From d0e5def3dabe4fc18fb1b4394945b6626840688b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 19:44:56 +0000 Subject: [PATCH 001/505] initial commit --- .devcontainer/Dockerfile | 9 + .devcontainer/devcontainer.json | 40 + .github/workflows/ci.yml | 53 + .gitignore | 16 + .python-version | 1 + .stats.yml | 2 + Brewfile | 2 + CONTRIBUTING.md | 129 ++ LICENSE | 201 ++ README.md | 326 ++- SECURITY.md | 27 + api.md | 412 ++++ bin/publish-pypi | 9 + examples/.keep | 4 + mypy.ini | 47 + noxfile.py | 9 + pyproject.toml | 208 ++ requirements-dev.lock | 102 + requirements.lock | 45 + scripts/bootstrap | 19 + scripts/format | 8 + scripts/lint | 12 + scripts/mock | 41 + scripts/test | 59 + scripts/utils/ruffen-docs.py | 167 ++ src/gitpod/__init__.py | 83 + src/gitpod/_base_client.py | 2041 +++++++++++++++++ src/gitpod/_client.py | 504 ++++ src/gitpod/_compat.py | 219 ++ src/gitpod/_constants.py | 14 + src/gitpod/_exceptions.py | 108 + src/gitpod/_files.py | 123 + src/gitpod/_models.py | 785 +++++++ src/gitpod/_qs.py | 150 ++ src/gitpod/_resource.py | 43 + src/gitpod/_response.py | 824 +++++++ src/gitpod/_streaming.py | 333 +++ src/gitpod/_types.py | 219 ++ src/gitpod/_utils/__init__.py | 55 + src/gitpod/_utils/_logs.py | 25 + src/gitpod/_utils/_proxy.py | 62 + src/gitpod/_utils/_reflection.py | 42 + src/gitpod/_utils/_streams.py | 12 + src/gitpod/_utils/_sync.py | 81 + src/gitpod/_utils/_transform.py | 382 +++ src/gitpod/_utils/_typing.py | 120 + src/gitpod/_utils/_utils.py | 397 ++++ src/gitpod/_version.py | 4 + src/gitpod/lib/.keep | 4 + src/gitpod/py.typed | 0 src/gitpod/resources/__init__.py | 201 ++ src/gitpod/resources/automations_files.py | 224 ++ .../resources/environment_automation.py | 209 ++ .../environment_automations/__init__.py | 47 + .../environment_automations.py | 134 ++ .../task_executions.py | 721 ++++++ .../environment_automations/tasks.py | 717 ++++++ src/gitpod/resources/environment_classes.py | 223 ++ src/gitpod/resources/environments.py | 711 ++++++ .../resources/organizations/__init__.py | 47 + .../organizations/invite/__init__.py | 33 + .../resources/organizations/invite/invite.py | 351 +++ .../resources/organizations/invite/summary.py | 202 ++ src/gitpod/resources/organizations/members.py | 222 ++ .../resources/organizations/organizations.py | 390 ++++ .../resources/personal_access_tokens.py | 326 +++ src/gitpod/resources/projects.py | 511 +++++ .../runner_configurations/__init__.py | 75 + .../configuration_schema.py | 343 +++ .../environment_classes.py | 327 +++ .../host_authentication_tokens.py | 791 +++++++ .../runner_configurations.py | 522 +++++ .../runner_configurations/scm_integration.py | 200 ++ src/gitpod/resources/runner_interaction.py | 1241 ++++++++++ .../resources/runner_interactions/__init__.py | 47 + .../runner_interactions/environment.py | 360 +++ .../runner_interactions/environments.py | 233 ++ .../runner_interactions.py | 530 +++++ src/gitpod/resources/runners/__init__.py | 33 + src/gitpod/resources/runners/policies.py | 222 ++ src/gitpod/resources/runners/runners.py | 1268 ++++++++++ src/gitpod/resources/services.py | 861 +++++++ src/gitpod/resources/tasks.py | 469 ++++ src/gitpod/types/__init__.py | 115 + .../types/automations_file_upsert_params.py | 92 + .../types/automations_file_upsert_response.py | 15 + ...ion_update_task_execution_status_params.py | 20 + .../types/environment_automations/__init__.py | 25 + .../task_create_list_params.py | 49 + .../task_create_list_response.py | 180 ++ .../task_delete_params.py | 19 + .../task_execution_create_list_params.py | 61 + .../task_execution_create_list_response.py | 452 ++++ .../task_execution_create_retrieve_params.py | 19 + ...task_execution_create_retrieve_response.py | 441 ++++ .../task_execution_list_params.py | 27 + .../task_execution_list_response.py | 452 ++++ .../task_execution_retrieve_params.py | 27 + .../task_execution_retrieve_response.py | 441 ++++ .../task_execution_stop_params.py | 19 + .../task_list_params.py | 27 + .../task_list_response.py | 180 ++ .../task_start_params.py | 19 + .../task_start_response.py | 441 ++++ .../task_update_params.py | 28 + .../types/environment_class_list_params.py | 37 + .../types/environment_class_list_response.py | 56 + .../environment_create_from_project_params.py | 222 ++ ...nvironment_create_from_project_response.py | 775 +++++++ src/gitpod/types/environment_create_params.py | 220 ++ .../types/environment_create_response.py | 775 +++++++ src/gitpod/types/environment_list_params.py | 80 + src/gitpod/types/environment_list_response.py | 787 +++++++ .../types/environment_retrieve_params.py | 20 + .../types/environment_retrieve_response.py | 775 +++++++ src/gitpod/types/environment_start_params.py | 20 + src/gitpod/types/organization_leave_params.py | 19 + .../types/organization_set_role_params.py | 23 + src/gitpod/types/organizations/__init__.py | 10 + .../types/organizations/invite/__init__.py | 6 + .../invite/summary_retrieve_params.py | 19 + .../invite/summary_retrieve_response.py | 17 + .../organizations/invite_create_params.py | 19 + .../organizations/invite_create_response.py | 21 + .../organizations/invite_retrieve_params.py | 19 + .../organizations/invite_retrieve_response.py | 21 + .../types/organizations/member_list_params.py | 37 + .../organizations/member_list_response.py | 137 ++ .../personal_access_token_delete_params.py | 19 + .../personal_access_token_list_params.py | 44 + .../personal_access_token_list_response.py | 328 +++ .../project_create_from_environment_params.py | 22 + ...roject_create_from_environment_response.py | 293 +++ src/gitpod/types/project_create_params.py | 41 + src/gitpod/types/project_create_response.py | 293 +++ src/gitpod/types/project_retrieve_params.py | 27 + src/gitpod/types/project_retrieve_response.py | 293 +++ ...er_check_authentication_for_host_params.py | 21 + ..._check_authentication_for_host_response.py | 17 + .../runner_configuration_validate_params.py | 43 + .../runner_configuration_validate_response.py | 8 + .../types/runner_configurations/__init__.py | 39 + .../configuration_schema_create_params.py | 19 + .../configuration_schema_create_response.py | 59 + .../configuration_schema_retrieve_params.py | 27 + .../configuration_schema_retrieve_response.py | 59 + .../environment_class_list_params.py | 37 + .../environment_class_list_response.py | 56 + .../environment_class_update_params.py | 20 + ...host_authentication_token_create_params.py | 19 + ...st_authentication_token_create_response.py | 32 + ...host_authentication_token_delete_params.py | 19 + .../host_authentication_token_list_params.py | 36 + ...host_authentication_token_list_response.py | 42 + ...st_authentication_token_retrieve_params.py | 27 + ..._authentication_token_retrieve_response.py | 32 + ...host_authentication_token_update_params.py | 33 + .../scm_integration_create_params.py | 20 + .../scm_integration_create_response.py | 12 + src/gitpod/types/runner_create_params.py | 62 + src/gitpod/types/runner_create_response.py | 414 ++++ .../runner_create_runner_token_params.py | 19 + .../runner_create_runner_token_response.py | 13 + .../types/runner_delete_runner_params.py | 27 + src/gitpod/types/runner_get_runner_params.py | 19 + .../types/runner_get_runner_response.py | 412 ++++ ..._host_authentication_token_value_params.py | 26 + ...ost_authentication_token_value_response.py | 20 + ...r_interaction_get_latest_version_params.py | 26 + ...interaction_get_latest_version_response.py | 26 + ..._list_runner_environment_classes_params.py | 48 + ...ist_runner_environment_classes_response.py | 62 + ...ion_list_runner_scm_integrations_params.py | 48 + ...n_list_runner_scm_integrations_response.py | 25 + .../runner_interaction_mark_active_params.py | 20 + ...runner_interaction_send_response_params.py | 81 + .../types/runner_interaction_signup_params.py | 60 + .../runner_interaction_signup_response.py | 14 + ...date_runner_configuration_schema_params.py | 76 + ...runner_interaction_update_status_params.py | 20 + .../types/runner_interactions/__init__.py | 9 + .../environment_list_params.py | 45 + .../environment_list_response.py | 389 ++++ .../environment_retrieve_params.py | 23 + .../environment_retrieve_response.py | 376 +++ .../environment_update_status_params.py | 415 ++++ src/gitpod/types/runner_list_params.py | 45 + src/gitpod/types/runner_list_response.py | 425 ++++ .../types/runner_parse_context_url_params.py | 21 + .../runner_parse_context_url_response.py | 31 + src/gitpod/types/runner_retrieve_params.py | 27 + src/gitpod/types/runner_retrieve_response.py | 412 ++++ .../types/runner_update_runner_params.py | 20 + src/gitpod/types/runners/__init__.py | 6 + .../types/runners/policy_list_params.py | 37 + .../types/runners/policy_list_response.py | 31 + src/gitpod/types/service_delete_params.py | 21 + .../types/service_list_create_params.py | 49 + .../types/service_list_create_response.py | 291 +++ src/gitpod/types/service_list_params.py | 27 + src/gitpod/types/service_list_response.py | 291 +++ src/gitpod/types/service_start_params.py | 19 + src/gitpod/types/service_stop_params.py | 19 + src/gitpod/types/service_update_params.py | 37 + src/gitpod/types/task_create_params.py | 167 ++ src/gitpod/types/task_create_response.py | 170 ++ .../types/task_retrieve_create_params.py | 19 + .../types/task_retrieve_create_response.py | 170 ++ src/gitpod/types/task_retrieve_params.py | 27 + src/gitpod/types/task_retrieve_response.py | 170 ++ tests/__init__.py | 1 + tests/api_resources/__init__.py | 1 + .../environment_automations/__init__.py | 1 + .../test_task_executions.py | 485 ++++ .../environment_automations/test_tasks.py | 480 ++++ tests/api_resources/organizations/__init__.py | 1 + .../organizations/invite/__init__.py | 1 + .../organizations/invite/test_summary.py | 102 + .../organizations/test_invite.py | 185 ++ .../organizations/test_members.py | 110 + .../runner_configurations/__init__.py | 1 + .../test_configuration_schema.py | 193 ++ .../test_environment_classes.py | 208 ++ .../test_host_authentication_tokens.py | 534 +++++ .../test_scm_integration.py | 122 + .../runner_interactions/__init__.py | 1 + .../runner_interactions/test_environment.py | 436 ++++ .../runner_interactions/test_environments.py | 120 + tests/api_resources/runners/__init__.py | 1 + tests/api_resources/runners/test_policies.py | 110 + tests/api_resources/test_automations_files.py | 148 ++ .../test_environment_automation.py | 149 ++ .../api_resources/test_environment_classes.py | 110 + tests/api_resources/test_environments.py | 701 ++++++ tests/api_resources/test_organizations.py | 185 ++ .../test_personal_access_tokens.py | 204 ++ tests/api_resources/test_projects.py | 296 +++ .../test_runner_configurations.py | 280 +++ .../api_resources/test_runner_interaction.py | 1105 +++++++++ .../api_resources/test_runner_interactions.py | 416 ++++ tests/api_resources/test_runners.py | 818 +++++++ tests/api_resources/test_services.py | 553 +++++ tests/api_resources/test_tasks.py | 309 +++ tests/conftest.py | 49 + tests/sample_file.txt | 1 + tests/test_client.py | 1510 ++++++++++++ tests/test_deepcopy.py | 58 + tests/test_extract_files.py | 64 + tests/test_files.py | 51 + tests/test_models.py | 829 +++++++ tests/test_qs.py | 78 + tests/test_required_args.py | 111 + tests/test_response.py | 277 +++ tests/test_streaming.py | 248 ++ tests/test_transform.py | 410 ++++ tests/test_utils/test_proxy.py | 23 + tests/test_utils/test_typing.py | 73 + tests/utils.py | 155 ++ 258 files changed, 48280 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 .python-version create mode 100644 .stats.yml create mode 100644 Brewfile create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 SECURITY.md create mode 100644 api.md create mode 100644 bin/publish-pypi create mode 100644 examples/.keep create mode 100644 mypy.ini create mode 100644 noxfile.py create mode 100644 pyproject.toml create mode 100644 requirements-dev.lock create mode 100644 requirements.lock create mode 100755 scripts/bootstrap create mode 100755 scripts/format create mode 100755 scripts/lint create mode 100755 scripts/mock create mode 100755 scripts/test create mode 100644 scripts/utils/ruffen-docs.py create mode 100644 src/gitpod/__init__.py create mode 100644 src/gitpod/_base_client.py create mode 100644 src/gitpod/_client.py create mode 100644 src/gitpod/_compat.py create mode 100644 src/gitpod/_constants.py create mode 100644 src/gitpod/_exceptions.py create mode 100644 src/gitpod/_files.py create mode 100644 src/gitpod/_models.py create mode 100644 src/gitpod/_qs.py create mode 100644 src/gitpod/_resource.py create mode 100644 src/gitpod/_response.py create mode 100644 src/gitpod/_streaming.py create mode 100644 src/gitpod/_types.py create mode 100644 src/gitpod/_utils/__init__.py create mode 100644 src/gitpod/_utils/_logs.py create mode 100644 src/gitpod/_utils/_proxy.py create mode 100644 src/gitpod/_utils/_reflection.py create mode 100644 src/gitpod/_utils/_streams.py create mode 100644 src/gitpod/_utils/_sync.py create mode 100644 src/gitpod/_utils/_transform.py create mode 100644 src/gitpod/_utils/_typing.py create mode 100644 src/gitpod/_utils/_utils.py create mode 100644 src/gitpod/_version.py create mode 100644 src/gitpod/lib/.keep create mode 100644 src/gitpod/py.typed create mode 100644 src/gitpod/resources/__init__.py create mode 100644 src/gitpod/resources/automations_files.py create mode 100644 src/gitpod/resources/environment_automation.py create mode 100644 src/gitpod/resources/environment_automations/__init__.py create mode 100644 src/gitpod/resources/environment_automations/environment_automations.py create mode 100644 src/gitpod/resources/environment_automations/task_executions.py create mode 100644 src/gitpod/resources/environment_automations/tasks.py create mode 100644 src/gitpod/resources/environment_classes.py create mode 100644 src/gitpod/resources/environments.py create mode 100644 src/gitpod/resources/organizations/__init__.py create mode 100644 src/gitpod/resources/organizations/invite/__init__.py create mode 100644 src/gitpod/resources/organizations/invite/invite.py create mode 100644 src/gitpod/resources/organizations/invite/summary.py create mode 100644 src/gitpod/resources/organizations/members.py create mode 100644 src/gitpod/resources/organizations/organizations.py create mode 100644 src/gitpod/resources/personal_access_tokens.py create mode 100644 src/gitpod/resources/projects.py create mode 100644 src/gitpod/resources/runner_configurations/__init__.py create mode 100644 src/gitpod/resources/runner_configurations/configuration_schema.py create mode 100644 src/gitpod/resources/runner_configurations/environment_classes.py create mode 100644 src/gitpod/resources/runner_configurations/host_authentication_tokens.py create mode 100644 src/gitpod/resources/runner_configurations/runner_configurations.py create mode 100644 src/gitpod/resources/runner_configurations/scm_integration.py create mode 100644 src/gitpod/resources/runner_interaction.py create mode 100644 src/gitpod/resources/runner_interactions/__init__.py create mode 100644 src/gitpod/resources/runner_interactions/environment.py create mode 100644 src/gitpod/resources/runner_interactions/environments.py create mode 100644 src/gitpod/resources/runner_interactions/runner_interactions.py create mode 100644 src/gitpod/resources/runners/__init__.py create mode 100644 src/gitpod/resources/runners/policies.py create mode 100644 src/gitpod/resources/runners/runners.py create mode 100644 src/gitpod/resources/services.py create mode 100644 src/gitpod/resources/tasks.py create mode 100644 src/gitpod/types/__init__.py create mode 100644 src/gitpod/types/automations_file_upsert_params.py create mode 100644 src/gitpod/types/automations_file_upsert_response.py create mode 100644 src/gitpod/types/environment_automation_update_task_execution_status_params.py create mode 100644 src/gitpod/types/environment_automations/__init__.py create mode 100644 src/gitpod/types/environment_automations/task_create_list_params.py create mode 100644 src/gitpod/types/environment_automations/task_create_list_response.py create mode 100644 src/gitpod/types/environment_automations/task_delete_params.py create mode 100644 src/gitpod/types/environment_automations/task_execution_create_list_params.py create mode 100644 src/gitpod/types/environment_automations/task_execution_create_list_response.py create mode 100644 src/gitpod/types/environment_automations/task_execution_create_retrieve_params.py create mode 100644 src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py create mode 100644 src/gitpod/types/environment_automations/task_execution_list_params.py create mode 100644 src/gitpod/types/environment_automations/task_execution_list_response.py create mode 100644 src/gitpod/types/environment_automations/task_execution_retrieve_params.py create mode 100644 src/gitpod/types/environment_automations/task_execution_retrieve_response.py create mode 100644 src/gitpod/types/environment_automations/task_execution_stop_params.py create mode 100644 src/gitpod/types/environment_automations/task_list_params.py create mode 100644 src/gitpod/types/environment_automations/task_list_response.py create mode 100644 src/gitpod/types/environment_automations/task_start_params.py create mode 100644 src/gitpod/types/environment_automations/task_start_response.py create mode 100644 src/gitpod/types/environment_automations/task_update_params.py create mode 100644 src/gitpod/types/environment_class_list_params.py create mode 100644 src/gitpod/types/environment_class_list_response.py create mode 100644 src/gitpod/types/environment_create_from_project_params.py create mode 100644 src/gitpod/types/environment_create_from_project_response.py create mode 100644 src/gitpod/types/environment_create_params.py create mode 100644 src/gitpod/types/environment_create_response.py create mode 100644 src/gitpod/types/environment_list_params.py create mode 100644 src/gitpod/types/environment_list_response.py create mode 100644 src/gitpod/types/environment_retrieve_params.py create mode 100644 src/gitpod/types/environment_retrieve_response.py create mode 100644 src/gitpod/types/environment_start_params.py create mode 100644 src/gitpod/types/organization_leave_params.py create mode 100644 src/gitpod/types/organization_set_role_params.py create mode 100644 src/gitpod/types/organizations/__init__.py create mode 100644 src/gitpod/types/organizations/invite/__init__.py create mode 100644 src/gitpod/types/organizations/invite/summary_retrieve_params.py create mode 100644 src/gitpod/types/organizations/invite/summary_retrieve_response.py create mode 100644 src/gitpod/types/organizations/invite_create_params.py create mode 100644 src/gitpod/types/organizations/invite_create_response.py create mode 100644 src/gitpod/types/organizations/invite_retrieve_params.py create mode 100644 src/gitpod/types/organizations/invite_retrieve_response.py create mode 100644 src/gitpod/types/organizations/member_list_params.py create mode 100644 src/gitpod/types/organizations/member_list_response.py create mode 100644 src/gitpod/types/personal_access_token_delete_params.py create mode 100644 src/gitpod/types/personal_access_token_list_params.py create mode 100644 src/gitpod/types/personal_access_token_list_response.py create mode 100644 src/gitpod/types/project_create_from_environment_params.py create mode 100644 src/gitpod/types/project_create_from_environment_response.py create mode 100644 src/gitpod/types/project_create_params.py create mode 100644 src/gitpod/types/project_create_response.py create mode 100644 src/gitpod/types/project_retrieve_params.py create mode 100644 src/gitpod/types/project_retrieve_response.py create mode 100644 src/gitpod/types/runner_check_authentication_for_host_params.py create mode 100644 src/gitpod/types/runner_check_authentication_for_host_response.py create mode 100644 src/gitpod/types/runner_configuration_validate_params.py create mode 100644 src/gitpod/types/runner_configuration_validate_response.py create mode 100644 src/gitpod/types/runner_configurations/__init__.py create mode 100644 src/gitpod/types/runner_configurations/configuration_schema_create_params.py create mode 100644 src/gitpod/types/runner_configurations/configuration_schema_create_response.py create mode 100644 src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py create mode 100644 src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py create mode 100644 src/gitpod/types/runner_configurations/environment_class_list_params.py create mode 100644 src/gitpod/types/runner_configurations/environment_class_list_response.py create mode 100644 src/gitpod/types/runner_configurations/environment_class_update_params.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_create_params.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_create_response.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_list_params.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_list_response.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_update_params.py create mode 100644 src/gitpod/types/runner_configurations/scm_integration_create_params.py create mode 100644 src/gitpod/types/runner_configurations/scm_integration_create_response.py create mode 100644 src/gitpod/types/runner_create_params.py create mode 100644 src/gitpod/types/runner_create_response.py create mode 100644 src/gitpod/types/runner_create_runner_token_params.py create mode 100644 src/gitpod/types/runner_create_runner_token_response.py create mode 100644 src/gitpod/types/runner_delete_runner_params.py create mode 100644 src/gitpod/types/runner_get_runner_params.py create mode 100644 src/gitpod/types/runner_get_runner_response.py create mode 100644 src/gitpod/types/runner_interaction_get_host_authentication_token_value_params.py create mode 100644 src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py create mode 100644 src/gitpod/types/runner_interaction_get_latest_version_params.py create mode 100644 src/gitpod/types/runner_interaction_get_latest_version_response.py create mode 100644 src/gitpod/types/runner_interaction_list_runner_environment_classes_params.py create mode 100644 src/gitpod/types/runner_interaction_list_runner_environment_classes_response.py create mode 100644 src/gitpod/types/runner_interaction_list_runner_scm_integrations_params.py create mode 100644 src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py create mode 100644 src/gitpod/types/runner_interaction_mark_active_params.py create mode 100644 src/gitpod/types/runner_interaction_send_response_params.py create mode 100644 src/gitpod/types/runner_interaction_signup_params.py create mode 100644 src/gitpod/types/runner_interaction_signup_response.py create mode 100644 src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py create mode 100644 src/gitpod/types/runner_interaction_update_status_params.py create mode 100644 src/gitpod/types/runner_interactions/__init__.py create mode 100644 src/gitpod/types/runner_interactions/environment_list_params.py create mode 100644 src/gitpod/types/runner_interactions/environment_list_response.py create mode 100644 src/gitpod/types/runner_interactions/environment_retrieve_params.py create mode 100644 src/gitpod/types/runner_interactions/environment_retrieve_response.py create mode 100644 src/gitpod/types/runner_interactions/environment_update_status_params.py create mode 100644 src/gitpod/types/runner_list_params.py create mode 100644 src/gitpod/types/runner_list_response.py create mode 100644 src/gitpod/types/runner_parse_context_url_params.py create mode 100644 src/gitpod/types/runner_parse_context_url_response.py create mode 100644 src/gitpod/types/runner_retrieve_params.py create mode 100644 src/gitpod/types/runner_retrieve_response.py create mode 100644 src/gitpod/types/runner_update_runner_params.py create mode 100644 src/gitpod/types/runners/__init__.py create mode 100644 src/gitpod/types/runners/policy_list_params.py create mode 100644 src/gitpod/types/runners/policy_list_response.py create mode 100644 src/gitpod/types/service_delete_params.py create mode 100644 src/gitpod/types/service_list_create_params.py create mode 100644 src/gitpod/types/service_list_create_response.py create mode 100644 src/gitpod/types/service_list_params.py create mode 100644 src/gitpod/types/service_list_response.py create mode 100644 src/gitpod/types/service_start_params.py create mode 100644 src/gitpod/types/service_stop_params.py create mode 100644 src/gitpod/types/service_update_params.py create mode 100644 src/gitpod/types/task_create_params.py create mode 100644 src/gitpod/types/task_create_response.py create mode 100644 src/gitpod/types/task_retrieve_create_params.py create mode 100644 src/gitpod/types/task_retrieve_create_response.py create mode 100644 src/gitpod/types/task_retrieve_params.py create mode 100644 src/gitpod/types/task_retrieve_response.py create mode 100644 tests/__init__.py create mode 100644 tests/api_resources/__init__.py create mode 100644 tests/api_resources/environment_automations/__init__.py create mode 100644 tests/api_resources/environment_automations/test_task_executions.py create mode 100644 tests/api_resources/environment_automations/test_tasks.py create mode 100644 tests/api_resources/organizations/__init__.py create mode 100644 tests/api_resources/organizations/invite/__init__.py create mode 100644 tests/api_resources/organizations/invite/test_summary.py create mode 100644 tests/api_resources/organizations/test_invite.py create mode 100644 tests/api_resources/organizations/test_members.py create mode 100644 tests/api_resources/runner_configurations/__init__.py create mode 100644 tests/api_resources/runner_configurations/test_configuration_schema.py create mode 100644 tests/api_resources/runner_configurations/test_environment_classes.py create mode 100644 tests/api_resources/runner_configurations/test_host_authentication_tokens.py create mode 100644 tests/api_resources/runner_configurations/test_scm_integration.py create mode 100644 tests/api_resources/runner_interactions/__init__.py create mode 100644 tests/api_resources/runner_interactions/test_environment.py create mode 100644 tests/api_resources/runner_interactions/test_environments.py create mode 100644 tests/api_resources/runners/__init__.py create mode 100644 tests/api_resources/runners/test_policies.py create mode 100644 tests/api_resources/test_automations_files.py create mode 100644 tests/api_resources/test_environment_automation.py create mode 100644 tests/api_resources/test_environment_classes.py create mode 100644 tests/api_resources/test_environments.py create mode 100644 tests/api_resources/test_organizations.py create mode 100644 tests/api_resources/test_personal_access_tokens.py create mode 100644 tests/api_resources/test_projects.py create mode 100644 tests/api_resources/test_runner_configurations.py create mode 100644 tests/api_resources/test_runner_interaction.py create mode 100644 tests/api_resources/test_runner_interactions.py create mode 100644 tests/api_resources/test_runners.py create mode 100644 tests/api_resources/test_services.py create mode 100644 tests/api_resources/test_tasks.py create mode 100644 tests/conftest.py create mode 100644 tests/sample_file.txt create mode 100644 tests/test_client.py create mode 100644 tests/test_deepcopy.py create mode 100644 tests/test_extract_files.py create mode 100644 tests/test_files.py create mode 100644 tests/test_models.py create mode 100644 tests/test_qs.py create mode 100644 tests/test_required_args.py create mode 100644 tests/test_response.py create mode 100644 tests/test_streaming.py create mode 100644 tests/test_transform.py create mode 100644 tests/test_utils/test_proxy.py create mode 100644 tests/test_utils/test_typing.py create mode 100644 tests/utils.py diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..ac9a2e75 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,9 @@ +ARG VARIANT="3.9" +FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} + +USER vscode + +RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash +ENV PATH=/home/vscode/.rye/shims:$PATH + +RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..bbeb30b1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,40 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/debian +{ + "name": "Debian", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + + "postStartCommand": "rye sync --all-features", + + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python" + ], + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "python.pythonPath": ".venv/bin/python", + "python.defaultInterpreterPath": ".venv/bin/python", + "python.typeChecking": "basic", + "terminal.integrated.env.linux": { + "PATH": "/home/vscode/.rye/shims:${env:PATH}" + } + } + } + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..40293964 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI +on: + push: + branches: + - main + pull_request: + branches: + - main + - next + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + + + steps: + - uses: actions/checkout@v4 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.35.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Install dependencies + run: rye sync --all-features + + - name: Run lints + run: ./scripts/lint + test: + name: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.35.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Bootstrap + run: ./scripts/bootstrap + + - name: Run tests + run: ./scripts/test + diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..87797408 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +.prism.log +.vscode +_dev + +__pycache__ +.mypy_cache + +dist + +.venv +.idea + +.env +.envrc +codegen.log +Brewfile.lock.json diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..43077b24 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.9.18 diff --git a/.stats.yml b/.stats.yml new file mode 100644 index 00000000..7728de32 --- /dev/null +++ b/.stats.yml @@ -0,0 +1,2 @@ +configured_endpoints: 71 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e382faa61767fc46a2a12e401bc7504f3b8925829c6ecaea5b2553281a5c4e7a.yml diff --git a/Brewfile b/Brewfile new file mode 100644 index 00000000..492ca37b --- /dev/null +++ b/Brewfile @@ -0,0 +1,2 @@ +brew "rye" + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..42c71aa0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,129 @@ +## Setting up the environment + +### With Rye + +We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run: + +```sh +$ ./scripts/bootstrap +``` + +Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run: + +```sh +$ rye sync --all-features +``` + +You can then run scripts using `rye run python script.py` or by activating the virtual environment: + +```sh +$ rye shell +# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work +$ source .venv/bin/activate + +# now you can omit the `rye run` prefix +$ python script.py +``` + +### Without Rye + +Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command: + +```sh +$ pip install -r requirements-dev.lock +``` + +## Modifying/Adding code + +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may +result in merge conflicts between manual patches and changes from the generator. The generator will never +modify the contents of the `src/gitpod/lib/` and `examples/` directories. + +## Adding and running examples + +All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. + +```py +# add an example to examples/.py + +#!/usr/bin/env -S rye run python +… +``` + +```sh +$ chmod +x examples/.py +# run the example against your api +$ ./examples/.py +``` + +## Using the repository from source + +If you’d like to use the repository from source, you can either install from git or link to a cloned repository: + +To install via git: + +```sh +$ pip install git+ssh://git@github.com/stainless-sdks/gitpod-python.git +``` + +Alternatively, you can build from source and install the wheel file: + +Building this package will create two files in the `dist/` directory, a `.tar.gz` containing the source files and a `.whl` that can be used to install the package efficiently. + +To create a distributable version of the library, all you have to do is run this command: + +```sh +$ rye build +# or +$ python -m build +``` + +Then to install: + +```sh +$ pip install ./path-to-wheel-file.whl +``` + +## Running tests + +Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. + +```sh +# you will need npm installed +$ npx prism mock path/to/your/openapi.yml +``` + +```sh +$ ./scripts/test +``` + +## Linting and formatting + +This repository uses [ruff](https://github.com/astral-sh/ruff) and +[black](https://github.com/psf/black) to format the code in the repository. + +To lint: + +```sh +$ ./scripts/lint +``` + +To format and fix all ruff issues automatically: + +```sh +$ ./scripts/format +``` + +## Publishing and releases + +Changes made to this repository via the automated release PR pipeline should publish to PyPI automatically. If +the changes aren't made through the automated pipeline, you may want to make releases manually. + +### Publish with a GitHub workflow + +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/gitpod-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. + +### Publish manually + +If you need to manually release a package, you can run the `bin/publish-pypi` script with a `PYPI_TOKEN` set on +the environment. diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..4d4c7f9c --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Gitpod + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index c2b730a2..767efa32 100644 --- a/README.md +++ b/README.md @@ -1 +1,325 @@ -# gitpod-python \ No newline at end of file +# Gitpod Python API library + +[![PyPI version](https://img.shields.io/pypi/v/gitpod.svg)](https://pypi.org/project/gitpod/) + +The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.7+ +application. The library includes type definitions for all request params and response fields, +and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx). + +It is generated with [Stainless](https://www.stainlessapi.com/). + +## Documentation + +The REST API documentation can be found on [docs.gitpod.com](https://docs.gitpod.com). The full API of this library can be found in [api.md](api.md). + +## Installation + +```sh +# install from this staging repo +pip install git+ssh://git@github.com/stainless-sdks/gitpod-python.git +``` + +> [!NOTE] +> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre gitpod` + +## Usage + +The full API of this library can be found in [api.md](api.md). + +```python +from gitpod import Gitpod + +client = Gitpod() + +runner = client.runners.create( + connect_protocol_version=1, +) +print(runner.access_token) +``` + +## Async usage + +Simply import `AsyncGitpod` instead of `Gitpod` and use `await` with each API call: + +```python +import asyncio +from gitpod import AsyncGitpod + +client = AsyncGitpod() + + +async def main() -> None: + runner = await client.runners.create( + connect_protocol_version=1, + ) + print(runner.access_token) + + +asyncio.run(main()) +``` + +Functionality between the synchronous and asynchronous clients is otherwise identical. + +## Using types + +Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like: + +- Serializing back into JSON, `model.to_json()` +- Converting to a dictionary, `model.to_dict()` + +Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`. + +## Handling errors + +When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `gitpod.APIConnectionError` is raised. + +When the API returns a non-success status code (that is, 4xx or 5xx +response), a subclass of `gitpod.APIStatusError` is raised, containing `status_code` and `response` properties. + +All errors inherit from `gitpod.APIError`. + +```python +import gitpod +from gitpod import Gitpod + +client = Gitpod() + +try: + client.runners.create( + connect_protocol_version=1, + ) +except gitpod.APIConnectionError as e: + print("The server could not be reached") + print(e.__cause__) # an underlying Exception, likely raised within httpx. +except gitpod.RateLimitError as e: + print("A 429 status code was received; we should back off a bit.") +except gitpod.APIStatusError as e: + print("Another non-200-range status code was received") + print(e.status_code) + print(e.response) +``` + +Error codes are as followed: + +| Status Code | Error Type | +| ----------- | -------------------------- | +| 400 | `BadRequestError` | +| 401 | `AuthenticationError` | +| 403 | `PermissionDeniedError` | +| 404 | `NotFoundError` | +| 422 | `UnprocessableEntityError` | +| 429 | `RateLimitError` | +| >=500 | `InternalServerError` | +| N/A | `APIConnectionError` | + +### Retries + +Certain errors are automatically retried 2 times by default, with a short exponential backoff. +Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, +429 Rate Limit, and >=500 Internal errors are all retried by default. + +You can use the `max_retries` option to configure or disable retry settings: + +```python +from gitpod import Gitpod + +# Configure the default for all requests: +client = Gitpod( + # default is 2 + max_retries=0, +) + +# Or, configure per-request: +client.with_options(max_retries=5).runners.create( + connect_protocol_version=1, +) +``` + +### Timeouts + +By default requests time out after 1 minute. You can configure this with a `timeout` option, +which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: + +```python +from gitpod import Gitpod + +# Configure the default for all requests: +client = Gitpod( + # 20 seconds (default is 1 minute) + timeout=20.0, +) + +# More granular control: +client = Gitpod( + timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), +) + +# Override per-request: +client.with_options(timeout=5.0).runners.create( + connect_protocol_version=1, +) +``` + +On timeout, an `APITimeoutError` is thrown. + +Note that requests that time out are [retried twice by default](#retries). + +## Advanced + +### Logging + +We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module. + +You can enable logging by setting the environment variable `GITPOD_LOG` to `debug`. + +```shell +$ export GITPOD_LOG=debug +``` + +### How to tell whether `None` means `null` or missing + +In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`: + +```py +if response.my_field is None: + if 'my_field' not in response.model_fields_set: + print('Got json like {}, without a "my_field" key present at all.') + else: + print('Got json like {"my_field": null}.') +``` + +### Accessing raw response data (e.g. headers) + +The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g., + +```py +from gitpod import Gitpod + +client = Gitpod() +response = client.runners.with_raw_response.create( + connect_protocol_version=1, +) +print(response.headers.get('X-My-Header')) + +runner = response.parse() # get the object that `runners.create()` would have returned +print(runner.access_token) +``` + +These methods return an [`APIResponse`](https://github.com/stainless-sdks/gitpod-python/tree/main/src/gitpod/_response.py) object. + +The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/gitpod-python/tree/main/src/gitpod/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. + +#### `.with_streaming_response` + +The above interface eagerly reads the full response body when you make the request, which may not always be what you want. + +To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. + +```python +with client.runners.with_streaming_response.create( + connect_protocol_version=1, +) as response: + print(response.headers.get("X-My-Header")) + + for line in response.iter_lines(): + print(line) +``` + +The context manager is required so that the response will reliably be closed. + +### Making custom/undocumented requests + +This library is typed for convenient access to the documented API. + +If you need to access undocumented endpoints, params, or response properties, the library can still be used. + +#### Undocumented endpoints + +To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other +http verbs. Options on the client will be respected (such as retries) will be respected when making this +request. + +```py +import httpx + +response = client.post( + "/foo", + cast_to=httpx.Response, + body={"my_param": True}, +) + +print(response.headers.get("x-foo")) +``` + +#### Undocumented request params + +If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request +options. + +#### Undocumented response properties + +To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You +can also get all the extra fields on the Pydantic model as a dict with +[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra). + +### Configuring the HTTP client + +You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including: + +- Support for proxies +- Custom transports +- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality + +```python +from gitpod import Gitpod, DefaultHttpxClient + +client = Gitpod( + # Or use the `GITPOD_BASE_URL` env var + base_url="http://my.test.server.example.com:8083", + http_client=DefaultHttpxClient( + proxies="http://my.test.proxy.example.com", + transport=httpx.HTTPTransport(local_address="0.0.0.0"), + ), +) +``` + +You can also customize the client on a per-request basis by using `with_options()`: + +```python +client.with_options(http_client=DefaultHttpxClient(...)) +``` + +### Managing HTTP resources + +By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. + +## Versioning + +This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: + +1. Changes that only affect static types, without breaking runtime behavior. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +3. Changes that we do not expect to impact the vast majority of users in practice. + +We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. + +We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/gitpod-python/issues) with questions, bugs, or suggestions. + +### Determining the installed version + +If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version. + +You can determine the version that is being used at runtime with: + +```py +import gitpod +print(gitpod.__version__) +``` + +## Requirements + +Python 3.7 or higher. + +## Contributing + +See [the contributing documentation](./CONTRIBUTING.md). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..0985c82e --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainlessapi.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Gitpod please follow the respective company's security reporting guidelines. + +### Gitpod Terms and Policies + +Please contact dev-feedback@gitpod.com for any questions or concerns regarding security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/api.md b/api.md new file mode 100644 index 00000000..b202ebb3 --- /dev/null +++ b/api.md @@ -0,0 +1,412 @@ +# Services + +Types: + +```python +from gitpod.types import ( + ServiceUpdateResponse, + ServiceListResponse, + ServiceDeleteResponse, + ServiceListCreateResponse, + ServiceStartResponse, + ServiceStopResponse, +) +``` + +Methods: + +- client.services.update(\*\*params) -> object +- client.services.list(\*\*params) -> ServiceListResponse +- client.services.delete(\*\*params) -> object +- client.services.list_create(\*\*params) -> ServiceListCreateResponse +- client.services.start(\*\*params) -> object +- client.services.stop(\*\*params) -> object + +# AutomationsFiles + +Types: + +```python +from gitpod.types import AutomationsFileUpsertResponse +``` + +Methods: + +- client.automations_files.upsert(\*\*params) -> AutomationsFileUpsertResponse + +# Tasks + +Types: + +```python +from gitpod.types import TaskCreateResponse, TaskRetrieveResponse, TaskRetrieveCreateResponse +``` + +Methods: + +- client.tasks.create(\*\*params) -> TaskCreateResponse +- client.tasks.retrieve(\*\*params) -> TaskRetrieveResponse +- client.tasks.retrieve_create(\*\*params) -> TaskRetrieveCreateResponse + +# EnvironmentAutomations + +## Tasks + +Types: + +```python +from gitpod.types.environment_automations import ( + TaskUpdateResponse, + TaskListResponse, + TaskDeleteResponse, + TaskCreateListResponse, + TaskStartResponse, +) +``` + +Methods: + +- client.environment_automations.tasks.update(\*\*params) -> object +- client.environment_automations.tasks.list(\*\*params) -> TaskListResponse +- client.environment_automations.tasks.delete(\*\*params) -> object +- client.environment_automations.tasks.create_list(\*\*params) -> TaskCreateListResponse +- client.environment_automations.tasks.start(\*\*params) -> TaskStartResponse + +## TaskExecutions + +Types: + +```python +from gitpod.types.environment_automations import ( + TaskExecutionRetrieveResponse, + TaskExecutionListResponse, + TaskExecutionCreateListResponse, + TaskExecutionCreateRetrieveResponse, + TaskExecutionStopResponse, +) +``` + +Methods: + +- client.environment_automations.task_executions.retrieve(\*\*params) -> TaskExecutionRetrieveResponse +- client.environment_automations.task_executions.list(\*\*params) -> TaskExecutionListResponse +- client.environment_automations.task_executions.create_list(\*\*params) -> TaskExecutionCreateListResponse +- client.environment_automations.task_executions.create_retrieve(\*\*params) -> TaskExecutionCreateRetrieveResponse +- client.environment_automations.task_executions.stop(\*\*params) -> object + +# EnvironmentAutomation + +Types: + +```python +from gitpod.types import EnvironmentAutomationUpdateTaskExecutionStatusResponse +``` + +Methods: + +- client.environment_automation.update_task_execution_status(\*\*params) -> object + +# Environments + +Types: + +```python +from gitpod.types import ( + EnvironmentCreateResponse, + EnvironmentRetrieveResponse, + EnvironmentListResponse, + EnvironmentCreateFromProjectResponse, + EnvironmentStartResponse, +) +``` + +Methods: + +- client.environments.create(\*\*params) -> EnvironmentCreateResponse +- client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse +- client.environments.list(\*\*params) -> EnvironmentListResponse +- client.environments.create_from_project(\*\*params) -> EnvironmentCreateFromProjectResponse +- client.environments.start(\*\*params) -> object + +# EnvironmentClasses + +Types: + +```python +from gitpod.types import EnvironmentClassListResponse +``` + +Methods: + +- client.environment_classes.list(\*\*params) -> EnvironmentClassListResponse + +# Organizations + +Types: + +```python +from gitpod.types import OrganizationLeaveResponse, OrganizationSetRoleResponse +``` + +Methods: + +- client.organizations.leave(\*\*params) -> object +- client.organizations.set_role(\*\*params) -> object + +## Members + +Types: + +```python +from gitpod.types.organizations import MemberListResponse +``` + +Methods: + +- client.organizations.members.list(\*\*params) -> MemberListResponse + +## Invite + +Types: + +```python +from gitpod.types.organizations import InviteCreateResponse, InviteRetrieveResponse +``` + +Methods: + +- client.organizations.invite.create(\*\*params) -> InviteCreateResponse +- client.organizations.invite.retrieve(\*\*params) -> InviteRetrieveResponse + +### Summary + +Types: + +```python +from gitpod.types.organizations.invite import SummaryRetrieveResponse +``` + +Methods: + +- client.organizations.invite.summary.retrieve(\*\*params) -> SummaryRetrieveResponse + +# Projects + +Types: + +```python +from gitpod.types import ( + ProjectCreateResponse, + ProjectRetrieveResponse, + ProjectCreateFromEnvironmentResponse, +) +``` + +Methods: + +- client.projects.create(\*\*params) -> ProjectCreateResponse +- client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse +- client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse + +# RunnerConfigurations + +Types: + +```python +from gitpod.types import RunnerConfigurationValidateResponse +``` + +Methods: + +- client.runner_configurations.validate(\*\*params) -> RunnerConfigurationValidateResponse + +## HostAuthenticationTokens + +Types: + +```python +from gitpod.types.runner_configurations import ( + HostAuthenticationTokenCreateResponse, + HostAuthenticationTokenRetrieveResponse, + HostAuthenticationTokenUpdateResponse, + HostAuthenticationTokenListResponse, + HostAuthenticationTokenDeleteResponse, +) +``` + +Methods: + +- client.runner_configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse +- client.runner_configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse +- client.runner_configurations.host_authentication_tokens.update(\*\*params) -> object +- client.runner_configurations.host_authentication_tokens.list(\*\*params) -> HostAuthenticationTokenListResponse +- client.runner_configurations.host_authentication_tokens.delete(\*\*params) -> object + +## ConfigurationSchema + +Types: + +```python +from gitpod.types.runner_configurations import ( + ConfigurationSchemaCreateResponse, + ConfigurationSchemaRetrieveResponse, +) +``` + +Methods: + +- client.runner_configurations.configuration_schema.create(\*\*params) -> ConfigurationSchemaCreateResponse +- client.runner_configurations.configuration_schema.retrieve(\*\*params) -> ConfigurationSchemaRetrieveResponse + +## ScmIntegration + +Types: + +```python +from gitpod.types.runner_configurations import ScmIntegrationCreateResponse +``` + +Methods: + +- client.runner_configurations.scm_integration.create(\*\*params) -> ScmIntegrationCreateResponse + +## EnvironmentClasses + +Types: + +```python +from gitpod.types.runner_configurations import ( + EnvironmentClassUpdateResponse, + EnvironmentClassListResponse, +) +``` + +Methods: + +- client.runner_configurations.environment_classes.update(\*\*params) -> object +- client.runner_configurations.environment_classes.list(\*\*params) -> EnvironmentClassListResponse + +# RunnerInteractions + +Types: + +```python +from gitpod.types import ( + RunnerInteractionMarkActiveResponse, + RunnerInteractionSignupResponse, + RunnerInteractionUpdateStatusResponse, +) +``` + +Methods: + +- client.runner_interactions.mark_active(\*\*params) -> object +- client.runner_interactions.signup(\*\*params) -> RunnerInteractionSignupResponse +- client.runner_interactions.update_status(\*\*params) -> object + +## Environment + +Types: + +```python +from gitpod.types.runner_interactions import ( + EnvironmentRetrieveResponse, + EnvironmentUpdateStatusResponse, +) +``` + +Methods: + +- client.runner_interactions.environment.retrieve(\*\*params) -> EnvironmentRetrieveResponse +- client.runner_interactions.environment.update_status(\*\*params) -> object + +## Environments + +Types: + +```python +from gitpod.types.runner_interactions import EnvironmentListResponse +``` + +Methods: + +- client.runner_interactions.environments.list(\*\*params) -> EnvironmentListResponse + +# RunnerInteraction + +Types: + +```python +from gitpod.types import ( + RunnerInteractionGetHostAuthenticationTokenValueResponse, + RunnerInteractionGetLatestVersionResponse, + RunnerInteractionListRunnerEnvironmentClassesResponse, + RunnerInteractionListRunnerScmIntegrationsResponse, + RunnerInteractionSendResponseResponse, + RunnerInteractionUpdateRunnerConfigurationSchemaResponse, +) +``` + +Methods: + +- client.runner_interaction.get_host_authentication_token_value(\*\*params) -> RunnerInteractionGetHostAuthenticationTokenValueResponse +- client.runner_interaction.get_latest_version(\*\*params) -> RunnerInteractionGetLatestVersionResponse +- client.runner_interaction.list_runner_environment_classes(\*\*params) -> RunnerInteractionListRunnerEnvironmentClassesResponse +- client.runner_interaction.list_runner_scm_integrations(\*\*params) -> RunnerInteractionListRunnerScmIntegrationsResponse +- client.runner_interaction.send_response(\*\*params) -> object +- client.runner_interaction.update_runner_configuration_schema(\*\*params) -> object + +# Runners + +Types: + +```python +from gitpod.types import ( + RunnerCreateResponse, + RunnerRetrieveResponse, + RunnerListResponse, + RunnerCheckAuthenticationForHostResponse, + RunnerCreateRunnerTokenResponse, + RunnerDeleteRunnerResponse, + RunnerGetRunnerResponse, + RunnerParseContextURLResponse, + RunnerUpdateRunnerResponse, +) +``` + +Methods: + +- client.runners.create(\*\*params) -> RunnerCreateResponse +- client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse +- client.runners.list(\*\*params) -> RunnerListResponse +- client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse +- client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse +- client.runners.delete_runner(\*\*params) -> object +- client.runners.get_runner(\*\*params) -> RunnerGetRunnerResponse +- client.runners.parse_context_url(\*\*params) -> RunnerParseContextURLResponse +- client.runners.update_runner(\*\*params) -> object + +## Policies + +Types: + +```python +from gitpod.types.runners import PolicyListResponse +``` + +Methods: + +- client.runners.policies.list(\*\*params) -> PolicyListResponse + +# PersonalAccessTokens + +Types: + +```python +from gitpod.types import PersonalAccessTokenListResponse, PersonalAccessTokenDeleteResponse +``` + +Methods: + +- client.personal_access_tokens.list(\*\*params) -> PersonalAccessTokenListResponse +- client.personal_access_tokens.delete(\*\*params) -> object diff --git a/bin/publish-pypi b/bin/publish-pypi new file mode 100644 index 00000000..05bfccbb --- /dev/null +++ b/bin/publish-pypi @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -eux +mkdir -p dist +rye build --clean +# Patching importlib-metadata version until upstream library version is updated +# https://github.com/pypa/twine/issues/977#issuecomment-2189800841 +"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1' +rye publish --yes --token=$PYPI_TOKEN diff --git a/examples/.keep b/examples/.keep new file mode 100644 index 00000000..d8c73e93 --- /dev/null +++ b/examples/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store example files demonstrating usage of this SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 00000000..333d91d4 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,47 @@ +[mypy] +pretty = True +show_error_codes = True + +# Exclude _files.py because mypy isn't smart enough to apply +# the correct type narrowing and as this is an internal module +# it's fine to just use Pyright. +exclude = ^(src/gitpod/_files\.py|_dev/.*\.py)$ + +strict_equality = True +implicit_reexport = True +check_untyped_defs = True +no_implicit_optional = True + +warn_return_any = True +warn_unreachable = True +warn_unused_configs = True + +# Turn these options off as it could cause conflicts +# with the Pyright options. +warn_unused_ignores = False +warn_redundant_casts = False + +disallow_any_generics = True +disallow_untyped_defs = True +disallow_untyped_calls = True +disallow_subclassing_any = True +disallow_incomplete_defs = True +disallow_untyped_decorators = True +cache_fine_grained = True + +# By default, mypy reports an error if you assign a value to the result +# of a function call that doesn't return anything. We do this in our test +# cases: +# ``` +# result = ... +# assert result is None +# ``` +# Changing this codegen to make mypy happy would increase complexity +# and would not be worth it. +disable_error_code = func-returns-value + +# https://github.com/python/mypy/issues/12162 +[mypy.overrides] +module = "black.files.*" +ignore_errors = true +ignore_missing_imports = true diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 00000000..53bca7ff --- /dev/null +++ b/noxfile.py @@ -0,0 +1,9 @@ +import nox + + +@nox.session(reuse_venv=True, name="test-pydantic-v1") +def test_pydantic_v1(session: nox.Session) -> None: + session.install("-r", "requirements-dev.lock") + session.install("pydantic<2") + + session.run("pytest", "--showlocals", "--ignore=tests/functional", *session.posargs) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..e01fa1d1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,208 @@ +[project] +name = "gitpod" +version = "0.0.1-alpha.0" +description = "The official Python library for the gitpod API" +dynamic = ["readme"] +license = "Apache-2.0" +authors = [ +{ name = "Gitpod", email = "dev-feedback@gitpod.com" }, +] +dependencies = [ + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.7, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", + "cached-property; python_version < '3.8'", +] +requires-python = ">= 3.7" +classifiers = [ + "Typing :: Typed", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Topic :: Software Development :: Libraries :: Python Modules", + "License :: OSI Approved :: Apache Software License" +] + +[project.urls] +Homepage = "https://github.com/stainless-sdks/gitpod-python" +Repository = "https://github.com/stainless-sdks/gitpod-python" + + + +[tool.rye] +managed = true +# version pins are in requirements-dev.lock +dev-dependencies = [ + "pyright>=1.1.359", + "mypy", + "respx", + "pytest", + "pytest-asyncio", + "ruff", + "time-machine", + "nox", + "dirty-equals>=0.6.0", + "importlib-metadata>=6.7.0", + "rich>=13.7.1", +] + +[tool.rye.scripts] +format = { chain = [ + "format:ruff", + "format:docs", + "fix:ruff", + # run formatting again to fix any inconsistencies when imports are stripped + "format:ruff", +]} +"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" +"format:ruff" = "ruff format" + +"lint" = { chain = [ + "check:ruff", + "typecheck", + "check:importable", +]} +"check:ruff" = "ruff check ." +"fix:ruff" = "ruff check --fix ." + +"check:importable" = "python -c 'import gitpod'" + +typecheck = { chain = [ + "typecheck:pyright", + "typecheck:mypy" +]} +"typecheck:pyright" = "pyright" +"typecheck:verify-types" = "pyright --verifytypes gitpod --ignoreexternal" +"typecheck:mypy" = "mypy ." + +[build-system] +requires = ["hatchling", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" + +[tool.hatch.build] +include = [ + "src/*" +] + +[tool.hatch.build.targets.wheel] +packages = ["src/gitpod"] + +[tool.hatch.build.targets.sdist] +# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc) +include = [ + "/*.toml", + "/*.json", + "/*.lock", + "/*.md", + "/mypy.ini", + "/noxfile.py", + "bin/*", + "examples/*", + "src/*", + "tests/*", +] + +[tool.hatch.metadata.hooks.fancy-pypi-readme] +content-type = "text/markdown" + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]] +path = "README.md" + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] +# replace relative links with absolute links +pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' +replacement = '[\1](https://github.com/stainless-sdks/gitpod-python/tree/main/\g<2>)' + +[tool.pytest.ini_options] +testpaths = ["tests"] +addopts = "--tb=short" +xfail_strict = true +asyncio_mode = "auto" +filterwarnings = [ + "error" +] + +[tool.pyright] +# this enables practically every flag given by pyright. +# there are a couple of flags that are still disabled by +# default in strict mode as they are experimental and niche. +typeCheckingMode = "strict" +pythonVersion = "3.7" + +exclude = [ + "_dev", + ".venv", + ".nox", +] + +reportImplicitOverride = true + +reportImportCycles = false +reportPrivateUsage = false + + +[tool.ruff] +line-length = 120 +output-format = "grouped" +target-version = "py37" + +[tool.ruff.format] +docstring-code-format = true + +[tool.ruff.lint] +select = [ + # isort + "I", + # bugbear rules + "B", + # remove unused imports + "F401", + # bare except statements + "E722", + # unused arguments + "ARG", + # print statements + "T201", + "T203", + # misuse of typing.TYPE_CHECKING + "TCH004", + # import rules + "TID251", +] +ignore = [ + # mutable defaults + "B006", +] +unfixable = [ + # disable auto fix for print statements + "T201", + "T203", +] + +[tool.ruff.lint.flake8-tidy-imports.banned-api] +"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" + +[tool.ruff.lint.isort] +length-sort = true +length-sort-straight = true +combine-as-imports = true +extra-standard-library = ["typing_extensions"] +known-first-party = ["gitpod", "tests"] + +[tool.ruff.lint.per-file-ignores] +"bin/**.py" = ["T201", "T203"] +"scripts/**.py" = ["T201", "T203"] +"tests/**.py" = ["T201", "T203"] +"examples/**.py" = ["T201", "T203"] diff --git a/requirements-dev.lock b/requirements-dev.lock new file mode 100644 index 00000000..f2da231c --- /dev/null +++ b/requirements-dev.lock @@ -0,0 +1,102 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: true +# with-sources: false +# generate-hashes: false + +-e file:. +annotated-types==0.6.0 + # via pydantic +anyio==4.4.0 + # via gitpod + # via httpx +argcomplete==3.1.2 + # via nox +certifi==2023.7.22 + # via httpcore + # via httpx +colorlog==6.7.0 + # via nox +dirty-equals==0.6.0 +distlib==0.3.7 + # via virtualenv +distro==1.8.0 + # via gitpod +exceptiongroup==1.2.2 + # via anyio + # via pytest +filelock==3.12.4 + # via virtualenv +h11==0.14.0 + # via httpcore +httpcore==1.0.2 + # via httpx +httpx==0.25.2 + # via gitpod + # via respx +idna==3.4 + # via anyio + # via httpx +importlib-metadata==7.0.0 +iniconfig==2.0.0 + # via pytest +markdown-it-py==3.0.0 + # via rich +mdurl==0.1.2 + # via markdown-it-py +mypy==1.11.2 +mypy-extensions==1.0.0 + # via mypy +nodeenv==1.8.0 + # via pyright +nox==2023.4.22 +packaging==23.2 + # via nox + # via pytest +platformdirs==3.11.0 + # via virtualenv +pluggy==1.5.0 + # via pytest +pydantic==2.9.2 + # via gitpod +pydantic-core==2.23.4 + # via pydantic +pygments==2.18.0 + # via rich +pyright==1.1.380 +pytest==8.3.3 + # via pytest-asyncio +pytest-asyncio==0.24.0 +python-dateutil==2.8.2 + # via time-machine +pytz==2023.3.post1 + # via dirty-equals +respx==0.20.2 +rich==13.7.1 +ruff==0.6.9 +setuptools==68.2.2 + # via nodeenv +six==1.16.0 + # via python-dateutil +sniffio==1.3.0 + # via anyio + # via gitpod + # via httpx +time-machine==2.9.0 +tomli==2.0.2 + # via mypy + # via pytest +typing-extensions==4.12.2 + # via anyio + # via gitpod + # via mypy + # via pydantic + # via pydantic-core +virtualenv==20.24.5 + # via nox +zipp==3.17.0 + # via importlib-metadata diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 00000000..aabc471e --- /dev/null +++ b/requirements.lock @@ -0,0 +1,45 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: true +# with-sources: false +# generate-hashes: false + +-e file:. +annotated-types==0.6.0 + # via pydantic +anyio==4.4.0 + # via gitpod + # via httpx +certifi==2023.7.22 + # via httpcore + # via httpx +distro==1.8.0 + # via gitpod +exceptiongroup==1.2.2 + # via anyio +h11==0.14.0 + # via httpcore +httpcore==1.0.2 + # via httpx +httpx==0.25.2 + # via gitpod +idna==3.4 + # via anyio + # via httpx +pydantic==2.9.2 + # via gitpod +pydantic-core==2.23.4 + # via pydantic +sniffio==1.3.0 + # via anyio + # via gitpod + # via httpx +typing-extensions==4.12.2 + # via anyio + # via gitpod + # via pydantic + # via pydantic-core diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 00000000..8c5c60eb --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then + brew bundle check >/dev/null 2>&1 || { + echo "==> Installing Homebrew dependencies…" + brew bundle + } +fi + +echo "==> Installing Python dependencies…" + +# experimental uv support makes installations significantly faster +rye config --set-bool behavior.use-uv=true + +rye sync --all-features diff --git a/scripts/format b/scripts/format new file mode 100755 index 00000000..667ec2d7 --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running formatters" +rye run format diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 00000000..491fd6be --- /dev/null +++ b/scripts/lint @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running lints" +rye run lint + +echo "==> Making sure it imports" +rye run python -c 'import gitpod' + diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 00000000..d2814ae6 --- /dev/null +++ b/scripts/mock @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run prism mock on the given spec +if [ "$1" == "--daemon" ]; then + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + + # Wait for server to come online + echo -n "Waiting for server" + while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + echo -n "." + sleep 0.1 + done + + if grep -q "✖ fatal" ".prism.log"; then + cat .prism.log + exit 1 + fi + + echo +else + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..4fa5698b --- /dev/null +++ b/scripts/test @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function prism_is_running() { + curl --silent "http://localhost:4010" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! prism_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! prism_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the prism command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo +fi + +echo "==> Running tests" +rye run pytest "$@" + +echo "==> Running Pydantic v1 tests" +rye run nox -s test-pydantic-v1 -- "$@" diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py new file mode 100644 index 00000000..37b3d94f --- /dev/null +++ b/scripts/utils/ruffen-docs.py @@ -0,0 +1,167 @@ +# fork of https://github.com/asottile/blacken-docs adapted for ruff +from __future__ import annotations + +import re +import sys +import argparse +import textwrap +import contextlib +import subprocess +from typing import Match, Optional, Sequence, Generator, NamedTuple, cast + +MD_RE = re.compile( + r"(?P^(?P *)```\s*python\n)" r"(?P.*?)" r"(?P^(?P=indent)```\s*$)", + re.DOTALL | re.MULTILINE, +) +MD_PYCON_RE = re.compile( + r"(?P^(?P *)```\s*pycon\n)" r"(?P.*?)" r"(?P^(?P=indent)```.*$)", + re.DOTALL | re.MULTILINE, +) +PYCON_PREFIX = ">>> " +PYCON_CONTINUATION_PREFIX = "..." +PYCON_CONTINUATION_RE = re.compile( + rf"^{re.escape(PYCON_CONTINUATION_PREFIX)}( |$)", +) +DEFAULT_LINE_LENGTH = 100 + + +class CodeBlockError(NamedTuple): + offset: int + exc: Exception + + +def format_str( + src: str, +) -> tuple[str, Sequence[CodeBlockError]]: + errors: list[CodeBlockError] = [] + + @contextlib.contextmanager + def _collect_error(match: Match[str]) -> Generator[None, None, None]: + try: + yield + except Exception as e: + errors.append(CodeBlockError(match.start(), e)) + + def _md_match(match: Match[str]) -> str: + code = textwrap.dedent(match["code"]) + with _collect_error(match): + code = format_code_block(code) + code = textwrap.indent(code, match["indent"]) + return f'{match["before"]}{code}{match["after"]}' + + def _pycon_match(match: Match[str]) -> str: + code = "" + fragment = cast(Optional[str], None) + + def finish_fragment() -> None: + nonlocal code + nonlocal fragment + + if fragment is not None: + with _collect_error(match): + fragment = format_code_block(fragment) + fragment_lines = fragment.splitlines() + code += f"{PYCON_PREFIX}{fragment_lines[0]}\n" + for line in fragment_lines[1:]: + # Skip blank lines to handle Black adding a blank above + # functions within blocks. A blank line would end the REPL + # continuation prompt. + # + # >>> if True: + # ... def f(): + # ... pass + # ... + if line: + code += f"{PYCON_CONTINUATION_PREFIX} {line}\n" + if fragment_lines[-1].startswith(" "): + code += f"{PYCON_CONTINUATION_PREFIX}\n" + fragment = None + + indentation = None + for line in match["code"].splitlines(): + orig_line, line = line, line.lstrip() + if indentation is None and line: + indentation = len(orig_line) - len(line) + continuation_match = PYCON_CONTINUATION_RE.match(line) + if continuation_match and fragment is not None: + fragment += line[continuation_match.end() :] + "\n" + else: + finish_fragment() + if line.startswith(PYCON_PREFIX): + fragment = line[len(PYCON_PREFIX) :] + "\n" + else: + code += orig_line[indentation:] + "\n" + finish_fragment() + return code + + def _md_pycon_match(match: Match[str]) -> str: + code = _pycon_match(match) + code = textwrap.indent(code, match["indent"]) + return f'{match["before"]}{code}{match["after"]}' + + src = MD_RE.sub(_md_match, src) + src = MD_PYCON_RE.sub(_md_pycon_match, src) + return src, errors + + +def format_code_block(code: str) -> str: + return subprocess.check_output( + [ + sys.executable, + "-m", + "ruff", + "format", + "--stdin-filename=script.py", + f"--line-length={DEFAULT_LINE_LENGTH}", + ], + encoding="utf-8", + input=code, + ) + + +def format_file( + filename: str, + skip_errors: bool, +) -> int: + with open(filename, encoding="UTF-8") as f: + contents = f.read() + new_contents, errors = format_str(contents) + for error in errors: + lineno = contents[: error.offset].count("\n") + 1 + print(f"{filename}:{lineno}: code block parse error {error.exc}") + if errors and not skip_errors: + return 1 + if contents != new_contents: + print(f"{filename}: Rewriting...") + with open(filename, "w", encoding="UTF-8") as f: + f.write(new_contents) + return 0 + else: + return 0 + + +def main(argv: Sequence[str] | None = None) -> int: + parser = argparse.ArgumentParser() + parser.add_argument( + "-l", + "--line-length", + type=int, + default=DEFAULT_LINE_LENGTH, + ) + parser.add_argument( + "-S", + "--skip-string-normalization", + action="store_true", + ) + parser.add_argument("-E", "--skip-errors", action="store_true") + parser.add_argument("filenames", nargs="*") + args = parser.parse_args(argv) + + retv = 0 + for filename in args.filenames: + retv |= format_file(filename, skip_errors=args.skip_errors) + return retv + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/src/gitpod/__init__.py b/src/gitpod/__init__.py new file mode 100644 index 00000000..bf8d4c31 --- /dev/null +++ b/src/gitpod/__init__.py @@ -0,0 +1,83 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from . import types +from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes +from ._utils import file_from_path +from ._client import Client, Gitpod, Stream, Timeout, Transport, AsyncClient, AsyncGitpod, AsyncStream, RequestOptions +from ._models import BaseModel +from ._version import __title__, __version__ +from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse +from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS +from ._exceptions import ( + APIError, + GitpodError, + ConflictError, + NotFoundError, + APIStatusError, + RateLimitError, + APITimeoutError, + BadRequestError, + APIConnectionError, + AuthenticationError, + InternalServerError, + PermissionDeniedError, + UnprocessableEntityError, + APIResponseValidationError, +) +from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient +from ._utils._logs import setup_logging as _setup_logging + +__all__ = [ + "types", + "__version__", + "__title__", + "NoneType", + "Transport", + "ProxiesTypes", + "NotGiven", + "NOT_GIVEN", + "GitpodError", + "APIError", + "APIStatusError", + "APITimeoutError", + "APIConnectionError", + "APIResponseValidationError", + "BadRequestError", + "AuthenticationError", + "PermissionDeniedError", + "NotFoundError", + "ConflictError", + "UnprocessableEntityError", + "RateLimitError", + "InternalServerError", + "Timeout", + "RequestOptions", + "Client", + "AsyncClient", + "Stream", + "AsyncStream", + "Gitpod", + "AsyncGitpod", + "file_from_path", + "BaseModel", + "DEFAULT_TIMEOUT", + "DEFAULT_MAX_RETRIES", + "DEFAULT_CONNECTION_LIMITS", + "DefaultHttpxClient", + "DefaultAsyncHttpxClient", +] + +_setup_logging() + +# Update the __module__ attribute for exported symbols so that +# error messages point to this module instead of the module +# it was originally defined in, e.g. +# gitpod._exceptions.NotFoundError -> gitpod.NotFoundError +__locals = locals() +for __name in __all__: + if not __name.startswith("__"): + try: + __locals[__name].__module__ = "gitpod" + except (TypeError, AttributeError): + # Some of our exported symbols are builtins which we can't set attributes for. + pass diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py new file mode 100644 index 00000000..064ec567 --- /dev/null +++ b/src/gitpod/_base_client.py @@ -0,0 +1,2041 @@ +from __future__ import annotations + +import sys +import json +import time +import uuid +import email +import asyncio +import inspect +import logging +import platform +import warnings +import email.utils +from types import TracebackType +from random import random +from typing import ( + TYPE_CHECKING, + Any, + Dict, + Type, + Union, + Generic, + Mapping, + TypeVar, + Iterable, + Iterator, + Optional, + Generator, + AsyncIterator, + cast, + overload, +) +from typing_extensions import Literal, override, get_origin + +import anyio +import httpx +import distro +import pydantic +from httpx import URL, Limits +from pydantic import PrivateAttr + +from . import _exceptions +from ._qs import Querystring +from ._files import to_httpx_files, async_to_httpx_files +from ._types import ( + NOT_GIVEN, + Body, + Omit, + Query, + Headers, + Timeout, + NotGiven, + ResponseT, + Transport, + AnyMapping, + PostParser, + ProxiesTypes, + RequestFiles, + HttpxSendArgs, + AsyncTransport, + RequestOptions, + HttpxRequestFiles, + ModelBuilderProtocol, +) +from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping +from ._compat import model_copy, model_dump +from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type +from ._response import ( + APIResponse, + BaseAPIResponse, + AsyncAPIResponse, + extract_response_type, +) +from ._constants import ( + DEFAULT_TIMEOUT, + MAX_RETRY_DELAY, + DEFAULT_MAX_RETRIES, + INITIAL_RETRY_DELAY, + RAW_RESPONSE_HEADER, + OVERRIDE_CAST_TO_HEADER, + DEFAULT_CONNECTION_LIMITS, +) +from ._streaming import Stream, SSEDecoder, AsyncStream, SSEBytesDecoder +from ._exceptions import ( + APIStatusError, + APITimeoutError, + APIConnectionError, + APIResponseValidationError, +) + +log: logging.Logger = logging.getLogger(__name__) + +# TODO: make base page type vars covariant +SyncPageT = TypeVar("SyncPageT", bound="BaseSyncPage[Any]") +AsyncPageT = TypeVar("AsyncPageT", bound="BaseAsyncPage[Any]") + + +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) + +_StreamT = TypeVar("_StreamT", bound=Stream[Any]) +_AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any]) + +if TYPE_CHECKING: + from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT +else: + try: + from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT + except ImportError: + # taken from https://github.com/encode/httpx/blob/3ba5fe0d7ac70222590e759c31442b1cab263791/httpx/_config.py#L366 + HTTPX_DEFAULT_TIMEOUT = Timeout(5.0) + + +class PageInfo: + """Stores the necessary information to build the request to retrieve the next page. + + Either `url` or `params` must be set. + """ + + url: URL | NotGiven + params: Query | NotGiven + + @overload + def __init__( + self, + *, + url: URL, + ) -> None: ... + + @overload + def __init__( + self, + *, + params: Query, + ) -> None: ... + + def __init__( + self, + *, + url: URL | NotGiven = NOT_GIVEN, + params: Query | NotGiven = NOT_GIVEN, + ) -> None: + self.url = url + self.params = params + + @override + def __repr__(self) -> str: + if self.url: + return f"{self.__class__.__name__}(url={self.url})" + return f"{self.__class__.__name__}(params={self.params})" + + +class BasePage(GenericModel, Generic[_T]): + """ + Defines the core interface for pagination. + + Type Args: + ModelT: The pydantic model that represents an item in the response. + + Methods: + has_next_page(): Check if there is another page available + next_page_info(): Get the necessary information to make a request for the next page + """ + + _options: FinalRequestOptions = PrivateAttr() + _model: Type[_T] = PrivateAttr() + + def has_next_page(self) -> bool: + items = self._get_page_items() + if not items: + return False + return self.next_page_info() is not None + + def next_page_info(self) -> Optional[PageInfo]: ... + + def _get_page_items(self) -> Iterable[_T]: # type: ignore[empty-body] + ... + + def _params_from_url(self, url: URL) -> httpx.QueryParams: + # TODO: do we have to preprocess params here? + return httpx.QueryParams(cast(Any, self._options.params)).merge(url.params) + + def _info_to_options(self, info: PageInfo) -> FinalRequestOptions: + options = model_copy(self._options) + options._strip_raw_response_header() + + if not isinstance(info.params, NotGiven): + options.params = {**options.params, **info.params} + return options + + if not isinstance(info.url, NotGiven): + params = self._params_from_url(info.url) + url = info.url.copy_with(params=params) + options.params = dict(url.params) + options.url = str(url) + return options + + raise ValueError("Unexpected PageInfo state") + + +class BaseSyncPage(BasePage[_T], Generic[_T]): + _client: SyncAPIClient = pydantic.PrivateAttr() + + def _set_private_attributes( + self, + client: SyncAPIClient, + model: Type[_T], + options: FinalRequestOptions, + ) -> None: + self._model = model + self._client = client + self._options = options + + # Pydantic uses a custom `__iter__` method to support casting BaseModels + # to dictionaries. e.g. dict(model). + # As we want to support `for item in page`, this is inherently incompatible + # with the default pydantic behaviour. It is not possible to support both + # use cases at once. Fortunately, this is not a big deal as all other pydantic + # methods should continue to work as expected as there is an alternative method + # to cast a model to a dictionary, model.dict(), which is used internally + # by pydantic. + def __iter__(self) -> Iterator[_T]: # type: ignore + for page in self.iter_pages(): + for item in page._get_page_items(): + yield item + + def iter_pages(self: SyncPageT) -> Iterator[SyncPageT]: + page = self + while True: + yield page + if page.has_next_page(): + page = page.get_next_page() + else: + return + + def get_next_page(self: SyncPageT) -> SyncPageT: + info = self.next_page_info() + if not info: + raise RuntimeError( + "No next page expected; please check `.has_next_page()` before calling `.get_next_page()`." + ) + + options = self._info_to_options(info) + return self._client._request_api_list(self._model, page=self.__class__, options=options) + + +class AsyncPaginator(Generic[_T, AsyncPageT]): + def __init__( + self, + client: AsyncAPIClient, + options: FinalRequestOptions, + page_cls: Type[AsyncPageT], + model: Type[_T], + ) -> None: + self._model = model + self._client = client + self._options = options + self._page_cls = page_cls + + def __await__(self) -> Generator[Any, None, AsyncPageT]: + return self._get_page().__await__() + + async def _get_page(self) -> AsyncPageT: + def _parser(resp: AsyncPageT) -> AsyncPageT: + resp._set_private_attributes( + model=self._model, + options=self._options, + client=self._client, + ) + return resp + + self._options.post_parser = _parser + + return await self._client.request(self._page_cls, self._options) + + async def __aiter__(self) -> AsyncIterator[_T]: + # https://github.com/microsoft/pyright/issues/3464 + page = cast( + AsyncPageT, + await self, # type: ignore + ) + async for item in page: + yield item + + +class BaseAsyncPage(BasePage[_T], Generic[_T]): + _client: AsyncAPIClient = pydantic.PrivateAttr() + + def _set_private_attributes( + self, + model: Type[_T], + client: AsyncAPIClient, + options: FinalRequestOptions, + ) -> None: + self._model = model + self._client = client + self._options = options + + async def __aiter__(self) -> AsyncIterator[_T]: + async for page in self.iter_pages(): + for item in page._get_page_items(): + yield item + + async def iter_pages(self: AsyncPageT) -> AsyncIterator[AsyncPageT]: + page = self + while True: + yield page + if page.has_next_page(): + page = await page.get_next_page() + else: + return + + async def get_next_page(self: AsyncPageT) -> AsyncPageT: + info = self.next_page_info() + if not info: + raise RuntimeError( + "No next page expected; please check `.has_next_page()` before calling `.get_next_page()`." + ) + + options = self._info_to_options(info) + return await self._client._request_api_list(self._model, page=self.__class__, options=options) + + +_HttpxClientT = TypeVar("_HttpxClientT", bound=Union[httpx.Client, httpx.AsyncClient]) +_DefaultStreamT = TypeVar("_DefaultStreamT", bound=Union[Stream[Any], AsyncStream[Any]]) + + +class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]): + _client: _HttpxClientT + _version: str + _base_url: URL + max_retries: int + timeout: Union[float, Timeout, None] + _limits: httpx.Limits + _proxies: ProxiesTypes | None + _transport: Transport | AsyncTransport | None + _strict_response_validation: bool + _idempotency_header: str | None + _default_stream_cls: type[_DefaultStreamT] | None = None + + def __init__( + self, + *, + version: str, + base_url: str | URL, + _strict_response_validation: bool, + max_retries: int = DEFAULT_MAX_RETRIES, + timeout: float | Timeout | None = DEFAULT_TIMEOUT, + limits: httpx.Limits, + transport: Transport | AsyncTransport | None, + proxies: ProxiesTypes | None, + custom_headers: Mapping[str, str] | None = None, + custom_query: Mapping[str, object] | None = None, + ) -> None: + self._version = version + self._base_url = self._enforce_trailing_slash(URL(base_url)) + self.max_retries = max_retries + self.timeout = timeout + self._limits = limits + self._proxies = proxies + self._transport = transport + self._custom_headers = custom_headers or {} + self._custom_query = custom_query or {} + self._strict_response_validation = _strict_response_validation + self._idempotency_header = None + self._platform: Platform | None = None + + if max_retries is None: # pyright: ignore[reportUnnecessaryComparison] + raise TypeError( + "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `gitpod.DEFAULT_MAX_RETRIES`" + ) + + def _enforce_trailing_slash(self, url: URL) -> URL: + if url.raw_path.endswith(b"/"): + return url + return url.copy_with(raw_path=url.raw_path + b"/") + + def _make_status_error_from_response( + self, + response: httpx.Response, + ) -> APIStatusError: + if response.is_closed and not response.is_stream_consumed: + # We can't read the response body as it has been closed + # before it was read. This can happen if an event hook + # raises a status error. + body = None + err_msg = f"Error code: {response.status_code}" + else: + err_text = response.text.strip() + body = err_text + + try: + body = json.loads(err_text) + err_msg = f"Error code: {response.status_code} - {body}" + except Exception: + err_msg = err_text or f"Error code: {response.status_code}" + + return self._make_status_error(err_msg, body=body, response=response) + + def _make_status_error( + self, + err_msg: str, + *, + body: object, + response: httpx.Response, + ) -> _exceptions.APIStatusError: + raise NotImplementedError() + + def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0) -> httpx.Headers: + custom_headers = options.headers or {} + headers_dict = _merge_mappings(self.default_headers, custom_headers) + self._validate_headers(headers_dict, custom_headers) + + # headers are case-insensitive while dictionaries are not. + headers = httpx.Headers(headers_dict) + + idempotency_header = self._idempotency_header + if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: + headers[idempotency_header] = options.idempotency_key or self._idempotency_key() + + # Don't set the retry count header if it was already set or removed by the caller. We check + # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case. + if "x-stainless-retry-count" not in (header.lower() for header in custom_headers): + headers["x-stainless-retry-count"] = str(retries_taken) + + return headers + + def _prepare_url(self, url: str) -> URL: + """ + Merge a URL argument together with any 'base_url' on the client, + to create the URL used for the outgoing request. + """ + # Copied from httpx's `_merge_url` method. + merge_url = URL(url) + if merge_url.is_relative_url: + merge_raw_path = self.base_url.raw_path + merge_url.raw_path.lstrip(b"/") + return self.base_url.copy_with(raw_path=merge_raw_path) + + return merge_url + + def _make_sse_decoder(self) -> SSEDecoder | SSEBytesDecoder: + return SSEDecoder() + + def _build_request( + self, + options: FinalRequestOptions, + *, + retries_taken: int = 0, + ) -> httpx.Request: + if log.isEnabledFor(logging.DEBUG): + log.debug("Request options: %s", model_dump(options, exclude_unset=True)) + + kwargs: dict[str, Any] = {} + + json_data = options.json_data + if options.extra_json is not None: + if json_data is None: + json_data = cast(Body, options.extra_json) + elif is_mapping(json_data): + json_data = _merge_mappings(json_data, options.extra_json) + else: + raise RuntimeError(f"Unexpected JSON data type, {type(json_data)}, cannot merge with `extra_body`") + + headers = self._build_headers(options, retries_taken=retries_taken) + params = _merge_mappings(self.default_query, options.params) + content_type = headers.get("Content-Type") + files = options.files + + # If the given Content-Type header is multipart/form-data then it + # has to be removed so that httpx can generate the header with + # additional information for us as it has to be in this form + # for the server to be able to correctly parse the request: + # multipart/form-data; boundary=---abc-- + if content_type is not None and content_type.startswith("multipart/form-data"): + if "boundary" not in content_type: + # only remove the header if the boundary hasn't been explicitly set + # as the caller doesn't want httpx to come up with their own boundary + headers.pop("Content-Type") + + # As we are now sending multipart/form-data instead of application/json + # we need to tell httpx to use it, https://www.python-httpx.org/advanced/clients/#multipart-file-encoding + if json_data: + if not is_dict(json_data): + raise TypeError( + f"Expected query input to be a dictionary for multipart requests but got {type(json_data)} instead." + ) + kwargs["data"] = self._serialize_multipartform(json_data) + + # httpx determines whether or not to send a "multipart/form-data" + # request based on the truthiness of the "files" argument. + # This gets around that issue by generating a dict value that + # evaluates to true. + # + # https://github.com/encode/httpx/discussions/2399#discussioncomment-3814186 + if not files: + files = cast(HttpxRequestFiles, ForceMultipartDict()) + + prepared_url = self._prepare_url(options.url) + if "_" in prepared_url.host: + # work around https://github.com/encode/httpx/discussions/2880 + kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + + # TODO: report this error to httpx + return self._client.build_request( # pyright: ignore[reportUnknownMemberType] + headers=headers, + timeout=self.timeout if isinstance(options.timeout, NotGiven) else options.timeout, + method=options.method, + url=prepared_url, + # the `Query` type that we use is incompatible with qs' + # `Params` type as it needs to be typed as `Mapping[str, object]` + # so that passing a `TypedDict` doesn't cause an error. + # https://github.com/microsoft/pyright/issues/3526#event-6715453066 + params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, + json=json_data, + files=files, + **kwargs, + ) + + def _serialize_multipartform(self, data: Mapping[object, object]) -> dict[str, object]: + items = self.qs.stringify_items( + # TODO: type ignore is required as stringify_items is well typed but we can't be + # well typed without heavy validation. + data, # type: ignore + array_format="brackets", + ) + serialized: dict[str, object] = {} + for key, value in items: + existing = serialized.get(key) + + if not existing: + serialized[key] = value + continue + + # If a value has already been set for this key then that + # means we're sending data like `array[]=[1, 2, 3]` and we + # need to tell httpx that we want to send multiple values with + # the same key which is done by using a list or a tuple. + # + # Note: 2d arrays should never result in the same key at both + # levels so it's safe to assume that if the value is a list, + # it was because we changed it to be a list. + if is_list(existing): + existing.append(value) + else: + serialized[key] = [existing, value] + + return serialized + + def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalRequestOptions) -> type[ResponseT]: + if not is_given(options.headers): + return cast_to + + # make a copy of the headers so we don't mutate user-input + headers = dict(options.headers) + + # we internally support defining a temporary header to override the + # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response` + # see _response.py for implementation details + override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN) + if is_given(override_cast_to): + options.headers = headers + return cast(Type[ResponseT], override_cast_to) + + return cast_to + + def _should_stream_response_body(self, request: httpx.Request) -> bool: + return request.headers.get(RAW_RESPONSE_HEADER) == "stream" # type: ignore[no-any-return] + + def _process_response_data( + self, + *, + data: object, + cast_to: type[ResponseT], + response: httpx.Response, + ) -> ResponseT: + if data is None: + return cast(ResponseT, None) + + if cast_to is object: + return cast(ResponseT, data) + + try: + if inspect.isclass(cast_to) and issubclass(cast_to, ModelBuilderProtocol): + return cast(ResponseT, cast_to.build(response=response, data=data)) + + if self._strict_response_validation: + return cast(ResponseT, validate_type(type_=cast_to, value=data)) + + return cast(ResponseT, construct_type(type_=cast_to, value=data)) + except pydantic.ValidationError as err: + raise APIResponseValidationError(response=response, body=data) from err + + @property + def qs(self) -> Querystring: + return Querystring() + + @property + def custom_auth(self) -> httpx.Auth | None: + return None + + @property + def auth_headers(self) -> dict[str, str]: + return {} + + @property + def default_headers(self) -> dict[str, str | Omit]: + return { + "Accept": "application/json", + "Content-Type": "application/json", + "User-Agent": self.user_agent, + **self.platform_headers(), + **self.auth_headers, + **self._custom_headers, + } + + @property + def default_query(self) -> dict[str, object]: + return { + **self._custom_query, + } + + def _validate_headers( + self, + headers: Headers, # noqa: ARG002 + custom_headers: Headers, # noqa: ARG002 + ) -> None: + """Validate the given default headers and custom headers. + + Does nothing by default. + """ + return + + @property + def user_agent(self) -> str: + return f"{self.__class__.__name__}/Python {self._version}" + + @property + def base_url(self) -> URL: + return self._base_url + + @base_url.setter + def base_url(self, url: URL | str) -> None: + self._base_url = self._enforce_trailing_slash(url if isinstance(url, URL) else URL(url)) + + def platform_headers(self) -> Dict[str, str]: + # the actual implementation is in a separate `lru_cache` decorated + # function because adding `lru_cache` to methods will leak memory + # https://github.com/python/cpython/issues/88476 + return platform_headers(self._version, platform=self._platform) + + def _parse_retry_after_header(self, response_headers: Optional[httpx.Headers] = None) -> float | None: + """Returns a float of the number of seconds (not milliseconds) to wait after retrying, or None if unspecified. + + About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After + See also https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#syntax + """ + if response_headers is None: + return None + + # First, try the non-standard `retry-after-ms` header for milliseconds, + # which is more precise than integer-seconds `retry-after` + try: + retry_ms_header = response_headers.get("retry-after-ms", None) + return float(retry_ms_header) / 1000 + except (TypeError, ValueError): + pass + + # Next, try parsing `retry-after` header as seconds (allowing nonstandard floats). + retry_header = response_headers.get("retry-after") + try: + # note: the spec indicates that this should only ever be an integer + # but if someone sends a float there's no reason for us to not respect it + return float(retry_header) + except (TypeError, ValueError): + pass + + # Last, try parsing `retry-after` as a date. + retry_date_tuple = email.utils.parsedate_tz(retry_header) + if retry_date_tuple is None: + return None + + retry_date = email.utils.mktime_tz(retry_date_tuple) + return float(retry_date - time.time()) + + def _calculate_retry_timeout( + self, + remaining_retries: int, + options: FinalRequestOptions, + response_headers: Optional[httpx.Headers] = None, + ) -> float: + max_retries = options.get_max_retries(self.max_retries) + + # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. + retry_after = self._parse_retry_after_header(response_headers) + if retry_after is not None and 0 < retry_after <= 60: + return retry_after + + # Also cap retry count to 1000 to avoid any potential overflows with `pow` + nb_retries = min(max_retries - remaining_retries, 1000) + + # Apply exponential backoff, but not more than the max. + sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY) + + # Apply some jitter, plus-or-minus half a second. + jitter = 1 - 0.25 * random() + timeout = sleep_seconds * jitter + return timeout if timeout >= 0 else 0 + + def _should_retry(self, response: httpx.Response) -> bool: + # Note: this is not a standard header + should_retry_header = response.headers.get("x-should-retry") + + # If the server explicitly says whether or not to retry, obey. + if should_retry_header == "true": + log.debug("Retrying as header `x-should-retry` is set to `true`") + return True + if should_retry_header == "false": + log.debug("Not retrying as header `x-should-retry` is set to `false`") + return False + + # Retry on request timeouts. + if response.status_code == 408: + log.debug("Retrying due to status code %i", response.status_code) + return True + + # Retry on lock timeouts. + if response.status_code == 409: + log.debug("Retrying due to status code %i", response.status_code) + return True + + # Retry on rate limits. + if response.status_code == 429: + log.debug("Retrying due to status code %i", response.status_code) + return True + + # Retry internal errors. + if response.status_code >= 500: + log.debug("Retrying due to status code %i", response.status_code) + return True + + log.debug("Not retrying") + return False + + def _idempotency_key(self) -> str: + return f"stainless-python-retry-{uuid.uuid4()}" + + +class _DefaultHttpxClient(httpx.Client): + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + super().__init__(**kwargs) + + +if TYPE_CHECKING: + DefaultHttpxClient = httpx.Client + """An alias to `httpx.Client` that provides the same defaults that this SDK + uses internally. + + This is useful because overriding the `http_client` with your own instance of + `httpx.Client` will result in httpx's defaults being used, not ours. + """ +else: + DefaultHttpxClient = _DefaultHttpxClient + + +class SyncHttpxClientWrapper(DefaultHttpxClient): + def __del__(self) -> None: + try: + self.close() + except Exception: + pass + + +class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]): + _client: httpx.Client + _default_stream_cls: type[Stream[Any]] | None = None + + def __init__( + self, + *, + version: str, + base_url: str | URL, + max_retries: int = DEFAULT_MAX_RETRIES, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + transport: Transport | None = None, + proxies: ProxiesTypes | None = None, + limits: Limits | None = None, + http_client: httpx.Client | None = None, + custom_headers: Mapping[str, str] | None = None, + custom_query: Mapping[str, object] | None = None, + _strict_response_validation: bool, + ) -> None: + if limits is not None: + warnings.warn( + "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") + else: + limits = DEFAULT_CONNECTION_LIMITS + + if transport is not None: + warnings.warn( + "The `transport` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `transport`") + + if proxies is not None: + warnings.warn( + "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") + + if not is_given(timeout): + # if the user passed in a custom http client with a non-default + # timeout set then we use that timeout. + # + # note: there is an edge case here where the user passes in a client + # where they've explicitly set the timeout to match the default timeout + # as this check is structural, meaning that we'll think they didn't + # pass in a timeout and will ignore it + if http_client and http_client.timeout != HTTPX_DEFAULT_TIMEOUT: + timeout = http_client.timeout + else: + timeout = DEFAULT_TIMEOUT + + if http_client is not None and not isinstance(http_client, httpx.Client): # pyright: ignore[reportUnnecessaryIsInstance] + raise TypeError( + f"Invalid `http_client` argument; Expected an instance of `httpx.Client` but got {type(http_client)}" + ) + + super().__init__( + version=version, + limits=limits, + # cast to a valid type because mypy doesn't understand our type narrowing + timeout=cast(Timeout, timeout), + proxies=proxies, + base_url=base_url, + transport=transport, + max_retries=max_retries, + custom_query=custom_query, + custom_headers=custom_headers, + _strict_response_validation=_strict_response_validation, + ) + self._client = http_client or SyncHttpxClientWrapper( + base_url=base_url, + # cast to a valid type because mypy doesn't understand our type narrowing + timeout=cast(Timeout, timeout), + proxies=proxies, + transport=transport, + limits=limits, + follow_redirects=True, + ) + + def is_closed(self) -> bool: + return self._client.is_closed + + def close(self) -> None: + """Close the underlying HTTPX client. + + The client will *not* be usable after this. + """ + # If an error is thrown while constructing a client, self._client + # may not be present + if hasattr(self, "_client"): + self._client.close() + + def __enter__(self: _T) -> _T: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.close() + + def _prepare_options( + self, + options: FinalRequestOptions, # noqa: ARG002 + ) -> FinalRequestOptions: + """Hook for mutating the given options""" + return options + + def _prepare_request( + self, + request: httpx.Request, # noqa: ARG002 + ) -> None: + """This method is used as a callback for mutating the `Request` object + after it has been constructed. + This is useful for cases where you want to add certain headers based off of + the request properties, e.g. `url`, `method` etc. + """ + return None + + @overload + def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + remaining_retries: Optional[int] = None, + *, + stream: Literal[True], + stream_cls: Type[_StreamT], + ) -> _StreamT: ... + + @overload + def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + remaining_retries: Optional[int] = None, + *, + stream: Literal[False] = False, + ) -> ResponseT: ... + + @overload + def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + remaining_retries: Optional[int] = None, + *, + stream: bool = False, + stream_cls: Type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: ... + + def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + remaining_retries: Optional[int] = None, + *, + stream: bool = False, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: + if remaining_retries is not None: + retries_taken = options.get_max_retries(self.max_retries) - remaining_retries + else: + retries_taken = 0 + + return self._request( + cast_to=cast_to, + options=options, + stream=stream, + stream_cls=stream_cls, + retries_taken=retries_taken, + ) + + def _request( + self, + *, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + retries_taken: int, + stream: bool, + stream_cls: type[_StreamT] | None, + ) -> ResponseT | _StreamT: + # create a copy of the options we were given so that if the + # options are mutated later & we then retry, the retries are + # given the original options + input_options = model_copy(options) + + cast_to = self._maybe_override_cast_to(cast_to, options) + options = self._prepare_options(options) + + remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + request = self._build_request(options, retries_taken=retries_taken) + self._prepare_request(request) + + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth + + log.debug("Sending HTTP Request: %s %s", request.method, request.url) + + try: + response = self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, + ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if remaining_retries > 0: + return self._retry_request( + input_options, + cast_to, + retries_taken=retries_taken, + stream=stream, + stream_cls=stream_cls, + response_headers=None, + ) + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if remaining_retries > 0: + return self._retry_request( + input_options, + cast_to, + retries_taken=retries_taken, + stream=stream, + stream_cls=stream_cls, + response_headers=None, + ) + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Response: %s %s "%i %s" %s', + request.method, + request.url, + response.status_code, + response.reason_phrase, + response.headers, + ) + + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if remaining_retries > 0 and self._should_retry(err.response): + err.response.close() + return self._retry_request( + input_options, + cast_to, + retries_taken=retries_taken, + response_headers=err.response.headers, + stream=stream, + stream_cls=stream_cls, + ) + + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + err.response.read() + + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None + + return self._process_response( + cast_to=cast_to, + options=options, + response=response, + stream=stream, + stream_cls=stream_cls, + retries_taken=retries_taken, + ) + + def _retry_request( + self, + options: FinalRequestOptions, + cast_to: Type[ResponseT], + *, + retries_taken: int, + response_headers: httpx.Headers | None, + stream: bool, + stream_cls: type[_StreamT] | None, + ) -> ResponseT | _StreamT: + remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + if remaining_retries == 1: + log.debug("1 retry left") + else: + log.debug("%i retries left", remaining_retries) + + timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) + log.info("Retrying request to %s in %f seconds", options.url, timeout) + + # In a synchronous context we are blocking the entire thread. Up to the library user to run the client in a + # different thread if necessary. + time.sleep(timeout) + + return self._request( + options=options, + cast_to=cast_to, + retries_taken=retries_taken + 1, + stream=stream, + stream_cls=stream_cls, + ) + + def _process_response( + self, + *, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + response: httpx.Response, + stream: bool, + stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, + retries_taken: int = 0, + ) -> ResponseT: + origin = get_origin(cast_to) or cast_to + + if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if not issubclass(origin, APIResponse): + raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}") + + response_cls = cast("type[BaseAPIResponse[Any]]", cast_to) + return cast( + ResponseT, + response_cls( + raw=response, + client=self, + cast_to=extract_response_type(response_cls), + stream=stream, + stream_cls=stream_cls, + options=options, + retries_taken=retries_taken, + ), + ) + + if cast_to == httpx.Response: + return cast(ResponseT, response) + + api_response = APIResponse( + raw=response, + client=self, + cast_to=cast("type[ResponseT]", cast_to), # pyright: ignore[reportUnnecessaryCast] + stream=stream, + stream_cls=stream_cls, + options=options, + retries_taken=retries_taken, + ) + if bool(response.request.headers.get(RAW_RESPONSE_HEADER)): + return cast(ResponseT, api_response) + + return api_response.parse() + + def _request_api_list( + self, + model: Type[object], + page: Type[SyncPageT], + options: FinalRequestOptions, + ) -> SyncPageT: + def _parser(resp: SyncPageT) -> SyncPageT: + resp._set_private_attributes( + client=self, + model=model, + options=options, + ) + return resp + + options.post_parser = _parser + + return self.request(page, options, stream=False) + + @overload + def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: Literal[False] = False, + ) -> ResponseT: ... + + @overload + def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: Literal[True], + stream_cls: type[_StreamT], + ) -> _StreamT: ... + + @overload + def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: bool, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: ... + + def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: bool = False, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: + opts = FinalRequestOptions.construct(method="get", url=path, **options) + # cast is required because mypy complains about returning Any even though + # it understands the type variables + return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) + + @overload + def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + files: RequestFiles | None = None, + stream: Literal[False] = False, + ) -> ResponseT: ... + + @overload + def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + files: RequestFiles | None = None, + stream: Literal[True], + stream_cls: type[_StreamT], + ) -> _StreamT: ... + + @overload + def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + files: RequestFiles | None = None, + stream: bool, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: ... + + def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + files: RequestFiles | None = None, + stream: bool = False, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: + opts = FinalRequestOptions.construct( + method="post", url=path, json_data=body, files=to_httpx_files(files), **options + ) + return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) + + def patch( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + return self.request(cast_to, opts) + + def put( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct( + method="put", url=path, json_data=body, files=to_httpx_files(files), **options + ) + return self.request(cast_to, opts) + + def delete( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + return self.request(cast_to, opts) + + def get_api_list( + self, + path: str, + *, + model: Type[object], + page: Type[SyncPageT], + body: Body | None = None, + options: RequestOptions = {}, + method: str = "get", + ) -> SyncPageT: + opts = FinalRequestOptions.construct(method=method, url=path, json_data=body, **options) + return self._request_api_list(model, page, opts) + + +class _DefaultAsyncHttpxClient(httpx.AsyncClient): + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + super().__init__(**kwargs) + + +if TYPE_CHECKING: + DefaultAsyncHttpxClient = httpx.AsyncClient + """An alias to `httpx.AsyncClient` that provides the same defaults that this SDK + uses internally. + + This is useful because overriding the `http_client` with your own instance of + `httpx.AsyncClient` will result in httpx's defaults being used, not ours. + """ +else: + DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient + + +class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): + def __del__(self) -> None: + try: + # TODO(someday): support non asyncio runtimes here + asyncio.get_running_loop().create_task(self.aclose()) + except Exception: + pass + + +class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]): + _client: httpx.AsyncClient + _default_stream_cls: type[AsyncStream[Any]] | None = None + + def __init__( + self, + *, + version: str, + base_url: str | URL, + _strict_response_validation: bool, + max_retries: int = DEFAULT_MAX_RETRIES, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + transport: AsyncTransport | None = None, + proxies: ProxiesTypes | None = None, + limits: Limits | None = None, + http_client: httpx.AsyncClient | None = None, + custom_headers: Mapping[str, str] | None = None, + custom_query: Mapping[str, object] | None = None, + ) -> None: + if limits is not None: + warnings.warn( + "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") + else: + limits = DEFAULT_CONNECTION_LIMITS + + if transport is not None: + warnings.warn( + "The `transport` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `transport`") + + if proxies is not None: + warnings.warn( + "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") + + if not is_given(timeout): + # if the user passed in a custom http client with a non-default + # timeout set then we use that timeout. + # + # note: there is an edge case here where the user passes in a client + # where they've explicitly set the timeout to match the default timeout + # as this check is structural, meaning that we'll think they didn't + # pass in a timeout and will ignore it + if http_client and http_client.timeout != HTTPX_DEFAULT_TIMEOUT: + timeout = http_client.timeout + else: + timeout = DEFAULT_TIMEOUT + + if http_client is not None and not isinstance(http_client, httpx.AsyncClient): # pyright: ignore[reportUnnecessaryIsInstance] + raise TypeError( + f"Invalid `http_client` argument; Expected an instance of `httpx.AsyncClient` but got {type(http_client)}" + ) + + super().__init__( + version=version, + base_url=base_url, + limits=limits, + # cast to a valid type because mypy doesn't understand our type narrowing + timeout=cast(Timeout, timeout), + proxies=proxies, + transport=transport, + max_retries=max_retries, + custom_query=custom_query, + custom_headers=custom_headers, + _strict_response_validation=_strict_response_validation, + ) + self._client = http_client or AsyncHttpxClientWrapper( + base_url=base_url, + # cast to a valid type because mypy doesn't understand our type narrowing + timeout=cast(Timeout, timeout), + proxies=proxies, + transport=transport, + limits=limits, + follow_redirects=True, + ) + + def is_closed(self) -> bool: + return self._client.is_closed + + async def close(self) -> None: + """Close the underlying HTTPX client. + + The client will *not* be usable after this. + """ + await self._client.aclose() + + async def __aenter__(self: _T) -> _T: + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + await self.close() + + async def _prepare_options( + self, + options: FinalRequestOptions, # noqa: ARG002 + ) -> FinalRequestOptions: + """Hook for mutating the given options""" + return options + + async def _prepare_request( + self, + request: httpx.Request, # noqa: ARG002 + ) -> None: + """This method is used as a callback for mutating the `Request` object + after it has been constructed. + This is useful for cases where you want to add certain headers based off of + the request properties, e.g. `url`, `method` etc. + """ + return None + + @overload + async def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: Literal[False] = False, + remaining_retries: Optional[int] = None, + ) -> ResponseT: ... + + @overload + async def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: Literal[True], + stream_cls: type[_AsyncStreamT], + remaining_retries: Optional[int] = None, + ) -> _AsyncStreamT: ... + + @overload + async def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: bool, + stream_cls: type[_AsyncStreamT] | None = None, + remaining_retries: Optional[int] = None, + ) -> ResponseT | _AsyncStreamT: ... + + async def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: bool = False, + stream_cls: type[_AsyncStreamT] | None = None, + remaining_retries: Optional[int] = None, + ) -> ResponseT | _AsyncStreamT: + if remaining_retries is not None: + retries_taken = options.get_max_retries(self.max_retries) - remaining_retries + else: + retries_taken = 0 + + return await self._request( + cast_to=cast_to, + options=options, + stream=stream, + stream_cls=stream_cls, + retries_taken=retries_taken, + ) + + async def _request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: bool, + stream_cls: type[_AsyncStreamT] | None, + retries_taken: int, + ) -> ResponseT | _AsyncStreamT: + if self._platform is None: + # `get_platform` can make blocking IO calls so we + # execute it earlier while we are in an async context + self._platform = await asyncify(get_platform)() + + # create a copy of the options we were given so that if the + # options are mutated later & we then retry, the retries are + # given the original options + input_options = model_copy(options) + + cast_to = self._maybe_override_cast_to(cast_to, options) + options = await self._prepare_options(options) + + remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + request = self._build_request(options, retries_taken=retries_taken) + await self._prepare_request(request) + + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth + + try: + response = await self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, + ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if remaining_retries > 0: + return await self._retry_request( + input_options, + cast_to, + retries_taken=retries_taken, + stream=stream, + stream_cls=stream_cls, + response_headers=None, + ) + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if remaining_retries > 0: + return await self._retry_request( + input_options, + cast_to, + retries_taken=retries_taken, + stream=stream, + stream_cls=stream_cls, + response_headers=None, + ) + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase + ) + + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if remaining_retries > 0 and self._should_retry(err.response): + await err.response.aclose() + return await self._retry_request( + input_options, + cast_to, + retries_taken=retries_taken, + response_headers=err.response.headers, + stream=stream, + stream_cls=stream_cls, + ) + + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + await err.response.aread() + + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None + + return await self._process_response( + cast_to=cast_to, + options=options, + response=response, + stream=stream, + stream_cls=stream_cls, + retries_taken=retries_taken, + ) + + async def _retry_request( + self, + options: FinalRequestOptions, + cast_to: Type[ResponseT], + *, + retries_taken: int, + response_headers: httpx.Headers | None, + stream: bool, + stream_cls: type[_AsyncStreamT] | None, + ) -> ResponseT | _AsyncStreamT: + remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + if remaining_retries == 1: + log.debug("1 retry left") + else: + log.debug("%i retries left", remaining_retries) + + timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) + log.info("Retrying request to %s in %f seconds", options.url, timeout) + + await anyio.sleep(timeout) + + return await self._request( + options=options, + cast_to=cast_to, + retries_taken=retries_taken + 1, + stream=stream, + stream_cls=stream_cls, + ) + + async def _process_response( + self, + *, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + response: httpx.Response, + stream: bool, + stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, + retries_taken: int = 0, + ) -> ResponseT: + origin = get_origin(cast_to) or cast_to + + if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if not issubclass(origin, AsyncAPIResponse): + raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}") + + response_cls = cast("type[BaseAPIResponse[Any]]", cast_to) + return cast( + "ResponseT", + response_cls( + raw=response, + client=self, + cast_to=extract_response_type(response_cls), + stream=stream, + stream_cls=stream_cls, + options=options, + retries_taken=retries_taken, + ), + ) + + if cast_to == httpx.Response: + return cast(ResponseT, response) + + api_response = AsyncAPIResponse( + raw=response, + client=self, + cast_to=cast("type[ResponseT]", cast_to), # pyright: ignore[reportUnnecessaryCast] + stream=stream, + stream_cls=stream_cls, + options=options, + retries_taken=retries_taken, + ) + if bool(response.request.headers.get(RAW_RESPONSE_HEADER)): + return cast(ResponseT, api_response) + + return await api_response.parse() + + def _request_api_list( + self, + model: Type[_T], + page: Type[AsyncPageT], + options: FinalRequestOptions, + ) -> AsyncPaginator[_T, AsyncPageT]: + return AsyncPaginator(client=self, options=options, page_cls=page, model=model) + + @overload + async def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: Literal[False] = False, + ) -> ResponseT: ... + + @overload + async def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: Literal[True], + stream_cls: type[_AsyncStreamT], + ) -> _AsyncStreamT: ... + + @overload + async def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: bool, + stream_cls: type[_AsyncStreamT] | None = None, + ) -> ResponseT | _AsyncStreamT: ... + + async def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: bool = False, + stream_cls: type[_AsyncStreamT] | None = None, + ) -> ResponseT | _AsyncStreamT: + opts = FinalRequestOptions.construct(method="get", url=path, **options) + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + + @overload + async def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + stream: Literal[False] = False, + ) -> ResponseT: ... + + @overload + async def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + stream: Literal[True], + stream_cls: type[_AsyncStreamT], + ) -> _AsyncStreamT: ... + + @overload + async def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + stream: bool, + stream_cls: type[_AsyncStreamT] | None = None, + ) -> ResponseT | _AsyncStreamT: ... + + async def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + stream: bool = False, + stream_cls: type[_AsyncStreamT] | None = None, + ) -> ResponseT | _AsyncStreamT: + opts = FinalRequestOptions.construct( + method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options + ) + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + + async def patch( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + return await self.request(cast_to, opts) + + async def put( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct( + method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options + ) + return await self.request(cast_to, opts) + + async def delete( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + return await self.request(cast_to, opts) + + def get_api_list( + self, + path: str, + *, + model: Type[_T], + page: Type[AsyncPageT], + body: Body | None = None, + options: RequestOptions = {}, + method: str = "get", + ) -> AsyncPaginator[_T, AsyncPageT]: + opts = FinalRequestOptions.construct(method=method, url=path, json_data=body, **options) + return self._request_api_list(model, page, opts) + + +def make_request_options( + *, + query: Query | None = None, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + idempotency_key: str | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + post_parser: PostParser | NotGiven = NOT_GIVEN, +) -> RequestOptions: + """Create a dict of type RequestOptions without keys of NotGiven values.""" + options: RequestOptions = {} + if extra_headers is not None: + options["headers"] = extra_headers + + if extra_body is not None: + options["extra_json"] = cast(AnyMapping, extra_body) + + if query is not None: + options["params"] = query + + if extra_query is not None: + options["params"] = {**options.get("params", {}), **extra_query} + + if not isinstance(timeout, NotGiven): + options["timeout"] = timeout + + if idempotency_key is not None: + options["idempotency_key"] = idempotency_key + + if is_given(post_parser): + # internal + options["post_parser"] = post_parser # type: ignore + + return options + + +class ForceMultipartDict(Dict[str, None]): + def __bool__(self) -> bool: + return True + + +class OtherPlatform: + def __init__(self, name: str) -> None: + self.name = name + + @override + def __str__(self) -> str: + return f"Other:{self.name}" + + +Platform = Union[ + OtherPlatform, + Literal[ + "MacOS", + "Linux", + "Windows", + "FreeBSD", + "OpenBSD", + "iOS", + "Android", + "Unknown", + ], +] + + +def get_platform() -> Platform: + try: + system = platform.system().lower() + platform_name = platform.platform().lower() + except Exception: + return "Unknown" + + if "iphone" in platform_name or "ipad" in platform_name: + # Tested using Python3IDE on an iPhone 11 and Pythonista on an iPad 7 + # system is Darwin and platform_name is a string like: + # - Darwin-21.6.0-iPhone12,1-64bit + # - Darwin-21.6.0-iPad7,11-64bit + return "iOS" + + if system == "darwin": + return "MacOS" + + if system == "windows": + return "Windows" + + if "android" in platform_name: + # Tested using Pydroid 3 + # system is Linux and platform_name is a string like 'Linux-5.10.81-android12-9-00001-geba40aecb3b7-ab8534902-aarch64-with-libc' + return "Android" + + if system == "linux": + # https://distro.readthedocs.io/en/latest/#distro.id + distro_id = distro.id() + if distro_id == "freebsd": + return "FreeBSD" + + if distro_id == "openbsd": + return "OpenBSD" + + return "Linux" + + if platform_name: + return OtherPlatform(platform_name) + + return "Unknown" + + +@lru_cache(maxsize=None) +def platform_headers(version: str, *, platform: Platform | None) -> Dict[str, str]: + return { + "X-Stainless-Lang": "python", + "X-Stainless-Package-Version": version, + "X-Stainless-OS": str(platform or get_platform()), + "X-Stainless-Arch": str(get_architecture()), + "X-Stainless-Runtime": get_python_runtime(), + "X-Stainless-Runtime-Version": get_python_version(), + } + + +class OtherArch: + def __init__(self, name: str) -> None: + self.name = name + + @override + def __str__(self) -> str: + return f"other:{self.name}" + + +Arch = Union[OtherArch, Literal["x32", "x64", "arm", "arm64", "unknown"]] + + +def get_python_runtime() -> str: + try: + return platform.python_implementation() + except Exception: + return "unknown" + + +def get_python_version() -> str: + try: + return platform.python_version() + except Exception: + return "unknown" + + +def get_architecture() -> Arch: + try: + machine = platform.machine().lower() + except Exception: + return "unknown" + + if machine in ("arm64", "aarch64"): + return "arm64" + + # TODO: untested + if machine == "arm": + return "arm" + + if machine == "x86_64": + return "x64" + + # TODO: untested + if sys.maxsize <= 2**32: + return "x32" + + if machine: + return OtherArch(machine) + + return "unknown" + + +def _merge_mappings( + obj1: Mapping[_T_co, Union[_T, Omit]], + obj2: Mapping[_T_co, Union[_T, Omit]], +) -> Dict[_T_co, _T]: + """Merge two mappings of the same type, removing any values that are instances of `Omit`. + + In cases with duplicate keys the second mapping takes precedence. + """ + merged = {**obj1, **obj2} + return {key: value for key, value in merged.items() if not isinstance(value, Omit)} diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py new file mode 100644 index 00000000..17747277 --- /dev/null +++ b/src/gitpod/_client.py @@ -0,0 +1,504 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Union, Mapping +from typing_extensions import Self, override + +import httpx + +from . import resources, _exceptions +from ._qs import Querystring +from ._types import ( + NOT_GIVEN, + Omit, + Timeout, + NotGiven, + Transport, + ProxiesTypes, + RequestOptions, +) +from ._utils import ( + is_given, + get_async_library, +) +from ._version import __version__ +from ._streaming import Stream as Stream, AsyncStream as AsyncStream +from ._exceptions import APIStatusError +from ._base_client import ( + DEFAULT_MAX_RETRIES, + SyncAPIClient, + AsyncAPIClient, +) + +__all__ = [ + "Timeout", + "Transport", + "ProxiesTypes", + "RequestOptions", + "resources", + "Gitpod", + "AsyncGitpod", + "Client", + "AsyncClient", +] + + +class Gitpod(SyncAPIClient): + services: resources.ServicesResource + automations_files: resources.AutomationsFilesResource + tasks: resources.TasksResource + environment_automations: resources.EnvironmentAutomationsResource + environment_automation: resources.EnvironmentAutomationResource + environments: resources.EnvironmentsResource + environment_classes: resources.EnvironmentClassesResource + organizations: resources.OrganizationsResource + projects: resources.ProjectsResource + runner_configurations: resources.RunnerConfigurationsResource + runner_interactions: resources.RunnerInteractionsResource + runner_interaction: resources.RunnerInteractionResource + runners: resources.RunnersResource + personal_access_tokens: resources.PersonalAccessTokensResource + with_raw_response: GitpodWithRawResponse + with_streaming_response: GitpodWithStreamedResponse + + # client options + + def __init__( + self, + *, + base_url: str | httpx.URL | None = None, + timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + # Configure a custom httpx client. + # We provide a `DefaultHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. + # See the [httpx documentation](https://www.python-httpx.org/api/#client) for more details. + http_client: httpx.Client | None = None, + # Enable or disable schema validation for data returned by the API. + # When enabled an error APIResponseValidationError is raised + # if the API responds with invalid data for the expected schema. + # + # This parameter may be removed or changed in the future. + # If you rely on this feature, please open a GitHub issue + # outlining your use-case to help us decide if it should be + # part of our public interface in the future. + _strict_response_validation: bool = False, + ) -> None: + """Construct a new synchronous gitpod client instance.""" + if base_url is None: + base_url = os.environ.get("GITPOD_BASE_URL") + if base_url is None: + base_url = f"https://localhost:8080/test-api" + + super().__init__( + version=__version__, + base_url=base_url, + max_retries=max_retries, + timeout=timeout, + http_client=http_client, + custom_headers=default_headers, + custom_query=default_query, + _strict_response_validation=_strict_response_validation, + ) + + self.services = resources.ServicesResource(self) + self.automations_files = resources.AutomationsFilesResource(self) + self.tasks = resources.TasksResource(self) + self.environment_automations = resources.EnvironmentAutomationsResource(self) + self.environment_automation = resources.EnvironmentAutomationResource(self) + self.environments = resources.EnvironmentsResource(self) + self.environment_classes = resources.EnvironmentClassesResource(self) + self.organizations = resources.OrganizationsResource(self) + self.projects = resources.ProjectsResource(self) + self.runner_configurations = resources.RunnerConfigurationsResource(self) + self.runner_interactions = resources.RunnerInteractionsResource(self) + self.runner_interaction = resources.RunnerInteractionResource(self) + self.runners = resources.RunnersResource(self) + self.personal_access_tokens = resources.PersonalAccessTokensResource(self) + self.with_raw_response = GitpodWithRawResponse(self) + self.with_streaming_response = GitpodWithStreamedResponse(self) + + @property + @override + def qs(self) -> Querystring: + return Querystring(array_format="comma") + + @property + @override + def default_headers(self) -> dict[str, str | Omit]: + return { + **super().default_headers, + "X-Stainless-Async": "false", + **self._custom_headers, + } + + def copy( + self, + *, + base_url: str | httpx.URL | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + http_client: httpx.Client | None = None, + max_retries: int | NotGiven = NOT_GIVEN, + default_headers: Mapping[str, str] | None = None, + set_default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + set_default_query: Mapping[str, object] | None = None, + _extra_kwargs: Mapping[str, Any] = {}, + ) -> Self: + """ + Create a new client instance re-using the same options given to the current client with optional overriding. + """ + if default_headers is not None and set_default_headers is not None: + raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + + if default_query is not None and set_default_query is not None: + raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + + headers = self._custom_headers + if default_headers is not None: + headers = {**headers, **default_headers} + elif set_default_headers is not None: + headers = set_default_headers + + params = self._custom_query + if default_query is not None: + params = {**params, **default_query} + elif set_default_query is not None: + params = set_default_query + + http_client = http_client or self._client + return self.__class__( + base_url=base_url or self.base_url, + timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, + http_client=http_client, + max_retries=max_retries if is_given(max_retries) else self.max_retries, + default_headers=headers, + default_query=params, + **_extra_kwargs, + ) + + # Alias for `copy` for nicer inline usage, e.g. + # client.with_options(timeout=10).foo.create(...) + with_options = copy + + @override + def _make_status_error( + self, + err_msg: str, + *, + body: object, + response: httpx.Response, + ) -> APIStatusError: + if response.status_code == 400: + return _exceptions.BadRequestError(err_msg, response=response, body=body) + + if response.status_code == 401: + return _exceptions.AuthenticationError(err_msg, response=response, body=body) + + if response.status_code == 403: + return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) + + if response.status_code == 404: + return _exceptions.NotFoundError(err_msg, response=response, body=body) + + if response.status_code == 409: + return _exceptions.ConflictError(err_msg, response=response, body=body) + + if response.status_code == 422: + return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) + + if response.status_code == 429: + return _exceptions.RateLimitError(err_msg, response=response, body=body) + + if response.status_code >= 500: + return _exceptions.InternalServerError(err_msg, response=response, body=body) + return APIStatusError(err_msg, response=response, body=body) + + +class AsyncGitpod(AsyncAPIClient): + services: resources.AsyncServicesResource + automations_files: resources.AsyncAutomationsFilesResource + tasks: resources.AsyncTasksResource + environment_automations: resources.AsyncEnvironmentAutomationsResource + environment_automation: resources.AsyncEnvironmentAutomationResource + environments: resources.AsyncEnvironmentsResource + environment_classes: resources.AsyncEnvironmentClassesResource + organizations: resources.AsyncOrganizationsResource + projects: resources.AsyncProjectsResource + runner_configurations: resources.AsyncRunnerConfigurationsResource + runner_interactions: resources.AsyncRunnerInteractionsResource + runner_interaction: resources.AsyncRunnerInteractionResource + runners: resources.AsyncRunnersResource + personal_access_tokens: resources.AsyncPersonalAccessTokensResource + with_raw_response: AsyncGitpodWithRawResponse + with_streaming_response: AsyncGitpodWithStreamedResponse + + # client options + + def __init__( + self, + *, + base_url: str | httpx.URL | None = None, + timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + # Configure a custom httpx client. + # We provide a `DefaultAsyncHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. + # See the [httpx documentation](https://www.python-httpx.org/api/#asyncclient) for more details. + http_client: httpx.AsyncClient | None = None, + # Enable or disable schema validation for data returned by the API. + # When enabled an error APIResponseValidationError is raised + # if the API responds with invalid data for the expected schema. + # + # This parameter may be removed or changed in the future. + # If you rely on this feature, please open a GitHub issue + # outlining your use-case to help us decide if it should be + # part of our public interface in the future. + _strict_response_validation: bool = False, + ) -> None: + """Construct a new async gitpod client instance.""" + if base_url is None: + base_url = os.environ.get("GITPOD_BASE_URL") + if base_url is None: + base_url = f"https://localhost:8080/test-api" + + super().__init__( + version=__version__, + base_url=base_url, + max_retries=max_retries, + timeout=timeout, + http_client=http_client, + custom_headers=default_headers, + custom_query=default_query, + _strict_response_validation=_strict_response_validation, + ) + + self.services = resources.AsyncServicesResource(self) + self.automations_files = resources.AsyncAutomationsFilesResource(self) + self.tasks = resources.AsyncTasksResource(self) + self.environment_automations = resources.AsyncEnvironmentAutomationsResource(self) + self.environment_automation = resources.AsyncEnvironmentAutomationResource(self) + self.environments = resources.AsyncEnvironmentsResource(self) + self.environment_classes = resources.AsyncEnvironmentClassesResource(self) + self.organizations = resources.AsyncOrganizationsResource(self) + self.projects = resources.AsyncProjectsResource(self) + self.runner_configurations = resources.AsyncRunnerConfigurationsResource(self) + self.runner_interactions = resources.AsyncRunnerInteractionsResource(self) + self.runner_interaction = resources.AsyncRunnerInteractionResource(self) + self.runners = resources.AsyncRunnersResource(self) + self.personal_access_tokens = resources.AsyncPersonalAccessTokensResource(self) + self.with_raw_response = AsyncGitpodWithRawResponse(self) + self.with_streaming_response = AsyncGitpodWithStreamedResponse(self) + + @property + @override + def qs(self) -> Querystring: + return Querystring(array_format="comma") + + @property + @override + def default_headers(self) -> dict[str, str | Omit]: + return { + **super().default_headers, + "X-Stainless-Async": f"async:{get_async_library()}", + **self._custom_headers, + } + + def copy( + self, + *, + base_url: str | httpx.URL | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + http_client: httpx.AsyncClient | None = None, + max_retries: int | NotGiven = NOT_GIVEN, + default_headers: Mapping[str, str] | None = None, + set_default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + set_default_query: Mapping[str, object] | None = None, + _extra_kwargs: Mapping[str, Any] = {}, + ) -> Self: + """ + Create a new client instance re-using the same options given to the current client with optional overriding. + """ + if default_headers is not None and set_default_headers is not None: + raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + + if default_query is not None and set_default_query is not None: + raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + + headers = self._custom_headers + if default_headers is not None: + headers = {**headers, **default_headers} + elif set_default_headers is not None: + headers = set_default_headers + + params = self._custom_query + if default_query is not None: + params = {**params, **default_query} + elif set_default_query is not None: + params = set_default_query + + http_client = http_client or self._client + return self.__class__( + base_url=base_url or self.base_url, + timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, + http_client=http_client, + max_retries=max_retries if is_given(max_retries) else self.max_retries, + default_headers=headers, + default_query=params, + **_extra_kwargs, + ) + + # Alias for `copy` for nicer inline usage, e.g. + # client.with_options(timeout=10).foo.create(...) + with_options = copy + + @override + def _make_status_error( + self, + err_msg: str, + *, + body: object, + response: httpx.Response, + ) -> APIStatusError: + if response.status_code == 400: + return _exceptions.BadRequestError(err_msg, response=response, body=body) + + if response.status_code == 401: + return _exceptions.AuthenticationError(err_msg, response=response, body=body) + + if response.status_code == 403: + return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) + + if response.status_code == 404: + return _exceptions.NotFoundError(err_msg, response=response, body=body) + + if response.status_code == 409: + return _exceptions.ConflictError(err_msg, response=response, body=body) + + if response.status_code == 422: + return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) + + if response.status_code == 429: + return _exceptions.RateLimitError(err_msg, response=response, body=body) + + if response.status_code >= 500: + return _exceptions.InternalServerError(err_msg, response=response, body=body) + return APIStatusError(err_msg, response=response, body=body) + + +class GitpodWithRawResponse: + def __init__(self, client: Gitpod) -> None: + self.services = resources.ServicesResourceWithRawResponse(client.services) + self.automations_files = resources.AutomationsFilesResourceWithRawResponse(client.automations_files) + self.tasks = resources.TasksResourceWithRawResponse(client.tasks) + self.environment_automations = resources.EnvironmentAutomationsResourceWithRawResponse( + client.environment_automations + ) + self.environment_automation = resources.EnvironmentAutomationResourceWithRawResponse( + client.environment_automation + ) + self.environments = resources.EnvironmentsResourceWithRawResponse(client.environments) + self.environment_classes = resources.EnvironmentClassesResourceWithRawResponse(client.environment_classes) + self.organizations = resources.OrganizationsResourceWithRawResponse(client.organizations) + self.projects = resources.ProjectsResourceWithRawResponse(client.projects) + self.runner_configurations = resources.RunnerConfigurationsResourceWithRawResponse(client.runner_configurations) + self.runner_interactions = resources.RunnerInteractionsResourceWithRawResponse(client.runner_interactions) + self.runner_interaction = resources.RunnerInteractionResourceWithRawResponse(client.runner_interaction) + self.runners = resources.RunnersResourceWithRawResponse(client.runners) + self.personal_access_tokens = resources.PersonalAccessTokensResourceWithRawResponse( + client.personal_access_tokens + ) + + +class AsyncGitpodWithRawResponse: + def __init__(self, client: AsyncGitpod) -> None: + self.services = resources.AsyncServicesResourceWithRawResponse(client.services) + self.automations_files = resources.AsyncAutomationsFilesResourceWithRawResponse(client.automations_files) + self.tasks = resources.AsyncTasksResourceWithRawResponse(client.tasks) + self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithRawResponse( + client.environment_automations + ) + self.environment_automation = resources.AsyncEnvironmentAutomationResourceWithRawResponse( + client.environment_automation + ) + self.environments = resources.AsyncEnvironmentsResourceWithRawResponse(client.environments) + self.environment_classes = resources.AsyncEnvironmentClassesResourceWithRawResponse(client.environment_classes) + self.organizations = resources.AsyncOrganizationsResourceWithRawResponse(client.organizations) + self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) + self.runner_configurations = resources.AsyncRunnerConfigurationsResourceWithRawResponse( + client.runner_configurations + ) + self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithRawResponse(client.runner_interactions) + self.runner_interaction = resources.AsyncRunnerInteractionResourceWithRawResponse(client.runner_interaction) + self.runners = resources.AsyncRunnersResourceWithRawResponse(client.runners) + self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithRawResponse( + client.personal_access_tokens + ) + + +class GitpodWithStreamedResponse: + def __init__(self, client: Gitpod) -> None: + self.services = resources.ServicesResourceWithStreamingResponse(client.services) + self.automations_files = resources.AutomationsFilesResourceWithStreamingResponse(client.automations_files) + self.tasks = resources.TasksResourceWithStreamingResponse(client.tasks) + self.environment_automations = resources.EnvironmentAutomationsResourceWithStreamingResponse( + client.environment_automations + ) + self.environment_automation = resources.EnvironmentAutomationResourceWithStreamingResponse( + client.environment_automation + ) + self.environments = resources.EnvironmentsResourceWithStreamingResponse(client.environments) + self.environment_classes = resources.EnvironmentClassesResourceWithStreamingResponse(client.environment_classes) + self.organizations = resources.OrganizationsResourceWithStreamingResponse(client.organizations) + self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) + self.runner_configurations = resources.RunnerConfigurationsResourceWithStreamingResponse( + client.runner_configurations + ) + self.runner_interactions = resources.RunnerInteractionsResourceWithStreamingResponse(client.runner_interactions) + self.runner_interaction = resources.RunnerInteractionResourceWithStreamingResponse(client.runner_interaction) + self.runners = resources.RunnersResourceWithStreamingResponse(client.runners) + self.personal_access_tokens = resources.PersonalAccessTokensResourceWithStreamingResponse( + client.personal_access_tokens + ) + + +class AsyncGitpodWithStreamedResponse: + def __init__(self, client: AsyncGitpod) -> None: + self.services = resources.AsyncServicesResourceWithStreamingResponse(client.services) + self.automations_files = resources.AsyncAutomationsFilesResourceWithStreamingResponse(client.automations_files) + self.tasks = resources.AsyncTasksResourceWithStreamingResponse(client.tasks) + self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithStreamingResponse( + client.environment_automations + ) + self.environment_automation = resources.AsyncEnvironmentAutomationResourceWithStreamingResponse( + client.environment_automation + ) + self.environments = resources.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) + self.environment_classes = resources.AsyncEnvironmentClassesResourceWithStreamingResponse( + client.environment_classes + ) + self.organizations = resources.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) + self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) + self.runner_configurations = resources.AsyncRunnerConfigurationsResourceWithStreamingResponse( + client.runner_configurations + ) + self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithStreamingResponse( + client.runner_interactions + ) + self.runner_interaction = resources.AsyncRunnerInteractionResourceWithStreamingResponse( + client.runner_interaction + ) + self.runners = resources.AsyncRunnersResourceWithStreamingResponse(client.runners) + self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithStreamingResponse( + client.personal_access_tokens + ) + + +Client = Gitpod + +AsyncClient = AsyncGitpod diff --git a/src/gitpod/_compat.py b/src/gitpod/_compat.py new file mode 100644 index 00000000..d89920d9 --- /dev/null +++ b/src/gitpod/_compat.py @@ -0,0 +1,219 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload +from datetime import date, datetime +from typing_extensions import Self + +import pydantic +from pydantic.fields import FieldInfo + +from ._types import IncEx, StrBytesIntFloat + +_T = TypeVar("_T") +_ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel) + +# --------------- Pydantic v2 compatibility --------------- + +# Pyright incorrectly reports some of our functions as overriding a method when they don't +# pyright: reportIncompatibleMethodOverride=false + +PYDANTIC_V2 = pydantic.VERSION.startswith("2.") + +# v1 re-exports +if TYPE_CHECKING: + + def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001 + ... + + def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: # noqa: ARG001 + ... + + def get_args(t: type[Any]) -> tuple[Any, ...]: # noqa: ARG001 + ... + + def is_union(tp: type[Any] | None) -> bool: # noqa: ARG001 + ... + + def get_origin(t: type[Any]) -> type[Any] | None: # noqa: ARG001 + ... + + def is_literal_type(type_: type[Any]) -> bool: # noqa: ARG001 + ... + + def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001 + ... + +else: + if PYDANTIC_V2: + from pydantic.v1.typing import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, + ) + from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime + else: + from pydantic.typing import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, + ) + from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime + + +# refactored config +if TYPE_CHECKING: + from pydantic import ConfigDict as ConfigDict +else: + if PYDANTIC_V2: + from pydantic import ConfigDict + else: + # TODO: provide an error message here? + ConfigDict = None + + +# renamed methods / properties +def parse_obj(model: type[_ModelT], value: object) -> _ModelT: + if PYDANTIC_V2: + return model.model_validate(value) + else: + return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + + +def field_is_required(field: FieldInfo) -> bool: + if PYDANTIC_V2: + return field.is_required() + return field.required # type: ignore + + +def field_get_default(field: FieldInfo) -> Any: + value = field.get_default() + if PYDANTIC_V2: + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None + return value + return value + + +def field_outer_type(field: FieldInfo) -> Any: + if PYDANTIC_V2: + return field.annotation + return field.outer_type_ # type: ignore + + +def get_model_config(model: type[pydantic.BaseModel]) -> Any: + if PYDANTIC_V2: + return model.model_config + return model.__config__ # type: ignore + + +def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]: + if PYDANTIC_V2: + return model.model_fields + return model.__fields__ # type: ignore + + +def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT: + if PYDANTIC_V2: + return model.model_copy(deep=deep) + return model.copy(deep=deep) # type: ignore + + +def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: + if PYDANTIC_V2: + return model.model_dump_json(indent=indent) + return model.json(indent=indent) # type: ignore + + +def model_dump( + model: pydantic.BaseModel, + *, + exclude: IncEx | None = None, + exclude_unset: bool = False, + exclude_defaults: bool = False, + warnings: bool = True, +) -> dict[str, Any]: + if PYDANTIC_V2: + return model.model_dump( + exclude=exclude, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + warnings=warnings, + ) + return cast( + "dict[str, Any]", + model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + exclude=exclude, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + ), + ) + + +def model_parse(model: type[_ModelT], data: Any) -> _ModelT: + if PYDANTIC_V2: + return model.model_validate(data) + return model.parse_obj(data) # pyright: ignore[reportDeprecated] + + +# generic models +if TYPE_CHECKING: + + class GenericModel(pydantic.BaseModel): ... + +else: + if PYDANTIC_V2: + # there no longer needs to be a distinction in v2 but + # we still have to create our own subclass to avoid + # inconsistent MRO ordering errors + class GenericModel(pydantic.BaseModel): ... + + else: + import pydantic.generics + + class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... + + +# cached properties +if TYPE_CHECKING: + cached_property = property + + # we define a separate type (copied from typeshed) + # that represents that `cached_property` is `set`able + # at runtime, which differs from `@property`. + # + # this is a separate type as editors likely special case + # `@property` and we don't want to cause issues just to have + # more helpful internal types. + + class typed_cached_property(Generic[_T]): + func: Callable[[Any], _T] + attrname: str | None + + def __init__(self, func: Callable[[Any], _T]) -> None: ... + + @overload + def __get__(self, instance: None, owner: type[Any] | None = None) -> Self: ... + + @overload + def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: ... + + def __get__(self, instance: object, owner: type[Any] | None = None) -> _T | Self: + raise NotImplementedError() + + def __set_name__(self, owner: type[Any], name: str) -> None: ... + + # __set__ is not defined at runtime, but @cached_property is designed to be settable + def __set__(self, instance: object, value: _T) -> None: ... +else: + try: + from functools import cached_property as cached_property + except ImportError: + from cached_property import cached_property as cached_property + + typed_cached_property = cached_property diff --git a/src/gitpod/_constants.py b/src/gitpod/_constants.py new file mode 100644 index 00000000..a2ac3b6f --- /dev/null +++ b/src/gitpod/_constants.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import httpx + +RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" +OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" + +# default timeout is 1 minute +DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0) +DEFAULT_MAX_RETRIES = 2 +DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) + +INITIAL_RETRY_DELAY = 0.5 +MAX_RETRY_DELAY = 8.0 diff --git a/src/gitpod/_exceptions.py b/src/gitpod/_exceptions.py new file mode 100644 index 00000000..93778359 --- /dev/null +++ b/src/gitpod/_exceptions.py @@ -0,0 +1,108 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +__all__ = [ + "BadRequestError", + "AuthenticationError", + "PermissionDeniedError", + "NotFoundError", + "ConflictError", + "UnprocessableEntityError", + "RateLimitError", + "InternalServerError", +] + + +class GitpodError(Exception): + pass + + +class APIError(GitpodError): + message: str + request: httpx.Request + + body: object | None + """The API response body. + + If the API responded with a valid JSON structure then this property will be the + decoded result. + + If it isn't a valid JSON structure then this will be the raw response. + + If there was no response associated with this error then it will be `None`. + """ + + def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: # noqa: ARG002 + super().__init__(message) + self.request = request + self.message = message + self.body = body + + +class APIResponseValidationError(APIError): + response: httpx.Response + status_code: int + + def __init__(self, response: httpx.Response, body: object | None, *, message: str | None = None) -> None: + super().__init__(message or "Data returned by API invalid for expected schema.", response.request, body=body) + self.response = response + self.status_code = response.status_code + + +class APIStatusError(APIError): + """Raised when an API response has a status code of 4xx or 5xx.""" + + response: httpx.Response + status_code: int + + def __init__(self, message: str, *, response: httpx.Response, body: object | None) -> None: + super().__init__(message, response.request, body=body) + self.response = response + self.status_code = response.status_code + + +class APIConnectionError(APIError): + def __init__(self, *, message: str = "Connection error.", request: httpx.Request) -> None: + super().__init__(message, request, body=None) + + +class APITimeoutError(APIConnectionError): + def __init__(self, request: httpx.Request) -> None: + super().__init__(message="Request timed out.", request=request) + + +class BadRequestError(APIStatusError): + status_code: Literal[400] = 400 # pyright: ignore[reportIncompatibleVariableOverride] + + +class AuthenticationError(APIStatusError): + status_code: Literal[401] = 401 # pyright: ignore[reportIncompatibleVariableOverride] + + +class PermissionDeniedError(APIStatusError): + status_code: Literal[403] = 403 # pyright: ignore[reportIncompatibleVariableOverride] + + +class NotFoundError(APIStatusError): + status_code: Literal[404] = 404 # pyright: ignore[reportIncompatibleVariableOverride] + + +class ConflictError(APIStatusError): + status_code: Literal[409] = 409 # pyright: ignore[reportIncompatibleVariableOverride] + + +class UnprocessableEntityError(APIStatusError): + status_code: Literal[422] = 422 # pyright: ignore[reportIncompatibleVariableOverride] + + +class RateLimitError(APIStatusError): + status_code: Literal[429] = 429 # pyright: ignore[reportIncompatibleVariableOverride] + + +class InternalServerError(APIStatusError): + pass diff --git a/src/gitpod/_files.py b/src/gitpod/_files.py new file mode 100644 index 00000000..715cc207 --- /dev/null +++ b/src/gitpod/_files.py @@ -0,0 +1,123 @@ +from __future__ import annotations + +import io +import os +import pathlib +from typing import overload +from typing_extensions import TypeGuard + +import anyio + +from ._types import ( + FileTypes, + FileContent, + RequestFiles, + HttpxFileTypes, + Base64FileInput, + HttpxFileContent, + HttpxRequestFiles, +) +from ._utils import is_tuple_t, is_mapping_t, is_sequence_t + + +def is_base64_file_input(obj: object) -> TypeGuard[Base64FileInput]: + return isinstance(obj, io.IOBase) or isinstance(obj, os.PathLike) + + +def is_file_content(obj: object) -> TypeGuard[FileContent]: + return ( + isinstance(obj, bytes) or isinstance(obj, tuple) or isinstance(obj, io.IOBase) or isinstance(obj, os.PathLike) + ) + + +def assert_is_file_content(obj: object, *, key: str | None = None) -> None: + if not is_file_content(obj): + prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`" + raise RuntimeError( + f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead." + ) from None + + +@overload +def to_httpx_files(files: None) -> None: ... + + +@overload +def to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ... + + +def to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None: + if files is None: + return None + + if is_mapping_t(files): + files = {key: _transform_file(file) for key, file in files.items()} + elif is_sequence_t(files): + files = [(key, _transform_file(file)) for key, file in files] + else: + raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence") + + return files + + +def _transform_file(file: FileTypes) -> HttpxFileTypes: + if is_file_content(file): + if isinstance(file, os.PathLike): + path = pathlib.Path(file) + return (path.name, path.read_bytes()) + + return file + + if is_tuple_t(file): + return (file[0], _read_file_content(file[1]), *file[2:]) + + raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") + + +def _read_file_content(file: FileContent) -> HttpxFileContent: + if isinstance(file, os.PathLike): + return pathlib.Path(file).read_bytes() + return file + + +@overload +async def async_to_httpx_files(files: None) -> None: ... + + +@overload +async def async_to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ... + + +async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None: + if files is None: + return None + + if is_mapping_t(files): + files = {key: await _async_transform_file(file) for key, file in files.items()} + elif is_sequence_t(files): + files = [(key, await _async_transform_file(file)) for key, file in files] + else: + raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence") + + return files + + +async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: + if is_file_content(file): + if isinstance(file, os.PathLike): + path = anyio.Path(file) + return (path.name, await path.read_bytes()) + + return file + + if is_tuple_t(file): + return (file[0], await _async_read_file_content(file[1]), *file[2:]) + + raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") + + +async def _async_read_file_content(file: FileContent) -> HttpxFileContent: + if isinstance(file, os.PathLike): + return await anyio.Path(file).read_bytes() + + return file diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py new file mode 100644 index 00000000..42551b76 --- /dev/null +++ b/src/gitpod/_models.py @@ -0,0 +1,785 @@ +from __future__ import annotations + +import os +import inspect +from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast +from datetime import date, datetime +from typing_extensions import ( + Unpack, + Literal, + ClassVar, + Protocol, + Required, + ParamSpec, + TypedDict, + TypeGuard, + final, + override, + runtime_checkable, +) + +import pydantic +import pydantic.generics +from pydantic.fields import FieldInfo + +from ._types import ( + Body, + IncEx, + Query, + ModelT, + Headers, + Timeout, + NotGiven, + AnyMapping, + HttpxRequestFiles, +) +from ._utils import ( + PropertyInfo, + is_list, + is_given, + lru_cache, + is_mapping, + parse_date, + coerce_boolean, + parse_datetime, + strip_not_given, + extract_type_arg, + is_annotated_type, + strip_annotated_type, +) +from ._compat import ( + PYDANTIC_V2, + ConfigDict, + GenericModel as BaseGenericModel, + get_args, + is_union, + parse_obj, + get_origin, + is_literal_type, + get_model_config, + get_model_fields, + field_get_default, +) +from ._constants import RAW_RESPONSE_HEADER + +if TYPE_CHECKING: + from pydantic_core.core_schema import ModelField, LiteralSchema, ModelFieldsSchema + +__all__ = ["BaseModel", "GenericModel"] + +_T = TypeVar("_T") +_BaseModelT = TypeVar("_BaseModelT", bound="BaseModel") + +P = ParamSpec("P") + + +@runtime_checkable +class _ConfigProtocol(Protocol): + allow_population_by_field_name: bool + + +class BaseModel(pydantic.BaseModel): + if PYDANTIC_V2: + model_config: ClassVar[ConfigDict] = ConfigDict( + extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) + ) + else: + + @property + @override + def model_fields_set(self) -> set[str]: + # a forwards-compat shim for pydantic v2 + return self.__fields_set__ # type: ignore + + class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] + extra: Any = pydantic.Extra.allow # type: ignore + + def to_dict( + self, + *, + mode: Literal["json", "python"] = "python", + use_api_names: bool = True, + exclude_unset: bool = True, + exclude_defaults: bool = False, + exclude_none: bool = False, + warnings: bool = True, + ) -> dict[str, object]: + """Recursively generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + + By default, fields that were not set by the API will not be included, + and keys will match the API response, *not* the property names from the model. + + For example, if the API responds with `"fooBar": true` but we've defined a `foo_bar: bool` property, + the output will use the `"fooBar"` key (unless `use_api_names=False` is passed). + + Args: + mode: + If mode is 'json', the dictionary will only contain JSON serializable types. e.g. `datetime` will be turned into a string, `"2024-3-22T18:11:19.117000Z"`. + If mode is 'python', the dictionary may contain any Python objects. e.g. `datetime(2024, 3, 22)` + + use_api_names: Whether to use the key that the API responded with or the property name. Defaults to `True`. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value from the output. + exclude_none: Whether to exclude fields that have a value of `None` from the output. + warnings: Whether to log warnings when invalid fields are encountered. This is only supported in Pydantic v2. + """ + return self.model_dump( + mode=mode, + by_alias=use_api_names, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + warnings=warnings, + ) + + def to_json( + self, + *, + indent: int | None = 2, + use_api_names: bool = True, + exclude_unset: bool = True, + exclude_defaults: bool = False, + exclude_none: bool = False, + warnings: bool = True, + ) -> str: + """Generates a JSON string representing this model as it would be received from or sent to the API (but with indentation). + + By default, fields that were not set by the API will not be included, + and keys will match the API response, *not* the property names from the model. + + For example, if the API responds with `"fooBar": true` but we've defined a `foo_bar: bool` property, + the output will use the `"fooBar"` key (unless `use_api_names=False` is passed). + + Args: + indent: Indentation to use in the JSON output. If `None` is passed, the output will be compact. Defaults to `2` + use_api_names: Whether to use the key that the API responded with or the property name. Defaults to `True`. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that have the default value. + exclude_none: Whether to exclude fields that have a value of `None`. + warnings: Whether to show any warnings that occurred during serialization. This is only supported in Pydantic v2. + """ + return self.model_dump_json( + indent=indent, + by_alias=use_api_names, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + warnings=warnings, + ) + + @override + def __str__(self) -> str: + # mypy complains about an invalid self arg + return f'{self.__repr_name__()}({self.__repr_str__(", ")})' # type: ignore[misc] + + # Override the 'construct' method in a way that supports recursive parsing without validation. + # Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836. + @classmethod + @override + def construct( # pyright: ignore[reportIncompatibleMethodOverride] + cls: Type[ModelT], + _fields_set: set[str] | None = None, + **values: object, + ) -> ModelT: + m = cls.__new__(cls) + fields_values: dict[str, object] = {} + + config = get_model_config(cls) + populate_by_name = ( + config.allow_population_by_field_name + if isinstance(config, _ConfigProtocol) + else config.get("populate_by_name") + ) + + if _fields_set is None: + _fields_set = set() + + model_fields = get_model_fields(cls) + for name, field in model_fields.items(): + key = field.alias + if key is None or (key not in values and populate_by_name): + key = name + + if key in values: + fields_values[name] = _construct_field(value=values[key], field=field, key=key) + _fields_set.add(name) + else: + fields_values[name] = field_get_default(field) + + _extra = {} + for key, value in values.items(): + if key not in model_fields: + if PYDANTIC_V2: + _extra[key] = value + else: + _fields_set.add(key) + fields_values[key] = value + + object.__setattr__(m, "__dict__", fields_values) + + if PYDANTIC_V2: + # these properties are copied from Pydantic's `model_construct()` method + object.__setattr__(m, "__pydantic_private__", None) + object.__setattr__(m, "__pydantic_extra__", _extra) + object.__setattr__(m, "__pydantic_fields_set__", _fields_set) + else: + # init_private_attributes() does not exist in v2 + m._init_private_attributes() # type: ignore + + # copied from Pydantic v1's `construct()` method + object.__setattr__(m, "__fields_set__", _fields_set) + + return m + + if not TYPE_CHECKING: + # type checkers incorrectly complain about this assignment + # because the type signatures are technically different + # although not in practice + model_construct = construct + + if not PYDANTIC_V2: + # we define aliases for some of the new pydantic v2 methods so + # that we can just document these methods without having to specify + # a specific pydantic version as some users may not know which + # pydantic version they are currently using + + @override + def model_dump( + self, + *, + mode: Literal["json", "python"] | str = "python", + include: IncEx | None = None, + exclude: IncEx | None = None, + by_alias: bool = False, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, + round_trip: bool = False, + warnings: bool | Literal["none", "warn", "error"] = True, + context: dict[str, Any] | None = None, + serialize_as_any: bool = False, + ) -> dict[str, Any]: + """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump + + Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + + Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the dictionary will only contain JSON serializable types. + If mode is 'python', the dictionary may contain any Python objects. + include: A list of fields to include in the output. + exclude: A list of fields to exclude from the output. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that are unset or None from the output. + exclude_defaults: Whether to exclude fields that are set to their default value from the output. + exclude_none: Whether to exclude fields that have a value of `None` from the output. + round_trip: Whether to enable serialization and deserialization round-trip support. + warnings: Whether to log warnings when invalid fields are encountered. + + Returns: + A dictionary representation of the model. + """ + if mode != "python": + raise ValueError("mode is only supported in Pydantic v2") + if round_trip != False: + raise ValueError("round_trip is only supported in Pydantic v2") + if warnings != True: + raise ValueError("warnings is only supported in Pydantic v2") + if context is not None: + raise ValueError("context is only supported in Pydantic v2") + if serialize_as_any != False: + raise ValueError("serialize_as_any is only supported in Pydantic v2") + return super().dict( # pyright: ignore[reportDeprecated] + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + ) + + @override + def model_dump_json( + self, + *, + indent: int | None = None, + include: IncEx | None = None, + exclude: IncEx | None = None, + by_alias: bool = False, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, + round_trip: bool = False, + warnings: bool | Literal["none", "warn", "error"] = True, + context: dict[str, Any] | None = None, + serialize_as_any: bool = False, + ) -> str: + """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json + + Generates a JSON representation of the model using Pydantic's `to_json` method. + + Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. Can take either a string or set of strings. + exclude: Field(s) to exclude from the JSON output. Can take either a string or set of strings. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that have the default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: Whether to use serialization/deserialization between JSON and class instance. + warnings: Whether to show any warnings that occurred during serialization. + + Returns: + A JSON string representation of the model. + """ + if round_trip != False: + raise ValueError("round_trip is only supported in Pydantic v2") + if warnings != True: + raise ValueError("warnings is only supported in Pydantic v2") + if context is not None: + raise ValueError("context is only supported in Pydantic v2") + if serialize_as_any != False: + raise ValueError("serialize_as_any is only supported in Pydantic v2") + return super().json( # type: ignore[reportDeprecated] + indent=indent, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + ) + + +def _construct_field(value: object, field: FieldInfo, key: str) -> object: + if value is None: + return field_get_default(field) + + if PYDANTIC_V2: + type_ = field.annotation + else: + type_ = cast(type, field.outer_type_) # type: ignore + + if type_ is None: + raise RuntimeError(f"Unexpected field type is None for {key}") + + return construct_type(value=value, type_=type_) + + +def is_basemodel(type_: type) -> bool: + """Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`""" + if is_union(type_): + for variant in get_args(type_): + if is_basemodel(variant): + return True + + return False + + return is_basemodel_type(type_) + + +def is_basemodel_type(type_: type) -> TypeGuard[type[BaseModel] | type[GenericModel]]: + origin = get_origin(type_) or type_ + if not inspect.isclass(origin): + return False + return issubclass(origin, BaseModel) or issubclass(origin, GenericModel) + + +def build( + base_model_cls: Callable[P, _BaseModelT], + *args: P.args, + **kwargs: P.kwargs, +) -> _BaseModelT: + """Construct a BaseModel class without validation. + + This is useful for cases where you need to instantiate a `BaseModel` + from an API response as this provides type-safe params which isn't supported + by helpers like `construct_type()`. + + ```py + build(MyModel, my_field_a="foo", my_field_b=123) + ``` + """ + if args: + raise TypeError( + "Received positional arguments which are not supported; Keyword arguments must be used instead", + ) + + return cast(_BaseModelT, construct_type(type_=base_model_cls, value=kwargs)) + + +def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T: + """Loose coercion to the expected type with construction of nested values. + + Note: the returned value from this function is not guaranteed to match the + given type. + """ + return cast(_T, construct_type(value=value, type_=type_)) + + +def construct_type(*, value: object, type_: object) -> object: + """Loose coercion to the expected type with construction of nested values. + + If the given value does not match the expected type then it is returned as-is. + """ + # we allow `object` as the input type because otherwise, passing things like + # `Literal['value']` will be reported as a type error by type checkers + type_ = cast("type[object]", type_) + + # unwrap `Annotated[T, ...]` -> `T` + if is_annotated_type(type_): + meta: tuple[Any, ...] = get_args(type_)[1:] + type_ = extract_type_arg(type_, 0) + else: + meta = tuple() + + # we need to use the origin class for any types that are subscripted generics + # e.g. Dict[str, object] + origin = get_origin(type_) or type_ + args = get_args(type_) + + if is_union(origin): + try: + return validate_type(type_=cast("type[object]", type_), value=value) + except Exception: + pass + + # if the type is a discriminated union then we want to construct the right variant + # in the union, even if the data doesn't match exactly, otherwise we'd break code + # that relies on the constructed class types, e.g. + # + # class FooType: + # kind: Literal['foo'] + # value: str + # + # class BarType: + # kind: Literal['bar'] + # value: int + # + # without this block, if the data we get is something like `{'kind': 'bar', 'value': 'foo'}` then + # we'd end up constructing `FooType` when it should be `BarType`. + discriminator = _build_discriminated_union_meta(union=type_, meta_annotations=meta) + if discriminator and is_mapping(value): + variant_value = value.get(discriminator.field_alias_from or discriminator.field_name) + if variant_value and isinstance(variant_value, str): + variant_type = discriminator.mapping.get(variant_value) + if variant_type: + return construct_type(type_=variant_type, value=value) + + # if the data is not valid, use the first variant that doesn't fail while deserializing + for variant in args: + try: + return construct_type(value=value, type_=variant) + except Exception: + continue + + raise RuntimeError(f"Could not convert data into a valid instance of {type_}") + + if origin == dict: + if not is_mapping(value): + return value + + _, items_type = get_args(type_) # Dict[_, items_type] + return {key: construct_type(value=item, type_=items_type) for key, item in value.items()} + + if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)): + if is_list(value): + return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value] + + if is_mapping(value): + if issubclass(type_, BaseModel): + return type_.construct(**value) # type: ignore[arg-type] + + return cast(Any, type_).construct(**value) + + if origin == list: + if not is_list(value): + return value + + inner_type = args[0] # List[inner_type] + return [construct_type(value=entry, type_=inner_type) for entry in value] + + if origin == float: + if isinstance(value, int): + coerced = float(value) + if coerced != value: + return value + return coerced + + return value + + if type_ == datetime: + try: + return parse_datetime(value) # type: ignore + except Exception: + return value + + if type_ == date: + try: + return parse_date(value) # type: ignore + except Exception: + return value + + return value + + +@runtime_checkable +class CachedDiscriminatorType(Protocol): + __discriminator__: DiscriminatorDetails + + +class DiscriminatorDetails: + field_name: str + """The name of the discriminator field in the variant class, e.g. + + ```py + class Foo(BaseModel): + type: Literal['foo'] + ``` + + Will result in field_name='type' + """ + + field_alias_from: str | None + """The name of the discriminator field in the API response, e.g. + + ```py + class Foo(BaseModel): + type: Literal['foo'] = Field(alias='type_from_api') + ``` + + Will result in field_alias_from='type_from_api' + """ + + mapping: dict[str, type] + """Mapping of discriminator value to variant type, e.g. + + {'foo': FooVariant, 'bar': BarVariant} + """ + + def __init__( + self, + *, + mapping: dict[str, type], + discriminator_field: str, + discriminator_alias: str | None, + ) -> None: + self.mapping = mapping + self.field_name = discriminator_field + self.field_alias_from = discriminator_alias + + +def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None: + if isinstance(union, CachedDiscriminatorType): + return union.__discriminator__ + + discriminator_field_name: str | None = None + + for annotation in meta_annotations: + if isinstance(annotation, PropertyInfo) and annotation.discriminator is not None: + discriminator_field_name = annotation.discriminator + break + + if not discriminator_field_name: + return None + + mapping: dict[str, type] = {} + discriminator_alias: str | None = None + + for variant in get_args(union): + variant = strip_annotated_type(variant) + if is_basemodel_type(variant): + if PYDANTIC_V2: + field = _extract_field_schema_pv2(variant, discriminator_field_name) + if not field: + continue + + # Note: if one variant defines an alias then they all should + discriminator_alias = field.get("serialization_alias") + + field_schema = field["schema"] + + if field_schema["type"] == "literal": + for entry in cast("LiteralSchema", field_schema)["expected"]: + if isinstance(entry, str): + mapping[entry] = variant + else: + field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + if not field_info: + continue + + # Note: if one variant defines an alias then they all should + discriminator_alias = field_info.alias + + if field_info.annotation and is_literal_type(field_info.annotation): + for entry in get_args(field_info.annotation): + if isinstance(entry, str): + mapping[entry] = variant + + if not mapping: + return None + + details = DiscriminatorDetails( + mapping=mapping, + discriminator_field=discriminator_field_name, + discriminator_alias=discriminator_alias, + ) + cast(CachedDiscriminatorType, union).__discriminator__ = details + return details + + +def _extract_field_schema_pv2(model: type[BaseModel], field_name: str) -> ModelField | None: + schema = model.__pydantic_core_schema__ + if schema["type"] != "model": + return None + + fields_schema = schema["schema"] + if fields_schema["type"] != "model-fields": + return None + + fields_schema = cast("ModelFieldsSchema", fields_schema) + + field = fields_schema["fields"].get(field_name) + if not field: + return None + + return cast("ModelField", field) # pyright: ignore[reportUnnecessaryCast] + + +def validate_type(*, type_: type[_T], value: object) -> _T: + """Strict validation that the given value matches the expected type""" + if inspect.isclass(type_) and issubclass(type_, pydantic.BaseModel): + return cast(_T, parse_obj(type_, value)) + + return cast(_T, _validate_non_model_type(type_=type_, value=value)) + + +def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None: + """Add a pydantic config for the given type. + + Note: this is a no-op on Pydantic v1. + """ + setattr(typ, "__pydantic_config__", config) # noqa: B010 + + +# our use of subclasssing here causes weirdness for type checkers, +# so we just pretend that we don't subclass +if TYPE_CHECKING: + GenericModel = BaseModel +else: + + class GenericModel(BaseGenericModel, BaseModel): + pass + + +if PYDANTIC_V2: + from pydantic import TypeAdapter as _TypeAdapter + + _CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter)) + + if TYPE_CHECKING: + from pydantic import TypeAdapter + else: + TypeAdapter = _CachedTypeAdapter + + def _validate_non_model_type(*, type_: type[_T], value: object) -> _T: + return TypeAdapter(type_).validate_python(value) + +elif not TYPE_CHECKING: # TODO: condition is weird + + class RootModel(GenericModel, Generic[_T]): + """Used as a placeholder to easily convert runtime types to a Pydantic format + to provide validation. + + For example: + ```py + validated = RootModel[int](__root__="5").__root__ + # validated: 5 + ``` + """ + + __root__: _T + + def _validate_non_model_type(*, type_: type[_T], value: object) -> _T: + model = _create_pydantic_model(type_).validate(value) + return cast(_T, model.__root__) + + def _create_pydantic_model(type_: _T) -> Type[RootModel[_T]]: + return RootModel[type_] # type: ignore + + +class FinalRequestOptionsInput(TypedDict, total=False): + method: Required[str] + url: Required[str] + params: Query + headers: Headers + max_retries: int + timeout: float | Timeout | None + files: HttpxRequestFiles | None + idempotency_key: str + json_data: Body + extra_json: AnyMapping + + +@final +class FinalRequestOptions(pydantic.BaseModel): + method: str + url: str + params: Query = {} + headers: Union[Headers, NotGiven] = NotGiven() + max_retries: Union[int, NotGiven] = NotGiven() + timeout: Union[float, Timeout, None, NotGiven] = NotGiven() + files: Union[HttpxRequestFiles, None] = None + idempotency_key: Union[str, None] = None + post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() + + # It should be noted that we cannot use `json` here as that would override + # a BaseModel method in an incompatible fashion. + json_data: Union[Body, None] = None + extra_json: Union[AnyMapping, None] = None + + if PYDANTIC_V2: + model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) + else: + + class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] + arbitrary_types_allowed: bool = True + + def get_max_retries(self, max_retries: int) -> int: + if isinstance(self.max_retries, NotGiven): + return max_retries + return self.max_retries + + def _strip_raw_response_header(self) -> None: + if not is_given(self.headers): + return + + if self.headers.get(RAW_RESPONSE_HEADER): + self.headers = {**self.headers} + self.headers.pop(RAW_RESPONSE_HEADER) + + # override the `construct` method so that we can run custom transformations. + # this is necessary as we don't want to do any actual runtime type checking + # (which means we can't use validators) but we do want to ensure that `NotGiven` + # values are not present + # + # type ignore required because we're adding explicit types to `**values` + @classmethod + def construct( # type: ignore + cls, + _fields_set: set[str] | None = None, + **values: Unpack[FinalRequestOptionsInput], + ) -> FinalRequestOptions: + kwargs: dict[str, Any] = { + # we unconditionally call `strip_not_given` on any value + # as it will just ignore any non-mapping types + key: strip_not_given(value) + for key, value in values.items() + } + if PYDANTIC_V2: + return super().model_construct(_fields_set, **kwargs) + return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + + if not TYPE_CHECKING: + # type checkers incorrectly complain about this assignment + model_construct = construct diff --git a/src/gitpod/_qs.py b/src/gitpod/_qs.py new file mode 100644 index 00000000..274320ca --- /dev/null +++ b/src/gitpod/_qs.py @@ -0,0 +1,150 @@ +from __future__ import annotations + +from typing import Any, List, Tuple, Union, Mapping, TypeVar +from urllib.parse import parse_qs, urlencode +from typing_extensions import Literal, get_args + +from ._types import NOT_GIVEN, NotGiven, NotGivenOr +from ._utils import flatten + +_T = TypeVar("_T") + + +ArrayFormat = Literal["comma", "repeat", "indices", "brackets"] +NestedFormat = Literal["dots", "brackets"] + +PrimitiveData = Union[str, int, float, bool, None] +# this should be Data = Union[PrimitiveData, "List[Data]", "Tuple[Data]", "Mapping[str, Data]"] +# https://github.com/microsoft/pyright/issues/3555 +Data = Union[PrimitiveData, List[Any], Tuple[Any], "Mapping[str, Any]"] +Params = Mapping[str, Data] + + +class Querystring: + array_format: ArrayFormat + nested_format: NestedFormat + + def __init__( + self, + *, + array_format: ArrayFormat = "repeat", + nested_format: NestedFormat = "brackets", + ) -> None: + self.array_format = array_format + self.nested_format = nested_format + + def parse(self, query: str) -> Mapping[str, object]: + # Note: custom format syntax is not supported yet + return parse_qs(query) + + def stringify( + self, + params: Params, + *, + array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, + nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + ) -> str: + return urlencode( + self.stringify_items( + params, + array_format=array_format, + nested_format=nested_format, + ) + ) + + def stringify_items( + self, + params: Params, + *, + array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, + nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + ) -> list[tuple[str, str]]: + opts = Options( + qs=self, + array_format=array_format, + nested_format=nested_format, + ) + return flatten([self._stringify_item(key, value, opts) for key, value in params.items()]) + + def _stringify_item( + self, + key: str, + value: Data, + opts: Options, + ) -> list[tuple[str, str]]: + if isinstance(value, Mapping): + items: list[tuple[str, str]] = [] + nested_format = opts.nested_format + for subkey, subvalue in value.items(): + items.extend( + self._stringify_item( + # TODO: error if unknown format + f"{key}.{subkey}" if nested_format == "dots" else f"{key}[{subkey}]", + subvalue, + opts, + ) + ) + return items + + if isinstance(value, (list, tuple)): + array_format = opts.array_format + if array_format == "comma": + return [ + ( + key, + ",".join(self._primitive_value_to_str(item) for item in value if item is not None), + ), + ] + elif array_format == "repeat": + items = [] + for item in value: + items.extend(self._stringify_item(key, item, opts)) + return items + elif array_format == "indices": + raise NotImplementedError("The array indices format is not supported yet") + elif array_format == "brackets": + items = [] + key = key + "[]" + for item in value: + items.extend(self._stringify_item(key, item, opts)) + return items + else: + raise NotImplementedError( + f"Unknown array_format value: {array_format}, choose from {', '.join(get_args(ArrayFormat))}" + ) + + serialised = self._primitive_value_to_str(value) + if not serialised: + return [] + return [(key, serialised)] + + def _primitive_value_to_str(self, value: PrimitiveData) -> str: + # copied from httpx + if value is True: + return "true" + elif value is False: + return "false" + elif value is None: + return "" + return str(value) + + +_qs = Querystring() +parse = _qs.parse +stringify = _qs.stringify +stringify_items = _qs.stringify_items + + +class Options: + array_format: ArrayFormat + nested_format: NestedFormat + + def __init__( + self, + qs: Querystring = _qs, + *, + array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, + nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + ) -> None: + self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format + self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format diff --git a/src/gitpod/_resource.py b/src/gitpod/_resource.py new file mode 100644 index 00000000..74476447 --- /dev/null +++ b/src/gitpod/_resource.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import time +from typing import TYPE_CHECKING + +import anyio + +if TYPE_CHECKING: + from ._client import Gitpod, AsyncGitpod + + +class SyncAPIResource: + _client: Gitpod + + def __init__(self, client: Gitpod) -> None: + self._client = client + self._get = client.get + self._post = client.post + self._patch = client.patch + self._put = client.put + self._delete = client.delete + self._get_api_list = client.get_api_list + + def _sleep(self, seconds: float) -> None: + time.sleep(seconds) + + +class AsyncAPIResource: + _client: AsyncGitpod + + def __init__(self, client: AsyncGitpod) -> None: + self._client = client + self._get = client.get + self._post = client.post + self._patch = client.patch + self._put = client.put + self._delete = client.delete + self._get_api_list = client.get_api_list + + async def _sleep(self, seconds: float) -> None: + await anyio.sleep(seconds) diff --git a/src/gitpod/_response.py b/src/gitpod/_response.py new file mode 100644 index 00000000..095cb424 --- /dev/null +++ b/src/gitpod/_response.py @@ -0,0 +1,824 @@ +from __future__ import annotations + +import os +import inspect +import logging +import datetime +import functools +from types import TracebackType +from typing import ( + TYPE_CHECKING, + Any, + Union, + Generic, + TypeVar, + Callable, + Iterator, + AsyncIterator, + cast, + overload, +) +from typing_extensions import Awaitable, ParamSpec, override, get_origin + +import anyio +import httpx +import pydantic + +from ._types import NoneType +from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base +from ._models import BaseModel, is_basemodel +from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER +from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type +from ._exceptions import GitpodError, APIResponseValidationError + +if TYPE_CHECKING: + from ._models import FinalRequestOptions + from ._base_client import BaseClient + + +P = ParamSpec("P") +R = TypeVar("R") +_T = TypeVar("_T") +_APIResponseT = TypeVar("_APIResponseT", bound="APIResponse[Any]") +_AsyncAPIResponseT = TypeVar("_AsyncAPIResponseT", bound="AsyncAPIResponse[Any]") + +log: logging.Logger = logging.getLogger(__name__) + + +class BaseAPIResponse(Generic[R]): + _cast_to: type[R] + _client: BaseClient[Any, Any] + _parsed_by_type: dict[type[Any], Any] + _is_sse_stream: bool + _stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None + _options: FinalRequestOptions + + http_response: httpx.Response + + retries_taken: int + """The number of retries made. If no retries happened this will be `0`""" + + def __init__( + self, + *, + raw: httpx.Response, + cast_to: type[R], + client: BaseClient[Any, Any], + stream: bool, + stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, + options: FinalRequestOptions, + retries_taken: int = 0, + ) -> None: + self._cast_to = cast_to + self._client = client + self._parsed_by_type = {} + self._is_sse_stream = stream + self._stream_cls = stream_cls + self._options = options + self.http_response = raw + self.retries_taken = retries_taken + + @property + def headers(self) -> httpx.Headers: + return self.http_response.headers + + @property + def http_request(self) -> httpx.Request: + """Returns the httpx Request instance associated with the current response.""" + return self.http_response.request + + @property + def status_code(self) -> int: + return self.http_response.status_code + + @property + def url(self) -> httpx.URL: + """Returns the URL for which the request was made.""" + return self.http_response.url + + @property + def method(self) -> str: + return self.http_request.method + + @property + def http_version(self) -> str: + return self.http_response.http_version + + @property + def elapsed(self) -> datetime.timedelta: + """The time taken for the complete request/response cycle to complete.""" + return self.http_response.elapsed + + @property + def is_closed(self) -> bool: + """Whether or not the response body has been closed. + + If this is False then there is response data that has not been read yet. + You must either fully consume the response body or call `.close()` + before discarding the response to prevent resource leaks. + """ + return self.http_response.is_closed + + @override + def __repr__(self) -> str: + return ( + f"<{self.__class__.__name__} [{self.status_code} {self.http_response.reason_phrase}] type={self._cast_to}>" + ) + + def _parse(self, *, to: type[_T] | None = None) -> R | _T: + # unwrap `Annotated[T, ...]` -> `T` + if to and is_annotated_type(to): + to = extract_type_arg(to, 0) + + if self._is_sse_stream: + if to: + if not is_stream_class_type(to): + raise TypeError(f"Expected custom parse type to be a subclass of {Stream} or {AsyncStream}") + + return cast( + _T, + to( + cast_to=extract_stream_chunk_type( + to, + failure_message="Expected custom stream type to be passed with a type argument, e.g. Stream[ChunkType]", + ), + response=self.http_response, + client=cast(Any, self._client), + ), + ) + + if self._stream_cls: + return cast( + R, + self._stream_cls( + cast_to=extract_stream_chunk_type(self._stream_cls), + response=self.http_response, + client=cast(Any, self._client), + ), + ) + + stream_cls = cast("type[Stream[Any]] | type[AsyncStream[Any]] | None", self._client._default_stream_cls) + if stream_cls is None: + raise MissingStreamClassError() + + return cast( + R, + stream_cls( + cast_to=self._cast_to, + response=self.http_response, + client=cast(Any, self._client), + ), + ) + + cast_to = to if to is not None else self._cast_to + + # unwrap `Annotated[T, ...]` -> `T` + if is_annotated_type(cast_to): + cast_to = extract_type_arg(cast_to, 0) + + if cast_to is NoneType: + return cast(R, None) + + response = self.http_response + if cast_to == str: + return cast(R, response.text) + + if cast_to == bytes: + return cast(R, response.content) + + if cast_to == int: + return cast(R, int(response.text)) + + if cast_to == float: + return cast(R, float(response.text)) + + if cast_to == bool: + return cast(R, response.text.lower() == "true") + + origin = get_origin(cast_to) or cast_to + + if origin == APIResponse: + raise RuntimeError("Unexpected state - cast_to is `APIResponse`") + + if inspect.isclass(origin) and issubclass(origin, httpx.Response): + # Because of the invariance of our ResponseT TypeVar, users can subclass httpx.Response + # and pass that class to our request functions. We cannot change the variance to be either + # covariant or contravariant as that makes our usage of ResponseT illegal. We could construct + # the response class ourselves but that is something that should be supported directly in httpx + # as it would be easy to incorrectly construct the Response object due to the multitude of arguments. + if cast_to != httpx.Response: + raise ValueError(f"Subclasses of httpx.Response cannot be passed to `cast_to`") + return cast(R, response) + + if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel): + raise TypeError("Pydantic models must subclass our base model type, e.g. `from gitpod import BaseModel`") + + if ( + cast_to is not object + and not origin is list + and not origin is dict + and not origin is Union + and not issubclass(origin, BaseModel) + ): + raise RuntimeError( + f"Unsupported type, expected {cast_to} to be a subclass of {BaseModel}, {dict}, {list}, {Union}, {NoneType}, {str} or {httpx.Response}." + ) + + # split is required to handle cases where additional information is included + # in the response, e.g. application/json; charset=utf-8 + content_type, *_ = response.headers.get("content-type", "*").split(";") + if content_type != "application/json": + if is_basemodel(cast_to): + try: + data = response.json() + except Exception as exc: + log.debug("Could not read JSON from response data due to %s - %s", type(exc), exc) + else: + return self._client._process_response_data( + data=data, + cast_to=cast_to, # type: ignore + response=response, + ) + + if self._client._strict_response_validation: + raise APIResponseValidationError( + response=response, + message=f"Expected Content-Type response header to be `application/json` but received `{content_type}` instead.", + body=response.text, + ) + + # If the API responds with content that isn't JSON then we just return + # the (decoded) text without performing any parsing so that you can still + # handle the response however you need to. + return response.text # type: ignore + + data = response.json() + + return self._client._process_response_data( + data=data, + cast_to=cast_to, # type: ignore + response=response, + ) + + +class APIResponse(BaseAPIResponse[R]): + @overload + def parse(self, *, to: type[_T]) -> _T: ... + + @overload + def parse(self) -> R: ... + + def parse(self, *, to: type[_T] | None = None) -> R | _T: + """Returns the rich python representation of this response's data. + + For lower-level control, see `.read()`, `.json()`, `.iter_bytes()`. + + You can customise the type that the response is parsed into through + the `to` argument, e.g. + + ```py + from gitpod import BaseModel + + + class MyModel(BaseModel): + foo: str + + + obj = response.parse(to=MyModel) + print(obj.foo) + ``` + + We support parsing: + - `BaseModel` + - `dict` + - `list` + - `Union` + - `str` + - `int` + - `float` + - `httpx.Response` + """ + cache_key = to if to is not None else self._cast_to + cached = self._parsed_by_type.get(cache_key) + if cached is not None: + return cached # type: ignore[no-any-return] + + if not self._is_sse_stream: + self.read() + + parsed = self._parse(to=to) + if is_given(self._options.post_parser): + parsed = self._options.post_parser(parsed) + + self._parsed_by_type[cache_key] = parsed + return parsed + + def read(self) -> bytes: + """Read and return the binary response content.""" + try: + return self.http_response.read() + except httpx.StreamConsumed as exc: + # The default error raised by httpx isn't very + # helpful in our case so we re-raise it with + # a different error message. + raise StreamAlreadyConsumed() from exc + + def text(self) -> str: + """Read and decode the response content into a string.""" + self.read() + return self.http_response.text + + def json(self) -> object: + """Read and decode the JSON response content.""" + self.read() + return self.http_response.json() + + def close(self) -> None: + """Close the response and release the connection. + + Automatically called if the response body is read to completion. + """ + self.http_response.close() + + def iter_bytes(self, chunk_size: int | None = None) -> Iterator[bytes]: + """ + A byte-iterator over the decoded response content. + + This automatically handles gzip, deflate and brotli encoded responses. + """ + for chunk in self.http_response.iter_bytes(chunk_size): + yield chunk + + def iter_text(self, chunk_size: int | None = None) -> Iterator[str]: + """A str-iterator over the decoded response content + that handles both gzip, deflate, etc but also detects the content's + string encoding. + """ + for chunk in self.http_response.iter_text(chunk_size): + yield chunk + + def iter_lines(self) -> Iterator[str]: + """Like `iter_text()` but will only yield chunks for each line""" + for chunk in self.http_response.iter_lines(): + yield chunk + + +class AsyncAPIResponse(BaseAPIResponse[R]): + @overload + async def parse(self, *, to: type[_T]) -> _T: ... + + @overload + async def parse(self) -> R: ... + + async def parse(self, *, to: type[_T] | None = None) -> R | _T: + """Returns the rich python representation of this response's data. + + For lower-level control, see `.read()`, `.json()`, `.iter_bytes()`. + + You can customise the type that the response is parsed into through + the `to` argument, e.g. + + ```py + from gitpod import BaseModel + + + class MyModel(BaseModel): + foo: str + + + obj = response.parse(to=MyModel) + print(obj.foo) + ``` + + We support parsing: + - `BaseModel` + - `dict` + - `list` + - `Union` + - `str` + - `httpx.Response` + """ + cache_key = to if to is not None else self._cast_to + cached = self._parsed_by_type.get(cache_key) + if cached is not None: + return cached # type: ignore[no-any-return] + + if not self._is_sse_stream: + await self.read() + + parsed = self._parse(to=to) + if is_given(self._options.post_parser): + parsed = self._options.post_parser(parsed) + + self._parsed_by_type[cache_key] = parsed + return parsed + + async def read(self) -> bytes: + """Read and return the binary response content.""" + try: + return await self.http_response.aread() + except httpx.StreamConsumed as exc: + # the default error raised by httpx isn't very + # helpful in our case so we re-raise it with + # a different error message + raise StreamAlreadyConsumed() from exc + + async def text(self) -> str: + """Read and decode the response content into a string.""" + await self.read() + return self.http_response.text + + async def json(self) -> object: + """Read and decode the JSON response content.""" + await self.read() + return self.http_response.json() + + async def close(self) -> None: + """Close the response and release the connection. + + Automatically called if the response body is read to completion. + """ + await self.http_response.aclose() + + async def iter_bytes(self, chunk_size: int | None = None) -> AsyncIterator[bytes]: + """ + A byte-iterator over the decoded response content. + + This automatically handles gzip, deflate and brotli encoded responses. + """ + async for chunk in self.http_response.aiter_bytes(chunk_size): + yield chunk + + async def iter_text(self, chunk_size: int | None = None) -> AsyncIterator[str]: + """A str-iterator over the decoded response content + that handles both gzip, deflate, etc but also detects the content's + string encoding. + """ + async for chunk in self.http_response.aiter_text(chunk_size): + yield chunk + + async def iter_lines(self) -> AsyncIterator[str]: + """Like `iter_text()` but will only yield chunks for each line""" + async for chunk in self.http_response.aiter_lines(): + yield chunk + + +class BinaryAPIResponse(APIResponse[bytes]): + """Subclass of APIResponse providing helpers for dealing with binary data. + + Note: If you want to stream the response data instead of eagerly reading it + all at once then you should use `.with_streaming_response` when making + the API request, e.g. `.with_streaming_response.get_binary_response()` + """ + + def write_to_file( + self, + file: str | os.PathLike[str], + ) -> None: + """Write the output to the given file. + + Accepts a filename or any path-like object, e.g. pathlib.Path + + Note: if you want to stream the data to the file instead of writing + all at once then you should use `.with_streaming_response` when making + the API request, e.g. `.with_streaming_response.get_binary_response()` + """ + with open(file, mode="wb") as f: + for data in self.iter_bytes(): + f.write(data) + + +class AsyncBinaryAPIResponse(AsyncAPIResponse[bytes]): + """Subclass of APIResponse providing helpers for dealing with binary data. + + Note: If you want to stream the response data instead of eagerly reading it + all at once then you should use `.with_streaming_response` when making + the API request, e.g. `.with_streaming_response.get_binary_response()` + """ + + async def write_to_file( + self, + file: str | os.PathLike[str], + ) -> None: + """Write the output to the given file. + + Accepts a filename or any path-like object, e.g. pathlib.Path + + Note: if you want to stream the data to the file instead of writing + all at once then you should use `.with_streaming_response` when making + the API request, e.g. `.with_streaming_response.get_binary_response()` + """ + path = anyio.Path(file) + async with await path.open(mode="wb") as f: + async for data in self.iter_bytes(): + await f.write(data) + + +class StreamedBinaryAPIResponse(APIResponse[bytes]): + def stream_to_file( + self, + file: str | os.PathLike[str], + *, + chunk_size: int | None = None, + ) -> None: + """Streams the output to the given file. + + Accepts a filename or any path-like object, e.g. pathlib.Path + """ + with open(file, mode="wb") as f: + for data in self.iter_bytes(chunk_size): + f.write(data) + + +class AsyncStreamedBinaryAPIResponse(AsyncAPIResponse[bytes]): + async def stream_to_file( + self, + file: str | os.PathLike[str], + *, + chunk_size: int | None = None, + ) -> None: + """Streams the output to the given file. + + Accepts a filename or any path-like object, e.g. pathlib.Path + """ + path = anyio.Path(file) + async with await path.open(mode="wb") as f: + async for data in self.iter_bytes(chunk_size): + await f.write(data) + + +class MissingStreamClassError(TypeError): + def __init__(self) -> None: + super().__init__( + "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `gitpod._streaming` for reference", + ) + + +class StreamAlreadyConsumed(GitpodError): + """ + Attempted to read or stream content, but the content has already + been streamed. + + This can happen if you use a method like `.iter_lines()` and then attempt + to read th entire response body afterwards, e.g. + + ```py + response = await client.post(...) + async for line in response.iter_lines(): + ... # do something with `line` + + content = await response.read() + # ^ error + ``` + + If you want this behaviour you'll need to either manually accumulate the response + content or call `await response.read()` before iterating over the stream. + """ + + def __init__(self) -> None: + message = ( + "Attempted to read or stream some content, but the content has " + "already been streamed. " + "This could be due to attempting to stream the response " + "content more than once." + "\n\n" + "You can fix this by manually accumulating the response content while streaming " + "or by calling `.read()` before starting to stream." + ) + super().__init__(message) + + +class ResponseContextManager(Generic[_APIResponseT]): + """Context manager for ensuring that a request is not made + until it is entered and that the response will always be closed + when the context manager exits + """ + + def __init__(self, request_func: Callable[[], _APIResponseT]) -> None: + self._request_func = request_func + self.__response: _APIResponseT | None = None + + def __enter__(self) -> _APIResponseT: + self.__response = self._request_func() + return self.__response + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + if self.__response is not None: + self.__response.close() + + +class AsyncResponseContextManager(Generic[_AsyncAPIResponseT]): + """Context manager for ensuring that a request is not made + until it is entered and that the response will always be closed + when the context manager exits + """ + + def __init__(self, api_request: Awaitable[_AsyncAPIResponseT]) -> None: + self._api_request = api_request + self.__response: _AsyncAPIResponseT | None = None + + async def __aenter__(self) -> _AsyncAPIResponseT: + self.__response = await self._api_request + return self.__response + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + if self.__response is not None: + await self.__response.close() + + +def to_streamed_response_wrapper(func: Callable[P, R]) -> Callable[P, ResponseContextManager[APIResponse[R]]]: + """Higher order function that takes one of our bound API methods and wraps it + to support streaming and returning the raw `APIResponse` object directly. + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> ResponseContextManager[APIResponse[R]]: + extra_headers: dict[str, str] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "stream" + + kwargs["extra_headers"] = extra_headers + + make_request = functools.partial(func, *args, **kwargs) + + return ResponseContextManager(cast(Callable[[], APIResponse[R]], make_request)) + + return wrapped + + +def async_to_streamed_response_wrapper( + func: Callable[P, Awaitable[R]], +) -> Callable[P, AsyncResponseContextManager[AsyncAPIResponse[R]]]: + """Higher order function that takes one of our bound API methods and wraps it + to support streaming and returning the raw `APIResponse` object directly. + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> AsyncResponseContextManager[AsyncAPIResponse[R]]: + extra_headers: dict[str, str] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "stream" + + kwargs["extra_headers"] = extra_headers + + make_request = func(*args, **kwargs) + + return AsyncResponseContextManager(cast(Awaitable[AsyncAPIResponse[R]], make_request)) + + return wrapped + + +def to_custom_streamed_response_wrapper( + func: Callable[P, object], + response_cls: type[_APIResponseT], +) -> Callable[P, ResponseContextManager[_APIResponseT]]: + """Higher order function that takes one of our bound API methods and an `APIResponse` class + and wraps the method to support streaming and returning the given response class directly. + + Note: the given `response_cls` *must* be concrete, e.g. `class BinaryAPIResponse(APIResponse[bytes])` + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> ResponseContextManager[_APIResponseT]: + extra_headers: dict[str, Any] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "stream" + extra_headers[OVERRIDE_CAST_TO_HEADER] = response_cls + + kwargs["extra_headers"] = extra_headers + + make_request = functools.partial(func, *args, **kwargs) + + return ResponseContextManager(cast(Callable[[], _APIResponseT], make_request)) + + return wrapped + + +def async_to_custom_streamed_response_wrapper( + func: Callable[P, Awaitable[object]], + response_cls: type[_AsyncAPIResponseT], +) -> Callable[P, AsyncResponseContextManager[_AsyncAPIResponseT]]: + """Higher order function that takes one of our bound API methods and an `APIResponse` class + and wraps the method to support streaming and returning the given response class directly. + + Note: the given `response_cls` *must* be concrete, e.g. `class BinaryAPIResponse(APIResponse[bytes])` + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> AsyncResponseContextManager[_AsyncAPIResponseT]: + extra_headers: dict[str, Any] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "stream" + extra_headers[OVERRIDE_CAST_TO_HEADER] = response_cls + + kwargs["extra_headers"] = extra_headers + + make_request = func(*args, **kwargs) + + return AsyncResponseContextManager(cast(Awaitable[_AsyncAPIResponseT], make_request)) + + return wrapped + + +def to_raw_response_wrapper(func: Callable[P, R]) -> Callable[P, APIResponse[R]]: + """Higher order function that takes one of our bound API methods and wraps it + to support returning the raw `APIResponse` object directly. + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> APIResponse[R]: + extra_headers: dict[str, str] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "raw" + + kwargs["extra_headers"] = extra_headers + + return cast(APIResponse[R], func(*args, **kwargs)) + + return wrapped + + +def async_to_raw_response_wrapper(func: Callable[P, Awaitable[R]]) -> Callable[P, Awaitable[AsyncAPIResponse[R]]]: + """Higher order function that takes one of our bound API methods and wraps it + to support returning the raw `APIResponse` object directly. + """ + + @functools.wraps(func) + async def wrapped(*args: P.args, **kwargs: P.kwargs) -> AsyncAPIResponse[R]: + extra_headers: dict[str, str] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "raw" + + kwargs["extra_headers"] = extra_headers + + return cast(AsyncAPIResponse[R], await func(*args, **kwargs)) + + return wrapped + + +def to_custom_raw_response_wrapper( + func: Callable[P, object], + response_cls: type[_APIResponseT], +) -> Callable[P, _APIResponseT]: + """Higher order function that takes one of our bound API methods and an `APIResponse` class + and wraps the method to support returning the given response class directly. + + Note: the given `response_cls` *must* be concrete, e.g. `class BinaryAPIResponse(APIResponse[bytes])` + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> _APIResponseT: + extra_headers: dict[str, Any] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "raw" + extra_headers[OVERRIDE_CAST_TO_HEADER] = response_cls + + kwargs["extra_headers"] = extra_headers + + return cast(_APIResponseT, func(*args, **kwargs)) + + return wrapped + + +def async_to_custom_raw_response_wrapper( + func: Callable[P, Awaitable[object]], + response_cls: type[_AsyncAPIResponseT], +) -> Callable[P, Awaitable[_AsyncAPIResponseT]]: + """Higher order function that takes one of our bound API methods and an `APIResponse` class + and wraps the method to support returning the given response class directly. + + Note: the given `response_cls` *must* be concrete, e.g. `class BinaryAPIResponse(APIResponse[bytes])` + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> Awaitable[_AsyncAPIResponseT]: + extra_headers: dict[str, Any] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "raw" + extra_headers[OVERRIDE_CAST_TO_HEADER] = response_cls + + kwargs["extra_headers"] = extra_headers + + return cast(Awaitable[_AsyncAPIResponseT], func(*args, **kwargs)) + + return wrapped + + +def extract_response_type(typ: type[BaseAPIResponse[Any]]) -> type: + """Given a type like `APIResponse[T]`, returns the generic type variable `T`. + + This also handles the case where a concrete subclass is given, e.g. + ```py + class MyResponse(APIResponse[bytes]): + ... + + extract_response_type(MyResponse) -> bytes + ``` + """ + return extract_type_var_from_base( + typ, + generic_bases=cast("tuple[type, ...]", (BaseAPIResponse, APIResponse, AsyncAPIResponse)), + index=0, + ) diff --git a/src/gitpod/_streaming.py b/src/gitpod/_streaming.py new file mode 100644 index 00000000..deacb4d4 --- /dev/null +++ b/src/gitpod/_streaming.py @@ -0,0 +1,333 @@ +# Note: initially copied from https://github.com/florimondmanca/httpx-sse/blob/master/src/httpx_sse/_decoders.py +from __future__ import annotations + +import json +import inspect +from types import TracebackType +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable + +import httpx + +from ._utils import extract_type_var_from_base + +if TYPE_CHECKING: + from ._client import Gitpod, AsyncGitpod + + +_T = TypeVar("_T") + + +class Stream(Generic[_T]): + """Provides the core interface to iterate over a synchronous stream response.""" + + response: httpx.Response + + _decoder: SSEBytesDecoder + + def __init__( + self, + *, + cast_to: type[_T], + response: httpx.Response, + client: Gitpod, + ) -> None: + self.response = response + self._cast_to = cast_to + self._client = client + self._decoder = client._make_sse_decoder() + self._iterator = self.__stream__() + + def __next__(self) -> _T: + return self._iterator.__next__() + + def __iter__(self) -> Iterator[_T]: + for item in self._iterator: + yield item + + def _iter_events(self) -> Iterator[ServerSentEvent]: + yield from self._decoder.iter_bytes(self.response.iter_bytes()) + + def __stream__(self) -> Iterator[_T]: + cast_to = cast(Any, self._cast_to) + response = self.response + process_data = self._client._process_response_data + iterator = self._iter_events() + + for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + + # Ensure the entire stream is consumed + for _sse in iterator: + ... + + def __enter__(self) -> Self: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.close() + + def close(self) -> None: + """ + Close the response and release the connection. + + Automatically called if the response body is read to completion. + """ + self.response.close() + + +class AsyncStream(Generic[_T]): + """Provides the core interface to iterate over an asynchronous stream response.""" + + response: httpx.Response + + _decoder: SSEDecoder | SSEBytesDecoder + + def __init__( + self, + *, + cast_to: type[_T], + response: httpx.Response, + client: AsyncGitpod, + ) -> None: + self.response = response + self._cast_to = cast_to + self._client = client + self._decoder = client._make_sse_decoder() + self._iterator = self.__stream__() + + async def __anext__(self) -> _T: + return await self._iterator.__anext__() + + async def __aiter__(self) -> AsyncIterator[_T]: + async for item in self._iterator: + yield item + + async def _iter_events(self) -> AsyncIterator[ServerSentEvent]: + async for sse in self._decoder.aiter_bytes(self.response.aiter_bytes()): + yield sse + + async def __stream__(self) -> AsyncIterator[_T]: + cast_to = cast(Any, self._cast_to) + response = self.response + process_data = self._client._process_response_data + iterator = self._iter_events() + + async for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + + # Ensure the entire stream is consumed + async for _sse in iterator: + ... + + async def __aenter__(self) -> Self: + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + await self.close() + + async def close(self) -> None: + """ + Close the response and release the connection. + + Automatically called if the response body is read to completion. + """ + await self.response.aclose() + + +class ServerSentEvent: + def __init__( + self, + *, + event: str | None = None, + data: str | None = None, + id: str | None = None, + retry: int | None = None, + ) -> None: + if data is None: + data = "" + + self._id = id + self._data = data + self._event = event or None + self._retry = retry + + @property + def event(self) -> str | None: + return self._event + + @property + def id(self) -> str | None: + return self._id + + @property + def retry(self) -> int | None: + return self._retry + + @property + def data(self) -> str: + return self._data + + def json(self) -> Any: + return json.loads(self.data) + + @override + def __repr__(self) -> str: + return f"ServerSentEvent(event={self.event}, data={self.data}, id={self.id}, retry={self.retry})" + + +class SSEDecoder: + _data: list[str] + _event: str | None + _retry: int | None + _last_event_id: str | None + + def __init__(self) -> None: + self._event = None + self._data = [] + self._last_event_id = None + self._retry = None + + def iter_bytes(self, iterator: Iterator[bytes]) -> Iterator[ServerSentEvent]: + """Given an iterator that yields raw binary data, iterate over it & yield every event encountered""" + for chunk in self._iter_chunks(iterator): + # Split before decoding so splitlines() only uses \r and \n + for raw_line in chunk.splitlines(): + line = raw_line.decode("utf-8") + sse = self.decode(line) + if sse: + yield sse + + def _iter_chunks(self, iterator: Iterator[bytes]) -> Iterator[bytes]: + """Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks""" + data = b"" + for chunk in iterator: + for line in chunk.splitlines(keepends=True): + data += line + if data.endswith((b"\r\r", b"\n\n", b"\r\n\r\n")): + yield data + data = b"" + if data: + yield data + + async def aiter_bytes(self, iterator: AsyncIterator[bytes]) -> AsyncIterator[ServerSentEvent]: + """Given an iterator that yields raw binary data, iterate over it & yield every event encountered""" + async for chunk in self._aiter_chunks(iterator): + # Split before decoding so splitlines() only uses \r and \n + for raw_line in chunk.splitlines(): + line = raw_line.decode("utf-8") + sse = self.decode(line) + if sse: + yield sse + + async def _aiter_chunks(self, iterator: AsyncIterator[bytes]) -> AsyncIterator[bytes]: + """Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks""" + data = b"" + async for chunk in iterator: + for line in chunk.splitlines(keepends=True): + data += line + if data.endswith((b"\r\r", b"\n\n", b"\r\n\r\n")): + yield data + data = b"" + if data: + yield data + + def decode(self, line: str) -> ServerSentEvent | None: + # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 + + if not line: + if not self._event and not self._data and not self._last_event_id and self._retry is None: + return None + + sse = ServerSentEvent( + event=self._event, + data="\n".join(self._data), + id=self._last_event_id, + retry=self._retry, + ) + + # NOTE: as per the SSE spec, do not reset last_event_id. + self._event = None + self._data = [] + self._retry = None + + return sse + + if line.startswith(":"): + return None + + fieldname, _, value = line.partition(":") + + if value.startswith(" "): + value = value[1:] + + if fieldname == "event": + self._event = value + elif fieldname == "data": + self._data.append(value) + elif fieldname == "id": + if "\0" in value: + pass + else: + self._last_event_id = value + elif fieldname == "retry": + try: + self._retry = int(value) + except (TypeError, ValueError): + pass + else: + pass # Field is ignored. + + return None + + +@runtime_checkable +class SSEBytesDecoder(Protocol): + def iter_bytes(self, iterator: Iterator[bytes]) -> Iterator[ServerSentEvent]: + """Given an iterator that yields raw binary data, iterate over it & yield every event encountered""" + ... + + def aiter_bytes(self, iterator: AsyncIterator[bytes]) -> AsyncIterator[ServerSentEvent]: + """Given an async iterator that yields raw binary data, iterate over it & yield every event encountered""" + ... + + +def is_stream_class_type(typ: type) -> TypeGuard[type[Stream[object]] | type[AsyncStream[object]]]: + """TypeGuard for determining whether or not the given type is a subclass of `Stream` / `AsyncStream`""" + origin = get_origin(typ) or typ + return inspect.isclass(origin) and issubclass(origin, (Stream, AsyncStream)) + + +def extract_stream_chunk_type( + stream_cls: type, + *, + failure_message: str | None = None, +) -> type: + """Given a type like `Stream[T]`, returns the generic type variable `T`. + + This also handles the case where a concrete subclass is given, e.g. + ```py + class MyStream(Stream[bytes]): + ... + + extract_stream_chunk_type(MyStream) -> bytes + ``` + """ + from ._base_client import Stream, AsyncStream + + return extract_type_var_from_base( + stream_cls, + index=0, + generic_bases=cast("tuple[type, ...]", (Stream, AsyncStream)), + failure_message=failure_message, + ) diff --git a/src/gitpod/_types.py b/src/gitpod/_types.py new file mode 100644 index 00000000..08a95394 --- /dev/null +++ b/src/gitpod/_types.py @@ -0,0 +1,219 @@ +from __future__ import annotations + +from os import PathLike +from typing import ( + IO, + TYPE_CHECKING, + Any, + Dict, + List, + Type, + Tuple, + Union, + Mapping, + TypeVar, + Callable, + Optional, + Sequence, +) +from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable + +import httpx +import pydantic +from httpx import URL, Proxy, Timeout, Response, BaseTransport, AsyncBaseTransport + +if TYPE_CHECKING: + from ._models import BaseModel + from ._response import APIResponse, AsyncAPIResponse + +Transport = BaseTransport +AsyncTransport = AsyncBaseTransport +Query = Mapping[str, object] +Body = object +AnyMapping = Mapping[str, object] +ModelT = TypeVar("ModelT", bound=pydantic.BaseModel) +_T = TypeVar("_T") + + +# Approximates httpx internal ProxiesTypes and RequestFiles types +# while adding support for `PathLike` instances +ProxiesDict = Dict["str | URL", Union[None, str, URL, Proxy]] +ProxiesTypes = Union[str, Proxy, ProxiesDict] +if TYPE_CHECKING: + Base64FileInput = Union[IO[bytes], PathLike[str]] + FileContent = Union[IO[bytes], bytes, PathLike[str]] +else: + Base64FileInput = Union[IO[bytes], PathLike] + FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. +FileTypes = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + Tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + Tuple[Optional[str], FileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], +] +RequestFiles = Union[Mapping[str, FileTypes], Sequence[Tuple[str, FileTypes]]] + +# duplicate of the above but without our custom file support +HttpxFileContent = Union[IO[bytes], bytes] +HttpxFileTypes = Union[ + # file (or bytes) + HttpxFileContent, + # (filename, file (or bytes)) + Tuple[Optional[str], HttpxFileContent], + # (filename, file (or bytes), content_type) + Tuple[Optional[str], HttpxFileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + Tuple[Optional[str], HttpxFileContent, Optional[str], Mapping[str, str]], +] +HttpxRequestFiles = Union[Mapping[str, HttpxFileTypes], Sequence[Tuple[str, HttpxFileTypes]]] + +# Workaround to support (cast_to: Type[ResponseT]) -> ResponseT +# where ResponseT includes `None`. In order to support directly +# passing `None`, overloads would have to be defined for every +# method that uses `ResponseT` which would lead to an unacceptable +# amount of code duplication and make it unreadable. See _base_client.py +# for example usage. +# +# This unfortunately means that you will either have +# to import this type and pass it explicitly: +# +# from gitpod import NoneType +# client.get('/foo', cast_to=NoneType) +# +# or build it yourself: +# +# client.get('/foo', cast_to=type(None)) +if TYPE_CHECKING: + NoneType: Type[None] +else: + NoneType = type(None) + + +class RequestOptions(TypedDict, total=False): + headers: Headers + max_retries: int + timeout: float | Timeout | None + params: Query + extra_json: AnyMapping + idempotency_key: str + + +# Sentinel class used until PEP 0661 is accepted +class NotGiven: + """ + A sentinel singleton class used to distinguish omitted keyword arguments + from those passed in with the value None (which may have different behavior). + + For example: + + ```py + def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ... + + + get(timeout=1) # 1s timeout + get(timeout=None) # No timeout + get() # Default timeout behavior, which may not be statically known at the method definition. + ``` + """ + + def __bool__(self) -> Literal[False]: + return False + + @override + def __repr__(self) -> str: + return "NOT_GIVEN" + + +NotGivenOr = Union[_T, NotGiven] +NOT_GIVEN = NotGiven() + + +class Omit: + """In certain situations you need to be able to represent a case where a default value has + to be explicitly removed and `None` is not an appropriate substitute, for example: + + ```py + # as the default `Content-Type` header is `application/json` that will be sent + client.post("/upload/files", files={"file": b"my raw file content"}) + + # you can't explicitly override the header as it has to be dynamically generated + # to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983' + client.post(..., headers={"Content-Type": "multipart/form-data"}) + + # instead you can remove the default `application/json` header by passing Omit + client.post(..., headers={"Content-Type": Omit()}) + ``` + """ + + def __bool__(self) -> Literal[False]: + return False + + +@runtime_checkable +class ModelBuilderProtocol(Protocol): + @classmethod + def build( + cls: type[_T], + *, + response: Response, + data: object, + ) -> _T: ... + + +Headers = Mapping[str, Union[str, Omit]] + + +class HeadersLikeProtocol(Protocol): + def get(self, __key: str) -> str | None: ... + + +HeadersLike = Union[Headers, HeadersLikeProtocol] + +ResponseT = TypeVar( + "ResponseT", + bound=Union[ + object, + str, + None, + "BaseModel", + List[Any], + Dict[str, Any], + Response, + ModelBuilderProtocol, + "APIResponse[Any]", + "AsyncAPIResponse[Any]", + ], +) + +StrBytesIntFloat = Union[str, bytes, int, float] + +# Note: copied from Pydantic +# https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49 +IncEx: TypeAlias = Union[ + Set[int], Set[str], Mapping[int, Union["IncEx", Literal[True]]], Mapping[str, Union["IncEx", Literal[True]]] +] + +PostParser = Callable[[Any], Any] + + +@runtime_checkable +class InheritsGeneric(Protocol): + """Represents a type that has inherited from `Generic` + + The `__orig_bases__` property can be used to determine the resolved + type variable for a given base class. + """ + + __orig_bases__: tuple[_GenericAlias] + + +class _GenericAlias(Protocol): + __origin__: type[object] + + +class HttpxSendArgs(TypedDict, total=False): + auth: httpx.Auth diff --git a/src/gitpod/_utils/__init__.py b/src/gitpod/_utils/__init__.py new file mode 100644 index 00000000..3efe66c8 --- /dev/null +++ b/src/gitpod/_utils/__init__.py @@ -0,0 +1,55 @@ +from ._sync import asyncify as asyncify +from ._proxy import LazyProxy as LazyProxy +from ._utils import ( + flatten as flatten, + is_dict as is_dict, + is_list as is_list, + is_given as is_given, + is_tuple as is_tuple, + lru_cache as lru_cache, + is_mapping as is_mapping, + is_tuple_t as is_tuple_t, + parse_date as parse_date, + is_iterable as is_iterable, + is_sequence as is_sequence, + coerce_float as coerce_float, + is_mapping_t as is_mapping_t, + removeprefix as removeprefix, + removesuffix as removesuffix, + extract_files as extract_files, + is_sequence_t as is_sequence_t, + required_args as required_args, + coerce_boolean as coerce_boolean, + coerce_integer as coerce_integer, + file_from_path as file_from_path, + parse_datetime as parse_datetime, + strip_not_given as strip_not_given, + deepcopy_minimal as deepcopy_minimal, + get_async_library as get_async_library, + maybe_coerce_float as maybe_coerce_float, + get_required_header as get_required_header, + maybe_coerce_boolean as maybe_coerce_boolean, + maybe_coerce_integer as maybe_coerce_integer, +) +from ._typing import ( + is_list_type as is_list_type, + is_union_type as is_union_type, + extract_type_arg as extract_type_arg, + is_iterable_type as is_iterable_type, + is_required_type as is_required_type, + is_annotated_type as is_annotated_type, + strip_annotated_type as strip_annotated_type, + extract_type_var_from_base as extract_type_var_from_base, +) +from ._streams import consume_sync_iterator as consume_sync_iterator, consume_async_iterator as consume_async_iterator +from ._transform import ( + PropertyInfo as PropertyInfo, + transform as transform, + async_transform as async_transform, + maybe_transform as maybe_transform, + async_maybe_transform as async_maybe_transform, +) +from ._reflection import ( + function_has_argument as function_has_argument, + assert_signatures_in_sync as assert_signatures_in_sync, +) diff --git a/src/gitpod/_utils/_logs.py b/src/gitpod/_utils/_logs.py new file mode 100644 index 00000000..229b952f --- /dev/null +++ b/src/gitpod/_utils/_logs.py @@ -0,0 +1,25 @@ +import os +import logging + +logger: logging.Logger = logging.getLogger("gitpod") +httpx_logger: logging.Logger = logging.getLogger("httpx") + + +def _basic_config() -> None: + # e.g. [2023-10-05 14:12:26 - gitpod._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" + logging.basicConfig( + format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s", + datefmt="%Y-%m-%d %H:%M:%S", + ) + + +def setup_logging() -> None: + env = os.environ.get("GITPOD_LOG") + if env == "debug": + _basic_config() + logger.setLevel(logging.DEBUG) + httpx_logger.setLevel(logging.DEBUG) + elif env == "info": + _basic_config() + logger.setLevel(logging.INFO) + httpx_logger.setLevel(logging.INFO) diff --git a/src/gitpod/_utils/_proxy.py b/src/gitpod/_utils/_proxy.py new file mode 100644 index 00000000..ffd883e9 --- /dev/null +++ b/src/gitpod/_utils/_proxy.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from abc import ABC, abstractmethod +from typing import Generic, TypeVar, Iterable, cast +from typing_extensions import override + +T = TypeVar("T") + + +class LazyProxy(Generic[T], ABC): + """Implements data methods to pretend that an instance is another instance. + + This includes forwarding attribute access and other methods. + """ + + # Note: we have to special case proxies that themselves return proxies + # to support using a proxy as a catch-all for any random access, e.g. `proxy.foo.bar.baz` + + def __getattr__(self, attr: str) -> object: + proxied = self.__get_proxied__() + if isinstance(proxied, LazyProxy): + return proxied # pyright: ignore + return getattr(proxied, attr) + + @override + def __repr__(self) -> str: + proxied = self.__get_proxied__() + if isinstance(proxied, LazyProxy): + return proxied.__class__.__name__ + return repr(self.__get_proxied__()) + + @override + def __str__(self) -> str: + proxied = self.__get_proxied__() + if isinstance(proxied, LazyProxy): + return proxied.__class__.__name__ + return str(proxied) + + @override + def __dir__(self) -> Iterable[str]: + proxied = self.__get_proxied__() + if isinstance(proxied, LazyProxy): + return [] + return proxied.__dir__() + + @property # type: ignore + @override + def __class__(self) -> type: # pyright: ignore + proxied = self.__get_proxied__() + if issubclass(type(proxied), LazyProxy): + return type(proxied) + return proxied.__class__ + + def __get_proxied__(self) -> T: + return self.__load__() + + def __as_proxied__(self) -> T: + """Helper method that returns the current proxy, typed as the loaded object""" + return cast(T, self) + + @abstractmethod + def __load__(self) -> T: ... diff --git a/src/gitpod/_utils/_reflection.py b/src/gitpod/_utils/_reflection.py new file mode 100644 index 00000000..89aa712a --- /dev/null +++ b/src/gitpod/_utils/_reflection.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +import inspect +from typing import Any, Callable + + +def function_has_argument(func: Callable[..., Any], arg_name: str) -> bool: + """Returns whether or not the given function has a specific parameter""" + sig = inspect.signature(func) + return arg_name in sig.parameters + + +def assert_signatures_in_sync( + source_func: Callable[..., Any], + check_func: Callable[..., Any], + *, + exclude_params: set[str] = set(), +) -> None: + """Ensure that the signature of the second function matches the first.""" + + check_sig = inspect.signature(check_func) + source_sig = inspect.signature(source_func) + + errors: list[str] = [] + + for name, source_param in source_sig.parameters.items(): + if name in exclude_params: + continue + + custom_param = check_sig.parameters.get(name) + if not custom_param: + errors.append(f"the `{name}` param is missing") + continue + + if custom_param.annotation != source_param.annotation: + errors.append( + f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(custom_param.annotation)}" + ) + continue + + if errors: + raise AssertionError(f"{len(errors)} errors encountered when comparing signatures:\n\n" + "\n\n".join(errors)) diff --git a/src/gitpod/_utils/_streams.py b/src/gitpod/_utils/_streams.py new file mode 100644 index 00000000..f4a0208f --- /dev/null +++ b/src/gitpod/_utils/_streams.py @@ -0,0 +1,12 @@ +from typing import Any +from typing_extensions import Iterator, AsyncIterator + + +def consume_sync_iterator(iterator: Iterator[Any]) -> None: + for _ in iterator: + ... + + +async def consume_async_iterator(iterator: AsyncIterator[Any]) -> None: + async for _ in iterator: + ... diff --git a/src/gitpod/_utils/_sync.py b/src/gitpod/_utils/_sync.py new file mode 100644 index 00000000..d0d81033 --- /dev/null +++ b/src/gitpod/_utils/_sync.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +import functools +from typing import TypeVar, Callable, Awaitable +from typing_extensions import ParamSpec + +import anyio +import anyio.to_thread + +from ._reflection import function_has_argument + +T_Retval = TypeVar("T_Retval") +T_ParamSpec = ParamSpec("T_ParamSpec") + + +# copied from `asyncer`, https://github.com/tiangolo/asyncer +def asyncify( + function: Callable[T_ParamSpec, T_Retval], + *, + cancellable: bool = False, + limiter: anyio.CapacityLimiter | None = None, +) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: + """ + Take a blocking function and create an async one that receives the same + positional and keyword arguments, and that when called, calls the original function + in a worker thread using `anyio.to_thread.run_sync()`. Internally, + `asyncer.asyncify()` uses the same `anyio.to_thread.run_sync()`, but it supports + keyword arguments additional to positional arguments and it adds better support for + autocompletion and inline errors for the arguments of the function called and the + return value. + + If the `cancellable` option is enabled and the task waiting for its completion is + cancelled, the thread will still run its course but its return value (or any raised + exception) will be ignored. + + Use it like this: + + ```Python + def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str: + # Do work + return "Some result" + + + result = await to_thread.asyncify(do_work)("spam", "ham", kwarg1="a", kwarg2="b") + print(result) + ``` + + ## Arguments + + `function`: a blocking regular callable (e.g. a function) + `cancellable`: `True` to allow cancellation of the operation + `limiter`: capacity limiter to use to limit the total amount of threads running + (if omitted, the default limiter is used) + + ## Return + + An async function that takes the same positional and keyword arguments as the + original one, that when called runs the same original function in a thread worker + and returns the result. + """ + + async def wrapper(*args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs) -> T_Retval: + partial_f = functools.partial(function, *args, **kwargs) + + # In `v4.1.0` anyio added the `abandon_on_cancel` argument and deprecated the old + # `cancellable` argument, so we need to use the new `abandon_on_cancel` to avoid + # surfacing deprecation warnings. + if function_has_argument(anyio.to_thread.run_sync, "abandon_on_cancel"): + return await anyio.to_thread.run_sync( + partial_f, + abandon_on_cancel=cancellable, + limiter=limiter, + ) + + return await anyio.to_thread.run_sync( + partial_f, + cancellable=cancellable, + limiter=limiter, + ) + + return wrapper diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py new file mode 100644 index 00000000..47e262a5 --- /dev/null +++ b/src/gitpod/_utils/_transform.py @@ -0,0 +1,382 @@ +from __future__ import annotations + +import io +import base64 +import pathlib +from typing import Any, Mapping, TypeVar, cast +from datetime import date, datetime +from typing_extensions import Literal, get_args, override, get_type_hints + +import anyio +import pydantic + +from ._utils import ( + is_list, + is_mapping, + is_iterable, +) +from .._files import is_base64_file_input +from ._typing import ( + is_list_type, + is_union_type, + extract_type_arg, + is_iterable_type, + is_required_type, + is_annotated_type, + strip_annotated_type, +) +from .._compat import model_dump, is_typeddict + +_T = TypeVar("_T") + + +# TODO: support for drilling globals() and locals() +# TODO: ensure works correctly with forward references in all cases + + +PropertyFormat = Literal["iso8601", "base64", "custom"] + + +class PropertyInfo: + """Metadata class to be used in Annotated types to provide information about a given type. + + For example: + + class MyParams(TypedDict): + account_holder_name: Annotated[str, PropertyInfo(alias='accountHolderName')] + + This means that {'account_holder_name': 'Robert'} will be transformed to {'accountHolderName': 'Robert'} before being sent to the API. + """ + + alias: str | None + format: PropertyFormat | None + format_template: str | None + discriminator: str | None + + def __init__( + self, + *, + alias: str | None = None, + format: PropertyFormat | None = None, + format_template: str | None = None, + discriminator: str | None = None, + ) -> None: + self.alias = alias + self.format = format + self.format_template = format_template + self.discriminator = discriminator + + @override + def __repr__(self) -> str: + return f"{self.__class__.__name__}(alias='{self.alias}', format={self.format}, format_template='{self.format_template}', discriminator='{self.discriminator}')" + + +def maybe_transform( + data: object, + expected_type: object, +) -> Any | None: + """Wrapper over `transform()` that allows `None` to be passed. + + See `transform()` for more details. + """ + if data is None: + return None + return transform(data, expected_type) + + +# Wrapper over _transform_recursive providing fake types +def transform( + data: _T, + expected_type: object, +) -> _T: + """Transform dictionaries based off of type information from the given type, for example: + + ```py + class Params(TypedDict, total=False): + card_id: Required[Annotated[str, PropertyInfo(alias="cardID")]] + + + transformed = transform({"card_id": ""}, Params) + # {'cardID': ''} + ``` + + Any keys / data that does not have type information given will be included as is. + + It should be noted that the transformations that this function does are not represented in the type system. + """ + transformed = _transform_recursive(data, annotation=cast(type, expected_type)) + return cast(_T, transformed) + + +def _get_annotated_type(type_: type) -> type | None: + """If the given type is an `Annotated` type then it is returned, if not `None` is returned. + + This also unwraps the type when applicable, e.g. `Required[Annotated[T, ...]]` + """ + if is_required_type(type_): + # Unwrap `Required[Annotated[T, ...]]` to `Annotated[T, ...]` + type_ = get_args(type_)[0] + + if is_annotated_type(type_): + return type_ + + return None + + +def _maybe_transform_key(key: str, type_: type) -> str: + """Transform the given `data` based on the annotations provided in `type_`. + + Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata. + """ + annotated_type = _get_annotated_type(type_) + if annotated_type is None: + # no `Annotated` definition for this type, no transformation needed + return key + + # ignore the first argument as it is the actual type + annotations = get_args(annotated_type)[1:] + for annotation in annotations: + if isinstance(annotation, PropertyInfo) and annotation.alias is not None: + return annotation.alias + + return key + + +def _transform_recursive( + data: object, + *, + annotation: type, + inner_type: type | None = None, +) -> object: + """Transform the given data against the expected type. + + Args: + annotation: The direct type annotation given to the particular piece of data. + This may or may not be wrapped in metadata types, e.g. `Required[T]`, `Annotated[T, ...]` etc + + inner_type: If applicable, this is the "inside" type. This is useful in certain cases where the outside type + is a container type such as `List[T]`. In that case `inner_type` should be set to `T` so that each entry in + the list can be transformed using the metadata from the container type. + + Defaults to the same value as the `annotation` argument. + """ + if inner_type is None: + inner_type = annotation + + stripped_type = strip_annotated_type(inner_type) + if is_typeddict(stripped_type) and is_mapping(data): + return _transform_typeddict(data, stripped_type) + + if ( + # List[T] + (is_list_type(stripped_type) and is_list(data)) + # Iterable[T] + or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + ): + inner_type = extract_type_arg(stripped_type, 0) + return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] + + if is_union_type(stripped_type): + # For union types we run the transformation against all subtypes to ensure that everything is transformed. + # + # TODO: there may be edge cases where the same normalized field name will transform to two different names + # in different subtypes. + for subtype in get_args(stripped_type): + data = _transform_recursive(data, annotation=annotation, inner_type=subtype) + return data + + if isinstance(data, pydantic.BaseModel): + return model_dump(data, exclude_unset=True) + + annotated_type = _get_annotated_type(annotation) + if annotated_type is None: + return data + + # ignore the first argument as it is the actual type + annotations = get_args(annotated_type)[1:] + for annotation in annotations: + if isinstance(annotation, PropertyInfo) and annotation.format is not None: + return _format_data(data, annotation.format, annotation.format_template) + + return data + + +def _format_data(data: object, format_: PropertyFormat, format_template: str | None) -> object: + if isinstance(data, (date, datetime)): + if format_ == "iso8601": + return data.isoformat() + + if format_ == "custom" and format_template is not None: + return data.strftime(format_template) + + if format_ == "base64" and is_base64_file_input(data): + binary: str | bytes | None = None + + if isinstance(data, pathlib.Path): + binary = data.read_bytes() + elif isinstance(data, io.IOBase): + binary = data.read() + + if isinstance(binary, str): # type: ignore[unreachable] + binary = binary.encode() + + if not isinstance(binary, bytes): + raise RuntimeError(f"Could not read bytes from {data}; Received {type(binary)}") + + return base64.b64encode(binary).decode("ascii") + + return data + + +def _transform_typeddict( + data: Mapping[str, object], + expected_type: type, +) -> Mapping[str, object]: + result: dict[str, object] = {} + annotations = get_type_hints(expected_type, include_extras=True) + for key, value in data.items(): + type_ = annotations.get(key) + if type_ is None: + # we do not have a type annotation for this field, leave it as is + result[key] = value + else: + result[_maybe_transform_key(key, type_)] = _transform_recursive(value, annotation=type_) + return result + + +async def async_maybe_transform( + data: object, + expected_type: object, +) -> Any | None: + """Wrapper over `async_transform()` that allows `None` to be passed. + + See `async_transform()` for more details. + """ + if data is None: + return None + return await async_transform(data, expected_type) + + +async def async_transform( + data: _T, + expected_type: object, +) -> _T: + """Transform dictionaries based off of type information from the given type, for example: + + ```py + class Params(TypedDict, total=False): + card_id: Required[Annotated[str, PropertyInfo(alias="cardID")]] + + + transformed = transform({"card_id": ""}, Params) + # {'cardID': ''} + ``` + + Any keys / data that does not have type information given will be included as is. + + It should be noted that the transformations that this function does are not represented in the type system. + """ + transformed = await _async_transform_recursive(data, annotation=cast(type, expected_type)) + return cast(_T, transformed) + + +async def _async_transform_recursive( + data: object, + *, + annotation: type, + inner_type: type | None = None, +) -> object: + """Transform the given data against the expected type. + + Args: + annotation: The direct type annotation given to the particular piece of data. + This may or may not be wrapped in metadata types, e.g. `Required[T]`, `Annotated[T, ...]` etc + + inner_type: If applicable, this is the "inside" type. This is useful in certain cases where the outside type + is a container type such as `List[T]`. In that case `inner_type` should be set to `T` so that each entry in + the list can be transformed using the metadata from the container type. + + Defaults to the same value as the `annotation` argument. + """ + if inner_type is None: + inner_type = annotation + + stripped_type = strip_annotated_type(inner_type) + if is_typeddict(stripped_type) and is_mapping(data): + return await _async_transform_typeddict(data, stripped_type) + + if ( + # List[T] + (is_list_type(stripped_type) and is_list(data)) + # Iterable[T] + or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + ): + inner_type = extract_type_arg(stripped_type, 0) + return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] + + if is_union_type(stripped_type): + # For union types we run the transformation against all subtypes to ensure that everything is transformed. + # + # TODO: there may be edge cases where the same normalized field name will transform to two different names + # in different subtypes. + for subtype in get_args(stripped_type): + data = await _async_transform_recursive(data, annotation=annotation, inner_type=subtype) + return data + + if isinstance(data, pydantic.BaseModel): + return model_dump(data, exclude_unset=True) + + annotated_type = _get_annotated_type(annotation) + if annotated_type is None: + return data + + # ignore the first argument as it is the actual type + annotations = get_args(annotated_type)[1:] + for annotation in annotations: + if isinstance(annotation, PropertyInfo) and annotation.format is not None: + return await _async_format_data(data, annotation.format, annotation.format_template) + + return data + + +async def _async_format_data(data: object, format_: PropertyFormat, format_template: str | None) -> object: + if isinstance(data, (date, datetime)): + if format_ == "iso8601": + return data.isoformat() + + if format_ == "custom" and format_template is not None: + return data.strftime(format_template) + + if format_ == "base64" and is_base64_file_input(data): + binary: str | bytes | None = None + + if isinstance(data, pathlib.Path): + binary = await anyio.Path(data).read_bytes() + elif isinstance(data, io.IOBase): + binary = data.read() + + if isinstance(binary, str): # type: ignore[unreachable] + binary = binary.encode() + + if not isinstance(binary, bytes): + raise RuntimeError(f"Could not read bytes from {data}; Received {type(binary)}") + + return base64.b64encode(binary).decode("ascii") + + return data + + +async def _async_transform_typeddict( + data: Mapping[str, object], + expected_type: type, +) -> Mapping[str, object]: + result: dict[str, object] = {} + annotations = get_type_hints(expected_type, include_extras=True) + for key, value in data.items(): + type_ = annotations.get(key) + if type_ is None: + # we do not have a type annotation for this field, leave it as is + result[key] = value + else: + result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_) + return result diff --git a/src/gitpod/_utils/_typing.py b/src/gitpod/_utils/_typing.py new file mode 100644 index 00000000..c036991f --- /dev/null +++ b/src/gitpod/_utils/_typing.py @@ -0,0 +1,120 @@ +from __future__ import annotations + +from typing import Any, TypeVar, Iterable, cast +from collections import abc as _c_abc +from typing_extensions import Required, Annotated, get_args, get_origin + +from .._types import InheritsGeneric +from .._compat import is_union as _is_union + + +def is_annotated_type(typ: type) -> bool: + return get_origin(typ) == Annotated + + +def is_list_type(typ: type) -> bool: + return (get_origin(typ) or typ) == list + + +def is_iterable_type(typ: type) -> bool: + """If the given type is `typing.Iterable[T]`""" + origin = get_origin(typ) or typ + return origin == Iterable or origin == _c_abc.Iterable + + +def is_union_type(typ: type) -> bool: + return _is_union(get_origin(typ)) + + +def is_required_type(typ: type) -> bool: + return get_origin(typ) == Required + + +def is_typevar(typ: type) -> bool: + # type ignore is required because type checkers + # think this expression will always return False + return type(typ) == TypeVar # type: ignore + + +# Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]] +def strip_annotated_type(typ: type) -> type: + if is_required_type(typ) or is_annotated_type(typ): + return strip_annotated_type(cast(type, get_args(typ)[0])) + + return typ + + +def extract_type_arg(typ: type, index: int) -> type: + args = get_args(typ) + try: + return cast(type, args[index]) + except IndexError as err: + raise RuntimeError(f"Expected type {typ} to have a type argument at index {index} but it did not") from err + + +def extract_type_var_from_base( + typ: type, + *, + generic_bases: tuple[type, ...], + index: int, + failure_message: str | None = None, +) -> type: + """Given a type like `Foo[T]`, returns the generic type variable `T`. + + This also handles the case where a concrete subclass is given, e.g. + ```py + class MyResponse(Foo[bytes]): + ... + + extract_type_var(MyResponse, bases=(Foo,), index=0) -> bytes + ``` + + And where a generic subclass is given: + ```py + _T = TypeVar('_T') + class MyResponse(Foo[_T]): + ... + + extract_type_var(MyResponse[bytes], bases=(Foo,), index=0) -> bytes + ``` + """ + cls = cast(object, get_origin(typ) or typ) + if cls in generic_bases: + # we're given the class directly + return extract_type_arg(typ, index) + + # if a subclass is given + # --- + # this is needed as __orig_bases__ is not present in the typeshed stubs + # because it is intended to be for internal use only, however there does + # not seem to be a way to resolve generic TypeVars for inherited subclasses + # without using it. + if isinstance(cls, InheritsGeneric): + target_base_class: Any | None = None + for base in cls.__orig_bases__: + if base.__origin__ in generic_bases: + target_base_class = base + break + + if target_base_class is None: + raise RuntimeError( + "Could not find the generic base class;\n" + "This should never happen;\n" + f"Does {cls} inherit from one of {generic_bases} ?" + ) + + extracted = extract_type_arg(target_base_class, index) + if is_typevar(extracted): + # If the extracted type argument is itself a type variable + # then that means the subclass itself is generic, so we have + # to resolve the type argument from the class itself, not + # the base class. + # + # Note: if there is more than 1 type argument, the subclass could + # change the ordering of the type arguments, this is not currently + # supported. + return extract_type_arg(typ, index) + + return extracted + + raise RuntimeError(failure_message or f"Could not resolve inner type variable at index {index} for {typ}") diff --git a/src/gitpod/_utils/_utils.py b/src/gitpod/_utils/_utils.py new file mode 100644 index 00000000..0bba17ca --- /dev/null +++ b/src/gitpod/_utils/_utils.py @@ -0,0 +1,397 @@ +from __future__ import annotations + +import os +import re +import inspect +import functools +from typing import ( + Any, + Tuple, + Mapping, + TypeVar, + Callable, + Iterable, + Sequence, + cast, + overload, +) +from pathlib import Path +from typing_extensions import TypeGuard + +import sniffio + +from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike +from .._compat import parse_date as parse_date, parse_datetime as parse_datetime + +_T = TypeVar("_T") +_TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) +_MappingT = TypeVar("_MappingT", bound=Mapping[str, object]) +_SequenceT = TypeVar("_SequenceT", bound=Sequence[object]) +CallableT = TypeVar("CallableT", bound=Callable[..., Any]) + + +def flatten(t: Iterable[Iterable[_T]]) -> list[_T]: + return [item for sublist in t for item in sublist] + + +def extract_files( + # TODO: this needs to take Dict but variance issues..... + # create protocol type ? + query: Mapping[str, object], + *, + paths: Sequence[Sequence[str]], +) -> list[tuple[str, FileTypes]]: + """Recursively extract files from the given dictionary based on specified paths. + + A path may look like this ['foo', 'files', '', 'data']. + + Note: this mutates the given dictionary. + """ + files: list[tuple[str, FileTypes]] = [] + for path in paths: + files.extend(_extract_items(query, path, index=0, flattened_key=None)) + return files + + +def _extract_items( + obj: object, + path: Sequence[str], + *, + index: int, + flattened_key: str | None, +) -> list[tuple[str, FileTypes]]: + try: + key = path[index] + except IndexError: + if isinstance(obj, NotGiven): + # no value was provided - we can safely ignore + return [] + + # cyclical import + from .._files import assert_is_file_content + + # We have exhausted the path, return the entry we found. + assert_is_file_content(obj, key=flattened_key) + assert flattened_key is not None + return [(flattened_key, cast(FileTypes, obj))] + + index += 1 + if is_dict(obj): + try: + # We are at the last entry in the path so we must remove the field + if (len(path)) == index: + item = obj.pop(key) + else: + item = obj[key] + except KeyError: + # Key was not present in the dictionary, this is not indicative of an error + # as the given path may not point to a required field. We also do not want + # to enforce required fields as the API may differ from the spec in some cases. + return [] + if flattened_key is None: + flattened_key = key + else: + flattened_key += f"[{key}]" + return _extract_items( + item, + path, + index=index, + flattened_key=flattened_key, + ) + elif is_list(obj): + if key != "": + return [] + + return flatten( + [ + _extract_items( + item, + path, + index=index, + flattened_key=flattened_key + "[]" if flattened_key is not None else "[]", + ) + for item in obj + ] + ) + + # Something unexpected was passed, just ignore it. + return [] + + +def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: + return not isinstance(obj, NotGiven) + + +# Type safe methods for narrowing types with TypeVars. +# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown], +# however this cause Pyright to rightfully report errors. As we know we don't +# care about the contained types we can safely use `object` in it's place. +# +# There are two separate functions defined, `is_*` and `is_*_t` for different use cases. +# `is_*` is for when you're dealing with an unknown input +# `is_*_t` is for when you're narrowing a known union type to a specific subset + + +def is_tuple(obj: object) -> TypeGuard[tuple[object, ...]]: + return isinstance(obj, tuple) + + +def is_tuple_t(obj: _TupleT | object) -> TypeGuard[_TupleT]: + return isinstance(obj, tuple) + + +def is_sequence(obj: object) -> TypeGuard[Sequence[object]]: + return isinstance(obj, Sequence) + + +def is_sequence_t(obj: _SequenceT | object) -> TypeGuard[_SequenceT]: + return isinstance(obj, Sequence) + + +def is_mapping(obj: object) -> TypeGuard[Mapping[str, object]]: + return isinstance(obj, Mapping) + + +def is_mapping_t(obj: _MappingT | object) -> TypeGuard[_MappingT]: + return isinstance(obj, Mapping) + + +def is_dict(obj: object) -> TypeGuard[dict[object, object]]: + return isinstance(obj, dict) + + +def is_list(obj: object) -> TypeGuard[list[object]]: + return isinstance(obj, list) + + +def is_iterable(obj: object) -> TypeGuard[Iterable[object]]: + return isinstance(obj, Iterable) + + +def deepcopy_minimal(item: _T) -> _T: + """Minimal reimplementation of copy.deepcopy() that will only copy certain object types: + + - mappings, e.g. `dict` + - list + + This is done for performance reasons. + """ + if is_mapping(item): + return cast(_T, {k: deepcopy_minimal(v) for k, v in item.items()}) + if is_list(item): + return cast(_T, [deepcopy_minimal(entry) for entry in item]) + return item + + +# copied from https://github.com/Rapptz/RoboDanny +def human_join(seq: Sequence[str], *, delim: str = ", ", final: str = "or") -> str: + size = len(seq) + if size == 0: + return "" + + if size == 1: + return seq[0] + + if size == 2: + return f"{seq[0]} {final} {seq[1]}" + + return delim.join(seq[:-1]) + f" {final} {seq[-1]}" + + +def quote(string: str) -> str: + """Add single quotation marks around the given string. Does *not* do any escaping.""" + return f"'{string}'" + + +def required_args(*variants: Sequence[str]) -> Callable[[CallableT], CallableT]: + """Decorator to enforce a given set of arguments or variants of arguments are passed to the decorated function. + + Useful for enforcing runtime validation of overloaded functions. + + Example usage: + ```py + @overload + def foo(*, a: str) -> str: ... + + + @overload + def foo(*, b: bool) -> str: ... + + + # This enforces the same constraints that a static type checker would + # i.e. that either a or b must be passed to the function + @required_args(["a"], ["b"]) + def foo(*, a: str | None = None, b: bool | None = None) -> str: ... + ``` + """ + + def inner(func: CallableT) -> CallableT: + params = inspect.signature(func).parameters + positional = [ + name + for name, param in params.items() + if param.kind + in { + param.POSITIONAL_ONLY, + param.POSITIONAL_OR_KEYWORD, + } + ] + + @functools.wraps(func) + def wrapper(*args: object, **kwargs: object) -> object: + given_params: set[str] = set() + for i, _ in enumerate(args): + try: + given_params.add(positional[i]) + except IndexError: + raise TypeError( + f"{func.__name__}() takes {len(positional)} argument(s) but {len(args)} were given" + ) from None + + for key in kwargs.keys(): + given_params.add(key) + + for variant in variants: + matches = all((param in given_params for param in variant)) + if matches: + break + else: # no break + if len(variants) > 1: + variations = human_join( + ["(" + human_join([quote(arg) for arg in variant], final="and") + ")" for variant in variants] + ) + msg = f"Missing required arguments; Expected either {variations} arguments to be given" + else: + assert len(variants) > 0 + + # TODO: this error message is not deterministic + missing = list(set(variants[0]) - given_params) + if len(missing) > 1: + msg = f"Missing required arguments: {human_join([quote(arg) for arg in missing])}" + else: + msg = f"Missing required argument: {quote(missing[0])}" + raise TypeError(msg) + return func(*args, **kwargs) + + return wrapper # type: ignore + + return inner + + +_K = TypeVar("_K") +_V = TypeVar("_V") + + +@overload +def strip_not_given(obj: None) -> None: ... + + +@overload +def strip_not_given(obj: Mapping[_K, _V | NotGiven]) -> dict[_K, _V]: ... + + +@overload +def strip_not_given(obj: object) -> object: ... + + +def strip_not_given(obj: object | None) -> object: + """Remove all top-level keys where their values are instances of `NotGiven`""" + if obj is None: + return None + + if not is_mapping(obj): + return obj + + return {key: value for key, value in obj.items() if not isinstance(value, NotGiven)} + + +def coerce_integer(val: str) -> int: + return int(val, base=10) + + +def coerce_float(val: str) -> float: + return float(val) + + +def coerce_boolean(val: str) -> bool: + return val == "true" or val == "1" or val == "on" + + +def maybe_coerce_integer(val: str | None) -> int | None: + if val is None: + return None + return coerce_integer(val) + + +def maybe_coerce_float(val: str | None) -> float | None: + if val is None: + return None + return coerce_float(val) + + +def maybe_coerce_boolean(val: str | None) -> bool | None: + if val is None: + return None + return coerce_boolean(val) + + +def removeprefix(string: str, prefix: str) -> str: + """Remove a prefix from a string. + + Backport of `str.removeprefix` for Python < 3.9 + """ + if string.startswith(prefix): + return string[len(prefix) :] + return string + + +def removesuffix(string: str, suffix: str) -> str: + """Remove a suffix from a string. + + Backport of `str.removesuffix` for Python < 3.9 + """ + if string.endswith(suffix): + return string[: -len(suffix)] + return string + + +def file_from_path(path: str) -> FileTypes: + contents = Path(path).read_bytes() + file_name = os.path.basename(path) + return (file_name, contents) + + +def get_required_header(headers: HeadersLike, header: str) -> str: + lower_header = header.lower() + if is_mapping_t(headers): + # mypy doesn't understand the type narrowing here + for k, v in headers.items(): # type: ignore + if k.lower() == lower_header and isinstance(v, str): + return v + + # to deal with the case where the header looks like Stainless-Event-Id + intercaps_header = re.sub(r"([^\w])(\w)", lambda pat: pat.group(1) + pat.group(2).upper(), header.capitalize()) + + for normalized_header in [header, lower_header, header.upper(), intercaps_header]: + value = headers.get(normalized_header) + if value: + return value + + raise ValueError(f"Could not find {header} header") + + +def get_async_library() -> str: + try: + return sniffio.current_async_library() + except Exception: + return "false" + + +def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]: + """A version of functools.lru_cache that retains the type signature + for the wrapped function arguments. + """ + wrapper = functools.lru_cache( # noqa: TID251 + maxsize=maxsize, + ) + return cast(Any, wrapper) # type: ignore[no-any-return] diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py new file mode 100644 index 00000000..e706ccbe --- /dev/null +++ b/src/gitpod/_version.py @@ -0,0 +1,4 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +__title__ = "gitpod" +__version__ = "0.0.1-alpha.0" diff --git a/src/gitpod/lib/.keep b/src/gitpod/lib/.keep new file mode 100644 index 00000000..5e2c99fd --- /dev/null +++ b/src/gitpod/lib/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store custom files to expand the SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/src/gitpod/py.typed b/src/gitpod/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py new file mode 100644 index 00000000..51c31275 --- /dev/null +++ b/src/gitpod/resources/__init__.py @@ -0,0 +1,201 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .tasks import ( + TasksResource, + AsyncTasksResource, + TasksResourceWithRawResponse, + AsyncTasksResourceWithRawResponse, + TasksResourceWithStreamingResponse, + AsyncTasksResourceWithStreamingResponse, +) +from .runners import ( + RunnersResource, + AsyncRunnersResource, + RunnersResourceWithRawResponse, + AsyncRunnersResourceWithRawResponse, + RunnersResourceWithStreamingResponse, + AsyncRunnersResourceWithStreamingResponse, +) +from .projects import ( + ProjectsResource, + AsyncProjectsResource, + ProjectsResourceWithRawResponse, + AsyncProjectsResourceWithRawResponse, + ProjectsResourceWithStreamingResponse, + AsyncProjectsResourceWithStreamingResponse, +) +from .services import ( + ServicesResource, + AsyncServicesResource, + ServicesResourceWithRawResponse, + AsyncServicesResourceWithRawResponse, + ServicesResourceWithStreamingResponse, + AsyncServicesResourceWithStreamingResponse, +) +from .environments import ( + EnvironmentsResource, + AsyncEnvironmentsResource, + EnvironmentsResourceWithRawResponse, + AsyncEnvironmentsResourceWithRawResponse, + EnvironmentsResourceWithStreamingResponse, + AsyncEnvironmentsResourceWithStreamingResponse, +) +from .organizations import ( + OrganizationsResource, + AsyncOrganizationsResource, + OrganizationsResourceWithRawResponse, + AsyncOrganizationsResourceWithRawResponse, + OrganizationsResourceWithStreamingResponse, + AsyncOrganizationsResourceWithStreamingResponse, +) +from .automations_files import ( + AutomationsFilesResource, + AsyncAutomationsFilesResource, + AutomationsFilesResourceWithRawResponse, + AsyncAutomationsFilesResourceWithRawResponse, + AutomationsFilesResourceWithStreamingResponse, + AsyncAutomationsFilesResourceWithStreamingResponse, +) +from .runner_interaction import ( + RunnerInteractionResource, + AsyncRunnerInteractionResource, + RunnerInteractionResourceWithRawResponse, + AsyncRunnerInteractionResourceWithRawResponse, + RunnerInteractionResourceWithStreamingResponse, + AsyncRunnerInteractionResourceWithStreamingResponse, +) +from .environment_classes import ( + EnvironmentClassesResource, + AsyncEnvironmentClassesResource, + EnvironmentClassesResourceWithRawResponse, + AsyncEnvironmentClassesResourceWithRawResponse, + EnvironmentClassesResourceWithStreamingResponse, + AsyncEnvironmentClassesResourceWithStreamingResponse, +) +from .runner_interactions import ( + RunnerInteractionsResource, + AsyncRunnerInteractionsResource, + RunnerInteractionsResourceWithRawResponse, + AsyncRunnerInteractionsResourceWithRawResponse, + RunnerInteractionsResourceWithStreamingResponse, + AsyncRunnerInteractionsResourceWithStreamingResponse, +) +from .runner_configurations import ( + RunnerConfigurationsResource, + AsyncRunnerConfigurationsResource, + RunnerConfigurationsResourceWithRawResponse, + AsyncRunnerConfigurationsResourceWithRawResponse, + RunnerConfigurationsResourceWithStreamingResponse, + AsyncRunnerConfigurationsResourceWithStreamingResponse, +) +from .environment_automation import ( + EnvironmentAutomationResource, + AsyncEnvironmentAutomationResource, + EnvironmentAutomationResourceWithRawResponse, + AsyncEnvironmentAutomationResourceWithRawResponse, + EnvironmentAutomationResourceWithStreamingResponse, + AsyncEnvironmentAutomationResourceWithStreamingResponse, +) +from .personal_access_tokens import ( + PersonalAccessTokensResource, + AsyncPersonalAccessTokensResource, + PersonalAccessTokensResourceWithRawResponse, + AsyncPersonalAccessTokensResourceWithRawResponse, + PersonalAccessTokensResourceWithStreamingResponse, + AsyncPersonalAccessTokensResourceWithStreamingResponse, +) +from .environment_automations import ( + EnvironmentAutomationsResource, + AsyncEnvironmentAutomationsResource, + EnvironmentAutomationsResourceWithRawResponse, + AsyncEnvironmentAutomationsResourceWithRawResponse, + EnvironmentAutomationsResourceWithStreamingResponse, + AsyncEnvironmentAutomationsResourceWithStreamingResponse, +) + +__all__ = [ + "ServicesResource", + "AsyncServicesResource", + "ServicesResourceWithRawResponse", + "AsyncServicesResourceWithRawResponse", + "ServicesResourceWithStreamingResponse", + "AsyncServicesResourceWithStreamingResponse", + "AutomationsFilesResource", + "AsyncAutomationsFilesResource", + "AutomationsFilesResourceWithRawResponse", + "AsyncAutomationsFilesResourceWithRawResponse", + "AutomationsFilesResourceWithStreamingResponse", + "AsyncAutomationsFilesResourceWithStreamingResponse", + "TasksResource", + "AsyncTasksResource", + "TasksResourceWithRawResponse", + "AsyncTasksResourceWithRawResponse", + "TasksResourceWithStreamingResponse", + "AsyncTasksResourceWithStreamingResponse", + "EnvironmentAutomationsResource", + "AsyncEnvironmentAutomationsResource", + "EnvironmentAutomationsResourceWithRawResponse", + "AsyncEnvironmentAutomationsResourceWithRawResponse", + "EnvironmentAutomationsResourceWithStreamingResponse", + "AsyncEnvironmentAutomationsResourceWithStreamingResponse", + "EnvironmentAutomationResource", + "AsyncEnvironmentAutomationResource", + "EnvironmentAutomationResourceWithRawResponse", + "AsyncEnvironmentAutomationResourceWithRawResponse", + "EnvironmentAutomationResourceWithStreamingResponse", + "AsyncEnvironmentAutomationResourceWithStreamingResponse", + "EnvironmentsResource", + "AsyncEnvironmentsResource", + "EnvironmentsResourceWithRawResponse", + "AsyncEnvironmentsResourceWithRawResponse", + "EnvironmentsResourceWithStreamingResponse", + "AsyncEnvironmentsResourceWithStreamingResponse", + "EnvironmentClassesResource", + "AsyncEnvironmentClassesResource", + "EnvironmentClassesResourceWithRawResponse", + "AsyncEnvironmentClassesResourceWithRawResponse", + "EnvironmentClassesResourceWithStreamingResponse", + "AsyncEnvironmentClassesResourceWithStreamingResponse", + "OrganizationsResource", + "AsyncOrganizationsResource", + "OrganizationsResourceWithRawResponse", + "AsyncOrganizationsResourceWithRawResponse", + "OrganizationsResourceWithStreamingResponse", + "AsyncOrganizationsResourceWithStreamingResponse", + "ProjectsResource", + "AsyncProjectsResource", + "ProjectsResourceWithRawResponse", + "AsyncProjectsResourceWithRawResponse", + "ProjectsResourceWithStreamingResponse", + "AsyncProjectsResourceWithStreamingResponse", + "RunnerConfigurationsResource", + "AsyncRunnerConfigurationsResource", + "RunnerConfigurationsResourceWithRawResponse", + "AsyncRunnerConfigurationsResourceWithRawResponse", + "RunnerConfigurationsResourceWithStreamingResponse", + "AsyncRunnerConfigurationsResourceWithStreamingResponse", + "RunnerInteractionsResource", + "AsyncRunnerInteractionsResource", + "RunnerInteractionsResourceWithRawResponse", + "AsyncRunnerInteractionsResourceWithRawResponse", + "RunnerInteractionsResourceWithStreamingResponse", + "AsyncRunnerInteractionsResourceWithStreamingResponse", + "RunnerInteractionResource", + "AsyncRunnerInteractionResource", + "RunnerInteractionResourceWithRawResponse", + "AsyncRunnerInteractionResourceWithRawResponse", + "RunnerInteractionResourceWithStreamingResponse", + "AsyncRunnerInteractionResourceWithStreamingResponse", + "RunnersResource", + "AsyncRunnersResource", + "RunnersResourceWithRawResponse", + "AsyncRunnersResourceWithRawResponse", + "RunnersResourceWithStreamingResponse", + "AsyncRunnersResourceWithStreamingResponse", + "PersonalAccessTokensResource", + "AsyncPersonalAccessTokensResource", + "PersonalAccessTokensResourceWithRawResponse", + "AsyncPersonalAccessTokensResourceWithRawResponse", + "PersonalAccessTokensResourceWithStreamingResponse", + "AsyncPersonalAccessTokensResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/automations_files.py b/src/gitpod/resources/automations_files.py new file mode 100644 index 00000000..b3b1c6f7 --- /dev/null +++ b/src/gitpod/resources/automations_files.py @@ -0,0 +1,224 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..types import automations_file_upsert_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.automations_file_upsert_response import AutomationsFileUpsertResponse + +__all__ = ["AutomationsFilesResource", "AsyncAutomationsFilesResource"] + + +class AutomationsFilesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AutomationsFilesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AutomationsFilesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AutomationsFilesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AutomationsFilesResourceWithStreamingResponse(self) + + def upsert( + self, + *, + connect_protocol_version: Literal[1], + automations_file: automations_file_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AutomationsFileUpsertResponse: + """ + UpsertAutomationsFile upserts the automations file for the given environment. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + automations_file: WARN: Do not remove any field here, as it will break reading automation yaml + files. We error if there are any unknown fields in the yaml (to ensure the yaml + is correct), but would break if we removed any fields. This includes marking a + field as "reserved" in the proto file, this will also break reading the yaml. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", + body=maybe_transform( + { + "automations_file": automations_file, + "environment_id": environment_id, + }, + automations_file_upsert_params.AutomationsFileUpsertParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationsFileUpsertResponse, + ) + + +class AsyncAutomationsFilesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAutomationsFilesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncAutomationsFilesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAutomationsFilesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncAutomationsFilesResourceWithStreamingResponse(self) + + async def upsert( + self, + *, + connect_protocol_version: Literal[1], + automations_file: automations_file_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AutomationsFileUpsertResponse: + """ + UpsertAutomationsFile upserts the automations file for the given environment. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + automations_file: WARN: Do not remove any field here, as it will break reading automation yaml + files. We error if there are any unknown fields in the yaml (to ensure the yaml + is correct), but would break if we removed any fields. This includes marking a + field as "reserved" in the proto file, this will also break reading the yaml. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", + body=await async_maybe_transform( + { + "automations_file": automations_file, + "environment_id": environment_id, + }, + automations_file_upsert_params.AutomationsFileUpsertParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationsFileUpsertResponse, + ) + + +class AutomationsFilesResourceWithRawResponse: + def __init__(self, automations_files: AutomationsFilesResource) -> None: + self._automations_files = automations_files + + self.upsert = to_raw_response_wrapper( + automations_files.upsert, + ) + + +class AsyncAutomationsFilesResourceWithRawResponse: + def __init__(self, automations_files: AsyncAutomationsFilesResource) -> None: + self._automations_files = automations_files + + self.upsert = async_to_raw_response_wrapper( + automations_files.upsert, + ) + + +class AutomationsFilesResourceWithStreamingResponse: + def __init__(self, automations_files: AutomationsFilesResource) -> None: + self._automations_files = automations_files + + self.upsert = to_streamed_response_wrapper( + automations_files.upsert, + ) + + +class AsyncAutomationsFilesResourceWithStreamingResponse: + def __init__(self, automations_files: AsyncAutomationsFilesResource) -> None: + self._automations_files = automations_files + + self.upsert = async_to_streamed_response_wrapper( + automations_files.upsert, + ) diff --git a/src/gitpod/resources/environment_automation.py b/src/gitpod/resources/environment_automation.py new file mode 100644 index 00000000..499d699b --- /dev/null +++ b/src/gitpod/resources/environment_automation.py @@ -0,0 +1,209 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..types import environment_automation_update_task_execution_status_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options + +__all__ = ["EnvironmentAutomationResource", "AsyncEnvironmentAutomationResource"] + + +class EnvironmentAutomationResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EnvironmentAutomationResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentAutomationResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentAutomationResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EnvironmentAutomationResourceWithStreamingResponse(self) + + def update_task_execution_status( + self, + *, + body: environment_automation_update_task_execution_status_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """UpdateTaskExecutionStatus updates the status of a task execution. + + Only the + environment executing a task execution is expected to call this function. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", + body=maybe_transform( + body, + environment_automation_update_task_execution_status_params.EnvironmentAutomationUpdateTaskExecutionStatusParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncEnvironmentAutomationResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEnvironmentAutomationResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEnvironmentAutomationResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEnvironmentAutomationResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEnvironmentAutomationResourceWithStreamingResponse(self) + + async def update_task_execution_status( + self, + *, + body: environment_automation_update_task_execution_status_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """UpdateTaskExecutionStatus updates the status of a task execution. + + Only the + environment executing a task execution is expected to call this function. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", + body=await async_maybe_transform( + body, + environment_automation_update_task_execution_status_params.EnvironmentAutomationUpdateTaskExecutionStatusParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class EnvironmentAutomationResourceWithRawResponse: + def __init__(self, environment_automation: EnvironmentAutomationResource) -> None: + self._environment_automation = environment_automation + + self.update_task_execution_status = to_raw_response_wrapper( + environment_automation.update_task_execution_status, + ) + + +class AsyncEnvironmentAutomationResourceWithRawResponse: + def __init__(self, environment_automation: AsyncEnvironmentAutomationResource) -> None: + self._environment_automation = environment_automation + + self.update_task_execution_status = async_to_raw_response_wrapper( + environment_automation.update_task_execution_status, + ) + + +class EnvironmentAutomationResourceWithStreamingResponse: + def __init__(self, environment_automation: EnvironmentAutomationResource) -> None: + self._environment_automation = environment_automation + + self.update_task_execution_status = to_streamed_response_wrapper( + environment_automation.update_task_execution_status, + ) + + +class AsyncEnvironmentAutomationResourceWithStreamingResponse: + def __init__(self, environment_automation: AsyncEnvironmentAutomationResource) -> None: + self._environment_automation = environment_automation + + self.update_task_execution_status = async_to_streamed_response_wrapper( + environment_automation.update_task_execution_status, + ) diff --git a/src/gitpod/resources/environment_automations/__init__.py b/src/gitpod/resources/environment_automations/__init__.py new file mode 100644 index 00000000..db0fddb0 --- /dev/null +++ b/src/gitpod/resources/environment_automations/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .tasks import ( + TasksResource, + AsyncTasksResource, + TasksResourceWithRawResponse, + AsyncTasksResourceWithRawResponse, + TasksResourceWithStreamingResponse, + AsyncTasksResourceWithStreamingResponse, +) +from .task_executions import ( + TaskExecutionsResource, + AsyncTaskExecutionsResource, + TaskExecutionsResourceWithRawResponse, + AsyncTaskExecutionsResourceWithRawResponse, + TaskExecutionsResourceWithStreamingResponse, + AsyncTaskExecutionsResourceWithStreamingResponse, +) +from .environment_automations import ( + EnvironmentAutomationsResource, + AsyncEnvironmentAutomationsResource, + EnvironmentAutomationsResourceWithRawResponse, + AsyncEnvironmentAutomationsResourceWithRawResponse, + EnvironmentAutomationsResourceWithStreamingResponse, + AsyncEnvironmentAutomationsResourceWithStreamingResponse, +) + +__all__ = [ + "TasksResource", + "AsyncTasksResource", + "TasksResourceWithRawResponse", + "AsyncTasksResourceWithRawResponse", + "TasksResourceWithStreamingResponse", + "AsyncTasksResourceWithStreamingResponse", + "TaskExecutionsResource", + "AsyncTaskExecutionsResource", + "TaskExecutionsResourceWithRawResponse", + "AsyncTaskExecutionsResourceWithRawResponse", + "TaskExecutionsResourceWithStreamingResponse", + "AsyncTaskExecutionsResourceWithStreamingResponse", + "EnvironmentAutomationsResource", + "AsyncEnvironmentAutomationsResource", + "EnvironmentAutomationsResourceWithRawResponse", + "AsyncEnvironmentAutomationsResourceWithRawResponse", + "EnvironmentAutomationsResourceWithStreamingResponse", + "AsyncEnvironmentAutomationsResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/environment_automations/environment_automations.py b/src/gitpod/resources/environment_automations/environment_automations.py new file mode 100644 index 00000000..30799d85 --- /dev/null +++ b/src/gitpod/resources/environment_automations/environment_automations.py @@ -0,0 +1,134 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .tasks import ( + TasksResource, + AsyncTasksResource, + TasksResourceWithRawResponse, + AsyncTasksResourceWithRawResponse, + TasksResourceWithStreamingResponse, + AsyncTasksResourceWithStreamingResponse, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from .task_executions import ( + TaskExecutionsResource, + AsyncTaskExecutionsResource, + TaskExecutionsResourceWithRawResponse, + AsyncTaskExecutionsResourceWithRawResponse, + TaskExecutionsResourceWithStreamingResponse, + AsyncTaskExecutionsResourceWithStreamingResponse, +) + +__all__ = ["EnvironmentAutomationsResource", "AsyncEnvironmentAutomationsResource"] + + +class EnvironmentAutomationsResource(SyncAPIResource): + @cached_property + def tasks(self) -> TasksResource: + return TasksResource(self._client) + + @cached_property + def task_executions(self) -> TaskExecutionsResource: + return TaskExecutionsResource(self._client) + + @cached_property + def with_raw_response(self) -> EnvironmentAutomationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentAutomationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentAutomationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EnvironmentAutomationsResourceWithStreamingResponse(self) + + +class AsyncEnvironmentAutomationsResource(AsyncAPIResource): + @cached_property + def tasks(self) -> AsyncTasksResource: + return AsyncTasksResource(self._client) + + @cached_property + def task_executions(self) -> AsyncTaskExecutionsResource: + return AsyncTaskExecutionsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncEnvironmentAutomationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEnvironmentAutomationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEnvironmentAutomationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEnvironmentAutomationsResourceWithStreamingResponse(self) + + +class EnvironmentAutomationsResourceWithRawResponse: + def __init__(self, environment_automations: EnvironmentAutomationsResource) -> None: + self._environment_automations = environment_automations + + @cached_property + def tasks(self) -> TasksResourceWithRawResponse: + return TasksResourceWithRawResponse(self._environment_automations.tasks) + + @cached_property + def task_executions(self) -> TaskExecutionsResourceWithRawResponse: + return TaskExecutionsResourceWithRawResponse(self._environment_automations.task_executions) + + +class AsyncEnvironmentAutomationsResourceWithRawResponse: + def __init__(self, environment_automations: AsyncEnvironmentAutomationsResource) -> None: + self._environment_automations = environment_automations + + @cached_property + def tasks(self) -> AsyncTasksResourceWithRawResponse: + return AsyncTasksResourceWithRawResponse(self._environment_automations.tasks) + + @cached_property + def task_executions(self) -> AsyncTaskExecutionsResourceWithRawResponse: + return AsyncTaskExecutionsResourceWithRawResponse(self._environment_automations.task_executions) + + +class EnvironmentAutomationsResourceWithStreamingResponse: + def __init__(self, environment_automations: EnvironmentAutomationsResource) -> None: + self._environment_automations = environment_automations + + @cached_property + def tasks(self) -> TasksResourceWithStreamingResponse: + return TasksResourceWithStreamingResponse(self._environment_automations.tasks) + + @cached_property + def task_executions(self) -> TaskExecutionsResourceWithStreamingResponse: + return TaskExecutionsResourceWithStreamingResponse(self._environment_automations.task_executions) + + +class AsyncEnvironmentAutomationsResourceWithStreamingResponse: + def __init__(self, environment_automations: AsyncEnvironmentAutomationsResource) -> None: + self._environment_automations = environment_automations + + @cached_property + def tasks(self) -> AsyncTasksResourceWithStreamingResponse: + return AsyncTasksResourceWithStreamingResponse(self._environment_automations.tasks) + + @cached_property + def task_executions(self) -> AsyncTaskExecutionsResourceWithStreamingResponse: + return AsyncTaskExecutionsResourceWithStreamingResponse(self._environment_automations.task_executions) diff --git a/src/gitpod/resources/environment_automations/task_executions.py b/src/gitpod/resources/environment_automations/task_executions.py new file mode 100644 index 00000000..7b79a67e --- /dev/null +++ b/src/gitpod/resources/environment_automations/task_executions.py @@ -0,0 +1,721 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.environment_automations import ( + task_execution_list_params, + task_execution_stop_params, + task_execution_retrieve_params, + task_execution_create_list_params, + task_execution_create_retrieve_params, +) +from ...types.environment_automations.task_execution_list_response import TaskExecutionListResponse +from ...types.environment_automations.task_execution_retrieve_response import TaskExecutionRetrieveResponse +from ...types.environment_automations.task_execution_create_list_response import TaskExecutionCreateListResponse +from ...types.environment_automations.task_execution_create_retrieve_response import TaskExecutionCreateRetrieveResponse + +__all__ = ["TaskExecutionsResource", "AsyncTaskExecutionsResource"] + + +class TaskExecutionsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TaskExecutionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return TaskExecutionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TaskExecutionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return TaskExecutionsResourceWithStreamingResponse(self) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskExecutionRetrieveResponse: + """ + GetTaskExecution + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + task_execution_retrieve_params.TaskExecutionRetrieveParams, + ), + ), + cast_to=TaskExecutionRetrieveResponse, + ) + + def list( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskExecutionListResponse: + """ + ListTaskExecutions + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + task_execution_list_params.TaskExecutionListParams, + ), + ), + cast_to=TaskExecutionListResponse, + ) + + def create_list( + self, + *, + connect_protocol_version: Literal[1], + filter: task_execution_create_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_execution_create_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskExecutionCreateListResponse: + """ + ListTaskExecutions + + Args: + connect_protocol_version: Define the version of the Connect protocol + + filter: filter contains the filter options for listing task runs + + pagination: pagination contains the pagination options for listing task runs + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + task_execution_create_list_params.TaskExecutionCreateListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskExecutionCreateListResponse, + ) + + def create_retrieve( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskExecutionCreateRetrieveResponse: + """ + GetTaskExecution + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + body=maybe_transform({"id": id}, task_execution_create_retrieve_params.TaskExecutionCreateRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskExecutionCreateRetrieveResponse, + ) + + def stop( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + StopTaskExecution + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", + body=maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncTaskExecutionsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTaskExecutionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncTaskExecutionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTaskExecutionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncTaskExecutionsResourceWithStreamingResponse(self) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskExecutionRetrieveResponse: + """ + GetTaskExecution + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + task_execution_retrieve_params.TaskExecutionRetrieveParams, + ), + ), + cast_to=TaskExecutionRetrieveResponse, + ) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskExecutionListResponse: + """ + ListTaskExecutions + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + task_execution_list_params.TaskExecutionListParams, + ), + ), + cast_to=TaskExecutionListResponse, + ) + + async def create_list( + self, + *, + connect_protocol_version: Literal[1], + filter: task_execution_create_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_execution_create_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskExecutionCreateListResponse: + """ + ListTaskExecutions + + Args: + connect_protocol_version: Define the version of the Connect protocol + + filter: filter contains the filter options for listing task runs + + pagination: pagination contains the pagination options for listing task runs + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + task_execution_create_list_params.TaskExecutionCreateListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskExecutionCreateListResponse, + ) + + async def create_retrieve( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskExecutionCreateRetrieveResponse: + """ + GetTaskExecution + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + body=await async_maybe_transform( + {"id": id}, task_execution_create_retrieve_params.TaskExecutionCreateRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskExecutionCreateRetrieveResponse, + ) + + async def stop( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + StopTaskExecution + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", + body=await async_maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class TaskExecutionsResourceWithRawResponse: + def __init__(self, task_executions: TaskExecutionsResource) -> None: + self._task_executions = task_executions + + self.retrieve = to_raw_response_wrapper( + task_executions.retrieve, + ) + self.list = to_raw_response_wrapper( + task_executions.list, + ) + self.create_list = to_raw_response_wrapper( + task_executions.create_list, + ) + self.create_retrieve = to_raw_response_wrapper( + task_executions.create_retrieve, + ) + self.stop = to_raw_response_wrapper( + task_executions.stop, + ) + + +class AsyncTaskExecutionsResourceWithRawResponse: + def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: + self._task_executions = task_executions + + self.retrieve = async_to_raw_response_wrapper( + task_executions.retrieve, + ) + self.list = async_to_raw_response_wrapper( + task_executions.list, + ) + self.create_list = async_to_raw_response_wrapper( + task_executions.create_list, + ) + self.create_retrieve = async_to_raw_response_wrapper( + task_executions.create_retrieve, + ) + self.stop = async_to_raw_response_wrapper( + task_executions.stop, + ) + + +class TaskExecutionsResourceWithStreamingResponse: + def __init__(self, task_executions: TaskExecutionsResource) -> None: + self._task_executions = task_executions + + self.retrieve = to_streamed_response_wrapper( + task_executions.retrieve, + ) + self.list = to_streamed_response_wrapper( + task_executions.list, + ) + self.create_list = to_streamed_response_wrapper( + task_executions.create_list, + ) + self.create_retrieve = to_streamed_response_wrapper( + task_executions.create_retrieve, + ) + self.stop = to_streamed_response_wrapper( + task_executions.stop, + ) + + +class AsyncTaskExecutionsResourceWithStreamingResponse: + def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: + self._task_executions = task_executions + + self.retrieve = async_to_streamed_response_wrapper( + task_executions.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + task_executions.list, + ) + self.create_list = async_to_streamed_response_wrapper( + task_executions.create_list, + ) + self.create_retrieve = async_to_streamed_response_wrapper( + task_executions.create_retrieve, + ) + self.stop = async_to_streamed_response_wrapper( + task_executions.stop, + ) diff --git a/src/gitpod/resources/environment_automations/tasks.py b/src/gitpod/resources/environment_automations/tasks.py new file mode 100644 index 00000000..8f56906b --- /dev/null +++ b/src/gitpod/resources/environment_automations/tasks.py @@ -0,0 +1,717 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.environment_automations import ( + task_list_params, + task_start_params, + task_delete_params, + task_update_params, + task_create_list_params, +) +from ...types.environment_automations.task_list_response import TaskListResponse +from ...types.environment_automations.task_start_response import TaskStartResponse +from ...types.environment_automations.task_create_list_response import TaskCreateListResponse + +__all__ = ["TasksResource", "AsyncTasksResource"] + + +class TasksResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TasksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return TasksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TasksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return TasksResourceWithStreamingResponse(self) + + def update( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + depends_on: List[str] | NotGiven = NOT_GIVEN, + metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, + spec: Union[object, object] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + depends_on: dependencies specifies the IDs of the automations this task depends on. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/UpdateTask", + body=maybe_transform( + { + "id": id, + "depends_on": depends_on, + "metadata": metadata, + "spec": spec, + }, + task_update_params.TaskUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskListResponse: + """ + ListTasks + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentAutomationService/ListTasks", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + task_list_params.TaskListParams, + ), + ), + cast_to=TaskListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/DeleteTask", + body=maybe_transform({"id": id}, task_delete_params.TaskDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def create_list( + self, + *, + connect_protocol_version: Literal[1], + filter: task_create_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_create_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskCreateListResponse: + """ + ListTasks + + Args: + connect_protocol_version: Define the version of the Connect protocol + + filter: filter contains the filter options for listing tasks + + pagination: pagination contains the pagination options for listing tasks + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/ListTasks", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + task_create_list_params.TaskCreateListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskCreateListResponse, + ) + + def start( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskStartResponse: + """StartTask starts a task, i.e. + + creates a task execution. This call does not block + until the task is started; the task will be started asynchronously. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/StartTask", + body=maybe_transform({"id": id}, task_start_params.TaskStartParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskStartResponse, + ) + + +class AsyncTasksResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncTasksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncTasksResourceWithStreamingResponse(self) + + async def update( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + depends_on: List[str] | NotGiven = NOT_GIVEN, + metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, + spec: Union[object, object] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + depends_on: dependencies specifies the IDs of the automations this task depends on. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/UpdateTask", + body=await async_maybe_transform( + { + "id": id, + "depends_on": depends_on, + "metadata": metadata, + "spec": spec, + }, + task_update_params.TaskUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskListResponse: + """ + ListTasks + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EnvironmentAutomationService/ListTasks", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + task_list_params.TaskListParams, + ), + ), + cast_to=TaskListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/DeleteTask", + body=await async_maybe_transform({"id": id}, task_delete_params.TaskDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def create_list( + self, + *, + connect_protocol_version: Literal[1], + filter: task_create_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_create_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskCreateListResponse: + """ + ListTasks + + Args: + connect_protocol_version: Define the version of the Connect protocol + + filter: filter contains the filter options for listing tasks + + pagination: pagination contains the pagination options for listing tasks + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/ListTasks", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + task_create_list_params.TaskCreateListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskCreateListResponse, + ) + + async def start( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskStartResponse: + """StartTask starts a task, i.e. + + creates a task execution. This call does not block + until the task is started; the task will be started asynchronously. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/StartTask", + body=await async_maybe_transform({"id": id}, task_start_params.TaskStartParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskStartResponse, + ) + + +class TasksResourceWithRawResponse: + def __init__(self, tasks: TasksResource) -> None: + self._tasks = tasks + + self.update = to_raw_response_wrapper( + tasks.update, + ) + self.list = to_raw_response_wrapper( + tasks.list, + ) + self.delete = to_raw_response_wrapper( + tasks.delete, + ) + self.create_list = to_raw_response_wrapper( + tasks.create_list, + ) + self.start = to_raw_response_wrapper( + tasks.start, + ) + + +class AsyncTasksResourceWithRawResponse: + def __init__(self, tasks: AsyncTasksResource) -> None: + self._tasks = tasks + + self.update = async_to_raw_response_wrapper( + tasks.update, + ) + self.list = async_to_raw_response_wrapper( + tasks.list, + ) + self.delete = async_to_raw_response_wrapper( + tasks.delete, + ) + self.create_list = async_to_raw_response_wrapper( + tasks.create_list, + ) + self.start = async_to_raw_response_wrapper( + tasks.start, + ) + + +class TasksResourceWithStreamingResponse: + def __init__(self, tasks: TasksResource) -> None: + self._tasks = tasks + + self.update = to_streamed_response_wrapper( + tasks.update, + ) + self.list = to_streamed_response_wrapper( + tasks.list, + ) + self.delete = to_streamed_response_wrapper( + tasks.delete, + ) + self.create_list = to_streamed_response_wrapper( + tasks.create_list, + ) + self.start = to_streamed_response_wrapper( + tasks.start, + ) + + +class AsyncTasksResourceWithStreamingResponse: + def __init__(self, tasks: AsyncTasksResource) -> None: + self._tasks = tasks + + self.update = async_to_streamed_response_wrapper( + tasks.update, + ) + self.list = async_to_streamed_response_wrapper( + tasks.list, + ) + self.delete = async_to_streamed_response_wrapper( + tasks.delete, + ) + self.create_list = async_to_streamed_response_wrapper( + tasks.create_list, + ) + self.start = async_to_streamed_response_wrapper( + tasks.start, + ) diff --git a/src/gitpod/resources/environment_classes.py b/src/gitpod/resources/environment_classes.py new file mode 100644 index 00000000..7d2e7479 --- /dev/null +++ b/src/gitpod/resources/environment_classes.py @@ -0,0 +1,223 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal + +import httpx + +from ..types import environment_class_list_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.environment_class_list_response import EnvironmentClassListResponse + +__all__ = ["EnvironmentClassesResource", "AsyncEnvironmentClassesResource"] + + +class EnvironmentClassesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EnvironmentClassesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentClassesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EnvironmentClassesResourceWithStreamingResponse(self) + + def list( + self, + *, + connect_protocol_version: Literal[1], + filter: Union[object, object] | NotGiven = NOT_GIVEN, + pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentClassListResponse: + """ + ListEnvironmentClasses returns the list of environment classes with runner + details a user is able to use based on the query buf:lint:ignore + RPC_REQUEST_RESPONSE_UNIQUE + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environment classes + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + environment_class_list_params.EnvironmentClassListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentClassListResponse, + ) + + +class AsyncEnvironmentClassesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEnvironmentClassesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEnvironmentClassesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEnvironmentClassesResourceWithStreamingResponse(self) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + filter: Union[object, object] | NotGiven = NOT_GIVEN, + pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentClassListResponse: + """ + ListEnvironmentClasses returns the list of environment classes with runner + details a user is able to use based on the query buf:lint:ignore + RPC_REQUEST_RESPONSE_UNIQUE + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environment classes + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + environment_class_list_params.EnvironmentClassListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentClassListResponse, + ) + + +class EnvironmentClassesResourceWithRawResponse: + def __init__(self, environment_classes: EnvironmentClassesResource) -> None: + self._environment_classes = environment_classes + + self.list = to_raw_response_wrapper( + environment_classes.list, + ) + + +class AsyncEnvironmentClassesResourceWithRawResponse: + def __init__(self, environment_classes: AsyncEnvironmentClassesResource) -> None: + self._environment_classes = environment_classes + + self.list = async_to_raw_response_wrapper( + environment_classes.list, + ) + + +class EnvironmentClassesResourceWithStreamingResponse: + def __init__(self, environment_classes: EnvironmentClassesResource) -> None: + self._environment_classes = environment_classes + + self.list = to_streamed_response_wrapper( + environment_classes.list, + ) + + +class AsyncEnvironmentClassesResourceWithStreamingResponse: + def __init__(self, environment_classes: AsyncEnvironmentClassesResource) -> None: + self._environment_classes = environment_classes + + self.list = async_to_streamed_response_wrapper( + environment_classes.list, + ) diff --git a/src/gitpod/resources/environments.py b/src/gitpod/resources/environments.py new file mode 100644 index 00000000..c8f898aa --- /dev/null +++ b/src/gitpod/resources/environments.py @@ -0,0 +1,711 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..types import ( + environment_list_params, + environment_start_params, + environment_create_params, + environment_retrieve_params, + environment_create_from_project_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.environment_list_response import EnvironmentListResponse +from ..types.environment_create_response import EnvironmentCreateResponse +from ..types.environment_retrieve_response import EnvironmentRetrieveResponse +from ..types.environment_create_from_project_response import EnvironmentCreateFromProjectResponse + +__all__ = ["EnvironmentsResource", "AsyncEnvironmentsResource"] + + +class EnvironmentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EnvironmentsResourceWithStreamingResponse(self) + + def create( + self, + *, + connect_protocol_version: Literal[1], + spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentCreateResponse: + """ + CreateEnvironment creates a new environment and starts it. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + spec: EnvironmentSpec specifies the configuration of an environment for an environment + start + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/CreateEnvironment", + body=maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentCreateResponse, + ) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentRetrieveResponse: + """ + GetEnvironment returns a single environment. + + +return NOT_FOUND User does not have access to an environment with the given ID + +return NOT_FOUND Environment does not exist + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies the environment to get + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/GetEnvironment", + body=maybe_transform( + {"environment_id": environment_id}, environment_retrieve_params.EnvironmentRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentRetrieveResponse, + ) + + def list( + self, + *, + connect_protocol_version: Literal[1], + filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentListResponse: + """ + ListEnvironments returns a list of environments that match the query. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + organization_id: organization_id is the ID of the organization that contains the environments + + pagination: pagination contains the pagination options for listing environments + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/ListEnvironments", + body=maybe_transform( + { + "filter": filter, + "organization_id": organization_id, + "pagination": pagination, + }, + environment_list_params.EnvironmentListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentListResponse, + ) + + def create_from_project( + self, + *, + connect_protocol_version: Literal[1], + project_id: str | NotGiven = NOT_GIVEN, + spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentCreateFromProjectResponse: + """ + CreateAbdStartEnvironmentFromProject creates a new environment from a project + and starts it. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + spec: EnvironmentSpec specifies the configuration of an environment for an environment + start + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", + body=maybe_transform( + { + "project_id": project_id, + "spec": spec, + }, + environment_create_from_project_params.EnvironmentCreateFromProjectParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentCreateFromProjectResponse, + ) + + def start( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """StartEnvironment starts an environment. + + This function is idempotent, i.e. if the + environment is already running no error is returned. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies which environment should be started. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/StartEnvironment", + body=maybe_transform({"environment_id": environment_id}, environment_start_params.EnvironmentStartParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncEnvironmentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEnvironmentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEnvironmentsResourceWithStreamingResponse(self) + + async def create( + self, + *, + connect_protocol_version: Literal[1], + spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentCreateResponse: + """ + CreateEnvironment creates a new environment and starts it. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + spec: EnvironmentSpec specifies the configuration of an environment for an environment + start + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentService/CreateEnvironment", + body=await async_maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentCreateResponse, + ) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentRetrieveResponse: + """ + GetEnvironment returns a single environment. + + +return NOT_FOUND User does not have access to an environment with the given ID + +return NOT_FOUND Environment does not exist + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies the environment to get + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentService/GetEnvironment", + body=await async_maybe_transform( + {"environment_id": environment_id}, environment_retrieve_params.EnvironmentRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentRetrieveResponse, + ) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentListResponse: + """ + ListEnvironments returns a list of environments that match the query. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + organization_id: organization_id is the ID of the organization that contains the environments + + pagination: pagination contains the pagination options for listing environments + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentService/ListEnvironments", + body=await async_maybe_transform( + { + "filter": filter, + "organization_id": organization_id, + "pagination": pagination, + }, + environment_list_params.EnvironmentListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentListResponse, + ) + + async def create_from_project( + self, + *, + connect_protocol_version: Literal[1], + project_id: str | NotGiven = NOT_GIVEN, + spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentCreateFromProjectResponse: + """ + CreateAbdStartEnvironmentFromProject creates a new environment from a project + and starts it. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + spec: EnvironmentSpec specifies the configuration of an environment for an environment + start + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", + body=await async_maybe_transform( + { + "project_id": project_id, + "spec": spec, + }, + environment_create_from_project_params.EnvironmentCreateFromProjectParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentCreateFromProjectResponse, + ) + + async def start( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """StartEnvironment starts an environment. + + This function is idempotent, i.e. if the + environment is already running no error is returned. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies which environment should be started. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentService/StartEnvironment", + body=await async_maybe_transform( + {"environment_id": environment_id}, environment_start_params.EnvironmentStartParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class EnvironmentsResourceWithRawResponse: + def __init__(self, environments: EnvironmentsResource) -> None: + self._environments = environments + + self.create = to_raw_response_wrapper( + environments.create, + ) + self.retrieve = to_raw_response_wrapper( + environments.retrieve, + ) + self.list = to_raw_response_wrapper( + environments.list, + ) + self.create_from_project = to_raw_response_wrapper( + environments.create_from_project, + ) + self.start = to_raw_response_wrapper( + environments.start, + ) + + +class AsyncEnvironmentsResourceWithRawResponse: + def __init__(self, environments: AsyncEnvironmentsResource) -> None: + self._environments = environments + + self.create = async_to_raw_response_wrapper( + environments.create, + ) + self.retrieve = async_to_raw_response_wrapper( + environments.retrieve, + ) + self.list = async_to_raw_response_wrapper( + environments.list, + ) + self.create_from_project = async_to_raw_response_wrapper( + environments.create_from_project, + ) + self.start = async_to_raw_response_wrapper( + environments.start, + ) + + +class EnvironmentsResourceWithStreamingResponse: + def __init__(self, environments: EnvironmentsResource) -> None: + self._environments = environments + + self.create = to_streamed_response_wrapper( + environments.create, + ) + self.retrieve = to_streamed_response_wrapper( + environments.retrieve, + ) + self.list = to_streamed_response_wrapper( + environments.list, + ) + self.create_from_project = to_streamed_response_wrapper( + environments.create_from_project, + ) + self.start = to_streamed_response_wrapper( + environments.start, + ) + + +class AsyncEnvironmentsResourceWithStreamingResponse: + def __init__(self, environments: AsyncEnvironmentsResource) -> None: + self._environments = environments + + self.create = async_to_streamed_response_wrapper( + environments.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + environments.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + environments.list, + ) + self.create_from_project = async_to_streamed_response_wrapper( + environments.create_from_project, + ) + self.start = async_to_streamed_response_wrapper( + environments.start, + ) diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py new file mode 100644 index 00000000..a7e31bb1 --- /dev/null +++ b/src/gitpod/resources/organizations/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .invite import ( + InviteResource, + AsyncInviteResource, + InviteResourceWithRawResponse, + AsyncInviteResourceWithRawResponse, + InviteResourceWithStreamingResponse, + AsyncInviteResourceWithStreamingResponse, +) +from .members import ( + MembersResource, + AsyncMembersResource, + MembersResourceWithRawResponse, + AsyncMembersResourceWithRawResponse, + MembersResourceWithStreamingResponse, + AsyncMembersResourceWithStreamingResponse, +) +from .organizations import ( + OrganizationsResource, + AsyncOrganizationsResource, + OrganizationsResourceWithRawResponse, + AsyncOrganizationsResourceWithRawResponse, + OrganizationsResourceWithStreamingResponse, + AsyncOrganizationsResourceWithStreamingResponse, +) + +__all__ = [ + "MembersResource", + "AsyncMembersResource", + "MembersResourceWithRawResponse", + "AsyncMembersResourceWithRawResponse", + "MembersResourceWithStreamingResponse", + "AsyncMembersResourceWithStreamingResponse", + "InviteResource", + "AsyncInviteResource", + "InviteResourceWithRawResponse", + "AsyncInviteResourceWithRawResponse", + "InviteResourceWithStreamingResponse", + "AsyncInviteResourceWithStreamingResponse", + "OrganizationsResource", + "AsyncOrganizationsResource", + "OrganizationsResourceWithRawResponse", + "AsyncOrganizationsResourceWithRawResponse", + "OrganizationsResourceWithStreamingResponse", + "AsyncOrganizationsResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/organizations/invite/__init__.py b/src/gitpod/resources/organizations/invite/__init__.py new file mode 100644 index 00000000..439e89d5 --- /dev/null +++ b/src/gitpod/resources/organizations/invite/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .invite import ( + InviteResource, + AsyncInviteResource, + InviteResourceWithRawResponse, + AsyncInviteResourceWithRawResponse, + InviteResourceWithStreamingResponse, + AsyncInviteResourceWithStreamingResponse, +) +from .summary import ( + SummaryResource, + AsyncSummaryResource, + SummaryResourceWithRawResponse, + AsyncSummaryResourceWithRawResponse, + SummaryResourceWithStreamingResponse, + AsyncSummaryResourceWithStreamingResponse, +) + +__all__ = [ + "SummaryResource", + "AsyncSummaryResource", + "SummaryResourceWithRawResponse", + "AsyncSummaryResourceWithRawResponse", + "SummaryResourceWithStreamingResponse", + "AsyncSummaryResourceWithStreamingResponse", + "InviteResource", + "AsyncInviteResource", + "InviteResourceWithRawResponse", + "AsyncInviteResourceWithRawResponse", + "InviteResourceWithStreamingResponse", + "AsyncInviteResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/organizations/invite/invite.py b/src/gitpod/resources/organizations/invite/invite.py new file mode 100644 index 00000000..c1b4b70f --- /dev/null +++ b/src/gitpod/resources/organizations/invite/invite.py @@ -0,0 +1,351 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from .summary import ( + SummaryResource, + AsyncSummaryResource, + SummaryResourceWithRawResponse, + AsyncSummaryResourceWithRawResponse, + SummaryResourceWithStreamingResponse, + AsyncSummaryResourceWithStreamingResponse, +) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import make_request_options +from ....types.organizations import invite_create_params, invite_retrieve_params +from ....types.organizations.invite_create_response import InviteCreateResponse +from ....types.organizations.invite_retrieve_response import InviteRetrieveResponse + +__all__ = ["InviteResource", "AsyncInviteResource"] + + +class InviteResource(SyncAPIResource): + @cached_property + def summary(self) -> SummaryResource: + return SummaryResource(self._client) + + @cached_property + def with_raw_response(self) -> InviteResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return InviteResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> InviteResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return InviteResourceWithStreamingResponse(self) + + def create( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InviteCreateResponse: + """CreateOrganizationInvite creates an invite for the organization. + + Any existing + OrganizationInvites are invalidated and can no longer be used. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/CreateOrganizationInvite", + body=maybe_transform({"organization_id": organization_id}, invite_create_params.InviteCreateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InviteCreateResponse, + ) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InviteRetrieveResponse: + """GetOrganizationInvite retrieves invite for the organization. + + If no invite + exists, a new one is created. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/GetOrganizationInvite", + body=maybe_transform({"organization_id": organization_id}, invite_retrieve_params.InviteRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InviteRetrieveResponse, + ) + + +class AsyncInviteResource(AsyncAPIResource): + @cached_property + def summary(self) -> AsyncSummaryResource: + return AsyncSummaryResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncInviteResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncInviteResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncInviteResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncInviteResourceWithStreamingResponse(self) + + async def create( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InviteCreateResponse: + """CreateOrganizationInvite creates an invite for the organization. + + Any existing + OrganizationInvites are invalidated and can no longer be used. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/CreateOrganizationInvite", + body=await async_maybe_transform( + {"organization_id": organization_id}, invite_create_params.InviteCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InviteCreateResponse, + ) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InviteRetrieveResponse: + """GetOrganizationInvite retrieves invite for the organization. + + If no invite + exists, a new one is created. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/GetOrganizationInvite", + body=await async_maybe_transform( + {"organization_id": organization_id}, invite_retrieve_params.InviteRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InviteRetrieveResponse, + ) + + +class InviteResourceWithRawResponse: + def __init__(self, invite: InviteResource) -> None: + self._invite = invite + + self.create = to_raw_response_wrapper( + invite.create, + ) + self.retrieve = to_raw_response_wrapper( + invite.retrieve, + ) + + @cached_property + def summary(self) -> SummaryResourceWithRawResponse: + return SummaryResourceWithRawResponse(self._invite.summary) + + +class AsyncInviteResourceWithRawResponse: + def __init__(self, invite: AsyncInviteResource) -> None: + self._invite = invite + + self.create = async_to_raw_response_wrapper( + invite.create, + ) + self.retrieve = async_to_raw_response_wrapper( + invite.retrieve, + ) + + @cached_property + def summary(self) -> AsyncSummaryResourceWithRawResponse: + return AsyncSummaryResourceWithRawResponse(self._invite.summary) + + +class InviteResourceWithStreamingResponse: + def __init__(self, invite: InviteResource) -> None: + self._invite = invite + + self.create = to_streamed_response_wrapper( + invite.create, + ) + self.retrieve = to_streamed_response_wrapper( + invite.retrieve, + ) + + @cached_property + def summary(self) -> SummaryResourceWithStreamingResponse: + return SummaryResourceWithStreamingResponse(self._invite.summary) + + +class AsyncInviteResourceWithStreamingResponse: + def __init__(self, invite: AsyncInviteResource) -> None: + self._invite = invite + + self.create = async_to_streamed_response_wrapper( + invite.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + invite.retrieve, + ) + + @cached_property + def summary(self) -> AsyncSummaryResourceWithStreamingResponse: + return AsyncSummaryResourceWithStreamingResponse(self._invite.summary) diff --git a/src/gitpod/resources/organizations/invite/summary.py b/src/gitpod/resources/organizations/invite/summary.py new file mode 100644 index 00000000..e7dee9f7 --- /dev/null +++ b/src/gitpod/resources/organizations/invite/summary.py @@ -0,0 +1,202 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import make_request_options +from ....types.organizations.invite import summary_retrieve_params +from ....types.organizations.invite.summary_retrieve_response import SummaryRetrieveResponse + +__all__ = ["SummaryResource", "AsyncSummaryResource"] + + +class SummaryResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SummaryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return SummaryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return SummaryResourceWithStreamingResponse(self) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + invite_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryRetrieveResponse: + """ + GetOrganizationInviteSummary retrieves a summary of the organization based on an + Invite ID. Used to discover which organization an invite is for. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", + body=maybe_transform({"invite_id": invite_id}, summary_retrieve_params.SummaryRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SummaryRetrieveResponse, + ) + + +class AsyncSummaryResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncSummaryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncSummaryResourceWithStreamingResponse(self) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + invite_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryRetrieveResponse: + """ + GetOrganizationInviteSummary retrieves a summary of the organization based on an + Invite ID. Used to discover which organization an invite is for. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", + body=await async_maybe_transform({"invite_id": invite_id}, summary_retrieve_params.SummaryRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SummaryRetrieveResponse, + ) + + +class SummaryResourceWithRawResponse: + def __init__(self, summary: SummaryResource) -> None: + self._summary = summary + + self.retrieve = to_raw_response_wrapper( + summary.retrieve, + ) + + +class AsyncSummaryResourceWithRawResponse: + def __init__(self, summary: AsyncSummaryResource) -> None: + self._summary = summary + + self.retrieve = async_to_raw_response_wrapper( + summary.retrieve, + ) + + +class SummaryResourceWithStreamingResponse: + def __init__(self, summary: SummaryResource) -> None: + self._summary = summary + + self.retrieve = to_streamed_response_wrapper( + summary.retrieve, + ) + + +class AsyncSummaryResourceWithStreamingResponse: + def __init__(self, summary: AsyncSummaryResource) -> None: + self._summary = summary + + self.retrieve = async_to_streamed_response_wrapper( + summary.retrieve, + ) diff --git a/src/gitpod/resources/organizations/members.py b/src/gitpod/resources/organizations/members.py new file mode 100644 index 00000000..9c7ef93f --- /dev/null +++ b/src/gitpod/resources/organizations/members.py @@ -0,0 +1,222 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.organizations import member_list_params +from ...types.organizations.member_list_response import MemberListResponse + +__all__ = ["MembersResource", "AsyncMembersResource"] + + +class MembersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> MembersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return MembersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> MembersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return MembersResourceWithStreamingResponse(self) + + def list( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + pagination: member_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> MemberListResponse: + """ + ListMembers lists all members of the specified organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + organization_id: organization_id is the ID of the organization to list members for + + pagination: pagination contains the pagination options for listing members + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/ListMembers", + body=maybe_transform( + { + "organization_id": organization_id, + "pagination": pagination, + }, + member_list_params.MemberListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MemberListResponse, + ) + + +class AsyncMembersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncMembersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncMembersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncMembersResourceWithStreamingResponse(self) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + pagination: member_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> MemberListResponse: + """ + ListMembers lists all members of the specified organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + organization_id: organization_id is the ID of the organization to list members for + + pagination: pagination contains the pagination options for listing members + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/ListMembers", + body=await async_maybe_transform( + { + "organization_id": organization_id, + "pagination": pagination, + }, + member_list_params.MemberListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MemberListResponse, + ) + + +class MembersResourceWithRawResponse: + def __init__(self, members: MembersResource) -> None: + self._members = members + + self.list = to_raw_response_wrapper( + members.list, + ) + + +class AsyncMembersResourceWithRawResponse: + def __init__(self, members: AsyncMembersResource) -> None: + self._members = members + + self.list = async_to_raw_response_wrapper( + members.list, + ) + + +class MembersResourceWithStreamingResponse: + def __init__(self, members: MembersResource) -> None: + self._members = members + + self.list = to_streamed_response_wrapper( + members.list, + ) + + +class AsyncMembersResourceWithStreamingResponse: + def __init__(self, members: AsyncMembersResource) -> None: + self._members = members + + self.list = async_to_streamed_response_wrapper( + members.list, + ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py new file mode 100644 index 00000000..019b79b8 --- /dev/null +++ b/src/gitpod/resources/organizations/organizations.py @@ -0,0 +1,390 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from .invite import ( + InviteResource, + AsyncInviteResource, + InviteResourceWithRawResponse, + AsyncInviteResourceWithRawResponse, + InviteResourceWithStreamingResponse, + AsyncInviteResourceWithStreamingResponse, +) +from ...types import organization_leave_params, organization_set_role_params +from .members import ( + MembersResource, + AsyncMembersResource, + MembersResourceWithRawResponse, + AsyncMembersResourceWithRawResponse, + MembersResourceWithStreamingResponse, + AsyncMembersResourceWithStreamingResponse, +) +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .invite.invite import InviteResource, AsyncInviteResource +from ..._base_client import make_request_options + +__all__ = ["OrganizationsResource", "AsyncOrganizationsResource"] + + +class OrganizationsResource(SyncAPIResource): + @cached_property + def members(self) -> MembersResource: + return MembersResource(self._client) + + @cached_property + def invite(self) -> InviteResource: + return InviteResource(self._client) + + @cached_property + def with_raw_response(self) -> OrganizationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return OrganizationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return OrganizationsResourceWithStreamingResponse(self) + + def leave( + self, + *, + connect_protocol_version: Literal[1], + user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + LeaveOrganization lets the passed user leave an Organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/LeaveOrganization", + body=maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_role( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] + | NotGiven = NOT_GIVEN, + user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SetRole + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/SetRole", + body=maybe_transform( + { + "organization_id": organization_id, + "role": role, + "user_id": user_id, + }, + organization_set_role_params.OrganizationSetRoleParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncOrganizationsResource(AsyncAPIResource): + @cached_property + def members(self) -> AsyncMembersResource: + return AsyncMembersResource(self._client) + + @cached_property + def invite(self) -> AsyncInviteResource: + return AsyncInviteResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncOrganizationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncOrganizationsResourceWithStreamingResponse(self) + + async def leave( + self, + *, + connect_protocol_version: Literal[1], + user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + LeaveOrganization lets the passed user leave an Organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/LeaveOrganization", + body=await async_maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_role( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] + | NotGiven = NOT_GIVEN, + user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SetRole + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/SetRole", + body=await async_maybe_transform( + { + "organization_id": organization_id, + "role": role, + "user_id": user_id, + }, + organization_set_role_params.OrganizationSetRoleParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class OrganizationsResourceWithRawResponse: + def __init__(self, organizations: OrganizationsResource) -> None: + self._organizations = organizations + + self.leave = to_raw_response_wrapper( + organizations.leave, + ) + self.set_role = to_raw_response_wrapper( + organizations.set_role, + ) + + @cached_property + def members(self) -> MembersResourceWithRawResponse: + return MembersResourceWithRawResponse(self._organizations.members) + + @cached_property + def invite(self) -> InviteResourceWithRawResponse: + return InviteResourceWithRawResponse(self._organizations.invite) + + +class AsyncOrganizationsResourceWithRawResponse: + def __init__(self, organizations: AsyncOrganizationsResource) -> None: + self._organizations = organizations + + self.leave = async_to_raw_response_wrapper( + organizations.leave, + ) + self.set_role = async_to_raw_response_wrapper( + organizations.set_role, + ) + + @cached_property + def members(self) -> AsyncMembersResourceWithRawResponse: + return AsyncMembersResourceWithRawResponse(self._organizations.members) + + @cached_property + def invite(self) -> AsyncInviteResourceWithRawResponse: + return AsyncInviteResourceWithRawResponse(self._organizations.invite) + + +class OrganizationsResourceWithStreamingResponse: + def __init__(self, organizations: OrganizationsResource) -> None: + self._organizations = organizations + + self.leave = to_streamed_response_wrapper( + organizations.leave, + ) + self.set_role = to_streamed_response_wrapper( + organizations.set_role, + ) + + @cached_property + def members(self) -> MembersResourceWithStreamingResponse: + return MembersResourceWithStreamingResponse(self._organizations.members) + + @cached_property + def invite(self) -> InviteResourceWithStreamingResponse: + return InviteResourceWithStreamingResponse(self._organizations.invite) + + +class AsyncOrganizationsResourceWithStreamingResponse: + def __init__(self, organizations: AsyncOrganizationsResource) -> None: + self._organizations = organizations + + self.leave = async_to_streamed_response_wrapper( + organizations.leave, + ) + self.set_role = async_to_streamed_response_wrapper( + organizations.set_role, + ) + + @cached_property + def members(self) -> AsyncMembersResourceWithStreamingResponse: + return AsyncMembersResourceWithStreamingResponse(self._organizations.members) + + @cached_property + def invite(self) -> AsyncInviteResourceWithStreamingResponse: + return AsyncInviteResourceWithStreamingResponse(self._organizations.invite) diff --git a/src/gitpod/resources/personal_access_tokens.py b/src/gitpod/resources/personal_access_tokens.py new file mode 100644 index 00000000..d4a1dbf7 --- /dev/null +++ b/src/gitpod/resources/personal_access_tokens.py @@ -0,0 +1,326 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..types import personal_access_token_list_params, personal_access_token_delete_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.personal_access_token_list_response import PersonalAccessTokenListResponse + +__all__ = ["PersonalAccessTokensResource", "AsyncPersonalAccessTokensResource"] + + +class PersonalAccessTokensResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PersonalAccessTokensResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return PersonalAccessTokensResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PersonalAccessTokensResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return PersonalAccessTokensResourceWithStreamingResponse(self) + + def list( + self, + *, + connect_protocol_version: Literal[1], + filter: personal_access_token_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: personal_access_token_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PersonalAccessTokenListResponse: + """ + ListPersonalAccessTokens + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.UserService/ListPersonalAccessTokens", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + personal_access_token_list_params.PersonalAccessTokenListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PersonalAccessTokenListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + personal_access_token_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeletePersonalAccessToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.UserService/DeletePersonalAccessToken", + body=maybe_transform( + {"personal_access_token_id": personal_access_token_id}, + personal_access_token_delete_params.PersonalAccessTokenDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncPersonalAccessTokensResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPersonalAccessTokensResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncPersonalAccessTokensResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPersonalAccessTokensResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncPersonalAccessTokensResourceWithStreamingResponse(self) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + filter: personal_access_token_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: personal_access_token_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PersonalAccessTokenListResponse: + """ + ListPersonalAccessTokens + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.UserService/ListPersonalAccessTokens", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + personal_access_token_list_params.PersonalAccessTokenListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PersonalAccessTokenListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + personal_access_token_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeletePersonalAccessToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.UserService/DeletePersonalAccessToken", + body=await async_maybe_transform( + {"personal_access_token_id": personal_access_token_id}, + personal_access_token_delete_params.PersonalAccessTokenDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class PersonalAccessTokensResourceWithRawResponse: + def __init__(self, personal_access_tokens: PersonalAccessTokensResource) -> None: + self._personal_access_tokens = personal_access_tokens + + self.list = to_raw_response_wrapper( + personal_access_tokens.list, + ) + self.delete = to_raw_response_wrapper( + personal_access_tokens.delete, + ) + + +class AsyncPersonalAccessTokensResourceWithRawResponse: + def __init__(self, personal_access_tokens: AsyncPersonalAccessTokensResource) -> None: + self._personal_access_tokens = personal_access_tokens + + self.list = async_to_raw_response_wrapper( + personal_access_tokens.list, + ) + self.delete = async_to_raw_response_wrapper( + personal_access_tokens.delete, + ) + + +class PersonalAccessTokensResourceWithStreamingResponse: + def __init__(self, personal_access_tokens: PersonalAccessTokensResource) -> None: + self._personal_access_tokens = personal_access_tokens + + self.list = to_streamed_response_wrapper( + personal_access_tokens.list, + ) + self.delete = to_streamed_response_wrapper( + personal_access_tokens.delete, + ) + + +class AsyncPersonalAccessTokensResourceWithStreamingResponse: + def __init__(self, personal_access_tokens: AsyncPersonalAccessTokensResource) -> None: + self._personal_access_tokens = personal_access_tokens + + self.list = async_to_streamed_response_wrapper( + personal_access_tokens.list, + ) + self.delete = async_to_streamed_response_wrapper( + personal_access_tokens.delete, + ) diff --git a/src/gitpod/resources/projects.py b/src/gitpod/resources/projects.py new file mode 100644 index 00000000..990dea19 --- /dev/null +++ b/src/gitpod/resources/projects.py @@ -0,0 +1,511 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal + +import httpx + +from ..types import ( + project_create_params, + project_retrieve_params, + project_create_from_environment_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.project_create_response import ProjectCreateResponse +from ..types.project_retrieve_response import ProjectRetrieveResponse +from ..types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse + +__all__ = ["ProjectsResource", "AsyncProjectsResource"] + + +class ProjectsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ProjectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return ProjectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return ProjectsResourceWithStreamingResponse(self) + + def create( + self, + *, + environment_class: Union[object, object, object], + initializer: project_create_params.Initializer, + connect_protocol_version: Literal[1], + automations_file_path: str | NotGiven = NOT_GIVEN, + devcontainer_file_path: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectCreateResponse: + """ + CreateProject creates a new Project. + + Args: + initializer: EnvironmentInitializer specifies how an environment is to be initialized + + connect_protocol_version: Define the version of the Connect protocol + + automations_file_path: automations_file_path is the path to the automations file relative to the repo + root + + devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo + root + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.ProjectService/CreateProject", + body=maybe_transform( + { + "environment_class": environment_class, + "initializer": initializer, + "automations_file_path": automations_file_path, + "devcontainer_file_path": devcontainer_file_path, + "name": name, + }, + project_create_params.ProjectCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectCreateResponse, + ) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectRetrieveResponse: + """ + GetProject retrieves a single Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.ProjectService/GetProject", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + project_retrieve_params.ProjectRetrieveParams, + ), + ), + cast_to=ProjectRetrieveResponse, + ) + + def create_from_environment( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectCreateFromEnvironmentResponse: + """ + CreateProject creates a new Project using an environment as template. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies the environment identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", + body=maybe_transform( + { + "environment_id": environment_id, + "name": name, + }, + project_create_from_environment_params.ProjectCreateFromEnvironmentParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectCreateFromEnvironmentResponse, + ) + + +class AsyncProjectsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncProjectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncProjectsResourceWithStreamingResponse(self) + + async def create( + self, + *, + environment_class: Union[object, object, object], + initializer: project_create_params.Initializer, + connect_protocol_version: Literal[1], + automations_file_path: str | NotGiven = NOT_GIVEN, + devcontainer_file_path: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectCreateResponse: + """ + CreateProject creates a new Project. + + Args: + initializer: EnvironmentInitializer specifies how an environment is to be initialized + + connect_protocol_version: Define the version of the Connect protocol + + automations_file_path: automations_file_path is the path to the automations file relative to the repo + root + + devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo + root + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.ProjectService/CreateProject", + body=await async_maybe_transform( + { + "environment_class": environment_class, + "initializer": initializer, + "automations_file_path": automations_file_path, + "devcontainer_file_path": devcontainer_file_path, + "name": name, + }, + project_create_params.ProjectCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectCreateResponse, + ) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectRetrieveResponse: + """ + GetProject retrieves a single Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.ProjectService/GetProject", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + project_retrieve_params.ProjectRetrieveParams, + ), + ), + cast_to=ProjectRetrieveResponse, + ) + + async def create_from_environment( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectCreateFromEnvironmentResponse: + """ + CreateProject creates a new Project using an environment as template. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies the environment identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", + body=await async_maybe_transform( + { + "environment_id": environment_id, + "name": name, + }, + project_create_from_environment_params.ProjectCreateFromEnvironmentParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectCreateFromEnvironmentResponse, + ) + + +class ProjectsResourceWithRawResponse: + def __init__(self, projects: ProjectsResource) -> None: + self._projects = projects + + self.create = to_raw_response_wrapper( + projects.create, + ) + self.retrieve = to_raw_response_wrapper( + projects.retrieve, + ) + self.create_from_environment = to_raw_response_wrapper( + projects.create_from_environment, + ) + + +class AsyncProjectsResourceWithRawResponse: + def __init__(self, projects: AsyncProjectsResource) -> None: + self._projects = projects + + self.create = async_to_raw_response_wrapper( + projects.create, + ) + self.retrieve = async_to_raw_response_wrapper( + projects.retrieve, + ) + self.create_from_environment = async_to_raw_response_wrapper( + projects.create_from_environment, + ) + + +class ProjectsResourceWithStreamingResponse: + def __init__(self, projects: ProjectsResource) -> None: + self._projects = projects + + self.create = to_streamed_response_wrapper( + projects.create, + ) + self.retrieve = to_streamed_response_wrapper( + projects.retrieve, + ) + self.create_from_environment = to_streamed_response_wrapper( + projects.create_from_environment, + ) + + +class AsyncProjectsResourceWithStreamingResponse: + def __init__(self, projects: AsyncProjectsResource) -> None: + self._projects = projects + + self.create = async_to_streamed_response_wrapper( + projects.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + projects.retrieve, + ) + self.create_from_environment = async_to_streamed_response_wrapper( + projects.create_from_environment, + ) diff --git a/src/gitpod/resources/runner_configurations/__init__.py b/src/gitpod/resources/runner_configurations/__init__.py new file mode 100644 index 00000000..3ee6024c --- /dev/null +++ b/src/gitpod/resources/runner_configurations/__init__.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .scm_integration import ( + ScmIntegrationResource, + AsyncScmIntegrationResource, + ScmIntegrationResourceWithRawResponse, + AsyncScmIntegrationResourceWithRawResponse, + ScmIntegrationResourceWithStreamingResponse, + AsyncScmIntegrationResourceWithStreamingResponse, +) +from .environment_classes import ( + EnvironmentClassesResource, + AsyncEnvironmentClassesResource, + EnvironmentClassesResourceWithRawResponse, + AsyncEnvironmentClassesResourceWithRawResponse, + EnvironmentClassesResourceWithStreamingResponse, + AsyncEnvironmentClassesResourceWithStreamingResponse, +) +from .configuration_schema import ( + ConfigurationSchemaResource, + AsyncConfigurationSchemaResource, + ConfigurationSchemaResourceWithRawResponse, + AsyncConfigurationSchemaResourceWithRawResponse, + ConfigurationSchemaResourceWithStreamingResponse, + AsyncConfigurationSchemaResourceWithStreamingResponse, +) +from .runner_configurations import ( + RunnerConfigurationsResource, + AsyncRunnerConfigurationsResource, + RunnerConfigurationsResourceWithRawResponse, + AsyncRunnerConfigurationsResourceWithRawResponse, + RunnerConfigurationsResourceWithStreamingResponse, + AsyncRunnerConfigurationsResourceWithStreamingResponse, +) +from .host_authentication_tokens import ( + HostAuthenticationTokensResource, + AsyncHostAuthenticationTokensResource, + HostAuthenticationTokensResourceWithRawResponse, + AsyncHostAuthenticationTokensResourceWithRawResponse, + HostAuthenticationTokensResourceWithStreamingResponse, + AsyncHostAuthenticationTokensResourceWithStreamingResponse, +) + +__all__ = [ + "HostAuthenticationTokensResource", + "AsyncHostAuthenticationTokensResource", + "HostAuthenticationTokensResourceWithRawResponse", + "AsyncHostAuthenticationTokensResourceWithRawResponse", + "HostAuthenticationTokensResourceWithStreamingResponse", + "AsyncHostAuthenticationTokensResourceWithStreamingResponse", + "ConfigurationSchemaResource", + "AsyncConfigurationSchemaResource", + "ConfigurationSchemaResourceWithRawResponse", + "AsyncConfigurationSchemaResourceWithRawResponse", + "ConfigurationSchemaResourceWithStreamingResponse", + "AsyncConfigurationSchemaResourceWithStreamingResponse", + "ScmIntegrationResource", + "AsyncScmIntegrationResource", + "ScmIntegrationResourceWithRawResponse", + "AsyncScmIntegrationResourceWithRawResponse", + "ScmIntegrationResourceWithStreamingResponse", + "AsyncScmIntegrationResourceWithStreamingResponse", + "EnvironmentClassesResource", + "AsyncEnvironmentClassesResource", + "EnvironmentClassesResourceWithRawResponse", + "AsyncEnvironmentClassesResourceWithRawResponse", + "EnvironmentClassesResourceWithStreamingResponse", + "AsyncEnvironmentClassesResourceWithStreamingResponse", + "RunnerConfigurationsResource", + "AsyncRunnerConfigurationsResource", + "RunnerConfigurationsResourceWithRawResponse", + "AsyncRunnerConfigurationsResourceWithRawResponse", + "RunnerConfigurationsResourceWithStreamingResponse", + "AsyncRunnerConfigurationsResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/runner_configurations/configuration_schema.py b/src/gitpod/resources/runner_configurations/configuration_schema.py new file mode 100644 index 00000000..dc1cf365 --- /dev/null +++ b/src/gitpod/resources/runner_configurations/configuration_schema.py @@ -0,0 +1,343 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.runner_configurations import configuration_schema_create_params, configuration_schema_retrieve_params +from ...types.runner_configurations.configuration_schema_create_response import ConfigurationSchemaCreateResponse +from ...types.runner_configurations.configuration_schema_retrieve_response import ConfigurationSchemaRetrieveResponse + +__all__ = ["ConfigurationSchemaResource", "AsyncConfigurationSchemaResource"] + + +class ConfigurationSchemaResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ConfigurationSchemaResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return ConfigurationSchemaResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ConfigurationSchemaResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return ConfigurationSchemaResourceWithStreamingResponse(self) + + def create( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigurationSchemaCreateResponse: + """ + GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + body=maybe_transform( + {"runner_id": runner_id}, configuration_schema_create_params.ConfigurationSchemaCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ConfigurationSchemaCreateResponse, + ) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigurationSchemaRetrieveResponse: + """ + GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + configuration_schema_retrieve_params.ConfigurationSchemaRetrieveParams, + ), + ), + cast_to=ConfigurationSchemaRetrieveResponse, + ) + + +class AsyncConfigurationSchemaResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncConfigurationSchemaResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncConfigurationSchemaResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncConfigurationSchemaResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncConfigurationSchemaResourceWithStreamingResponse(self) + + async def create( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigurationSchemaCreateResponse: + """ + GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + body=await async_maybe_transform( + {"runner_id": runner_id}, configuration_schema_create_params.ConfigurationSchemaCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ConfigurationSchemaCreateResponse, + ) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigurationSchemaRetrieveResponse: + """ + GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + configuration_schema_retrieve_params.ConfigurationSchemaRetrieveParams, + ), + ), + cast_to=ConfigurationSchemaRetrieveResponse, + ) + + +class ConfigurationSchemaResourceWithRawResponse: + def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: + self._configuration_schema = configuration_schema + + self.create = to_raw_response_wrapper( + configuration_schema.create, + ) + self.retrieve = to_raw_response_wrapper( + configuration_schema.retrieve, + ) + + +class AsyncConfigurationSchemaResourceWithRawResponse: + def __init__(self, configuration_schema: AsyncConfigurationSchemaResource) -> None: + self._configuration_schema = configuration_schema + + self.create = async_to_raw_response_wrapper( + configuration_schema.create, + ) + self.retrieve = async_to_raw_response_wrapper( + configuration_schema.retrieve, + ) + + +class ConfigurationSchemaResourceWithStreamingResponse: + def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: + self._configuration_schema = configuration_schema + + self.create = to_streamed_response_wrapper( + configuration_schema.create, + ) + self.retrieve = to_streamed_response_wrapper( + configuration_schema.retrieve, + ) + + +class AsyncConfigurationSchemaResourceWithStreamingResponse: + def __init__(self, configuration_schema: AsyncConfigurationSchemaResource) -> None: + self._configuration_schema = configuration_schema + + self.create = async_to_streamed_response_wrapper( + configuration_schema.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + configuration_schema.retrieve, + ) diff --git a/src/gitpod/resources/runner_configurations/environment_classes.py b/src/gitpod/resources/runner_configurations/environment_classes.py new file mode 100644 index 00000000..eb374fe4 --- /dev/null +++ b/src/gitpod/resources/runner_configurations/environment_classes.py @@ -0,0 +1,327 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.runner_configurations import environment_class_list_params, environment_class_update_params +from ...types.runner_configurations.environment_class_list_response import EnvironmentClassListResponse + +__all__ = ["EnvironmentClassesResource", "AsyncEnvironmentClassesResource"] + + +class EnvironmentClassesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EnvironmentClassesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentClassesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EnvironmentClassesResourceWithStreamingResponse(self) + + def update( + self, + *, + body: environment_class_update_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", + body=maybe_transform(body, environment_class_update_params.EnvironmentClassUpdateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + connect_protocol_version: Literal[1], + filter: Union[object, object] | NotGiven = NOT_GIVEN, + pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentClassListResponse: + """ + ListEnvironmentClasses returns all environment classes configured for a runner. + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environment classes + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + environment_class_list_params.EnvironmentClassListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentClassListResponse, + ) + + +class AsyncEnvironmentClassesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEnvironmentClassesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEnvironmentClassesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEnvironmentClassesResourceWithStreamingResponse(self) + + async def update( + self, + *, + body: environment_class_update_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", + body=await async_maybe_transform(body, environment_class_update_params.EnvironmentClassUpdateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + filter: Union[object, object] | NotGiven = NOT_GIVEN, + pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentClassListResponse: + """ + ListEnvironmentClasses returns all environment classes configured for a runner. + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environment classes + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + environment_class_list_params.EnvironmentClassListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentClassListResponse, + ) + + +class EnvironmentClassesResourceWithRawResponse: + def __init__(self, environment_classes: EnvironmentClassesResource) -> None: + self._environment_classes = environment_classes + + self.update = to_raw_response_wrapper( + environment_classes.update, + ) + self.list = to_raw_response_wrapper( + environment_classes.list, + ) + + +class AsyncEnvironmentClassesResourceWithRawResponse: + def __init__(self, environment_classes: AsyncEnvironmentClassesResource) -> None: + self._environment_classes = environment_classes + + self.update = async_to_raw_response_wrapper( + environment_classes.update, + ) + self.list = async_to_raw_response_wrapper( + environment_classes.list, + ) + + +class EnvironmentClassesResourceWithStreamingResponse: + def __init__(self, environment_classes: EnvironmentClassesResource) -> None: + self._environment_classes = environment_classes + + self.update = to_streamed_response_wrapper( + environment_classes.update, + ) + self.list = to_streamed_response_wrapper( + environment_classes.list, + ) + + +class AsyncEnvironmentClassesResourceWithStreamingResponse: + def __init__(self, environment_classes: AsyncEnvironmentClassesResource) -> None: + self._environment_classes = environment_classes + + self.update = async_to_streamed_response_wrapper( + environment_classes.update, + ) + self.list = async_to_streamed_response_wrapper( + environment_classes.list, + ) diff --git a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py new file mode 100644 index 00000000..fb9308fa --- /dev/null +++ b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py @@ -0,0 +1,791 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, overload + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + required_args, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.runner_configurations import ( + host_authentication_token_list_params, + host_authentication_token_create_params, + host_authentication_token_delete_params, + host_authentication_token_update_params, + host_authentication_token_retrieve_params, +) +from ...types.runner_configurations.host_authentication_token_list_response import HostAuthenticationTokenListResponse +from ...types.runner_configurations.host_authentication_token_create_response import ( + HostAuthenticationTokenCreateResponse, +) +from ...types.runner_configurations.host_authentication_token_retrieve_response import ( + HostAuthenticationTokenRetrieveResponse, +) + +__all__ = ["HostAuthenticationTokensResource", "AsyncHostAuthenticationTokensResource"] + + +class HostAuthenticationTokensResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> HostAuthenticationTokensResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return HostAuthenticationTokensResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> HostAuthenticationTokensResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return HostAuthenticationTokensResourceWithStreamingResponse(self) + + def create( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HostAuthenticationTokenCreateResponse: + """ + GetHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + body=maybe_transform( + {"id": id}, host_authentication_token_create_params.HostAuthenticationTokenCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HostAuthenticationTokenCreateResponse, + ) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HostAuthenticationTokenRetrieveResponse: + """ + GetHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams, + ), + ), + cast_to=HostAuthenticationTokenRetrieveResponse, + ) + + @overload + def update( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["body", "connect_protocol_version"]) + def update( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", + body=maybe_transform(body, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + connect_protocol_version: Literal[1], + filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HostAuthenticationTokenListResponse: + """ + ListHostAuthenticationTokens + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + host_authentication_token_list_params.HostAuthenticationTokenListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HostAuthenticationTokenListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/DeleteHostAuthenticationToken", + body=maybe_transform( + {"id": id}, host_authentication_token_delete_params.HostAuthenticationTokenDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncHostAuthenticationTokensResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncHostAuthenticationTokensResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncHostAuthenticationTokensResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncHostAuthenticationTokensResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncHostAuthenticationTokensResourceWithStreamingResponse(self) + + async def create( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HostAuthenticationTokenCreateResponse: + """ + GetHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + body=await async_maybe_transform( + {"id": id}, host_authentication_token_create_params.HostAuthenticationTokenCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HostAuthenticationTokenCreateResponse, + ) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HostAuthenticationTokenRetrieveResponse: + """ + GetHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams, + ), + ), + cast_to=HostAuthenticationTokenRetrieveResponse, + ) + + @overload + async def update( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["body", "connect_protocol_version"]) + async def update( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", + body=await async_maybe_transform( + body, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HostAuthenticationTokenListResponse: + """ + ListHostAuthenticationTokens + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + host_authentication_token_list_params.HostAuthenticationTokenListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HostAuthenticationTokenListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/DeleteHostAuthenticationToken", + body=await async_maybe_transform( + {"id": id}, host_authentication_token_delete_params.HostAuthenticationTokenDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class HostAuthenticationTokensResourceWithRawResponse: + def __init__(self, host_authentication_tokens: HostAuthenticationTokensResource) -> None: + self._host_authentication_tokens = host_authentication_tokens + + self.create = to_raw_response_wrapper( + host_authentication_tokens.create, + ) + self.retrieve = to_raw_response_wrapper( + host_authentication_tokens.retrieve, + ) + self.update = to_raw_response_wrapper( + host_authentication_tokens.update, + ) + self.list = to_raw_response_wrapper( + host_authentication_tokens.list, + ) + self.delete = to_raw_response_wrapper( + host_authentication_tokens.delete, + ) + + +class AsyncHostAuthenticationTokensResourceWithRawResponse: + def __init__(self, host_authentication_tokens: AsyncHostAuthenticationTokensResource) -> None: + self._host_authentication_tokens = host_authentication_tokens + + self.create = async_to_raw_response_wrapper( + host_authentication_tokens.create, + ) + self.retrieve = async_to_raw_response_wrapper( + host_authentication_tokens.retrieve, + ) + self.update = async_to_raw_response_wrapper( + host_authentication_tokens.update, + ) + self.list = async_to_raw_response_wrapper( + host_authentication_tokens.list, + ) + self.delete = async_to_raw_response_wrapper( + host_authentication_tokens.delete, + ) + + +class HostAuthenticationTokensResourceWithStreamingResponse: + def __init__(self, host_authentication_tokens: HostAuthenticationTokensResource) -> None: + self._host_authentication_tokens = host_authentication_tokens + + self.create = to_streamed_response_wrapper( + host_authentication_tokens.create, + ) + self.retrieve = to_streamed_response_wrapper( + host_authentication_tokens.retrieve, + ) + self.update = to_streamed_response_wrapper( + host_authentication_tokens.update, + ) + self.list = to_streamed_response_wrapper( + host_authentication_tokens.list, + ) + self.delete = to_streamed_response_wrapper( + host_authentication_tokens.delete, + ) + + +class AsyncHostAuthenticationTokensResourceWithStreamingResponse: + def __init__(self, host_authentication_tokens: AsyncHostAuthenticationTokensResource) -> None: + self._host_authentication_tokens = host_authentication_tokens + + self.create = async_to_streamed_response_wrapper( + host_authentication_tokens.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + host_authentication_tokens.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + host_authentication_tokens.update, + ) + self.list = async_to_streamed_response_wrapper( + host_authentication_tokens.list, + ) + self.delete = async_to_streamed_response_wrapper( + host_authentication_tokens.delete, + ) diff --git a/src/gitpod/resources/runner_configurations/runner_configurations.py b/src/gitpod/resources/runner_configurations/runner_configurations.py new file mode 100644 index 00000000..f19aa8fc --- /dev/null +++ b/src/gitpod/resources/runner_configurations/runner_configurations.py @@ -0,0 +1,522 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Any, cast +from typing_extensions import Literal, overload + +import httpx + +from ...types import runner_configuration_validate_params +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + required_args, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from .scm_integration import ( + ScmIntegrationResource, + AsyncScmIntegrationResource, + ScmIntegrationResourceWithRawResponse, + AsyncScmIntegrationResourceWithRawResponse, + ScmIntegrationResourceWithStreamingResponse, + AsyncScmIntegrationResourceWithStreamingResponse, +) +from .environment_classes import ( + EnvironmentClassesResource, + AsyncEnvironmentClassesResource, + EnvironmentClassesResourceWithRawResponse, + AsyncEnvironmentClassesResourceWithRawResponse, + EnvironmentClassesResourceWithStreamingResponse, + AsyncEnvironmentClassesResourceWithStreamingResponse, +) +from .configuration_schema import ( + ConfigurationSchemaResource, + AsyncConfigurationSchemaResource, + ConfigurationSchemaResourceWithRawResponse, + AsyncConfigurationSchemaResourceWithRawResponse, + ConfigurationSchemaResourceWithStreamingResponse, + AsyncConfigurationSchemaResourceWithStreamingResponse, +) +from .host_authentication_tokens import ( + HostAuthenticationTokensResource, + AsyncHostAuthenticationTokensResource, + HostAuthenticationTokensResourceWithRawResponse, + AsyncHostAuthenticationTokensResourceWithRawResponse, + HostAuthenticationTokensResourceWithStreamingResponse, + AsyncHostAuthenticationTokensResourceWithStreamingResponse, +) +from ...types.runner_configuration_validate_response import RunnerConfigurationValidateResponse + +__all__ = ["RunnerConfigurationsResource", "AsyncRunnerConfigurationsResource"] + + +class RunnerConfigurationsResource(SyncAPIResource): + @cached_property + def host_authentication_tokens(self) -> HostAuthenticationTokensResource: + return HostAuthenticationTokensResource(self._client) + + @cached_property + def configuration_schema(self) -> ConfigurationSchemaResource: + return ConfigurationSchemaResource(self._client) + + @cached_property + def scm_integration(self) -> ScmIntegrationResource: + return ScmIntegrationResource(self._client) + + @cached_property + def environment_classes(self) -> EnvironmentClassesResource: + return EnvironmentClassesResource(self._client) + + @cached_property + def with_raw_response(self) -> RunnerConfigurationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return RunnerConfigurationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RunnerConfigurationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return RunnerConfigurationsResourceWithStreamingResponse(self) + + @overload + def validate( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def validate( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def validate( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["body", "connect_protocol_version"]) + def validate( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return cast( + RunnerConfigurationValidateResponse, + self._post( + "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", + body=maybe_transform(body, runner_configuration_validate_params.RunnerConfigurationValidateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, RunnerConfigurationValidateResponse + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AsyncRunnerConfigurationsResource(AsyncAPIResource): + @cached_property + def host_authentication_tokens(self) -> AsyncHostAuthenticationTokensResource: + return AsyncHostAuthenticationTokensResource(self._client) + + @cached_property + def configuration_schema(self) -> AsyncConfigurationSchemaResource: + return AsyncConfigurationSchemaResource(self._client) + + @cached_property + def scm_integration(self) -> AsyncScmIntegrationResource: + return AsyncScmIntegrationResource(self._client) + + @cached_property + def environment_classes(self) -> AsyncEnvironmentClassesResource: + return AsyncEnvironmentClassesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncRunnerConfigurationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncRunnerConfigurationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRunnerConfigurationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncRunnerConfigurationsResourceWithStreamingResponse(self) + + @overload + async def validate( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def validate( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def validate( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["body", "connect_protocol_version"]) + async def validate( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return cast( + RunnerConfigurationValidateResponse, + await self._post( + "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", + body=await async_maybe_transform( + body, runner_configuration_validate_params.RunnerConfigurationValidateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, RunnerConfigurationValidateResponse + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class RunnerConfigurationsResourceWithRawResponse: + def __init__(self, runner_configurations: RunnerConfigurationsResource) -> None: + self._runner_configurations = runner_configurations + + self.validate = to_raw_response_wrapper( + runner_configurations.validate, + ) + + @cached_property + def host_authentication_tokens(self) -> HostAuthenticationTokensResourceWithRawResponse: + return HostAuthenticationTokensResourceWithRawResponse(self._runner_configurations.host_authentication_tokens) + + @cached_property + def configuration_schema(self) -> ConfigurationSchemaResourceWithRawResponse: + return ConfigurationSchemaResourceWithRawResponse(self._runner_configurations.configuration_schema) + + @cached_property + def scm_integration(self) -> ScmIntegrationResourceWithRawResponse: + return ScmIntegrationResourceWithRawResponse(self._runner_configurations.scm_integration) + + @cached_property + def environment_classes(self) -> EnvironmentClassesResourceWithRawResponse: + return EnvironmentClassesResourceWithRawResponse(self._runner_configurations.environment_classes) + + +class AsyncRunnerConfigurationsResourceWithRawResponse: + def __init__(self, runner_configurations: AsyncRunnerConfigurationsResource) -> None: + self._runner_configurations = runner_configurations + + self.validate = async_to_raw_response_wrapper( + runner_configurations.validate, + ) + + @cached_property + def host_authentication_tokens(self) -> AsyncHostAuthenticationTokensResourceWithRawResponse: + return AsyncHostAuthenticationTokensResourceWithRawResponse( + self._runner_configurations.host_authentication_tokens + ) + + @cached_property + def configuration_schema(self) -> AsyncConfigurationSchemaResourceWithRawResponse: + return AsyncConfigurationSchemaResourceWithRawResponse(self._runner_configurations.configuration_schema) + + @cached_property + def scm_integration(self) -> AsyncScmIntegrationResourceWithRawResponse: + return AsyncScmIntegrationResourceWithRawResponse(self._runner_configurations.scm_integration) + + @cached_property + def environment_classes(self) -> AsyncEnvironmentClassesResourceWithRawResponse: + return AsyncEnvironmentClassesResourceWithRawResponse(self._runner_configurations.environment_classes) + + +class RunnerConfigurationsResourceWithStreamingResponse: + def __init__(self, runner_configurations: RunnerConfigurationsResource) -> None: + self._runner_configurations = runner_configurations + + self.validate = to_streamed_response_wrapper( + runner_configurations.validate, + ) + + @cached_property + def host_authentication_tokens(self) -> HostAuthenticationTokensResourceWithStreamingResponse: + return HostAuthenticationTokensResourceWithStreamingResponse( + self._runner_configurations.host_authentication_tokens + ) + + @cached_property + def configuration_schema(self) -> ConfigurationSchemaResourceWithStreamingResponse: + return ConfigurationSchemaResourceWithStreamingResponse(self._runner_configurations.configuration_schema) + + @cached_property + def scm_integration(self) -> ScmIntegrationResourceWithStreamingResponse: + return ScmIntegrationResourceWithStreamingResponse(self._runner_configurations.scm_integration) + + @cached_property + def environment_classes(self) -> EnvironmentClassesResourceWithStreamingResponse: + return EnvironmentClassesResourceWithStreamingResponse(self._runner_configurations.environment_classes) + + +class AsyncRunnerConfigurationsResourceWithStreamingResponse: + def __init__(self, runner_configurations: AsyncRunnerConfigurationsResource) -> None: + self._runner_configurations = runner_configurations + + self.validate = async_to_streamed_response_wrapper( + runner_configurations.validate, + ) + + @cached_property + def host_authentication_tokens(self) -> AsyncHostAuthenticationTokensResourceWithStreamingResponse: + return AsyncHostAuthenticationTokensResourceWithStreamingResponse( + self._runner_configurations.host_authentication_tokens + ) + + @cached_property + def configuration_schema(self) -> AsyncConfigurationSchemaResourceWithStreamingResponse: + return AsyncConfigurationSchemaResourceWithStreamingResponse(self._runner_configurations.configuration_schema) + + @cached_property + def scm_integration(self) -> AsyncScmIntegrationResourceWithStreamingResponse: + return AsyncScmIntegrationResourceWithStreamingResponse(self._runner_configurations.scm_integration) + + @cached_property + def environment_classes(self) -> AsyncEnvironmentClassesResourceWithStreamingResponse: + return AsyncEnvironmentClassesResourceWithStreamingResponse(self._runner_configurations.environment_classes) diff --git a/src/gitpod/resources/runner_configurations/scm_integration.py b/src/gitpod/resources/runner_configurations/scm_integration.py new file mode 100644 index 00000000..af3e5fa9 --- /dev/null +++ b/src/gitpod/resources/runner_configurations/scm_integration.py @@ -0,0 +1,200 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.runner_configurations import scm_integration_create_params +from ...types.runner_configurations.scm_integration_create_response import ScmIntegrationCreateResponse + +__all__ = ["ScmIntegrationResource", "AsyncScmIntegrationResource"] + + +class ScmIntegrationResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ScmIntegrationResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return ScmIntegrationResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ScmIntegrationResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return ScmIntegrationResourceWithStreamingResponse(self) + + def create( + self, + *, + body: scm_integration_create_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", + body=maybe_transform(body, scm_integration_create_params.ScmIntegrationCreateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScmIntegrationCreateResponse, + ) + + +class AsyncScmIntegrationResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncScmIntegrationResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncScmIntegrationResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncScmIntegrationResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncScmIntegrationResourceWithStreamingResponse(self) + + async def create( + self, + *, + body: scm_integration_create_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", + body=await async_maybe_transform(body, scm_integration_create_params.ScmIntegrationCreateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScmIntegrationCreateResponse, + ) + + +class ScmIntegrationResourceWithRawResponse: + def __init__(self, scm_integration: ScmIntegrationResource) -> None: + self._scm_integration = scm_integration + + self.create = to_raw_response_wrapper( + scm_integration.create, + ) + + +class AsyncScmIntegrationResourceWithRawResponse: + def __init__(self, scm_integration: AsyncScmIntegrationResource) -> None: + self._scm_integration = scm_integration + + self.create = async_to_raw_response_wrapper( + scm_integration.create, + ) + + +class ScmIntegrationResourceWithStreamingResponse: + def __init__(self, scm_integration: ScmIntegrationResource) -> None: + self._scm_integration = scm_integration + + self.create = to_streamed_response_wrapper( + scm_integration.create, + ) + + +class AsyncScmIntegrationResourceWithStreamingResponse: + def __init__(self, scm_integration: AsyncScmIntegrationResource) -> None: + self._scm_integration = scm_integration + + self.create = async_to_streamed_response_wrapper( + scm_integration.create, + ) diff --git a/src/gitpod/resources/runner_interaction.py b/src/gitpod/resources/runner_interaction.py new file mode 100644 index 00000000..4a28603d --- /dev/null +++ b/src/gitpod/resources/runner_interaction.py @@ -0,0 +1,1241 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, overload + +import httpx + +from ..types import ( + runner_interaction_send_response_params, + runner_interaction_get_latest_version_params, + runner_interaction_list_runner_scm_integrations_params, + runner_interaction_list_runner_environment_classes_params, + runner_interaction_update_runner_configuration_schema_params, + runner_interaction_get_host_authentication_token_value_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + required_args, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.runner_interaction_get_latest_version_response import RunnerInteractionGetLatestVersionResponse +from ..types.runner_interaction_list_runner_scm_integrations_response import ( + RunnerInteractionListRunnerScmIntegrationsResponse, +) +from ..types.runner_interaction_list_runner_environment_classes_response import ( + RunnerInteractionListRunnerEnvironmentClassesResponse, +) +from ..types.runner_interaction_get_host_authentication_token_value_response import ( + RunnerInteractionGetHostAuthenticationTokenValueResponse, +) + +__all__ = ["RunnerInteractionResource", "AsyncRunnerInteractionResource"] + + +class RunnerInteractionResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RunnerInteractionResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return RunnerInteractionResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RunnerInteractionResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return RunnerInteractionResourceWithStreamingResponse(self) + + def get_host_authentication_token_value( + self, + *, + connect_protocol_version: Literal[1], + host: str | NotGiven = NOT_GIVEN, + principal_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionGetHostAuthenticationTokenValueResponse: + """ + GetRunnerHostAuthenticationToken returns an authentication token for the given + host. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + host: The host to get the authentication token for + + principal_id: The principal's ID to get the authentication token for + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/GetHostAuthenticationTokenValue", + body=maybe_transform( + { + "host": host, + "principal_id": principal_id, + "runner_id": runner_id, + }, + runner_interaction_get_host_authentication_token_value_params.RunnerInteractionGetHostAuthenticationTokenValueParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionGetHostAuthenticationTokenValueResponse, + ) + + def get_latest_version( + self, + *, + connect_protocol_version: Literal[1], + current_version: str | NotGiven = NOT_GIVEN, + infrastructure_version: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionGetLatestVersionResponse: + """ + GetLatestVersion returns the latest version of the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + current_version: The current version of the runner + + infrastructure_version: The version of the infrastructure + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/GetLatestVersion", + body=maybe_transform( + { + "current_version": current_version, + "infrastructure_version": infrastructure_version, + "runner_id": runner_id, + }, + runner_interaction_get_latest_version_params.RunnerInteractionGetLatestVersionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionGetLatestVersionResponse, + ) + + def list_runner_environment_classes( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_interaction_list_runner_environment_classes_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_interaction_list_runner_environment_classes_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionListRunnerEnvironmentClassesResponse: + """ + ListRunnerEnvironmentClasses returns the environment classes configured for the + runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environment classes + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironmentClasses", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + "runner_id": runner_id, + }, + runner_interaction_list_runner_environment_classes_params.RunnerInteractionListRunnerEnvironmentClassesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionListRunnerEnvironmentClassesResponse, + ) + + def list_runner_scm_integrations( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_interaction_list_runner_scm_integrations_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_interaction_list_runner_scm_integrations_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionListRunnerScmIntegrationsResponse: + """ + ListRunnerSCMIntegrations + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing SCM integrations + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerSCMIntegrations", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + "runner_id": runner_id, + }, + runner_interaction_list_runner_scm_integrations_params.RunnerInteractionListRunnerScmIntegrationsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionListRunnerScmIntegrationsResponse, + ) + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["body", "connect_protocol_version"]) + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/SendResponse", + body=maybe_transform(body, runner_interaction_send_response_params.RunnerInteractionSendResponseParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def update_runner_configuration_schema( + self, + *, + connect_protocol_version: Literal[1], + config_schema: runner_interaction_update_runner_configuration_schema_params.ConfigSchema | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerConfigurationSchema updates the runner's configuration schema. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + config_schema: config_schema is the schema for the runner's configuration + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerConfigurationSchema", + body=maybe_transform( + { + "config_schema": config_schema, + "runner_id": runner_id, + }, + runner_interaction_update_runner_configuration_schema_params.RunnerInteractionUpdateRunnerConfigurationSchemaParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncRunnerInteractionResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRunnerInteractionResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncRunnerInteractionResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRunnerInteractionResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncRunnerInteractionResourceWithStreamingResponse(self) + + async def get_host_authentication_token_value( + self, + *, + connect_protocol_version: Literal[1], + host: str | NotGiven = NOT_GIVEN, + principal_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionGetHostAuthenticationTokenValueResponse: + """ + GetRunnerHostAuthenticationToken returns an authentication token for the given + host. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + host: The host to get the authentication token for + + principal_id: The principal's ID to get the authentication token for + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/GetHostAuthenticationTokenValue", + body=await async_maybe_transform( + { + "host": host, + "principal_id": principal_id, + "runner_id": runner_id, + }, + runner_interaction_get_host_authentication_token_value_params.RunnerInteractionGetHostAuthenticationTokenValueParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionGetHostAuthenticationTokenValueResponse, + ) + + async def get_latest_version( + self, + *, + connect_protocol_version: Literal[1], + current_version: str | NotGiven = NOT_GIVEN, + infrastructure_version: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionGetLatestVersionResponse: + """ + GetLatestVersion returns the latest version of the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + current_version: The current version of the runner + + infrastructure_version: The version of the infrastructure + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/GetLatestVersion", + body=await async_maybe_transform( + { + "current_version": current_version, + "infrastructure_version": infrastructure_version, + "runner_id": runner_id, + }, + runner_interaction_get_latest_version_params.RunnerInteractionGetLatestVersionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionGetLatestVersionResponse, + ) + + async def list_runner_environment_classes( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_interaction_list_runner_environment_classes_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_interaction_list_runner_environment_classes_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionListRunnerEnvironmentClassesResponse: + """ + ListRunnerEnvironmentClasses returns the environment classes configured for the + runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environment classes + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironmentClasses", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + "runner_id": runner_id, + }, + runner_interaction_list_runner_environment_classes_params.RunnerInteractionListRunnerEnvironmentClassesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionListRunnerEnvironmentClassesResponse, + ) + + async def list_runner_scm_integrations( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_interaction_list_runner_scm_integrations_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_interaction_list_runner_scm_integrations_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionListRunnerScmIntegrationsResponse: + """ + ListRunnerSCMIntegrations + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing SCM integrations + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerSCMIntegrations", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + "runner_id": runner_id, + }, + runner_interaction_list_runner_scm_integrations_params.RunnerInteractionListRunnerScmIntegrationsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionListRunnerScmIntegrationsResponse, + ) + + @overload + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["body", "connect_protocol_version"]) + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/SendResponse", + body=await async_maybe_transform( + body, runner_interaction_send_response_params.RunnerInteractionSendResponseParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def update_runner_configuration_schema( + self, + *, + connect_protocol_version: Literal[1], + config_schema: runner_interaction_update_runner_configuration_schema_params.ConfigSchema | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerConfigurationSchema updates the runner's configuration schema. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + config_schema: config_schema is the schema for the runner's configuration + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerConfigurationSchema", + body=await async_maybe_transform( + { + "config_schema": config_schema, + "runner_id": runner_id, + }, + runner_interaction_update_runner_configuration_schema_params.RunnerInteractionUpdateRunnerConfigurationSchemaParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class RunnerInteractionResourceWithRawResponse: + def __init__(self, runner_interaction: RunnerInteractionResource) -> None: + self._runner_interaction = runner_interaction + + self.get_host_authentication_token_value = to_raw_response_wrapper( + runner_interaction.get_host_authentication_token_value, + ) + self.get_latest_version = to_raw_response_wrapper( + runner_interaction.get_latest_version, + ) + self.list_runner_environment_classes = to_raw_response_wrapper( + runner_interaction.list_runner_environment_classes, + ) + self.list_runner_scm_integrations = to_raw_response_wrapper( + runner_interaction.list_runner_scm_integrations, + ) + self.send_response = to_raw_response_wrapper( + runner_interaction.send_response, + ) + self.update_runner_configuration_schema = to_raw_response_wrapper( + runner_interaction.update_runner_configuration_schema, + ) + + +class AsyncRunnerInteractionResourceWithRawResponse: + def __init__(self, runner_interaction: AsyncRunnerInteractionResource) -> None: + self._runner_interaction = runner_interaction + + self.get_host_authentication_token_value = async_to_raw_response_wrapper( + runner_interaction.get_host_authentication_token_value, + ) + self.get_latest_version = async_to_raw_response_wrapper( + runner_interaction.get_latest_version, + ) + self.list_runner_environment_classes = async_to_raw_response_wrapper( + runner_interaction.list_runner_environment_classes, + ) + self.list_runner_scm_integrations = async_to_raw_response_wrapper( + runner_interaction.list_runner_scm_integrations, + ) + self.send_response = async_to_raw_response_wrapper( + runner_interaction.send_response, + ) + self.update_runner_configuration_schema = async_to_raw_response_wrapper( + runner_interaction.update_runner_configuration_schema, + ) + + +class RunnerInteractionResourceWithStreamingResponse: + def __init__(self, runner_interaction: RunnerInteractionResource) -> None: + self._runner_interaction = runner_interaction + + self.get_host_authentication_token_value = to_streamed_response_wrapper( + runner_interaction.get_host_authentication_token_value, + ) + self.get_latest_version = to_streamed_response_wrapper( + runner_interaction.get_latest_version, + ) + self.list_runner_environment_classes = to_streamed_response_wrapper( + runner_interaction.list_runner_environment_classes, + ) + self.list_runner_scm_integrations = to_streamed_response_wrapper( + runner_interaction.list_runner_scm_integrations, + ) + self.send_response = to_streamed_response_wrapper( + runner_interaction.send_response, + ) + self.update_runner_configuration_schema = to_streamed_response_wrapper( + runner_interaction.update_runner_configuration_schema, + ) + + +class AsyncRunnerInteractionResourceWithStreamingResponse: + def __init__(self, runner_interaction: AsyncRunnerInteractionResource) -> None: + self._runner_interaction = runner_interaction + + self.get_host_authentication_token_value = async_to_streamed_response_wrapper( + runner_interaction.get_host_authentication_token_value, + ) + self.get_latest_version = async_to_streamed_response_wrapper( + runner_interaction.get_latest_version, + ) + self.list_runner_environment_classes = async_to_streamed_response_wrapper( + runner_interaction.list_runner_environment_classes, + ) + self.list_runner_scm_integrations = async_to_streamed_response_wrapper( + runner_interaction.list_runner_scm_integrations, + ) + self.send_response = async_to_streamed_response_wrapper( + runner_interaction.send_response, + ) + self.update_runner_configuration_schema = async_to_streamed_response_wrapper( + runner_interaction.update_runner_configuration_schema, + ) diff --git a/src/gitpod/resources/runner_interactions/__init__.py b/src/gitpod/resources/runner_interactions/__init__.py new file mode 100644 index 00000000..4bd52c99 --- /dev/null +++ b/src/gitpod/resources/runner_interactions/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .environment import ( + EnvironmentResource, + AsyncEnvironmentResource, + EnvironmentResourceWithRawResponse, + AsyncEnvironmentResourceWithRawResponse, + EnvironmentResourceWithStreamingResponse, + AsyncEnvironmentResourceWithStreamingResponse, +) +from .environments import ( + EnvironmentsResource, + AsyncEnvironmentsResource, + EnvironmentsResourceWithRawResponse, + AsyncEnvironmentsResourceWithRawResponse, + EnvironmentsResourceWithStreamingResponse, + AsyncEnvironmentsResourceWithStreamingResponse, +) +from .runner_interactions import ( + RunnerInteractionsResource, + AsyncRunnerInteractionsResource, + RunnerInteractionsResourceWithRawResponse, + AsyncRunnerInteractionsResourceWithRawResponse, + RunnerInteractionsResourceWithStreamingResponse, + AsyncRunnerInteractionsResourceWithStreamingResponse, +) + +__all__ = [ + "EnvironmentResource", + "AsyncEnvironmentResource", + "EnvironmentResourceWithRawResponse", + "AsyncEnvironmentResourceWithRawResponse", + "EnvironmentResourceWithStreamingResponse", + "AsyncEnvironmentResourceWithStreamingResponse", + "EnvironmentsResource", + "AsyncEnvironmentsResource", + "EnvironmentsResourceWithRawResponse", + "AsyncEnvironmentsResourceWithRawResponse", + "EnvironmentsResourceWithStreamingResponse", + "AsyncEnvironmentsResourceWithStreamingResponse", + "RunnerInteractionsResource", + "AsyncRunnerInteractionsResource", + "RunnerInteractionsResourceWithRawResponse", + "AsyncRunnerInteractionsResourceWithRawResponse", + "RunnerInteractionsResourceWithStreamingResponse", + "AsyncRunnerInteractionsResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/runner_interactions/environment.py b/src/gitpod/resources/runner_interactions/environment.py new file mode 100644 index 00000000..30bfad71 --- /dev/null +++ b/src/gitpod/resources/runner_interactions/environment.py @@ -0,0 +1,360 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.runner_interactions import environment_retrieve_params, environment_update_status_params +from ...types.runner_interactions.environment_retrieve_response import EnvironmentRetrieveResponse + +__all__ = ["EnvironmentResource", "AsyncEnvironmentResource"] + + +class EnvironmentResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EnvironmentResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EnvironmentResourceWithStreamingResponse(self) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentRetrieveResponse: + """ + GetRunnerEnvironment returns the environment given it is owned by the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: The environment's ID + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/GetRunnerEnvironment", + body=maybe_transform( + { + "environment_id": environment_id, + "runner_id": runner_id, + }, + environment_retrieve_params.EnvironmentRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentRetrieveResponse, + ) + + def update_status( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + status: environment_update_status_params.Status | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerEnvironmentStatus updates the status of an environment this runner + is responsible for. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: The environment's ID + + runner_id: The runner's identity + + status: EnvironmentStatus describes an environment status + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerEnvironmentStatus", + body=maybe_transform( + { + "environment_id": environment_id, + "runner_id": runner_id, + "status": status, + }, + environment_update_status_params.EnvironmentUpdateStatusParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncEnvironmentResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEnvironmentResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEnvironmentResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEnvironmentResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEnvironmentResourceWithStreamingResponse(self) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentRetrieveResponse: + """ + GetRunnerEnvironment returns the environment given it is owned by the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: The environment's ID + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/GetRunnerEnvironment", + body=await async_maybe_transform( + { + "environment_id": environment_id, + "runner_id": runner_id, + }, + environment_retrieve_params.EnvironmentRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentRetrieveResponse, + ) + + async def update_status( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + status: environment_update_status_params.Status | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerEnvironmentStatus updates the status of an environment this runner + is responsible for. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: The environment's ID + + runner_id: The runner's identity + + status: EnvironmentStatus describes an environment status + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerEnvironmentStatus", + body=await async_maybe_transform( + { + "environment_id": environment_id, + "runner_id": runner_id, + "status": status, + }, + environment_update_status_params.EnvironmentUpdateStatusParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class EnvironmentResourceWithRawResponse: + def __init__(self, environment: EnvironmentResource) -> None: + self._environment = environment + + self.retrieve = to_raw_response_wrapper( + environment.retrieve, + ) + self.update_status = to_raw_response_wrapper( + environment.update_status, + ) + + +class AsyncEnvironmentResourceWithRawResponse: + def __init__(self, environment: AsyncEnvironmentResource) -> None: + self._environment = environment + + self.retrieve = async_to_raw_response_wrapper( + environment.retrieve, + ) + self.update_status = async_to_raw_response_wrapper( + environment.update_status, + ) + + +class EnvironmentResourceWithStreamingResponse: + def __init__(self, environment: EnvironmentResource) -> None: + self._environment = environment + + self.retrieve = to_streamed_response_wrapper( + environment.retrieve, + ) + self.update_status = to_streamed_response_wrapper( + environment.update_status, + ) + + +class AsyncEnvironmentResourceWithStreamingResponse: + def __init__(self, environment: AsyncEnvironmentResource) -> None: + self._environment = environment + + self.retrieve = async_to_streamed_response_wrapper( + environment.retrieve, + ) + self.update_status = async_to_streamed_response_wrapper( + environment.update_status, + ) diff --git a/src/gitpod/resources/runner_interactions/environments.py b/src/gitpod/resources/runner_interactions/environments.py new file mode 100644 index 00000000..1cc9c8ee --- /dev/null +++ b/src/gitpod/resources/runner_interactions/environments.py @@ -0,0 +1,233 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.runner_interactions import environment_list_params +from ...types.runner_interactions.environment_list_response import EnvironmentListResponse + +__all__ = ["EnvironmentsResource", "AsyncEnvironmentsResource"] + + +class EnvironmentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EnvironmentsResourceWithStreamingResponse(self) + + def list( + self, + *, + connect_protocol_version: Literal[1], + environment_ids: List[str] | NotGiven = NOT_GIVEN, + pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentListResponse: + """ + ListRunnerEnvironments returns the environments this runner is responsible for. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_ids: An optional list of environment IDs to fetch. If this list is empty/not provided + all environments that ought to run on the runner are returned. + + pagination: pagination contains the pagination options for listing environments + + runner_id: The runner's identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironments", + body=maybe_transform( + { + "environment_ids": environment_ids, + "pagination": pagination, + "runner_id": runner_id, + }, + environment_list_params.EnvironmentListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentListResponse, + ) + + +class AsyncEnvironmentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEnvironmentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEnvironmentsResourceWithStreamingResponse(self) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + environment_ids: List[str] | NotGiven = NOT_GIVEN, + pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentListResponse: + """ + ListRunnerEnvironments returns the environments this runner is responsible for. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_ids: An optional list of environment IDs to fetch. If this list is empty/not provided + all environments that ought to run on the runner are returned. + + pagination: pagination contains the pagination options for listing environments + + runner_id: The runner's identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironments", + body=await async_maybe_transform( + { + "environment_ids": environment_ids, + "pagination": pagination, + "runner_id": runner_id, + }, + environment_list_params.EnvironmentListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentListResponse, + ) + + +class EnvironmentsResourceWithRawResponse: + def __init__(self, environments: EnvironmentsResource) -> None: + self._environments = environments + + self.list = to_raw_response_wrapper( + environments.list, + ) + + +class AsyncEnvironmentsResourceWithRawResponse: + def __init__(self, environments: AsyncEnvironmentsResource) -> None: + self._environments = environments + + self.list = async_to_raw_response_wrapper( + environments.list, + ) + + +class EnvironmentsResourceWithStreamingResponse: + def __init__(self, environments: EnvironmentsResource) -> None: + self._environments = environments + + self.list = to_streamed_response_wrapper( + environments.list, + ) + + +class AsyncEnvironmentsResourceWithStreamingResponse: + def __init__(self, environments: AsyncEnvironmentsResource) -> None: + self._environments = environments + + self.list = async_to_streamed_response_wrapper( + environments.list, + ) diff --git a/src/gitpod/resources/runner_interactions/runner_interactions.py b/src/gitpod/resources/runner_interactions/runner_interactions.py new file mode 100644 index 00000000..75b19c96 --- /dev/null +++ b/src/gitpod/resources/runner_interactions/runner_interactions.py @@ -0,0 +1,530 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal + +import httpx + +from ...types import ( + runner_interaction_signup_params, + runner_interaction_mark_active_params, + runner_interaction_update_status_params, +) +from ..._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, + Base64FileInput, +) +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .environment import ( + EnvironmentResource, + AsyncEnvironmentResource, + EnvironmentResourceWithRawResponse, + AsyncEnvironmentResourceWithRawResponse, + EnvironmentResourceWithStreamingResponse, + AsyncEnvironmentResourceWithStreamingResponse, +) +from .environments import ( + EnvironmentsResource, + AsyncEnvironmentsResource, + EnvironmentsResourceWithRawResponse, + AsyncEnvironmentsResourceWithRawResponse, + EnvironmentsResourceWithStreamingResponse, + AsyncEnvironmentsResourceWithStreamingResponse, +) +from ..._base_client import make_request_options +from ...types.runner_interaction_signup_response import RunnerInteractionSignupResponse + +__all__ = ["RunnerInteractionsResource", "AsyncRunnerInteractionsResource"] + + +class RunnerInteractionsResource(SyncAPIResource): + @cached_property + def environment(self) -> EnvironmentResource: + return EnvironmentResource(self._client) + + @cached_property + def environments(self) -> EnvironmentsResource: + return EnvironmentsResource(self._client) + + @cached_property + def with_raw_response(self) -> RunnerInteractionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return RunnerInteractionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RunnerInteractionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return RunnerInteractionsResourceWithStreamingResponse(self) + + def mark_active( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """MarkRunnerActive marks a runner as available. + + This must be called every 30 + seconds to keep the runner active. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/MarkRunnerActive", + body=maybe_transform( + {"runner_id": runner_id}, runner_interaction_mark_active_params.RunnerInteractionMarkActiveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def signup( + self, + *, + connect_protocol_version: Literal[1], + environment_classes: Iterable[runner_interaction_signup_params.EnvironmentClass] | NotGiven = NOT_GIVEN, + public_key: Union[str, Base64FileInput] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionSignupResponse: + """Signup is called by a runner to sign up with the backend. + + This is the first call + a runner makes. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_classes: The environment classes this runner has to offer + + public_key: The runner's public key. Must be an ECDH public key encoded in PKIX, ASN.1 DER + format. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/Signup", + body=maybe_transform( + { + "environment_classes": environment_classes, + "public_key": public_key, + }, + runner_interaction_signup_params.RunnerInteractionSignupParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionSignupResponse, + ) + + def update_status( + self, + *, + body: runner_interaction_update_status_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerStatus updates the status of the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerStatus", + body=maybe_transform(body, runner_interaction_update_status_params.RunnerInteractionUpdateStatusParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncRunnerInteractionsResource(AsyncAPIResource): + @cached_property + def environment(self) -> AsyncEnvironmentResource: + return AsyncEnvironmentResource(self._client) + + @cached_property + def environments(self) -> AsyncEnvironmentsResource: + return AsyncEnvironmentsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncRunnerInteractionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncRunnerInteractionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRunnerInteractionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncRunnerInteractionsResourceWithStreamingResponse(self) + + async def mark_active( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """MarkRunnerActive marks a runner as available. + + This must be called every 30 + seconds to keep the runner active. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/MarkRunnerActive", + body=await async_maybe_transform( + {"runner_id": runner_id}, runner_interaction_mark_active_params.RunnerInteractionMarkActiveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def signup( + self, + *, + connect_protocol_version: Literal[1], + environment_classes: Iterable[runner_interaction_signup_params.EnvironmentClass] | NotGiven = NOT_GIVEN, + public_key: Union[str, Base64FileInput] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionSignupResponse: + """Signup is called by a runner to sign up with the backend. + + This is the first call + a runner makes. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_classes: The environment classes this runner has to offer + + public_key: The runner's public key. Must be an ECDH public key encoded in PKIX, ASN.1 DER + format. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/Signup", + body=await async_maybe_transform( + { + "environment_classes": environment_classes, + "public_key": public_key, + }, + runner_interaction_signup_params.RunnerInteractionSignupParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionSignupResponse, + ) + + async def update_status( + self, + *, + body: runner_interaction_update_status_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerStatus updates the status of the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerStatus", + body=await async_maybe_transform( + body, runner_interaction_update_status_params.RunnerInteractionUpdateStatusParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class RunnerInteractionsResourceWithRawResponse: + def __init__(self, runner_interactions: RunnerInteractionsResource) -> None: + self._runner_interactions = runner_interactions + + self.mark_active = to_raw_response_wrapper( + runner_interactions.mark_active, + ) + self.signup = to_raw_response_wrapper( + runner_interactions.signup, + ) + self.update_status = to_raw_response_wrapper( + runner_interactions.update_status, + ) + + @cached_property + def environment(self) -> EnvironmentResourceWithRawResponse: + return EnvironmentResourceWithRawResponse(self._runner_interactions.environment) + + @cached_property + def environments(self) -> EnvironmentsResourceWithRawResponse: + return EnvironmentsResourceWithRawResponse(self._runner_interactions.environments) + + +class AsyncRunnerInteractionsResourceWithRawResponse: + def __init__(self, runner_interactions: AsyncRunnerInteractionsResource) -> None: + self._runner_interactions = runner_interactions + + self.mark_active = async_to_raw_response_wrapper( + runner_interactions.mark_active, + ) + self.signup = async_to_raw_response_wrapper( + runner_interactions.signup, + ) + self.update_status = async_to_raw_response_wrapper( + runner_interactions.update_status, + ) + + @cached_property + def environment(self) -> AsyncEnvironmentResourceWithRawResponse: + return AsyncEnvironmentResourceWithRawResponse(self._runner_interactions.environment) + + @cached_property + def environments(self) -> AsyncEnvironmentsResourceWithRawResponse: + return AsyncEnvironmentsResourceWithRawResponse(self._runner_interactions.environments) + + +class RunnerInteractionsResourceWithStreamingResponse: + def __init__(self, runner_interactions: RunnerInteractionsResource) -> None: + self._runner_interactions = runner_interactions + + self.mark_active = to_streamed_response_wrapper( + runner_interactions.mark_active, + ) + self.signup = to_streamed_response_wrapper( + runner_interactions.signup, + ) + self.update_status = to_streamed_response_wrapper( + runner_interactions.update_status, + ) + + @cached_property + def environment(self) -> EnvironmentResourceWithStreamingResponse: + return EnvironmentResourceWithStreamingResponse(self._runner_interactions.environment) + + @cached_property + def environments(self) -> EnvironmentsResourceWithStreamingResponse: + return EnvironmentsResourceWithStreamingResponse(self._runner_interactions.environments) + + +class AsyncRunnerInteractionsResourceWithStreamingResponse: + def __init__(self, runner_interactions: AsyncRunnerInteractionsResource) -> None: + self._runner_interactions = runner_interactions + + self.mark_active = async_to_streamed_response_wrapper( + runner_interactions.mark_active, + ) + self.signup = async_to_streamed_response_wrapper( + runner_interactions.signup, + ) + self.update_status = async_to_streamed_response_wrapper( + runner_interactions.update_status, + ) + + @cached_property + def environment(self) -> AsyncEnvironmentResourceWithStreamingResponse: + return AsyncEnvironmentResourceWithStreamingResponse(self._runner_interactions.environment) + + @cached_property + def environments(self) -> AsyncEnvironmentsResourceWithStreamingResponse: + return AsyncEnvironmentsResourceWithStreamingResponse(self._runner_interactions.environments) diff --git a/src/gitpod/resources/runners/__init__.py b/src/gitpod/resources/runners/__init__.py new file mode 100644 index 00000000..03ac96d2 --- /dev/null +++ b/src/gitpod/resources/runners/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .runners import ( + RunnersResource, + AsyncRunnersResource, + RunnersResourceWithRawResponse, + AsyncRunnersResourceWithRawResponse, + RunnersResourceWithStreamingResponse, + AsyncRunnersResourceWithStreamingResponse, +) +from .policies import ( + PoliciesResource, + AsyncPoliciesResource, + PoliciesResourceWithRawResponse, + AsyncPoliciesResourceWithRawResponse, + PoliciesResourceWithStreamingResponse, + AsyncPoliciesResourceWithStreamingResponse, +) + +__all__ = [ + "PoliciesResource", + "AsyncPoliciesResource", + "PoliciesResourceWithRawResponse", + "AsyncPoliciesResourceWithRawResponse", + "PoliciesResourceWithStreamingResponse", + "AsyncPoliciesResourceWithStreamingResponse", + "RunnersResource", + "AsyncRunnersResource", + "RunnersResourceWithRawResponse", + "AsyncRunnersResourceWithRawResponse", + "RunnersResourceWithStreamingResponse", + "AsyncRunnersResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py new file mode 100644 index 00000000..8fad4d9d --- /dev/null +++ b/src/gitpod/resources/runners/policies.py @@ -0,0 +1,222 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.runners import policy_list_params +from ...types.runners.policy_list_response import PolicyListResponse + +__all__ = ["PoliciesResource", "AsyncPoliciesResource"] + + +class PoliciesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PoliciesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return PoliciesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return PoliciesResourceWithStreamingResponse(self) + + def list( + self, + *, + connect_protocol_version: Literal[1], + pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PolicyListResponse: + """ + ListRunnerPolicies lists runner policies. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing project policies + + runner_id: runner_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/ListRunnerPolicies", + body=maybe_transform( + { + "pagination": pagination, + "runner_id": runner_id, + }, + policy_list_params.PolicyListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PolicyListResponse, + ) + + +class AsyncPoliciesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncPoliciesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncPoliciesResourceWithStreamingResponse(self) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PolicyListResponse: + """ + ListRunnerPolicies lists runner policies. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing project policies + + runner_id: runner_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/ListRunnerPolicies", + body=await async_maybe_transform( + { + "pagination": pagination, + "runner_id": runner_id, + }, + policy_list_params.PolicyListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PolicyListResponse, + ) + + +class PoliciesResourceWithRawResponse: + def __init__(self, policies: PoliciesResource) -> None: + self._policies = policies + + self.list = to_raw_response_wrapper( + policies.list, + ) + + +class AsyncPoliciesResourceWithRawResponse: + def __init__(self, policies: AsyncPoliciesResource) -> None: + self._policies = policies + + self.list = async_to_raw_response_wrapper( + policies.list, + ) + + +class PoliciesResourceWithStreamingResponse: + def __init__(self, policies: PoliciesResource) -> None: + self._policies = policies + + self.list = to_streamed_response_wrapper( + policies.list, + ) + + +class AsyncPoliciesResourceWithStreamingResponse: + def __init__(self, policies: AsyncPoliciesResource) -> None: + self._policies = policies + + self.list = async_to_streamed_response_wrapper( + policies.list, + ) diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py new file mode 100644 index 00000000..d67db56f --- /dev/null +++ b/src/gitpod/resources/runners/runners.py @@ -0,0 +1,1268 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ...types import ( + runner_list_params, + runner_create_params, + runner_retrieve_params, + runner_get_runner_params, + runner_delete_runner_params, + runner_update_runner_params, + runner_parse_context_url_params, + runner_create_runner_token_params, + runner_check_authentication_for_host_params, +) +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .policies import ( + PoliciesResource, + AsyncPoliciesResource, + PoliciesResourceWithRawResponse, + AsyncPoliciesResourceWithRawResponse, + PoliciesResourceWithStreamingResponse, + AsyncPoliciesResourceWithStreamingResponse, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.runner_list_response import RunnerListResponse +from ...types.runner_create_response import RunnerCreateResponse +from ...types.runner_retrieve_response import RunnerRetrieveResponse +from ...types.runner_get_runner_response import RunnerGetRunnerResponse +from ...types.runner_parse_context_url_response import RunnerParseContextURLResponse +from ...types.runner_create_runner_token_response import RunnerCreateRunnerTokenResponse +from ...types.runner_check_authentication_for_host_response import RunnerCheckAuthenticationForHostResponse + +__all__ = ["RunnersResource", "AsyncRunnersResource"] + + +class RunnersResource(SyncAPIResource): + @cached_property + def policies(self) -> PoliciesResource: + return PoliciesResource(self._client) + + @cached_property + def with_raw_response(self) -> RunnersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return RunnersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RunnersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return RunnersResourceWithStreamingResponse(self) + + def create( + self, + *, + connect_protocol_version: Literal[1], + kind: Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerCreateResponse: + """CreateRunner creates a new runner with the server. + + Registrations are very + short-lived and must be renewed every 30 seconds. Runners can be registered for + an entire organisation or a single user. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + kind: RunnerKind represents the kind of a runner + + name: The runner name for humans + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/CreateRunner", + body=maybe_transform( + { + "kind": kind, + "name": name, + "spec": spec, + }, + runner_create_params.RunnerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCreateResponse, + ) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerRetrieveResponse: + """ + GetRunner returns a single runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.RunnerService/GetRunner", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + runner_retrieve_params.RunnerRetrieveParams, + ), + ), + cast_to=RunnerRetrieveResponse, + ) + + def list( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerListResponse: + """ + ListRunners returns all runners registered in the scope. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing runners + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/ListRunners", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + runner_list_params.RunnerListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerListResponse, + ) + + def check_authentication_for_host( + self, + *, + connect_protocol_version: Literal[1], + host: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerCheckAuthenticationForHostResponse: + """ + CheckAuthenticationForHost asks a runner if the user is authenticated against a + particular host, e.g. an SCM system. If not, this function will return a URL + that the user should visit to authenticate, or indicate that Personal Access + Tokens are supported. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/CheckAuthenticationForHost", + body=maybe_transform( + { + "host": host, + "runner_id": runner_id, + }, + runner_check_authentication_for_host_params.RunnerCheckAuthenticationForHostParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCheckAuthenticationForHostResponse, + ) + + def create_runner_token( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerCreateRunnerTokenResponse: + """CreateRunnerToken returns a token that can be used to authenticate as the + runner. + + Use this call to renew an outdated token - this does not expire any + previouly issued tokens. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/CreateRunnerToken", + body=maybe_transform( + {"runner_id": runner_id}, runner_create_runner_token_params.RunnerCreateRunnerTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCreateRunnerTokenResponse, + ) + + def delete_runner( + self, + *, + connect_protocol_version: Literal[1], + force: bool | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteRunner deletes an environment runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + force: force indicates whether the runner should be deleted forcefully. When force + deleting a Runner, all Environments on the runner are also force deleted and + regular Runner lifecycle is not respected. Force deleting can result in data + loss. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/DeleteRunner", + body=maybe_transform( + { + "force": force, + "runner_id": runner_id, + }, + runner_delete_runner_params.RunnerDeleteRunnerParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_runner( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerGetRunnerResponse: + """ + GetRunner returns a single runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/GetRunner", + body=maybe_transform({"runner_id": runner_id}, runner_get_runner_params.RunnerGetRunnerParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerGetRunnerResponse, + ) + + def parse_context_url( + self, + *, + connect_protocol_version: Literal[1], + context_url: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerParseContextURLResponse: + """ + ParseContextURL asks a runner to parse a context URL, and return the parsed + result. + + This call returns + + - FAILED_PRECONDITION if the user requires authentication on the runner to + access the context URL + - PERMISSION_DENIED if the user is not allowed to access the context URL using + the credentials they have + - INVALID_ARGUMENT if the context URL is invalid + - NOT_FOUND if the repository or branch indicated by the context URL does not + exist + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/ParseContextURL", + body=maybe_transform( + { + "context_url": context_url, + "runner_id": runner_id, + }, + runner_parse_context_url_params.RunnerParseContextURLParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerParseContextURLResponse, + ) + + def update_runner( + self, + *, + body: runner_update_runner_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunner updates an environment runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/UpdateRunner", + body=maybe_transform(body, runner_update_runner_params.RunnerUpdateRunnerParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncRunnersResource(AsyncAPIResource): + @cached_property + def policies(self) -> AsyncPoliciesResource: + return AsyncPoliciesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncRunnersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncRunnersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRunnersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncRunnersResourceWithStreamingResponse(self) + + async def create( + self, + *, + connect_protocol_version: Literal[1], + kind: Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerCreateResponse: + """CreateRunner creates a new runner with the server. + + Registrations are very + short-lived and must be renewed every 30 seconds. Runners can be registered for + an entire organisation or a single user. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + kind: RunnerKind represents the kind of a runner + + name: The runner name for humans + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/CreateRunner", + body=await async_maybe_transform( + { + "kind": kind, + "name": name, + "spec": spec, + }, + runner_create_params.RunnerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCreateResponse, + ) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerRetrieveResponse: + """ + GetRunner returns a single runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.RunnerService/GetRunner", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + runner_retrieve_params.RunnerRetrieveParams, + ), + ), + cast_to=RunnerRetrieveResponse, + ) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerListResponse: + """ + ListRunners returns all runners registered in the scope. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing runners + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/ListRunners", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + runner_list_params.RunnerListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerListResponse, + ) + + async def check_authentication_for_host( + self, + *, + connect_protocol_version: Literal[1], + host: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerCheckAuthenticationForHostResponse: + """ + CheckAuthenticationForHost asks a runner if the user is authenticated against a + particular host, e.g. an SCM system. If not, this function will return a URL + that the user should visit to authenticate, or indicate that Personal Access + Tokens are supported. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/CheckAuthenticationForHost", + body=await async_maybe_transform( + { + "host": host, + "runner_id": runner_id, + }, + runner_check_authentication_for_host_params.RunnerCheckAuthenticationForHostParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCheckAuthenticationForHostResponse, + ) + + async def create_runner_token( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerCreateRunnerTokenResponse: + """CreateRunnerToken returns a token that can be used to authenticate as the + runner. + + Use this call to renew an outdated token - this does not expire any + previouly issued tokens. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/CreateRunnerToken", + body=await async_maybe_transform( + {"runner_id": runner_id}, runner_create_runner_token_params.RunnerCreateRunnerTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCreateRunnerTokenResponse, + ) + + async def delete_runner( + self, + *, + connect_protocol_version: Literal[1], + force: bool | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteRunner deletes an environment runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + force: force indicates whether the runner should be deleted forcefully. When force + deleting a Runner, all Environments on the runner are also force deleted and + regular Runner lifecycle is not respected. Force deleting can result in data + loss. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/DeleteRunner", + body=await async_maybe_transform( + { + "force": force, + "runner_id": runner_id, + }, + runner_delete_runner_params.RunnerDeleteRunnerParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_runner( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerGetRunnerResponse: + """ + GetRunner returns a single runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/GetRunner", + body=await async_maybe_transform({"runner_id": runner_id}, runner_get_runner_params.RunnerGetRunnerParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerGetRunnerResponse, + ) + + async def parse_context_url( + self, + *, + connect_protocol_version: Literal[1], + context_url: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerParseContextURLResponse: + """ + ParseContextURL asks a runner to parse a context URL, and return the parsed + result. + + This call returns + + - FAILED_PRECONDITION if the user requires authentication on the runner to + access the context URL + - PERMISSION_DENIED if the user is not allowed to access the context URL using + the credentials they have + - INVALID_ARGUMENT if the context URL is invalid + - NOT_FOUND if the repository or branch indicated by the context URL does not + exist + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/ParseContextURL", + body=await async_maybe_transform( + { + "context_url": context_url, + "runner_id": runner_id, + }, + runner_parse_context_url_params.RunnerParseContextURLParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerParseContextURLResponse, + ) + + async def update_runner( + self, + *, + body: runner_update_runner_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunner updates an environment runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/UpdateRunner", + body=await async_maybe_transform(body, runner_update_runner_params.RunnerUpdateRunnerParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class RunnersResourceWithRawResponse: + def __init__(self, runners: RunnersResource) -> None: + self._runners = runners + + self.create = to_raw_response_wrapper( + runners.create, + ) + self.retrieve = to_raw_response_wrapper( + runners.retrieve, + ) + self.list = to_raw_response_wrapper( + runners.list, + ) + self.check_authentication_for_host = to_raw_response_wrapper( + runners.check_authentication_for_host, + ) + self.create_runner_token = to_raw_response_wrapper( + runners.create_runner_token, + ) + self.delete_runner = to_raw_response_wrapper( + runners.delete_runner, + ) + self.get_runner = to_raw_response_wrapper( + runners.get_runner, + ) + self.parse_context_url = to_raw_response_wrapper( + runners.parse_context_url, + ) + self.update_runner = to_raw_response_wrapper( + runners.update_runner, + ) + + @cached_property + def policies(self) -> PoliciesResourceWithRawResponse: + return PoliciesResourceWithRawResponse(self._runners.policies) + + +class AsyncRunnersResourceWithRawResponse: + def __init__(self, runners: AsyncRunnersResource) -> None: + self._runners = runners + + self.create = async_to_raw_response_wrapper( + runners.create, + ) + self.retrieve = async_to_raw_response_wrapper( + runners.retrieve, + ) + self.list = async_to_raw_response_wrapper( + runners.list, + ) + self.check_authentication_for_host = async_to_raw_response_wrapper( + runners.check_authentication_for_host, + ) + self.create_runner_token = async_to_raw_response_wrapper( + runners.create_runner_token, + ) + self.delete_runner = async_to_raw_response_wrapper( + runners.delete_runner, + ) + self.get_runner = async_to_raw_response_wrapper( + runners.get_runner, + ) + self.parse_context_url = async_to_raw_response_wrapper( + runners.parse_context_url, + ) + self.update_runner = async_to_raw_response_wrapper( + runners.update_runner, + ) + + @cached_property + def policies(self) -> AsyncPoliciesResourceWithRawResponse: + return AsyncPoliciesResourceWithRawResponse(self._runners.policies) + + +class RunnersResourceWithStreamingResponse: + def __init__(self, runners: RunnersResource) -> None: + self._runners = runners + + self.create = to_streamed_response_wrapper( + runners.create, + ) + self.retrieve = to_streamed_response_wrapper( + runners.retrieve, + ) + self.list = to_streamed_response_wrapper( + runners.list, + ) + self.check_authentication_for_host = to_streamed_response_wrapper( + runners.check_authentication_for_host, + ) + self.create_runner_token = to_streamed_response_wrapper( + runners.create_runner_token, + ) + self.delete_runner = to_streamed_response_wrapper( + runners.delete_runner, + ) + self.get_runner = to_streamed_response_wrapper( + runners.get_runner, + ) + self.parse_context_url = to_streamed_response_wrapper( + runners.parse_context_url, + ) + self.update_runner = to_streamed_response_wrapper( + runners.update_runner, + ) + + @cached_property + def policies(self) -> PoliciesResourceWithStreamingResponse: + return PoliciesResourceWithStreamingResponse(self._runners.policies) + + +class AsyncRunnersResourceWithStreamingResponse: + def __init__(self, runners: AsyncRunnersResource) -> None: + self._runners = runners + + self.create = async_to_streamed_response_wrapper( + runners.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + runners.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + runners.list, + ) + self.check_authentication_for_host = async_to_streamed_response_wrapper( + runners.check_authentication_for_host, + ) + self.create_runner_token = async_to_streamed_response_wrapper( + runners.create_runner_token, + ) + self.delete_runner = async_to_streamed_response_wrapper( + runners.delete_runner, + ) + self.get_runner = async_to_streamed_response_wrapper( + runners.get_runner, + ) + self.parse_context_url = async_to_streamed_response_wrapper( + runners.parse_context_url, + ) + self.update_runner = async_to_streamed_response_wrapper( + runners.update_runner, + ) + + @cached_property + def policies(self) -> AsyncPoliciesResourceWithStreamingResponse: + return AsyncPoliciesResourceWithStreamingResponse(self._runners.policies) diff --git a/src/gitpod/resources/services.py b/src/gitpod/resources/services.py new file mode 100644 index 00000000..158e7377 --- /dev/null +++ b/src/gitpod/resources/services.py @@ -0,0 +1,861 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal + +import httpx + +from ..types import ( + service_list_params, + service_stop_params, + service_start_params, + service_delete_params, + service_update_params, + service_list_create_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.service_list_response import ServiceListResponse +from ..types.service_list_create_response import ServiceListCreateResponse + +__all__ = ["ServicesResource", "AsyncServicesResource"] + + +class ServicesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ServicesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return ServicesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return ServicesResourceWithStreamingResponse(self) + + def update( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, + spec: Union[object, object] | NotGiven = NOT_GIVEN, + status: service_update_params.Status | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateService + + Args: + connect_protocol_version: Define the version of the Connect protocol + + spec: Changing the spec of a service is a complex operation. The spec of a service can + only be updated if the service is in a stopped state. If the service is running, + it must be stopped first. + + status: Service status updates are only expected from the executing environment. As a + client of this API you are not expected to provide this field. Updating this + field requires the `environmentservice:update_status` permission. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/UpdateService", + body=maybe_transform( + { + "id": id, + "metadata": metadata, + "spec": spec, + "status": status, + }, + service_update_params.ServiceUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceListResponse: + """ + ListServices + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentAutomationService/ListServices", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + service_list_params.ServiceListParams, + ), + ), + cast_to=ServiceListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + force: bool | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """DeleteService deletes a service. + + This call does not block until the service is + deleted. If the service is not stopped it will be stopped before deletion. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/DeleteService", + body=maybe_transform( + { + "id": id, + "force": force, + }, + service_delete_params.ServiceDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_create( + self, + *, + connect_protocol_version: Literal[1], + filter: service_list_create_params.Filter | NotGiven = NOT_GIVEN, + pagination: service_list_create_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceListCreateResponse: + """ + ListServices + + Args: + connect_protocol_version: Define the version of the Connect protocol + + filter: filter contains the filter options for listing services + + pagination: pagination contains the pagination options for listing environments + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/ListServices", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + service_list_create_params.ServiceListCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ServiceListCreateResponse, + ) + + def start( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """StartService starts a service. + + This call does not block until the service is + started. This call will not error if the service is already running or has been + started. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/StartService", + body=maybe_transform({"id": id}, service_start_params.ServiceStartParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def stop( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """StopService stops a service. + + This call does not block until the service is + stopped. This call will not error if the service is already stopped or has been + stopped. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/StopService", + body=maybe_transform({"id": id}, service_stop_params.ServiceStopParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncServicesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncServicesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncServicesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncServicesResourceWithStreamingResponse(self) + + async def update( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, + spec: Union[object, object] | NotGiven = NOT_GIVEN, + status: service_update_params.Status | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateService + + Args: + connect_protocol_version: Define the version of the Connect protocol + + spec: Changing the spec of a service is a complex operation. The spec of a service can + only be updated if the service is in a stopped state. If the service is running, + it must be stopped first. + + status: Service status updates are only expected from the executing environment. As a + client of this API you are not expected to provide this field. Updating this + field requires the `environmentservice:update_status` permission. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/UpdateService", + body=await async_maybe_transform( + { + "id": id, + "metadata": metadata, + "spec": spec, + "status": status, + }, + service_update_params.ServiceUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceListResponse: + """ + ListServices + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EnvironmentAutomationService/ListServices", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + service_list_params.ServiceListParams, + ), + ), + cast_to=ServiceListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + force: bool | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """DeleteService deletes a service. + + This call does not block until the service is + deleted. If the service is not stopped it will be stopped before deletion. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/DeleteService", + body=await async_maybe_transform( + { + "id": id, + "force": force, + }, + service_delete_params.ServiceDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def list_create( + self, + *, + connect_protocol_version: Literal[1], + filter: service_list_create_params.Filter | NotGiven = NOT_GIVEN, + pagination: service_list_create_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceListCreateResponse: + """ + ListServices + + Args: + connect_protocol_version: Define the version of the Connect protocol + + filter: filter contains the filter options for listing services + + pagination: pagination contains the pagination options for listing environments + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/ListServices", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + service_list_create_params.ServiceListCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ServiceListCreateResponse, + ) + + async def start( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """StartService starts a service. + + This call does not block until the service is + started. This call will not error if the service is already running or has been + started. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/StartService", + body=await async_maybe_transform({"id": id}, service_start_params.ServiceStartParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def stop( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """StopService stops a service. + + This call does not block until the service is + stopped. This call will not error if the service is already stopped or has been + stopped. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/StopService", + body=await async_maybe_transform({"id": id}, service_stop_params.ServiceStopParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class ServicesResourceWithRawResponse: + def __init__(self, services: ServicesResource) -> None: + self._services = services + + self.update = to_raw_response_wrapper( + services.update, + ) + self.list = to_raw_response_wrapper( + services.list, + ) + self.delete = to_raw_response_wrapper( + services.delete, + ) + self.list_create = to_raw_response_wrapper( + services.list_create, + ) + self.start = to_raw_response_wrapper( + services.start, + ) + self.stop = to_raw_response_wrapper( + services.stop, + ) + + +class AsyncServicesResourceWithRawResponse: + def __init__(self, services: AsyncServicesResource) -> None: + self._services = services + + self.update = async_to_raw_response_wrapper( + services.update, + ) + self.list = async_to_raw_response_wrapper( + services.list, + ) + self.delete = async_to_raw_response_wrapper( + services.delete, + ) + self.list_create = async_to_raw_response_wrapper( + services.list_create, + ) + self.start = async_to_raw_response_wrapper( + services.start, + ) + self.stop = async_to_raw_response_wrapper( + services.stop, + ) + + +class ServicesResourceWithStreamingResponse: + def __init__(self, services: ServicesResource) -> None: + self._services = services + + self.update = to_streamed_response_wrapper( + services.update, + ) + self.list = to_streamed_response_wrapper( + services.list, + ) + self.delete = to_streamed_response_wrapper( + services.delete, + ) + self.list_create = to_streamed_response_wrapper( + services.list_create, + ) + self.start = to_streamed_response_wrapper( + services.start, + ) + self.stop = to_streamed_response_wrapper( + services.stop, + ) + + +class AsyncServicesResourceWithStreamingResponse: + def __init__(self, services: AsyncServicesResource) -> None: + self._services = services + + self.update = async_to_streamed_response_wrapper( + services.update, + ) + self.list = async_to_streamed_response_wrapper( + services.list, + ) + self.delete = async_to_streamed_response_wrapper( + services.delete, + ) + self.list_create = async_to_streamed_response_wrapper( + services.list_create, + ) + self.start = async_to_streamed_response_wrapper( + services.start, + ) + self.stop = async_to_streamed_response_wrapper( + services.stop, + ) diff --git a/src/gitpod/resources/tasks.py b/src/gitpod/resources/tasks.py new file mode 100644 index 00000000..70841c47 --- /dev/null +++ b/src/gitpod/resources/tasks.py @@ -0,0 +1,469 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal + +import httpx + +from ..types import task_create_params, task_retrieve_params, task_retrieve_create_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.task_create_response import TaskCreateResponse +from ..types.task_retrieve_response import TaskRetrieveResponse +from ..types.task_retrieve_create_response import TaskRetrieveCreateResponse + +__all__ = ["TasksResource", "AsyncTasksResource"] + + +class TasksResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TasksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return TasksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TasksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return TasksResourceWithStreamingResponse(self) + + def create( + self, + *, + connect_protocol_version: Literal[1], + depends_on: List[str] | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, + spec: task_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskCreateResponse: + """ + CreateTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/CreateTask", + body=maybe_transform( + { + "depends_on": depends_on, + "environment_id": environment_id, + "metadata": metadata, + "spec": spec, + }, + task_create_params.TaskCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskCreateResponse, + ) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskRetrieveResponse: + """ + GetTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentAutomationService/GetTask", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + task_retrieve_params.TaskRetrieveParams, + ), + ), + cast_to=TaskRetrieveResponse, + ) + + def retrieve_create( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskRetrieveCreateResponse: + """ + GetTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/GetTask", + body=maybe_transform({"id": id}, task_retrieve_create_params.TaskRetrieveCreateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskRetrieveCreateResponse, + ) + + +class AsyncTasksResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncTasksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncTasksResourceWithStreamingResponse(self) + + async def create( + self, + *, + connect_protocol_version: Literal[1], + depends_on: List[str] | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, + spec: task_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskCreateResponse: + """ + CreateTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/CreateTask", + body=await async_maybe_transform( + { + "depends_on": depends_on, + "environment_id": environment_id, + "metadata": metadata, + "spec": spec, + }, + task_create_params.TaskCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskCreateResponse, + ) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + base64: str | NotGiven = NOT_GIVEN, + compression: str | NotGiven = NOT_GIVEN, + connect: str | NotGiven = NOT_GIVEN, + encoding: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskRetrieveResponse: + """ + GetTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EnvironmentAutomationService/GetTask", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "base64": base64, + "compression": compression, + "connect": connect, + "encoding": encoding, + "message": message, + }, + task_retrieve_params.TaskRetrieveParams, + ), + ), + cast_to=TaskRetrieveResponse, + ) + + async def retrieve_create( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskRetrieveCreateResponse: + """ + GetTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/GetTask", + body=await async_maybe_transform({"id": id}, task_retrieve_create_params.TaskRetrieveCreateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskRetrieveCreateResponse, + ) + + +class TasksResourceWithRawResponse: + def __init__(self, tasks: TasksResource) -> None: + self._tasks = tasks + + self.create = to_raw_response_wrapper( + tasks.create, + ) + self.retrieve = to_raw_response_wrapper( + tasks.retrieve, + ) + self.retrieve_create = to_raw_response_wrapper( + tasks.retrieve_create, + ) + + +class AsyncTasksResourceWithRawResponse: + def __init__(self, tasks: AsyncTasksResource) -> None: + self._tasks = tasks + + self.create = async_to_raw_response_wrapper( + tasks.create, + ) + self.retrieve = async_to_raw_response_wrapper( + tasks.retrieve, + ) + self.retrieve_create = async_to_raw_response_wrapper( + tasks.retrieve_create, + ) + + +class TasksResourceWithStreamingResponse: + def __init__(self, tasks: TasksResource) -> None: + self._tasks = tasks + + self.create = to_streamed_response_wrapper( + tasks.create, + ) + self.retrieve = to_streamed_response_wrapper( + tasks.retrieve, + ) + self.retrieve_create = to_streamed_response_wrapper( + tasks.retrieve_create, + ) + + +class AsyncTasksResourceWithStreamingResponse: + def __init__(self, tasks: AsyncTasksResource) -> None: + self._tasks = tasks + + self.create = async_to_streamed_response_wrapper( + tasks.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + tasks.retrieve, + ) + self.retrieve_create = async_to_streamed_response_wrapper( + tasks.retrieve_create, + ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py new file mode 100644 index 00000000..f2ea748c --- /dev/null +++ b/src/gitpod/types/__init__.py @@ -0,0 +1,115 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .runner_list_params import RunnerListParams as RunnerListParams +from .task_create_params import TaskCreateParams as TaskCreateParams +from .service_list_params import ServiceListParams as ServiceListParams +from .service_stop_params import ServiceStopParams as ServiceStopParams +from .runner_create_params import RunnerCreateParams as RunnerCreateParams +from .runner_list_response import RunnerListResponse as RunnerListResponse +from .service_start_params import ServiceStartParams as ServiceStartParams +from .task_create_response import TaskCreateResponse as TaskCreateResponse +from .task_retrieve_params import TaskRetrieveParams as TaskRetrieveParams +from .project_create_params import ProjectCreateParams as ProjectCreateParams +from .service_delete_params import ServiceDeleteParams as ServiceDeleteParams +from .service_list_response import ServiceListResponse as ServiceListResponse +from .service_update_params import ServiceUpdateParams as ServiceUpdateParams +from .runner_create_response import RunnerCreateResponse as RunnerCreateResponse +from .runner_retrieve_params import RunnerRetrieveParams as RunnerRetrieveParams +from .task_retrieve_response import TaskRetrieveResponse as TaskRetrieveResponse +from .environment_list_params import EnvironmentListParams as EnvironmentListParams +from .project_create_response import ProjectCreateResponse as ProjectCreateResponse +from .project_retrieve_params import ProjectRetrieveParams as ProjectRetrieveParams +from .environment_start_params import EnvironmentStartParams as EnvironmentStartParams +from .runner_get_runner_params import RunnerGetRunnerParams as RunnerGetRunnerParams +from .runner_retrieve_response import RunnerRetrieveResponse as RunnerRetrieveResponse +from .environment_create_params import EnvironmentCreateParams as EnvironmentCreateParams +from .environment_list_response import EnvironmentListResponse as EnvironmentListResponse +from .organization_leave_params import OrganizationLeaveParams as OrganizationLeaveParams +from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse +from .runner_get_runner_response import RunnerGetRunnerResponse as RunnerGetRunnerResponse +from .service_list_create_params import ServiceListCreateParams as ServiceListCreateParams +from .environment_create_response import EnvironmentCreateResponse as EnvironmentCreateResponse +from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams +from .runner_delete_runner_params import RunnerDeleteRunnerParams as RunnerDeleteRunnerParams +from .runner_update_runner_params import RunnerUpdateRunnerParams as RunnerUpdateRunnerParams +from .task_retrieve_create_params import TaskRetrieveCreateParams as TaskRetrieveCreateParams +from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams +from .service_list_create_response import ServiceListCreateResponse as ServiceListCreateResponse +from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams +from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse +from .task_retrieve_create_response import TaskRetrieveCreateResponse as TaskRetrieveCreateResponse +from .automations_file_upsert_params import AutomationsFileUpsertParams as AutomationsFileUpsertParams +from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse +from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams +from .automations_file_upsert_response import AutomationsFileUpsertResponse as AutomationsFileUpsertResponse +from .runner_interaction_signup_params import RunnerInteractionSignupParams as RunnerInteractionSignupParams +from .personal_access_token_list_params import PersonalAccessTokenListParams as PersonalAccessTokenListParams +from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams +from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse +from .runner_interaction_signup_response import RunnerInteractionSignupResponse as RunnerInteractionSignupResponse +from .personal_access_token_delete_params import PersonalAccessTokenDeleteParams as PersonalAccessTokenDeleteParams +from .personal_access_token_list_response import PersonalAccessTokenListResponse as PersonalAccessTokenListResponse +from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse +from .runner_configuration_validate_params import RunnerConfigurationValidateParams as RunnerConfigurationValidateParams +from .runner_interaction_mark_active_params import ( + RunnerInteractionMarkActiveParams as RunnerInteractionMarkActiveParams, +) +from .environment_create_from_project_params import ( + EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, +) +from .project_create_from_environment_params import ( + ProjectCreateFromEnvironmentParams as ProjectCreateFromEnvironmentParams, +) +from .runner_configuration_validate_response import ( + RunnerConfigurationValidateResponse as RunnerConfigurationValidateResponse, +) +from .runner_interaction_send_response_params import ( + RunnerInteractionSendResponseParams as RunnerInteractionSendResponseParams, +) +from .runner_interaction_update_status_params import ( + RunnerInteractionUpdateStatusParams as RunnerInteractionUpdateStatusParams, +) +from .environment_create_from_project_response import ( + EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, +) +from .project_create_from_environment_response import ( + ProjectCreateFromEnvironmentResponse as ProjectCreateFromEnvironmentResponse, +) +from .runner_check_authentication_for_host_params import ( + RunnerCheckAuthenticationForHostParams as RunnerCheckAuthenticationForHostParams, +) +from .runner_interaction_get_latest_version_params import ( + RunnerInteractionGetLatestVersionParams as RunnerInteractionGetLatestVersionParams, +) +from .runner_check_authentication_for_host_response import ( + RunnerCheckAuthenticationForHostResponse as RunnerCheckAuthenticationForHostResponse, +) +from .runner_interaction_get_latest_version_response import ( + RunnerInteractionGetLatestVersionResponse as RunnerInteractionGetLatestVersionResponse, +) +from .runner_interaction_list_runner_scm_integrations_params import ( + RunnerInteractionListRunnerScmIntegrationsParams as RunnerInteractionListRunnerScmIntegrationsParams, +) +from .runner_interaction_list_runner_scm_integrations_response import ( + RunnerInteractionListRunnerScmIntegrationsResponse as RunnerInteractionListRunnerScmIntegrationsResponse, +) +from .runner_interaction_list_runner_environment_classes_params import ( + RunnerInteractionListRunnerEnvironmentClassesParams as RunnerInteractionListRunnerEnvironmentClassesParams, +) +from .environment_automation_update_task_execution_status_params import ( + EnvironmentAutomationUpdateTaskExecutionStatusParams as EnvironmentAutomationUpdateTaskExecutionStatusParams, +) +from .runner_interaction_list_runner_environment_classes_response import ( + RunnerInteractionListRunnerEnvironmentClassesResponse as RunnerInteractionListRunnerEnvironmentClassesResponse, +) +from .runner_interaction_update_runner_configuration_schema_params import ( + RunnerInteractionUpdateRunnerConfigurationSchemaParams as RunnerInteractionUpdateRunnerConfigurationSchemaParams, +) +from .runner_interaction_get_host_authentication_token_value_params import ( + RunnerInteractionGetHostAuthenticationTokenValueParams as RunnerInteractionGetHostAuthenticationTokenValueParams, +) +from .runner_interaction_get_host_authentication_token_value_response import ( + RunnerInteractionGetHostAuthenticationTokenValueResponse as RunnerInteractionGetHostAuthenticationTokenValueResponse, +) diff --git a/src/gitpod/types/automations_file_upsert_params.py b/src/gitpod/types/automations_file_upsert_params.py new file mode 100644 index 00000000..49148f19 --- /dev/null +++ b/src/gitpod/types/automations_file_upsert_params.py @@ -0,0 +1,92 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "AutomationsFileUpsertParams", + "AutomationsFile", + "AutomationsFileServices", + "AutomationsFileServicesCommands", + "AutomationsFileTasks", +] + + +class AutomationsFileUpsertParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + automations_file: Annotated[AutomationsFile, PropertyInfo(alias="automationsFile")] + """ + WARN: Do not remove any field here, as it will break reading automation yaml + files. We error if there are any unknown fields in the yaml (to ensure the yaml + is correct), but would break if we removed any fields. This includes marking a + field as "reserved" in the proto file, this will also break reading the yaml. + """ + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class AutomationsFileServicesCommands(TypedDict, total=False): + ready: str + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. + """ + + start: str + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: str + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. + """ + + +class AutomationsFileServices(TypedDict, total=False): + commands: AutomationsFileServicesCommands + + description: str + + name: str + + triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] + + +class AutomationsFileTasks(TypedDict, total=False): + command: str + + depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] + + description: str + + name: str + + triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] + + +class AutomationsFile(TypedDict, total=False): + services: Dict[str, AutomationsFileServices] + + tasks: Dict[str, AutomationsFileTasks] diff --git a/src/gitpod/types/automations_file_upsert_response.py b/src/gitpod/types/automations_file_upsert_response.py new file mode 100644 index 00000000..dad78447 --- /dev/null +++ b/src/gitpod/types/automations_file_upsert_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AutomationsFileUpsertResponse"] + + +class AutomationsFileUpsertResponse(BaseModel): + updated_service_ids: Optional[List[str]] = FieldInfo(alias="updatedServiceIds", default=None) + + updated_task_ids: Optional[List[str]] = FieldInfo(alias="updatedTaskIds", default=None) diff --git a/src/gitpod/types/environment_automation_update_task_execution_status_params.py b/src/gitpod/types/environment_automation_update_task_execution_status_params.py new file mode 100644 index 00000000..df760684 --- /dev/null +++ b/src/gitpod/types/environment_automation_update_task_execution_status_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..types import environment_automation_update_task_execution_status_params +from .._utils import PropertyInfo + +__all__ = ["EnvironmentAutomationUpdateTaskExecutionStatusParams"] + + +class EnvironmentAutomationUpdateTaskExecutionStatusParams(TypedDict, total=False): + body: Required[environment_automation_update_task_execution_status_params.Body] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/__init__.py b/src/gitpod/types/environment_automations/__init__.py new file mode 100644 index 00000000..20d1c6df --- /dev/null +++ b/src/gitpod/types/environment_automations/__init__.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .task_list_params import TaskListParams as TaskListParams +from .task_start_params import TaskStartParams as TaskStartParams +from .task_delete_params import TaskDeleteParams as TaskDeleteParams +from .task_list_response import TaskListResponse as TaskListResponse +from .task_update_params import TaskUpdateParams as TaskUpdateParams +from .task_start_response import TaskStartResponse as TaskStartResponse +from .task_create_list_params import TaskCreateListParams as TaskCreateListParams +from .task_create_list_response import TaskCreateListResponse as TaskCreateListResponse +from .task_execution_list_params import TaskExecutionListParams as TaskExecutionListParams +from .task_execution_stop_params import TaskExecutionStopParams as TaskExecutionStopParams +from .task_execution_list_response import TaskExecutionListResponse as TaskExecutionListResponse +from .task_execution_retrieve_params import TaskExecutionRetrieveParams as TaskExecutionRetrieveParams +from .task_execution_retrieve_response import TaskExecutionRetrieveResponse as TaskExecutionRetrieveResponse +from .task_execution_create_list_params import TaskExecutionCreateListParams as TaskExecutionCreateListParams +from .task_execution_create_list_response import TaskExecutionCreateListResponse as TaskExecutionCreateListResponse +from .task_execution_create_retrieve_params import ( + TaskExecutionCreateRetrieveParams as TaskExecutionCreateRetrieveParams, +) +from .task_execution_create_retrieve_response import ( + TaskExecutionCreateRetrieveResponse as TaskExecutionCreateRetrieveResponse, +) diff --git a/src/gitpod/types/environment_automations/task_create_list_params.py b/src/gitpod/types/environment_automations/task_create_list_params.py new file mode 100644 index 00000000..601844e0 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_create_list_params.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["TaskCreateListParams", "Filter", "Pagination"] + + +class TaskCreateListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Filter + """filter contains the filter options for listing tasks""" + + pagination: Pagination + """pagination contains the pagination options for listing tasks""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only tasks of these environments""" + + references: List[str] + """references filters the response to only services with these references""" + + task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] + """task_ids filters the response to only tasks with these IDs""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environment_automations/task_create_list_response.py b/src/gitpod/types/environment_automations/task_create_list_response.py new file mode 100644 index 00000000..fdf76ae2 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_create_list_response.py @@ -0,0 +1,180 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["TaskCreateListResponse", "Pagination", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class TaskMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskMetadataCreator] = None + """creator describes the principal who created the task.""" + + description: Optional[str] = None + """description is a user-facing description for the task. + + It can be used to provide context and documentation for the task. + """ + + name: Optional[str] = None + """name is a user-facing name for the task. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the task. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the task which must be unique on the + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the task.""" + + +class TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + +class Task(BaseModel): + id: Optional[str] = None + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + """dependencies specifies the IDs of the automations this task depends on.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[TaskMetadata] = None + + spec: Optional[TaskSpec] = None + + +class TaskCreateListResponse(BaseModel): + pagination: Optional[Pagination] = None + + tasks: Optional[List[Task]] = None diff --git a/src/gitpod/types/environment_automations/task_delete_params.py b/src/gitpod/types/environment_automations/task_delete_params.py new file mode 100644 index 00000000..25d40d78 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_delete_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["TaskDeleteParams"] + + +class TaskDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_execution_create_list_params.py b/src/gitpod/types/environment_automations/task_execution_create_list_params.py new file mode 100644 index 00000000..24926cb6 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_create_list_params.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["TaskExecutionCreateListParams", "Filter", "Pagination"] + + +class TaskExecutionCreateListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Filter + """filter contains the filter options for listing task runs""" + + pagination: Pagination + """pagination contains the pagination options for listing task runs""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only task runs of these environments""" + + phases: List[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] + """phases filters the response to only task runs in these phases""" + + task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] + """task_ids filters the response to only task runs of these tasks""" + + task_references: Annotated[List[str], PropertyInfo(alias="taskReferences")] + """task_references filters the response to only task runs with this reference""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environment_automations/task_execution_create_list_response.py b/src/gitpod/types/environment_automations/task_execution_create_list_response.py new file mode 100644 index 00000000..d9695004 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_create_list_response.py @@ -0,0 +1,452 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = [ + "TaskExecutionCreateListResponse", + "Pagination", + "TaskExecution", + "TaskExecutionMetadata", + "TaskExecutionMetadataCreator", + "TaskExecutionSpec", + "TaskExecutionSpecPlan", + "TaskExecutionStatus", + "TaskExecutionStatusStep", +] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class TaskExecutionMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskExecutionMetadata(BaseModel): + completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskExecutionMetadataCreator] = None + """creator describes the principal who created/started the task run.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """environment_id is the ID of the environment in which the task run is executed.""" + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) + """started_by describes the trigger that started the task execution.""" + + task_id: Optional[str] = FieldInfo(alias="taskId", default=None) + """task_id is the ID of the main task being executed.""" + + +class TaskExecutionSpecPlan(BaseModel): + steps: Optional[List[Union[object, object, object]]] = None + + +class TaskExecutionSpec(BaseModel): + desired_phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the task execution should be in. + + Used to stop a running task execution early. + """ + + plan: Optional[List[TaskExecutionSpecPlan]] = None + """plan is a list of groups of steps. + + The steps in a group are executed concurrently, while the groups are executed + sequentially. The order of the groups is the order in which they are executed. + """ + + +class TaskExecutionStatusStep(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + +class TaskExecutionStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url is the URL to the logs of the task's steps. + + If this is empty, the task either has no logs or has not yet started. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + steps: Optional[List[TaskExecutionStatusStep]] = None + """steps provides the status for each individual step of the task execution. + + If a step is missing it has not yet started. + """ + + +class TaskExecution(BaseModel): + id: Optional[str] = None + + metadata: Optional[TaskExecutionMetadata] = None + + spec: Optional[TaskExecutionSpec] = None + + status: Optional[TaskExecutionStatus] = None + + +class TaskExecutionCreateListResponse(BaseModel): + pagination: Optional[Pagination] = None + + task_executions: Optional[List[TaskExecution]] = FieldInfo(alias="taskExecutions", default=None) diff --git a/src/gitpod/types/environment_automations/task_execution_create_retrieve_params.py b/src/gitpod/types/environment_automations/task_execution_create_retrieve_params.py new file mode 100644 index 00000000..057567ba --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_create_retrieve_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["TaskExecutionCreateRetrieveParams"] + + +class TaskExecutionCreateRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py b/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py new file mode 100644 index 00000000..5a0ca7bb --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py @@ -0,0 +1,441 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = [ + "TaskExecutionCreateRetrieveResponse", + "TaskExecution", + "TaskExecutionMetadata", + "TaskExecutionMetadataCreator", + "TaskExecutionSpec", + "TaskExecutionSpecPlan", + "TaskExecutionStatus", + "TaskExecutionStatusStep", +] + + +class TaskExecutionMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskExecutionMetadata(BaseModel): + completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskExecutionMetadataCreator] = None + """creator describes the principal who created/started the task run.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """environment_id is the ID of the environment in which the task run is executed.""" + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) + """started_by describes the trigger that started the task execution.""" + + task_id: Optional[str] = FieldInfo(alias="taskId", default=None) + """task_id is the ID of the main task being executed.""" + + +class TaskExecutionSpecPlan(BaseModel): + steps: Optional[List[Union[object, object, object]]] = None + + +class TaskExecutionSpec(BaseModel): + desired_phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the task execution should be in. + + Used to stop a running task execution early. + """ + + plan: Optional[List[TaskExecutionSpecPlan]] = None + """plan is a list of groups of steps. + + The steps in a group are executed concurrently, while the groups are executed + sequentially. The order of the groups is the order in which they are executed. + """ + + +class TaskExecutionStatusStep(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + +class TaskExecutionStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url is the URL to the logs of the task's steps. + + If this is empty, the task either has no logs or has not yet started. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + steps: Optional[List[TaskExecutionStatusStep]] = None + """steps provides the status for each individual step of the task execution. + + If a step is missing it has not yet started. + """ + + +class TaskExecution(BaseModel): + id: Optional[str] = None + + metadata: Optional[TaskExecutionMetadata] = None + + spec: Optional[TaskExecutionSpec] = None + + status: Optional[TaskExecutionStatus] = None + + +class TaskExecutionCreateRetrieveResponse(BaseModel): + task_execution: Optional[TaskExecution] = FieldInfo(alias="taskExecution", default=None) diff --git a/src/gitpod/types/environment_automations/task_execution_list_params.py b/src/gitpod/types/environment_automations/task_execution_list_params.py new file mode 100644 index 00000000..dcc6cf70 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_list_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["TaskExecutionListParams"] + + +class TaskExecutionListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: str + + compression: str + + connect: str + + encoding: str + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_execution_list_response.py b/src/gitpod/types/environment_automations/task_execution_list_response.py new file mode 100644 index 00000000..4b201f86 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_list_response.py @@ -0,0 +1,452 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = [ + "TaskExecutionListResponse", + "Pagination", + "TaskExecution", + "TaskExecutionMetadata", + "TaskExecutionMetadataCreator", + "TaskExecutionSpec", + "TaskExecutionSpecPlan", + "TaskExecutionStatus", + "TaskExecutionStatusStep", +] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class TaskExecutionMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskExecutionMetadata(BaseModel): + completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskExecutionMetadataCreator] = None + """creator describes the principal who created/started the task run.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """environment_id is the ID of the environment in which the task run is executed.""" + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) + """started_by describes the trigger that started the task execution.""" + + task_id: Optional[str] = FieldInfo(alias="taskId", default=None) + """task_id is the ID of the main task being executed.""" + + +class TaskExecutionSpecPlan(BaseModel): + steps: Optional[List[Union[object, object, object]]] = None + + +class TaskExecutionSpec(BaseModel): + desired_phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the task execution should be in. + + Used to stop a running task execution early. + """ + + plan: Optional[List[TaskExecutionSpecPlan]] = None + """plan is a list of groups of steps. + + The steps in a group are executed concurrently, while the groups are executed + sequentially. The order of the groups is the order in which they are executed. + """ + + +class TaskExecutionStatusStep(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + +class TaskExecutionStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url is the URL to the logs of the task's steps. + + If this is empty, the task either has no logs or has not yet started. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + steps: Optional[List[TaskExecutionStatusStep]] = None + """steps provides the status for each individual step of the task execution. + + If a step is missing it has not yet started. + """ + + +class TaskExecution(BaseModel): + id: Optional[str] = None + + metadata: Optional[TaskExecutionMetadata] = None + + spec: Optional[TaskExecutionSpec] = None + + status: Optional[TaskExecutionStatus] = None + + +class TaskExecutionListResponse(BaseModel): + pagination: Optional[Pagination] = None + + task_executions: Optional[List[TaskExecution]] = FieldInfo(alias="taskExecutions", default=None) diff --git a/src/gitpod/types/environment_automations/task_execution_retrieve_params.py b/src/gitpod/types/environment_automations/task_execution_retrieve_params.py new file mode 100644 index 00000000..c109c67f --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_retrieve_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["TaskExecutionRetrieveParams"] + + +class TaskExecutionRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: str + + compression: str + + connect: str + + encoding: str + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_execution_retrieve_response.py b/src/gitpod/types/environment_automations/task_execution_retrieve_response.py new file mode 100644 index 00000000..1e81e276 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_retrieve_response.py @@ -0,0 +1,441 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = [ + "TaskExecutionRetrieveResponse", + "TaskExecution", + "TaskExecutionMetadata", + "TaskExecutionMetadataCreator", + "TaskExecutionSpec", + "TaskExecutionSpecPlan", + "TaskExecutionStatus", + "TaskExecutionStatusStep", +] + + +class TaskExecutionMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskExecutionMetadata(BaseModel): + completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskExecutionMetadataCreator] = None + """creator describes the principal who created/started the task run.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """environment_id is the ID of the environment in which the task run is executed.""" + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) + """started_by describes the trigger that started the task execution.""" + + task_id: Optional[str] = FieldInfo(alias="taskId", default=None) + """task_id is the ID of the main task being executed.""" + + +class TaskExecutionSpecPlan(BaseModel): + steps: Optional[List[Union[object, object, object]]] = None + + +class TaskExecutionSpec(BaseModel): + desired_phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the task execution should be in. + + Used to stop a running task execution early. + """ + + plan: Optional[List[TaskExecutionSpecPlan]] = None + """plan is a list of groups of steps. + + The steps in a group are executed concurrently, while the groups are executed + sequentially. The order of the groups is the order in which they are executed. + """ + + +class TaskExecutionStatusStep(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + +class TaskExecutionStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url is the URL to the logs of the task's steps. + + If this is empty, the task either has no logs or has not yet started. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + steps: Optional[List[TaskExecutionStatusStep]] = None + """steps provides the status for each individual step of the task execution. + + If a step is missing it has not yet started. + """ + + +class TaskExecution(BaseModel): + id: Optional[str] = None + + metadata: Optional[TaskExecutionMetadata] = None + + spec: Optional[TaskExecutionSpec] = None + + status: Optional[TaskExecutionStatus] = None + + +class TaskExecutionRetrieveResponse(BaseModel): + task_execution: Optional[TaskExecution] = FieldInfo(alias="taskExecution", default=None) diff --git a/src/gitpod/types/environment_automations/task_execution_stop_params.py b/src/gitpod/types/environment_automations/task_execution_stop_params.py new file mode 100644 index 00000000..dc7659c0 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_stop_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["TaskExecutionStopParams"] + + +class TaskExecutionStopParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_list_params.py b/src/gitpod/types/environment_automations/task_list_params.py new file mode 100644 index 00000000..f74ba3d5 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_list_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["TaskListParams"] + + +class TaskListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: str + + compression: str + + connect: str + + encoding: str + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_list_response.py b/src/gitpod/types/environment_automations/task_list_response.py new file mode 100644 index 00000000..e73d0fe7 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_list_response.py @@ -0,0 +1,180 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["TaskListResponse", "Pagination", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class TaskMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskMetadataCreator] = None + """creator describes the principal who created the task.""" + + description: Optional[str] = None + """description is a user-facing description for the task. + + It can be used to provide context and documentation for the task. + """ + + name: Optional[str] = None + """name is a user-facing name for the task. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the task. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the task which must be unique on the + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the task.""" + + +class TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + +class Task(BaseModel): + id: Optional[str] = None + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + """dependencies specifies the IDs of the automations this task depends on.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[TaskMetadata] = None + + spec: Optional[TaskSpec] = None + + +class TaskListResponse(BaseModel): + pagination: Optional[Pagination] = None + + tasks: Optional[List[Task]] = None diff --git a/src/gitpod/types/environment_automations/task_start_params.py b/src/gitpod/types/environment_automations/task_start_params.py new file mode 100644 index 00000000..9324c00a --- /dev/null +++ b/src/gitpod/types/environment_automations/task_start_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["TaskStartParams"] + + +class TaskStartParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_start_response.py b/src/gitpod/types/environment_automations/task_start_response.py new file mode 100644 index 00000000..d54b3807 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_start_response.py @@ -0,0 +1,441 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = [ + "TaskStartResponse", + "TaskExecution", + "TaskExecutionMetadata", + "TaskExecutionMetadataCreator", + "TaskExecutionSpec", + "TaskExecutionSpecPlan", + "TaskExecutionStatus", + "TaskExecutionStatusStep", +] + + +class TaskExecutionMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskExecutionMetadata(BaseModel): + completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskExecutionMetadataCreator] = None + """creator describes the principal who created/started the task run.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """environment_id is the ID of the environment in which the task run is executed.""" + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) + """started_by describes the trigger that started the task execution.""" + + task_id: Optional[str] = FieldInfo(alias="taskId", default=None) + """task_id is the ID of the main task being executed.""" + + +class TaskExecutionSpecPlan(BaseModel): + steps: Optional[List[Union[object, object, object]]] = None + + +class TaskExecutionSpec(BaseModel): + desired_phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the task execution should be in. + + Used to stop a running task execution early. + """ + + plan: Optional[List[TaskExecutionSpecPlan]] = None + """plan is a list of groups of steps. + + The steps in a group are executed concurrently, while the groups are executed + sequentially. The order of the groups is the order in which they are executed. + """ + + +class TaskExecutionStatusStep(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + +class TaskExecutionStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url is the URL to the logs of the task's steps. + + If this is empty, the task either has no logs or has not yet started. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """ + the phase of a environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + steps: Optional[List[TaskExecutionStatusStep]] = None + """steps provides the status for each individual step of the task execution. + + If a step is missing it has not yet started. + """ + + +class TaskExecution(BaseModel): + id: Optional[str] = None + + metadata: Optional[TaskExecutionMetadata] = None + + spec: Optional[TaskExecutionSpec] = None + + status: Optional[TaskExecutionStatus] = None + + +class TaskStartResponse(BaseModel): + task_execution: Optional[TaskExecution] = FieldInfo(alias="taskExecution", default=None) diff --git a/src/gitpod/types/environment_automations/task_update_params.py b/src/gitpod/types/environment_automations/task_update_params.py new file mode 100644 index 00000000..c4658fc6 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_update_params.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from ...types.environment_automations import task_update_params + +__all__ = ["TaskUpdateParams"] + + +class TaskUpdateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] + """dependencies specifies the IDs of the automations this task depends on.""" + + metadata: task_update_params.Metadata + + spec: Union[object, object] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_class_list_params.py b/src/gitpod/types/environment_class_list_params.py new file mode 100644 index 00000000..3e562591 --- /dev/null +++ b/src/gitpod/types/environment_class_list_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentClassListParams", "Pagination"] + + +class EnvironmentClassListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Union[object, object] + + pagination: Pagination + """pagination contains the pagination options for listing environment classes""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environment_class_list_response.py b/src/gitpod/types/environment_class_list_response.py new file mode 100644 index 00000000..0bec0318 --- /dev/null +++ b/src/gitpod/types/environment_class_list_response.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EnvironmentClassListResponse", "EnvironmentClass", "EnvironmentClassConfiguration", "Pagination"] + + +class EnvironmentClassConfiguration(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class EnvironmentClass(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the environment class""" + + configuration: Optional[List[EnvironmentClassConfiguration]] = None + """configuration describes the configuration of the environment class""" + + description: Optional[str] = None + """description is a human readable description of the environment class""" + + display_name: Optional[str] = FieldInfo(alias="displayName", default=None) + """display_name is the human readable name of the environment class""" + + enabled: Optional[bool] = None + """ + enabled indicates whether the environment class can be used to create new + environments. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class EnvironmentClassListResponse(BaseModel): + environment_classes: Optional[List[EnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing environment classes""" diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py new file mode 100644 index 00000000..bea4167e --- /dev/null +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -0,0 +1,222 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "EnvironmentCreateFromProjectParams", + "Spec", + "SpecAutomationsFile", + "SpecContent", + "SpecContentInitializer", + "SpecDevcontainer", + "SpecMachine", + "SpecPort", + "SpecSSHPublicKey", + "SpecTimeout", +] + + +class EnvironmentCreateFromProjectParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + + spec: Spec + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class SpecAutomationsFile(TypedDict, total=False): + automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. + """ + + session: str + + +class SpecContentInitializer(TypedDict, total=False): + specs: Iterable[Union[object, object, object]] + + +class SpecContent(TypedDict, total=False): + git_email: Annotated[str, PropertyInfo(alias="gitEmail")] + """The Git email address""" + + git_username: Annotated[str, PropertyInfo(alias="gitUsername")] + """The Git username""" + + initializer: SpecContentInitializer + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: str + + +class SpecDevcontainer(TypedDict, total=False): + devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + session: str + + +_SpecMachineReservedKeywords = TypedDict( + "_SpecMachineReservedKeywords", + { + "class": str, + }, + total=False, +) + + +class SpecMachine(_SpecMachineReservedKeywords, total=False): + session: str + + +class SpecPort(TypedDict, total=False): + admission: Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + """Admission level describes who can access an environment instance and its ports.""" + + name: str + """name of this port""" + + port: int + """port number""" + + +class SpecSSHPublicKey(TypedDict, total=False): + id: str + """id is the unique identifier of the public key""" + + value: str + """value is the actual public key in the public key file format""" + + +class SpecTimeout(TypedDict, total=False): + disconnected: str + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class Spec(TypedDict, total=False): + admission: Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Annotated[SpecAutomationsFile, PropertyInfo(alias="automationsFile")] + """automations_file is the automations file spec of the environment""" + + content: SpecContent + """content is the content spec of the environment""" + + desired_phase: Annotated[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ], + PropertyInfo(alias="desiredPhase"), + ] + """Phase is the desired phase of the environment""" + + devcontainer: SpecDevcontainer + """devcontainer is the devcontainer spec of the environment""" + + machine: SpecMachine + """machine is the machine spec of the environment""" + + ports: Iterable[SpecPort] + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Iterable[Union[object, object, object, object]] + """secrets are confidential data that is mounted into the environment""" + + spec_version: Annotated[Union[str, float], PropertyInfo(alias="specVersion")] + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Annotated[Iterable[SpecSSHPublicKey], PropertyInfo(alias="sshPublicKeys")] + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: SpecTimeout + """Timeout configures the environment timeout""" diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py new file mode 100644 index 00000000..4c362490 --- /dev/null +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -0,0 +1,775 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "EnvironmentCreateFromProjectResponse", + "Environment", + "EnvironmentMetadata", + "EnvironmentMetadataCreator", + "EnvironmentSpec", + "EnvironmentSpecAutomationsFile", + "EnvironmentSpecContent", + "EnvironmentSpecContentInitializer", + "EnvironmentSpecDevcontainer", + "EnvironmentSpecMachine", + "EnvironmentSpecPort", + "EnvironmentSpecSSHPublicKey", + "EnvironmentSpecTimeout", + "EnvironmentStatus", + "EnvironmentStatusAutomationsFile", + "EnvironmentStatusContent", + "EnvironmentStatusContentGit", + "EnvironmentStatusContentGitChangedFile", + "EnvironmentStatusDevcontainer", + "EnvironmentStatusEnvironmentURLs", + "EnvironmentStatusEnvironmentURLsPort", + "EnvironmentStatusEnvironmentURLsSSH", + "EnvironmentStatusMachine", + "EnvironmentStatusMachineVersions", + "EnvironmentStatusRunnerAck", + "EnvironmentStatusSecret", + "EnvironmentStatusSSHPublicKey", +] + + +class EnvironmentMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class EnvironmentMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[EnvironmentMetadataCreator] = None + """creator is the identity of the creator of the environment""" + + name: Optional[str] = None + """name is the name of the environment as specified by the user""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + """ + original_context_url is the normalized URL from which the environment was + created + """ + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """ + If the Environment was started from a project, the project_id will reference the + project. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """Runner is the ID of the runner that runs this environment.""" + + +class EnvironmentSpecAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. + """ + + session: Optional[str] = None + + +class EnvironmentSpecContentInitializer(BaseModel): + specs: Optional[List[Union[object, object, object]]] = None + + +class EnvironmentSpecContent(BaseModel): + git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) + """The Git email address""" + + git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) + """The Git username""" + + initializer: Optional[EnvironmentSpecContentInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: Optional[str] = None + + +class EnvironmentSpecDevcontainer(BaseModel): + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + session: Optional[str] = None + + +class EnvironmentSpecMachine(BaseModel): + class_: Optional[str] = FieldInfo(alias="class", default=None) + """Class denotes the class of the environment we ought to start""" + + session: Optional[str] = None + + +class EnvironmentSpecPort(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + name: Optional[str] = None + """name of this port""" + + port: Optional[int] = None + """port number""" + + +class EnvironmentSpecSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + value: Optional[str] = None + """value is the actual public key in the public key file format""" + + +class EnvironmentSpecTimeout(BaseModel): + disconnected: Optional[str] = None + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class EnvironmentSpec(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file is the automations file spec of the environment""" + + content: Optional[EnvironmentSpecContent] = None + """content is the content spec of the environment""" + + desired_phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """Phase is the desired phase of the environment""" + + devcontainer: Optional[EnvironmentSpecDevcontainer] = None + """devcontainer is the devcontainer spec of the environment""" + + machine: Optional[EnvironmentSpecMachine] = None + """machine is the machine spec of the environment""" + + ports: Optional[List[EnvironmentSpecPort]] = None + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Optional[List[Union[object, object, object, object]]] = None + """secrets are confidential data that is mounted into the environment""" + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: Optional[EnvironmentSpecTimeout] = None + """Timeout configures the environment timeout""" + + +class EnvironmentStatusAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root. + """ + + automations_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="automationsFilePresence", default=None) + """ + automations_file_presence indicates how an automations file is present in the + environment. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """ + failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the automations file.""" + + session: Optional[str] = None + """ + session is the automations file session that is currently applied in the + environment. + """ + + +class EnvironmentStatusContentGitChangedFile(BaseModel): + change_type: Optional[ + Literal[ + "CHANGE_TYPE_UNSPECIFIED", + "CHANGE_TYPE_ADDED", + "CHANGE_TYPE_MODIFIED", + "CHANGE_TYPE_DELETED", + "CHANGE_TYPE_RENAMED", + "CHANGE_TYPE_COPIED", + "CHANGE_TYPE_UPDATED_BUT_UNMERGED", + "CHANGE_TYPE_UNTRACKED", + ] + ] = FieldInfo(alias="changeType", default=None) + """ChangeType is the type of change that happened to the file""" + + path: Optional[str] = None + """path is the path of the file""" + + +class EnvironmentStatusContentGit(BaseModel): + branch: Optional[str] = None + """branch is branch we're currently on""" + + changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( + alias="changedFiles", default=None + ) + """ + changed_files is an array of changed files in the environment, possibly + truncated + """ + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + """ + clone_url is the repository url as you would pass it to "git clone". Only HTTPS + clone URLs are supported. + """ + + latest_commit: Optional[str] = FieldInfo(alias="latestCommit", default=None) + """latest_commit is the most recent commit on the current branch""" + + total_changed_files: Optional[int] = FieldInfo(alias="totalChangedFiles", default=None) + + total_unpushed_commits: Optional[int] = FieldInfo(alias="totalUnpushedCommits", default=None) + """the total number of unpushed changes""" + + unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) + """ + unpushed_commits is an array of unpushed changes in the environment, possibly + truncated + """ + + +class EnvironmentStatusContent(BaseModel): + content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) + """content_location_in_machine is the location of the content in the machine""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the content initialization failed.""" + + git: Optional[EnvironmentStatusContentGit] = None + """ + git is the Git working copy status of the environment. Note: this is a + best-effort field and more often than not will not be present. Its absence does + not indicate the absence of a working copy. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the environment content""" + + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the content is present but not in the expected state. + """ + + +class EnvironmentStatusDevcontainer(BaseModel): + container_id: Optional[str] = FieldInfo(alias="containerId", default=None) + """container_id is the ID of the container.""" + + container_name: Optional[str] = FieldInfo(alias="containerName", default=None) + """ + container_name is the name of the container that is used to connect to the + devcontainer + """ + + devcontainerconfig_in_sync: Optional[bool] = FieldInfo(alias="devcontainerconfigInSync", default=None) + """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. + + the devcontainer config file. + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + devcontainer_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="devcontainerFilePresence", default=None) + """ + devcontainer_file_presence indicates how the devcontainer file is present in the + repo. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the devcontainer failed to operate.""" + + phase: Optional[ + Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] + ] = None + """phase is the current phase of the devcontainer""" + + remote_user: Optional[str] = FieldInfo(alias="remoteUser", default=None) + """remote_user is the user that is used to connect to the devcontainer""" + + remote_workspace_folder: Optional[str] = FieldInfo(alias="remoteWorkspaceFolder", default=None) + """ + remote_workspace_folder is the folder that is used to connect to the + devcontainer + """ + + secrets_in_sync: Optional[bool] = FieldInfo(alias="secretsInSync", default=None) + """secrets_in_sync indicates if the secrets are up to date w.r.t. + + the running devcontainer. + """ + + session: Optional[str] = None + """session is the session that is currently active in the devcontainer.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the devcontainer is present but not in the expected state. + """ + + +class EnvironmentStatusEnvironmentURLsPort(BaseModel): + port: Optional[int] = None + """port is the port number of the environment port""" + + url: Optional[str] = None + """url is the URL at which the environment port can be accessed""" + + +class EnvironmentStatusEnvironmentURLsSSH(BaseModel): + url: Optional[str] = None + + +class EnvironmentStatusEnvironmentURLs(BaseModel): + logs: Optional[str] = None + """logs is the URL at which the environment logs can be accessed.""" + + ports: Optional[List[EnvironmentStatusEnvironmentURLsPort]] = None + + ssh: Optional[EnvironmentStatusEnvironmentURLsSSH] = None + """SSH is the URL at which the environment can be accessed via SSH.""" + + +class EnvironmentStatusMachineVersions(BaseModel): + supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) + + supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) + + +class EnvironmentStatusMachine(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the machine failed to operate.""" + + phase: Optional[ + Literal[ + "PHASE_UNSPECIFIED", + "PHASE_CREATING", + "PHASE_STARTING", + "PHASE_RUNNING", + "PHASE_STOPPING", + "PHASE_STOPPED", + "PHASE_DELETING", + "PHASE_DELETED", + ] + ] = None + """phase is the current phase of the environment machine""" + + session: Optional[str] = None + """session is the session that is currently active in the machine.""" + + timeout: Optional[str] = None + """timeout contains the reason the environment has timed out. + + If this field is empty, the environment has not timed out. + """ + + versions: Optional[EnvironmentStatusMachineVersions] = None + """versions contains the versions of components in the machine.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the machine is present but not in the expected state. + """ + + +class EnvironmentStatusRunnerAck(BaseModel): + message: Optional[str] = None + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + + status_code: Optional[ + Literal[ + "STATUS_CODE_UNSPECIFIED", + "STATUS_CODE_OK", + "STATUS_CODE_INVALID_RESOURCE", + "STATUS_CODE_FAILED_PRECONDITION", + ] + ] = FieldInfo(alias="statusCode", default=None) + + +class EnvironmentStatusSecret(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the secret failed to be materialize.""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + + secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the secret is present but not in the expected state. + """ + + +class EnvironmentStatusSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the public key""" + + +class EnvironmentStatus(BaseModel): + automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file contains the status of the automations file.""" + + content: Optional[EnvironmentStatusContent] = None + """content contains the status of the environment content.""" + + devcontainer: Optional[EnvironmentStatusDevcontainer] = None + """devcontainer contains the status of the devcontainer.""" + + environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. + """ + + failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + machine: Optional[EnvironmentStatusMachine] = None + """machine contains the status of the environment machine""" + + phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = None + """ + the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) + """ + RunnerACK is the acknowledgement from the runner that is has received the + environment spec. + """ + + secrets: Optional[List[EnvironmentStatusSecret]] = None + """secrets contains the status of the environment secrets""" + + ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys contains the status of the environment ssh public keys""" + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the environment is present but not in the expected state. + """ + + +class Environment(BaseModel): + id: Optional[str] = None + """ID is a unique identifier of this environment. + + No other environment with the same name must be managed by this environment + manager + """ + + metadata: Optional[EnvironmentMetadata] = None + """ + EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function + """ + + spec: Optional[EnvironmentSpec] = None + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + + status: Optional[EnvironmentStatus] = None + """EnvironmentStatus describes an environment status""" + + +class EnvironmentCreateFromProjectResponse(BaseModel): + environment: Optional[Environment] = None + """+resource get environment""" diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py new file mode 100644 index 00000000..c1b47dba --- /dev/null +++ b/src/gitpod/types/environment_create_params.py @@ -0,0 +1,220 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "EnvironmentCreateParams", + "Spec", + "SpecAutomationsFile", + "SpecContent", + "SpecContentInitializer", + "SpecDevcontainer", + "SpecMachine", + "SpecPort", + "SpecSSHPublicKey", + "SpecTimeout", +] + + +class EnvironmentCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + spec: Spec + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class SpecAutomationsFile(TypedDict, total=False): + automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. + """ + + session: str + + +class SpecContentInitializer(TypedDict, total=False): + specs: Iterable[Union[object, object, object]] + + +class SpecContent(TypedDict, total=False): + git_email: Annotated[str, PropertyInfo(alias="gitEmail")] + """The Git email address""" + + git_username: Annotated[str, PropertyInfo(alias="gitUsername")] + """The Git username""" + + initializer: SpecContentInitializer + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: str + + +class SpecDevcontainer(TypedDict, total=False): + devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + session: str + + +_SpecMachineReservedKeywords = TypedDict( + "_SpecMachineReservedKeywords", + { + "class": str, + }, + total=False, +) + + +class SpecMachine(_SpecMachineReservedKeywords, total=False): + session: str + + +class SpecPort(TypedDict, total=False): + admission: Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + """Admission level describes who can access an environment instance and its ports.""" + + name: str + """name of this port""" + + port: int + """port number""" + + +class SpecSSHPublicKey(TypedDict, total=False): + id: str + """id is the unique identifier of the public key""" + + value: str + """value is the actual public key in the public key file format""" + + +class SpecTimeout(TypedDict, total=False): + disconnected: str + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class Spec(TypedDict, total=False): + admission: Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Annotated[SpecAutomationsFile, PropertyInfo(alias="automationsFile")] + """automations_file is the automations file spec of the environment""" + + content: SpecContent + """content is the content spec of the environment""" + + desired_phase: Annotated[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ], + PropertyInfo(alias="desiredPhase"), + ] + """Phase is the desired phase of the environment""" + + devcontainer: SpecDevcontainer + """devcontainer is the devcontainer spec of the environment""" + + machine: SpecMachine + """machine is the machine spec of the environment""" + + ports: Iterable[SpecPort] + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Iterable[Union[object, object, object, object]] + """secrets are confidential data that is mounted into the environment""" + + spec_version: Annotated[Union[str, float], PropertyInfo(alias="specVersion")] + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Annotated[Iterable[SpecSSHPublicKey], PropertyInfo(alias="sshPublicKeys")] + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: SpecTimeout + """Timeout configures the environment timeout""" diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py new file mode 100644 index 00000000..c622ca32 --- /dev/null +++ b/src/gitpod/types/environment_create_response.py @@ -0,0 +1,775 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "EnvironmentCreateResponse", + "Environment", + "EnvironmentMetadata", + "EnvironmentMetadataCreator", + "EnvironmentSpec", + "EnvironmentSpecAutomationsFile", + "EnvironmentSpecContent", + "EnvironmentSpecContentInitializer", + "EnvironmentSpecDevcontainer", + "EnvironmentSpecMachine", + "EnvironmentSpecPort", + "EnvironmentSpecSSHPublicKey", + "EnvironmentSpecTimeout", + "EnvironmentStatus", + "EnvironmentStatusAutomationsFile", + "EnvironmentStatusContent", + "EnvironmentStatusContentGit", + "EnvironmentStatusContentGitChangedFile", + "EnvironmentStatusDevcontainer", + "EnvironmentStatusEnvironmentURLs", + "EnvironmentStatusEnvironmentURLsPort", + "EnvironmentStatusEnvironmentURLsSSH", + "EnvironmentStatusMachine", + "EnvironmentStatusMachineVersions", + "EnvironmentStatusRunnerAck", + "EnvironmentStatusSecret", + "EnvironmentStatusSSHPublicKey", +] + + +class EnvironmentMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class EnvironmentMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[EnvironmentMetadataCreator] = None + """creator is the identity of the creator of the environment""" + + name: Optional[str] = None + """name is the name of the environment as specified by the user""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + """ + original_context_url is the normalized URL from which the environment was + created + """ + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """ + If the Environment was started from a project, the project_id will reference the + project. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """Runner is the ID of the runner that runs this environment.""" + + +class EnvironmentSpecAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. + """ + + session: Optional[str] = None + + +class EnvironmentSpecContentInitializer(BaseModel): + specs: Optional[List[Union[object, object, object]]] = None + + +class EnvironmentSpecContent(BaseModel): + git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) + """The Git email address""" + + git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) + """The Git username""" + + initializer: Optional[EnvironmentSpecContentInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: Optional[str] = None + + +class EnvironmentSpecDevcontainer(BaseModel): + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + session: Optional[str] = None + + +class EnvironmentSpecMachine(BaseModel): + class_: Optional[str] = FieldInfo(alias="class", default=None) + """Class denotes the class of the environment we ought to start""" + + session: Optional[str] = None + + +class EnvironmentSpecPort(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + name: Optional[str] = None + """name of this port""" + + port: Optional[int] = None + """port number""" + + +class EnvironmentSpecSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + value: Optional[str] = None + """value is the actual public key in the public key file format""" + + +class EnvironmentSpecTimeout(BaseModel): + disconnected: Optional[str] = None + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class EnvironmentSpec(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file is the automations file spec of the environment""" + + content: Optional[EnvironmentSpecContent] = None + """content is the content spec of the environment""" + + desired_phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """Phase is the desired phase of the environment""" + + devcontainer: Optional[EnvironmentSpecDevcontainer] = None + """devcontainer is the devcontainer spec of the environment""" + + machine: Optional[EnvironmentSpecMachine] = None + """machine is the machine spec of the environment""" + + ports: Optional[List[EnvironmentSpecPort]] = None + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Optional[List[Union[object, object, object, object]]] = None + """secrets are confidential data that is mounted into the environment""" + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: Optional[EnvironmentSpecTimeout] = None + """Timeout configures the environment timeout""" + + +class EnvironmentStatusAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root. + """ + + automations_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="automationsFilePresence", default=None) + """ + automations_file_presence indicates how an automations file is present in the + environment. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """ + failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the automations file.""" + + session: Optional[str] = None + """ + session is the automations file session that is currently applied in the + environment. + """ + + +class EnvironmentStatusContentGitChangedFile(BaseModel): + change_type: Optional[ + Literal[ + "CHANGE_TYPE_UNSPECIFIED", + "CHANGE_TYPE_ADDED", + "CHANGE_TYPE_MODIFIED", + "CHANGE_TYPE_DELETED", + "CHANGE_TYPE_RENAMED", + "CHANGE_TYPE_COPIED", + "CHANGE_TYPE_UPDATED_BUT_UNMERGED", + "CHANGE_TYPE_UNTRACKED", + ] + ] = FieldInfo(alias="changeType", default=None) + """ChangeType is the type of change that happened to the file""" + + path: Optional[str] = None + """path is the path of the file""" + + +class EnvironmentStatusContentGit(BaseModel): + branch: Optional[str] = None + """branch is branch we're currently on""" + + changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( + alias="changedFiles", default=None + ) + """ + changed_files is an array of changed files in the environment, possibly + truncated + """ + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + """ + clone_url is the repository url as you would pass it to "git clone". Only HTTPS + clone URLs are supported. + """ + + latest_commit: Optional[str] = FieldInfo(alias="latestCommit", default=None) + """latest_commit is the most recent commit on the current branch""" + + total_changed_files: Optional[int] = FieldInfo(alias="totalChangedFiles", default=None) + + total_unpushed_commits: Optional[int] = FieldInfo(alias="totalUnpushedCommits", default=None) + """the total number of unpushed changes""" + + unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) + """ + unpushed_commits is an array of unpushed changes in the environment, possibly + truncated + """ + + +class EnvironmentStatusContent(BaseModel): + content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) + """content_location_in_machine is the location of the content in the machine""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the content initialization failed.""" + + git: Optional[EnvironmentStatusContentGit] = None + """ + git is the Git working copy status of the environment. Note: this is a + best-effort field and more often than not will not be present. Its absence does + not indicate the absence of a working copy. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the environment content""" + + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the content is present but not in the expected state. + """ + + +class EnvironmentStatusDevcontainer(BaseModel): + container_id: Optional[str] = FieldInfo(alias="containerId", default=None) + """container_id is the ID of the container.""" + + container_name: Optional[str] = FieldInfo(alias="containerName", default=None) + """ + container_name is the name of the container that is used to connect to the + devcontainer + """ + + devcontainerconfig_in_sync: Optional[bool] = FieldInfo(alias="devcontainerconfigInSync", default=None) + """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. + + the devcontainer config file. + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + devcontainer_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="devcontainerFilePresence", default=None) + """ + devcontainer_file_presence indicates how the devcontainer file is present in the + repo. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the devcontainer failed to operate.""" + + phase: Optional[ + Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] + ] = None + """phase is the current phase of the devcontainer""" + + remote_user: Optional[str] = FieldInfo(alias="remoteUser", default=None) + """remote_user is the user that is used to connect to the devcontainer""" + + remote_workspace_folder: Optional[str] = FieldInfo(alias="remoteWorkspaceFolder", default=None) + """ + remote_workspace_folder is the folder that is used to connect to the + devcontainer + """ + + secrets_in_sync: Optional[bool] = FieldInfo(alias="secretsInSync", default=None) + """secrets_in_sync indicates if the secrets are up to date w.r.t. + + the running devcontainer. + """ + + session: Optional[str] = None + """session is the session that is currently active in the devcontainer.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the devcontainer is present but not in the expected state. + """ + + +class EnvironmentStatusEnvironmentURLsPort(BaseModel): + port: Optional[int] = None + """port is the port number of the environment port""" + + url: Optional[str] = None + """url is the URL at which the environment port can be accessed""" + + +class EnvironmentStatusEnvironmentURLsSSH(BaseModel): + url: Optional[str] = None + + +class EnvironmentStatusEnvironmentURLs(BaseModel): + logs: Optional[str] = None + """logs is the URL at which the environment logs can be accessed.""" + + ports: Optional[List[EnvironmentStatusEnvironmentURLsPort]] = None + + ssh: Optional[EnvironmentStatusEnvironmentURLsSSH] = None + """SSH is the URL at which the environment can be accessed via SSH.""" + + +class EnvironmentStatusMachineVersions(BaseModel): + supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) + + supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) + + +class EnvironmentStatusMachine(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the machine failed to operate.""" + + phase: Optional[ + Literal[ + "PHASE_UNSPECIFIED", + "PHASE_CREATING", + "PHASE_STARTING", + "PHASE_RUNNING", + "PHASE_STOPPING", + "PHASE_STOPPED", + "PHASE_DELETING", + "PHASE_DELETED", + ] + ] = None + """phase is the current phase of the environment machine""" + + session: Optional[str] = None + """session is the session that is currently active in the machine.""" + + timeout: Optional[str] = None + """timeout contains the reason the environment has timed out. + + If this field is empty, the environment has not timed out. + """ + + versions: Optional[EnvironmentStatusMachineVersions] = None + """versions contains the versions of components in the machine.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the machine is present but not in the expected state. + """ + + +class EnvironmentStatusRunnerAck(BaseModel): + message: Optional[str] = None + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + + status_code: Optional[ + Literal[ + "STATUS_CODE_UNSPECIFIED", + "STATUS_CODE_OK", + "STATUS_CODE_INVALID_RESOURCE", + "STATUS_CODE_FAILED_PRECONDITION", + ] + ] = FieldInfo(alias="statusCode", default=None) + + +class EnvironmentStatusSecret(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the secret failed to be materialize.""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + + secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the secret is present but not in the expected state. + """ + + +class EnvironmentStatusSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the public key""" + + +class EnvironmentStatus(BaseModel): + automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file contains the status of the automations file.""" + + content: Optional[EnvironmentStatusContent] = None + """content contains the status of the environment content.""" + + devcontainer: Optional[EnvironmentStatusDevcontainer] = None + """devcontainer contains the status of the devcontainer.""" + + environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. + """ + + failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + machine: Optional[EnvironmentStatusMachine] = None + """machine contains the status of the environment machine""" + + phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = None + """ + the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) + """ + RunnerACK is the acknowledgement from the runner that is has received the + environment spec. + """ + + secrets: Optional[List[EnvironmentStatusSecret]] = None + """secrets contains the status of the environment secrets""" + + ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys contains the status of the environment ssh public keys""" + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the environment is present but not in the expected state. + """ + + +class Environment(BaseModel): + id: Optional[str] = None + """ID is a unique identifier of this environment. + + No other environment with the same name must be managed by this environment + manager + """ + + metadata: Optional[EnvironmentMetadata] = None + """ + EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function + """ + + spec: Optional[EnvironmentSpec] = None + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + + status: Optional[EnvironmentStatus] = None + """EnvironmentStatus describes an environment status""" + + +class EnvironmentCreateResponse(BaseModel): + environment: Optional[Environment] = None + """+resource get environment""" diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py new file mode 100644 index 00000000..e5be7002 --- /dev/null +++ b/src/gitpod/types/environment_list_params.py @@ -0,0 +1,80 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentListParams", "Filter", "Pagination"] + + +class EnvironmentListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Filter + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the ID of the organization that contains the environments""" + + pagination: Pagination + """pagination contains the pagination options for listing environments""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Filter(TypedDict, total=False): + creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] + """ + creator_ids filters the response to only Environments created by specified + members + """ + + project_ids: Annotated[List[str], PropertyInfo(alias="projectIds")] + """ + project_ids filters the response to only Environments associated with the + specified projects + """ + + runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] + """ + runner_ids filters the response to only Environments running on these Runner IDs + """ + + status_phases: Annotated[ + List[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ], + PropertyInfo(alias="statusPhases"), + ] + """ + actual_phases is a list of phases the environment must be in for it to be + returned in the API call + """ + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py new file mode 100644 index 00000000..110ddb59 --- /dev/null +++ b/src/gitpod/types/environment_list_response.py @@ -0,0 +1,787 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "EnvironmentListResponse", + "Environment", + "EnvironmentMetadata", + "EnvironmentMetadataCreator", + "EnvironmentSpec", + "EnvironmentSpecAutomationsFile", + "EnvironmentSpecContent", + "EnvironmentSpecContentInitializer", + "EnvironmentSpecDevcontainer", + "EnvironmentSpecMachine", + "EnvironmentSpecPort", + "EnvironmentSpecSSHPublicKey", + "EnvironmentSpecTimeout", + "EnvironmentStatus", + "EnvironmentStatusAutomationsFile", + "EnvironmentStatusContent", + "EnvironmentStatusContentGit", + "EnvironmentStatusContentGitChangedFile", + "EnvironmentStatusDevcontainer", + "EnvironmentStatusEnvironmentURLs", + "EnvironmentStatusEnvironmentURLsPort", + "EnvironmentStatusEnvironmentURLsSSH", + "EnvironmentStatusMachine", + "EnvironmentStatusMachineVersions", + "EnvironmentStatusRunnerAck", + "EnvironmentStatusSecret", + "EnvironmentStatusSSHPublicKey", + "Pagination", +] + + +class EnvironmentMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class EnvironmentMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[EnvironmentMetadataCreator] = None + """creator is the identity of the creator of the environment""" + + name: Optional[str] = None + """name is the name of the environment as specified by the user""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + """ + original_context_url is the normalized URL from which the environment was + created + """ + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """ + If the Environment was started from a project, the project_id will reference the + project. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """Runner is the ID of the runner that runs this environment.""" + + +class EnvironmentSpecAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. + """ + + session: Optional[str] = None + + +class EnvironmentSpecContentInitializer(BaseModel): + specs: Optional[List[Union[object, object, object]]] = None + + +class EnvironmentSpecContent(BaseModel): + git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) + """The Git email address""" + + git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) + """The Git username""" + + initializer: Optional[EnvironmentSpecContentInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: Optional[str] = None + + +class EnvironmentSpecDevcontainer(BaseModel): + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + session: Optional[str] = None + + +class EnvironmentSpecMachine(BaseModel): + class_: Optional[str] = FieldInfo(alias="class", default=None) + """Class denotes the class of the environment we ought to start""" + + session: Optional[str] = None + + +class EnvironmentSpecPort(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + name: Optional[str] = None + """name of this port""" + + port: Optional[int] = None + """port number""" + + +class EnvironmentSpecSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + value: Optional[str] = None + """value is the actual public key in the public key file format""" + + +class EnvironmentSpecTimeout(BaseModel): + disconnected: Optional[str] = None + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class EnvironmentSpec(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file is the automations file spec of the environment""" + + content: Optional[EnvironmentSpecContent] = None + """content is the content spec of the environment""" + + desired_phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """Phase is the desired phase of the environment""" + + devcontainer: Optional[EnvironmentSpecDevcontainer] = None + """devcontainer is the devcontainer spec of the environment""" + + machine: Optional[EnvironmentSpecMachine] = None + """machine is the machine spec of the environment""" + + ports: Optional[List[EnvironmentSpecPort]] = None + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Optional[List[Union[object, object, object, object]]] = None + """secrets are confidential data that is mounted into the environment""" + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: Optional[EnvironmentSpecTimeout] = None + """Timeout configures the environment timeout""" + + +class EnvironmentStatusAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root. + """ + + automations_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="automationsFilePresence", default=None) + """ + automations_file_presence indicates how an automations file is present in the + environment. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """ + failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the automations file.""" + + session: Optional[str] = None + """ + session is the automations file session that is currently applied in the + environment. + """ + + +class EnvironmentStatusContentGitChangedFile(BaseModel): + change_type: Optional[ + Literal[ + "CHANGE_TYPE_UNSPECIFIED", + "CHANGE_TYPE_ADDED", + "CHANGE_TYPE_MODIFIED", + "CHANGE_TYPE_DELETED", + "CHANGE_TYPE_RENAMED", + "CHANGE_TYPE_COPIED", + "CHANGE_TYPE_UPDATED_BUT_UNMERGED", + "CHANGE_TYPE_UNTRACKED", + ] + ] = FieldInfo(alias="changeType", default=None) + """ChangeType is the type of change that happened to the file""" + + path: Optional[str] = None + """path is the path of the file""" + + +class EnvironmentStatusContentGit(BaseModel): + branch: Optional[str] = None + """branch is branch we're currently on""" + + changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( + alias="changedFiles", default=None + ) + """ + changed_files is an array of changed files in the environment, possibly + truncated + """ + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + """ + clone_url is the repository url as you would pass it to "git clone". Only HTTPS + clone URLs are supported. + """ + + latest_commit: Optional[str] = FieldInfo(alias="latestCommit", default=None) + """latest_commit is the most recent commit on the current branch""" + + total_changed_files: Optional[int] = FieldInfo(alias="totalChangedFiles", default=None) + + total_unpushed_commits: Optional[int] = FieldInfo(alias="totalUnpushedCommits", default=None) + """the total number of unpushed changes""" + + unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) + """ + unpushed_commits is an array of unpushed changes in the environment, possibly + truncated + """ + + +class EnvironmentStatusContent(BaseModel): + content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) + """content_location_in_machine is the location of the content in the machine""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the content initialization failed.""" + + git: Optional[EnvironmentStatusContentGit] = None + """ + git is the Git working copy status of the environment. Note: this is a + best-effort field and more often than not will not be present. Its absence does + not indicate the absence of a working copy. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the environment content""" + + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the content is present but not in the expected state. + """ + + +class EnvironmentStatusDevcontainer(BaseModel): + container_id: Optional[str] = FieldInfo(alias="containerId", default=None) + """container_id is the ID of the container.""" + + container_name: Optional[str] = FieldInfo(alias="containerName", default=None) + """ + container_name is the name of the container that is used to connect to the + devcontainer + """ + + devcontainerconfig_in_sync: Optional[bool] = FieldInfo(alias="devcontainerconfigInSync", default=None) + """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. + + the devcontainer config file. + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + devcontainer_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="devcontainerFilePresence", default=None) + """ + devcontainer_file_presence indicates how the devcontainer file is present in the + repo. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the devcontainer failed to operate.""" + + phase: Optional[ + Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] + ] = None + """phase is the current phase of the devcontainer""" + + remote_user: Optional[str] = FieldInfo(alias="remoteUser", default=None) + """remote_user is the user that is used to connect to the devcontainer""" + + remote_workspace_folder: Optional[str] = FieldInfo(alias="remoteWorkspaceFolder", default=None) + """ + remote_workspace_folder is the folder that is used to connect to the + devcontainer + """ + + secrets_in_sync: Optional[bool] = FieldInfo(alias="secretsInSync", default=None) + """secrets_in_sync indicates if the secrets are up to date w.r.t. + + the running devcontainer. + """ + + session: Optional[str] = None + """session is the session that is currently active in the devcontainer.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the devcontainer is present but not in the expected state. + """ + + +class EnvironmentStatusEnvironmentURLsPort(BaseModel): + port: Optional[int] = None + """port is the port number of the environment port""" + + url: Optional[str] = None + """url is the URL at which the environment port can be accessed""" + + +class EnvironmentStatusEnvironmentURLsSSH(BaseModel): + url: Optional[str] = None + + +class EnvironmentStatusEnvironmentURLs(BaseModel): + logs: Optional[str] = None + """logs is the URL at which the environment logs can be accessed.""" + + ports: Optional[List[EnvironmentStatusEnvironmentURLsPort]] = None + + ssh: Optional[EnvironmentStatusEnvironmentURLsSSH] = None + """SSH is the URL at which the environment can be accessed via SSH.""" + + +class EnvironmentStatusMachineVersions(BaseModel): + supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) + + supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) + + +class EnvironmentStatusMachine(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the machine failed to operate.""" + + phase: Optional[ + Literal[ + "PHASE_UNSPECIFIED", + "PHASE_CREATING", + "PHASE_STARTING", + "PHASE_RUNNING", + "PHASE_STOPPING", + "PHASE_STOPPED", + "PHASE_DELETING", + "PHASE_DELETED", + ] + ] = None + """phase is the current phase of the environment machine""" + + session: Optional[str] = None + """session is the session that is currently active in the machine.""" + + timeout: Optional[str] = None + """timeout contains the reason the environment has timed out. + + If this field is empty, the environment has not timed out. + """ + + versions: Optional[EnvironmentStatusMachineVersions] = None + """versions contains the versions of components in the machine.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the machine is present but not in the expected state. + """ + + +class EnvironmentStatusRunnerAck(BaseModel): + message: Optional[str] = None + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + + status_code: Optional[ + Literal[ + "STATUS_CODE_UNSPECIFIED", + "STATUS_CODE_OK", + "STATUS_CODE_INVALID_RESOURCE", + "STATUS_CODE_FAILED_PRECONDITION", + ] + ] = FieldInfo(alias="statusCode", default=None) + + +class EnvironmentStatusSecret(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the secret failed to be materialize.""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + + secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the secret is present but not in the expected state. + """ + + +class EnvironmentStatusSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the public key""" + + +class EnvironmentStatus(BaseModel): + automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file contains the status of the automations file.""" + + content: Optional[EnvironmentStatusContent] = None + """content contains the status of the environment content.""" + + devcontainer: Optional[EnvironmentStatusDevcontainer] = None + """devcontainer contains the status of the devcontainer.""" + + environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. + """ + + failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + machine: Optional[EnvironmentStatusMachine] = None + """machine contains the status of the environment machine""" + + phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = None + """ + the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) + """ + RunnerACK is the acknowledgement from the runner that is has received the + environment spec. + """ + + secrets: Optional[List[EnvironmentStatusSecret]] = None + """secrets contains the status of the environment secrets""" + + ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys contains the status of the environment ssh public keys""" + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the environment is present but not in the expected state. + """ + + +class Environment(BaseModel): + id: Optional[str] = None + """ID is a unique identifier of this environment. + + No other environment with the same name must be managed by this environment + manager + """ + + metadata: Optional[EnvironmentMetadata] = None + """ + EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function + """ + + spec: Optional[EnvironmentSpec] = None + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + + status: Optional[EnvironmentStatus] = None + """EnvironmentStatus describes an environment status""" + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class EnvironmentListResponse(BaseModel): + environments: Optional[List[Environment]] = None + """environments are the environments that matched the query""" + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/environment_retrieve_params.py b/src/gitpod/types/environment_retrieve_params.py new file mode 100644 index 00000000..a06329ae --- /dev/null +++ b/src/gitpod/types/environment_retrieve_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentRetrieveParams"] + + +class EnvironmentRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environment_id specifies the environment to get""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py new file mode 100644 index 00000000..fc2eab03 --- /dev/null +++ b/src/gitpod/types/environment_retrieve_response.py @@ -0,0 +1,775 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "EnvironmentRetrieveResponse", + "Environment", + "EnvironmentMetadata", + "EnvironmentMetadataCreator", + "EnvironmentSpec", + "EnvironmentSpecAutomationsFile", + "EnvironmentSpecContent", + "EnvironmentSpecContentInitializer", + "EnvironmentSpecDevcontainer", + "EnvironmentSpecMachine", + "EnvironmentSpecPort", + "EnvironmentSpecSSHPublicKey", + "EnvironmentSpecTimeout", + "EnvironmentStatus", + "EnvironmentStatusAutomationsFile", + "EnvironmentStatusContent", + "EnvironmentStatusContentGit", + "EnvironmentStatusContentGitChangedFile", + "EnvironmentStatusDevcontainer", + "EnvironmentStatusEnvironmentURLs", + "EnvironmentStatusEnvironmentURLsPort", + "EnvironmentStatusEnvironmentURLsSSH", + "EnvironmentStatusMachine", + "EnvironmentStatusMachineVersions", + "EnvironmentStatusRunnerAck", + "EnvironmentStatusSecret", + "EnvironmentStatusSSHPublicKey", +] + + +class EnvironmentMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class EnvironmentMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[EnvironmentMetadataCreator] = None + """creator is the identity of the creator of the environment""" + + name: Optional[str] = None + """name is the name of the environment as specified by the user""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + """ + original_context_url is the normalized URL from which the environment was + created + """ + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """ + If the Environment was started from a project, the project_id will reference the + project. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """Runner is the ID of the runner that runs this environment.""" + + +class EnvironmentSpecAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. + """ + + session: Optional[str] = None + + +class EnvironmentSpecContentInitializer(BaseModel): + specs: Optional[List[Union[object, object, object]]] = None + + +class EnvironmentSpecContent(BaseModel): + git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) + """The Git email address""" + + git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) + """The Git username""" + + initializer: Optional[EnvironmentSpecContentInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: Optional[str] = None + + +class EnvironmentSpecDevcontainer(BaseModel): + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + session: Optional[str] = None + + +class EnvironmentSpecMachine(BaseModel): + class_: Optional[str] = FieldInfo(alias="class", default=None) + """Class denotes the class of the environment we ought to start""" + + session: Optional[str] = None + + +class EnvironmentSpecPort(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + name: Optional[str] = None + """name of this port""" + + port: Optional[int] = None + """port number""" + + +class EnvironmentSpecSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + value: Optional[str] = None + """value is the actual public key in the public key file format""" + + +class EnvironmentSpecTimeout(BaseModel): + disconnected: Optional[str] = None + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class EnvironmentSpec(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file is the automations file spec of the environment""" + + content: Optional[EnvironmentSpecContent] = None + """content is the content spec of the environment""" + + desired_phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """Phase is the desired phase of the environment""" + + devcontainer: Optional[EnvironmentSpecDevcontainer] = None + """devcontainer is the devcontainer spec of the environment""" + + machine: Optional[EnvironmentSpecMachine] = None + """machine is the machine spec of the environment""" + + ports: Optional[List[EnvironmentSpecPort]] = None + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Optional[List[Union[object, object, object, object]]] = None + """secrets are confidential data that is mounted into the environment""" + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: Optional[EnvironmentSpecTimeout] = None + """Timeout configures the environment timeout""" + + +class EnvironmentStatusAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root. + """ + + automations_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="automationsFilePresence", default=None) + """ + automations_file_presence indicates how an automations file is present in the + environment. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """ + failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the automations file.""" + + session: Optional[str] = None + """ + session is the automations file session that is currently applied in the + environment. + """ + + +class EnvironmentStatusContentGitChangedFile(BaseModel): + change_type: Optional[ + Literal[ + "CHANGE_TYPE_UNSPECIFIED", + "CHANGE_TYPE_ADDED", + "CHANGE_TYPE_MODIFIED", + "CHANGE_TYPE_DELETED", + "CHANGE_TYPE_RENAMED", + "CHANGE_TYPE_COPIED", + "CHANGE_TYPE_UPDATED_BUT_UNMERGED", + "CHANGE_TYPE_UNTRACKED", + ] + ] = FieldInfo(alias="changeType", default=None) + """ChangeType is the type of change that happened to the file""" + + path: Optional[str] = None + """path is the path of the file""" + + +class EnvironmentStatusContentGit(BaseModel): + branch: Optional[str] = None + """branch is branch we're currently on""" + + changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( + alias="changedFiles", default=None + ) + """ + changed_files is an array of changed files in the environment, possibly + truncated + """ + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + """ + clone_url is the repository url as you would pass it to "git clone". Only HTTPS + clone URLs are supported. + """ + + latest_commit: Optional[str] = FieldInfo(alias="latestCommit", default=None) + """latest_commit is the most recent commit on the current branch""" + + total_changed_files: Optional[int] = FieldInfo(alias="totalChangedFiles", default=None) + + total_unpushed_commits: Optional[int] = FieldInfo(alias="totalUnpushedCommits", default=None) + """the total number of unpushed changes""" + + unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) + """ + unpushed_commits is an array of unpushed changes in the environment, possibly + truncated + """ + + +class EnvironmentStatusContent(BaseModel): + content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) + """content_location_in_machine is the location of the content in the machine""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the content initialization failed.""" + + git: Optional[EnvironmentStatusContentGit] = None + """ + git is the Git working copy status of the environment. Note: this is a + best-effort field and more often than not will not be present. Its absence does + not indicate the absence of a working copy. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the environment content""" + + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the content is present but not in the expected state. + """ + + +class EnvironmentStatusDevcontainer(BaseModel): + container_id: Optional[str] = FieldInfo(alias="containerId", default=None) + """container_id is the ID of the container.""" + + container_name: Optional[str] = FieldInfo(alias="containerName", default=None) + """ + container_name is the name of the container that is used to connect to the + devcontainer + """ + + devcontainerconfig_in_sync: Optional[bool] = FieldInfo(alias="devcontainerconfigInSync", default=None) + """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. + + the devcontainer config file. + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + devcontainer_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="devcontainerFilePresence", default=None) + """ + devcontainer_file_presence indicates how the devcontainer file is present in the + repo. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the devcontainer failed to operate.""" + + phase: Optional[ + Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] + ] = None + """phase is the current phase of the devcontainer""" + + remote_user: Optional[str] = FieldInfo(alias="remoteUser", default=None) + """remote_user is the user that is used to connect to the devcontainer""" + + remote_workspace_folder: Optional[str] = FieldInfo(alias="remoteWorkspaceFolder", default=None) + """ + remote_workspace_folder is the folder that is used to connect to the + devcontainer + """ + + secrets_in_sync: Optional[bool] = FieldInfo(alias="secretsInSync", default=None) + """secrets_in_sync indicates if the secrets are up to date w.r.t. + + the running devcontainer. + """ + + session: Optional[str] = None + """session is the session that is currently active in the devcontainer.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the devcontainer is present but not in the expected state. + """ + + +class EnvironmentStatusEnvironmentURLsPort(BaseModel): + port: Optional[int] = None + """port is the port number of the environment port""" + + url: Optional[str] = None + """url is the URL at which the environment port can be accessed""" + + +class EnvironmentStatusEnvironmentURLsSSH(BaseModel): + url: Optional[str] = None + + +class EnvironmentStatusEnvironmentURLs(BaseModel): + logs: Optional[str] = None + """logs is the URL at which the environment logs can be accessed.""" + + ports: Optional[List[EnvironmentStatusEnvironmentURLsPort]] = None + + ssh: Optional[EnvironmentStatusEnvironmentURLsSSH] = None + """SSH is the URL at which the environment can be accessed via SSH.""" + + +class EnvironmentStatusMachineVersions(BaseModel): + supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) + + supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) + + +class EnvironmentStatusMachine(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the machine failed to operate.""" + + phase: Optional[ + Literal[ + "PHASE_UNSPECIFIED", + "PHASE_CREATING", + "PHASE_STARTING", + "PHASE_RUNNING", + "PHASE_STOPPING", + "PHASE_STOPPED", + "PHASE_DELETING", + "PHASE_DELETED", + ] + ] = None + """phase is the current phase of the environment machine""" + + session: Optional[str] = None + """session is the session that is currently active in the machine.""" + + timeout: Optional[str] = None + """timeout contains the reason the environment has timed out. + + If this field is empty, the environment has not timed out. + """ + + versions: Optional[EnvironmentStatusMachineVersions] = None + """versions contains the versions of components in the machine.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the machine is present but not in the expected state. + """ + + +class EnvironmentStatusRunnerAck(BaseModel): + message: Optional[str] = None + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + + status_code: Optional[ + Literal[ + "STATUS_CODE_UNSPECIFIED", + "STATUS_CODE_OK", + "STATUS_CODE_INVALID_RESOURCE", + "STATUS_CODE_FAILED_PRECONDITION", + ] + ] = FieldInfo(alias="statusCode", default=None) + + +class EnvironmentStatusSecret(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the secret failed to be materialize.""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + + secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the secret is present but not in the expected state. + """ + + +class EnvironmentStatusSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the public key""" + + +class EnvironmentStatus(BaseModel): + automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file contains the status of the automations file.""" + + content: Optional[EnvironmentStatusContent] = None + """content contains the status of the environment content.""" + + devcontainer: Optional[EnvironmentStatusDevcontainer] = None + """devcontainer contains the status of the devcontainer.""" + + environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. + """ + + failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + machine: Optional[EnvironmentStatusMachine] = None + """machine contains the status of the environment machine""" + + phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = None + """ + the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) + """ + RunnerACK is the acknowledgement from the runner that is has received the + environment spec. + """ + + secrets: Optional[List[EnvironmentStatusSecret]] = None + """secrets contains the status of the environment secrets""" + + ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys contains the status of the environment ssh public keys""" + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the environment is present but not in the expected state. + """ + + +class Environment(BaseModel): + id: Optional[str] = None + """ID is a unique identifier of this environment. + + No other environment with the same name must be managed by this environment + manager + """ + + metadata: Optional[EnvironmentMetadata] = None + """ + EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function + """ + + spec: Optional[EnvironmentSpec] = None + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + + status: Optional[EnvironmentStatus] = None + """EnvironmentStatus describes an environment status""" + + +class EnvironmentRetrieveResponse(BaseModel): + environment: Optional[Environment] = None + """+resource get environment""" diff --git a/src/gitpod/types/environment_start_params.py b/src/gitpod/types/environment_start_params.py new file mode 100644 index 00000000..7827114d --- /dev/null +++ b/src/gitpod/types/environment_start_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentStartParams"] + + +class EnvironmentStartParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environment_id specifies which environment should be started.""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_leave_params.py b/src/gitpod/types/organization_leave_params.py new file mode 100644 index 00000000..4fe19ee5 --- /dev/null +++ b/src/gitpod/types/organization_leave_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["OrganizationLeaveParams"] + + +class OrganizationLeaveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + user_id: Annotated[str, PropertyInfo(alias="userId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_set_role_params.py b/src/gitpod/types/organization_set_role_params.py new file mode 100644 index 00000000..fbd10649 --- /dev/null +++ b/src/gitpod/types/organization_set_role_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["OrganizationSetRoleParams"] + + +class OrganizationSetRoleParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + + role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] + + user_id: Annotated[str, PropertyInfo(alias="userId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py new file mode 100644 index 00000000..615aa157 --- /dev/null +++ b/src/gitpod/types/organizations/__init__.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .member_list_params import MemberListParams as MemberListParams +from .invite_create_params import InviteCreateParams as InviteCreateParams +from .member_list_response import MemberListResponse as MemberListResponse +from .invite_create_response import InviteCreateResponse as InviteCreateResponse +from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams +from .invite_retrieve_response import InviteRetrieveResponse as InviteRetrieveResponse diff --git a/src/gitpod/types/organizations/invite/__init__.py b/src/gitpod/types/organizations/invite/__init__.py new file mode 100644 index 00000000..24698ae5 --- /dev/null +++ b/src/gitpod/types/organizations/invite/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .summary_retrieve_params import SummaryRetrieveParams as SummaryRetrieveParams +from .summary_retrieve_response import SummaryRetrieveResponse as SummaryRetrieveResponse diff --git a/src/gitpod/types/organizations/invite/summary_retrieve_params.py b/src/gitpod/types/organizations/invite/summary_retrieve_params.py new file mode 100644 index 00000000..86f4793d --- /dev/null +++ b/src/gitpod/types/organizations/invite/summary_retrieve_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["SummaryRetrieveParams"] + + +class SummaryRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + invite_id: Annotated[str, PropertyInfo(alias="inviteId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite/summary_retrieve_response.py b/src/gitpod/types/organizations/invite/summary_retrieve_response.py new file mode 100644 index 00000000..38200c0e --- /dev/null +++ b/src/gitpod/types/organizations/invite/summary_retrieve_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["SummaryRetrieveResponse"] + + +class SummaryRetrieveResponse(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + + organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + + organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) diff --git a/src/gitpod/types/organizations/invite_create_params.py b/src/gitpod/types/organizations/invite_create_params.py new file mode 100644 index 00000000..1cd14a51 --- /dev/null +++ b/src/gitpod/types/organizations/invite_create_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["InviteCreateParams"] + + +class InviteCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_create_response.py b/src/gitpod/types/organizations/invite_create_response.py new file mode 100644 index 00000000..fb0cbbae --- /dev/null +++ b/src/gitpod/types/organizations/invite_create_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["InviteCreateResponse", "Invite"] + + +class Invite(BaseModel): + invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) + """ + invite_id is the unique identifier of the invite to join the organization. Use + JoinOrganization with this ID to join the organization. + """ + + +class InviteCreateResponse(BaseModel): + invite: Optional[Invite] = None diff --git a/src/gitpod/types/organizations/invite_retrieve_params.py b/src/gitpod/types/organizations/invite_retrieve_params.py new file mode 100644 index 00000000..fbbeaa6d --- /dev/null +++ b/src/gitpod/types/organizations/invite_retrieve_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["InviteRetrieveParams"] + + +class InviteRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_retrieve_response.py b/src/gitpod/types/organizations/invite_retrieve_response.py new file mode 100644 index 00000000..ea2cbb09 --- /dev/null +++ b/src/gitpod/types/organizations/invite_retrieve_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["InviteRetrieveResponse", "Invite"] + + +class Invite(BaseModel): + invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) + """ + invite_id is the unique identifier of the invite to join the organization. Use + JoinOrganization with this ID to join the organization. + """ + + +class InviteRetrieveResponse(BaseModel): + invite: Optional[Invite] = None diff --git a/src/gitpod/types/organizations/member_list_params.py b/src/gitpod/types/organizations/member_list_params.py new file mode 100644 index 00000000..958c7159 --- /dev/null +++ b/src/gitpod/types/organizations/member_list_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["MemberListParams", "Pagination"] + + +class MemberListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the ID of the organization to list members for""" + + pagination: Pagination + """pagination contains the pagination options for listing members""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/organizations/member_list_response.py b/src/gitpod/types/organizations/member_list_response.py new file mode 100644 index 00000000..137d1351 --- /dev/null +++ b/src/gitpod/types/organizations/member_list_response.py @@ -0,0 +1,137 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["MemberListResponse", "Member", "Pagination"] + + +class Member(BaseModel): + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + + email: Optional[str] = None + + full_name: Optional[str] = FieldInfo(alias="fullName", default=None) + + member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + role: Optional[Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"]] = ( + None + ) + + status: Optional[ + Literal["USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT"] + ] = None + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class MemberListResponse(BaseModel): + members: Optional[List[Member]] = None + """members are the members of the organization""" + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing members""" diff --git a/src/gitpod/types/personal_access_token_delete_params.py b/src/gitpod/types/personal_access_token_delete_params.py new file mode 100644 index 00000000..39d64414 --- /dev/null +++ b/src/gitpod/types/personal_access_token_delete_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PersonalAccessTokenDeleteParams"] + + +class PersonalAccessTokenDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + personal_access_token_id: Annotated[str, PropertyInfo(alias="personalAccessTokenId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/personal_access_token_list_params.py b/src/gitpod/types/personal_access_token_list_params.py new file mode 100644 index 00000000..9a5d90d1 --- /dev/null +++ b/src/gitpod/types/personal_access_token_list_params.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PersonalAccessTokenListParams", "Filter", "Pagination"] + + +class PersonalAccessTokenListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Filter + + pagination: Pagination + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Filter(TypedDict, total=False): + user_ids: Annotated[List[str], PropertyInfo(alias="userIds")] + """ + creator_ids filters the response to only Environments created by specified + members + """ + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/personal_access_token_list_response.py b/src/gitpod/types/personal_access_token_list_response.py new file mode 100644 index 00000000..e8e845d1 --- /dev/null +++ b/src/gitpod/types/personal_access_token_list_response.py @@ -0,0 +1,328 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["PersonalAccessTokenListResponse", "Pagination", "PersonalAccessToken", "PersonalAccessTokenCreator"] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class PersonalAccessTokenCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class PersonalAccessToken(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[PersonalAccessTokenCreator] = None + + description: Optional[str] = None + + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + last_used: Optional[datetime] = FieldInfo(alias="lastUsed", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + + +class PersonalAccessTokenListResponse(BaseModel): + pagination: Optional[Pagination] = None + + personal_access_tokens: Optional[List[PersonalAccessToken]] = FieldInfo(alias="personalAccessTokens", default=None) diff --git a/src/gitpod/types/project_create_from_environment_params.py b/src/gitpod/types/project_create_from_environment_params.py new file mode 100644 index 00000000..477cbbdc --- /dev/null +++ b/src/gitpod/types/project_create_from_environment_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ProjectCreateFromEnvironmentParams"] + + +class ProjectCreateFromEnvironmentParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environment_id specifies the environment identifier""" + + name: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py new file mode 100644 index 00000000..3bf6e1b3 --- /dev/null +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -0,0 +1,293 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ProjectCreateFromEnvironmentResponse", + "Project", + "ProjectInitializer", + "ProjectMetadata", + "ProjectMetadataCreator", + "ProjectUsedBy", + "ProjectUsedBySubject", +] + + +class ProjectInitializer(BaseModel): + specs: Optional[List[Union[object, object, object]]] = None + + +class ProjectMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ProjectMetadataCreator] = None + """creator is the identity of the project creator""" + + name: Optional[str] = None + """name is the human readable name of the project""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class ProjectUsedBySubject(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectUsedBy(BaseModel): + subjects: Optional[List[ProjectUsedBySubject]] = None + """ + Subjects are the 10 most recent subjects who have used the project to create an + environment + """ + + total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) + """Total number of unique subjects who have used the project""" + + +class Project(BaseModel): + environment_class: Union[object, object, object] = FieldInfo(alias="environmentClass") + + id: Optional[str] = None + """id is the unique identifier for the project""" + + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + initializer: Optional[ProjectInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + metadata: Optional[ProjectMetadata] = None + + used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) + + +class ProjectCreateFromEnvironmentResponse(BaseModel): + project: Optional[Project] = None diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py new file mode 100644 index 00000000..03fcad08 --- /dev/null +++ b/src/gitpod/types/project_create_params.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ProjectCreateParams", "Initializer"] + + +class ProjectCreateParams(TypedDict, total=False): + environment_class: Required[Annotated[Union[object, object, object], PropertyInfo(alias="environmentClass")]] + + initializer: Required[Initializer] + """EnvironmentInitializer specifies how an environment is to be initialized""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] + """ + automations_file_path is the path to the automations file relative to the repo + root + """ + + devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + name: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Initializer(TypedDict, total=False): + specs: Iterable[Union[object, object, object]] diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py new file mode 100644 index 00000000..97278748 --- /dev/null +++ b/src/gitpod/types/project_create_response.py @@ -0,0 +1,293 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ProjectCreateResponse", + "Project", + "ProjectInitializer", + "ProjectMetadata", + "ProjectMetadataCreator", + "ProjectUsedBy", + "ProjectUsedBySubject", +] + + +class ProjectInitializer(BaseModel): + specs: Optional[List[Union[object, object, object]]] = None + + +class ProjectMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ProjectMetadataCreator] = None + """creator is the identity of the project creator""" + + name: Optional[str] = None + """name is the human readable name of the project""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class ProjectUsedBySubject(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectUsedBy(BaseModel): + subjects: Optional[List[ProjectUsedBySubject]] = None + """ + Subjects are the 10 most recent subjects who have used the project to create an + environment + """ + + total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) + """Total number of unique subjects who have used the project""" + + +class Project(BaseModel): + environment_class: Union[object, object, object] = FieldInfo(alias="environmentClass") + + id: Optional[str] = None + """id is the unique identifier for the project""" + + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + initializer: Optional[ProjectInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + metadata: Optional[ProjectMetadata] = None + + used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) + + +class ProjectCreateResponse(BaseModel): + project: Optional[Project] = None diff --git a/src/gitpod/types/project_retrieve_params.py b/src/gitpod/types/project_retrieve_params.py new file mode 100644 index 00000000..9ebcf753 --- /dev/null +++ b/src/gitpod/types/project_retrieve_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ProjectRetrieveParams"] + + +class ProjectRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: str + + compression: str + + connect: str + + encoding: str + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py new file mode 100644 index 00000000..df9cb4a1 --- /dev/null +++ b/src/gitpod/types/project_retrieve_response.py @@ -0,0 +1,293 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ProjectRetrieveResponse", + "Project", + "ProjectInitializer", + "ProjectMetadata", + "ProjectMetadataCreator", + "ProjectUsedBy", + "ProjectUsedBySubject", +] + + +class ProjectInitializer(BaseModel): + specs: Optional[List[Union[object, object, object]]] = None + + +class ProjectMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ProjectMetadataCreator] = None + """creator is the identity of the project creator""" + + name: Optional[str] = None + """name is the human readable name of the project""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class ProjectUsedBySubject(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectUsedBy(BaseModel): + subjects: Optional[List[ProjectUsedBySubject]] = None + """ + Subjects are the 10 most recent subjects who have used the project to create an + environment + """ + + total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) + """Total number of unique subjects who have used the project""" + + +class Project(BaseModel): + environment_class: Union[object, object, object] = FieldInfo(alias="environmentClass") + + id: Optional[str] = None + """id is the unique identifier for the project""" + + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + initializer: Optional[ProjectInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + metadata: Optional[ProjectMetadata] = None + + used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) + + +class ProjectRetrieveResponse(BaseModel): + project: Optional[Project] = None diff --git a/src/gitpod/types/runner_check_authentication_for_host_params.py b/src/gitpod/types/runner_check_authentication_for_host_params.py new file mode 100644 index 00000000..67322e17 --- /dev/null +++ b/src/gitpod/types/runner_check_authentication_for_host_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerCheckAuthenticationForHostParams"] + + +class RunnerCheckAuthenticationForHostParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + host: str + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_check_authentication_for_host_response.py b/src/gitpod/types/runner_check_authentication_for_host_response.py new file mode 100644 index 00000000..38f8b973 --- /dev/null +++ b/src/gitpod/types/runner_check_authentication_for_host_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerCheckAuthenticationForHostResponse"] + + +class RunnerCheckAuthenticationForHostResponse(BaseModel): + authenticated: Optional[bool] = None + + authentication_url: Optional[str] = FieldInfo(alias="authenticationUrl", default=None) + + pat_supported: Optional[bool] = FieldInfo(alias="patSupported", default=None) diff --git a/src/gitpod/types/runner_configuration_validate_params.py b/src/gitpod/types/runner_configuration_validate_params.py new file mode 100644 index 00000000..5f440dce --- /dev/null +++ b/src/gitpod/types/runner_configuration_validate_params.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerConfigurationValidateParams", "Variant0", "Variant1", "Variant2"] + + +class Variant0(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +RunnerConfigurationValidateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/runner_configuration_validate_response.py b/src/gitpod/types/runner_configuration_validate_response.py new file mode 100644 index 00000000..040bb7f5 --- /dev/null +++ b/src/gitpod/types/runner_configuration_validate_response.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import TypeAlias + +__all__ = ["RunnerConfigurationValidateResponse"] + +RunnerConfigurationValidateResponse: TypeAlias = Union[object, object, object] diff --git a/src/gitpod/types/runner_configurations/__init__.py b/src/gitpod/types/runner_configurations/__init__.py new file mode 100644 index 00000000..bab7e5ce --- /dev/null +++ b/src/gitpod/types/runner_configurations/__init__.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams +from .scm_integration_create_params import ScmIntegrationCreateParams as ScmIntegrationCreateParams +from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse +from .environment_class_update_params import EnvironmentClassUpdateParams as EnvironmentClassUpdateParams +from .scm_integration_create_response import ScmIntegrationCreateResponse as ScmIntegrationCreateResponse +from .configuration_schema_create_params import ConfigurationSchemaCreateParams as ConfigurationSchemaCreateParams +from .configuration_schema_create_response import ConfigurationSchemaCreateResponse as ConfigurationSchemaCreateResponse +from .configuration_schema_retrieve_params import ConfigurationSchemaRetrieveParams as ConfigurationSchemaRetrieveParams +from .host_authentication_token_list_params import ( + HostAuthenticationTokenListParams as HostAuthenticationTokenListParams, +) +from .configuration_schema_retrieve_response import ( + ConfigurationSchemaRetrieveResponse as ConfigurationSchemaRetrieveResponse, +) +from .host_authentication_token_create_params import ( + HostAuthenticationTokenCreateParams as HostAuthenticationTokenCreateParams, +) +from .host_authentication_token_delete_params import ( + HostAuthenticationTokenDeleteParams as HostAuthenticationTokenDeleteParams, +) +from .host_authentication_token_list_response import ( + HostAuthenticationTokenListResponse as HostAuthenticationTokenListResponse, +) +from .host_authentication_token_update_params import ( + HostAuthenticationTokenUpdateParams as HostAuthenticationTokenUpdateParams, +) +from .host_authentication_token_create_response import ( + HostAuthenticationTokenCreateResponse as HostAuthenticationTokenCreateResponse, +) +from .host_authentication_token_retrieve_params import ( + HostAuthenticationTokenRetrieveParams as HostAuthenticationTokenRetrieveParams, +) +from .host_authentication_token_retrieve_response import ( + HostAuthenticationTokenRetrieveResponse as HostAuthenticationTokenRetrieveResponse, +) diff --git a/src/gitpod/types/runner_configurations/configuration_schema_create_params.py b/src/gitpod/types/runner_configurations/configuration_schema_create_params.py new file mode 100644 index 00000000..b8cb816d --- /dev/null +++ b/src/gitpod/types/runner_configurations/configuration_schema_create_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ConfigurationSchemaCreateParams"] + + +class ConfigurationSchemaCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/configuration_schema_create_response.py b/src/gitpod/types/runner_configurations/configuration_schema_create_response.py new file mode 100644 index 00000000..88c94cad --- /dev/null +++ b/src/gitpod/types/runner_configurations/configuration_schema_create_response.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["ConfigurationSchemaCreateResponse", "Schema", "SchemaScm", "SchemaScmOAuth", "SchemaScmPat"] + + +class SchemaScmOAuth(BaseModel): + callback_url: Optional[str] = FieldInfo(alias="callbackUrl", default=None) + """ + callback_url is the URL the OAuth app will redirect to after the user has + authenticated. + """ + + +class SchemaScmPat(BaseModel): + description: Optional[str] = None + """description is a human-readable description of the PAT.""" + + docs_link: Optional[str] = FieldInfo(alias="docsLink", default=None) + """ + docs_link is a link to the documentation on how to create a PAT for this SCM + system. + """ + + +class SchemaScm(BaseModel): + default_hosts: Optional[List[str]] = FieldInfo(alias="defaultHosts", default=None) + + name: Optional[str] = None + + oauth: Optional[SchemaScmOAuth] = None + + pat: Optional[SchemaScmPat] = None + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + + +class Schema(BaseModel): + environment_classes: Optional[List[Union[object, object, object, object, object, object]]] = FieldInfo( + alias="environmentClasses", default=None + ) + + runner_config: Optional[List[Union[object, object, object, object, object, object]]] = FieldInfo( + alias="runnerConfig", default=None + ) + + scm: Optional[List[SchemaScm]] = None + + version: Optional[str] = None + """The schema version""" + + +class ConfigurationSchemaCreateResponse(BaseModel): + schema_: Optional[Schema] = FieldInfo(alias="schema", default=None) diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py new file mode 100644 index 00000000..4ba5ac37 --- /dev/null +++ b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ConfigurationSchemaRetrieveParams"] + + +class ConfigurationSchemaRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: str + + compression: str + + connect: str + + encoding: str + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py new file mode 100644 index 00000000..03cdbf6a --- /dev/null +++ b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["ConfigurationSchemaRetrieveResponse", "Schema", "SchemaScm", "SchemaScmOAuth", "SchemaScmPat"] + + +class SchemaScmOAuth(BaseModel): + callback_url: Optional[str] = FieldInfo(alias="callbackUrl", default=None) + """ + callback_url is the URL the OAuth app will redirect to after the user has + authenticated. + """ + + +class SchemaScmPat(BaseModel): + description: Optional[str] = None + """description is a human-readable description of the PAT.""" + + docs_link: Optional[str] = FieldInfo(alias="docsLink", default=None) + """ + docs_link is a link to the documentation on how to create a PAT for this SCM + system. + """ + + +class SchemaScm(BaseModel): + default_hosts: Optional[List[str]] = FieldInfo(alias="defaultHosts", default=None) + + name: Optional[str] = None + + oauth: Optional[SchemaScmOAuth] = None + + pat: Optional[SchemaScmPat] = None + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + + +class Schema(BaseModel): + environment_classes: Optional[List[Union[object, object, object, object, object, object]]] = FieldInfo( + alias="environmentClasses", default=None + ) + + runner_config: Optional[List[Union[object, object, object, object, object, object]]] = FieldInfo( + alias="runnerConfig", default=None + ) + + scm: Optional[List[SchemaScm]] = None + + version: Optional[str] = None + """The schema version""" + + +class ConfigurationSchemaRetrieveResponse(BaseModel): + schema_: Optional[Schema] = FieldInfo(alias="schema", default=None) diff --git a/src/gitpod/types/runner_configurations/environment_class_list_params.py b/src/gitpod/types/runner_configurations/environment_class_list_params.py new file mode 100644 index 00000000..28f92ab7 --- /dev/null +++ b/src/gitpod/types/runner_configurations/environment_class_list_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["EnvironmentClassListParams", "Pagination"] + + +class EnvironmentClassListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Union[object, object] + + pagination: Pagination + """pagination contains the pagination options for listing environment classes""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runner_configurations/environment_class_list_response.py b/src/gitpod/types/runner_configurations/environment_class_list_response.py new file mode 100644 index 00000000..68e5d17f --- /dev/null +++ b/src/gitpod/types/runner_configurations/environment_class_list_response.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["EnvironmentClassListResponse", "EnvironmentClass", "EnvironmentClassConfiguration", "Pagination"] + + +class EnvironmentClassConfiguration(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class EnvironmentClass(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the environment class""" + + configuration: Optional[List[EnvironmentClassConfiguration]] = None + """configuration describes the configuration of the environment class""" + + description: Optional[str] = None + """description is a human readable description of the environment class""" + + display_name: Optional[str] = FieldInfo(alias="displayName", default=None) + """display_name is the human readable name of the environment class""" + + enabled: Optional[bool] = None + """ + enabled indicates whether the environment class can be used to create new + environments. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class EnvironmentClassListResponse(BaseModel): + environment_classes: Optional[List[EnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing environment classes""" diff --git a/src/gitpod/types/runner_configurations/environment_class_update_params.py b/src/gitpod/types/runner_configurations/environment_class_update_params.py new file mode 100644 index 00000000..b4d6d8a3 --- /dev/null +++ b/src/gitpod/types/runner_configurations/environment_class_update_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from ...types.runner_configurations import environment_class_update_params + +__all__ = ["EnvironmentClassUpdateParams"] + + +class EnvironmentClassUpdateParams(TypedDict, total=False): + body: Required[environment_class_update_params.Body] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py new file mode 100644 index 00000000..fb34ff72 --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["HostAuthenticationTokenCreateParams"] + + +class HostAuthenticationTokenCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py b/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py new file mode 100644 index 00000000..1ce9bac5 --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HostAuthenticationTokenCreateResponse", "Token"] + + +class Token(BaseModel): + id: Optional[str] = None + + host: Optional[str] = None + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + source: Optional[ + Literal[ + "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", + ] + ] = None + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + + +class HostAuthenticationTokenCreateResponse(BaseModel): + token: Optional[Token] = None diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py new file mode 100644 index 00000000..05eaa723 --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["HostAuthenticationTokenDeleteParams"] + + +class HostAuthenticationTokenDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py new file mode 100644 index 00000000..5c9c596a --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from ...types.runner_configurations import host_authentication_token_list_params + +__all__ = ["HostAuthenticationTokenListParams", "Pagination"] + + +class HostAuthenticationTokenListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: host_authentication_token_list_params.Filter + + pagination: Pagination + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py new file mode 100644 index 00000000..93f1b005 --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HostAuthenticationTokenListResponse", "Pagination", "Token"] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class Token(BaseModel): + id: Optional[str] = None + + host: Optional[str] = None + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + source: Optional[ + Literal[ + "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", + ] + ] = None + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + + +class HostAuthenticationTokenListResponse(BaseModel): + pagination: Optional[Pagination] = None + + tokens: Optional[List[Token]] = None diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py new file mode 100644 index 00000000..21eda2d1 --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["HostAuthenticationTokenRetrieveParams"] + + +class HostAuthenticationTokenRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: str + + compression: str + + connect: str + + encoding: str + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py new file mode 100644 index 00000000..cd4d8a29 --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HostAuthenticationTokenRetrieveResponse", "Token"] + + +class Token(BaseModel): + id: Optional[str] = None + + host: Optional[str] = None + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + source: Optional[ + Literal[ + "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", + ] + ] = None + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + + +class HostAuthenticationTokenRetrieveResponse(BaseModel): + token: Optional[Token] = None diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py new file mode 100644 index 00000000..adf4dd15 --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["HostAuthenticationTokenUpdateParams", "Variant0", "Variant1"] + + +class Variant0(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +HostAuthenticationTokenUpdateParams: TypeAlias = Union[Variant0, Variant1] diff --git a/src/gitpod/types/runner_configurations/scm_integration_create_params.py b/src/gitpod/types/runner_configurations/scm_integration_create_params.py new file mode 100644 index 00000000..456f8f76 --- /dev/null +++ b/src/gitpod/types/runner_configurations/scm_integration_create_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from ...types.runner_configurations import scm_integration_create_params + +__all__ = ["ScmIntegrationCreateParams"] + + +class ScmIntegrationCreateParams(TypedDict, total=False): + body: Required[scm_integration_create_params.Body] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/scm_integration_create_response.py b/src/gitpod/types/runner_configurations/scm_integration_create_response.py new file mode 100644 index 00000000..c2a3461f --- /dev/null +++ b/src/gitpod/types/runner_configurations/scm_integration_create_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["ScmIntegrationCreateResponse"] + + +class ScmIntegrationCreateResponse(BaseModel): + id: Optional[str] = None + """id is a uniquely generated identifier for the SCM integration""" diff --git a/src/gitpod/types/runner_create_params.py b/src/gitpod/types/runner_create_params.py new file mode 100644 index 00000000..6dfedea5 --- /dev/null +++ b/src/gitpod/types/runner_create_params.py @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerCreateParams", "Spec", "SpecConfiguration"] + + +class RunnerCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + kind: Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"] + """RunnerKind represents the kind of a runner""" + + name: str + """The runner name for humans""" + + spec: Spec + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class SpecConfiguration(TypedDict, total=False): + auto_update: Annotated[bool, PropertyInfo(alias="autoUpdate")] + """auto_update indicates whether the runner should automatically update itself.""" + + region: str + """ + Region to deploy the runner in, if applicable. This is mainly used for remote + runners, and is only a hint. The runner may be deployed in a different region. + See the runner's status for the actual region. + """ + + release_channel: Annotated[ + Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"], + PropertyInfo(alias="releaseChannel"), + ] + """The release channel the runner is on""" + + +class Spec(TypedDict, total=False): + configuration: SpecConfiguration + """The runner's configuration""" + + desired_phase: Annotated[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ], + PropertyInfo(alias="desiredPhase"), + ] + """RunnerPhase represents the phase a runner is in""" diff --git a/src/gitpod/types/runner_create_response.py b/src/gitpod/types/runner_create_response.py new file mode 100644 index 00000000..4888ede0 --- /dev/null +++ b/src/gitpod/types/runner_create_response.py @@ -0,0 +1,414 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "RunnerCreateResponse", + "Runner", + "RunnerCreator", + "RunnerSpec", + "RunnerSpecConfiguration", + "RunnerStatus", + "RunnerStatusAdditionalInfo", +] + + +class RunnerCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class RunnerSpecConfiguration(BaseModel): + auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) + """auto_update indicates whether the runner should automatically update itself.""" + + region: Optional[str] = None + """ + Region to deploy the runner in, if applicable. This is mainly used for remote + runners, and is only a hint. The runner may be deployed in a different region. + See the runner's status for the actual region. + """ + + release_channel: Optional[ + Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] + ] = FieldInfo(alias="releaseChannel", default=None) + """The release channel the runner is on""" + + +class RunnerSpec(BaseModel): + configuration: Optional[RunnerSpecConfiguration] = None + """The runner's configuration""" + + desired_phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """RunnerPhase represents the phase a runner is in""" + + +class RunnerStatusAdditionalInfo(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class RunnerStatus(BaseModel): + additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) + """additional_info contains additional information about the runner, e.g. + + a CloudFormation stack URL. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + + message: Optional[str] = None + """ + The runner's reported message which is shown to users. This message adds more + context to the runner's phase. + """ + + phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = None + """RunnerPhase represents the phase a runner is in""" + + region: Optional[str] = None + """region is the region the runner is running in, if applicable.""" + + system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + version: Optional[str] = None + + +class Runner(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[RunnerCreator] = None + """creator is the identity of the creator of the environment""" + + kind: Optional[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] = None + """RunnerKind represents the kind of a runner""" + + name: Optional[str] = None + """The runner's name which is shown to users""" + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + spec: Optional[RunnerSpec] = None + """The runner's specification""" + + status: Optional[RunnerStatus] = None + """RunnerStatus represents the status of a runner""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class RunnerCreateResponse(BaseModel): + access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) + + runner: Optional[Runner] = None diff --git a/src/gitpod/types/runner_create_runner_token_params.py b/src/gitpod/types/runner_create_runner_token_params.py new file mode 100644 index 00000000..da185a2c --- /dev/null +++ b/src/gitpod/types/runner_create_runner_token_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerCreateRunnerTokenParams"] + + +class RunnerCreateRunnerTokenParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_create_runner_token_response.py b/src/gitpod/types/runner_create_runner_token_response.py new file mode 100644 index 00000000..c74f5780 --- /dev/null +++ b/src/gitpod/types/runner_create_runner_token_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerCreateRunnerTokenResponse"] + + +class RunnerCreateRunnerTokenResponse(BaseModel): + access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) diff --git a/src/gitpod/types/runner_delete_runner_params.py b/src/gitpod/types/runner_delete_runner_params.py new file mode 100644 index 00000000..005bf36e --- /dev/null +++ b/src/gitpod/types/runner_delete_runner_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerDeleteRunnerParams"] + + +class RunnerDeleteRunnerParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + force: bool + """ + force indicates whether the runner should be deleted forcefully. When force + deleting a Runner, all Environments on the runner are also force deleted and + regular Runner lifecycle is not respected. Force deleting can result in data + loss. + """ + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_get_runner_params.py b/src/gitpod/types/runner_get_runner_params.py new file mode 100644 index 00000000..3079471c --- /dev/null +++ b/src/gitpod/types/runner_get_runner_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerGetRunnerParams"] + + +class RunnerGetRunnerParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_get_runner_response.py b/src/gitpod/types/runner_get_runner_response.py new file mode 100644 index 00000000..9598eb2b --- /dev/null +++ b/src/gitpod/types/runner_get_runner_response.py @@ -0,0 +1,412 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "RunnerGetRunnerResponse", + "Runner", + "RunnerCreator", + "RunnerSpec", + "RunnerSpecConfiguration", + "RunnerStatus", + "RunnerStatusAdditionalInfo", +] + + +class RunnerCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class RunnerSpecConfiguration(BaseModel): + auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) + """auto_update indicates whether the runner should automatically update itself.""" + + region: Optional[str] = None + """ + Region to deploy the runner in, if applicable. This is mainly used for remote + runners, and is only a hint. The runner may be deployed in a different region. + See the runner's status for the actual region. + """ + + release_channel: Optional[ + Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] + ] = FieldInfo(alias="releaseChannel", default=None) + """The release channel the runner is on""" + + +class RunnerSpec(BaseModel): + configuration: Optional[RunnerSpecConfiguration] = None + """The runner's configuration""" + + desired_phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """RunnerPhase represents the phase a runner is in""" + + +class RunnerStatusAdditionalInfo(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class RunnerStatus(BaseModel): + additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) + """additional_info contains additional information about the runner, e.g. + + a CloudFormation stack URL. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + + message: Optional[str] = None + """ + The runner's reported message which is shown to users. This message adds more + context to the runner's phase. + """ + + phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = None + """RunnerPhase represents the phase a runner is in""" + + region: Optional[str] = None + """region is the region the runner is running in, if applicable.""" + + system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + version: Optional[str] = None + + +class Runner(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[RunnerCreator] = None + """creator is the identity of the creator of the environment""" + + kind: Optional[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] = None + """RunnerKind represents the kind of a runner""" + + name: Optional[str] = None + """The runner's name which is shown to users""" + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + spec: Optional[RunnerSpec] = None + """The runner's specification""" + + status: Optional[RunnerStatus] = None + """RunnerStatus represents the status of a runner""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class RunnerGetRunnerResponse(BaseModel): + runner: Optional[Runner] = None diff --git a/src/gitpod/types/runner_interaction_get_host_authentication_token_value_params.py b/src/gitpod/types/runner_interaction_get_host_authentication_token_value_params.py new file mode 100644 index 00000000..e95c495c --- /dev/null +++ b/src/gitpod/types/runner_interaction_get_host_authentication_token_value_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerInteractionGetHostAuthenticationTokenValueParams"] + + +class RunnerInteractionGetHostAuthenticationTokenValueParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + host: str + """The host to get the authentication token for""" + + principal_id: Annotated[str, PropertyInfo(alias="principalId")] + """The principal's ID to get the authentication token for""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """The runner's identity""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py b/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py new file mode 100644 index 00000000..ad28e81c --- /dev/null +++ b/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerInteractionGetHostAuthenticationTokenValueResponse"] + + +class RunnerInteractionGetHostAuthenticationTokenValueResponse(BaseModel): + token_id: Optional[str] = FieldInfo(alias="tokenId", default=None) + """The host authentication token's ID""" + + value: Optional[str] = None + """ + The authentication token encrypted as NaCL anonymous sealed box using the + runner's public key. + """ diff --git a/src/gitpod/types/runner_interaction_get_latest_version_params.py b/src/gitpod/types/runner_interaction_get_latest_version_params.py new file mode 100644 index 00000000..cb8e8b39 --- /dev/null +++ b/src/gitpod/types/runner_interaction_get_latest_version_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerInteractionGetLatestVersionParams"] + + +class RunnerInteractionGetLatestVersionParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + current_version: Annotated[str, PropertyInfo(alias="currentVersion")] + """The current version of the runner""" + + infrastructure_version: Annotated[str, PropertyInfo(alias="infrastructureVersion")] + """The version of the infrastructure""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """The runner's identity""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_interaction_get_latest_version_response.py b/src/gitpod/types/runner_interaction_get_latest_version_response.py new file mode 100644 index 00000000..907917e0 --- /dev/null +++ b/src/gitpod/types/runner_interaction_get_latest_version_response.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerInteractionGetLatestVersionResponse"] + + +class RunnerInteractionGetLatestVersionResponse(BaseModel): + auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) + """auto-update indicates if the runner should be updated automatically""" + + gitpod_cli_download_url: Optional[str] = FieldInfo(alias="gitpodCliDownloadUrl", default=None) + """gitpod_cli_download_url is the URL to download the gitpod CLI""" + + runner_image: Optional[str] = FieldInfo(alias="runnerImage", default=None) + """The container image of the runner""" + + supervisor_download_url: Optional[str] = FieldInfo(alias="supervisorDownloadUrl", default=None) + """supervisor_download_url is the URL to download the supervisor""" + + version: Optional[str] = None + """The latest version of the runner""" diff --git a/src/gitpod/types/runner_interaction_list_runner_environment_classes_params.py b/src/gitpod/types/runner_interaction_list_runner_environment_classes_params.py new file mode 100644 index 00000000..7d26ea06 --- /dev/null +++ b/src/gitpod/types/runner_interaction_list_runner_environment_classes_params.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerInteractionListRunnerEnvironmentClassesParams", "Filter", "Pagination"] + + +class RunnerInteractionListRunnerEnvironmentClassesParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Filter + + pagination: Pagination + """pagination contains the pagination options for listing environment classes""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """The runner's identity""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Filter(TypedDict, total=False): + environment_class_ids: Annotated[List[str], PropertyInfo(alias="environmentClassIds")] + """ + environment_class_ids filters the response to only environment classes with + these IDs + """ + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runner_interaction_list_runner_environment_classes_response.py b/src/gitpod/types/runner_interaction_list_runner_environment_classes_response.py new file mode 100644 index 00000000..5a41a1fc --- /dev/null +++ b/src/gitpod/types/runner_interaction_list_runner_environment_classes_response.py @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "RunnerInteractionListRunnerEnvironmentClassesResponse", + "EnvironmentClass", + "EnvironmentClassConfiguration", + "Pagination", +] + + +class EnvironmentClassConfiguration(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class EnvironmentClass(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the environment class""" + + configuration: Optional[List[EnvironmentClassConfiguration]] = None + """configuration describes the configuration of the environment class""" + + description: Optional[str] = None + """description is a human readable description of the environment class""" + + display_name: Optional[str] = FieldInfo(alias="displayName", default=None) + """display_name is the human readable name of the environment class""" + + enabled: Optional[bool] = None + """ + enabled indicates whether the environment class can be used to create new + environments. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class RunnerInteractionListRunnerEnvironmentClassesResponse(BaseModel): + environment_classes: Optional[List[EnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) + """The environment classes configured for the runner""" + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing environment classes""" diff --git a/src/gitpod/types/runner_interaction_list_runner_scm_integrations_params.py b/src/gitpod/types/runner_interaction_list_runner_scm_integrations_params.py new file mode 100644 index 00000000..23eb2308 --- /dev/null +++ b/src/gitpod/types/runner_interaction_list_runner_scm_integrations_params.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerInteractionListRunnerScmIntegrationsParams", "Filter", "Pagination"] + + +class RunnerInteractionListRunnerScmIntegrationsParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Filter + + pagination: Pagination + """pagination contains the pagination options for listing SCM integrations""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """The runner's identity""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Filter(TypedDict, total=False): + scm_integration_ids: Annotated[List[str], PropertyInfo(alias="scmIntegrationIds")] + """ + environment_class_ids filters the response to only SCM integrations with these + IDs + """ + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py b/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py new file mode 100644 index 00000000..e6a747ab --- /dev/null +++ b/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerInteractionListRunnerScmIntegrationsResponse", "Pagination"] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class RunnerInteractionListRunnerScmIntegrationsResponse(BaseModel): + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing SCM integrations""" + + scm_integrations: Optional[List[Union[object, object]]] = FieldInfo(alias="scmIntegrations", default=None) + """The SCM integrations configured for the runner""" diff --git a/src/gitpod/types/runner_interaction_mark_active_params.py b/src/gitpod/types/runner_interaction_mark_active_params.py new file mode 100644 index 00000000..68ebd411 --- /dev/null +++ b/src/gitpod/types/runner_interaction_mark_active_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerInteractionMarkActiveParams"] + + +class RunnerInteractionMarkActiveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """The runner's identity""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_interaction_send_response_params.py b/src/gitpod/types/runner_interaction_send_response_params.py new file mode 100644 index 00000000..ea94fed1 --- /dev/null +++ b/src/gitpod/types/runner_interaction_send_response_params.py @@ -0,0 +1,81 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "RunnerInteractionSendResponseParams", + "Variant0", + "Variant1", + "Variant2", + "Variant3", + "Variant4", + "Variant5", +] + + +class Variant0(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant3(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant4(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant5(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +RunnerInteractionSendResponseParams: TypeAlias = Union[Variant0, Variant1, Variant2, Variant3, Variant4, Variant5] diff --git a/src/gitpod/types/runner_interaction_signup_params.py b/src/gitpod/types/runner_interaction_signup_params.py new file mode 100644 index 00000000..1efc7527 --- /dev/null +++ b/src/gitpod/types/runner_interaction_signup_params.py @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._types import Base64FileInput +from .._utils import PropertyInfo + +__all__ = ["RunnerInteractionSignupParams", "EnvironmentClass", "EnvironmentClassConfiguration"] + + +class RunnerInteractionSignupParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_classes: Annotated[Iterable[EnvironmentClass], PropertyInfo(alias="environmentClasses")] + """The environment classes this runner has to offer""" + + public_key: Annotated[Union[str, Base64FileInput], PropertyInfo(alias="publicKey", format="base64")] + """The runner's public key. + + Must be an ECDH public key encoded in PKIX, ASN.1 DER format. + """ + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class EnvironmentClassConfiguration(TypedDict, total=False): + key: str + + value: str + + +class EnvironmentClass(TypedDict, total=False): + id: str + """id is the unique identifier of the environment class""" + + configuration: Iterable[EnvironmentClassConfiguration] + """configuration describes the configuration of the environment class""" + + description: str + """description is a human readable description of the environment class""" + + display_name: Annotated[str, PropertyInfo(alias="displayName")] + """display_name is the human readable name of the environment class""" + + enabled: bool + """ + enabled indicates whether the environment class can be used to create new + environments. + """ + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ diff --git a/src/gitpod/types/runner_interaction_signup_response.py b/src/gitpod/types/runner_interaction_signup_response.py new file mode 100644 index 00000000..7a8ffc7d --- /dev/null +++ b/src/gitpod/types/runner_interaction_signup_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerInteractionSignupResponse"] + + +class RunnerInteractionSignupResponse(BaseModel): + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """The runner's identity""" diff --git a/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py b/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py new file mode 100644 index 00000000..fb803bea --- /dev/null +++ b/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py @@ -0,0 +1,76 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "RunnerInteractionUpdateRunnerConfigurationSchemaParams", + "ConfigSchema", + "ConfigSchemaScm", + "ConfigSchemaScmOAuth", + "ConfigSchemaScmPat", +] + + +class RunnerInteractionUpdateRunnerConfigurationSchemaParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + config_schema: Annotated[ConfigSchema, PropertyInfo(alias="configSchema")] + """config_schema is the schema for the runner's configuration""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """The runner's identity""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class ConfigSchemaScmOAuth(TypedDict, total=False): + callback_url: Annotated[str, PropertyInfo(alias="callbackUrl")] + """ + callback_url is the URL the OAuth app will redirect to after the user has + authenticated. + """ + + +class ConfigSchemaScmPat(TypedDict, total=False): + description: str + """description is a human-readable description of the PAT.""" + + docs_link: Annotated[str, PropertyInfo(alias="docsLink")] + """ + docs_link is a link to the documentation on how to create a PAT for this SCM + system. + """ + + +class ConfigSchemaScm(TypedDict, total=False): + default_hosts: Annotated[List[str], PropertyInfo(alias="defaultHosts")] + + name: str + + oauth: ConfigSchemaScmOAuth + + pat: ConfigSchemaScmPat + + scm_id: Annotated[str, PropertyInfo(alias="scmId")] + + +class ConfigSchema(TypedDict, total=False): + environment_classes: Annotated[ + Iterable[Union[object, object, object, object, object, object]], PropertyInfo(alias="environmentClasses") + ] + + runner_config: Annotated[ + Iterable[Union[object, object, object, object, object, object]], PropertyInfo(alias="runnerConfig") + ] + + scm: Iterable[ConfigSchemaScm] + + version: str + """The schema version""" diff --git a/src/gitpod/types/runner_interaction_update_status_params.py b/src/gitpod/types/runner_interaction_update_status_params.py new file mode 100644 index 00000000..ae3666c9 --- /dev/null +++ b/src/gitpod/types/runner_interaction_update_status_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..types import runner_interaction_update_status_params +from .._utils import PropertyInfo + +__all__ = ["RunnerInteractionUpdateStatusParams"] + + +class RunnerInteractionUpdateStatusParams(TypedDict, total=False): + body: Required[runner_interaction_update_status_params.Body] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_interactions/__init__.py b/src/gitpod/types/runner_interactions/__init__.py new file mode 100644 index 00000000..d8022bb2 --- /dev/null +++ b/src/gitpod/types/runner_interactions/__init__.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .environment_list_params import EnvironmentListParams as EnvironmentListParams +from .environment_list_response import EnvironmentListResponse as EnvironmentListResponse +from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams +from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse +from .environment_update_status_params import EnvironmentUpdateStatusParams as EnvironmentUpdateStatusParams diff --git a/src/gitpod/types/runner_interactions/environment_list_params.py b/src/gitpod/types/runner_interactions/environment_list_params.py new file mode 100644 index 00000000..504d854d --- /dev/null +++ b/src/gitpod/types/runner_interactions/environment_list_params.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["EnvironmentListParams", "Pagination"] + + +class EnvironmentListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """An optional list of environment IDs to fetch. + + If this list is empty/not provided all environments that ought to run on the + runner are returned. + """ + + pagination: Pagination + """pagination contains the pagination options for listing environments""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """The runner's identifier""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runner_interactions/environment_list_response.py b/src/gitpod/types/runner_interactions/environment_list_response.py new file mode 100644 index 00000000..f178ffc7 --- /dev/null +++ b/src/gitpod/types/runner_interactions/environment_list_response.py @@ -0,0 +1,389 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = [ + "EnvironmentListResponse", + "Environment", + "EnvironmentMetadata", + "EnvironmentMetadataCreator", + "EnvironmentSpec", + "EnvironmentSpecAutomationsFile", + "EnvironmentSpecContent", + "EnvironmentSpecContentInitializer", + "EnvironmentSpecDevcontainer", + "EnvironmentSpecMachine", + "EnvironmentSpecPort", + "EnvironmentSpecSSHPublicKey", + "EnvironmentSpecTimeout", + "Pagination", +] + + +class EnvironmentMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class EnvironmentMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[EnvironmentMetadataCreator] = None + """creator is the identity of the creator of the environment""" + + name: Optional[str] = None + """name is the name of the environment as specified by the user""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + """ + original_context_url is the normalized URL from which the environment was + created + """ + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """ + If the Environment was started from a project, the project_id will reference the + project. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """Runner is the ID of the runner that runs this environment.""" + + +class EnvironmentSpecAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. + """ + + session: Optional[str] = None + + +class EnvironmentSpecContentInitializer(BaseModel): + specs: Optional[List[Union[object, object, object]]] = None + + +class EnvironmentSpecContent(BaseModel): + git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) + """The Git email address""" + + git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) + """The Git username""" + + initializer: Optional[EnvironmentSpecContentInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: Optional[str] = None + + +class EnvironmentSpecDevcontainer(BaseModel): + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + session: Optional[str] = None + + +class EnvironmentSpecMachine(BaseModel): + class_: Optional[str] = FieldInfo(alias="class", default=None) + """Class denotes the class of the environment we ought to start""" + + session: Optional[str] = None + + +class EnvironmentSpecPort(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + name: Optional[str] = None + """name of this port""" + + port: Optional[int] = None + """port number""" + + +class EnvironmentSpecSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + value: Optional[str] = None + """value is the actual public key in the public key file format""" + + +class EnvironmentSpecTimeout(BaseModel): + disconnected: Optional[str] = None + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class EnvironmentSpec(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file is the automations file spec of the environment""" + + content: Optional[EnvironmentSpecContent] = None + """content is the content spec of the environment""" + + desired_phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """Phase is the desired phase of the environment""" + + devcontainer: Optional[EnvironmentSpecDevcontainer] = None + """devcontainer is the devcontainer spec of the environment""" + + machine: Optional[EnvironmentSpecMachine] = None + """machine is the machine spec of the environment""" + + ports: Optional[List[EnvironmentSpecPort]] = None + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Optional[List[Union[object, object, object, object]]] = None + """secrets are confidential data that is mounted into the environment""" + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: Optional[EnvironmentSpecTimeout] = None + """Timeout configures the environment timeout""" + + +class Environment(BaseModel): + id: Optional[str] = None + """ID is a unique identifier of this environment. + + No other environment with the same name must be managed by this environment + manager + """ + + environment_access_token: Optional[str] = FieldInfo(alias="environmentAccessToken", default=None) + """The environment's access token""" + + metadata: Optional[EnvironmentMetadata] = None + """ + EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function + """ + + spec: Optional[EnvironmentSpec] = None + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class EnvironmentListResponse(BaseModel): + environments: Optional[List[Environment]] = None + """The environments running on the runner""" + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/runner_interactions/environment_retrieve_params.py b/src/gitpod/types/runner_interactions/environment_retrieve_params.py new file mode 100644 index 00000000..a7bf9537 --- /dev/null +++ b/src/gitpod/types/runner_interactions/environment_retrieve_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["EnvironmentRetrieveParams"] + + +class EnvironmentRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """The environment's ID""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """The runner's identity""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_interactions/environment_retrieve_response.py b/src/gitpod/types/runner_interactions/environment_retrieve_response.py new file mode 100644 index 00000000..9294c99a --- /dev/null +++ b/src/gitpod/types/runner_interactions/environment_retrieve_response.py @@ -0,0 +1,376 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = [ + "EnvironmentRetrieveResponse", + "Environment", + "EnvironmentMetadata", + "EnvironmentMetadataCreator", + "EnvironmentSpec", + "EnvironmentSpecAutomationsFile", + "EnvironmentSpecContent", + "EnvironmentSpecContentInitializer", + "EnvironmentSpecDevcontainer", + "EnvironmentSpecMachine", + "EnvironmentSpecPort", + "EnvironmentSpecSSHPublicKey", + "EnvironmentSpecTimeout", +] + + +class EnvironmentMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class EnvironmentMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[EnvironmentMetadataCreator] = None + """creator is the identity of the creator of the environment""" + + name: Optional[str] = None + """name is the name of the environment as specified by the user""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + """ + original_context_url is the normalized URL from which the environment was + created + """ + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """ + If the Environment was started from a project, the project_id will reference the + project. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """Runner is the ID of the runner that runs this environment.""" + + +class EnvironmentSpecAutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. + """ + + session: Optional[str] = None + + +class EnvironmentSpecContentInitializer(BaseModel): + specs: Optional[List[Union[object, object, object]]] = None + + +class EnvironmentSpecContent(BaseModel): + git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) + """The Git email address""" + + git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) + """The Git username""" + + initializer: Optional[EnvironmentSpecContentInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: Optional[str] = None + + +class EnvironmentSpecDevcontainer(BaseModel): + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + session: Optional[str] = None + + +class EnvironmentSpecMachine(BaseModel): + class_: Optional[str] = FieldInfo(alias="class", default=None) + """Class denotes the class of the environment we ought to start""" + + session: Optional[str] = None + + +class EnvironmentSpecPort(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + name: Optional[str] = None + """name of this port""" + + port: Optional[int] = None + """port number""" + + +class EnvironmentSpecSSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + value: Optional[str] = None + """value is the actual public key in the public key file format""" + + +class EnvironmentSpecTimeout(BaseModel): + disconnected: Optional[str] = None + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class EnvironmentSpec(BaseModel): + admission: Optional[ + Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] + ] = None + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file is the automations file spec of the environment""" + + content: Optional[EnvironmentSpecContent] = None + """content is the content spec of the environment""" + + desired_phase: Optional[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """Phase is the desired phase of the environment""" + + devcontainer: Optional[EnvironmentSpecDevcontainer] = None + """devcontainer is the devcontainer spec of the environment""" + + machine: Optional[EnvironmentSpecMachine] = None + """machine is the machine spec of the environment""" + + ports: Optional[List[EnvironmentSpecPort]] = None + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Optional[List[Union[object, object, object, object]]] = None + """secrets are confidential data that is mounted into the environment""" + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: Optional[EnvironmentSpecTimeout] = None + """Timeout configures the environment timeout""" + + +class Environment(BaseModel): + id: Optional[str] = None + """ID is a unique identifier of this environment. + + No other environment with the same name must be managed by this environment + manager + """ + + environment_access_token: Optional[str] = FieldInfo(alias="environmentAccessToken", default=None) + """The environment's access token""" + + metadata: Optional[EnvironmentMetadata] = None + """ + EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function + """ + + spec: Optional[EnvironmentSpec] = None + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + + +class EnvironmentRetrieveResponse(BaseModel): + environment: Optional[Environment] = None diff --git a/src/gitpod/types/runner_interactions/environment_update_status_params.py b/src/gitpod/types/runner_interactions/environment_update_status_params.py new file mode 100644 index 00000000..012c7c03 --- /dev/null +++ b/src/gitpod/types/runner_interactions/environment_update_status_params.py @@ -0,0 +1,415 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = [ + "EnvironmentUpdateStatusParams", + "Status", + "StatusAutomationsFile", + "StatusContent", + "StatusContentGit", + "StatusContentGitChangedFile", + "StatusDevcontainer", + "StatusEnvironmentURLs", + "StatusEnvironmentURLsPort", + "StatusEnvironmentURLsSSH", + "StatusMachine", + "StatusMachineVersions", + "StatusRunnerAck", + "StatusSecret", + "StatusSSHPublicKey", +] + + +class EnvironmentUpdateStatusParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """The environment's ID""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """The runner's identity""" + + status: Status + """EnvironmentStatus describes an environment status""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class StatusAutomationsFile(TypedDict, total=False): + automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] + """ + automations_file_path is the path to the automations file relative to the repo + root. + """ + + automations_file_presence: Annotated[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"], + PropertyInfo(alias="automationsFilePresence"), + ] + """ + automations_file_presence indicates how an automations file is present in the + environment. + """ + + failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] + """ + failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. + """ + + phase: Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + """phase is the current phase of the automations file.""" + + session: str + """ + session is the automations file session that is currently applied in the + environment. + """ + + +class StatusContentGitChangedFile(TypedDict, total=False): + change_type: Annotated[ + Literal[ + "CHANGE_TYPE_UNSPECIFIED", + "CHANGE_TYPE_ADDED", + "CHANGE_TYPE_MODIFIED", + "CHANGE_TYPE_DELETED", + "CHANGE_TYPE_RENAMED", + "CHANGE_TYPE_COPIED", + "CHANGE_TYPE_UPDATED_BUT_UNMERGED", + "CHANGE_TYPE_UNTRACKED", + ], + PropertyInfo(alias="changeType"), + ] + """ChangeType is the type of change that happened to the file""" + + path: str + """path is the path of the file""" + + +class StatusContentGit(TypedDict, total=False): + branch: str + """branch is branch we're currently on""" + + changed_files: Annotated[Iterable[StatusContentGitChangedFile], PropertyInfo(alias="changedFiles")] + """ + changed_files is an array of changed files in the environment, possibly + truncated + """ + + clone_url: Annotated[str, PropertyInfo(alias="cloneUrl")] + """ + clone_url is the repository url as you would pass it to "git clone". Only HTTPS + clone URLs are supported. + """ + + latest_commit: Annotated[str, PropertyInfo(alias="latestCommit")] + """latest_commit is the most recent commit on the current branch""" + + total_changed_files: Annotated[int, PropertyInfo(alias="totalChangedFiles")] + + total_unpushed_commits: Annotated[int, PropertyInfo(alias="totalUnpushedCommits")] + """the total number of unpushed changes""" + + unpushed_commits: Annotated[List[str], PropertyInfo(alias="unpushedCommits")] + """ + unpushed_commits is an array of unpushed changes in the environment, possibly + truncated + """ + + +class StatusContent(TypedDict, total=False): + content_location_in_machine: Annotated[str, PropertyInfo(alias="contentLocationInMachine")] + """content_location_in_machine is the location of the content in the machine""" + + failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] + """failure_message contains the reason the content initialization failed.""" + + git: StatusContentGit + """ + git is the Git working copy status of the environment. Note: this is a + best-effort field and more often than not will not be present. Its absence does + not indicate the absence of a working copy. + """ + + phase: Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + """phase is the current phase of the environment content""" + + session: str + """session is the session that is currently active in the environment.""" + + warning_message: Annotated[str, PropertyInfo(alias="warningMessage")] + """warning_message contains warnings, e.g. + + when the content is present but not in the expected state. + """ + + +class StatusDevcontainer(TypedDict, total=False): + container_id: Annotated[str, PropertyInfo(alias="containerId")] + """container_id is the ID of the container.""" + + container_name: Annotated[str, PropertyInfo(alias="containerName")] + """ + container_name is the name of the container that is used to connect to the + devcontainer + """ + + devcontainerconfig_in_sync: Annotated[bool, PropertyInfo(alias="devcontainerconfigInSync")] + """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. + + the devcontainer config file. + """ + + devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + devcontainer_file_presence: Annotated[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"], + PropertyInfo(alias="devcontainerFilePresence"), + ] + """ + devcontainer_file_presence indicates how the devcontainer file is present in the + repo. + """ + + failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] + """failure_message contains the reason the devcontainer failed to operate.""" + + phase: Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] + """phase is the current phase of the devcontainer""" + + remote_user: Annotated[str, PropertyInfo(alias="remoteUser")] + """remote_user is the user that is used to connect to the devcontainer""" + + remote_workspace_folder: Annotated[str, PropertyInfo(alias="remoteWorkspaceFolder")] + """ + remote_workspace_folder is the folder that is used to connect to the + devcontainer + """ + + secrets_in_sync: Annotated[bool, PropertyInfo(alias="secretsInSync")] + """secrets_in_sync indicates if the secrets are up to date w.r.t. + + the running devcontainer. + """ + + session: str + """session is the session that is currently active in the devcontainer.""" + + warning_message: Annotated[str, PropertyInfo(alias="warningMessage")] + """warning_message contains warnings, e.g. + + when the devcontainer is present but not in the expected state. + """ + + +class StatusEnvironmentURLsPort(TypedDict, total=False): + port: int + """port is the port number of the environment port""" + + url: str + """url is the URL at which the environment port can be accessed""" + + +class StatusEnvironmentURLsSSH(TypedDict, total=False): + url: str + + +class StatusEnvironmentURLs(TypedDict, total=False): + logs: str + """logs is the URL at which the environment logs can be accessed.""" + + ports: Iterable[StatusEnvironmentURLsPort] + + ssh: StatusEnvironmentURLsSSH + """SSH is the URL at which the environment can be accessed via SSH.""" + + +class StatusMachineVersions(TypedDict, total=False): + supervisor_commit: Annotated[str, PropertyInfo(alias="supervisorCommit")] + + supervisor_version: Annotated[str, PropertyInfo(alias="supervisorVersion")] + + +class StatusMachine(TypedDict, total=False): + failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] + """failure_message contains the reason the machine failed to operate.""" + + phase: Literal[ + "PHASE_UNSPECIFIED", + "PHASE_CREATING", + "PHASE_STARTING", + "PHASE_RUNNING", + "PHASE_STOPPING", + "PHASE_STOPPED", + "PHASE_DELETING", + "PHASE_DELETED", + ] + """phase is the current phase of the environment machine""" + + session: str + """session is the session that is currently active in the machine.""" + + timeout: str + """timeout contains the reason the environment has timed out. + + If this field is empty, the environment has not timed out. + """ + + versions: StatusMachineVersions + """versions contains the versions of components in the machine.""" + + warning_message: Annotated[str, PropertyInfo(alias="warningMessage")] + """warning_message contains warnings, e.g. + + when the machine is present but not in the expected state. + """ + + +class StatusRunnerAck(TypedDict, total=False): + message: str + + spec_version: Annotated[Union[str, float], PropertyInfo(alias="specVersion")] + + status_code: Annotated[ + Literal[ + "STATUS_CODE_UNSPECIFIED", + "STATUS_CODE_OK", + "STATUS_CODE_INVALID_RESOURCE", + "STATUS_CODE_FAILED_PRECONDITION", + ], + PropertyInfo(alias="statusCode"), + ] + + +class StatusSecret(TypedDict, total=False): + failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] + """failure_message contains the reason the secret failed to be materialize.""" + + phase: Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + + secret_name: Annotated[str, PropertyInfo(alias="secretName")] + + warning_message: Annotated[str, PropertyInfo(alias="warningMessage")] + """warning_message contains warnings, e.g. + + when the secret is present but not in the expected state. + """ + + +class StatusSSHPublicKey(TypedDict, total=False): + id: str + """id is the unique identifier of the public key""" + + phase: Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + """phase is the current phase of the public key""" + + +class Status(TypedDict, total=False): + automations_file: Annotated[StatusAutomationsFile, PropertyInfo(alias="automationsFile")] + """automations_file contains the status of the automations file.""" + + content: StatusContent + """content contains the status of the environment content.""" + + devcontainer: StatusDevcontainer + """devcontainer contains the status of the devcontainer.""" + + environment_urls: Annotated[StatusEnvironmentURLs, PropertyInfo(alias="environmentUrls")] + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. + """ + + failure_message: Annotated[List[str], PropertyInfo(alias="failureMessage")] + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + machine: StatusMachine + """machine contains the status of the environment machine""" + + phase: Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + """ + the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + runner_ack: Annotated[StatusRunnerAck, PropertyInfo(alias="runnerAck")] + """ + RunnerACK is the acknowledgement from the runner that is has received the + environment spec. + """ + + secrets: Iterable[StatusSecret] + """secrets contains the status of the environment secrets""" + + ssh_public_keys: Annotated[Iterable[StatusSSHPublicKey], PropertyInfo(alias="sshPublicKeys")] + """ssh_public_keys contains the status of the environment ssh public keys""" + + status_version: Annotated[Union[str, float], PropertyInfo(alias="statusVersion")] + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + warning_message: Annotated[List[str], PropertyInfo(alias="warningMessage")] + """warning_message contains warnings, e.g. + + when the environment is present but not in the expected state. + """ diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py new file mode 100644 index 00000000..e6dbbb38 --- /dev/null +++ b/src/gitpod/types/runner_list_params.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerListParams", "Filter", "Pagination"] + + +class RunnerListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Filter + + pagination: Pagination + """pagination contains the pagination options for listing runners""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Filter(TypedDict, total=False): + creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] + """creator_ids filters the response to only runner created by specified users""" + + kinds: List[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] + """kinds filters the response to only runners of the specified kinds""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runner_list_response.py b/src/gitpod/types/runner_list_response.py new file mode 100644 index 00000000..09f823d4 --- /dev/null +++ b/src/gitpod/types/runner_list_response.py @@ -0,0 +1,425 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "RunnerListResponse", + "Pagination", + "Runner", + "RunnerCreator", + "RunnerSpec", + "RunnerSpecConfiguration", + "RunnerStatus", + "RunnerStatusAdditionalInfo", +] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class RunnerCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class RunnerSpecConfiguration(BaseModel): + auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) + """auto_update indicates whether the runner should automatically update itself.""" + + region: Optional[str] = None + """ + Region to deploy the runner in, if applicable. This is mainly used for remote + runners, and is only a hint. The runner may be deployed in a different region. + See the runner's status for the actual region. + """ + + release_channel: Optional[ + Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] + ] = FieldInfo(alias="releaseChannel", default=None) + """The release channel the runner is on""" + + +class RunnerSpec(BaseModel): + configuration: Optional[RunnerSpecConfiguration] = None + """The runner's configuration""" + + desired_phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """RunnerPhase represents the phase a runner is in""" + + +class RunnerStatusAdditionalInfo(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class RunnerStatus(BaseModel): + additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) + """additional_info contains additional information about the runner, e.g. + + a CloudFormation stack URL. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + + message: Optional[str] = None + """ + The runner's reported message which is shown to users. This message adds more + context to the runner's phase. + """ + + phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = None + """RunnerPhase represents the phase a runner is in""" + + region: Optional[str] = None + """region is the region the runner is running in, if applicable.""" + + system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + version: Optional[str] = None + + +class Runner(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[RunnerCreator] = None + """creator is the identity of the creator of the environment""" + + kind: Optional[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] = None + """RunnerKind represents the kind of a runner""" + + name: Optional[str] = None + """The runner's name which is shown to users""" + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + spec: Optional[RunnerSpec] = None + """The runner's specification""" + + status: Optional[RunnerStatus] = None + """RunnerStatus represents the status of a runner""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class RunnerListResponse(BaseModel): + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing runners""" + + runners: Optional[List[Runner]] = None + """The runners registered in the scope""" diff --git a/src/gitpod/types/runner_parse_context_url_params.py b/src/gitpod/types/runner_parse_context_url_params.py new file mode 100644 index 00000000..c131a243 --- /dev/null +++ b/src/gitpod/types/runner_parse_context_url_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerParseContextURLParams"] + + +class RunnerParseContextURLParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + context_url: Annotated[str, PropertyInfo(alias="contextUrl")] + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_parse_context_url_response.py b/src/gitpod/types/runner_parse_context_url_response.py new file mode 100644 index 00000000..f51e857a --- /dev/null +++ b/src/gitpod/types/runner_parse_context_url_response.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerParseContextURLResponse", "Git"] + + +class Git(BaseModel): + branch: Optional[str] = None + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + + commit: Optional[str] = None + + host: Optional[str] = None + + owner: Optional[str] = None + + repo: Optional[str] = None + + upstream_remote_url: Optional[str] = FieldInfo(alias="upstreamRemoteUrl", default=None) + + +class RunnerParseContextURLResponse(BaseModel): + git: Optional[Git] = None + + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) diff --git a/src/gitpod/types/runner_retrieve_params.py b/src/gitpod/types/runner_retrieve_params.py new file mode 100644 index 00000000..b748bd50 --- /dev/null +++ b/src/gitpod/types/runner_retrieve_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerRetrieveParams"] + + +class RunnerRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: str + + compression: str + + connect: str + + encoding: str + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_retrieve_response.py b/src/gitpod/types/runner_retrieve_response.py new file mode 100644 index 00000000..3f3c18b7 --- /dev/null +++ b/src/gitpod/types/runner_retrieve_response.py @@ -0,0 +1,412 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "RunnerRetrieveResponse", + "Runner", + "RunnerCreator", + "RunnerSpec", + "RunnerSpecConfiguration", + "RunnerStatus", + "RunnerStatusAdditionalInfo", +] + + +class RunnerCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class RunnerSpecConfiguration(BaseModel): + auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) + """auto_update indicates whether the runner should automatically update itself.""" + + region: Optional[str] = None + """ + Region to deploy the runner in, if applicable. This is mainly used for remote + runners, and is only a hint. The runner may be deployed in a different region. + See the runner's status for the actual region. + """ + + release_channel: Optional[ + Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] + ] = FieldInfo(alias="releaseChannel", default=None) + """The release channel the runner is on""" + + +class RunnerSpec(BaseModel): + configuration: Optional[RunnerSpecConfiguration] = None + """The runner's configuration""" + + desired_phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """RunnerPhase represents the phase a runner is in""" + + +class RunnerStatusAdditionalInfo(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class RunnerStatus(BaseModel): + additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) + """additional_info contains additional information about the runner, e.g. + + a CloudFormation stack URL. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + + message: Optional[str] = None + """ + The runner's reported message which is shown to users. This message adds more + context to the runner's phase. + """ + + phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = None + """RunnerPhase represents the phase a runner is in""" + + region: Optional[str] = None + """region is the region the runner is running in, if applicable.""" + + system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + version: Optional[str] = None + + +class Runner(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[RunnerCreator] = None + """creator is the identity of the creator of the environment""" + + kind: Optional[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] = None + """RunnerKind represents the kind of a runner""" + + name: Optional[str] = None + """The runner's name which is shown to users""" + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + spec: Optional[RunnerSpec] = None + """The runner's specification""" + + status: Optional[RunnerStatus] = None + """RunnerStatus represents the status of a runner""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class RunnerRetrieveResponse(BaseModel): + runner: Optional[Runner] = None diff --git a/src/gitpod/types/runner_update_runner_params.py b/src/gitpod/types/runner_update_runner_params.py new file mode 100644 index 00000000..cafdbece --- /dev/null +++ b/src/gitpod/types/runner_update_runner_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..types import runner_update_runner_params +from .._utils import PropertyInfo + +__all__ = ["RunnerUpdateRunnerParams"] + + +class RunnerUpdateRunnerParams(TypedDict, total=False): + body: Required[runner_update_runner_params.Body] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/__init__.py b/src/gitpod/types/runners/__init__.py new file mode 100644 index 00000000..19b3cdb8 --- /dev/null +++ b/src/gitpod/types/runners/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .policy_list_params import PolicyListParams as PolicyListParams +from .policy_list_response import PolicyListResponse as PolicyListResponse diff --git a/src/gitpod/types/runners/policy_list_params.py b/src/gitpod/types/runners/policy_list_params.py new file mode 100644 index 00000000..f6945b88 --- /dev/null +++ b/src/gitpod/types/runners/policy_list_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PolicyListParams", "Pagination"] + + +class PolicyListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + pagination: Pagination + """pagination contains the pagination options for listing project policies""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """runner_id specifies the project identifier""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runners/policy_list_response.py b/src/gitpod/types/runners/policy_list_response.py new file mode 100644 index 00000000..730960cb --- /dev/null +++ b/src/gitpod/types/runners/policy_list_response.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["PolicyListResponse", "Pagination", "Policy"] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class Policy(BaseModel): + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + + role: Optional[Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"]] = None + """role is the role assigned to the group""" + + +class PolicyListResponse(BaseModel): + pagination: Optional[Pagination] = None + + policies: Optional[List[Policy]] = None diff --git a/src/gitpod/types/service_delete_params.py b/src/gitpod/types/service_delete_params.py new file mode 100644 index 00000000..274244b4 --- /dev/null +++ b/src/gitpod/types/service_delete_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ServiceDeleteParams"] + + +class ServiceDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + force: bool + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/service_list_create_params.py b/src/gitpod/types/service_list_create_params.py new file mode 100644 index 00000000..1a5eb592 --- /dev/null +++ b/src/gitpod/types/service_list_create_params.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ServiceListCreateParams", "Filter", "Pagination"] + + +class ServiceListCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Filter + """filter contains the filter options for listing services""" + + pagination: Pagination + """pagination contains the pagination options for listing environments""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only services of these environments""" + + references: List[str] + """references filters the response to only services with these references""" + + service_ids: Annotated[List[str], PropertyInfo(alias="serviceIds")] + """service_ids filters the response to only services with these IDs""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/service_list_create_response.py b/src/gitpod/types/service_list_create_response.py new file mode 100644 index 00000000..81bfb8ce --- /dev/null +++ b/src/gitpod/types/service_list_create_response.py @@ -0,0 +1,291 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ServiceListCreateResponse", + "Pagination", + "Service", + "ServiceMetadata", + "ServiceMetadataCreator", + "ServiceSpec", + "ServiceSpecCommands", + "ServiceStatus", +] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class ServiceMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ServiceMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ServiceMetadataCreator] = None + """creator describes the principal who created the service.""" + + description: Optional[str] = None + """description is a user-facing description for the service. + + It can be used to provide context and documentation for the service. + """ + + name: Optional[str] = None + """name is a user-facing name for the service. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the service. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the service which must be unique on + the environment. It is used to express dependencies between services, and to + identify the service in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the service.""" + + +class ServiceSpecCommands(BaseModel): + ready: Optional[str] = None + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. + """ + + start: Optional[str] = None + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: Optional[str] = None + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. + """ + + +class ServiceSpec(BaseModel): + commands: Optional[ServiceSpecCommands] = None + """ + commands contains the commands to start, stop and check the readiness of the + service + """ + + desired_phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """Phase is the desired phase of the environment""" + + session: Optional[str] = None + """session should be changed to trigger a restart of the service. + + If a service exits it will not be restarted until the session is changed. + """ + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + +class ServiceStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. + """ + + phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = None + """ + the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + session: Optional[str] = None + """session is the current session of the service.""" + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + +class Service(BaseModel): + id: Optional[str] = None + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[ServiceMetadata] = None + + spec: Optional[ServiceSpec] = None + + status: Optional[ServiceStatus] = None + + +class ServiceListCreateResponse(BaseModel): + pagination: Optional[Pagination] = None + + services: Optional[List[Service]] = None diff --git a/src/gitpod/types/service_list_params.py b/src/gitpod/types/service_list_params.py new file mode 100644 index 00000000..619baec5 --- /dev/null +++ b/src/gitpod/types/service_list_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ServiceListParams"] + + +class ServiceListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: str + + compression: str + + connect: str + + encoding: str + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/service_list_response.py b/src/gitpod/types/service_list_response.py new file mode 100644 index 00000000..42506210 --- /dev/null +++ b/src/gitpod/types/service_list_response.py @@ -0,0 +1,291 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ServiceListResponse", + "Pagination", + "Service", + "ServiceMetadata", + "ServiceMetadataCreator", + "ServiceSpec", + "ServiceSpecCommands", + "ServiceStatus", +] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class ServiceMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ServiceMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ServiceMetadataCreator] = None + """creator describes the principal who created the service.""" + + description: Optional[str] = None + """description is a user-facing description for the service. + + It can be used to provide context and documentation for the service. + """ + + name: Optional[str] = None + """name is a user-facing name for the service. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the service. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the service which must be unique on + the environment. It is used to express dependencies between services, and to + identify the service in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the service.""" + + +class ServiceSpecCommands(BaseModel): + ready: Optional[str] = None + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. + """ + + start: Optional[str] = None + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: Optional[str] = None + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. + """ + + +class ServiceSpec(BaseModel): + commands: Optional[ServiceSpecCommands] = None + """ + commands contains the commands to start, stop and check the readiness of the + service + """ + + desired_phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """Phase is the desired phase of the environment""" + + session: Optional[str] = None + """session should be changed to trigger a restart of the service. + + If a service exits it will not be restarted until the session is changed. + """ + + spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + +class ServiceStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. + """ + + phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = None + """ + the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + session: Optional[str] = None + """session is the current session of the service.""" + + status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their statuus has + different versions. The value of this field has no semantic meaning (e.g. don't + interpret it as as a timestemp), but it can be used to impose a partial order. + If a.status_version < b.status_version then a was the status before b. + """ + + +class Service(BaseModel): + id: Optional[str] = None + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[ServiceMetadata] = None + + spec: Optional[ServiceSpec] = None + + status: Optional[ServiceStatus] = None + + +class ServiceListResponse(BaseModel): + pagination: Optional[Pagination] = None + + services: Optional[List[Service]] = None diff --git a/src/gitpod/types/service_start_params.py b/src/gitpod/types/service_start_params.py new file mode 100644 index 00000000..c552b27d --- /dev/null +++ b/src/gitpod/types/service_start_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ServiceStartParams"] + + +class ServiceStartParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/service_stop_params.py b/src/gitpod/types/service_stop_params.py new file mode 100644 index 00000000..d69f3cdb --- /dev/null +++ b/src/gitpod/types/service_stop_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ServiceStopParams"] + + +class ServiceStopParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/service_update_params.py b/src/gitpod/types/service_update_params.py new file mode 100644 index 00000000..e56003e7 --- /dev/null +++ b/src/gitpod/types/service_update_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..types import service_update_params +from .._utils import PropertyInfo + +__all__ = ["ServiceUpdateParams"] + + +class ServiceUpdateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + metadata: service_update_params.Metadata + + spec: Union[object, object] + """Changing the spec of a service is a complex operation. + + The spec of a service can only be updated if the service is in a stopped state. + If the service is running, it must be stopped first. + """ + + status: service_update_params.Status + """Service status updates are only expected from the executing environment. + + As a client of this API you are not expected to provide this field. Updating + this field requires the `environmentservice:update_status` permission. + """ + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/task_create_params.py b/src/gitpod/types/task_create_params.py new file mode 100644 index 00000000..5911ed60 --- /dev/null +++ b/src/gitpod/types/task_create_params.py @@ -0,0 +1,167 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Iterable +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["TaskCreateParams", "Metadata", "MetadataCreator", "Spec"] + + +class TaskCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + + metadata: Metadata + + spec: Spec + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class MetadataCreator(TypedDict, total=False): + id: str + """id is the UUID of the subject""" + + principal: Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + """Principal is the principal of the subject""" + + +class Metadata(TypedDict, total=False): + created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: MetadataCreator + """creator describes the principal who created the task.""" + + description: str + """description is a user-facing description for the task. + + It can be used to provide context and documentation for the task. + """ + + name: str + """name is a user-facing name for the task. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the task. + """ + + reference: str + """ + reference is a user-facing identifier for the task which must be unique on the + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). + """ + + triggered_by: Annotated[Iterable[Union[object, object, object, object]], PropertyInfo(alias="triggeredBy")] + """triggered_by is a list of trigger that start the task.""" + + +class Spec(TypedDict, total=False): + command: str + """command contains the command the task should execute""" diff --git a/src/gitpod/types/task_create_response.py b/src/gitpod/types/task_create_response.py new file mode 100644 index 00000000..3bdbef53 --- /dev/null +++ b/src/gitpod/types/task_create_response.py @@ -0,0 +1,170 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["TaskCreateResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] + + +class TaskMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskMetadataCreator] = None + """creator describes the principal who created the task.""" + + description: Optional[str] = None + """description is a user-facing description for the task. + + It can be used to provide context and documentation for the task. + """ + + name: Optional[str] = None + """name is a user-facing name for the task. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the task. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the task which must be unique on the + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the task.""" + + +class TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + +class Task(BaseModel): + id: Optional[str] = None + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + """dependencies specifies the IDs of the automations this task depends on.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[TaskMetadata] = None + + spec: Optional[TaskSpec] = None + + +class TaskCreateResponse(BaseModel): + task: Optional[Task] = None diff --git a/src/gitpod/types/task_retrieve_create_params.py b/src/gitpod/types/task_retrieve_create_params.py new file mode 100644 index 00000000..9171f208 --- /dev/null +++ b/src/gitpod/types/task_retrieve_create_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["TaskRetrieveCreateParams"] + + +class TaskRetrieveCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/task_retrieve_create_response.py b/src/gitpod/types/task_retrieve_create_response.py new file mode 100644 index 00000000..4a6599fe --- /dev/null +++ b/src/gitpod/types/task_retrieve_create_response.py @@ -0,0 +1,170 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["TaskRetrieveCreateResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] + + +class TaskMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskMetadataCreator] = None + """creator describes the principal who created the task.""" + + description: Optional[str] = None + """description is a user-facing description for the task. + + It can be used to provide context and documentation for the task. + """ + + name: Optional[str] = None + """name is a user-facing name for the task. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the task. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the task which must be unique on the + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the task.""" + + +class TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + +class Task(BaseModel): + id: Optional[str] = None + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + """dependencies specifies the IDs of the automations this task depends on.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[TaskMetadata] = None + + spec: Optional[TaskSpec] = None + + +class TaskRetrieveCreateResponse(BaseModel): + task: Optional[Task] = None diff --git a/src/gitpod/types/task_retrieve_params.py b/src/gitpod/types/task_retrieve_params.py new file mode 100644 index 00000000..7c5553ed --- /dev/null +++ b/src/gitpod/types/task_retrieve_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["TaskRetrieveParams"] + + +class TaskRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: str + + compression: str + + connect: str + + encoding: str + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/task_retrieve_response.py b/src/gitpod/types/task_retrieve_response.py new file mode 100644 index 00000000..9ce93799 --- /dev/null +++ b/src/gitpod/types/task_retrieve_response.py @@ -0,0 +1,170 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["TaskRetrieveResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] + + +class TaskMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskMetadataCreator] = None + """creator describes the principal who created the task.""" + + description: Optional[str] = None + """description is a user-facing description for the task. + + It can be used to provide context and documentation for the task. + """ + + name: Optional[str] = None + """name is a user-facing name for the task. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the task. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the task which must be unique on the + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the task.""" + + +class TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + +class Task(BaseModel): + id: Optional[str] = None + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + """dependencies specifies the IDs of the automations this task depends on.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[TaskMetadata] = None + + spec: Optional[TaskSpec] = None + + +class TaskRetrieveResponse(BaseModel): + task: Optional[Task] = None diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/__init__.py b/tests/api_resources/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/environment_automations/__init__.py b/tests/api_resources/environment_automations/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/environment_automations/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/environment_automations/test_task_executions.py b/tests/api_resources/environment_automations/test_task_executions.py new file mode 100644 index 00000000..6bf94ee1 --- /dev/null +++ b/tests/api_resources/environment_automations/test_task_executions.py @@ -0,0 +1,485 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.environment_automations import ( + TaskExecutionListResponse, + TaskExecutionRetrieveResponse, + TaskExecutionCreateListResponse, + TaskExecutionCreateRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTaskExecutions: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.environment_automations.task_executions.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.environment_automations.task_executions.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.list( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.list( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.environment_automations.task_executions.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.environment_automations.task_executions.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_list(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.create_list( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + + @parametrize + def test_method_create_list_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.create_list( + connect_protocol_version=1, + filter={ + "environment_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "phases": [ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + ], + "task_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "task_references": ["string", "string", "string"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + + @parametrize + def test_raw_response_create_list(self, client: Gitpod) -> None: + response = client.environment_automations.task_executions.with_raw_response.create_list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_create_list(self, client: Gitpod) -> None: + with client.environment_automations.task_executions.with_streaming_response.create_list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_retrieve(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.create_retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) + + @parametrize + def test_method_create_retrieve_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.create_retrieve( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) + + @parametrize + def test_raw_response_create_retrieve(self, client: Gitpod) -> None: + response = client.environment_automations.task_executions.with_raw_response.create_retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_create_retrieve(self, client: Gitpod) -> None: + with client.environment_automations.task_executions.with_streaming_response.create_retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_stop(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_method_stop_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.stop( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_raw_response_stop(self, client: Gitpod) -> None: + response = client.environment_automations.task_executions.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_stop(self, client: Gitpod) -> None: + with client.environment_automations.task_executions.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncTaskExecutions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.task_executions.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.task_executions.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.list( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.list( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.task_executions.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.task_executions.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_list(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.create_list( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + + @parametrize + async def test_method_create_list_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.create_list( + connect_protocol_version=1, + filter={ + "environment_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "phases": [ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + ], + "task_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "task_references": ["string", "string", "string"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_create_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.task_executions.with_raw_response.create_list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_create_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.task_executions.with_streaming_response.create_list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_retrieve(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.create_retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) + + @parametrize + async def test_method_create_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.create_retrieve( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_create_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.task_executions.with_raw_response.create_retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_create_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.task_executions.with_streaming_response.create_retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_stop(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.stop( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.task_executions.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.task_executions.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environment_automations/test_tasks.py b/tests/api_resources/environment_automations/test_tasks.py new file mode 100644 index 00000000..843f0070 --- /dev/null +++ b/tests/api_resources/environment_automations/test_tasks.py @@ -0,0 +1,480 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.environment_automations import ( + TaskListResponse, + TaskStartResponse, + TaskCreateListResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTasks: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.update( + connect_protocol_version=1, + ) + assert_matches_type(object, task, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.update( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + depends_on=[ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + metadata={}, + spec={}, + connect_timeout_ms=0, + ) + assert_matches_type(object, task, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.environment_automations.tasks.with_raw_response.update( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(object, task, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.environment_automations.tasks.with_streaming_response.update( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(object, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.list( + connect_protocol_version=1, + ) + assert_matches_type(TaskListResponse, task, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.list( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(TaskListResponse, task, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.environment_automations.tasks.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(TaskListResponse, task, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.environment_automations.tasks.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(TaskListResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, task, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.delete( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, task, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.environment_automations.tasks.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(object, task, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.environment_automations.tasks.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(object, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_list(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.create_list( + connect_protocol_version=1, + ) + assert_matches_type(TaskCreateListResponse, task, path=["response"]) + + @parametrize + def test_method_create_list_with_all_params(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.create_list( + connect_protocol_version=1, + filter={ + "environment_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "references": ["x", "x", "x"], + "task_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(TaskCreateListResponse, task, path=["response"]) + + @parametrize + def test_raw_response_create_list(self, client: Gitpod) -> None: + response = client.environment_automations.tasks.with_raw_response.create_list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(TaskCreateListResponse, task, path=["response"]) + + @parametrize + def test_streaming_response_create_list(self, client: Gitpod) -> None: + with client.environment_automations.tasks.with_streaming_response.create_list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(TaskCreateListResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_start(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.start( + connect_protocol_version=1, + ) + assert_matches_type(TaskStartResponse, task, path=["response"]) + + @parametrize + def test_method_start_with_all_params(self, client: Gitpod) -> None: + task = client.environment_automations.tasks.start( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskStartResponse, task, path=["response"]) + + @parametrize + def test_raw_response_start(self, client: Gitpod) -> None: + response = client.environment_automations.tasks.with_raw_response.start( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(TaskStartResponse, task, path=["response"]) + + @parametrize + def test_streaming_response_start(self, client: Gitpod) -> None: + with client.environment_automations.tasks.with_streaming_response.start( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(TaskStartResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncTasks: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.update( + connect_protocol_version=1, + ) + assert_matches_type(object, task, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.update( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + depends_on=[ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + metadata={}, + spec={}, + connect_timeout_ms=0, + ) + assert_matches_type(object, task, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.tasks.with_raw_response.update( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(object, task, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.tasks.with_streaming_response.update( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(object, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.list( + connect_protocol_version=1, + ) + assert_matches_type(TaskListResponse, task, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.list( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(TaskListResponse, task, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.tasks.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(TaskListResponse, task, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.tasks.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(TaskListResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, task, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.delete( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, task, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.tasks.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(object, task, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.tasks.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(object, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_list(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.create_list( + connect_protocol_version=1, + ) + assert_matches_type(TaskCreateListResponse, task, path=["response"]) + + @parametrize + async def test_method_create_list_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.create_list( + connect_protocol_version=1, + filter={ + "environment_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "references": ["x", "x", "x"], + "task_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(TaskCreateListResponse, task, path=["response"]) + + @parametrize + async def test_raw_response_create_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.tasks.with_raw_response.create_list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(TaskCreateListResponse, task, path=["response"]) + + @parametrize + async def test_streaming_response_create_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.tasks.with_streaming_response.create_list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(TaskCreateListResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_start(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.start( + connect_protocol_version=1, + ) + assert_matches_type(TaskStartResponse, task, path=["response"]) + + @parametrize + async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.environment_automations.tasks.start( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskStartResponse, task, path=["response"]) + + @parametrize + async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.tasks.with_raw_response.start( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(TaskStartResponse, task, path=["response"]) + + @parametrize + async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.tasks.with_streaming_response.start( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(TaskStartResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/__init__.py b/tests/api_resources/organizations/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/organizations/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/organizations/invite/__init__.py b/tests/api_resources/organizations/invite/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/organizations/invite/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/organizations/invite/test_summary.py b/tests/api_resources/organizations/invite/test_summary.py new file mode 100644 index 00000000..efed9ad1 --- /dev/null +++ b/tests/api_resources/organizations/invite/test_summary.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.organizations.invite import SummaryRetrieveResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSummary: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + summary = client.organizations.invite.summary.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + summary = client.organizations.invite.summary.retrieve( + connect_protocol_version=1, + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.invite.summary.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = response.parse() + assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.invite.summary.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = response.parse() + assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncSummary: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + summary = await async_client.organizations.invite.summary.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + summary = await async_client.organizations.invite.summary.retrieve( + connect_protocol_version=1, + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.invite.summary.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = await response.parse() + assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.invite.summary.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = await response.parse() + assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_invite.py b/tests/api_resources/organizations/test_invite.py new file mode 100644 index 00000000..52a7e802 --- /dev/null +++ b/tests/api_resources/organizations/test_invite.py @@ -0,0 +1,185 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.organizations import ( + InviteCreateResponse, + InviteRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestInvite: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + invite = client.organizations.invite.create( + connect_protocol_version=1, + ) + assert_matches_type(InviteCreateResponse, invite, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + invite = client.organizations.invite.create( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(InviteCreateResponse, invite, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.organizations.invite.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invite = response.parse() + assert_matches_type(InviteCreateResponse, invite, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.organizations.invite.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invite = response.parse() + assert_matches_type(InviteCreateResponse, invite, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + invite = client.organizations.invite.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + invite = client.organizations.invite.retrieve( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.invite.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invite = response.parse() + assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.invite.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invite = response.parse() + assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncInvite: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + invite = await async_client.organizations.invite.create( + connect_protocol_version=1, + ) + assert_matches_type(InviteCreateResponse, invite, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + invite = await async_client.organizations.invite.create( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(InviteCreateResponse, invite, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.invite.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invite = await response.parse() + assert_matches_type(InviteCreateResponse, invite, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.invite.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invite = await response.parse() + assert_matches_type(InviteCreateResponse, invite, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + invite = await async_client.organizations.invite.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + invite = await async_client.organizations.invite.retrieve( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.invite.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invite = await response.parse() + assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.invite.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invite = await response.parse() + assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_members.py b/tests/api_resources/organizations/test_members.py new file mode 100644 index 00000000..7477de21 --- /dev/null +++ b/tests/api_resources/organizations/test_members.py @@ -0,0 +1,110 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.organizations import MemberListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestMembers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + member = client.organizations.members.list( + connect_protocol_version=1, + ) + assert_matches_type(MemberListResponse, member, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + member = client.organizations.members.list( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(MemberListResponse, member, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.organizations.members.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = response.parse() + assert_matches_type(MemberListResponse, member, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.organizations.members.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = response.parse() + assert_matches_type(MemberListResponse, member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncMembers: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + member = await async_client.organizations.members.list( + connect_protocol_version=1, + ) + assert_matches_type(MemberListResponse, member, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + member = await async_client.organizations.members.list( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(MemberListResponse, member, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.members.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = await response.parse() + assert_matches_type(MemberListResponse, member, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.members.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = await response.parse() + assert_matches_type(MemberListResponse, member, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/__init__.py b/tests/api_resources/runner_configurations/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/runner_configurations/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/runner_configurations/test_configuration_schema.py b/tests/api_resources/runner_configurations/test_configuration_schema.py new file mode 100644 index 00000000..dbb54e48 --- /dev/null +++ b/tests/api_resources/runner_configurations/test_configuration_schema.py @@ -0,0 +1,193 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.runner_configurations import ( + ConfigurationSchemaCreateResponse, + ConfigurationSchemaRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestConfigurationSchema: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + configuration_schema = client.runner_configurations.configuration_schema.create( + connect_protocol_version=1, + ) + assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + configuration_schema = client.runner_configurations.configuration_schema.create( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.runner_configurations.configuration_schema.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + configuration_schema = response.parse() + assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.runner_configurations.configuration_schema.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + configuration_schema = response.parse() + assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + configuration_schema = client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + configuration_schema = client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runner_configurations.configuration_schema.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + configuration_schema = response.parse() + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runner_configurations.configuration_schema.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + configuration_schema = response.parse() + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncConfigurationSchema: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + configuration_schema = await async_client.runner_configurations.configuration_schema.create( + connect_protocol_version=1, + ) + assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + configuration_schema = await async_client.runner_configurations.configuration_schema.create( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.configuration_schema.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + configuration_schema = await response.parse() + assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.configuration_schema.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + configuration_schema = await response.parse() + assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.configuration_schema.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + configuration_schema = await response.parse() + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.configuration_schema.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + configuration_schema = await response.parse() + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/test_environment_classes.py b/tests/api_resources/runner_configurations/test_environment_classes.py new file mode 100644 index 00000000..2d2d96e1 --- /dev/null +++ b/tests/api_resources/runner_configurations/test_environment_classes.py @@ -0,0 +1,208 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.runner_configurations import ( + EnvironmentClassListResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEnvironmentClasses: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.update( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.update( + body={ + "description": "xxx", + "displayName": "xxx", + "enabled": True, + "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.runner_configurations.environment_classes.with_raw_response.update( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.runner_configurations.environment_classes.with_streaming_response.update( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.list( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.list( + connect_protocol_version=1, + filter={}, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.runner_configurations.environment_classes.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = response.parse() + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.runner_configurations.environment_classes.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = response.parse() + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEnvironmentClasses: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.update( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.update( + body={ + "description": "xxx", + "displayName": "xxx", + "enabled": True, + "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.environment_classes.with_raw_response.update( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.environment_classes.with_streaming_response.update( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.list( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.list( + connect_protocol_version=1, + filter={}, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.environment_classes.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = await response.parse() + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.environment_classes.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = await response.parse() + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py new file mode 100644 index 00000000..dd8a5f52 --- /dev/null +++ b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py @@ -0,0 +1,534 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.runner_configurations import ( + HostAuthenticationTokenListResponse, + HostAuthenticationTokenCreateResponse, + HostAuthenticationTokenRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestHostAuthenticationTokens: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.create( + connect_protocol_version=1, + ) + assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.create( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.runner_configurations.host_authentication_tokens.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_1(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.list( + connect_protocol_version=1, + ) + assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.list( + connect_protocol_version=1, + filter={}, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.runner_configurations.host_authentication_tokens.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.delete( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.runner_configurations.host_authentication_tokens.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncHostAuthenticationTokens: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create( + connect_protocol_version=1, + ) + assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list( + connect_protocol_version=1, + ) + assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list( + connect_protocol_version=1, + filter={}, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/test_scm_integration.py b/tests/api_resources/runner_configurations/test_scm_integration.py new file mode 100644 index 00000000..d5311fb6 --- /dev/null +++ b/tests/api_resources/runner_configurations/test_scm_integration.py @@ -0,0 +1,122 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.runner_configurations import ScmIntegrationCreateResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestScmIntegration: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + scm_integration = client.runner_configurations.scm_integration.create( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + scm_integration = client.runner_configurations.scm_integration.create( + body={ + "host": "host", + "oauthClientId": "oauthClientId", + "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", + "pat": True, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmId": "scmId", + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.runner_configurations.scm_integration.with_raw_response.create( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.runner_configurations.scm_integration.with_streaming_response.create( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncScmIntegration: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runner_configurations.scm_integration.create( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runner_configurations.scm_integration.create( + body={ + "host": "host", + "oauthClientId": "oauthClientId", + "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", + "pat": True, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmId": "scmId", + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.scm_integration.with_raw_response.create( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.scm_integration.with_streaming_response.create( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_interactions/__init__.py b/tests/api_resources/runner_interactions/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/runner_interactions/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/runner_interactions/test_environment.py b/tests/api_resources/runner_interactions/test_environment.py new file mode 100644 index 00000000..1898f8fc --- /dev/null +++ b/tests/api_resources/runner_interactions/test_environment.py @@ -0,0 +1,436 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.runner_interactions import ( + EnvironmentRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEnvironment: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + environment = client.runner_interactions.environment.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + environment = client.runner_interactions.environment.retrieve( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runner_interactions.environment.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runner_interactions.environment.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_status(self, client: Gitpod) -> None: + environment = client.runner_interactions.environment.update_status( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_method_update_status_with_all_params(self, client: Gitpod) -> None: + environment = client.runner_interactions.environment.update_status( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + status={ + "automations_file": { + "automations_file_path": "automationsFilePath", + "automations_file_presence": "PRESENCE_UNSPECIFIED", + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "session": "session", + }, + "content": { + "content_location_in_machine": "contentLocationInMachine", + "failure_message": "failureMessage", + "git": { + "branch": "branch", + "changed_files": [ + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + ], + "clone_url": "cloneUrl", + "latest_commit": "latestCommit", + "total_changed_files": 0, + "total_unpushed_commits": 0, + "unpushed_commits": ["string", "string", "string"], + }, + "phase": "CONTENT_PHASE_UNSPECIFIED", + "session": "session", + "warning_message": "warningMessage", + }, + "devcontainer": { + "container_id": "containerId", + "container_name": "containerName", + "devcontainerconfig_in_sync": True, + "devcontainer_file_path": "devcontainerFilePath", + "devcontainer_file_presence": "PRESENCE_UNSPECIFIED", + "failure_message": "failureMessage", + "phase": "PHASE_UNSPECIFIED", + "remote_user": "remoteUser", + "remote_workspace_folder": "remoteWorkspaceFolder", + "secrets_in_sync": True, + "session": "session", + "warning_message": "warningMessage", + }, + "environment_urls": { + "logs": "logs", + "ports": [ + { + "port": 1, + "url": "url", + }, + { + "port": 1, + "url": "url", + }, + { + "port": 1, + "url": "url", + }, + ], + "ssh": {"url": "url"}, + }, + "failure_message": ["string", "string", "string"], + "machine": { + "failure_message": "failureMessage", + "phase": "PHASE_UNSPECIFIED", + "session": "session", + "timeout": "timeout", + "versions": { + "supervisor_commit": "supervisorCommit", + "supervisor_version": "supervisorVersion", + }, + "warning_message": "warningMessage", + }, + "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", + "runner_ack": { + "message": "message", + "spec_version": "string", + "status_code": "STATUS_CODE_UNSPECIFIED", + }, + "secrets": [ + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + ], + "ssh_public_keys": [ + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + ], + "status_version": "string", + "warning_message": ["string", "string", "string"], + }, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_raw_response_update_status(self, client: Gitpod) -> None: + response = client.runner_interactions.environment.with_raw_response.update_status( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_streaming_response_update_status(self, client: Gitpod) -> None: + with client.runner_interactions.environment.with_streaming_response.update_status( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEnvironment: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environment.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environment.retrieve( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.environment.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.environment.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_status(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environment.update_status( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environment.update_status( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + status={ + "automations_file": { + "automations_file_path": "automationsFilePath", + "automations_file_presence": "PRESENCE_UNSPECIFIED", + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "session": "session", + }, + "content": { + "content_location_in_machine": "contentLocationInMachine", + "failure_message": "failureMessage", + "git": { + "branch": "branch", + "changed_files": [ + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + ], + "clone_url": "cloneUrl", + "latest_commit": "latestCommit", + "total_changed_files": 0, + "total_unpushed_commits": 0, + "unpushed_commits": ["string", "string", "string"], + }, + "phase": "CONTENT_PHASE_UNSPECIFIED", + "session": "session", + "warning_message": "warningMessage", + }, + "devcontainer": { + "container_id": "containerId", + "container_name": "containerName", + "devcontainerconfig_in_sync": True, + "devcontainer_file_path": "devcontainerFilePath", + "devcontainer_file_presence": "PRESENCE_UNSPECIFIED", + "failure_message": "failureMessage", + "phase": "PHASE_UNSPECIFIED", + "remote_user": "remoteUser", + "remote_workspace_folder": "remoteWorkspaceFolder", + "secrets_in_sync": True, + "session": "session", + "warning_message": "warningMessage", + }, + "environment_urls": { + "logs": "logs", + "ports": [ + { + "port": 1, + "url": "url", + }, + { + "port": 1, + "url": "url", + }, + { + "port": 1, + "url": "url", + }, + ], + "ssh": {"url": "url"}, + }, + "failure_message": ["string", "string", "string"], + "machine": { + "failure_message": "failureMessage", + "phase": "PHASE_UNSPECIFIED", + "session": "session", + "timeout": "timeout", + "versions": { + "supervisor_commit": "supervisorCommit", + "supervisor_version": "supervisorVersion", + }, + "warning_message": "warningMessage", + }, + "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", + "runner_ack": { + "message": "message", + "spec_version": "string", + "status_code": "STATUS_CODE_UNSPECIFIED", + }, + "secrets": [ + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + ], + "ssh_public_keys": [ + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + ], + "status_version": "string", + "warning_message": ["string", "string", "string"], + }, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_raw_response_update_status(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.environment.with_raw_response.update_status( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_streaming_response_update_status(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.environment.with_streaming_response.update_status( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_interactions/test_environments.py b/tests/api_resources/runner_interactions/test_environments.py new file mode 100644 index 00000000..4cda0e67 --- /dev/null +++ b/tests/api_resources/runner_interactions/test_environments.py @@ -0,0 +1,120 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.runner_interactions import EnvironmentListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEnvironments: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + environment = client.runner_interactions.environments.list( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + environment = client.runner_interactions.environments.list( + connect_protocol_version=1, + environment_ids=[ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.runner_interactions.environments.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.runner_interactions.environments.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEnvironments: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environments.list( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environments.list( + connect_protocol_version=1, + environment_ids=[ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.environments.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.environments.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/__init__.py b/tests/api_resources/runners/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/runners/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py new file mode 100644 index 00000000..f4b93e21 --- /dev/null +++ b/tests/api_resources/runners/test_policies.py @@ -0,0 +1,110 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.runners import PolicyListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPolicies: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + policy = client.runners.policies.list( + connect_protocol_version=1, + ) + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + policy = client.runners.policies.list( + connect_protocol_version=1, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.runners.policies.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.runners.policies.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncPolicies: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + policy = await async_client.runners.policies.list( + connect_protocol_version=1, + ) + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + policy = await async_client.runners.policies.list( + connect_protocol_version=1, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.policies.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.policies.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_automations_files.py b/tests/api_resources/test_automations_files.py new file mode 100644 index 00000000..fed1b113 --- /dev/null +++ b/tests/api_resources/test_automations_files.py @@ -0,0 +1,148 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import AutomationsFileUpsertResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAutomationsFiles: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_upsert(self, client: Gitpod) -> None: + automations_file = client.automations_files.upsert( + connect_protocol_version=1, + ) + assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + + @parametrize + def test_method_upsert_with_all_params(self, client: Gitpod) -> None: + automations_file = client.automations_files.upsert( + connect_protocol_version=1, + automations_file={ + "services": { + "foo": { + "commands": { + "ready": "ready", + "start": "x", + "stop": "stop", + }, + "description": "description", + "name": "x", + "triggered_by": ["string", "string", "string"], + } + }, + "tasks": { + "foo": { + "command": "x", + "depends_on": ["string", "string", "string"], + "description": "description", + "name": "x", + "triggered_by": ["string", "string", "string"], + } + }, + }, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + + @parametrize + def test_raw_response_upsert(self, client: Gitpod) -> None: + response = client.automations_files.with_raw_response.upsert( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automations_file = response.parse() + assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + + @parametrize + def test_streaming_response_upsert(self, client: Gitpod) -> None: + with client.automations_files.with_streaming_response.upsert( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automations_file = response.parse() + assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncAutomationsFiles: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_upsert(self, async_client: AsyncGitpod) -> None: + automations_file = await async_client.automations_files.upsert( + connect_protocol_version=1, + ) + assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + + @parametrize + async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: + automations_file = await async_client.automations_files.upsert( + connect_protocol_version=1, + automations_file={ + "services": { + "foo": { + "commands": { + "ready": "ready", + "start": "x", + "stop": "stop", + }, + "description": "description", + "name": "x", + "triggered_by": ["string", "string", "string"], + } + }, + "tasks": { + "foo": { + "command": "x", + "depends_on": ["string", "string", "string"], + "description": "description", + "name": "x", + "triggered_by": ["string", "string", "string"], + } + }, + }, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + + @parametrize + async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations_files.with_raw_response.upsert( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automations_file = await response.parse() + assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + + @parametrize + async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: + async with async_client.automations_files.with_streaming_response.upsert( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automations_file = await response.parse() + assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_environment_automation.py b/tests/api_resources/test_environment_automation.py new file mode 100644 index 00000000..33432942 --- /dev/null +++ b/tests/api_resources/test_environment_automation.py @@ -0,0 +1,149 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEnvironmentAutomation: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update_task_execution_status(self, client: Gitpod) -> None: + environment_automation = client.environment_automation.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment_automation, path=["response"]) + + @parametrize + def test_method_update_task_execution_status_with_all_params(self, client: Gitpod) -> None: + environment_automation = client.environment_automation.update_task_execution_status( + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failureMessage": "failureMessage", + "logUrl": "logUrl", + "steps": [ + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + ], + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_automation, path=["response"]) + + @parametrize + def test_raw_response_update_task_execution_status(self, client: Gitpod) -> None: + response = client.environment_automation.with_raw_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_automation = response.parse() + assert_matches_type(object, environment_automation, path=["response"]) + + @parametrize + def test_streaming_response_update_task_execution_status(self, client: Gitpod) -> None: + with client.environment_automation.with_streaming_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_automation = response.parse() + assert_matches_type(object, environment_automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEnvironmentAutomation: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + environment_automation = await async_client.environment_automation.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment_automation, path=["response"]) + + @parametrize + async def test_method_update_task_execution_status_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_automation = await async_client.environment_automation.update_task_execution_status( + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failureMessage": "failureMessage", + "logUrl": "logUrl", + "steps": [ + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + ], + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_automation, path=["response"]) + + @parametrize + async def test_raw_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automation.with_raw_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_automation = await response.parse() + assert_matches_type(object, environment_automation, path=["response"]) + + @parametrize + async def test_streaming_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automation.with_streaming_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_automation = await response.parse() + assert_matches_type(object, environment_automation, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_environment_classes.py b/tests/api_resources/test_environment_classes.py new file mode 100644 index 00000000..281063fe --- /dev/null +++ b/tests/api_resources/test_environment_classes.py @@ -0,0 +1,110 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import EnvironmentClassListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEnvironmentClasses: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + environment_class = client.environment_classes.list( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + environment_class = client.environment_classes.list( + connect_protocol_version=1, + filter={}, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.environment_classes.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = response.parse() + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.environment_classes.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = response.parse() + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEnvironmentClasses: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.environment_classes.list( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.environment_classes.list( + connect_protocol_version=1, + filter={}, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_classes.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = await response.parse() + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_classes.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = await response.parse() + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py new file mode 100644 index 00000000..db5f3ce1 --- /dev/null +++ b/tests/api_resources/test_environments.py @@ -0,0 +1,701 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + EnvironmentListResponse, + EnvironmentCreateResponse, + EnvironmentRetrieveResponse, + EnvironmentCreateFromProjectResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEnvironments: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + environment = client.environments.create( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.create( + connect_protocol_version=1, + spec={ + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "automations_file": { + "automations_file_path": "automationsFilePath", + "session": "session", + }, + "content": { + "git_email": "gitEmail", + "git_username": "gitUsername", + "initializer": {"specs": [{}, {}, {}]}, + "session": "session", + }, + "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", + "devcontainer": { + "devcontainer_file_path": "devcontainerFilePath", + "session": "session", + }, + "machine": { + "class": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "session": "session", + }, + "ports": [ + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + ], + "secrets": [{}, {}, {}], + "spec_version": "string", + "ssh_public_keys": [ + { + "id": "id", + "value": "value", + }, + { + "id": "id", + "value": "value", + }, + { + "id": "id", + "value": "value", + }, + ], + "timeout": {"disconnected": "disconnected"}, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + environment = client.environments.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.retrieve( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + environment = client.environments.list( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.list( + connect_protocol_version=1, + filter={ + "creator_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "project_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "runner_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "status_phases": [ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + ], + }, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_from_project(self, client: Gitpod) -> None: + environment = client.environments.create_from_project( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + + @parametrize + def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.create_from_project( + connect_protocol_version=1, + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + spec={ + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "automations_file": { + "automations_file_path": "automationsFilePath", + "session": "session", + }, + "content": { + "git_email": "gitEmail", + "git_username": "gitUsername", + "initializer": {"specs": [{}, {}, {}]}, + "session": "session", + }, + "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", + "devcontainer": { + "devcontainer_file_path": "devcontainerFilePath", + "session": "session", + }, + "machine": { + "class": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "session": "session", + }, + "ports": [ + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + ], + "secrets": [{}, {}, {}], + "spec_version": "string", + "ssh_public_keys": [ + { + "id": "id", + "value": "value", + }, + { + "id": "id", + "value": "value", + }, + { + "id": "id", + "value": "value", + }, + ], + "timeout": {"disconnected": "disconnected"}, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + + @parametrize + def test_raw_response_create_from_project(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.create_from_project( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + + @parametrize + def test_streaming_response_create_from_project(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.create_from_project( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_start(self, client: Gitpod) -> None: + environment = client.environments.start( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_method_start_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.start( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_raw_response_start(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.start( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_streaming_response_start(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.start( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEnvironments: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.create( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.create( + connect_protocol_version=1, + spec={ + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "automations_file": { + "automations_file_path": "automationsFilePath", + "session": "session", + }, + "content": { + "git_email": "gitEmail", + "git_username": "gitUsername", + "initializer": {"specs": [{}, {}, {}]}, + "session": "session", + }, + "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", + "devcontainer": { + "devcontainer_file_path": "devcontainerFilePath", + "session": "session", + }, + "machine": { + "class": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "session": "session", + }, + "ports": [ + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + ], + "secrets": [{}, {}, {}], + "spec_version": "string", + "ssh_public_keys": [ + { + "id": "id", + "value": "value", + }, + { + "id": "id", + "value": "value", + }, + { + "id": "id", + "value": "value", + }, + ], + "timeout": {"disconnected": "disconnected"}, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.retrieve( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.list( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.list( + connect_protocol_version=1, + filter={ + "creator_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "project_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "runner_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "status_phases": [ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + ], + }, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.create_from_project( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + + @parametrize + async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.create_from_project( + connect_protocol_version=1, + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + spec={ + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "automations_file": { + "automations_file_path": "automationsFilePath", + "session": "session", + }, + "content": { + "git_email": "gitEmail", + "git_username": "gitUsername", + "initializer": {"specs": [{}, {}, {}]}, + "session": "session", + }, + "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", + "devcontainer": { + "devcontainer_file_path": "devcontainerFilePath", + "session": "session", + }, + "machine": { + "class": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "session": "session", + }, + "ports": [ + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + }, + ], + "secrets": [{}, {}, {}], + "spec_version": "string", + "ssh_public_keys": [ + { + "id": "id", + "value": "value", + }, + { + "id": "id", + "value": "value", + }, + { + "id": "id", + "value": "value", + }, + ], + "timeout": {"disconnected": "disconnected"}, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + + @parametrize + async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.create_from_project( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + + @parametrize + async def test_streaming_response_create_from_project(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.create_from_project( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_start(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.start( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.start( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.start( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.start( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py new file mode 100644 index 00000000..3b4591e8 --- /dev/null +++ b/tests/api_resources/test_organizations.py @@ -0,0 +1,185 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestOrganizations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_leave(self, client: Gitpod) -> None: + organization = client.organizations.leave( + connect_protocol_version=1, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + def test_method_leave_with_all_params(self, client: Gitpod) -> None: + organization = client.organizations.leave( + connect_protocol_version=1, + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + def test_raw_response_leave(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.leave( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(object, organization, path=["response"]) + + @parametrize + def test_streaming_response_leave(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.leave( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(object, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_set_role(self, client: Gitpod) -> None: + organization = client.organizations.set_role( + connect_protocol_version=1, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + def test_method_set_role_with_all_params(self, client: Gitpod) -> None: + organization = client.organizations.set_role( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="ORGANIZATION_ROLE_UNSPECIFIED", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + def test_raw_response_set_role(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.set_role( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(object, organization, path=["response"]) + + @parametrize + def test_streaming_response_set_role(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.set_role( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(object, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncOrganizations: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_leave(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.leave( + connect_protocol_version=1, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.leave( + connect_protocol_version=1, + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.leave( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(object, organization, path=["response"]) + + @parametrize + async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.leave( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(object, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_set_role(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.set_role( + connect_protocol_version=1, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.set_role( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="ORGANIZATION_ROLE_UNSPECIFIED", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.set_role( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(object, organization, path=["response"]) + + @parametrize + async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.set_role( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(object, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_personal_access_tokens.py b/tests/api_resources/test_personal_access_tokens.py new file mode 100644 index 00000000..4ada66d6 --- /dev/null +++ b/tests/api_resources/test_personal_access_tokens.py @@ -0,0 +1,204 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + PersonalAccessTokenListResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPersonalAccessTokens: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + personal_access_token = client.personal_access_tokens.list( + connect_protocol_version=1, + ) + assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + personal_access_token = client.personal_access_tokens.list( + connect_protocol_version=1, + filter={ + "user_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.personal_access_tokens.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + personal_access_token = response.parse() + assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.personal_access_tokens.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + personal_access_token = response.parse() + assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + personal_access_token = client.personal_access_tokens.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, personal_access_token, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + personal_access_token = client.personal_access_tokens.delete( + connect_protocol_version=1, + personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, personal_access_token, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.personal_access_tokens.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + personal_access_token = response.parse() + assert_matches_type(object, personal_access_token, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.personal_access_tokens.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + personal_access_token = response.parse() + assert_matches_type(object, personal_access_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncPersonalAccessTokens: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + personal_access_token = await async_client.personal_access_tokens.list( + connect_protocol_version=1, + ) + assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + personal_access_token = await async_client.personal_access_tokens.list( + connect_protocol_version=1, + filter={ + "user_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.personal_access_tokens.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + personal_access_token = await response.parse() + assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.personal_access_tokens.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + personal_access_token = await response.parse() + assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + personal_access_token = await async_client.personal_access_tokens.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, personal_access_token, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + personal_access_token = await async_client.personal_access_tokens.delete( + connect_protocol_version=1, + personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, personal_access_token, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.personal_access_tokens.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + personal_access_token = await response.parse() + assert_matches_type(object, personal_access_token, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.personal_access_tokens.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + personal_access_token = await response.parse() + assert_matches_type(object, personal_access_token, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py new file mode 100644 index 00000000..04dcaf3f --- /dev/null +++ b/tests/api_resources/test_projects.py @@ -0,0 +1,296 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + ProjectCreateResponse, + ProjectRetrieveResponse, + ProjectCreateFromEnvironmentResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestProjects: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + project = client.projects.create( + environment_class={}, + initializer={}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectCreateResponse, project, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + project = client.projects.create( + environment_class={}, + initializer={"specs": [{}, {}, {}]}, + connect_protocol_version=1, + automations_file_path="automationsFilePath", + devcontainer_file_path="devcontainerFilePath", + name="x", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectCreateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.create( + environment_class={}, + initializer={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectCreateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.create( + environment_class={}, + initializer={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectCreateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + project = client.projects.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + project = client.projects.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_from_environment(self, client: Gitpod) -> None: + project = client.projects.create_from_environment( + connect_protocol_version=1, + ) + assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + + @parametrize + def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: + project = client.projects.create_from_environment( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + name="x", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + + @parametrize + def test_raw_response_create_from_environment(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.create_from_environment( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_create_from_environment(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.create_from_environment( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncProjects: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.create( + environment_class={}, + initializer={}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectCreateResponse, project, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.create( + environment_class={}, + initializer={"specs": [{}, {}, {}]}, + connect_protocol_version=1, + automations_file_path="automationsFilePath", + devcontainer_file_path="devcontainerFilePath", + name="x", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectCreateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.create( + environment_class={}, + initializer={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectCreateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.create( + environment_class={}, + initializer={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectCreateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.create_from_environment( + connect_protocol_version=1, + ) + assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + + @parametrize + async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.create_from_environment( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + name="x", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_create_from_environment(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.create_from_environment( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_create_from_environment(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.create_from_environment( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runner_configurations.py b/tests/api_resources/test_runner_configurations.py new file mode 100644 index 00000000..cfb45e26 --- /dev/null +++ b/tests/api_resources/test_runner_configurations.py @@ -0,0 +1,280 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import RunnerConfigurationValidateResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRunnerConfigurations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_validate_overload_1(self, client: Gitpod) -> None: + runner_configuration = client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> None: + runner_configuration = client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: + response = client.runner_configurations.with_raw_response.validate( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_configuration = response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: + with client.runner_configurations.with_streaming_response.validate( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_configuration = response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_validate_overload_2(self, client: Gitpod) -> None: + runner_configuration = client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: + runner_configuration = client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: + response = client.runner_configurations.with_raw_response.validate( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_configuration = response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: + with client.runner_configurations.with_streaming_response.validate( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_configuration = response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_validate_overload_3(self, client: Gitpod) -> None: + runner_configuration = client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_method_validate_with_all_params_overload_3(self, client: Gitpod) -> None: + runner_configuration = client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_raw_response_validate_overload_3(self, client: Gitpod) -> None: + response = client.runner_configurations.with_raw_response.validate( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_configuration = response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_streaming_response_validate_overload_3(self, client: Gitpod) -> None: + with client.runner_configurations.with_streaming_response.validate( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_configuration = response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncRunnerConfigurations: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: + runner_configuration = await async_client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_method_validate_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + runner_configuration = await async_client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.with_raw_response.validate( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_configuration = await response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.with_streaming_response.validate( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_configuration = await response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: + runner_configuration = await async_client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + runner_configuration = await async_client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.with_raw_response.validate( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_configuration = await response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.with_streaming_response.validate( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_configuration = await response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_validate_overload_3(self, async_client: AsyncGitpod) -> None: + runner_configuration = await async_client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_method_validate_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + runner_configuration = await async_client.runner_configurations.validate( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_raw_response_validate_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.with_raw_response.validate( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_configuration = await response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_validate_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.with_streaming_response.validate( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_configuration = await response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runner_interaction.py b/tests/api_resources/test_runner_interaction.py new file mode 100644 index 00000000..8fe31768 --- /dev/null +++ b/tests/api_resources/test_runner_interaction.py @@ -0,0 +1,1105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + RunnerInteractionGetLatestVersionResponse, + RunnerInteractionListRunnerScmIntegrationsResponse, + RunnerInteractionListRunnerEnvironmentClassesResponse, + RunnerInteractionGetHostAuthenticationTokenValueResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRunnerInteraction: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get_host_authentication_token_value(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.get_host_authentication_token_value( + connect_protocol_version=1, + ) + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_method_get_host_authentication_token_value_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.get_host_authentication_token_value( + connect_protocol_version=1, + host="host", + principal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_raw_response_get_host_authentication_token_value(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.get_host_authentication_token_value( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_streaming_response_get_host_authentication_token_value(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.get_host_authentication_token_value( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_latest_version(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.get_latest_version( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + def test_method_get_latest_version_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.get_latest_version( + connect_protocol_version=1, + current_version="currentVersion", + infrastructure_version="infrastructureVersion", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_get_latest_version(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.get_latest_version( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_get_latest_version(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.get_latest_version( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list_runner_environment_classes(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.list_runner_environment_classes( + connect_protocol_version=1, + ) + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_method_list_runner_environment_classes_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.list_runner_environment_classes( + connect_protocol_version=1, + filter={ + "environment_class_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_raw_response_list_runner_environment_classes(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.list_runner_environment_classes( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_streaming_response_list_runner_environment_classes(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.list_runner_environment_classes( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list_runner_scm_integrations(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.list_runner_scm_integrations( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + def test_method_list_runner_scm_integrations_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.list_runner_scm_integrations( + connect_protocol_version=1, + filter={ + "scm_integration_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_list_runner_scm_integrations(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.list_runner_scm_integrations( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_list_runner_scm_integrations(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.list_runner_scm_integrations( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_1(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_1(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_1(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_1(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_2(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_2(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_2(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_2(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_3(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_3(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_3(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_3(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_4(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_4(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_4(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_4(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_5(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_5(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_5(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_5(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_6(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_6(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_6(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_6(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_runner_configuration_schema(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.update_runner_configuration_schema( + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_update_runner_configuration_schema_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interaction.update_runner_configuration_schema( + connect_protocol_version=1, + config_schema={ + "environment_classes": [{}, {}, {}], + "runner_config": [{}, {}, {}], + "scm": [ + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + ], + "version": "version", + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_update_runner_configuration_schema(self, client: Gitpod) -> None: + response = client.runner_interaction.with_raw_response.update_runner_configuration_schema( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_update_runner_configuration_schema(self, client: Gitpod) -> None: + with client.runner_interaction.with_streaming_response.update_runner_configuration_schema( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncRunnerInteraction: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.get_host_authentication_token_value( + connect_protocol_version=1, + ) + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_method_get_host_authentication_token_value_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.get_host_authentication_token_value( + connect_protocol_version=1, + host="host", + principal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_raw_response_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.get_host_authentication_token_value( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_streaming_response_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.get_host_authentication_token_value( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_latest_version(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.get_latest_version( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_method_get_latest_version_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.get_latest_version( + connect_protocol_version=1, + current_version="currentVersion", + infrastructure_version="infrastructureVersion", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_get_latest_version(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.get_latest_version( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_get_latest_version(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.get_latest_version( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.list_runner_environment_classes( + connect_protocol_version=1, + ) + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_method_list_runner_environment_classes_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.list_runner_environment_classes( + connect_protocol_version=1, + filter={ + "environment_class_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_raw_response_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.list_runner_environment_classes( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_streaming_response_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.list_runner_environment_classes( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.list_runner_scm_integrations( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_method_list_runner_scm_integrations_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.list_runner_scm_integrations( + connect_protocol_version=1, + filter={ + "scm_integration_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.list_runner_scm_integrations( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.list_runner_scm_integrations( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_send_response_overload_1(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_send_response_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_send_response_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_send_response_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_send_response_overload_2(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_send_response_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_send_response_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_send_response_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_send_response_overload_3(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_send_response_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_send_response_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_send_response_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_send_response_overload_4(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_send_response_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_send_response_overload_4(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_send_response_overload_4(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_send_response_overload_5(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_send_response_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_send_response_overload_5(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_send_response_overload_5(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_send_response_overload_6(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_send_response_with_all_params_overload_6(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_send_response_overload_6(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_send_response_overload_6(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.update_runner_configuration_schema( + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_update_runner_configuration_schema_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interaction.update_runner_configuration_schema( + connect_protocol_version=1, + config_schema={ + "environment_classes": [{}, {}, {}], + "runner_config": [{}, {}, {}], + "scm": [ + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + ], + "version": "version", + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interaction.with_raw_response.update_runner_configuration_schema( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interaction.with_streaming_response.update_runner_configuration_schema( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runner_interactions.py b/tests/api_resources/test_runner_interactions.py new file mode 100644 index 00000000..9f9a7e4d --- /dev/null +++ b/tests/api_resources/test_runner_interactions.py @@ -0,0 +1,416 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + RunnerInteractionSignupResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRunnerInteractions: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_mark_active(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.mark_active( + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.mark_active( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_mark_active(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.mark_active( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_mark_active(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.mark_active( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_signup(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.signup( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + @parametrize + def test_method_signup_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.signup( + connect_protocol_version=1, + environment_classes=[ + { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + ], + public_key="U3RhaW5sZXNzIHJvY2tz", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_signup(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.signup( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_signup(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.signup( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_status(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.update_status( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_update_status_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.update_status( + body={ + "additionalInfo": [{}, {}, {}], + "degredationMessage": "degredationMessage", + "logUrl": "https://example.com", + "region": "region", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "systemDetails": "systemDetails", + "version": "version", + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_update_status(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.update_status( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_update_status(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.update_status( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncRunnerInteractions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.mark_active( + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.mark_active( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.mark_active( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.mark_active( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_signup(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.signup( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_method_signup_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.signup( + connect_protocol_version=1, + environment_classes=[ + { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + ], + public_key="U3RhaW5sZXNzIHJvY2tz", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_signup(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.signup( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_signup(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.signup( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_status(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.update_status( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.update_status( + body={ + "additionalInfo": [{}, {}, {}], + "degredationMessage": "degredationMessage", + "logUrl": "https://example.com", + "region": "region", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "systemDetails": "systemDetails", + "version": "version", + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_update_status(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.update_status( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_update_status(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.update_status( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py new file mode 100644 index 00000000..9bb0341d --- /dev/null +++ b/tests/api_resources/test_runners.py @@ -0,0 +1,818 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + RunnerListResponse, + RunnerCreateResponse, + RunnerRetrieveResponse, + RunnerGetRunnerResponse, + RunnerParseContextURLResponse, + RunnerCreateRunnerTokenResponse, + RunnerCheckAuthenticationForHostResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRunners: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + runner = client.runners.create( + connect_protocol_version=1, + ) + assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.create( + connect_protocol_version=1, + kind="RUNNER_KIND_UNSPECIFIED", + name="xxx", + spec={ + "configuration": { + "auto_update": True, + "region": "region", + "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + }, + "desired_phase": "RUNNER_PHASE_UNSPECIFIED", + }, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + runner = client.runners.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + runner = client.runners.list( + connect_protocol_version=1, + ) + assert_matches_type(RunnerListResponse, runner, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.list( + connect_protocol_version=1, + filter={ + "creator_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "kinds": ["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerListResponse, runner, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerListResponse, runner, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerListResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_check_authentication_for_host(self, client: Gitpod) -> None: + runner = client.runners.check_authentication_for_host( + connect_protocol_version=1, + ) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + + @parametrize + def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.check_authentication_for_host( + connect_protocol_version=1, + host="host", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + + @parametrize + def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.check_authentication_for_host( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + + @parametrize + def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.check_authentication_for_host( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_runner_token(self, client: Gitpod) -> None: + runner = client.runners.create_runner_token( + connect_protocol_version=1, + ) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + + @parametrize + def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.create_runner_token( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + + @parametrize + def test_raw_response_create_runner_token(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.create_runner_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + + @parametrize + def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.create_runner_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete_runner(self, client: Gitpod) -> None: + runner = client.runners.delete_runner( + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_method_delete_runner_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.delete_runner( + connect_protocol_version=1, + force=True, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_raw_response_delete_runner(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.delete_runner( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_streaming_response_delete_runner(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.delete_runner( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(object, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_runner(self, client: Gitpod) -> None: + runner = client.runners.get_runner( + connect_protocol_version=1, + ) + assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + + @parametrize + def test_method_get_runner_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.get_runner( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + + @parametrize + def test_raw_response_get_runner(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.get_runner( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + + @parametrize + def test_streaming_response_get_runner(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.get_runner( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_parse_context_url(self, client: Gitpod) -> None: + runner = client.runners.parse_context_url( + connect_protocol_version=1, + ) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + + @parametrize + def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.parse_context_url( + connect_protocol_version=1, + context_url="https://example.com", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + + @parametrize + def test_raw_response_parse_context_url(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.parse_context_url( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + + @parametrize + def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.parse_context_url( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_runner(self, client: Gitpod) -> None: + runner = client.runners.update_runner( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_method_update_runner_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.update_runner( + body={ + "name": "xxx", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "spec": {}, + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_raw_response_update_runner(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.update_runner( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_streaming_response_update_runner(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.update_runner( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(object, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncRunners: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create( + connect_protocol_version=1, + ) + assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create( + connect_protocol_version=1, + kind="RUNNER_KIND_UNSPECIFIED", + name="xxx", + spec={ + "configuration": { + "auto_update": True, + "region": "region", + "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + }, + "desired_phase": "RUNNER_PHASE_UNSPECIFIED", + }, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.list( + connect_protocol_version=1, + ) + assert_matches_type(RunnerListResponse, runner, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.list( + connect_protocol_version=1, + filter={ + "creator_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "kinds": ["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(RunnerListResponse, runner, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerListResponse, runner, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerListResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.check_authentication_for_host( + connect_protocol_version=1, + ) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + + @parametrize + async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.check_authentication_for_host( + connect_protocol_version=1, + host="host", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + + @parametrize + async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.check_authentication_for_host( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + + @parametrize + async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.check_authentication_for_host( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create_runner_token( + connect_protocol_version=1, + ) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + + @parametrize + async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create_runner_token( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + + @parametrize + async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.create_runner_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + + @parametrize + async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.create_runner_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete_runner(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.delete_runner( + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_method_delete_runner_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.delete_runner( + connect_protocol_version=1, + force=True, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_raw_response_delete_runner(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.delete_runner( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_streaming_response_delete_runner(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.delete_runner( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(object, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_runner(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.get_runner( + connect_protocol_version=1, + ) + assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + + @parametrize + async def test_method_get_runner_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.get_runner( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + + @parametrize + async def test_raw_response_get_runner(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.get_runner( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + + @parametrize + async def test_streaming_response_get_runner(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.get_runner( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.parse_context_url( + connect_protocol_version=1, + ) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + + @parametrize + async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.parse_context_url( + connect_protocol_version=1, + context_url="https://example.com", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + + @parametrize + async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.parse_context_url( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + + @parametrize + async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.parse_context_url( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_runner(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update_runner( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_method_update_runner_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update_runner( + body={ + "name": "xxx", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "spec": {}, + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_raw_response_update_runner(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.update_runner( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_streaming_response_update_runner(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.update_runner( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(object, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_services.py b/tests/api_resources/test_services.py new file mode 100644 index 00000000..115968e2 --- /dev/null +++ b/tests/api_resources/test_services.py @@ -0,0 +1,553 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + ServiceListResponse, + ServiceListCreateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestServices: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Gitpod) -> None: + service = client.services.update( + connect_protocol_version=1, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + service = client.services.update( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={}, + spec={}, + status={}, + connect_timeout_ms=0, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.services.with_raw_response.update( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = response.parse() + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.services.with_streaming_response.update( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = response.parse() + assert_matches_type(object, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + service = client.services.list( + connect_protocol_version=1, + ) + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + service = client.services.list( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.services.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = response.parse() + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.services.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = response.parse() + assert_matches_type(ServiceListResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + service = client.services.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + service = client.services.delete( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + force=True, + connect_timeout_ms=0, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.services.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = response.parse() + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.services.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = response.parse() + assert_matches_type(object, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list_create(self, client: Gitpod) -> None: + service = client.services.list_create( + connect_protocol_version=1, + ) + assert_matches_type(ServiceListCreateResponse, service, path=["response"]) + + @parametrize + def test_method_list_create_with_all_params(self, client: Gitpod) -> None: + service = client.services.list_create( + connect_protocol_version=1, + filter={ + "environment_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "references": ["x", "x", "x"], + "service_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(ServiceListCreateResponse, service, path=["response"]) + + @parametrize + def test_raw_response_list_create(self, client: Gitpod) -> None: + response = client.services.with_raw_response.list_create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = response.parse() + assert_matches_type(ServiceListCreateResponse, service, path=["response"]) + + @parametrize + def test_streaming_response_list_create(self, client: Gitpod) -> None: + with client.services.with_streaming_response.list_create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = response.parse() + assert_matches_type(ServiceListCreateResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_start(self, client: Gitpod) -> None: + service = client.services.start( + connect_protocol_version=1, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_method_start_with_all_params(self, client: Gitpod) -> None: + service = client.services.start( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_raw_response_start(self, client: Gitpod) -> None: + response = client.services.with_raw_response.start( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = response.parse() + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_streaming_response_start(self, client: Gitpod) -> None: + with client.services.with_streaming_response.start( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = response.parse() + assert_matches_type(object, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_stop(self, client: Gitpod) -> None: + service = client.services.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_method_stop_with_all_params(self, client: Gitpod) -> None: + service = client.services.stop( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_raw_response_stop(self, client: Gitpod) -> None: + response = client.services.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = response.parse() + assert_matches_type(object, service, path=["response"]) + + @parametrize + def test_streaming_response_stop(self, client: Gitpod) -> None: + with client.services.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = response.parse() + assert_matches_type(object, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncServices: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.update( + connect_protocol_version=1, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.update( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={}, + spec={}, + status={}, + connect_timeout_ms=0, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.services.with_raw_response.update( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = await response.parse() + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.services.with_streaming_response.update( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = await response.parse() + assert_matches_type(object, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.list( + connect_protocol_version=1, + ) + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.list( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.services.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = await response.parse() + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.services.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = await response.parse() + assert_matches_type(ServiceListResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.delete( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + force=True, + connect_timeout_ms=0, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.services.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = await response.parse() + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.services.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = await response.parse() + assert_matches_type(object, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list_create(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.list_create( + connect_protocol_version=1, + ) + assert_matches_type(ServiceListCreateResponse, service, path=["response"]) + + @parametrize + async def test_method_list_create_with_all_params(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.list_create( + connect_protocol_version=1, + filter={ + "environment_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + "references": ["x", "x", "x"], + "service_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(ServiceListCreateResponse, service, path=["response"]) + + @parametrize + async def test_raw_response_list_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.services.with_raw_response.list_create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = await response.parse() + assert_matches_type(ServiceListCreateResponse, service, path=["response"]) + + @parametrize + async def test_streaming_response_list_create(self, async_client: AsyncGitpod) -> None: + async with async_client.services.with_streaming_response.list_create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = await response.parse() + assert_matches_type(ServiceListCreateResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_start(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.start( + connect_protocol_version=1, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.start( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: + response = await async_client.services.with_raw_response.start( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = await response.parse() + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: + async with async_client.services.with_streaming_response.start( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = await response.parse() + assert_matches_type(object, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_stop(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: + service = await async_client.services.stop( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: + response = await async_client.services.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = await response.parse() + assert_matches_type(object, service, path=["response"]) + + @parametrize + async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: + async with async_client.services.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = await response.parse() + assert_matches_type(object, service, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_tasks.py b/tests/api_resources/test_tasks.py new file mode 100644 index 00000000..f0a4ea03 --- /dev/null +++ b/tests/api_resources/test_tasks.py @@ -0,0 +1,309 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + TaskCreateResponse, + TaskRetrieveResponse, + TaskRetrieveCreateResponse, +) +from gitpod._utils import parse_datetime + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTasks: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + task = client.tasks.create( + connect_protocol_version=1, + ) + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + task = client.tasks.create( + connect_protocol_version=1, + depends_on=[ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={ + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "creator": { + "id": "id", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "description": "description", + "name": "x", + "reference": "reference", + "triggered_by": [{}, {}, {}], + }, + spec={"command": "command"}, + connect_timeout_ms=0, + ) + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.tasks.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.tasks.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + task = client.tasks.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + task = client.tasks.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.tasks.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.tasks.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve_create(self, client: Gitpod) -> None: + task = client.tasks.retrieve_create( + connect_protocol_version=1, + ) + assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) + + @parametrize + def test_method_retrieve_create_with_all_params(self, client: Gitpod) -> None: + task = client.tasks.retrieve_create( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) + + @parametrize + def test_raw_response_retrieve_create(self, client: Gitpod) -> None: + response = client.tasks.with_raw_response.retrieve_create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) + + @parametrize + def test_streaming_response_retrieve_create(self, client: Gitpod) -> None: + with client.tasks.with_streaming_response.retrieve_create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncTasks: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + task = await async_client.tasks.create( + connect_protocol_version=1, + ) + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.tasks.create( + connect_protocol_version=1, + depends_on=[ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ], + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={ + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "creator": { + "id": "id", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "description": "description", + "name": "x", + "reference": "reference", + "triggered_by": [{}, {}, {}], + }, + spec={"command": "command"}, + connect_timeout_ms=0, + ) + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.tasks.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.tasks.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + task = await async_client.tasks.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.tasks.retrieve( + connect_protocol_version=1, + base64="base64", + compression="compression", + connect="connect", + encoding="encoding", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.tasks.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.tasks.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve_create(self, async_client: AsyncGitpod) -> None: + task = await async_client.tasks.retrieve_create( + connect_protocol_version=1, + ) + assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) + + @parametrize + async def test_method_retrieve_create_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.tasks.retrieve_create( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) + + @parametrize + async def test_raw_response_retrieve_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.tasks.with_raw_response.retrieve_create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve_create(self, async_client: AsyncGitpod) -> None: + async with async_client.tasks.with_streaming_response.retrieve_create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 00000000..ef7ca2c5 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,49 @@ +from __future__ import annotations + +import os +import logging +from typing import TYPE_CHECKING, Iterator, AsyncIterator + +import pytest +from pytest_asyncio import is_async_test + +from gitpod import Gitpod, AsyncGitpod + +if TYPE_CHECKING: + from _pytest.fixtures import FixtureRequest + +pytest.register_assert_rewrite("tests.utils") + +logging.getLogger("gitpod").setLevel(logging.DEBUG) + + +# automatically add `pytest.mark.asyncio()` to all of our async tests +# so we don't have to add that boilerplate everywhere +def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: + pytest_asyncio_tests = (item for item in items if is_async_test(item)) + session_scope_marker = pytest.mark.asyncio(loop_scope="session") + for async_test in pytest_asyncio_tests: + async_test.add_marker(session_scope_marker, append=False) + + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +@pytest.fixture(scope="session") +def client(request: FixtureRequest) -> Iterator[Gitpod]: + strict = getattr(request, "param", True) + if not isinstance(strict, bool): + raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") + + with Gitpod(base_url=base_url, _strict_response_validation=strict) as client: + yield client + + +@pytest.fixture(scope="session") +async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncGitpod]: + strict = getattr(request, "param", True) + if not isinstance(strict, bool): + raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") + + async with AsyncGitpod(base_url=base_url, _strict_response_validation=strict) as client: + yield client diff --git a/tests/sample_file.txt b/tests/sample_file.txt new file mode 100644 index 00000000..af5626b4 --- /dev/null +++ b/tests/sample_file.txt @@ -0,0 +1 @@ +Hello, world! diff --git a/tests/test_client.py b/tests/test_client.py new file mode 100644 index 00000000..a5df55d0 --- /dev/null +++ b/tests/test_client.py @@ -0,0 +1,1510 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import gc +import os +import json +import asyncio +import inspect +import tracemalloc +from typing import Any, Union, cast +from unittest import mock +from typing_extensions import Literal + +import httpx +import pytest +from respx import MockRouter +from pydantic import ValidationError + +from gitpod import Gitpod, AsyncGitpod, APIResponseValidationError +from gitpod._types import Omit +from gitpod._models import BaseModel, FinalRequestOptions +from gitpod._constants import RAW_RESPONSE_HEADER +from gitpod._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError +from gitpod._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options + +from .utils import update_env + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +def _get_params(client: BaseClient[Any, Any]) -> dict[str, str]: + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + url = httpx.URL(request.url) + return dict(url.params) + + +def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: + return 0.1 + + +def _get_open_connections(client: Gitpod | AsyncGitpod) -> int: + transport = client._client._transport + assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) + + pool = transport._pool + return len(pool._requests) + + +class TestGitpod: + client = Gitpod(base_url=base_url, _strict_response_validation=True) + + @pytest.mark.respx(base_url=base_url) + def test_raw_response(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = self.client.post("/foo", cast_to=httpx.Response) + assert response.status_code == 200 + assert isinstance(response, httpx.Response) + assert response.json() == {"foo": "bar"} + + @pytest.mark.respx(base_url=base_url) + def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock( + return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') + ) + + response = self.client.post("/foo", cast_to=httpx.Response) + assert response.status_code == 200 + assert isinstance(response, httpx.Response) + assert response.json() == {"foo": "bar"} + + def test_copy(self) -> None: + copied = self.client.copy() + assert id(copied) != id(self.client) + + def test_copy_default_options(self) -> None: + # options that have a default are overridden correctly + copied = self.client.copy(max_retries=7) + assert copied.max_retries == 7 + assert self.client.max_retries == 2 + + copied2 = copied.copy(max_retries=6) + assert copied2.max_retries == 6 + assert copied.max_retries == 7 + + # timeout + assert isinstance(self.client.timeout, httpx.Timeout) + copied = self.client.copy(timeout=None) + assert copied.timeout is None + assert isinstance(self.client.timeout, httpx.Timeout) + + def test_copy_default_headers(self) -> None: + client = Gitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + assert client.default_headers["X-Foo"] == "bar" + + # does not override the already given value when not specified + copied = client.copy() + assert copied.default_headers["X-Foo"] == "bar" + + # merges already given headers + copied = client.copy(default_headers={"X-Bar": "stainless"}) + assert copied.default_headers["X-Foo"] == "bar" + assert copied.default_headers["X-Bar"] == "stainless" + + # uses new values for any already given headers + copied = client.copy(default_headers={"X-Foo": "stainless"}) + assert copied.default_headers["X-Foo"] == "stainless" + + # set_default_headers + + # completely overrides already set values + copied = client.copy(set_default_headers={}) + assert copied.default_headers.get("X-Foo") is None + + copied = client.copy(set_default_headers={"X-Bar": "Robert"}) + assert copied.default_headers["X-Bar"] == "Robert" + + with pytest.raises( + ValueError, + match="`default_headers` and `set_default_headers` arguments are mutually exclusive", + ): + client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + + def test_copy_default_query(self) -> None: + client = Gitpod(base_url=base_url, _strict_response_validation=True, default_query={"foo": "bar"}) + assert _get_params(client)["foo"] == "bar" + + # does not override the already given value when not specified + copied = client.copy() + assert _get_params(copied)["foo"] == "bar" + + # merges already given params + copied = client.copy(default_query={"bar": "stainless"}) + params = _get_params(copied) + assert params["foo"] == "bar" + assert params["bar"] == "stainless" + + # uses new values for any already given headers + copied = client.copy(default_query={"foo": "stainless"}) + assert _get_params(copied)["foo"] == "stainless" + + # set_default_query + + # completely overrides already set values + copied = client.copy(set_default_query={}) + assert _get_params(copied) == {} + + copied = client.copy(set_default_query={"bar": "Robert"}) + assert _get_params(copied)["bar"] == "Robert" + + with pytest.raises( + ValueError, + # TODO: update + match="`default_query` and `set_default_query` arguments are mutually exclusive", + ): + client.copy(set_default_query={}, default_query={"foo": "Bar"}) + + def test_copy_signature(self) -> None: + # ensure the same parameters that can be passed to the client are defined in the `.copy()` method + init_signature = inspect.signature( + # mypy doesn't like that we access the `__init__` property. + self.client.__init__, # type: ignore[misc] + ) + copy_signature = inspect.signature(self.client.copy) + exclude_params = {"transport", "proxies", "_strict_response_validation"} + + for name in init_signature.parameters.keys(): + if name in exclude_params: + continue + + copy_param = copy_signature.parameters.get(name) + assert copy_param is not None, f"copy() signature is missing the {name} param" + + def test_copy_build_request(self) -> None: + options = FinalRequestOptions(method="get", url="/foo") + + def build_request(options: FinalRequestOptions) -> None: + client = self.client.copy() + client._build_request(options) + + # ensure that the machinery is warmed up before tracing starts. + build_request(options) + gc.collect() + + tracemalloc.start(1000) + + snapshot_before = tracemalloc.take_snapshot() + + ITERATIONS = 10 + for _ in range(ITERATIONS): + build_request(options) + + gc.collect() + snapshot_after = tracemalloc.take_snapshot() + + tracemalloc.stop() + + def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff) -> None: + if diff.count == 0: + # Avoid false positives by considering only leaks (i.e. allocations that persist). + return + + if diff.count % ITERATIONS != 0: + # Avoid false positives by considering only leaks that appear per iteration. + return + + for frame in diff.traceback: + if any( + frame.filename.endswith(fragment) + for fragment in [ + # to_raw_response_wrapper leaks through the @functools.wraps() decorator. + # + # removing the decorator fixes the leak for reasons we don't understand. + "gitpod/_legacy_response.py", + "gitpod/_response.py", + # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. + "gitpod/_compat.py", + # Standard library leaks we don't care about. + "/logging/__init__.py", + ] + ): + return + + leaks.append(diff) + + leaks: list[tracemalloc.StatisticDiff] = [] + for diff in snapshot_after.compare_to(snapshot_before, "traceback"): + add_leak(leaks, diff) + if leaks: + for leak in leaks: + print("MEMORY LEAK:", leak) + for frame in leak.traceback: + print(frame) + raise AssertionError() + + def test_request_timeout(self) -> None: + request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT + + request = self.client._build_request( + FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) + ) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(100.0) + + def test_client_timeout_option(self) -> None: + client = Gitpod(base_url=base_url, _strict_response_validation=True, timeout=httpx.Timeout(0)) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(0) + + def test_http_client_timeout_option(self) -> None: + # custom timeout given to the httpx client should be used + with httpx.Client(timeout=None) as http_client: + client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(None) + + # no timeout given to the httpx client should not use the httpx default + with httpx.Client() as http_client: + client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT + + # explicitly passing the default timeout currently results in it being ignored + with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: + client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT # our default + + async def test_invalid_http_client(self) -> None: + with pytest.raises(TypeError, match="Invalid `http_client` arg"): + async with httpx.AsyncClient() as http_client: + Gitpod(base_url=base_url, _strict_response_validation=True, http_client=cast(Any, http_client)) + + def test_default_headers_option(self) -> None: + client = Gitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("x-foo") == "bar" + assert request.headers.get("x-stainless-lang") == "python" + + client2 = Gitpod( + base_url=base_url, + _strict_response_validation=True, + default_headers={ + "X-Foo": "stainless", + "X-Stainless-Lang": "my-overriding-header", + }, + ) + request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("x-foo") == "stainless" + assert request.headers.get("x-stainless-lang") == "my-overriding-header" + + def test_default_query_option(self) -> None: + client = Gitpod(base_url=base_url, _strict_response_validation=True, default_query={"query_param": "bar"}) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + url = httpx.URL(request.url) + assert dict(url.params) == {"query_param": "bar"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo", + params={"foo": "baz", "query_param": "overriden"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + + def test_request_extra_json(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + extra_json={"baz": False}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"foo": "bar", "baz": False} + + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + extra_json={"baz": False}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"baz": False} + + # `extra_json` takes priority over `json_data` when keys clash + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar", "baz": True}, + extra_json={"baz": None}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"foo": "bar", "baz": None} + + def test_request_extra_headers(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options(extra_headers={"X-Foo": "Foo"}), + ), + ) + assert request.headers.get("X-Foo") == "Foo" + + # `extra_headers` takes priority over `default_headers` when keys clash + request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + extra_headers={"X-Bar": "false"}, + ), + ), + ) + assert request.headers.get("X-Bar") == "false" + + def test_request_extra_query(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + extra_query={"my_query_param": "Foo"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"my_query_param": "Foo"} + + # if both `query` and `extra_query` are given, they are merged + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + query={"bar": "1"}, + extra_query={"foo": "2"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"bar": "1", "foo": "2"} + + # `extra_query` takes priority over `query` when keys clash + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + query={"foo": "1"}, + extra_query={"foo": "2"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"foo": "2"} + + def test_multipart_repeating_array(self, client: Gitpod) -> None: + request = client._build_request( + FinalRequestOptions.construct( + method="get", + url="/foo", + headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, + json_data={"array": ["foo", "bar"]}, + files=[("foo.txt", b"hello world")], + ) + ) + + assert request.read().split(b"\r\n") == [ + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="array[]"', + b"", + b"foo", + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="array[]"', + b"", + b"bar", + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="foo.txt"; filename="upload"', + b"Content-Type: application/octet-stream", + b"", + b"hello world", + b"--6b7ba517decee4a450543ea6ae821c82--", + b"", + ] + + @pytest.mark.respx(base_url=base_url) + def test_basic_union_response(self, respx_mock: MockRouter) -> None: + class Model1(BaseModel): + name: str + + class Model2(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model2) + assert response.foo == "bar" + + @pytest.mark.respx(base_url=base_url) + def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + """Union of objects with the same field name using a different type""" + + class Model1(BaseModel): + foo: int + + class Model2(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model2) + assert response.foo == "bar" + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) + + response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model1) + assert response.foo == 1 + + @pytest.mark.respx(base_url=base_url) + def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + """ + Response that sets Content-Type to something other than application/json but returns json data + """ + + class Model(BaseModel): + foo: int + + respx_mock.get("/foo").mock( + return_value=httpx.Response( + 200, + content=json.dumps({"foo": 2}), + headers={"Content-Type": "application/text"}, + ) + ) + + response = self.client.get("/foo", cast_to=Model) + assert isinstance(response, Model) + assert response.foo == 2 + + def test_base_url_setter(self) -> None: + client = Gitpod(base_url="https://example.com/from_init", _strict_response_validation=True) + assert client.base_url == "https://example.com/from_init/" + + client.base_url = "https://example.com/from_setter" # type: ignore[assignment] + + assert client.base_url == "https://example.com/from_setter/" + + def test_base_url_env(self) -> None: + with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): + client = Gitpod(_strict_response_validation=True) + assert client.base_url == "http://localhost:5000/from/env/" + + @pytest.mark.parametrize( + "client", + [ + Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + Gitpod( + base_url="http://localhost:5000/custom/path/", + _strict_response_validation=True, + http_client=httpx.Client(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_base_url_trailing_slash(self, client: Gitpod) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "http://localhost:5000/custom/path/foo" + + @pytest.mark.parametrize( + "client", + [ + Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + Gitpod( + base_url="http://localhost:5000/custom/path/", + _strict_response_validation=True, + http_client=httpx.Client(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_base_url_no_trailing_slash(self, client: Gitpod) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "http://localhost:5000/custom/path/foo" + + @pytest.mark.parametrize( + "client", + [ + Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + Gitpod( + base_url="http://localhost:5000/custom/path/", + _strict_response_validation=True, + http_client=httpx.Client(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_absolute_request_url(self, client: Gitpod) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="https://myapi.com/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "https://myapi.com/foo" + + def test_copied_client_does_not_close_http(self) -> None: + client = Gitpod(base_url=base_url, _strict_response_validation=True) + assert not client.is_closed() + + copied = client.copy() + assert copied is not client + + del copied + + assert not client.is_closed() + + def test_client_context_manager(self) -> None: + client = Gitpod(base_url=base_url, _strict_response_validation=True) + with client as c2: + assert c2 is client + assert not c2.is_closed() + assert not client.is_closed() + assert client.is_closed() + + @pytest.mark.respx(base_url=base_url) + def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) + + with pytest.raises(APIResponseValidationError) as exc: + self.client.get("/foo", cast_to=Model) + + assert isinstance(exc.value.__cause__, ValidationError) + + def test_client_max_retries_validation(self) -> None: + with pytest.raises(TypeError, match=r"max_retries cannot be None"): + Gitpod(base_url=base_url, _strict_response_validation=True, max_retries=cast(Any, None)) + + @pytest.mark.respx(base_url=base_url) + def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + name: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) + + strict_client = Gitpod(base_url=base_url, _strict_response_validation=True) + + with pytest.raises(APIResponseValidationError): + strict_client.get("/foo", cast_to=Model) + + client = Gitpod(base_url=base_url, _strict_response_validation=False) + + response = client.get("/foo", cast_to=Model) + assert isinstance(response, str) # type: ignore[unreachable] + + @pytest.mark.parametrize( + "remaining_retries,retry_after,timeout", + [ + [3, "20", 20], + [3, "0", 0.5], + [3, "-10", 0.5], + [3, "60", 60], + [3, "61", 0.5], + [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], + [3, "99999999999999999999999999999999999", 0.5], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "", 0.5], + [2, "", 0.5 * 2.0], + [1, "", 0.5 * 4.0], + [-1100, "", 7.8], # test large number potentially overflowing + ], + ) + @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) + def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: + client = Gitpod(base_url=base_url, _strict_response_validation=True) + + headers = httpx.Headers({"retry-after": retry_after}) + options = FinalRequestOptions(method="get", url="/foo", max_retries=3) + calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock( + side_effect=httpx.TimeoutException("Test timeout error") + ) + + with pytest.raises(APITimeoutError): + self.client.post( + "/gitpod.v1.RunnerService/CreateRunner", + body=cast(object, dict()), + cast_to=httpx.Response, + options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, + ) + + assert _get_open_connections(self.client) == 0 + + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(return_value=httpx.Response(500)) + + with pytest.raises(APIStatusError): + self.client.post( + "/gitpod.v1.RunnerService/CreateRunner", + body=cast(object, dict()), + cast_to=httpx.Response, + options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, + ) + + assert _get_open_connections(self.client) == 0 + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + @pytest.mark.parametrize("failure_mode", ["status", "exception"]) + def test_retries_taken( + self, + client: Gitpod, + failures_before_success: int, + failure_mode: Literal["status", "exception"], + respx_mock: MockRouter, + ) -> None: + client = client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + if failure_mode == "exception": + raise RuntimeError("oops") + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + + response = client.runners.with_raw_response.create(connect_protocol_version=1) + + assert response.retries_taken == failures_before_success + assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + def test_omit_retry_count_header( + self, client: Gitpod, failures_before_success: int, respx_mock: MockRouter + ) -> None: + client = client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + + response = client.runners.with_raw_response.create( + connect_protocol_version=1, extra_headers={"x-stainless-retry-count": Omit()} + ) + + assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + def test_overwrite_retry_count_header( + self, client: Gitpod, failures_before_success: int, respx_mock: MockRouter + ) -> None: + client = client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + + response = client.runners.with_raw_response.create( + connect_protocol_version=1, extra_headers={"x-stainless-retry-count": "42"} + ) + + assert response.http_request.headers.get("x-stainless-retry-count") == "42" + + +class TestAsyncGitpod: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_raw_response(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = await self.client.post("/foo", cast_to=httpx.Response) + assert response.status_code == 200 + assert isinstance(response, httpx.Response) + assert response.json() == {"foo": "bar"} + + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock( + return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') + ) + + response = await self.client.post("/foo", cast_to=httpx.Response) + assert response.status_code == 200 + assert isinstance(response, httpx.Response) + assert response.json() == {"foo": "bar"} + + def test_copy(self) -> None: + copied = self.client.copy() + assert id(copied) != id(self.client) + + def test_copy_default_options(self) -> None: + # options that have a default are overridden correctly + copied = self.client.copy(max_retries=7) + assert copied.max_retries == 7 + assert self.client.max_retries == 2 + + copied2 = copied.copy(max_retries=6) + assert copied2.max_retries == 6 + assert copied.max_retries == 7 + + # timeout + assert isinstance(self.client.timeout, httpx.Timeout) + copied = self.client.copy(timeout=None) + assert copied.timeout is None + assert isinstance(self.client.timeout, httpx.Timeout) + + def test_copy_default_headers(self) -> None: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + assert client.default_headers["X-Foo"] == "bar" + + # does not override the already given value when not specified + copied = client.copy() + assert copied.default_headers["X-Foo"] == "bar" + + # merges already given headers + copied = client.copy(default_headers={"X-Bar": "stainless"}) + assert copied.default_headers["X-Foo"] == "bar" + assert copied.default_headers["X-Bar"] == "stainless" + + # uses new values for any already given headers + copied = client.copy(default_headers={"X-Foo": "stainless"}) + assert copied.default_headers["X-Foo"] == "stainless" + + # set_default_headers + + # completely overrides already set values + copied = client.copy(set_default_headers={}) + assert copied.default_headers.get("X-Foo") is None + + copied = client.copy(set_default_headers={"X-Bar": "Robert"}) + assert copied.default_headers["X-Bar"] == "Robert" + + with pytest.raises( + ValueError, + match="`default_headers` and `set_default_headers` arguments are mutually exclusive", + ): + client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + + def test_copy_default_query(self) -> None: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_query={"foo": "bar"}) + assert _get_params(client)["foo"] == "bar" + + # does not override the already given value when not specified + copied = client.copy() + assert _get_params(copied)["foo"] == "bar" + + # merges already given params + copied = client.copy(default_query={"bar": "stainless"}) + params = _get_params(copied) + assert params["foo"] == "bar" + assert params["bar"] == "stainless" + + # uses new values for any already given headers + copied = client.copy(default_query={"foo": "stainless"}) + assert _get_params(copied)["foo"] == "stainless" + + # set_default_query + + # completely overrides already set values + copied = client.copy(set_default_query={}) + assert _get_params(copied) == {} + + copied = client.copy(set_default_query={"bar": "Robert"}) + assert _get_params(copied)["bar"] == "Robert" + + with pytest.raises( + ValueError, + # TODO: update + match="`default_query` and `set_default_query` arguments are mutually exclusive", + ): + client.copy(set_default_query={}, default_query={"foo": "Bar"}) + + def test_copy_signature(self) -> None: + # ensure the same parameters that can be passed to the client are defined in the `.copy()` method + init_signature = inspect.signature( + # mypy doesn't like that we access the `__init__` property. + self.client.__init__, # type: ignore[misc] + ) + copy_signature = inspect.signature(self.client.copy) + exclude_params = {"transport", "proxies", "_strict_response_validation"} + + for name in init_signature.parameters.keys(): + if name in exclude_params: + continue + + copy_param = copy_signature.parameters.get(name) + assert copy_param is not None, f"copy() signature is missing the {name} param" + + def test_copy_build_request(self) -> None: + options = FinalRequestOptions(method="get", url="/foo") + + def build_request(options: FinalRequestOptions) -> None: + client = self.client.copy() + client._build_request(options) + + # ensure that the machinery is warmed up before tracing starts. + build_request(options) + gc.collect() + + tracemalloc.start(1000) + + snapshot_before = tracemalloc.take_snapshot() + + ITERATIONS = 10 + for _ in range(ITERATIONS): + build_request(options) + + gc.collect() + snapshot_after = tracemalloc.take_snapshot() + + tracemalloc.stop() + + def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff) -> None: + if diff.count == 0: + # Avoid false positives by considering only leaks (i.e. allocations that persist). + return + + if diff.count % ITERATIONS != 0: + # Avoid false positives by considering only leaks that appear per iteration. + return + + for frame in diff.traceback: + if any( + frame.filename.endswith(fragment) + for fragment in [ + # to_raw_response_wrapper leaks through the @functools.wraps() decorator. + # + # removing the decorator fixes the leak for reasons we don't understand. + "gitpod/_legacy_response.py", + "gitpod/_response.py", + # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. + "gitpod/_compat.py", + # Standard library leaks we don't care about. + "/logging/__init__.py", + ] + ): + return + + leaks.append(diff) + + leaks: list[tracemalloc.StatisticDiff] = [] + for diff in snapshot_after.compare_to(snapshot_before, "traceback"): + add_leak(leaks, diff) + if leaks: + for leak in leaks: + print("MEMORY LEAK:", leak) + for frame in leak.traceback: + print(frame) + raise AssertionError() + + async def test_request_timeout(self) -> None: + request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT + + request = self.client._build_request( + FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) + ) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(100.0) + + async def test_client_timeout_option(self) -> None: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, timeout=httpx.Timeout(0)) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(0) + + async def test_http_client_timeout_option(self) -> None: + # custom timeout given to the httpx client should be used + async with httpx.AsyncClient(timeout=None) as http_client: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(None) + + # no timeout given to the httpx client should not use the httpx default + async with httpx.AsyncClient() as http_client: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT + + # explicitly passing the default timeout currently results in it being ignored + async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT # our default + + def test_invalid_http_client(self) -> None: + with pytest.raises(TypeError, match="Invalid `http_client` arg"): + with httpx.Client() as http_client: + AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=cast(Any, http_client)) + + def test_default_headers_option(self) -> None: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("x-foo") == "bar" + assert request.headers.get("x-stainless-lang") == "python" + + client2 = AsyncGitpod( + base_url=base_url, + _strict_response_validation=True, + default_headers={ + "X-Foo": "stainless", + "X-Stainless-Lang": "my-overriding-header", + }, + ) + request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("x-foo") == "stainless" + assert request.headers.get("x-stainless-lang") == "my-overriding-header" + + def test_default_query_option(self) -> None: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_query={"query_param": "bar"}) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + url = httpx.URL(request.url) + assert dict(url.params) == {"query_param": "bar"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo", + params={"foo": "baz", "query_param": "overriden"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + + def test_request_extra_json(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + extra_json={"baz": False}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"foo": "bar", "baz": False} + + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + extra_json={"baz": False}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"baz": False} + + # `extra_json` takes priority over `json_data` when keys clash + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar", "baz": True}, + extra_json={"baz": None}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"foo": "bar", "baz": None} + + def test_request_extra_headers(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options(extra_headers={"X-Foo": "Foo"}), + ), + ) + assert request.headers.get("X-Foo") == "Foo" + + # `extra_headers` takes priority over `default_headers` when keys clash + request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + extra_headers={"X-Bar": "false"}, + ), + ), + ) + assert request.headers.get("X-Bar") == "false" + + def test_request_extra_query(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + extra_query={"my_query_param": "Foo"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"my_query_param": "Foo"} + + # if both `query` and `extra_query` are given, they are merged + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + query={"bar": "1"}, + extra_query={"foo": "2"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"bar": "1", "foo": "2"} + + # `extra_query` takes priority over `query` when keys clash + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + query={"foo": "1"}, + extra_query={"foo": "2"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"foo": "2"} + + def test_multipart_repeating_array(self, async_client: AsyncGitpod) -> None: + request = async_client._build_request( + FinalRequestOptions.construct( + method="get", + url="/foo", + headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, + json_data={"array": ["foo", "bar"]}, + files=[("foo.txt", b"hello world")], + ) + ) + + assert request.read().split(b"\r\n") == [ + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="array[]"', + b"", + b"foo", + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="array[]"', + b"", + b"bar", + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="foo.txt"; filename="upload"', + b"Content-Type: application/octet-stream", + b"", + b"hello world", + b"--6b7ba517decee4a450543ea6ae821c82--", + b"", + ] + + @pytest.mark.respx(base_url=base_url) + async def test_basic_union_response(self, respx_mock: MockRouter) -> None: + class Model1(BaseModel): + name: str + + class Model2(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model2) + assert response.foo == "bar" + + @pytest.mark.respx(base_url=base_url) + async def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + """Union of objects with the same field name using a different type""" + + class Model1(BaseModel): + foo: int + + class Model2(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model2) + assert response.foo == "bar" + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) + + response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model1) + assert response.foo == 1 + + @pytest.mark.respx(base_url=base_url) + async def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + """ + Response that sets Content-Type to something other than application/json but returns json data + """ + + class Model(BaseModel): + foo: int + + respx_mock.get("/foo").mock( + return_value=httpx.Response( + 200, + content=json.dumps({"foo": 2}), + headers={"Content-Type": "application/text"}, + ) + ) + + response = await self.client.get("/foo", cast_to=Model) + assert isinstance(response, Model) + assert response.foo == 2 + + def test_base_url_setter(self) -> None: + client = AsyncGitpod(base_url="https://example.com/from_init", _strict_response_validation=True) + assert client.base_url == "https://example.com/from_init/" + + client.base_url = "https://example.com/from_setter" # type: ignore[assignment] + + assert client.base_url == "https://example.com/from_setter/" + + def test_base_url_env(self) -> None: + with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): + client = AsyncGitpod(_strict_response_validation=True) + assert client.base_url == "http://localhost:5000/from/env/" + + @pytest.mark.parametrize( + "client", + [ + AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + AsyncGitpod( + base_url="http://localhost:5000/custom/path/", + _strict_response_validation=True, + http_client=httpx.AsyncClient(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "http://localhost:5000/custom/path/foo" + + @pytest.mark.parametrize( + "client", + [ + AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + AsyncGitpod( + base_url="http://localhost:5000/custom/path/", + _strict_response_validation=True, + http_client=httpx.AsyncClient(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "http://localhost:5000/custom/path/foo" + + @pytest.mark.parametrize( + "client", + [ + AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + AsyncGitpod( + base_url="http://localhost:5000/custom/path/", + _strict_response_validation=True, + http_client=httpx.AsyncClient(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_absolute_request_url(self, client: AsyncGitpod) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="https://myapi.com/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "https://myapi.com/foo" + + async def test_copied_client_does_not_close_http(self) -> None: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + assert not client.is_closed() + + copied = client.copy() + assert copied is not client + + del copied + + await asyncio.sleep(0.2) + assert not client.is_closed() + + async def test_client_context_manager(self) -> None: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + async with client as c2: + assert c2 is client + assert not c2.is_closed() + assert not client.is_closed() + assert client.is_closed() + + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) + + with pytest.raises(APIResponseValidationError) as exc: + await self.client.get("/foo", cast_to=Model) + + assert isinstance(exc.value.__cause__, ValidationError) + + async def test_client_max_retries_validation(self) -> None: + with pytest.raises(TypeError, match=r"max_retries cannot be None"): + AsyncGitpod(base_url=base_url, _strict_response_validation=True, max_retries=cast(Any, None)) + + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + name: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) + + strict_client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + + with pytest.raises(APIResponseValidationError): + await strict_client.get("/foo", cast_to=Model) + + client = AsyncGitpod(base_url=base_url, _strict_response_validation=False) + + response = await client.get("/foo", cast_to=Model) + assert isinstance(response, str) # type: ignore[unreachable] + + @pytest.mark.parametrize( + "remaining_retries,retry_after,timeout", + [ + [3, "20", 20], + [3, "0", 0.5], + [3, "-10", 0.5], + [3, "60", 60], + [3, "61", 0.5], + [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], + [3, "99999999999999999999999999999999999", 0.5], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "", 0.5], + [2, "", 0.5 * 2.0], + [1, "", 0.5 * 4.0], + [-1100, "", 7.8], # test large number potentially overflowing + ], + ) + @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) + @pytest.mark.asyncio + async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + + headers = httpx.Headers({"retry-after": retry_after}) + options = FinalRequestOptions(method="get", url="/foo", max_retries=3) + calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock( + side_effect=httpx.TimeoutException("Test timeout error") + ) + + with pytest.raises(APITimeoutError): + await self.client.post( + "/gitpod.v1.RunnerService/CreateRunner", + body=cast(object, dict()), + cast_to=httpx.Response, + options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, + ) + + assert _get_open_connections(self.client) == 0 + + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(return_value=httpx.Response(500)) + + with pytest.raises(APIStatusError): + await self.client.post( + "/gitpod.v1.RunnerService/CreateRunner", + body=cast(object, dict()), + cast_to=httpx.Response, + options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, + ) + + assert _get_open_connections(self.client) == 0 + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + @pytest.mark.parametrize("failure_mode", ["status", "exception"]) + async def test_retries_taken( + self, + async_client: AsyncGitpod, + failures_before_success: int, + failure_mode: Literal["status", "exception"], + respx_mock: MockRouter, + ) -> None: + client = async_client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + if failure_mode == "exception": + raise RuntimeError("oops") + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + + response = await client.runners.with_raw_response.create(connect_protocol_version=1) + + assert response.retries_taken == failures_before_success + assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_omit_retry_count_header( + self, async_client: AsyncGitpod, failures_before_success: int, respx_mock: MockRouter + ) -> None: + client = async_client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + + response = await client.runners.with_raw_response.create( + connect_protocol_version=1, extra_headers={"x-stainless-retry-count": Omit()} + ) + + assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_overwrite_retry_count_header( + self, async_client: AsyncGitpod, failures_before_success: int, respx_mock: MockRouter + ) -> None: + client = async_client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + + response = await client.runners.with_raw_response.create( + connect_protocol_version=1, extra_headers={"x-stainless-retry-count": "42"} + ) + + assert response.http_request.headers.get("x-stainless-retry-count") == "42" diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py new file mode 100644 index 00000000..c498f531 --- /dev/null +++ b/tests/test_deepcopy.py @@ -0,0 +1,58 @@ +from gitpod._utils import deepcopy_minimal + + +def assert_different_identities(obj1: object, obj2: object) -> None: + assert obj1 == obj2 + assert id(obj1) != id(obj2) + + +def test_simple_dict() -> None: + obj1 = {"foo": "bar"} + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + + +def test_nested_dict() -> None: + obj1 = {"foo": {"bar": True}} + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + assert_different_identities(obj1["foo"], obj2["foo"]) + + +def test_complex_nested_dict() -> None: + obj1 = {"foo": {"bar": [{"hello": "world"}]}} + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + assert_different_identities(obj1["foo"], obj2["foo"]) + assert_different_identities(obj1["foo"]["bar"], obj2["foo"]["bar"]) + assert_different_identities(obj1["foo"]["bar"][0], obj2["foo"]["bar"][0]) + + +def test_simple_list() -> None: + obj1 = ["a", "b", "c"] + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + + +def test_nested_list() -> None: + obj1 = ["a", [1, 2, 3]] + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + assert_different_identities(obj1[1], obj2[1]) + + +class MyObject: ... + + +def test_ignores_other_types() -> None: + # custom classes + my_obj = MyObject() + obj1 = {"foo": my_obj} + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + assert obj1["foo"] is my_obj + + # tuples + obj3 = ("a", "b") + obj4 = deepcopy_minimal(obj3) + assert obj3 is obj4 diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py new file mode 100644 index 00000000..0ca5a8dc --- /dev/null +++ b/tests/test_extract_files.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from typing import Sequence + +import pytest + +from gitpod._types import FileTypes +from gitpod._utils import extract_files + + +def test_removes_files_from_input() -> None: + query = {"foo": "bar"} + assert extract_files(query, paths=[]) == [] + assert query == {"foo": "bar"} + + query2 = {"foo": b"Bar", "hello": "world"} + assert extract_files(query2, paths=[["foo"]]) == [("foo", b"Bar")] + assert query2 == {"hello": "world"} + + query3 = {"foo": {"foo": {"bar": b"Bar"}}, "hello": "world"} + assert extract_files(query3, paths=[["foo", "foo", "bar"]]) == [("foo[foo][bar]", b"Bar")] + assert query3 == {"foo": {"foo": {}}, "hello": "world"} + + query4 = {"foo": {"bar": b"Bar", "baz": "foo"}, "hello": "world"} + assert extract_files(query4, paths=[["foo", "bar"]]) == [("foo[bar]", b"Bar")] + assert query4 == {"hello": "world", "foo": {"baz": "foo"}} + + +def test_multiple_files() -> None: + query = {"documents": [{"file": b"My first file"}, {"file": b"My second file"}]} + assert extract_files(query, paths=[["documents", "", "file"]]) == [ + ("documents[][file]", b"My first file"), + ("documents[][file]", b"My second file"), + ] + assert query == {"documents": [{}, {}]} + + +@pytest.mark.parametrize( + "query,paths,expected", + [ + [ + {"foo": {"bar": "baz"}}, + [["foo", "", "bar"]], + [], + ], + [ + {"foo": ["bar", "baz"]}, + [["foo", "bar"]], + [], + ], + [ + {"foo": {"bar": "baz"}}, + [["foo", "foo"]], + [], + ], + ], + ids=["dict expecting array", "array expecting dict", "unknown keys"], +) +def test_ignores_incorrect_paths( + query: dict[str, object], + paths: Sequence[Sequence[str]], + expected: list[tuple[str, FileTypes]], +) -> None: + assert extract_files(query, paths=paths) == expected diff --git a/tests/test_files.py b/tests/test_files.py new file mode 100644 index 00000000..efde0d4e --- /dev/null +++ b/tests/test_files.py @@ -0,0 +1,51 @@ +from pathlib import Path + +import anyio +import pytest +from dirty_equals import IsDict, IsList, IsBytes, IsTuple + +from gitpod._files import to_httpx_files, async_to_httpx_files + +readme_path = Path(__file__).parent.parent.joinpath("README.md") + + +def test_pathlib_includes_file_name() -> None: + result = to_httpx_files({"file": readme_path}) + print(result) + assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) + + +def test_tuple_input() -> None: + result = to_httpx_files([("file", readme_path)]) + print(result) + assert result == IsList(IsTuple("file", IsTuple("README.md", IsBytes()))) + + +@pytest.mark.asyncio +async def test_async_pathlib_includes_file_name() -> None: + result = await async_to_httpx_files({"file": readme_path}) + print(result) + assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) + + +@pytest.mark.asyncio +async def test_async_supports_anyio_path() -> None: + result = await async_to_httpx_files({"file": anyio.Path(readme_path)}) + print(result) + assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) + + +@pytest.mark.asyncio +async def test_async_tuple_input() -> None: + result = await async_to_httpx_files([("file", readme_path)]) + print(result) + assert result == IsList(IsTuple("file", IsTuple("README.md", IsBytes()))) + + +def test_string_not_allowed() -> None: + with pytest.raises(TypeError, match="Expected file types input to be a FileContent type or to be a tuple"): + to_httpx_files( + { + "file": "foo", # type: ignore + } + ) diff --git a/tests/test_models.py b/tests/test_models.py new file mode 100644 index 00000000..49f7dd6f --- /dev/null +++ b/tests/test_models.py @@ -0,0 +1,829 @@ +import json +from typing import Any, Dict, List, Union, Optional, cast +from datetime import datetime, timezone +from typing_extensions import Literal, Annotated + +import pytest +import pydantic +from pydantic import Field + +from gitpod._utils import PropertyInfo +from gitpod._compat import PYDANTIC_V2, parse_obj, model_dump, model_json +from gitpod._models import BaseModel, construct_type + + +class BasicModel(BaseModel): + foo: str + + +@pytest.mark.parametrize("value", ["hello", 1], ids=["correct type", "mismatched"]) +def test_basic(value: object) -> None: + m = BasicModel.construct(foo=value) + assert m.foo == value + + +def test_directly_nested_model() -> None: + class NestedModel(BaseModel): + nested: BasicModel + + m = NestedModel.construct(nested={"foo": "Foo!"}) + assert m.nested.foo == "Foo!" + + # mismatched types + m = NestedModel.construct(nested="hello!") + assert cast(Any, m.nested) == "hello!" + + +def test_optional_nested_model() -> None: + class NestedModel(BaseModel): + nested: Optional[BasicModel] + + m1 = NestedModel.construct(nested=None) + assert m1.nested is None + + m2 = NestedModel.construct(nested={"foo": "bar"}) + assert m2.nested is not None + assert m2.nested.foo == "bar" + + # mismatched types + m3 = NestedModel.construct(nested={"foo"}) + assert isinstance(cast(Any, m3.nested), set) + assert cast(Any, m3.nested) == {"foo"} + + +def test_list_nested_model() -> None: + class NestedModel(BaseModel): + nested: List[BasicModel] + + m = NestedModel.construct(nested=[{"foo": "bar"}, {"foo": "2"}]) + assert m.nested is not None + assert isinstance(m.nested, list) + assert len(m.nested) == 2 + assert m.nested[0].foo == "bar" + assert m.nested[1].foo == "2" + + # mismatched types + m = NestedModel.construct(nested=True) + assert cast(Any, m.nested) is True + + m = NestedModel.construct(nested=[False]) + assert cast(Any, m.nested) == [False] + + +def test_optional_list_nested_model() -> None: + class NestedModel(BaseModel): + nested: Optional[List[BasicModel]] + + m1 = NestedModel.construct(nested=[{"foo": "bar"}, {"foo": "2"}]) + assert m1.nested is not None + assert isinstance(m1.nested, list) + assert len(m1.nested) == 2 + assert m1.nested[0].foo == "bar" + assert m1.nested[1].foo == "2" + + m2 = NestedModel.construct(nested=None) + assert m2.nested is None + + # mismatched types + m3 = NestedModel.construct(nested={1}) + assert cast(Any, m3.nested) == {1} + + m4 = NestedModel.construct(nested=[False]) + assert cast(Any, m4.nested) == [False] + + +def test_list_optional_items_nested_model() -> None: + class NestedModel(BaseModel): + nested: List[Optional[BasicModel]] + + m = NestedModel.construct(nested=[None, {"foo": "bar"}]) + assert m.nested is not None + assert isinstance(m.nested, list) + assert len(m.nested) == 2 + assert m.nested[0] is None + assert m.nested[1] is not None + assert m.nested[1].foo == "bar" + + # mismatched types + m3 = NestedModel.construct(nested="foo") + assert cast(Any, m3.nested) == "foo" + + m4 = NestedModel.construct(nested=[False]) + assert cast(Any, m4.nested) == [False] + + +def test_list_mismatched_type() -> None: + class NestedModel(BaseModel): + nested: List[str] + + m = NestedModel.construct(nested=False) + assert cast(Any, m.nested) is False + + +def test_raw_dictionary() -> None: + class NestedModel(BaseModel): + nested: Dict[str, str] + + m = NestedModel.construct(nested={"hello": "world"}) + assert m.nested == {"hello": "world"} + + # mismatched types + m = NestedModel.construct(nested=False) + assert cast(Any, m.nested) is False + + +def test_nested_dictionary_model() -> None: + class NestedModel(BaseModel): + nested: Dict[str, BasicModel] + + m = NestedModel.construct(nested={"hello": {"foo": "bar"}}) + assert isinstance(m.nested, dict) + assert m.nested["hello"].foo == "bar" + + # mismatched types + m = NestedModel.construct(nested={"hello": False}) + assert cast(Any, m.nested["hello"]) is False + + +def test_unknown_fields() -> None: + m1 = BasicModel.construct(foo="foo", unknown=1) + assert m1.foo == "foo" + assert cast(Any, m1).unknown == 1 + + m2 = BasicModel.construct(foo="foo", unknown={"foo_bar": True}) + assert m2.foo == "foo" + assert cast(Any, m2).unknown == {"foo_bar": True} + + assert model_dump(m2) == {"foo": "foo", "unknown": {"foo_bar": True}} + + +def test_strict_validation_unknown_fields() -> None: + class Model(BaseModel): + foo: str + + model = parse_obj(Model, dict(foo="hello!", user="Robert")) + assert model.foo == "hello!" + assert cast(Any, model).user == "Robert" + + assert model_dump(model) == {"foo": "hello!", "user": "Robert"} + + +def test_aliases() -> None: + class Model(BaseModel): + my_field: int = Field(alias="myField") + + m = Model.construct(myField=1) + assert m.my_field == 1 + + # mismatched types + m = Model.construct(myField={"hello": False}) + assert cast(Any, m.my_field) == {"hello": False} + + +def test_repr() -> None: + model = BasicModel(foo="bar") + assert str(model) == "BasicModel(foo='bar')" + assert repr(model) == "BasicModel(foo='bar')" + + +def test_repr_nested_model() -> None: + class Child(BaseModel): + name: str + age: int + + class Parent(BaseModel): + name: str + child: Child + + model = Parent(name="Robert", child=Child(name="Foo", age=5)) + assert str(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))" + assert repr(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))" + + +def test_optional_list() -> None: + class Submodel(BaseModel): + name: str + + class Model(BaseModel): + items: Optional[List[Submodel]] + + m = Model.construct(items=None) + assert m.items is None + + m = Model.construct(items=[]) + assert m.items == [] + + m = Model.construct(items=[{"name": "Robert"}]) + assert m.items is not None + assert len(m.items) == 1 + assert m.items[0].name == "Robert" + + +def test_nested_union_of_models() -> None: + class Submodel1(BaseModel): + bar: bool + + class Submodel2(BaseModel): + thing: str + + class Model(BaseModel): + foo: Union[Submodel1, Submodel2] + + m = Model.construct(foo={"thing": "hello"}) + assert isinstance(m.foo, Submodel2) + assert m.foo.thing == "hello" + + +def test_nested_union_of_mixed_types() -> None: + class Submodel1(BaseModel): + bar: bool + + class Model(BaseModel): + foo: Union[Submodel1, Literal[True], Literal["CARD_HOLDER"]] + + m = Model.construct(foo=True) + assert m.foo is True + + m = Model.construct(foo="CARD_HOLDER") + assert m.foo == "CARD_HOLDER" + + m = Model.construct(foo={"bar": False}) + assert isinstance(m.foo, Submodel1) + assert m.foo.bar is False + + +def test_nested_union_multiple_variants() -> None: + class Submodel1(BaseModel): + bar: bool + + class Submodel2(BaseModel): + thing: str + + class Submodel3(BaseModel): + foo: int + + class Model(BaseModel): + foo: Union[Submodel1, Submodel2, None, Submodel3] + + m = Model.construct(foo={"thing": "hello"}) + assert isinstance(m.foo, Submodel2) + assert m.foo.thing == "hello" + + m = Model.construct(foo=None) + assert m.foo is None + + m = Model.construct() + assert m.foo is None + + m = Model.construct(foo={"foo": "1"}) + assert isinstance(m.foo, Submodel3) + assert m.foo.foo == 1 + + +def test_nested_union_invalid_data() -> None: + class Submodel1(BaseModel): + level: int + + class Submodel2(BaseModel): + name: str + + class Model(BaseModel): + foo: Union[Submodel1, Submodel2] + + m = Model.construct(foo=True) + assert cast(bool, m.foo) is True + + m = Model.construct(foo={"name": 3}) + if PYDANTIC_V2: + assert isinstance(m.foo, Submodel1) + assert m.foo.name == 3 # type: ignore + else: + assert isinstance(m.foo, Submodel2) + assert m.foo.name == "3" + + +def test_list_of_unions() -> None: + class Submodel1(BaseModel): + level: int + + class Submodel2(BaseModel): + name: str + + class Model(BaseModel): + items: List[Union[Submodel1, Submodel2]] + + m = Model.construct(items=[{"level": 1}, {"name": "Robert"}]) + assert len(m.items) == 2 + assert isinstance(m.items[0], Submodel1) + assert m.items[0].level == 1 + assert isinstance(m.items[1], Submodel2) + assert m.items[1].name == "Robert" + + m = Model.construct(items=[{"level": -1}, 156]) + assert len(m.items) == 2 + assert isinstance(m.items[0], Submodel1) + assert m.items[0].level == -1 + assert cast(Any, m.items[1]) == 156 + + +def test_union_of_lists() -> None: + class SubModel1(BaseModel): + level: int + + class SubModel2(BaseModel): + name: str + + class Model(BaseModel): + items: Union[List[SubModel1], List[SubModel2]] + + # with one valid entry + m = Model.construct(items=[{"name": "Robert"}]) + assert len(m.items) == 1 + assert isinstance(m.items[0], SubModel2) + assert m.items[0].name == "Robert" + + # with two entries pointing to different types + m = Model.construct(items=[{"level": 1}, {"name": "Robert"}]) + assert len(m.items) == 2 + assert isinstance(m.items[0], SubModel1) + assert m.items[0].level == 1 + assert isinstance(m.items[1], SubModel1) + assert cast(Any, m.items[1]).name == "Robert" + + # with two entries pointing to *completely* different types + m = Model.construct(items=[{"level": -1}, 156]) + assert len(m.items) == 2 + assert isinstance(m.items[0], SubModel1) + assert m.items[0].level == -1 + assert cast(Any, m.items[1]) == 156 + + +def test_dict_of_union() -> None: + class SubModel1(BaseModel): + name: str + + class SubModel2(BaseModel): + foo: str + + class Model(BaseModel): + data: Dict[str, Union[SubModel1, SubModel2]] + + m = Model.construct(data={"hello": {"name": "there"}, "foo": {"foo": "bar"}}) + assert len(list(m.data.keys())) == 2 + assert isinstance(m.data["hello"], SubModel1) + assert m.data["hello"].name == "there" + assert isinstance(m.data["foo"], SubModel2) + assert m.data["foo"].foo == "bar" + + # TODO: test mismatched type + + +def test_double_nested_union() -> None: + class SubModel1(BaseModel): + name: str + + class SubModel2(BaseModel): + bar: str + + class Model(BaseModel): + data: Dict[str, List[Union[SubModel1, SubModel2]]] + + m = Model.construct(data={"foo": [{"bar": "baz"}, {"name": "Robert"}]}) + assert len(m.data["foo"]) == 2 + + entry1 = m.data["foo"][0] + assert isinstance(entry1, SubModel2) + assert entry1.bar == "baz" + + entry2 = m.data["foo"][1] + assert isinstance(entry2, SubModel1) + assert entry2.name == "Robert" + + # TODO: test mismatched type + + +def test_union_of_dict() -> None: + class SubModel1(BaseModel): + name: str + + class SubModel2(BaseModel): + foo: str + + class Model(BaseModel): + data: Union[Dict[str, SubModel1], Dict[str, SubModel2]] + + m = Model.construct(data={"hello": {"name": "there"}, "foo": {"foo": "bar"}}) + assert len(list(m.data.keys())) == 2 + assert isinstance(m.data["hello"], SubModel1) + assert m.data["hello"].name == "there" + assert isinstance(m.data["foo"], SubModel1) + assert cast(Any, m.data["foo"]).foo == "bar" + + +def test_iso8601_datetime() -> None: + class Model(BaseModel): + created_at: datetime + + expected = datetime(2019, 12, 27, 18, 11, 19, 117000, tzinfo=timezone.utc) + + if PYDANTIC_V2: + expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}' + else: + expected_json = '{"created_at": "2019-12-27T18:11:19.117000+00:00"}' + + model = Model.construct(created_at="2019-12-27T18:11:19.117Z") + assert model.created_at == expected + assert model_json(model) == expected_json + + model = parse_obj(Model, dict(created_at="2019-12-27T18:11:19.117Z")) + assert model.created_at == expected + assert model_json(model) == expected_json + + +def test_does_not_coerce_int() -> None: + class Model(BaseModel): + bar: int + + assert Model.construct(bar=1).bar == 1 + assert Model.construct(bar=10.9).bar == 10.9 + assert Model.construct(bar="19").bar == "19" # type: ignore[comparison-overlap] + assert Model.construct(bar=False).bar is False + + +def test_int_to_float_safe_conversion() -> None: + class Model(BaseModel): + float_field: float + + m = Model.construct(float_field=10) + assert m.float_field == 10.0 + assert isinstance(m.float_field, float) + + m = Model.construct(float_field=10.12) + assert m.float_field == 10.12 + assert isinstance(m.float_field, float) + + # number too big + m = Model.construct(float_field=2**53 + 1) + assert m.float_field == 2**53 + 1 + assert isinstance(m.float_field, int) + + +def test_deprecated_alias() -> None: + class Model(BaseModel): + resource_id: str = Field(alias="model_id") + + @property + def model_id(self) -> str: + return self.resource_id + + m = Model.construct(model_id="id") + assert m.model_id == "id" + assert m.resource_id == "id" + assert m.resource_id is m.model_id + + m = parse_obj(Model, {"model_id": "id"}) + assert m.model_id == "id" + assert m.resource_id == "id" + assert m.resource_id is m.model_id + + +def test_omitted_fields() -> None: + class Model(BaseModel): + resource_id: Optional[str] = None + + m = Model.construct() + assert "resource_id" not in m.model_fields_set + + m = Model.construct(resource_id=None) + assert "resource_id" in m.model_fields_set + + m = Model.construct(resource_id="foo") + assert "resource_id" in m.model_fields_set + + +def test_to_dict() -> None: + class Model(BaseModel): + foo: Optional[str] = Field(alias="FOO", default=None) + + m = Model(FOO="hello") + assert m.to_dict() == {"FOO": "hello"} + assert m.to_dict(use_api_names=False) == {"foo": "hello"} + + m2 = Model() + assert m2.to_dict() == {} + assert m2.to_dict(exclude_unset=False) == {"FOO": None} + assert m2.to_dict(exclude_unset=False, exclude_none=True) == {} + assert m2.to_dict(exclude_unset=False, exclude_defaults=True) == {} + + m3 = Model(FOO=None) + assert m3.to_dict() == {"FOO": None} + assert m3.to_dict(exclude_none=True) == {} + assert m3.to_dict(exclude_defaults=True) == {} + + if PYDANTIC_V2: + + class Model2(BaseModel): + created_at: datetime + + time_str = "2024-03-21T11:39:01.275859" + m4 = Model2.construct(created_at=time_str) + assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)} + assert m4.to_dict(mode="json") == {"created_at": time_str} + else: + with pytest.raises(ValueError, match="mode is only supported in Pydantic v2"): + m.to_dict(mode="json") + + with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): + m.to_dict(warnings=False) + + +def test_forwards_compat_model_dump_method() -> None: + class Model(BaseModel): + foo: Optional[str] = Field(alias="FOO", default=None) + + m = Model(FOO="hello") + assert m.model_dump() == {"foo": "hello"} + assert m.model_dump(include={"bar"}) == {} + assert m.model_dump(exclude={"foo"}) == {} + assert m.model_dump(by_alias=True) == {"FOO": "hello"} + + m2 = Model() + assert m2.model_dump() == {"foo": None} + assert m2.model_dump(exclude_unset=True) == {} + assert m2.model_dump(exclude_none=True) == {} + assert m2.model_dump(exclude_defaults=True) == {} + + m3 = Model(FOO=None) + assert m3.model_dump() == {"foo": None} + assert m3.model_dump(exclude_none=True) == {} + + if not PYDANTIC_V2: + with pytest.raises(ValueError, match="mode is only supported in Pydantic v2"): + m.model_dump(mode="json") + + with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): + m.model_dump(round_trip=True) + + with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): + m.model_dump(warnings=False) + + +def test_to_json() -> None: + class Model(BaseModel): + foo: Optional[str] = Field(alias="FOO", default=None) + + m = Model(FOO="hello") + assert json.loads(m.to_json()) == {"FOO": "hello"} + assert json.loads(m.to_json(use_api_names=False)) == {"foo": "hello"} + + if PYDANTIC_V2: + assert m.to_json(indent=None) == '{"FOO":"hello"}' + else: + assert m.to_json(indent=None) == '{"FOO": "hello"}' + + m2 = Model() + assert json.loads(m2.to_json()) == {} + assert json.loads(m2.to_json(exclude_unset=False)) == {"FOO": None} + assert json.loads(m2.to_json(exclude_unset=False, exclude_none=True)) == {} + assert json.loads(m2.to_json(exclude_unset=False, exclude_defaults=True)) == {} + + m3 = Model(FOO=None) + assert json.loads(m3.to_json()) == {"FOO": None} + assert json.loads(m3.to_json(exclude_none=True)) == {} + + if not PYDANTIC_V2: + with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): + m.to_json(warnings=False) + + +def test_forwards_compat_model_dump_json_method() -> None: + class Model(BaseModel): + foo: Optional[str] = Field(alias="FOO", default=None) + + m = Model(FOO="hello") + assert json.loads(m.model_dump_json()) == {"foo": "hello"} + assert json.loads(m.model_dump_json(include={"bar"})) == {} + assert json.loads(m.model_dump_json(include={"foo"})) == {"foo": "hello"} + assert json.loads(m.model_dump_json(by_alias=True)) == {"FOO": "hello"} + + assert m.model_dump_json(indent=2) == '{\n "foo": "hello"\n}' + + m2 = Model() + assert json.loads(m2.model_dump_json()) == {"foo": None} + assert json.loads(m2.model_dump_json(exclude_unset=True)) == {} + assert json.loads(m2.model_dump_json(exclude_none=True)) == {} + assert json.loads(m2.model_dump_json(exclude_defaults=True)) == {} + + m3 = Model(FOO=None) + assert json.loads(m3.model_dump_json()) == {"foo": None} + assert json.loads(m3.model_dump_json(exclude_none=True)) == {} + + if not PYDANTIC_V2: + with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): + m.model_dump_json(round_trip=True) + + with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): + m.model_dump_json(warnings=False) + + +def test_type_compat() -> None: + # our model type can be assigned to Pydantic's model type + + def takes_pydantic(model: pydantic.BaseModel) -> None: # noqa: ARG001 + ... + + class OurModel(BaseModel): + foo: Optional[str] = None + + takes_pydantic(OurModel()) + + +def test_annotated_types() -> None: + class Model(BaseModel): + value: str + + m = construct_type( + value={"value": "foo"}, + type_=cast(Any, Annotated[Model, "random metadata"]), + ) + assert isinstance(m, Model) + assert m.value == "foo" + + +def test_discriminated_unions_invalid_data() -> None: + class A(BaseModel): + type: Literal["a"] + + data: str + + class B(BaseModel): + type: Literal["b"] + + data: int + + m = construct_type( + value={"type": "b", "data": "foo"}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, B) + assert m.type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + m = construct_type( + value={"type": "a", "data": 100}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, A) + assert m.type == "a" + if PYDANTIC_V2: + assert m.data == 100 # type: ignore[comparison-overlap] + else: + # pydantic v1 automatically converts inputs to strings + # if the expected type is a str + assert m.data == "100" + + +def test_discriminated_unions_unknown_variant() -> None: + class A(BaseModel): + type: Literal["a"] + + data: str + + class B(BaseModel): + type: Literal["b"] + + data: int + + m = construct_type( + value={"type": "c", "data": None, "new_thing": "bar"}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="type")]), + ) + + # just chooses the first variant + assert isinstance(m, A) + assert m.type == "c" # type: ignore[comparison-overlap] + assert m.data == None # type: ignore[unreachable] + assert m.new_thing == "bar" + + +def test_discriminated_unions_invalid_data_nested_unions() -> None: + class A(BaseModel): + type: Literal["a"] + + data: str + + class B(BaseModel): + type: Literal["b"] + + data: int + + class C(BaseModel): + type: Literal["c"] + + data: bool + + m = construct_type( + value={"type": "b", "data": "foo"}, + type_=cast(Any, Annotated[Union[Union[A, B], C], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, B) + assert m.type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + m = construct_type( + value={"type": "c", "data": "foo"}, + type_=cast(Any, Annotated[Union[Union[A, B], C], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, C) + assert m.type == "c" + assert m.data == "foo" # type: ignore[comparison-overlap] + + +def test_discriminated_unions_with_aliases_invalid_data() -> None: + class A(BaseModel): + foo_type: Literal["a"] = Field(alias="type") + + data: str + + class B(BaseModel): + foo_type: Literal["b"] = Field(alias="type") + + data: int + + m = construct_type( + value={"type": "b", "data": "foo"}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="foo_type")]), + ) + assert isinstance(m, B) + assert m.foo_type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + m = construct_type( + value={"type": "a", "data": 100}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="foo_type")]), + ) + assert isinstance(m, A) + assert m.foo_type == "a" + if PYDANTIC_V2: + assert m.data == 100 # type: ignore[comparison-overlap] + else: + # pydantic v1 automatically converts inputs to strings + # if the expected type is a str + assert m.data == "100" + + +def test_discriminated_unions_overlapping_discriminators_invalid_data() -> None: + class A(BaseModel): + type: Literal["a"] + + data: bool + + class B(BaseModel): + type: Literal["a"] + + data: int + + m = construct_type( + value={"type": "a", "data": "foo"}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, B) + assert m.type == "a" + assert m.data == "foo" # type: ignore[comparison-overlap] + + +def test_discriminated_unions_invalid_data_uses_cache() -> None: + class A(BaseModel): + type: Literal["a"] + + data: str + + class B(BaseModel): + type: Literal["b"] + + data: int + + UnionType = cast(Any, Union[A, B]) + + assert not hasattr(UnionType, "__discriminator__") + + m = construct_type( + value={"type": "b", "data": "foo"}, type_=cast(Any, Annotated[UnionType, PropertyInfo(discriminator="type")]) + ) + assert isinstance(m, B) + assert m.type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + discriminator = UnionType.__discriminator__ + assert discriminator is not None + + m = construct_type( + value={"type": "b", "data": "foo"}, type_=cast(Any, Annotated[UnionType, PropertyInfo(discriminator="type")]) + ) + assert isinstance(m, B) + assert m.type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + # if the discriminator details object stays the same between invocations then + # we hit the cache + assert UnionType.__discriminator__ is discriminator diff --git a/tests/test_qs.py b/tests/test_qs.py new file mode 100644 index 00000000..0ca7188b --- /dev/null +++ b/tests/test_qs.py @@ -0,0 +1,78 @@ +from typing import Any, cast +from functools import partial +from urllib.parse import unquote + +import pytest + +from gitpod._qs import Querystring, stringify + + +def test_empty() -> None: + assert stringify({}) == "" + assert stringify({"a": {}}) == "" + assert stringify({"a": {"b": {"c": {}}}}) == "" + + +def test_basic() -> None: + assert stringify({"a": 1}) == "a=1" + assert stringify({"a": "b"}) == "a=b" + assert stringify({"a": True}) == "a=true" + assert stringify({"a": False}) == "a=false" + assert stringify({"a": 1.23456}) == "a=1.23456" + assert stringify({"a": None}) == "" + + +@pytest.mark.parametrize("method", ["class", "function"]) +def test_nested_dotted(method: str) -> None: + if method == "class": + serialise = Querystring(nested_format="dots").stringify + else: + serialise = partial(stringify, nested_format="dots") + + assert unquote(serialise({"a": {"b": "c"}})) == "a.b=c" + assert unquote(serialise({"a": {"b": "c", "d": "e", "f": "g"}})) == "a.b=c&a.d=e&a.f=g" + assert unquote(serialise({"a": {"b": {"c": {"d": "e"}}}})) == "a.b.c.d=e" + assert unquote(serialise({"a": {"b": True}})) == "a.b=true" + + +def test_nested_brackets() -> None: + assert unquote(stringify({"a": {"b": "c"}})) == "a[b]=c" + assert unquote(stringify({"a": {"b": "c", "d": "e", "f": "g"}})) == "a[b]=c&a[d]=e&a[f]=g" + assert unquote(stringify({"a": {"b": {"c": {"d": "e"}}}})) == "a[b][c][d]=e" + assert unquote(stringify({"a": {"b": True}})) == "a[b]=true" + + +@pytest.mark.parametrize("method", ["class", "function"]) +def test_array_comma(method: str) -> None: + if method == "class": + serialise = Querystring(array_format="comma").stringify + else: + serialise = partial(stringify, array_format="comma") + + assert unquote(serialise({"in": ["foo", "bar"]})) == "in=foo,bar" + assert unquote(serialise({"a": {"b": [True, False]}})) == "a[b]=true,false" + assert unquote(serialise({"a": {"b": [True, False, None, True]}})) == "a[b]=true,false,true" + + +def test_array_repeat() -> None: + assert unquote(stringify({"in": ["foo", "bar"]})) == "in=foo&in=bar" + assert unquote(stringify({"a": {"b": [True, False]}})) == "a[b]=true&a[b]=false" + assert unquote(stringify({"a": {"b": [True, False, None, True]}})) == "a[b]=true&a[b]=false&a[b]=true" + assert unquote(stringify({"in": ["foo", {"b": {"c": ["d", "e"]}}]})) == "in=foo&in[b][c]=d&in[b][c]=e" + + +@pytest.mark.parametrize("method", ["class", "function"]) +def test_array_brackets(method: str) -> None: + if method == "class": + serialise = Querystring(array_format="brackets").stringify + else: + serialise = partial(stringify, array_format="brackets") + + assert unquote(serialise({"in": ["foo", "bar"]})) == "in[]=foo&in[]=bar" + assert unquote(serialise({"a": {"b": [True, False]}})) == "a[b][]=true&a[b][]=false" + assert unquote(serialise({"a": {"b": [True, False, None, True]}})) == "a[b][]=true&a[b][]=false&a[b][]=true" + + +def test_unknown_array_format() -> None: + with pytest.raises(NotImplementedError, match="Unknown array_format value: foo, choose from comma, repeat"): + stringify({"a": ["foo", "bar"]}, array_format=cast(Any, "foo")) diff --git a/tests/test_required_args.py b/tests/test_required_args.py new file mode 100644 index 00000000..84527ed6 --- /dev/null +++ b/tests/test_required_args.py @@ -0,0 +1,111 @@ +from __future__ import annotations + +import pytest + +from gitpod._utils import required_args + + +def test_too_many_positional_params() -> None: + @required_args(["a"]) + def foo(a: str | None = None) -> str | None: + return a + + with pytest.raises(TypeError, match=r"foo\(\) takes 1 argument\(s\) but 2 were given"): + foo("a", "b") # type: ignore + + +def test_positional_param() -> None: + @required_args(["a"]) + def foo(a: str | None = None) -> str | None: + return a + + assert foo("a") == "a" + assert foo(None) is None + assert foo(a="b") == "b" + + with pytest.raises(TypeError, match="Missing required argument: 'a'"): + foo() + + +def test_keyword_only_param() -> None: + @required_args(["a"]) + def foo(*, a: str | None = None) -> str | None: + return a + + assert foo(a="a") == "a" + assert foo(a=None) is None + assert foo(a="b") == "b" + + with pytest.raises(TypeError, match="Missing required argument: 'a'"): + foo() + + +def test_multiple_params() -> None: + @required_args(["a", "b", "c"]) + def foo(a: str = "", *, b: str = "", c: str = "") -> str | None: + return f"{a} {b} {c}" + + assert foo(a="a", b="b", c="c") == "a b c" + + error_message = r"Missing required arguments.*" + + with pytest.raises(TypeError, match=error_message): + foo() + + with pytest.raises(TypeError, match=error_message): + foo(a="a") + + with pytest.raises(TypeError, match=error_message): + foo(b="b") + + with pytest.raises(TypeError, match=error_message): + foo(c="c") + + with pytest.raises(TypeError, match=r"Missing required argument: 'a'"): + foo(b="a", c="c") + + with pytest.raises(TypeError, match=r"Missing required argument: 'b'"): + foo("a", c="c") + + +def test_multiple_variants() -> None: + @required_args(["a"], ["b"]) + def foo(*, a: str | None = None, b: str | None = None) -> str | None: + return a if a is not None else b + + assert foo(a="foo") == "foo" + assert foo(b="bar") == "bar" + assert foo(a=None) is None + assert foo(b=None) is None + + # TODO: this error message could probably be improved + with pytest.raises( + TypeError, + match=r"Missing required arguments; Expected either \('a'\) or \('b'\) arguments to be given", + ): + foo() + + +def test_multiple_params_multiple_variants() -> None: + @required_args(["a", "b"], ["c"]) + def foo(*, a: str | None = None, b: str | None = None, c: str | None = None) -> str | None: + if a is not None: + return a + if b is not None: + return b + return c + + error_message = r"Missing required arguments; Expected either \('a' and 'b'\) or \('c'\) arguments to be given" + + with pytest.raises(TypeError, match=error_message): + foo(a="foo") + + with pytest.raises(TypeError, match=error_message): + foo(b="bar") + + with pytest.raises(TypeError, match=error_message): + foo() + + assert foo(a=None, b="bar") == "bar" + assert foo(c=None) is None + assert foo(c="foo") == "foo" diff --git a/tests/test_response.py b/tests/test_response.py new file mode 100644 index 00000000..8e6ccd77 --- /dev/null +++ b/tests/test_response.py @@ -0,0 +1,277 @@ +import json +from typing import Any, List, Union, cast +from typing_extensions import Annotated + +import httpx +import pytest +import pydantic + +from gitpod import Gitpod, BaseModel, AsyncGitpod +from gitpod._response import ( + APIResponse, + BaseAPIResponse, + AsyncAPIResponse, + BinaryAPIResponse, + AsyncBinaryAPIResponse, + extract_response_type, +) +from gitpod._streaming import Stream +from gitpod._base_client import FinalRequestOptions + + +class ConcreteBaseAPIResponse(APIResponse[bytes]): ... + + +class ConcreteAPIResponse(APIResponse[List[str]]): ... + + +class ConcreteAsyncAPIResponse(APIResponse[httpx.Response]): ... + + +def test_extract_response_type_direct_classes() -> None: + assert extract_response_type(BaseAPIResponse[str]) == str + assert extract_response_type(APIResponse[str]) == str + assert extract_response_type(AsyncAPIResponse[str]) == str + + +def test_extract_response_type_direct_class_missing_type_arg() -> None: + with pytest.raises( + RuntimeError, + match="Expected type to have a type argument at index 0 but it did not", + ): + extract_response_type(AsyncAPIResponse) + + +def test_extract_response_type_concrete_subclasses() -> None: + assert extract_response_type(ConcreteBaseAPIResponse) == bytes + assert extract_response_type(ConcreteAPIResponse) == List[str] + assert extract_response_type(ConcreteAsyncAPIResponse) == httpx.Response + + +def test_extract_response_type_binary_response() -> None: + assert extract_response_type(BinaryAPIResponse) == bytes + assert extract_response_type(AsyncBinaryAPIResponse) == bytes + + +class PydanticModel(pydantic.BaseModel): ... + + +def test_response_parse_mismatched_basemodel(client: Gitpod) -> None: + response = APIResponse( + raw=httpx.Response(200, content=b"foo"), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + with pytest.raises( + TypeError, + match="Pydantic models must subclass our base model type, e.g. `from gitpod import BaseModel`", + ): + response.parse(to=PydanticModel) + + +@pytest.mark.asyncio +async def test_async_response_parse_mismatched_basemodel(async_client: AsyncGitpod) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=b"foo"), + client=async_client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + with pytest.raises( + TypeError, + match="Pydantic models must subclass our base model type, e.g. `from gitpod import BaseModel`", + ): + await response.parse(to=PydanticModel) + + +def test_response_parse_custom_stream(client: Gitpod) -> None: + response = APIResponse( + raw=httpx.Response(200, content=b"foo"), + client=client, + stream=True, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + stream = response.parse(to=Stream[int]) + assert stream._cast_to == int + + +@pytest.mark.asyncio +async def test_async_response_parse_custom_stream(async_client: AsyncGitpod) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=b"foo"), + client=async_client, + stream=True, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + stream = await response.parse(to=Stream[int]) + assert stream._cast_to == int + + +class CustomModel(BaseModel): + foo: str + bar: int + + +def test_response_parse_custom_model(client: Gitpod) -> None: + response = APIResponse( + raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = response.parse(to=CustomModel) + assert obj.foo == "hello!" + assert obj.bar == 2 + + +@pytest.mark.asyncio +async def test_async_response_parse_custom_model(async_client: AsyncGitpod) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), + client=async_client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = await response.parse(to=CustomModel) + assert obj.foo == "hello!" + assert obj.bar == 2 + + +def test_response_parse_annotated_type(client: Gitpod) -> None: + response = APIResponse( + raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = response.parse( + to=cast("type[CustomModel]", Annotated[CustomModel, "random metadata"]), + ) + assert obj.foo == "hello!" + assert obj.bar == 2 + + +async def test_async_response_parse_annotated_type(async_client: AsyncGitpod) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), + client=async_client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = await response.parse( + to=cast("type[CustomModel]", Annotated[CustomModel, "random metadata"]), + ) + assert obj.foo == "hello!" + assert obj.bar == 2 + + +@pytest.mark.parametrize( + "content, expected", + [ + ("false", False), + ("true", True), + ("False", False), + ("True", True), + ("TrUe", True), + ("FalSe", False), + ], +) +def test_response_parse_bool(client: Gitpod, content: str, expected: bool) -> None: + response = APIResponse( + raw=httpx.Response(200, content=content), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + result = response.parse(to=bool) + assert result is expected + + +@pytest.mark.parametrize( + "content, expected", + [ + ("false", False), + ("true", True), + ("False", False), + ("True", True), + ("TrUe", True), + ("FalSe", False), + ], +) +async def test_async_response_parse_bool(client: AsyncGitpod, content: str, expected: bool) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=content), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + result = await response.parse(to=bool) + assert result is expected + + +class OtherModel(BaseModel): + a: str + + +@pytest.mark.parametrize("client", [False], indirect=True) # loose validation +def test_response_parse_expect_model_union_non_json_content(client: Gitpod) -> None: + response = APIResponse( + raw=httpx.Response(200, content=b"foo", headers={"Content-Type": "application/text"}), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = response.parse(to=cast(Any, Union[CustomModel, OtherModel])) + assert isinstance(obj, str) + assert obj == "foo" + + +@pytest.mark.asyncio +@pytest.mark.parametrize("async_client", [False], indirect=True) # loose validation +async def test_async_response_parse_expect_model_union_non_json_content(async_client: AsyncGitpod) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=b"foo", headers={"Content-Type": "application/text"}), + client=async_client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = await response.parse(to=cast(Any, Union[CustomModel, OtherModel])) + assert isinstance(obj, str) + assert obj == "foo" diff --git a/tests/test_streaming.py b/tests/test_streaming.py new file mode 100644 index 00000000..7dedcf3b --- /dev/null +++ b/tests/test_streaming.py @@ -0,0 +1,248 @@ +from __future__ import annotations + +from typing import Iterator, AsyncIterator + +import httpx +import pytest + +from gitpod import Gitpod, AsyncGitpod +from gitpod._streaming import Stream, AsyncStream, ServerSentEvent + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_basic(sync: bool, client: Gitpod, async_client: AsyncGitpod) -> None: + def body() -> Iterator[bytes]: + yield b"event: completion\n" + yield b'data: {"foo":true}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "completion" + assert sse.json() == {"foo": True} + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_data_missing_event(sync: bool, client: Gitpod, async_client: AsyncGitpod) -> None: + def body() -> Iterator[bytes]: + yield b'data: {"foo":true}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"foo": True} + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_event_missing_data(sync: bool, client: Gitpod, async_client: AsyncGitpod) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.data == "" + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multiple_events(sync: bool, client: Gitpod, async_client: AsyncGitpod) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b"\n" + yield b"event: completion\n" + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.data == "" + + sse = await iter_next(iterator) + assert sse.event == "completion" + assert sse.data == "" + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multiple_events_with_data(sync: bool, client: Gitpod, async_client: AsyncGitpod) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b'data: {"foo":true}\n' + yield b"\n" + yield b"event: completion\n" + yield b'data: {"bar":false}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.json() == {"foo": True} + + sse = await iter_next(iterator) + assert sse.event == "completion" + assert sse.json() == {"bar": False} + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multiple_data_lines_with_empty_line(sync: bool, client: Gitpod, async_client: AsyncGitpod) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b"data: {\n" + yield b'data: "foo":\n' + yield b"data: \n" + yield b"data:\n" + yield b"data: true}\n" + yield b"\n\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.json() == {"foo": True} + assert sse.data == '{\n"foo":\n\n\ntrue}' + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_data_json_escaped_double_new_line(sync: bool, client: Gitpod, async_client: AsyncGitpod) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b'data: {"foo": "my long\\n\\ncontent"}' + yield b"\n\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.json() == {"foo": "my long\n\ncontent"} + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multiple_data_lines(sync: bool, client: Gitpod, async_client: AsyncGitpod) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b"data: {\n" + yield b'data: "foo":\n' + yield b"data: true}\n" + yield b"\n\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.json() == {"foo": True} + + await assert_empty_iter(iterator) + + +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_special_new_line_character( + sync: bool, + client: Gitpod, + async_client: AsyncGitpod, +) -> None: + def body() -> Iterator[bytes]: + yield b'data: {"content":" culpa"}\n' + yield b"\n" + yield b'data: {"content":" \xe2\x80\xa8"}\n' + yield b"\n" + yield b'data: {"content":"foo"}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"content": " culpa"} + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"content": " 
"} + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"content": "foo"} + + await assert_empty_iter(iterator) + + +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multi_byte_character_multiple_chunks( + sync: bool, + client: Gitpod, + async_client: AsyncGitpod, +) -> None: + def body() -> Iterator[bytes]: + yield b'data: {"content":"' + # bytes taken from the string 'известни' and arbitrarily split + # so that some multi-byte characters span multiple chunks + yield b"\xd0" + yield b"\xb8\xd0\xb7\xd0" + yield b"\xb2\xd0\xb5\xd1\x81\xd1\x82\xd0\xbd\xd0\xb8" + yield b'"}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"content": "известни"} + + +async def to_aiter(iter: Iterator[bytes]) -> AsyncIterator[bytes]: + for chunk in iter: + yield chunk + + +async def iter_next(iter: Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent]) -> ServerSentEvent: + if isinstance(iter, AsyncIterator): + return await iter.__anext__() + + return next(iter) + + +async def assert_empty_iter(iter: Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent]) -> None: + with pytest.raises((StopAsyncIteration, RuntimeError)): + await iter_next(iter) + + +def make_event_iterator( + content: Iterator[bytes], + *, + sync: bool, + client: Gitpod, + async_client: AsyncGitpod, +) -> Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent]: + if sync: + return Stream(cast_to=object, client=client, response=httpx.Response(200, content=content))._iter_events() + + return AsyncStream( + cast_to=object, client=async_client, response=httpx.Response(200, content=to_aiter(content)) + )._iter_events() diff --git a/tests/test_transform.py b/tests/test_transform.py new file mode 100644 index 00000000..53bb72d6 --- /dev/null +++ b/tests/test_transform.py @@ -0,0 +1,410 @@ +from __future__ import annotations + +import io +import pathlib +from typing import Any, List, Union, TypeVar, Iterable, Optional, cast +from datetime import date, datetime +from typing_extensions import Required, Annotated, TypedDict + +import pytest + +from gitpod._types import Base64FileInput +from gitpod._utils import ( + PropertyInfo, + transform as _transform, + parse_datetime, + async_transform as _async_transform, +) +from gitpod._compat import PYDANTIC_V2 +from gitpod._models import BaseModel + +_T = TypeVar("_T") + +SAMPLE_FILE_PATH = pathlib.Path(__file__).parent.joinpath("sample_file.txt") + + +async def transform( + data: _T, + expected_type: object, + use_async: bool, +) -> _T: + if use_async: + return await _async_transform(data, expected_type=expected_type) + + return _transform(data, expected_type=expected_type) + + +parametrize = pytest.mark.parametrize("use_async", [False, True], ids=["sync", "async"]) + + +class Foo1(TypedDict): + foo_bar: Annotated[str, PropertyInfo(alias="fooBar")] + + +@parametrize +@pytest.mark.asyncio +async def test_top_level_alias(use_async: bool) -> None: + assert await transform({"foo_bar": "hello"}, expected_type=Foo1, use_async=use_async) == {"fooBar": "hello"} + + +class Foo2(TypedDict): + bar: Bar2 + + +class Bar2(TypedDict): + this_thing: Annotated[int, PropertyInfo(alias="this__thing")] + baz: Annotated[Baz2, PropertyInfo(alias="Baz")] + + +class Baz2(TypedDict): + my_baz: Annotated[str, PropertyInfo(alias="myBaz")] + + +@parametrize +@pytest.mark.asyncio +async def test_recursive_typeddict(use_async: bool) -> None: + assert await transform({"bar": {"this_thing": 1}}, Foo2, use_async) == {"bar": {"this__thing": 1}} + assert await transform({"bar": {"baz": {"my_baz": "foo"}}}, Foo2, use_async) == {"bar": {"Baz": {"myBaz": "foo"}}} + + +class Foo3(TypedDict): + things: List[Bar3] + + +class Bar3(TypedDict): + my_field: Annotated[str, PropertyInfo(alias="myField")] + + +@parametrize +@pytest.mark.asyncio +async def test_list_of_typeddict(use_async: bool) -> None: + result = await transform({"things": [{"my_field": "foo"}, {"my_field": "foo2"}]}, Foo3, use_async) + assert result == {"things": [{"myField": "foo"}, {"myField": "foo2"}]} + + +class Foo4(TypedDict): + foo: Union[Bar4, Baz4] + + +class Bar4(TypedDict): + foo_bar: Annotated[str, PropertyInfo(alias="fooBar")] + + +class Baz4(TypedDict): + foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + + +@parametrize +@pytest.mark.asyncio +async def test_union_of_typeddict(use_async: bool) -> None: + assert await transform({"foo": {"foo_bar": "bar"}}, Foo4, use_async) == {"foo": {"fooBar": "bar"}} + assert await transform({"foo": {"foo_baz": "baz"}}, Foo4, use_async) == {"foo": {"fooBaz": "baz"}} + assert await transform({"foo": {"foo_baz": "baz", "foo_bar": "bar"}}, Foo4, use_async) == { + "foo": {"fooBaz": "baz", "fooBar": "bar"} + } + + +class Foo5(TypedDict): + foo: Annotated[Union[Bar4, List[Baz4]], PropertyInfo(alias="FOO")] + + +class Bar5(TypedDict): + foo_bar: Annotated[str, PropertyInfo(alias="fooBar")] + + +class Baz5(TypedDict): + foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + + +@parametrize +@pytest.mark.asyncio +async def test_union_of_list(use_async: bool) -> None: + assert await transform({"foo": {"foo_bar": "bar"}}, Foo5, use_async) == {"FOO": {"fooBar": "bar"}} + assert await transform( + { + "foo": [ + {"foo_baz": "baz"}, + {"foo_baz": "baz"}, + ] + }, + Foo5, + use_async, + ) == {"FOO": [{"fooBaz": "baz"}, {"fooBaz": "baz"}]} + + +class Foo6(TypedDict): + bar: Annotated[str, PropertyInfo(alias="Bar")] + + +@parametrize +@pytest.mark.asyncio +async def test_includes_unknown_keys(use_async: bool) -> None: + assert await transform({"bar": "bar", "baz_": {"FOO": 1}}, Foo6, use_async) == { + "Bar": "bar", + "baz_": {"FOO": 1}, + } + + +class Foo7(TypedDict): + bar: Annotated[List[Bar7], PropertyInfo(alias="bAr")] + foo: Bar7 + + +class Bar7(TypedDict): + foo: str + + +@parametrize +@pytest.mark.asyncio +async def test_ignores_invalid_input(use_async: bool) -> None: + assert await transform({"bar": ""}, Foo7, use_async) == {"bAr": ""} + assert await transform({"foo": ""}, Foo7, use_async) == {"foo": ""} + + +class DatetimeDict(TypedDict, total=False): + foo: Annotated[datetime, PropertyInfo(format="iso8601")] + + bar: Annotated[Optional[datetime], PropertyInfo(format="iso8601")] + + required: Required[Annotated[Optional[datetime], PropertyInfo(format="iso8601")]] + + list_: Required[Annotated[Optional[List[datetime]], PropertyInfo(format="iso8601")]] + + union: Annotated[Union[int, datetime], PropertyInfo(format="iso8601")] + + +class DateDict(TypedDict, total=False): + foo: Annotated[date, PropertyInfo(format="iso8601")] + + +@parametrize +@pytest.mark.asyncio +async def test_iso8601_format(use_async: bool) -> None: + dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] + + dt = dt.replace(tzinfo=None) + assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692"} # type: ignore[comparison-overlap] + + assert await transform({"foo": None}, DateDict, use_async) == {"foo": None} # type: ignore[comparison-overlap] + assert await transform({"foo": date.fromisoformat("2023-02-23")}, DateDict, use_async) == {"foo": "2023-02-23"} # type: ignore[comparison-overlap] + + +@parametrize +@pytest.mark.asyncio +async def test_optional_iso8601_format(use_async: bool) -> None: + dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + assert await transform({"bar": dt}, DatetimeDict, use_async) == {"bar": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] + + assert await transform({"bar": None}, DatetimeDict, use_async) == {"bar": None} + + +@parametrize +@pytest.mark.asyncio +async def test_required_iso8601_format(use_async: bool) -> None: + dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + assert await transform({"required": dt}, DatetimeDict, use_async) == { + "required": "2023-02-23T14:16:36.337692+00:00" + } # type: ignore[comparison-overlap] + + assert await transform({"required": None}, DatetimeDict, use_async) == {"required": None} + + +@parametrize +@pytest.mark.asyncio +async def test_union_datetime(use_async: bool) -> None: + dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + assert await transform({"union": dt}, DatetimeDict, use_async) == { # type: ignore[comparison-overlap] + "union": "2023-02-23T14:16:36.337692+00:00" + } + + assert await transform({"union": "foo"}, DatetimeDict, use_async) == {"union": "foo"} + + +@parametrize +@pytest.mark.asyncio +async def test_nested_list_iso6801_format(use_async: bool) -> None: + dt1 = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + dt2 = parse_datetime("2022-01-15T06:34:23Z") + assert await transform({"list_": [dt1, dt2]}, DatetimeDict, use_async) == { # type: ignore[comparison-overlap] + "list_": ["2023-02-23T14:16:36.337692+00:00", "2022-01-15T06:34:23+00:00"] + } + + +@parametrize +@pytest.mark.asyncio +async def test_datetime_custom_format(use_async: bool) -> None: + dt = parse_datetime("2022-01-15T06:34:23Z") + + result = await transform(dt, Annotated[datetime, PropertyInfo(format="custom", format_template="%H")], use_async) + assert result == "06" # type: ignore[comparison-overlap] + + +class DateDictWithRequiredAlias(TypedDict, total=False): + required_prop: Required[Annotated[date, PropertyInfo(format="iso8601", alias="prop")]] + + +@parametrize +@pytest.mark.asyncio +async def test_datetime_with_alias(use_async: bool) -> None: + assert await transform({"required_prop": None}, DateDictWithRequiredAlias, use_async) == {"prop": None} # type: ignore[comparison-overlap] + assert await transform( + {"required_prop": date.fromisoformat("2023-02-23")}, DateDictWithRequiredAlias, use_async + ) == {"prop": "2023-02-23"} # type: ignore[comparison-overlap] + + +class MyModel(BaseModel): + foo: str + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_model_to_dictionary(use_async: bool) -> None: + assert cast(Any, await transform(MyModel(foo="hi!"), Any, use_async)) == {"foo": "hi!"} + assert cast(Any, await transform(MyModel.construct(foo="hi!"), Any, use_async)) == {"foo": "hi!"} + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_empty_model(use_async: bool) -> None: + assert cast(Any, await transform(MyModel.construct(), Any, use_async)) == {} + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_unknown_field(use_async: bool) -> None: + assert cast(Any, await transform(MyModel.construct(my_untyped_field=True), Any, use_async)) == { + "my_untyped_field": True + } + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_mismatched_types(use_async: bool) -> None: + model = MyModel.construct(foo=True) + if PYDANTIC_V2: + with pytest.warns(UserWarning): + params = await transform(model, Any, use_async) + else: + params = await transform(model, Any, use_async) + assert cast(Any, params) == {"foo": True} + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_mismatched_object_type(use_async: bool) -> None: + model = MyModel.construct(foo=MyModel.construct(hello="world")) + if PYDANTIC_V2: + with pytest.warns(UserWarning): + params = await transform(model, Any, use_async) + else: + params = await transform(model, Any, use_async) + assert cast(Any, params) == {"foo": {"hello": "world"}} + + +class ModelNestedObjects(BaseModel): + nested: MyModel + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_nested_objects(use_async: bool) -> None: + model = ModelNestedObjects.construct(nested={"foo": "stainless"}) + assert isinstance(model.nested, MyModel) + assert cast(Any, await transform(model, Any, use_async)) == {"nested": {"foo": "stainless"}} + + +class ModelWithDefaultField(BaseModel): + foo: str + with_none_default: Union[str, None] = None + with_str_default: str = "foo" + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_default_field(use_async: bool) -> None: + # should be excluded when defaults are used + model = ModelWithDefaultField.construct() + assert model.with_none_default is None + assert model.with_str_default == "foo" + assert cast(Any, await transform(model, Any, use_async)) == {} + + # should be included when the default value is explicitly given + model = ModelWithDefaultField.construct(with_none_default=None, with_str_default="foo") + assert model.with_none_default is None + assert model.with_str_default == "foo" + assert cast(Any, await transform(model, Any, use_async)) == {"with_none_default": None, "with_str_default": "foo"} + + # should be included when a non-default value is explicitly given + model = ModelWithDefaultField.construct(with_none_default="bar", with_str_default="baz") + assert model.with_none_default == "bar" + assert model.with_str_default == "baz" + assert cast(Any, await transform(model, Any, use_async)) == {"with_none_default": "bar", "with_str_default": "baz"} + + +class TypedDictIterableUnion(TypedDict): + foo: Annotated[Union[Bar8, Iterable[Baz8]], PropertyInfo(alias="FOO")] + + +class Bar8(TypedDict): + foo_bar: Annotated[str, PropertyInfo(alias="fooBar")] + + +class Baz8(TypedDict): + foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + + +@parametrize +@pytest.mark.asyncio +async def test_iterable_of_dictionaries(use_async: bool) -> None: + assert await transform({"foo": [{"foo_baz": "bar"}]}, TypedDictIterableUnion, use_async) == { + "FOO": [{"fooBaz": "bar"}] + } + assert cast(Any, await transform({"foo": ({"foo_baz": "bar"},)}, TypedDictIterableUnion, use_async)) == { + "FOO": [{"fooBaz": "bar"}] + } + + def my_iter() -> Iterable[Baz8]: + yield {"foo_baz": "hello"} + yield {"foo_baz": "world"} + + assert await transform({"foo": my_iter()}, TypedDictIterableUnion, use_async) == { + "FOO": [{"fooBaz": "hello"}, {"fooBaz": "world"}] + } + + +class TypedDictIterableUnionStr(TypedDict): + foo: Annotated[Union[str, Iterable[Baz8]], PropertyInfo(alias="FOO")] + + +@parametrize +@pytest.mark.asyncio +async def test_iterable_union_str(use_async: bool) -> None: + assert await transform({"foo": "bar"}, TypedDictIterableUnionStr, use_async) == {"FOO": "bar"} + assert cast(Any, await transform(iter([{"foo_baz": "bar"}]), Union[str, Iterable[Baz8]], use_async)) == [ + {"fooBaz": "bar"} + ] + + +class TypedDictBase64Input(TypedDict): + foo: Annotated[Union[str, Base64FileInput], PropertyInfo(format="base64")] + + +@parametrize +@pytest.mark.asyncio +async def test_base64_file_input(use_async: bool) -> None: + # strings are left as-is + assert await transform({"foo": "bar"}, TypedDictBase64Input, use_async) == {"foo": "bar"} + + # pathlib.Path is automatically converted to base64 + assert await transform({"foo": SAMPLE_FILE_PATH}, TypedDictBase64Input, use_async) == { + "foo": "SGVsbG8sIHdvcmxkIQo=" + } # type: ignore[comparison-overlap] + + # io instances are automatically converted to base64 + assert await transform({"foo": io.StringIO("Hello, world!")}, TypedDictBase64Input, use_async) == { + "foo": "SGVsbG8sIHdvcmxkIQ==" + } # type: ignore[comparison-overlap] + assert await transform({"foo": io.BytesIO(b"Hello, world!")}, TypedDictBase64Input, use_async) == { + "foo": "SGVsbG8sIHdvcmxkIQ==" + } # type: ignore[comparison-overlap] diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py new file mode 100644 index 00000000..a6465693 --- /dev/null +++ b/tests/test_utils/test_proxy.py @@ -0,0 +1,23 @@ +import operator +from typing import Any +from typing_extensions import override + +from gitpod._utils import LazyProxy + + +class RecursiveLazyProxy(LazyProxy[Any]): + @override + def __load__(self) -> Any: + return self + + def __call__(self, *_args: Any, **_kwds: Any) -> Any: + raise RuntimeError("This should never be called!") + + +def test_recursive_proxy() -> None: + proxy = RecursiveLazyProxy() + assert repr(proxy) == "RecursiveLazyProxy" + assert str(proxy) == "RecursiveLazyProxy" + assert dir(proxy) == [] + assert type(proxy).__name__ == "RecursiveLazyProxy" + assert type(operator.attrgetter("name.foo.bar.baz")(proxy)).__name__ == "RecursiveLazyProxy" diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py new file mode 100644 index 00000000..18d4ff6d --- /dev/null +++ b/tests/test_utils/test_typing.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from typing import Generic, TypeVar, cast + +from gitpod._utils import extract_type_var_from_base + +_T = TypeVar("_T") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") + + +class BaseGeneric(Generic[_T]): ... + + +class SubclassGeneric(BaseGeneric[_T]): ... + + +class BaseGenericMultipleTypeArgs(Generic[_T, _T2, _T3]): ... + + +class SubclassGenericMultipleTypeArgs(BaseGenericMultipleTypeArgs[_T, _T2, _T3]): ... + + +class SubclassDifferentOrderGenericMultipleTypeArgs(BaseGenericMultipleTypeArgs[_T2, _T, _T3]): ... + + +def test_extract_type_var() -> None: + assert ( + extract_type_var_from_base( + BaseGeneric[int], + index=0, + generic_bases=cast("tuple[type, ...]", (BaseGeneric,)), + ) + == int + ) + + +def test_extract_type_var_generic_subclass() -> None: + assert ( + extract_type_var_from_base( + SubclassGeneric[int], + index=0, + generic_bases=cast("tuple[type, ...]", (BaseGeneric,)), + ) + == int + ) + + +def test_extract_type_var_multiple() -> None: + typ = BaseGenericMultipleTypeArgs[int, str, None] + + generic_bases = cast("tuple[type, ...]", (BaseGenericMultipleTypeArgs,)) + assert extract_type_var_from_base(typ, index=0, generic_bases=generic_bases) == int + assert extract_type_var_from_base(typ, index=1, generic_bases=generic_bases) == str + assert extract_type_var_from_base(typ, index=2, generic_bases=generic_bases) == type(None) + + +def test_extract_type_var_generic_subclass_multiple() -> None: + typ = SubclassGenericMultipleTypeArgs[int, str, None] + + generic_bases = cast("tuple[type, ...]", (BaseGenericMultipleTypeArgs,)) + assert extract_type_var_from_base(typ, index=0, generic_bases=generic_bases) == int + assert extract_type_var_from_base(typ, index=1, generic_bases=generic_bases) == str + assert extract_type_var_from_base(typ, index=2, generic_bases=generic_bases) == type(None) + + +def test_extract_type_var_generic_subclass_different_ordering_multiple() -> None: + typ = SubclassDifferentOrderGenericMultipleTypeArgs[int, str, None] + + generic_bases = cast("tuple[type, ...]", (BaseGenericMultipleTypeArgs,)) + assert extract_type_var_from_base(typ, index=0, generic_bases=generic_bases) == int + assert extract_type_var_from_base(typ, index=1, generic_bases=generic_bases) == str + assert extract_type_var_from_base(typ, index=2, generic_bases=generic_bases) == type(None) diff --git a/tests/utils.py b/tests/utils.py new file mode 100644 index 00000000..0a80aa6a --- /dev/null +++ b/tests/utils.py @@ -0,0 +1,155 @@ +from __future__ import annotations + +import os +import inspect +import traceback +import contextlib +from typing import Any, TypeVar, Iterator, cast +from datetime import date, datetime +from typing_extensions import Literal, get_args, get_origin, assert_type + +from gitpod._types import Omit, NoneType +from gitpod._utils import ( + is_dict, + is_list, + is_list_type, + is_union_type, + extract_type_arg, + is_annotated_type, +) +from gitpod._compat import PYDANTIC_V2, field_outer_type, get_model_fields +from gitpod._models import BaseModel + +BaseModelT = TypeVar("BaseModelT", bound=BaseModel) + + +def assert_matches_model(model: type[BaseModelT], value: BaseModelT, *, path: list[str]) -> bool: + for name, field in get_model_fields(model).items(): + field_value = getattr(value, name) + if PYDANTIC_V2: + allow_none = False + else: + # in v1 nullability was structured differently + # https://docs.pydantic.dev/2.0/migration/#required-optional-and-nullable-fields + allow_none = getattr(field, "allow_none", False) + + assert_matches_type( + field_outer_type(field), + field_value, + path=[*path, name], + allow_none=allow_none, + ) + + return True + + +# Note: the `path` argument is only used to improve error messages when `--showlocals` is used +def assert_matches_type( + type_: Any, + value: object, + *, + path: list[str], + allow_none: bool = False, +) -> None: + # unwrap `Annotated[T, ...]` -> `T` + if is_annotated_type(type_): + type_ = extract_type_arg(type_, 0) + + if allow_none and value is None: + return + + if type_ is None or type_ is NoneType: + assert value is None + return + + origin = get_origin(type_) or type_ + + if is_list_type(type_): + return _assert_list_type(type_, value) + + if origin == str: + assert isinstance(value, str) + elif origin == int: + assert isinstance(value, int) + elif origin == bool: + assert isinstance(value, bool) + elif origin == float: + assert isinstance(value, float) + elif origin == bytes: + assert isinstance(value, bytes) + elif origin == datetime: + assert isinstance(value, datetime) + elif origin == date: + assert isinstance(value, date) + elif origin == object: + # nothing to do here, the expected type is unknown + pass + elif origin == Literal: + assert value in get_args(type_) + elif origin == dict: + assert is_dict(value) + + args = get_args(type_) + key_type = args[0] + items_type = args[1] + + for key, item in value.items(): + assert_matches_type(key_type, key, path=[*path, ""]) + assert_matches_type(items_type, item, path=[*path, ""]) + elif is_union_type(type_): + variants = get_args(type_) + + try: + none_index = variants.index(type(None)) + except ValueError: + pass + else: + # special case Optional[T] for better error messages + if len(variants) == 2: + if value is None: + # valid + return + + return assert_matches_type(type_=variants[not none_index], value=value, path=path) + + for i, variant in enumerate(variants): + try: + assert_matches_type(variant, value, path=[*path, f"variant {i}"]) + return + except AssertionError: + traceback.print_exc() + continue + + raise AssertionError("Did not match any variants") + elif issubclass(origin, BaseModel): + assert isinstance(value, type_) + assert assert_matches_model(type_, cast(Any, value), path=path) + elif inspect.isclass(origin) and origin.__name__ == "HttpxBinaryResponseContent": + assert value.__class__.__name__ == "HttpxBinaryResponseContent" + else: + assert None, f"Unhandled field type: {type_}" + + +def _assert_list_type(type_: type[object], value: object) -> None: + assert is_list(value) + + inner_type = get_args(type_)[0] + for entry in value: + assert_type(inner_type, entry) # type: ignore + + +@contextlib.contextmanager +def update_env(**new_env: str | Omit) -> Iterator[None]: + old = os.environ.copy() + + try: + for name, value in new_env.items(): + if isinstance(value, Omit): + os.environ.pop(name, None) + else: + os.environ[name] = value + + yield None + finally: + os.environ.clear() + os.environ.update(old) From 17fb8da03a5a0abe4ff031599e11d73ac1e1a8e2 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 20:28:22 +0000 Subject: [PATCH 002/505] feat(api): update via SDK Studio --- api.md | 68 +- src/gitpod/_client.py | 26 - src/gitpod/resources/__init__.py | 28 - .../task_executions.py | 115 ++ .../resources/runner_interactions/__init__.py | 14 - .../runner_interactions/environments.py | 273 +++- .../runner_interactions.py | 1345 +++++++++++++++-- src/gitpod/types/__init__.py | 3 - .../types/environment_automations/__init__.py | 3 + ...ion_update_task_execution_status_params.py | 20 + .../test_task_executions.py | 130 ++ .../runner_interactions/test_environments.py | 417 ++++- .../api_resources/test_runner_interactions.py | 1320 ++++++++++++++-- 13 files changed, 3405 insertions(+), 357 deletions(-) create mode 100644 src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py diff --git a/api.md b/api.md index b202ebb3..a7db6efe 100644 --- a/api.md +++ b/api.md @@ -83,6 +83,7 @@ from gitpod.types.environment_automations import ( TaskExecutionCreateListResponse, TaskExecutionCreateRetrieveResponse, TaskExecutionStopResponse, + TaskExecutionUpdateTaskExecutionStatusResponse, ) ``` @@ -93,18 +94,7 @@ Methods: - client.environment_automations.task_executions.create_list(\*\*params) -> TaskExecutionCreateListResponse - client.environment_automations.task_executions.create_retrieve(\*\*params) -> TaskExecutionCreateRetrieveResponse - client.environment_automations.task_executions.stop(\*\*params) -> object - -# EnvironmentAutomation - -Types: - -```python -from gitpod.types import EnvironmentAutomationUpdateTaskExecutionStatusResponse -``` - -Methods: - -- client.environment_automation.update_task_execution_status(\*\*params) -> object +- client.environment_automations.task_executions.update_task_execution_status(\*\*params) -> object # Environments @@ -292,69 +282,47 @@ Types: ```python from gitpod.types import ( + RunnerInteractionGetHostAuthenticationTokenValueResponse, + RunnerInteractionGetLatestVersionResponse, + RunnerInteractionListRunnerEnvironmentClassesResponse, + RunnerInteractionListRunnerScmIntegrationsResponse, RunnerInteractionMarkActiveResponse, + RunnerInteractionSendResponseResponse, RunnerInteractionSignupResponse, + RunnerInteractionUpdateRunnerConfigurationSchemaResponse, RunnerInteractionUpdateStatusResponse, ) ``` Methods: +- client.runner_interactions.get_host_authentication_token_value(\*\*params) -> RunnerInteractionGetHostAuthenticationTokenValueResponse +- client.runner_interactions.get_latest_version(\*\*params) -> RunnerInteractionGetLatestVersionResponse +- client.runner_interactions.list_runner_environment_classes(\*\*params) -> RunnerInteractionListRunnerEnvironmentClassesResponse +- client.runner_interactions.list_runner_scm_integrations(\*\*params) -> RunnerInteractionListRunnerScmIntegrationsResponse - client.runner_interactions.mark_active(\*\*params) -> object +- client.runner_interactions.send_response(\*\*params) -> object - client.runner_interactions.signup(\*\*params) -> RunnerInteractionSignupResponse +- client.runner_interactions.update_runner_configuration_schema(\*\*params) -> object - client.runner_interactions.update_status(\*\*params) -> object -## Environment +## Environments Types: ```python from gitpod.types.runner_interactions import ( EnvironmentRetrieveResponse, + EnvironmentListResponse, EnvironmentUpdateStatusResponse, ) ``` Methods: -- client.runner_interactions.environment.retrieve(\*\*params) -> EnvironmentRetrieveResponse -- client.runner_interactions.environment.update_status(\*\*params) -> object - -## Environments - -Types: - -```python -from gitpod.types.runner_interactions import EnvironmentListResponse -``` - -Methods: - +- client.runner_interactions.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse - client.runner_interactions.environments.list(\*\*params) -> EnvironmentListResponse - -# RunnerInteraction - -Types: - -```python -from gitpod.types import ( - RunnerInteractionGetHostAuthenticationTokenValueResponse, - RunnerInteractionGetLatestVersionResponse, - RunnerInteractionListRunnerEnvironmentClassesResponse, - RunnerInteractionListRunnerScmIntegrationsResponse, - RunnerInteractionSendResponseResponse, - RunnerInteractionUpdateRunnerConfigurationSchemaResponse, -) -``` - -Methods: - -- client.runner_interaction.get_host_authentication_token_value(\*\*params) -> RunnerInteractionGetHostAuthenticationTokenValueResponse -- client.runner_interaction.get_latest_version(\*\*params) -> RunnerInteractionGetLatestVersionResponse -- client.runner_interaction.list_runner_environment_classes(\*\*params) -> RunnerInteractionListRunnerEnvironmentClassesResponse -- client.runner_interaction.list_runner_scm_integrations(\*\*params) -> RunnerInteractionListRunnerScmIntegrationsResponse -- client.runner_interaction.send_response(\*\*params) -> object -- client.runner_interaction.update_runner_configuration_schema(\*\*params) -> object +- client.runner_interactions.environments.update_status(\*\*params) -> object # Runners diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 17747277..6d7ffc33 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -50,14 +50,12 @@ class Gitpod(SyncAPIClient): automations_files: resources.AutomationsFilesResource tasks: resources.TasksResource environment_automations: resources.EnvironmentAutomationsResource - environment_automation: resources.EnvironmentAutomationResource environments: resources.EnvironmentsResource environment_classes: resources.EnvironmentClassesResource organizations: resources.OrganizationsResource projects: resources.ProjectsResource runner_configurations: resources.RunnerConfigurationsResource runner_interactions: resources.RunnerInteractionsResource - runner_interaction: resources.RunnerInteractionResource runners: resources.RunnersResource personal_access_tokens: resources.PersonalAccessTokensResource with_raw_response: GitpodWithRawResponse @@ -108,14 +106,12 @@ def __init__( self.automations_files = resources.AutomationsFilesResource(self) self.tasks = resources.TasksResource(self) self.environment_automations = resources.EnvironmentAutomationsResource(self) - self.environment_automation = resources.EnvironmentAutomationResource(self) self.environments = resources.EnvironmentsResource(self) self.environment_classes = resources.EnvironmentClassesResource(self) self.organizations = resources.OrganizationsResource(self) self.projects = resources.ProjectsResource(self) self.runner_configurations = resources.RunnerConfigurationsResource(self) self.runner_interactions = resources.RunnerInteractionsResource(self) - self.runner_interaction = resources.RunnerInteractionResource(self) self.runners = resources.RunnersResource(self) self.personal_access_tokens = resources.PersonalAccessTokensResource(self) self.with_raw_response = GitpodWithRawResponse(self) @@ -223,14 +219,12 @@ class AsyncGitpod(AsyncAPIClient): automations_files: resources.AsyncAutomationsFilesResource tasks: resources.AsyncTasksResource environment_automations: resources.AsyncEnvironmentAutomationsResource - environment_automation: resources.AsyncEnvironmentAutomationResource environments: resources.AsyncEnvironmentsResource environment_classes: resources.AsyncEnvironmentClassesResource organizations: resources.AsyncOrganizationsResource projects: resources.AsyncProjectsResource runner_configurations: resources.AsyncRunnerConfigurationsResource runner_interactions: resources.AsyncRunnerInteractionsResource - runner_interaction: resources.AsyncRunnerInteractionResource runners: resources.AsyncRunnersResource personal_access_tokens: resources.AsyncPersonalAccessTokensResource with_raw_response: AsyncGitpodWithRawResponse @@ -281,14 +275,12 @@ def __init__( self.automations_files = resources.AsyncAutomationsFilesResource(self) self.tasks = resources.AsyncTasksResource(self) self.environment_automations = resources.AsyncEnvironmentAutomationsResource(self) - self.environment_automation = resources.AsyncEnvironmentAutomationResource(self) self.environments = resources.AsyncEnvironmentsResource(self) self.environment_classes = resources.AsyncEnvironmentClassesResource(self) self.organizations = resources.AsyncOrganizationsResource(self) self.projects = resources.AsyncProjectsResource(self) self.runner_configurations = resources.AsyncRunnerConfigurationsResource(self) self.runner_interactions = resources.AsyncRunnerInteractionsResource(self) - self.runner_interaction = resources.AsyncRunnerInteractionResource(self) self.runners = resources.AsyncRunnersResource(self) self.personal_access_tokens = resources.AsyncPersonalAccessTokensResource(self) self.with_raw_response = AsyncGitpodWithRawResponse(self) @@ -399,16 +391,12 @@ def __init__(self, client: Gitpod) -> None: self.environment_automations = resources.EnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) - self.environment_automation = resources.EnvironmentAutomationResourceWithRawResponse( - client.environment_automation - ) self.environments = resources.EnvironmentsResourceWithRawResponse(client.environments) self.environment_classes = resources.EnvironmentClassesResourceWithRawResponse(client.environment_classes) self.organizations = resources.OrganizationsResourceWithRawResponse(client.organizations) self.projects = resources.ProjectsResourceWithRawResponse(client.projects) self.runner_configurations = resources.RunnerConfigurationsResourceWithRawResponse(client.runner_configurations) self.runner_interactions = resources.RunnerInteractionsResourceWithRawResponse(client.runner_interactions) - self.runner_interaction = resources.RunnerInteractionResourceWithRawResponse(client.runner_interaction) self.runners = resources.RunnersResourceWithRawResponse(client.runners) self.personal_access_tokens = resources.PersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens @@ -423,9 +411,6 @@ def __init__(self, client: AsyncGitpod) -> None: self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) - self.environment_automation = resources.AsyncEnvironmentAutomationResourceWithRawResponse( - client.environment_automation - ) self.environments = resources.AsyncEnvironmentsResourceWithRawResponse(client.environments) self.environment_classes = resources.AsyncEnvironmentClassesResourceWithRawResponse(client.environment_classes) self.organizations = resources.AsyncOrganizationsResourceWithRawResponse(client.organizations) @@ -434,7 +419,6 @@ def __init__(self, client: AsyncGitpod) -> None: client.runner_configurations ) self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithRawResponse(client.runner_interactions) - self.runner_interaction = resources.AsyncRunnerInteractionResourceWithRawResponse(client.runner_interaction) self.runners = resources.AsyncRunnersResourceWithRawResponse(client.runners) self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens @@ -449,9 +433,6 @@ def __init__(self, client: Gitpod) -> None: self.environment_automations = resources.EnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) - self.environment_automation = resources.EnvironmentAutomationResourceWithStreamingResponse( - client.environment_automation - ) self.environments = resources.EnvironmentsResourceWithStreamingResponse(client.environments) self.environment_classes = resources.EnvironmentClassesResourceWithStreamingResponse(client.environment_classes) self.organizations = resources.OrganizationsResourceWithStreamingResponse(client.organizations) @@ -460,7 +441,6 @@ def __init__(self, client: Gitpod) -> None: client.runner_configurations ) self.runner_interactions = resources.RunnerInteractionsResourceWithStreamingResponse(client.runner_interactions) - self.runner_interaction = resources.RunnerInteractionResourceWithStreamingResponse(client.runner_interaction) self.runners = resources.RunnersResourceWithStreamingResponse(client.runners) self.personal_access_tokens = resources.PersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens @@ -475,9 +455,6 @@ def __init__(self, client: AsyncGitpod) -> None: self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) - self.environment_automation = resources.AsyncEnvironmentAutomationResourceWithStreamingResponse( - client.environment_automation - ) self.environments = resources.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) self.environment_classes = resources.AsyncEnvironmentClassesResourceWithStreamingResponse( client.environment_classes @@ -490,9 +467,6 @@ def __init__(self, client: AsyncGitpod) -> None: self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithStreamingResponse( client.runner_interactions ) - self.runner_interaction = resources.AsyncRunnerInteractionResourceWithStreamingResponse( - client.runner_interaction - ) self.runners = resources.AsyncRunnersResourceWithStreamingResponse(client.runners) self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index 51c31275..3290b9ec 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -56,14 +56,6 @@ AutomationsFilesResourceWithStreamingResponse, AsyncAutomationsFilesResourceWithStreamingResponse, ) -from .runner_interaction import ( - RunnerInteractionResource, - AsyncRunnerInteractionResource, - RunnerInteractionResourceWithRawResponse, - AsyncRunnerInteractionResourceWithRawResponse, - RunnerInteractionResourceWithStreamingResponse, - AsyncRunnerInteractionResourceWithStreamingResponse, -) from .environment_classes import ( EnvironmentClassesResource, AsyncEnvironmentClassesResource, @@ -88,14 +80,6 @@ RunnerConfigurationsResourceWithStreamingResponse, AsyncRunnerConfigurationsResourceWithStreamingResponse, ) -from .environment_automation import ( - EnvironmentAutomationResource, - AsyncEnvironmentAutomationResource, - EnvironmentAutomationResourceWithRawResponse, - AsyncEnvironmentAutomationResourceWithRawResponse, - EnvironmentAutomationResourceWithStreamingResponse, - AsyncEnvironmentAutomationResourceWithStreamingResponse, -) from .personal_access_tokens import ( PersonalAccessTokensResource, AsyncPersonalAccessTokensResource, @@ -138,12 +122,6 @@ "AsyncEnvironmentAutomationsResourceWithRawResponse", "EnvironmentAutomationsResourceWithStreamingResponse", "AsyncEnvironmentAutomationsResourceWithStreamingResponse", - "EnvironmentAutomationResource", - "AsyncEnvironmentAutomationResource", - "EnvironmentAutomationResourceWithRawResponse", - "AsyncEnvironmentAutomationResourceWithRawResponse", - "EnvironmentAutomationResourceWithStreamingResponse", - "AsyncEnvironmentAutomationResourceWithStreamingResponse", "EnvironmentsResource", "AsyncEnvironmentsResource", "EnvironmentsResourceWithRawResponse", @@ -180,12 +158,6 @@ "AsyncRunnerInteractionsResourceWithRawResponse", "RunnerInteractionsResourceWithStreamingResponse", "AsyncRunnerInteractionsResourceWithStreamingResponse", - "RunnerInteractionResource", - "AsyncRunnerInteractionResource", - "RunnerInteractionResourceWithRawResponse", - "AsyncRunnerInteractionResourceWithRawResponse", - "RunnerInteractionResourceWithStreamingResponse", - "AsyncRunnerInteractionResourceWithStreamingResponse", "RunnersResource", "AsyncRunnersResource", "RunnersResourceWithRawResponse", diff --git a/src/gitpod/resources/environment_automations/task_executions.py b/src/gitpod/resources/environment_automations/task_executions.py index 7b79a67e..c1ced3aa 100644 --- a/src/gitpod/resources/environment_automations/task_executions.py +++ b/src/gitpod/resources/environment_automations/task_executions.py @@ -28,6 +28,7 @@ task_execution_retrieve_params, task_execution_create_list_params, task_execution_create_retrieve_params, + task_execution_update_task_execution_status_params, ) from ...types.environment_automations.task_execution_list_response import TaskExecutionListResponse from ...types.environment_automations.task_execution_retrieve_response import TaskExecutionRetrieveResponse @@ -335,6 +336,57 @@ def stop( cast_to=object, ) + def update_task_execution_status( + self, + *, + body: task_execution_update_task_execution_status_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """UpdateTaskExecutionStatus updates the status of a task execution. + + Only the + environment executing a task execution is expected to call this function. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", + body=maybe_transform( + body, task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + class AsyncTaskExecutionsResource(AsyncAPIResource): @cached_property @@ -636,6 +688,57 @@ async def stop( cast_to=object, ) + async def update_task_execution_status( + self, + *, + body: task_execution_update_task_execution_status_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """UpdateTaskExecutionStatus updates the status of a task execution. + + Only the + environment executing a task execution is expected to call this function. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", + body=await async_maybe_transform( + body, task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + class TaskExecutionsResourceWithRawResponse: def __init__(self, task_executions: TaskExecutionsResource) -> None: @@ -656,6 +759,9 @@ def __init__(self, task_executions: TaskExecutionsResource) -> None: self.stop = to_raw_response_wrapper( task_executions.stop, ) + self.update_task_execution_status = to_raw_response_wrapper( + task_executions.update_task_execution_status, + ) class AsyncTaskExecutionsResourceWithRawResponse: @@ -677,6 +783,9 @@ def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: self.stop = async_to_raw_response_wrapper( task_executions.stop, ) + self.update_task_execution_status = async_to_raw_response_wrapper( + task_executions.update_task_execution_status, + ) class TaskExecutionsResourceWithStreamingResponse: @@ -698,6 +807,9 @@ def __init__(self, task_executions: TaskExecutionsResource) -> None: self.stop = to_streamed_response_wrapper( task_executions.stop, ) + self.update_task_execution_status = to_streamed_response_wrapper( + task_executions.update_task_execution_status, + ) class AsyncTaskExecutionsResourceWithStreamingResponse: @@ -719,3 +831,6 @@ def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: self.stop = async_to_streamed_response_wrapper( task_executions.stop, ) + self.update_task_execution_status = async_to_streamed_response_wrapper( + task_executions.update_task_execution_status, + ) diff --git a/src/gitpod/resources/runner_interactions/__init__.py b/src/gitpod/resources/runner_interactions/__init__.py index 4bd52c99..6f7456f6 100644 --- a/src/gitpod/resources/runner_interactions/__init__.py +++ b/src/gitpod/resources/runner_interactions/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .environment import ( - EnvironmentResource, - AsyncEnvironmentResource, - EnvironmentResourceWithRawResponse, - AsyncEnvironmentResourceWithRawResponse, - EnvironmentResourceWithStreamingResponse, - AsyncEnvironmentResourceWithStreamingResponse, -) from .environments import ( EnvironmentsResource, AsyncEnvironmentsResource, @@ -26,12 +18,6 @@ ) __all__ = [ - "EnvironmentResource", - "AsyncEnvironmentResource", - "EnvironmentResourceWithRawResponse", - "AsyncEnvironmentResourceWithRawResponse", - "EnvironmentResourceWithStreamingResponse", - "AsyncEnvironmentResourceWithStreamingResponse", "EnvironmentsResource", "AsyncEnvironmentsResource", "EnvironmentsResourceWithRawResponse", diff --git a/src/gitpod/resources/runner_interactions/environments.py b/src/gitpod/resources/runner_interactions/environments.py index 1cc9c8ee..617f8160 100644 --- a/src/gitpod/resources/runner_interactions/environments.py +++ b/src/gitpod/resources/runner_interactions/environments.py @@ -23,8 +23,13 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.runner_interactions import environment_list_params +from ...types.runner_interactions import ( + environment_list_params, + environment_retrieve_params, + environment_update_status_params, +) from ...types.runner_interactions.environment_list_response import EnvironmentListResponse +from ...types.runner_interactions.environment_retrieve_response import EnvironmentRetrieveResponse __all__ = ["EnvironmentsResource", "AsyncEnvironmentsResource"] @@ -49,6 +54,64 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: """ return EnvironmentsResourceWithStreamingResponse(self) + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentRetrieveResponse: + """ + GetRunnerEnvironment returns the environment given it is owned by the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: The environment's ID + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/GetRunnerEnvironment", + body=maybe_transform( + { + "environment_id": environment_id, + "runner_id": runner_id, + }, + environment_retrieve_params.EnvironmentRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentRetrieveResponse, + ) + def list( self, *, @@ -112,6 +175,69 @@ def list( cast_to=EnvironmentListResponse, ) + def update_status( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + status: environment_update_status_params.Status | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerEnvironmentStatus updates the status of an environment this runner + is responsible for. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: The environment's ID + + runner_id: The runner's identity + + status: EnvironmentStatus describes an environment status + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerEnvironmentStatus", + body=maybe_transform( + { + "environment_id": environment_id, + "runner_id": runner_id, + "status": status, + }, + environment_update_status_params.EnvironmentUpdateStatusParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + class AsyncEnvironmentsResource(AsyncAPIResource): @cached_property @@ -133,6 +259,64 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo """ return AsyncEnvironmentsResourceWithStreamingResponse(self) + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentRetrieveResponse: + """ + GetRunnerEnvironment returns the environment given it is owned by the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: The environment's ID + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/GetRunnerEnvironment", + body=await async_maybe_transform( + { + "environment_id": environment_id, + "runner_id": runner_id, + }, + environment_retrieve_params.EnvironmentRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentRetrieveResponse, + ) + async def list( self, *, @@ -196,38 +380,125 @@ async def list( cast_to=EnvironmentListResponse, ) + async def update_status( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + status: environment_update_status_params.Status | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerEnvironmentStatus updates the status of an environment this runner + is responsible for. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: The environment's ID + + runner_id: The runner's identity + + status: EnvironmentStatus describes an environment status + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerEnvironmentStatus", + body=await async_maybe_transform( + { + "environment_id": environment_id, + "runner_id": runner_id, + "status": status, + }, + environment_update_status_params.EnvironmentUpdateStatusParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + class EnvironmentsResourceWithRawResponse: def __init__(self, environments: EnvironmentsResource) -> None: self._environments = environments + self.retrieve = to_raw_response_wrapper( + environments.retrieve, + ) self.list = to_raw_response_wrapper( environments.list, ) + self.update_status = to_raw_response_wrapper( + environments.update_status, + ) class AsyncEnvironmentsResourceWithRawResponse: def __init__(self, environments: AsyncEnvironmentsResource) -> None: self._environments = environments + self.retrieve = async_to_raw_response_wrapper( + environments.retrieve, + ) self.list = async_to_raw_response_wrapper( environments.list, ) + self.update_status = async_to_raw_response_wrapper( + environments.update_status, + ) class EnvironmentsResourceWithStreamingResponse: def __init__(self, environments: EnvironmentsResource) -> None: self._environments = environments + self.retrieve = to_streamed_response_wrapper( + environments.retrieve, + ) self.list = to_streamed_response_wrapper( environments.list, ) + self.update_status = to_streamed_response_wrapper( + environments.update_status, + ) class AsyncEnvironmentsResourceWithStreamingResponse: def __init__(self, environments: AsyncEnvironmentsResource) -> None: self._environments = environments + self.retrieve = async_to_streamed_response_wrapper( + environments.retrieve, + ) self.list = async_to_streamed_response_wrapper( environments.list, ) + self.update_status = async_to_streamed_response_wrapper( + environments.update_status, + ) diff --git a/src/gitpod/resources/runner_interactions/runner_interactions.py b/src/gitpod/resources/runner_interactions/runner_interactions.py index 75b19c96..6d74805a 100644 --- a/src/gitpod/resources/runner_interactions/runner_interactions.py +++ b/src/gitpod/resources/runner_interactions/runner_interactions.py @@ -3,14 +3,20 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ...types import ( runner_interaction_signup_params, runner_interaction_mark_active_params, + runner_interaction_send_response_params, runner_interaction_update_status_params, + runner_interaction_get_latest_version_params, + runner_interaction_list_runner_scm_integrations_params, + runner_interaction_list_runner_environment_classes_params, + runner_interaction_update_runner_configuration_schema_params, + runner_interaction_get_host_authentication_token_value_params, ) from ..._types import ( NOT_GIVEN, @@ -22,6 +28,7 @@ ) from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -34,14 +41,6 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .environment import ( - EnvironmentResource, - AsyncEnvironmentResource, - EnvironmentResourceWithRawResponse, - AsyncEnvironmentResourceWithRawResponse, - EnvironmentResourceWithStreamingResponse, - AsyncEnvironmentResourceWithStreamingResponse, -) from .environments import ( EnvironmentsResource, AsyncEnvironmentsResource, @@ -52,15 +51,21 @@ ) from ..._base_client import make_request_options from ...types.runner_interaction_signup_response import RunnerInteractionSignupResponse +from ...types.runner_interaction_get_latest_version_response import RunnerInteractionGetLatestVersionResponse +from ...types.runner_interaction_list_runner_scm_integrations_response import ( + RunnerInteractionListRunnerScmIntegrationsResponse, +) +from ...types.runner_interaction_list_runner_environment_classes_response import ( + RunnerInteractionListRunnerEnvironmentClassesResponse, +) +from ...types.runner_interaction_get_host_authentication_token_value_response import ( + RunnerInteractionGetHostAuthenticationTokenValueResponse, +) __all__ = ["RunnerInteractionsResource", "AsyncRunnerInteractionsResource"] class RunnerInteractionsResource(SyncAPIResource): - @cached_property - def environment(self) -> EnvironmentResource: - return EnvironmentResource(self._client) - @cached_property def environments(self) -> EnvironmentsResource: return EnvironmentsResource(self._client) @@ -84,7 +89,967 @@ def with_streaming_response(self) -> RunnerInteractionsResourceWithStreamingResp """ return RunnerInteractionsResourceWithStreamingResponse(self) - def mark_active( + def get_host_authentication_token_value( + self, + *, + connect_protocol_version: Literal[1], + host: str | NotGiven = NOT_GIVEN, + principal_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionGetHostAuthenticationTokenValueResponse: + """ + GetRunnerHostAuthenticationToken returns an authentication token for the given + host. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + host: The host to get the authentication token for + + principal_id: The principal's ID to get the authentication token for + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/GetHostAuthenticationTokenValue", + body=maybe_transform( + { + "host": host, + "principal_id": principal_id, + "runner_id": runner_id, + }, + runner_interaction_get_host_authentication_token_value_params.RunnerInteractionGetHostAuthenticationTokenValueParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionGetHostAuthenticationTokenValueResponse, + ) + + def get_latest_version( + self, + *, + connect_protocol_version: Literal[1], + current_version: str | NotGiven = NOT_GIVEN, + infrastructure_version: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionGetLatestVersionResponse: + """ + GetLatestVersion returns the latest version of the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + current_version: The current version of the runner + + infrastructure_version: The version of the infrastructure + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/GetLatestVersion", + body=maybe_transform( + { + "current_version": current_version, + "infrastructure_version": infrastructure_version, + "runner_id": runner_id, + }, + runner_interaction_get_latest_version_params.RunnerInteractionGetLatestVersionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionGetLatestVersionResponse, + ) + + def list_runner_environment_classes( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_interaction_list_runner_environment_classes_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_interaction_list_runner_environment_classes_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionListRunnerEnvironmentClassesResponse: + """ + ListRunnerEnvironmentClasses returns the environment classes configured for the + runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environment classes + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironmentClasses", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + "runner_id": runner_id, + }, + runner_interaction_list_runner_environment_classes_params.RunnerInteractionListRunnerEnvironmentClassesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionListRunnerEnvironmentClassesResponse, + ) + + def list_runner_scm_integrations( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_interaction_list_runner_scm_integrations_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_interaction_list_runner_scm_integrations_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionListRunnerScmIntegrationsResponse: + """ + ListRunnerSCMIntegrations + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing SCM integrations + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerSCMIntegrations", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + "runner_id": runner_id, + }, + runner_interaction_list_runner_scm_integrations_params.RunnerInteractionListRunnerScmIntegrationsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionListRunnerScmIntegrationsResponse, + ) + + def mark_active( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """MarkRunnerActive marks a runner as available. + + This must be called every 30 + seconds to keep the runner active. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/MarkRunnerActive", + body=maybe_transform( + {"runner_id": runner_id}, runner_interaction_mark_active_params.RunnerInteractionMarkActiveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["body", "connect_protocol_version"]) + def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/SendResponse", + body=maybe_transform(body, runner_interaction_send_response_params.RunnerInteractionSendResponseParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def signup( + self, + *, + connect_protocol_version: Literal[1], + environment_classes: Iterable[runner_interaction_signup_params.EnvironmentClass] | NotGiven = NOT_GIVEN, + public_key: Union[str, Base64FileInput] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionSignupResponse: + """Signup is called by a runner to sign up with the backend. + + This is the first call + a runner makes. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_classes: The environment classes this runner has to offer + + public_key: The runner's public key. Must be an ECDH public key encoded in PKIX, ASN.1 DER + format. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/Signup", + body=maybe_transform( + { + "environment_classes": environment_classes, + "public_key": public_key, + }, + runner_interaction_signup_params.RunnerInteractionSignupParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionSignupResponse, + ) + + def update_runner_configuration_schema( + self, + *, + connect_protocol_version: Literal[1], + config_schema: runner_interaction_update_runner_configuration_schema_params.ConfigSchema | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerConfigurationSchema updates the runner's configuration schema. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + config_schema: config_schema is the schema for the runner's configuration + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerConfigurationSchema", + body=maybe_transform( + { + "config_schema": config_schema, + "runner_id": runner_id, + }, + runner_interaction_update_runner_configuration_schema_params.RunnerInteractionUpdateRunnerConfigurationSchemaParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def update_status( + self, + *, + body: runner_interaction_update_status_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerStatus updates the status of the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerStatus", + body=maybe_transform(body, runner_interaction_update_status_params.RunnerInteractionUpdateStatusParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncRunnerInteractionsResource(AsyncAPIResource): + @cached_property + def environments(self) -> AsyncEnvironmentsResource: + return AsyncEnvironmentsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncRunnerInteractionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncRunnerInteractionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRunnerInteractionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncRunnerInteractionsResourceWithStreamingResponse(self) + + async def get_host_authentication_token_value( + self, + *, + connect_protocol_version: Literal[1], + host: str | NotGiven = NOT_GIVEN, + principal_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionGetHostAuthenticationTokenValueResponse: + """ + GetRunnerHostAuthenticationToken returns an authentication token for the given + host. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + host: The host to get the authentication token for + + principal_id: The principal's ID to get the authentication token for + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/GetHostAuthenticationTokenValue", + body=await async_maybe_transform( + { + "host": host, + "principal_id": principal_id, + "runner_id": runner_id, + }, + runner_interaction_get_host_authentication_token_value_params.RunnerInteractionGetHostAuthenticationTokenValueParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionGetHostAuthenticationTokenValueResponse, + ) + + async def get_latest_version( + self, + *, + connect_protocol_version: Literal[1], + current_version: str | NotGiven = NOT_GIVEN, + infrastructure_version: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionGetLatestVersionResponse: + """ + GetLatestVersion returns the latest version of the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + current_version: The current version of the runner + + infrastructure_version: The version of the infrastructure + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/GetLatestVersion", + body=await async_maybe_transform( + { + "current_version": current_version, + "infrastructure_version": infrastructure_version, + "runner_id": runner_id, + }, + runner_interaction_get_latest_version_params.RunnerInteractionGetLatestVersionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionGetLatestVersionResponse, + ) + + async def list_runner_environment_classes( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_interaction_list_runner_environment_classes_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_interaction_list_runner_environment_classes_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionListRunnerEnvironmentClassesResponse: + """ + ListRunnerEnvironmentClasses returns the environment classes configured for the + runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environment classes + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironmentClasses", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + "runner_id": runner_id, + }, + runner_interaction_list_runner_environment_classes_params.RunnerInteractionListRunnerEnvironmentClassesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionListRunnerEnvironmentClassesResponse, + ) + + async def list_runner_scm_integrations( + self, + *, + connect_protocol_version: Literal[1], + filter: runner_interaction_list_runner_scm_integrations_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_interaction_list_runner_scm_integrations_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerInteractionListRunnerScmIntegrationsResponse: + """ + ListRunnerSCMIntegrations + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing SCM integrations + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/ListRunnerSCMIntegrations", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + "runner_id": runner_id, + }, + runner_interaction_list_runner_scm_integrations_params.RunnerInteractionListRunnerScmIntegrationsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerInteractionListRunnerScmIntegrationsResponse, + ) + + async def mark_active( self, *, connect_protocol_version: Literal[1], @@ -126,9 +1091,9 @@ def mark_active( ), **(extra_headers or {}), } - return self._post( + return await self._post( "/gitpod.v1.RunnerInteractionService/MarkRunnerActive", - body=maybe_transform( + body=await async_maybe_transform( {"runner_id": runner_id}, runner_interaction_mark_active_params.RunnerInteractionMarkActiveParams ), options=make_request_options( @@ -137,12 +1102,12 @@ def mark_active( cast_to=object, ) - def signup( + @overload + async def send_response( self, *, + body: object, connect_protocol_version: Literal[1], - environment_classes: Iterable[runner_interaction_signup_params.EnvironmentClass] | NotGiven = NOT_GIVEN, - public_key: Union[str, Base64FileInput] | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -150,19 +1115,44 @@ def signup( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionSignupResponse: - """Signup is called by a runner to sign up with the backend. - - This is the first call - a runner makes. + ) -> object: + """ + SendResponse sends a response to a request. Args: connect_protocol_version: Define the version of the Connect protocol - environment_classes: The environment classes this runner has to offer + connect_timeout_ms: Define the timeout, in ms - public_key: The runner's public key. Must be an ECDH public key encoded in PKIX, ASN.1 DER - format. + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + + Args: + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -174,34 +1164,13 @@ def signup( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/Signup", - body=maybe_transform( - { - "environment_classes": environment_classes, - "public_key": public_key, - }, - runner_interaction_signup_params.RunnerInteractionSignupParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionSignupResponse, - ) + ... - def update_status( + @overload + async def send_response( self, *, - body: runner_interaction_update_status_params.Body, + body: object, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -212,7 +1181,7 @@ def update_status( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateRunnerStatus updates the status of the runner. + SendResponse sends a response to a request. Args: connect_protocol_version: Define the version of the Connect protocol @@ -227,58 +1196,78 @@ def update_status( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerStatus", - body=maybe_transform(body, runner_interaction_update_status_params.RunnerInteractionUpdateStatusParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) + ... + + @overload + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SendResponse sends a response to a request. + Args: + connect_protocol_version: Define the version of the Connect protocol -class AsyncRunnerInteractionsResource(AsyncAPIResource): - @cached_property - def environment(self) -> AsyncEnvironmentResource: - return AsyncEnvironmentResource(self._client) + connect_timeout_ms: Define the timeout, in ms - @cached_property - def environments(self) -> AsyncEnvironmentsResource: - return AsyncEnvironmentsResource(self._client) + extra_headers: Send extra headers - @cached_property - def with_raw_response(self) -> AsyncRunnerInteractionsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. + extra_query: Add additional query parameters to the request - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ - return AsyncRunnerInteractionsResourceWithRawResponse(self) + ... - @cached_property - def with_streaming_response(self) -> AsyncRunnerInteractionsResourceWithStreamingResponse: + @overload + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. + SendResponse sends a response to a request. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ - return AsyncRunnerInteractionsResourceWithStreamingResponse(self) + ... - async def mark_active( + @overload + async def send_response( self, *, + body: object, connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -287,16 +1276,12 @@ async def mark_active( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """MarkRunnerActive marks a runner as available. - - This must be called every 30 - seconds to keep the runner active. + """ + SendResponse sends a response to a request. Args: connect_protocol_version: Define the version of the Connect protocol - runner_id: The runner's identity - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -307,6 +1292,22 @@ async def mark_active( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["body", "connect_protocol_version"]) + async def send_response( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -317,9 +1318,9 @@ async def mark_active( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.RunnerInteractionService/MarkRunnerActive", + "/gitpod.v1.RunnerInteractionService/SendResponse", body=await async_maybe_transform( - {"runner_id": runner_id}, runner_interaction_mark_active_params.RunnerInteractionMarkActiveParams + body, runner_interaction_send_response_params.RunnerInteractionSendResponseParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -388,6 +1389,64 @@ async def signup( cast_to=RunnerInteractionSignupResponse, ) + async def update_runner_configuration_schema( + self, + *, + connect_protocol_version: Literal[1], + config_schema: runner_interaction_update_runner_configuration_schema_params.ConfigSchema | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunnerConfigurationSchema updates the runner's configuration schema. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + config_schema: config_schema is the schema for the runner's configuration + + runner_id: The runner's identity + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerInteractionService/UpdateRunnerConfigurationSchema", + body=await async_maybe_transform( + { + "config_schema": config_schema, + "runner_id": runner_id, + }, + runner_interaction_update_runner_configuration_schema_params.RunnerInteractionUpdateRunnerConfigurationSchemaParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + async def update_status( self, *, @@ -442,20 +1501,34 @@ class RunnerInteractionsResourceWithRawResponse: def __init__(self, runner_interactions: RunnerInteractionsResource) -> None: self._runner_interactions = runner_interactions + self.get_host_authentication_token_value = to_raw_response_wrapper( + runner_interactions.get_host_authentication_token_value, + ) + self.get_latest_version = to_raw_response_wrapper( + runner_interactions.get_latest_version, + ) + self.list_runner_environment_classes = to_raw_response_wrapper( + runner_interactions.list_runner_environment_classes, + ) + self.list_runner_scm_integrations = to_raw_response_wrapper( + runner_interactions.list_runner_scm_integrations, + ) self.mark_active = to_raw_response_wrapper( runner_interactions.mark_active, ) + self.send_response = to_raw_response_wrapper( + runner_interactions.send_response, + ) self.signup = to_raw_response_wrapper( runner_interactions.signup, ) + self.update_runner_configuration_schema = to_raw_response_wrapper( + runner_interactions.update_runner_configuration_schema, + ) self.update_status = to_raw_response_wrapper( runner_interactions.update_status, ) - @cached_property - def environment(self) -> EnvironmentResourceWithRawResponse: - return EnvironmentResourceWithRawResponse(self._runner_interactions.environment) - @cached_property def environments(self) -> EnvironmentsResourceWithRawResponse: return EnvironmentsResourceWithRawResponse(self._runner_interactions.environments) @@ -465,20 +1538,34 @@ class AsyncRunnerInteractionsResourceWithRawResponse: def __init__(self, runner_interactions: AsyncRunnerInteractionsResource) -> None: self._runner_interactions = runner_interactions + self.get_host_authentication_token_value = async_to_raw_response_wrapper( + runner_interactions.get_host_authentication_token_value, + ) + self.get_latest_version = async_to_raw_response_wrapper( + runner_interactions.get_latest_version, + ) + self.list_runner_environment_classes = async_to_raw_response_wrapper( + runner_interactions.list_runner_environment_classes, + ) + self.list_runner_scm_integrations = async_to_raw_response_wrapper( + runner_interactions.list_runner_scm_integrations, + ) self.mark_active = async_to_raw_response_wrapper( runner_interactions.mark_active, ) + self.send_response = async_to_raw_response_wrapper( + runner_interactions.send_response, + ) self.signup = async_to_raw_response_wrapper( runner_interactions.signup, ) + self.update_runner_configuration_schema = async_to_raw_response_wrapper( + runner_interactions.update_runner_configuration_schema, + ) self.update_status = async_to_raw_response_wrapper( runner_interactions.update_status, ) - @cached_property - def environment(self) -> AsyncEnvironmentResourceWithRawResponse: - return AsyncEnvironmentResourceWithRawResponse(self._runner_interactions.environment) - @cached_property def environments(self) -> AsyncEnvironmentsResourceWithRawResponse: return AsyncEnvironmentsResourceWithRawResponse(self._runner_interactions.environments) @@ -488,20 +1575,34 @@ class RunnerInteractionsResourceWithStreamingResponse: def __init__(self, runner_interactions: RunnerInteractionsResource) -> None: self._runner_interactions = runner_interactions + self.get_host_authentication_token_value = to_streamed_response_wrapper( + runner_interactions.get_host_authentication_token_value, + ) + self.get_latest_version = to_streamed_response_wrapper( + runner_interactions.get_latest_version, + ) + self.list_runner_environment_classes = to_streamed_response_wrapper( + runner_interactions.list_runner_environment_classes, + ) + self.list_runner_scm_integrations = to_streamed_response_wrapper( + runner_interactions.list_runner_scm_integrations, + ) self.mark_active = to_streamed_response_wrapper( runner_interactions.mark_active, ) + self.send_response = to_streamed_response_wrapper( + runner_interactions.send_response, + ) self.signup = to_streamed_response_wrapper( runner_interactions.signup, ) + self.update_runner_configuration_schema = to_streamed_response_wrapper( + runner_interactions.update_runner_configuration_schema, + ) self.update_status = to_streamed_response_wrapper( runner_interactions.update_status, ) - @cached_property - def environment(self) -> EnvironmentResourceWithStreamingResponse: - return EnvironmentResourceWithStreamingResponse(self._runner_interactions.environment) - @cached_property def environments(self) -> EnvironmentsResourceWithStreamingResponse: return EnvironmentsResourceWithStreamingResponse(self._runner_interactions.environments) @@ -511,20 +1612,34 @@ class AsyncRunnerInteractionsResourceWithStreamingResponse: def __init__(self, runner_interactions: AsyncRunnerInteractionsResource) -> None: self._runner_interactions = runner_interactions + self.get_host_authentication_token_value = async_to_streamed_response_wrapper( + runner_interactions.get_host_authentication_token_value, + ) + self.get_latest_version = async_to_streamed_response_wrapper( + runner_interactions.get_latest_version, + ) + self.list_runner_environment_classes = async_to_streamed_response_wrapper( + runner_interactions.list_runner_environment_classes, + ) + self.list_runner_scm_integrations = async_to_streamed_response_wrapper( + runner_interactions.list_runner_scm_integrations, + ) self.mark_active = async_to_streamed_response_wrapper( runner_interactions.mark_active, ) + self.send_response = async_to_streamed_response_wrapper( + runner_interactions.send_response, + ) self.signup = async_to_streamed_response_wrapper( runner_interactions.signup, ) + self.update_runner_configuration_schema = async_to_streamed_response_wrapper( + runner_interactions.update_runner_configuration_schema, + ) self.update_status = async_to_streamed_response_wrapper( runner_interactions.update_status, ) - @cached_property - def environment(self) -> AsyncEnvironmentResourceWithStreamingResponse: - return AsyncEnvironmentResourceWithStreamingResponse(self._runner_interactions.environment) - @cached_property def environments(self) -> AsyncEnvironmentsResourceWithStreamingResponse: return AsyncEnvironmentsResourceWithStreamingResponse(self._runner_interactions.environments) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index f2ea748c..e33aeb77 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -98,9 +98,6 @@ from .runner_interaction_list_runner_environment_classes_params import ( RunnerInteractionListRunnerEnvironmentClassesParams as RunnerInteractionListRunnerEnvironmentClassesParams, ) -from .environment_automation_update_task_execution_status_params import ( - EnvironmentAutomationUpdateTaskExecutionStatusParams as EnvironmentAutomationUpdateTaskExecutionStatusParams, -) from .runner_interaction_list_runner_environment_classes_response import ( RunnerInteractionListRunnerEnvironmentClassesResponse as RunnerInteractionListRunnerEnvironmentClassesResponse, ) diff --git a/src/gitpod/types/environment_automations/__init__.py b/src/gitpod/types/environment_automations/__init__.py index 20d1c6df..ddf0450b 100644 --- a/src/gitpod/types/environment_automations/__init__.py +++ b/src/gitpod/types/environment_automations/__init__.py @@ -23,3 +23,6 @@ from .task_execution_create_retrieve_response import ( TaskExecutionCreateRetrieveResponse as TaskExecutionCreateRetrieveResponse, ) +from .task_execution_update_task_execution_status_params import ( + TaskExecutionUpdateTaskExecutionStatusParams as TaskExecutionUpdateTaskExecutionStatusParams, +) diff --git a/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py b/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py new file mode 100644 index 00000000..dda988a7 --- /dev/null +++ b/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from ...types.environment_automations import task_execution_update_task_execution_status_params + +__all__ = ["TaskExecutionUpdateTaskExecutionStatusParams"] + + +class TaskExecutionUpdateTaskExecutionStatusParams(TypedDict, total=False): + body: Required[task_execution_update_task_execution_status_params.Body] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/tests/api_resources/environment_automations/test_task_executions.py b/tests/api_resources/environment_automations/test_task_executions.py index 6bf94ee1..271d1b6f 100644 --- a/tests/api_resources/environment_automations/test_task_executions.py +++ b/tests/api_resources/environment_automations/test_task_executions.py @@ -251,6 +251,70 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_update_task_execution_status(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_method_update_task_execution_status_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environment_automations.task_executions.update_task_execution_status( + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failureMessage": "failureMessage", + "logUrl": "logUrl", + "steps": [ + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + ], + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_raw_response_update_task_execution_status(self, client: Gitpod) -> None: + response = client.environment_automations.task_executions.with_raw_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_update_task_execution_status(self, client: Gitpod) -> None: + with client.environment_automations.task_executions.with_streaming_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncTaskExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -483,3 +547,69 @@ async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, task_execution, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_method_update_task_execution_status_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environment_automations.task_executions.update_task_execution_status( + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failureMessage": "failureMessage", + "logUrl": "logUrl", + "steps": [ + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + }, + ], + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + response = ( + await async_client.environment_automations.task_executions.with_raw_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.task_executions.with_streaming_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_interactions/test_environments.py b/tests/api_resources/runner_interactions/test_environments.py index 4cda0e67..1f03bf45 100644 --- a/tests/api_resources/runner_interactions/test_environments.py +++ b/tests/api_resources/runner_interactions/test_environments.py @@ -9,7 +9,10 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types.runner_interactions import EnvironmentListResponse +from gitpod.types.runner_interactions import ( + EnvironmentListResponse, + EnvironmentRetrieveResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,6 +20,47 @@ class TestEnvironments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + environment = client.runner_interactions.environments.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + environment = client.runner_interactions.environments.retrieve( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runner_interactions.environments.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runner_interactions.environments.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_list(self, client: Gitpod) -> None: environment = client.runner_interactions.environments.list( @@ -66,10 +110,216 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_update_status(self, client: Gitpod) -> None: + environment = client.runner_interactions.environments.update_status( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_method_update_status_with_all_params(self, client: Gitpod) -> None: + environment = client.runner_interactions.environments.update_status( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + status={ + "automations_file": { + "automations_file_path": "automationsFilePath", + "automations_file_presence": "PRESENCE_UNSPECIFIED", + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "session": "session", + }, + "content": { + "content_location_in_machine": "contentLocationInMachine", + "failure_message": "failureMessage", + "git": { + "branch": "branch", + "changed_files": [ + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + ], + "clone_url": "cloneUrl", + "latest_commit": "latestCommit", + "total_changed_files": 0, + "total_unpushed_commits": 0, + "unpushed_commits": ["string", "string", "string"], + }, + "phase": "CONTENT_PHASE_UNSPECIFIED", + "session": "session", + "warning_message": "warningMessage", + }, + "devcontainer": { + "container_id": "containerId", + "container_name": "containerName", + "devcontainerconfig_in_sync": True, + "devcontainer_file_path": "devcontainerFilePath", + "devcontainer_file_presence": "PRESENCE_UNSPECIFIED", + "failure_message": "failureMessage", + "phase": "PHASE_UNSPECIFIED", + "remote_user": "remoteUser", + "remote_workspace_folder": "remoteWorkspaceFolder", + "secrets_in_sync": True, + "session": "session", + "warning_message": "warningMessage", + }, + "environment_urls": { + "logs": "logs", + "ports": [ + { + "port": 1, + "url": "url", + }, + { + "port": 1, + "url": "url", + }, + { + "port": 1, + "url": "url", + }, + ], + "ssh": {"url": "url"}, + }, + "failure_message": ["string", "string", "string"], + "machine": { + "failure_message": "failureMessage", + "phase": "PHASE_UNSPECIFIED", + "session": "session", + "timeout": "timeout", + "versions": { + "supervisor_commit": "supervisorCommit", + "supervisor_version": "supervisorVersion", + }, + "warning_message": "warningMessage", + }, + "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", + "runner_ack": { + "message": "message", + "spec_version": "string", + "status_code": "STATUS_CODE_UNSPECIFIED", + }, + "secrets": [ + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + ], + "ssh_public_keys": [ + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + ], + "status_version": "string", + "warning_message": ["string", "string", "string"], + }, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_raw_response_update_status(self, client: Gitpod) -> None: + response = client.runner_interactions.environments.with_raw_response.update_status( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_streaming_response_update_status(self, client: Gitpod) -> None: + with client.runner_interactions.environments.with_streaming_response.update_status( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncEnvironments: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environments.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environments.retrieve( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.environments.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.environments.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment = await async_client.runner_interactions.environments.list( @@ -118,3 +368,168 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert_matches_type(EnvironmentListResponse, environment, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_status(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environments.update_status( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.runner_interactions.environments.update_status( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + status={ + "automations_file": { + "automations_file_path": "automationsFilePath", + "automations_file_presence": "PRESENCE_UNSPECIFIED", + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "session": "session", + }, + "content": { + "content_location_in_machine": "contentLocationInMachine", + "failure_message": "failureMessage", + "git": { + "branch": "branch", + "changed_files": [ + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + { + "change_type": "CHANGE_TYPE_UNSPECIFIED", + "path": "path", + }, + ], + "clone_url": "cloneUrl", + "latest_commit": "latestCommit", + "total_changed_files": 0, + "total_unpushed_commits": 0, + "unpushed_commits": ["string", "string", "string"], + }, + "phase": "CONTENT_PHASE_UNSPECIFIED", + "session": "session", + "warning_message": "warningMessage", + }, + "devcontainer": { + "container_id": "containerId", + "container_name": "containerName", + "devcontainerconfig_in_sync": True, + "devcontainer_file_path": "devcontainerFilePath", + "devcontainer_file_presence": "PRESENCE_UNSPECIFIED", + "failure_message": "failureMessage", + "phase": "PHASE_UNSPECIFIED", + "remote_user": "remoteUser", + "remote_workspace_folder": "remoteWorkspaceFolder", + "secrets_in_sync": True, + "session": "session", + "warning_message": "warningMessage", + }, + "environment_urls": { + "logs": "logs", + "ports": [ + { + "port": 1, + "url": "url", + }, + { + "port": 1, + "url": "url", + }, + { + "port": 1, + "url": "url", + }, + ], + "ssh": {"url": "url"}, + }, + "failure_message": ["string", "string", "string"], + "machine": { + "failure_message": "failureMessage", + "phase": "PHASE_UNSPECIFIED", + "session": "session", + "timeout": "timeout", + "versions": { + "supervisor_commit": "supervisorCommit", + "supervisor_version": "supervisorVersion", + }, + "warning_message": "warningMessage", + }, + "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", + "runner_ack": { + "message": "message", + "spec_version": "string", + "status_code": "STATUS_CODE_UNSPECIFIED", + }, + "secrets": [ + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + { + "failure_message": "failureMessage", + "phase": "CONTENT_PHASE_UNSPECIFIED", + "secret_name": "secretName", + "warning_message": "warningMessage", + }, + ], + "ssh_public_keys": [ + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + { + "id": "id", + "phase": "CONTENT_PHASE_UNSPECIFIED", + }, + ], + "status_version": "string", + "warning_message": ["string", "string", "string"], + }, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_raw_response_update_status(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.environments.with_raw_response.update_status( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_streaming_response_update_status(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.environments.with_streaming_response.update_status( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runner_interactions.py b/tests/api_resources/test_runner_interactions.py index 9f9a7e4d..5a73d53f 100644 --- a/tests/api_resources/test_runner_interactions.py +++ b/tests/api_resources/test_runner_interactions.py @@ -11,6 +11,10 @@ from tests.utils import assert_matches_type from gitpod.types import ( RunnerInteractionSignupResponse, + RunnerInteractionGetLatestVersionResponse, + RunnerInteractionListRunnerScmIntegrationsResponse, + RunnerInteractionListRunnerEnvironmentClassesResponse, + RunnerInteractionGetHostAuthenticationTokenValueResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,6 +23,210 @@ class TestRunnerInteractions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_get_host_authentication_token_value(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.get_host_authentication_token_value( + connect_protocol_version=1, + ) + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_method_get_host_authentication_token_value_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.get_host_authentication_token_value( + connect_protocol_version=1, + host="host", + principal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_raw_response_get_host_authentication_token_value(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.get_host_authentication_token_value( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_streaming_response_get_host_authentication_token_value(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.get_host_authentication_token_value( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_latest_version(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.get_latest_version( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + def test_method_get_latest_version_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.get_latest_version( + connect_protocol_version=1, + current_version="currentVersion", + infrastructure_version="infrastructureVersion", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_get_latest_version(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.get_latest_version( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_get_latest_version(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.get_latest_version( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list_runner_environment_classes(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.list_runner_environment_classes( + connect_protocol_version=1, + ) + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_method_list_runner_environment_classes_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.list_runner_environment_classes( + connect_protocol_version=1, + filter={ + "environment_class_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_raw_response_list_runner_environment_classes(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.list_runner_environment_classes( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + def test_streaming_response_list_runner_environment_classes(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.list_runner_environment_classes( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list_runner_scm_integrations(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.list_runner_scm_integrations( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + def test_method_list_runner_scm_integrations_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.list_runner_scm_integrations( + connect_protocol_version=1, + filter={ + "scm_integration_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_list_runner_scm_integrations(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.list_runner_scm_integrations( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_list_runner_scm_integrations(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.list_runner_scm_integrations( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type( + RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_mark_active(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.mark_active( @@ -27,217 +235,970 @@ def test_method_mark_active(self, client: Gitpod) -> None: assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.mark_active( + def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.mark_active( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_mark_active(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.mark_active( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_mark_active(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.mark_active( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_1(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_1(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_1(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_1(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_2(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_2(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_2(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_2(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_3(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_3(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_3(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_3(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_4(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_4(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_4(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_4(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_5(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_5(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_5(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_5(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_send_response_overload_6(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_send_response_with_all_params_overload_6(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_send_response_overload_6(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_send_response_overload_6(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_signup(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.signup( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + @parametrize + def test_method_signup_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.signup( + connect_protocol_version=1, + environment_classes=[ + { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + { + "key": "key", + "value": "value", + }, + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + ], + public_key="U3RhaW5sZXNzIHJvY2tz", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_signup(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.signup( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_signup(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.signup( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_runner_configuration_schema(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.update_runner_configuration_schema( + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_update_runner_configuration_schema_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.update_runner_configuration_schema( + connect_protocol_version=1, + config_schema={ + "environment_classes": [{}, {}, {}], + "runner_config": [{}, {}, {}], + "scm": [ + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + ], + "version": "version", + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_update_runner_configuration_schema(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.update_runner_configuration_schema( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_update_runner_configuration_schema(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.update_runner_configuration_schema( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_status(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.update_status( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_method_update_status_with_all_params(self, client: Gitpod) -> None: + runner_interaction = client.runner_interactions.update_status( + body={ + "additionalInfo": [{}, {}, {}], + "degredationMessage": "degredationMessage", + "logUrl": "https://example.com", + "region": "region", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "systemDetails": "systemDetails", + "version": "version", + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_raw_response_update_status(self, client: Gitpod) -> None: + response = client.runner_interactions.with_raw_response.update_status( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + def test_streaming_response_update_status(self, client: Gitpod) -> None: + with client.runner_interactions.with_streaming_response.update_status( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncRunnerInteractions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.get_host_authentication_token_value( + connect_protocol_version=1, + ) + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_method_get_host_authentication_token_value_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.get_host_authentication_token_value( + connect_protocol_version=1, + host="host", + principal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_raw_response_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.get_host_authentication_token_value( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_streaming_response_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.get_host_authentication_token_value( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_latest_version(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.get_latest_version( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_method_get_latest_version_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.get_latest_version( + connect_protocol_version=1, + current_version="currentVersion", + infrastructure_version="infrastructureVersion", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_get_latest_version(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.get_latest_version( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_get_latest_version(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.get_latest_version( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.list_runner_environment_classes( + connect_protocol_version=1, + ) + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_method_list_runner_environment_classes_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.list_runner_environment_classes( + connect_protocol_version=1, + filter={ + "environment_class_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_raw_response_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.list_runner_environment_classes( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + @parametrize + async def test_streaming_response_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.list_runner_environment_classes( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.list_runner_scm_integrations( + connect_protocol_version=1, + ) + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_method_list_runner_scm_integrations_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.list_runner_scm_integrations( + connect_protocol_version=1, + filter={ + "scm_integration_ids": [ + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ] + }, + pagination={ + "token": "token", + "page_size": 0, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.list_runner_scm_integrations( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.list_runner_scm_integrations( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type( + RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.mark_active( + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.mark_active( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.mark_active( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.mark_active( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_send_response_overload_1(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_send_response_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_raw_response_mark_active(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.mark_active( + async def test_raw_response_send_response_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.send_response( + body={}, connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() + runner_interaction = await response.parse() assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_streaming_response_mark_active(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.mark_active( + async def test_streaming_response_send_response_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.send_response( + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() + runner_interaction = await response.parse() assert_matches_type(object, runner_interaction, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_method_signup(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.signup( + async def test_method_send_response_overload_2(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, connect_protocol_version=1, ) - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_method_signup_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.signup( + async def test_method_send_response_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, connect_protocol_version=1, - environment_classes=[ - { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - ], - public_key="U3RhaW5sZXNzIHJvY2tz", connect_timeout_ms=0, ) - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_raw_response_signup(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.signup( + async def test_raw_response_send_response_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.send_response( + body={}, connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_streaming_response_signup(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.signup( + async def test_streaming_response_send_response_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.send_response( + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_status(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.update_status( + async def test_method_send_response_overload_3(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( body={}, connect_protocol_version=1, ) assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_method_update_status_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.update_status( - body={ - "additionalInfo": [{}, {}, {}], - "degredationMessage": "degredationMessage", - "logUrl": "https://example.com", - "region": "region", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "systemDetails": "systemDetails", - "version": "version", - }, + async def test_method_send_response_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_raw_response_update_status(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.update_status( + async def test_raw_response_send_response_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.send_response( body={}, connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() + runner_interaction = await response.parse() assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_streaming_response_update_status(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.update_status( + async def test_streaming_response_send_response_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.send_response( body={}, connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() + runner_interaction = await response.parse() assert_matches_type(object, runner_interaction, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_send_response_overload_4(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) -class TestAsyncRunnerInteractions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_send_response_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.mark_active( + async def test_raw_response_send_response_overload_4(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.send_response( + body={}, connect_protocol_version=1, ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.mark_active( + async def test_streaming_response_send_response_overload_4(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_send_response_overload_5(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_send_response_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.mark_active( + async def test_raw_response_send_response_overload_5(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.send_response( + body={}, connect_protocol_version=1, ) @@ -247,8 +1208,52 @@ async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.mark_active( + async def test_streaming_response_send_response_overload_5(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.send_response( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_send_response_overload_6(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_send_response_with_all_params_overload_6(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.send_response( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_send_response_overload_6(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.send_response( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_send_response_overload_6(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.send_response( + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -364,6 +1369,83 @@ async def test_streaming_response_signup(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.update_runner_configuration_schema( + connect_protocol_version=1, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_method_update_runner_configuration_schema_with_all_params(self, async_client: AsyncGitpod) -> None: + runner_interaction = await async_client.runner_interactions.update_runner_configuration_schema( + connect_protocol_version=1, + config_schema={ + "environment_classes": [{}, {}, {}], + "runner_config": [{}, {}, {}], + "scm": [ + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + { + "default_hosts": ["string", "string", "string"], + "name": "name", + "oauth": {"callback_url": "callbackUrl"}, + "pat": { + "description": "description", + "docs_link": "docsLink", + }, + "scm_id": "scmId", + }, + ], + "version": "version", + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_raw_response_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_interactions.with_raw_response.update_runner_configuration_schema( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + @parametrize + async def test_streaming_response_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_interactions.with_streaming_response.update_runner_configuration_schema( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_interaction = await response.parse() + assert_matches_type(object, runner_interaction, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_update_status(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.update_status( From 80293ad56d39cce2a684c104640889af7ea5979d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 8 Nov 2024 18:48:11 +0000 Subject: [PATCH 003/505] chore: rebuild project due to codegen change --- README.md | 4 +- pyproject.toml | 5 +- requirements-dev.lock | 2 +- src/gitpod/_compat.py | 6 +- src/gitpod/_models.py | 9 +- src/gitpod/_utils/__init__.py | 1 + src/gitpod/_utils/_transform.py | 9 +- src/gitpod/_utils/_utils.py | 17 + .../resources/environment_automation.py | 209 --- src/gitpod/resources/runner_interaction.py | 1241 ----------------- .../runner_interactions/environment.py | 360 ----- ...ion_update_task_execution_status_params.py | 20 - .../runner_interactions/test_environment.py | 436 ------ .../test_environment_automation.py | 149 -- .../api_resources/test_runner_interaction.py | 1105 --------------- tests/test_client.py | 4 +- tests/test_models.py | 21 +- tests/test_transform.py | 15 + 18 files changed, 64 insertions(+), 3549 deletions(-) delete mode 100644 src/gitpod/resources/environment_automation.py delete mode 100644 src/gitpod/resources/runner_interaction.py delete mode 100644 src/gitpod/resources/runner_interactions/environment.py delete mode 100644 src/gitpod/types/environment_automation_update_task_execution_status_params.py delete mode 100644 tests/api_resources/runner_interactions/test_environment.py delete mode 100644 tests/api_resources/test_environment_automation.py delete mode 100644 tests/api_resources/test_runner_interaction.py diff --git a/README.md b/README.md index 767efa32..d58829ab 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![PyPI version](https://img.shields.io/pypi/v/gitpod.svg)](https://pypi.org/project/gitpod/) -The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.7+ +The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx). @@ -318,7 +318,7 @@ print(gitpod.__version__) ## Requirements -Python 3.7 or higher. +Python 3.8 or higher. ## Contributing diff --git a/pyproject.toml b/pyproject.toml index e01fa1d1..36c8c1ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,11 +16,10 @@ dependencies = [ "sniffio", "cached-property; python_version < '3.8'", ] -requires-python = ">= 3.7" +requires-python = ">= 3.8" classifiers = [ "Typing :: Typed", "Intended Audience :: Developers", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -139,7 +138,7 @@ filterwarnings = [ # there are a couple of flags that are still disabled by # default in strict mode as they are experimental and niche. typeCheckingMode = "strict" -pythonVersion = "3.7" +pythonVersion = "3.8" exclude = [ "_dev", diff --git a/requirements-dev.lock b/requirements-dev.lock index f2da231c..71257301 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -48,7 +48,7 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.11.2 +mypy==1.13.0 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 diff --git a/src/gitpod/_compat.py b/src/gitpod/_compat.py index d89920d9..4794129c 100644 --- a/src/gitpod/_compat.py +++ b/src/gitpod/_compat.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self +from typing_extensions import Self, Literal import pydantic from pydantic.fields import FieldInfo @@ -137,9 +137,11 @@ def model_dump( exclude_unset: bool = False, exclude_defaults: bool = False, warnings: bool = True, + mode: Literal["json", "python"] = "python", ) -> dict[str, Any]: - if PYDANTIC_V2: + if PYDANTIC_V2 or hasattr(model, "model_dump"): return model.model_dump( + mode=mode, exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 42551b76..6cb469e2 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -37,6 +37,7 @@ PropertyInfo, is_list, is_given, + json_safe, lru_cache, is_mapping, parse_date, @@ -279,8 +280,8 @@ def model_dump( Returns: A dictionary representation of the model. """ - if mode != "python": - raise ValueError("mode is only supported in Pydantic v2") + if mode not in {"json", "python"}: + raise ValueError("mode must be either 'json' or 'python'") if round_trip != False: raise ValueError("round_trip is only supported in Pydantic v2") if warnings != True: @@ -289,7 +290,7 @@ def model_dump( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") - return super().dict( # pyright: ignore[reportDeprecated] + dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, by_alias=by_alias, @@ -298,6 +299,8 @@ def model_dump( exclude_none=exclude_none, ) + return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped + @override def model_dump_json( self, diff --git a/src/gitpod/_utils/__init__.py b/src/gitpod/_utils/__init__.py index 3efe66c8..a7cff3c0 100644 --- a/src/gitpod/_utils/__init__.py +++ b/src/gitpod/_utils/__init__.py @@ -6,6 +6,7 @@ is_list as is_list, is_given as is_given, is_tuple as is_tuple, + json_safe as json_safe, lru_cache as lru_cache, is_mapping as is_mapping, is_tuple_t as is_tuple_t, diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index 47e262a5..d7c05345 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -173,6 +173,11 @@ def _transform_recursive( # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) ): + # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually + # intended as an iterable, so we don't transform it. + if isinstance(data, dict): + return cast(object, data) + inner_type = extract_type_arg(stripped_type, 0) return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] @@ -186,7 +191,7 @@ def _transform_recursive( return data if isinstance(data, pydantic.BaseModel): - return model_dump(data, exclude_unset=True) + return model_dump(data, exclude_unset=True, mode="json") annotated_type = _get_annotated_type(annotation) if annotated_type is None: @@ -324,7 +329,7 @@ async def _async_transform_recursive( return data if isinstance(data, pydantic.BaseModel): - return model_dump(data, exclude_unset=True) + return model_dump(data, exclude_unset=True, mode="json") annotated_type = _get_annotated_type(annotation) if annotated_type is None: diff --git a/src/gitpod/_utils/_utils.py b/src/gitpod/_utils/_utils.py index 0bba17ca..e5811bba 100644 --- a/src/gitpod/_utils/_utils.py +++ b/src/gitpod/_utils/_utils.py @@ -16,6 +16,7 @@ overload, ) from pathlib import Path +from datetime import date, datetime from typing_extensions import TypeGuard import sniffio @@ -395,3 +396,19 @@ def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]: maxsize=maxsize, ) return cast(Any, wrapper) # type: ignore[no-any-return] + + +def json_safe(data: object) -> object: + """Translates a mapping / sequence recursively in the same fashion + as `pydantic` v2's `model_dump(mode="json")`. + """ + if is_mapping(data): + return {json_safe(key): json_safe(value) for key, value in data.items()} + + if is_iterable(data) and not isinstance(data, (str, bytes, bytearray)): + return [json_safe(item) for item in data] + + if isinstance(data, (datetime, date)): + return data.isoformat() + + return data diff --git a/src/gitpod/resources/environment_automation.py b/src/gitpod/resources/environment_automation.py deleted file mode 100644 index 499d699b..00000000 --- a/src/gitpod/resources/environment_automation.py +++ /dev/null @@ -1,209 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from ..types import environment_automation_update_task_execution_status_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options - -__all__ = ["EnvironmentAutomationResource", "AsyncEnvironmentAutomationResource"] - - -class EnvironmentAutomationResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> EnvironmentAutomationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return EnvironmentAutomationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> EnvironmentAutomationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return EnvironmentAutomationResourceWithStreamingResponse(self) - - def update_task_execution_status( - self, - *, - body: environment_automation_update_task_execution_status_params.Body, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """UpdateTaskExecutionStatus updates the status of a task execution. - - Only the - environment executing a task execution is expected to call this function. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", - body=maybe_transform( - body, - environment_automation_update_task_execution_status_params.EnvironmentAutomationUpdateTaskExecutionStatusParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncEnvironmentAutomationResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncEnvironmentAutomationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncEnvironmentAutomationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncEnvironmentAutomationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncEnvironmentAutomationResourceWithStreamingResponse(self) - - async def update_task_execution_status( - self, - *, - body: environment_automation_update_task_execution_status_params.Body, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """UpdateTaskExecutionStatus updates the status of a task execution. - - Only the - environment executing a task execution is expected to call this function. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", - body=await async_maybe_transform( - body, - environment_automation_update_task_execution_status_params.EnvironmentAutomationUpdateTaskExecutionStatusParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class EnvironmentAutomationResourceWithRawResponse: - def __init__(self, environment_automation: EnvironmentAutomationResource) -> None: - self._environment_automation = environment_automation - - self.update_task_execution_status = to_raw_response_wrapper( - environment_automation.update_task_execution_status, - ) - - -class AsyncEnvironmentAutomationResourceWithRawResponse: - def __init__(self, environment_automation: AsyncEnvironmentAutomationResource) -> None: - self._environment_automation = environment_automation - - self.update_task_execution_status = async_to_raw_response_wrapper( - environment_automation.update_task_execution_status, - ) - - -class EnvironmentAutomationResourceWithStreamingResponse: - def __init__(self, environment_automation: EnvironmentAutomationResource) -> None: - self._environment_automation = environment_automation - - self.update_task_execution_status = to_streamed_response_wrapper( - environment_automation.update_task_execution_status, - ) - - -class AsyncEnvironmentAutomationResourceWithStreamingResponse: - def __init__(self, environment_automation: AsyncEnvironmentAutomationResource) -> None: - self._environment_automation = environment_automation - - self.update_task_execution_status = async_to_streamed_response_wrapper( - environment_automation.update_task_execution_status, - ) diff --git a/src/gitpod/resources/runner_interaction.py b/src/gitpod/resources/runner_interaction.py deleted file mode 100644 index 4a28603d..00000000 --- a/src/gitpod/resources/runner_interaction.py +++ /dev/null @@ -1,1241 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, overload - -import httpx - -from ..types import ( - runner_interaction_send_response_params, - runner_interaction_get_latest_version_params, - runner_interaction_list_runner_scm_integrations_params, - runner_interaction_list_runner_environment_classes_params, - runner_interaction_update_runner_configuration_schema_params, - runner_interaction_get_host_authentication_token_value_params, -) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - is_given, - required_args, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options -from ..types.runner_interaction_get_latest_version_response import RunnerInteractionGetLatestVersionResponse -from ..types.runner_interaction_list_runner_scm_integrations_response import ( - RunnerInteractionListRunnerScmIntegrationsResponse, -) -from ..types.runner_interaction_list_runner_environment_classes_response import ( - RunnerInteractionListRunnerEnvironmentClassesResponse, -) -from ..types.runner_interaction_get_host_authentication_token_value_response import ( - RunnerInteractionGetHostAuthenticationTokenValueResponse, -) - -__all__ = ["RunnerInteractionResource", "AsyncRunnerInteractionResource"] - - -class RunnerInteractionResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> RunnerInteractionResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return RunnerInteractionResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RunnerInteractionResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return RunnerInteractionResourceWithStreamingResponse(self) - - def get_host_authentication_token_value( - self, - *, - connect_protocol_version: Literal[1], - host: str | NotGiven = NOT_GIVEN, - principal_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionGetHostAuthenticationTokenValueResponse: - """ - GetRunnerHostAuthenticationToken returns an authentication token for the given - host. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - host: The host to get the authentication token for - - principal_id: The principal's ID to get the authentication token for - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/GetHostAuthenticationTokenValue", - body=maybe_transform( - { - "host": host, - "principal_id": principal_id, - "runner_id": runner_id, - }, - runner_interaction_get_host_authentication_token_value_params.RunnerInteractionGetHostAuthenticationTokenValueParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionGetHostAuthenticationTokenValueResponse, - ) - - def get_latest_version( - self, - *, - connect_protocol_version: Literal[1], - current_version: str | NotGiven = NOT_GIVEN, - infrastructure_version: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionGetLatestVersionResponse: - """ - GetLatestVersion returns the latest version of the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - current_version: The current version of the runner - - infrastructure_version: The version of the infrastructure - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/GetLatestVersion", - body=maybe_transform( - { - "current_version": current_version, - "infrastructure_version": infrastructure_version, - "runner_id": runner_id, - }, - runner_interaction_get_latest_version_params.RunnerInteractionGetLatestVersionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionGetLatestVersionResponse, - ) - - def list_runner_environment_classes( - self, - *, - connect_protocol_version: Literal[1], - filter: runner_interaction_list_runner_environment_classes_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_interaction_list_runner_environment_classes_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionListRunnerEnvironmentClassesResponse: - """ - ListRunnerEnvironmentClasses returns the environment classes configured for the - runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - pagination: pagination contains the pagination options for listing environment classes - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironmentClasses", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - "runner_id": runner_id, - }, - runner_interaction_list_runner_environment_classes_params.RunnerInteractionListRunnerEnvironmentClassesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionListRunnerEnvironmentClassesResponse, - ) - - def list_runner_scm_integrations( - self, - *, - connect_protocol_version: Literal[1], - filter: runner_interaction_list_runner_scm_integrations_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_interaction_list_runner_scm_integrations_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionListRunnerScmIntegrationsResponse: - """ - ListRunnerSCMIntegrations - - Args: - connect_protocol_version: Define the version of the Connect protocol - - pagination: pagination contains the pagination options for listing SCM integrations - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerSCMIntegrations", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - "runner_id": runner_id, - }, - runner_interaction_list_runner_scm_integrations_params.RunnerInteractionListRunnerScmIntegrationsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionListRunnerScmIntegrationsResponse, - ) - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["body", "connect_protocol_version"]) - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/SendResponse", - body=maybe_transform(body, runner_interaction_send_response_params.RunnerInteractionSendResponseParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def update_runner_configuration_schema( - self, - *, - connect_protocol_version: Literal[1], - config_schema: runner_interaction_update_runner_configuration_schema_params.ConfigSchema | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerConfigurationSchema updates the runner's configuration schema. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - config_schema: config_schema is the schema for the runner's configuration - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerConfigurationSchema", - body=maybe_transform( - { - "config_schema": config_schema, - "runner_id": runner_id, - }, - runner_interaction_update_runner_configuration_schema_params.RunnerInteractionUpdateRunnerConfigurationSchemaParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncRunnerInteractionResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRunnerInteractionResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncRunnerInteractionResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRunnerInteractionResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncRunnerInteractionResourceWithStreamingResponse(self) - - async def get_host_authentication_token_value( - self, - *, - connect_protocol_version: Literal[1], - host: str | NotGiven = NOT_GIVEN, - principal_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionGetHostAuthenticationTokenValueResponse: - """ - GetRunnerHostAuthenticationToken returns an authentication token for the given - host. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - host: The host to get the authentication token for - - principal_id: The principal's ID to get the authentication token for - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/GetHostAuthenticationTokenValue", - body=await async_maybe_transform( - { - "host": host, - "principal_id": principal_id, - "runner_id": runner_id, - }, - runner_interaction_get_host_authentication_token_value_params.RunnerInteractionGetHostAuthenticationTokenValueParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionGetHostAuthenticationTokenValueResponse, - ) - - async def get_latest_version( - self, - *, - connect_protocol_version: Literal[1], - current_version: str | NotGiven = NOT_GIVEN, - infrastructure_version: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionGetLatestVersionResponse: - """ - GetLatestVersion returns the latest version of the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - current_version: The current version of the runner - - infrastructure_version: The version of the infrastructure - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/GetLatestVersion", - body=await async_maybe_transform( - { - "current_version": current_version, - "infrastructure_version": infrastructure_version, - "runner_id": runner_id, - }, - runner_interaction_get_latest_version_params.RunnerInteractionGetLatestVersionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionGetLatestVersionResponse, - ) - - async def list_runner_environment_classes( - self, - *, - connect_protocol_version: Literal[1], - filter: runner_interaction_list_runner_environment_classes_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_interaction_list_runner_environment_classes_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionListRunnerEnvironmentClassesResponse: - """ - ListRunnerEnvironmentClasses returns the environment classes configured for the - runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - pagination: pagination contains the pagination options for listing environment classes - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironmentClasses", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - "runner_id": runner_id, - }, - runner_interaction_list_runner_environment_classes_params.RunnerInteractionListRunnerEnvironmentClassesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionListRunnerEnvironmentClassesResponse, - ) - - async def list_runner_scm_integrations( - self, - *, - connect_protocol_version: Literal[1], - filter: runner_interaction_list_runner_scm_integrations_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_interaction_list_runner_scm_integrations_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionListRunnerScmIntegrationsResponse: - """ - ListRunnerSCMIntegrations - - Args: - connect_protocol_version: Define the version of the Connect protocol - - pagination: pagination contains the pagination options for listing SCM integrations - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerSCMIntegrations", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - "runner_id": runner_id, - }, - runner_interaction_list_runner_scm_integrations_params.RunnerInteractionListRunnerScmIntegrationsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionListRunnerScmIntegrationsResponse, - ) - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["body", "connect_protocol_version"]) - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/SendResponse", - body=await async_maybe_transform( - body, runner_interaction_send_response_params.RunnerInteractionSendResponseParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def update_runner_configuration_schema( - self, - *, - connect_protocol_version: Literal[1], - config_schema: runner_interaction_update_runner_configuration_schema_params.ConfigSchema | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerConfigurationSchema updates the runner's configuration schema. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - config_schema: config_schema is the schema for the runner's configuration - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerConfigurationSchema", - body=await async_maybe_transform( - { - "config_schema": config_schema, - "runner_id": runner_id, - }, - runner_interaction_update_runner_configuration_schema_params.RunnerInteractionUpdateRunnerConfigurationSchemaParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class RunnerInteractionResourceWithRawResponse: - def __init__(self, runner_interaction: RunnerInteractionResource) -> None: - self._runner_interaction = runner_interaction - - self.get_host_authentication_token_value = to_raw_response_wrapper( - runner_interaction.get_host_authentication_token_value, - ) - self.get_latest_version = to_raw_response_wrapper( - runner_interaction.get_latest_version, - ) - self.list_runner_environment_classes = to_raw_response_wrapper( - runner_interaction.list_runner_environment_classes, - ) - self.list_runner_scm_integrations = to_raw_response_wrapper( - runner_interaction.list_runner_scm_integrations, - ) - self.send_response = to_raw_response_wrapper( - runner_interaction.send_response, - ) - self.update_runner_configuration_schema = to_raw_response_wrapper( - runner_interaction.update_runner_configuration_schema, - ) - - -class AsyncRunnerInteractionResourceWithRawResponse: - def __init__(self, runner_interaction: AsyncRunnerInteractionResource) -> None: - self._runner_interaction = runner_interaction - - self.get_host_authentication_token_value = async_to_raw_response_wrapper( - runner_interaction.get_host_authentication_token_value, - ) - self.get_latest_version = async_to_raw_response_wrapper( - runner_interaction.get_latest_version, - ) - self.list_runner_environment_classes = async_to_raw_response_wrapper( - runner_interaction.list_runner_environment_classes, - ) - self.list_runner_scm_integrations = async_to_raw_response_wrapper( - runner_interaction.list_runner_scm_integrations, - ) - self.send_response = async_to_raw_response_wrapper( - runner_interaction.send_response, - ) - self.update_runner_configuration_schema = async_to_raw_response_wrapper( - runner_interaction.update_runner_configuration_schema, - ) - - -class RunnerInteractionResourceWithStreamingResponse: - def __init__(self, runner_interaction: RunnerInteractionResource) -> None: - self._runner_interaction = runner_interaction - - self.get_host_authentication_token_value = to_streamed_response_wrapper( - runner_interaction.get_host_authentication_token_value, - ) - self.get_latest_version = to_streamed_response_wrapper( - runner_interaction.get_latest_version, - ) - self.list_runner_environment_classes = to_streamed_response_wrapper( - runner_interaction.list_runner_environment_classes, - ) - self.list_runner_scm_integrations = to_streamed_response_wrapper( - runner_interaction.list_runner_scm_integrations, - ) - self.send_response = to_streamed_response_wrapper( - runner_interaction.send_response, - ) - self.update_runner_configuration_schema = to_streamed_response_wrapper( - runner_interaction.update_runner_configuration_schema, - ) - - -class AsyncRunnerInteractionResourceWithStreamingResponse: - def __init__(self, runner_interaction: AsyncRunnerInteractionResource) -> None: - self._runner_interaction = runner_interaction - - self.get_host_authentication_token_value = async_to_streamed_response_wrapper( - runner_interaction.get_host_authentication_token_value, - ) - self.get_latest_version = async_to_streamed_response_wrapper( - runner_interaction.get_latest_version, - ) - self.list_runner_environment_classes = async_to_streamed_response_wrapper( - runner_interaction.list_runner_environment_classes, - ) - self.list_runner_scm_integrations = async_to_streamed_response_wrapper( - runner_interaction.list_runner_scm_integrations, - ) - self.send_response = async_to_streamed_response_wrapper( - runner_interaction.send_response, - ) - self.update_runner_configuration_schema = async_to_streamed_response_wrapper( - runner_interaction.update_runner_configuration_schema, - ) diff --git a/src/gitpod/resources/runner_interactions/environment.py b/src/gitpod/resources/runner_interactions/environment.py deleted file mode 100644 index 30bfad71..00000000 --- a/src/gitpod/resources/runner_interactions/environment.py +++ /dev/null @@ -1,360 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.runner_interactions import environment_retrieve_params, environment_update_status_params -from ...types.runner_interactions.environment_retrieve_response import EnvironmentRetrieveResponse - -__all__ = ["EnvironmentResource", "AsyncEnvironmentResource"] - - -class EnvironmentResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> EnvironmentResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return EnvironmentResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> EnvironmentResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return EnvironmentResourceWithStreamingResponse(self) - - def retrieve( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentRetrieveResponse: - """ - GetRunnerEnvironment returns the environment given it is owned by the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: The environment's ID - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/GetRunnerEnvironment", - body=maybe_transform( - { - "environment_id": environment_id, - "runner_id": runner_id, - }, - environment_retrieve_params.EnvironmentRetrieveParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=EnvironmentRetrieveResponse, - ) - - def update_status( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - status: environment_update_status_params.Status | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerEnvironmentStatus updates the status of an environment this runner - is responsible for. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: The environment's ID - - runner_id: The runner's identity - - status: EnvironmentStatus describes an environment status - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerEnvironmentStatus", - body=maybe_transform( - { - "environment_id": environment_id, - "runner_id": runner_id, - "status": status, - }, - environment_update_status_params.EnvironmentUpdateStatusParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncEnvironmentResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncEnvironmentResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncEnvironmentResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncEnvironmentResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncEnvironmentResourceWithStreamingResponse(self) - - async def retrieve( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentRetrieveResponse: - """ - GetRunnerEnvironment returns the environment given it is owned by the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: The environment's ID - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/GetRunnerEnvironment", - body=await async_maybe_transform( - { - "environment_id": environment_id, - "runner_id": runner_id, - }, - environment_retrieve_params.EnvironmentRetrieveParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=EnvironmentRetrieveResponse, - ) - - async def update_status( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - status: environment_update_status_params.Status | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerEnvironmentStatus updates the status of an environment this runner - is responsible for. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: The environment's ID - - runner_id: The runner's identity - - status: EnvironmentStatus describes an environment status - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerEnvironmentStatus", - body=await async_maybe_transform( - { - "environment_id": environment_id, - "runner_id": runner_id, - "status": status, - }, - environment_update_status_params.EnvironmentUpdateStatusParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class EnvironmentResourceWithRawResponse: - def __init__(self, environment: EnvironmentResource) -> None: - self._environment = environment - - self.retrieve = to_raw_response_wrapper( - environment.retrieve, - ) - self.update_status = to_raw_response_wrapper( - environment.update_status, - ) - - -class AsyncEnvironmentResourceWithRawResponse: - def __init__(self, environment: AsyncEnvironmentResource) -> None: - self._environment = environment - - self.retrieve = async_to_raw_response_wrapper( - environment.retrieve, - ) - self.update_status = async_to_raw_response_wrapper( - environment.update_status, - ) - - -class EnvironmentResourceWithStreamingResponse: - def __init__(self, environment: EnvironmentResource) -> None: - self._environment = environment - - self.retrieve = to_streamed_response_wrapper( - environment.retrieve, - ) - self.update_status = to_streamed_response_wrapper( - environment.update_status, - ) - - -class AsyncEnvironmentResourceWithStreamingResponse: - def __init__(self, environment: AsyncEnvironmentResource) -> None: - self._environment = environment - - self.retrieve = async_to_streamed_response_wrapper( - environment.retrieve, - ) - self.update_status = async_to_streamed_response_wrapper( - environment.update_status, - ) diff --git a/src/gitpod/types/environment_automation_update_task_execution_status_params.py b/src/gitpod/types/environment_automation_update_task_execution_status_params.py deleted file mode 100644 index df760684..00000000 --- a/src/gitpod/types/environment_automation_update_task_execution_status_params.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..types import environment_automation_update_task_execution_status_params -from .._utils import PropertyInfo - -__all__ = ["EnvironmentAutomationUpdateTaskExecutionStatusParams"] - - -class EnvironmentAutomationUpdateTaskExecutionStatusParams(TypedDict, total=False): - body: Required[environment_automation_update_task_execution_status_params.Body] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/tests/api_resources/runner_interactions/test_environment.py b/tests/api_resources/runner_interactions/test_environment.py deleted file mode 100644 index 1898f8fc..00000000 --- a/tests/api_resources/runner_interactions/test_environment.py +++ /dev/null @@ -1,436 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types.runner_interactions import ( - EnvironmentRetrieveResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestEnvironment: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - environment = client.runner_interactions.environment.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - environment = client.runner_interactions.environment.retrieve( - connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_interactions.environment.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = response.parse() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_interactions.environment.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = response.parse() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_status(self, client: Gitpod) -> None: - environment = client.runner_interactions.environment.update_status( - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_method_update_status_with_all_params(self, client: Gitpod) -> None: - environment = client.runner_interactions.environment.update_status( - connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - status={ - "automations_file": { - "automations_file_path": "automationsFilePath", - "automations_file_presence": "PRESENCE_UNSPECIFIED", - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "session": "session", - }, - "content": { - "content_location_in_machine": "contentLocationInMachine", - "failure_message": "failureMessage", - "git": { - "branch": "branch", - "changed_files": [ - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, - ], - "clone_url": "cloneUrl", - "latest_commit": "latestCommit", - "total_changed_files": 0, - "total_unpushed_commits": 0, - "unpushed_commits": ["string", "string", "string"], - }, - "phase": "CONTENT_PHASE_UNSPECIFIED", - "session": "session", - "warning_message": "warningMessage", - }, - "devcontainer": { - "container_id": "containerId", - "container_name": "containerName", - "devcontainerconfig_in_sync": True, - "devcontainer_file_path": "devcontainerFilePath", - "devcontainer_file_presence": "PRESENCE_UNSPECIFIED", - "failure_message": "failureMessage", - "phase": "PHASE_UNSPECIFIED", - "remote_user": "remoteUser", - "remote_workspace_folder": "remoteWorkspaceFolder", - "secrets_in_sync": True, - "session": "session", - "warning_message": "warningMessage", - }, - "environment_urls": { - "logs": "logs", - "ports": [ - { - "port": 1, - "url": "url", - }, - { - "port": 1, - "url": "url", - }, - { - "port": 1, - "url": "url", - }, - ], - "ssh": {"url": "url"}, - }, - "failure_message": ["string", "string", "string"], - "machine": { - "failure_message": "failureMessage", - "phase": "PHASE_UNSPECIFIED", - "session": "session", - "timeout": "timeout", - "versions": { - "supervisor_commit": "supervisorCommit", - "supervisor_version": "supervisorVersion", - }, - "warning_message": "warningMessage", - }, - "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", - "runner_ack": { - "message": "message", - "spec_version": "string", - "status_code": "STATUS_CODE_UNSPECIFIED", - }, - "secrets": [ - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, - ], - "ssh_public_keys": [ - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - ], - "status_version": "string", - "warning_message": ["string", "string", "string"], - }, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_raw_response_update_status(self, client: Gitpod) -> None: - response = client.runner_interactions.environment.with_raw_response.update_status( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = response.parse() - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_streaming_response_update_status(self, client: Gitpod) -> None: - with client.runner_interactions.environment.with_streaming_response.update_status( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = response.parse() - assert_matches_type(object, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncEnvironment: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environment.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environment.retrieve( - connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.environment.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = await response.parse() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.environment.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = await response.parse() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_status(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environment.update_status( - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environment.update_status( - connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - status={ - "automations_file": { - "automations_file_path": "automationsFilePath", - "automations_file_presence": "PRESENCE_UNSPECIFIED", - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "session": "session", - }, - "content": { - "content_location_in_machine": "contentLocationInMachine", - "failure_message": "failureMessage", - "git": { - "branch": "branch", - "changed_files": [ - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, - ], - "clone_url": "cloneUrl", - "latest_commit": "latestCommit", - "total_changed_files": 0, - "total_unpushed_commits": 0, - "unpushed_commits": ["string", "string", "string"], - }, - "phase": "CONTENT_PHASE_UNSPECIFIED", - "session": "session", - "warning_message": "warningMessage", - }, - "devcontainer": { - "container_id": "containerId", - "container_name": "containerName", - "devcontainerconfig_in_sync": True, - "devcontainer_file_path": "devcontainerFilePath", - "devcontainer_file_presence": "PRESENCE_UNSPECIFIED", - "failure_message": "failureMessage", - "phase": "PHASE_UNSPECIFIED", - "remote_user": "remoteUser", - "remote_workspace_folder": "remoteWorkspaceFolder", - "secrets_in_sync": True, - "session": "session", - "warning_message": "warningMessage", - }, - "environment_urls": { - "logs": "logs", - "ports": [ - { - "port": 1, - "url": "url", - }, - { - "port": 1, - "url": "url", - }, - { - "port": 1, - "url": "url", - }, - ], - "ssh": {"url": "url"}, - }, - "failure_message": ["string", "string", "string"], - "machine": { - "failure_message": "failureMessage", - "phase": "PHASE_UNSPECIFIED", - "session": "session", - "timeout": "timeout", - "versions": { - "supervisor_commit": "supervisorCommit", - "supervisor_version": "supervisorVersion", - }, - "warning_message": "warningMessage", - }, - "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", - "runner_ack": { - "message": "message", - "spec_version": "string", - "status_code": "STATUS_CODE_UNSPECIFIED", - }, - "secrets": [ - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, - ], - "ssh_public_keys": [ - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - ], - "status_version": "string", - "warning_message": ["string", "string", "string"], - }, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_raw_response_update_status(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.environment.with_raw_response.update_status( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = await response.parse() - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_streaming_response_update_status(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.environment.with_streaming_response.update_status( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = await response.parse() - assert_matches_type(object, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_environment_automation.py b/tests/api_resources/test_environment_automation.py deleted file mode 100644 index 33432942..00000000 --- a/tests/api_resources/test_environment_automation.py +++ /dev/null @@ -1,149 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestEnvironmentAutomation: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_update_task_execution_status(self, client: Gitpod) -> None: - environment_automation = client.environment_automation.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, environment_automation, path=["response"]) - - @parametrize - def test_method_update_task_execution_status_with_all_params(self, client: Gitpod) -> None: - environment_automation = client.environment_automation.update_task_execution_status( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failureMessage": "failureMessage", - "logUrl": "logUrl", - "steps": [ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - ], - }, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment_automation, path=["response"]) - - @parametrize - def test_raw_response_update_task_execution_status(self, client: Gitpod) -> None: - response = client.environment_automation.with_raw_response.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_automation = response.parse() - assert_matches_type(object, environment_automation, path=["response"]) - - @parametrize - def test_streaming_response_update_task_execution_status(self, client: Gitpod) -> None: - with client.environment_automation.with_streaming_response.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_automation = response.parse() - assert_matches_type(object, environment_automation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncEnvironmentAutomation: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_update_task_execution_status(self, async_client: AsyncGitpod) -> None: - environment_automation = await async_client.environment_automation.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, environment_automation, path=["response"]) - - @parametrize - async def test_method_update_task_execution_status_with_all_params(self, async_client: AsyncGitpod) -> None: - environment_automation = await async_client.environment_automation.update_task_execution_status( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failureMessage": "failureMessage", - "logUrl": "logUrl", - "steps": [ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - ], - }, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment_automation, path=["response"]) - - @parametrize - async def test_raw_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automation.with_raw_response.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_automation = await response.parse() - assert_matches_type(object, environment_automation, path=["response"]) - - @parametrize - async def test_streaming_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automation.with_streaming_response.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_automation = await response.parse() - assert_matches_type(object, environment_automation, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runner_interaction.py b/tests/api_resources/test_runner_interaction.py deleted file mode 100644 index 8fe31768..00000000 --- a/tests/api_resources/test_runner_interaction.py +++ /dev/null @@ -1,1105 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types import ( - RunnerInteractionGetLatestVersionResponse, - RunnerInteractionListRunnerScmIntegrationsResponse, - RunnerInteractionListRunnerEnvironmentClassesResponse, - RunnerInteractionGetHostAuthenticationTokenValueResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestRunnerInteraction: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_get_host_authentication_token_value(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.get_host_authentication_token_value( - connect_protocol_version=1, - ) - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_method_get_host_authentication_token_value_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.get_host_authentication_token_value( - connect_protocol_version=1, - host="host", - principal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_raw_response_get_host_authentication_token_value(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.get_host_authentication_token_value( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_streaming_response_get_host_authentication_token_value(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.get_host_authentication_token_value( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_get_latest_version(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.get_latest_version( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - def test_method_get_latest_version_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.get_latest_version( - connect_protocol_version=1, - current_version="currentVersion", - infrastructure_version="infrastructureVersion", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_get_latest_version(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.get_latest_version( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_get_latest_version(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.get_latest_version( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list_runner_environment_classes(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.list_runner_environment_classes( - connect_protocol_version=1, - ) - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_method_list_runner_environment_classes_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.list_runner_environment_classes( - connect_protocol_version=1, - filter={ - "environment_class_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_raw_response_list_runner_environment_classes(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.list_runner_environment_classes( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_streaming_response_list_runner_environment_classes(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.list_runner_environment_classes( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list_runner_scm_integrations(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.list_runner_scm_integrations( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - def test_method_list_runner_scm_integrations_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.list_runner_scm_integrations( - connect_protocol_version=1, - filter={ - "scm_integration_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_list_runner_scm_integrations(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.list_runner_scm_integrations( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_list_runner_scm_integrations(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.list_runner_scm_integrations( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_1(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_1(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_1(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_1(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_2(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_2(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_2(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_2(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_3(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_3(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_3(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_3(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_4(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_4(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_4(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_4(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_5(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_5(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_5(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_5(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_6(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_6(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_6(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_6(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_runner_configuration_schema(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.update_runner_configuration_schema( - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_update_runner_configuration_schema_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interaction.update_runner_configuration_schema( - connect_protocol_version=1, - config_schema={ - "environment_classes": [{}, {}, {}], - "runner_config": [{}, {}, {}], - "scm": [ - { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - ], - "version": "version", - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_update_runner_configuration_schema(self, client: Gitpod) -> None: - response = client.runner_interaction.with_raw_response.update_runner_configuration_schema( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_update_runner_configuration_schema(self, client: Gitpod) -> None: - with client.runner_interaction.with_streaming_response.update_runner_configuration_schema( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncRunnerInteraction: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.get_host_authentication_token_value( - connect_protocol_version=1, - ) - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_method_get_host_authentication_token_value_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.get_host_authentication_token_value( - connect_protocol_version=1, - host="host", - principal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_raw_response_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.get_host_authentication_token_value( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_streaming_response_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.get_host_authentication_token_value( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_get_latest_version(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.get_latest_version( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_method_get_latest_version_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.get_latest_version( - connect_protocol_version=1, - current_version="currentVersion", - infrastructure_version="infrastructureVersion", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_get_latest_version(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.get_latest_version( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_get_latest_version(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.get_latest_version( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.list_runner_environment_classes( - connect_protocol_version=1, - ) - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_method_list_runner_environment_classes_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.list_runner_environment_classes( - connect_protocol_version=1, - filter={ - "environment_class_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_raw_response_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.list_runner_environment_classes( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_streaming_response_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.list_runner_environment_classes( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.list_runner_scm_integrations( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_method_list_runner_scm_integrations_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.list_runner_scm_integrations( - connect_protocol_version=1, - filter={ - "scm_integration_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.list_runner_scm_integrations( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.list_runner_scm_integrations( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_1(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_2(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_3(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_4(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_4(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_4(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_5(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_5(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_5(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_6(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_6(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_6(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_6(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.update_runner_configuration_schema( - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_update_runner_configuration_schema_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interaction.update_runner_configuration_schema( - connect_protocol_version=1, - config_schema={ - "environment_classes": [{}, {}, {}], - "runner_config": [{}, {}, {}], - "scm": [ - { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - ], - "version": "version", - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interaction.with_raw_response.update_runner_configuration_schema( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interaction.with_streaming_response.update_runner_configuration_schema( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/test_client.py b/tests/test_client.py index a5df55d0..edce69cd 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -648,7 +648,7 @@ class Model(BaseModel): [3, "", 0.5], [2, "", 0.5 * 2.0], [1, "", 0.5 * 4.0], - [-1100, "", 7.8], # test large number potentially overflowing + [-1100, "", 8], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -1380,7 +1380,7 @@ class Model(BaseModel): [3, "", 0.5], [2, "", 0.5 * 2.0], [1, "", 0.5 * 4.0], - [-1100, "", 7.8], # test large number potentially overflowing + [-1100, "", 8], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) diff --git a/tests/test_models.py b/tests/test_models.py index 49f7dd6f..9217b518 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -520,19 +520,15 @@ class Model(BaseModel): assert m3.to_dict(exclude_none=True) == {} assert m3.to_dict(exclude_defaults=True) == {} - if PYDANTIC_V2: - - class Model2(BaseModel): - created_at: datetime + class Model2(BaseModel): + created_at: datetime - time_str = "2024-03-21T11:39:01.275859" - m4 = Model2.construct(created_at=time_str) - assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)} - assert m4.to_dict(mode="json") == {"created_at": time_str} - else: - with pytest.raises(ValueError, match="mode is only supported in Pydantic v2"): - m.to_dict(mode="json") + time_str = "2024-03-21T11:39:01.275859" + m4 = Model2.construct(created_at=time_str) + assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)} + assert m4.to_dict(mode="json") == {"created_at": time_str} + if not PYDANTIC_V2: with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): m.to_dict(warnings=False) @@ -558,9 +554,6 @@ class Model(BaseModel): assert m3.model_dump(exclude_none=True) == {} if not PYDANTIC_V2: - with pytest.raises(ValueError, match="mode is only supported in Pydantic v2"): - m.model_dump(mode="json") - with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): m.model_dump(round_trip=True) diff --git a/tests/test_transform.py b/tests/test_transform.py index 53bb72d6..6382db3f 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -177,17 +177,32 @@ class DateDict(TypedDict, total=False): foo: Annotated[date, PropertyInfo(format="iso8601")] +class DatetimeModel(BaseModel): + foo: datetime + + +class DateModel(BaseModel): + foo: Optional[date] + + @parametrize @pytest.mark.asyncio async def test_iso8601_format(use_async: bool) -> None: dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + tz = "Z" if PYDANTIC_V2 else "+00:00" assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] + assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692" + tz} # type: ignore[comparison-overlap] dt = dt.replace(tzinfo=None) assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692"} # type: ignore[comparison-overlap] + assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692"} # type: ignore[comparison-overlap] assert await transform({"foo": None}, DateDict, use_async) == {"foo": None} # type: ignore[comparison-overlap] + assert await transform(DateModel(foo=None), Any, use_async) == {"foo": None} # type: ignore assert await transform({"foo": date.fromisoformat("2023-02-23")}, DateDict, use_async) == {"foo": "2023-02-23"} # type: ignore[comparison-overlap] + assert await transform(DateModel(foo=date.fromisoformat("2023-02-23")), DateDict, use_async) == { + "foo": "2023-02-23" + } # type: ignore[comparison-overlap] @parametrize From 137944e8cf7b0ce07b7679c2521ad87ddd557872 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 12:09:07 +0000 Subject: [PATCH 004/505] chore: rebuild project due to codegen change --- src/gitpod/_utils/_transform.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index d7c05345..a6b62cad 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -316,6 +316,11 @@ async def _async_transform_recursive( # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) ): + # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually + # intended as an iterable, so we don't transform it. + if isinstance(data, dict): + return cast(object, data) + inner_type = extract_type_arg(stripped_type, 0) return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] From 4f2478a1a5145a4d7423591a33f97271fafc8a8d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 18 Nov 2024 10:42:49 +0000 Subject: [PATCH 005/505] chore: rebuild project due to codegen change --- .../test_task_executions.py | 64 +----- .../environment_automations/test_tasks.py | 40 +--- .../runner_interactions/test_environments.py | 112 ++-------- tests/api_resources/test_automations_files.py | 12 +- tests/api_resources/test_environments.py | 152 +++---------- .../test_personal_access_tokens.py | 16 +- tests/api_resources/test_projects.py | 4 +- .../api_resources/test_runner_interactions.py | 200 ++---------------- tests/api_resources/test_runners.py | 16 +- tests/api_resources/test_services.py | 28 +-- tests/api_resources/test_tasks.py | 16 +- 11 files changed, 100 insertions(+), 560 deletions(-) diff --git a/tests/api_resources/environment_automations/test_task_executions.py b/tests/api_resources/environment_automations/test_task_executions.py index 271d1b6f..1d40c2a2 100644 --- a/tests/api_resources/environment_automations/test_task_executions.py +++ b/tests/api_resources/environment_automations/test_task_executions.py @@ -122,22 +122,10 @@ def test_method_create_list_with_all_params(self, client: Gitpod) -> None: task_execution = client.environment_automations.task_executions.create_list( connect_protocol_version=1, filter={ - "environment_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "phases": [ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - ], - "task_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "task_references": ["string", "string", "string"], + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "task_references": ["string"], }, pagination={ "token": "token", @@ -271,17 +259,7 @@ def test_method_update_task_execution_status_with_all_params(self, client: Gitpo "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "failure_message": "failureMessage", "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, + } ], }, connect_protocol_version=1, @@ -419,22 +397,10 @@ async def test_method_create_list_with_all_params(self, async_client: AsyncGitpo task_execution = await async_client.environment_automations.task_executions.create_list( connect_protocol_version=1, filter={ - "environment_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "phases": [ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - ], - "task_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "task_references": ["string", "string", "string"], + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "task_references": ["string"], }, pagination={ "token": "token", @@ -568,17 +534,7 @@ async def test_method_update_task_execution_status_with_all_params(self, async_c "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "failure_message": "failureMessage", "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - }, + } ], }, connect_protocol_version=1, diff --git a/tests/api_resources/environment_automations/test_tasks.py b/tests/api_resources/environment_automations/test_tasks.py index 843f0070..804d10aa 100644 --- a/tests/api_resources/environment_automations/test_tasks.py +++ b/tests/api_resources/environment_automations/test_tasks.py @@ -33,11 +33,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environment_automations.tasks.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - depends_on=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={}, spec={}, connect_timeout_ms=0, @@ -164,17 +160,9 @@ def test_method_create_list_with_all_params(self, client: Gitpod) -> None: task = client.environment_automations.tasks.create_list( connect_protocol_version=1, filter={ - "environment_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "references": ["x", "x", "x"], - "task_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", @@ -264,11 +252,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> task = await async_client.environment_automations.tasks.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - depends_on=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={}, spec={}, connect_timeout_ms=0, @@ -395,17 +379,9 @@ async def test_method_create_list_with_all_params(self, async_client: AsyncGitpo task = await async_client.environment_automations.tasks.create_list( connect_protocol_version=1, filter={ - "environment_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "references": ["x", "x", "x"], - "task_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", diff --git a/tests/api_resources/runner_interactions/test_environments.py b/tests/api_resources/runner_interactions/test_environments.py index 1f03bf45..aa13dda2 100644 --- a/tests/api_resources/runner_interactions/test_environments.py +++ b/tests/api_resources/runner_interactions/test_environments.py @@ -72,11 +72,7 @@ def test_method_list(self, client: Gitpod) -> None: def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.runner_interactions.environments.list( connect_protocol_version=1, - environment_ids=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + environment_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], pagination={ "token": "token", "page_size": 0, @@ -140,21 +136,13 @@ def test_method_update_status_with_all_params(self, client: Gitpod) -> None: { "change_type": "CHANGE_TYPE_UNSPECIFIED", "path": "path", - }, - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, + } ], "clone_url": "cloneUrl", "latest_commit": "latestCommit", "total_changed_files": 0, "total_unpushed_commits": 0, - "unpushed_commits": ["string", "string", "string"], + "unpushed_commits": ["string"], }, "phase": "CONTENT_PHASE_UNSPECIFIED", "session": "session", @@ -180,19 +168,11 @@ def test_method_update_status_with_all_params(self, client: Gitpod) -> None: { "port": 1, "url": "url", - }, - { - "port": 1, - "url": "url", - }, - { - "port": 1, - "url": "url", - }, + } ], "ssh": {"url": "url"}, }, - "failure_message": ["string", "string", "string"], + "failure_message": ["string"], "machine": { "failure_message": "failureMessage", "phase": "PHASE_UNSPECIFIED", @@ -216,36 +196,16 @@ def test_method_update_status_with_all_params(self, client: Gitpod) -> None: "phase": "CONTENT_PHASE_UNSPECIFIED", "secret_name": "secretName", "warning_message": "warningMessage", - }, - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, + } ], "ssh_public_keys": [ { "id": "id", "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, + } ], "status_version": "string", - "warning_message": ["string", "string", "string"], + "warning_message": ["string"], }, connect_timeout_ms=0, ) @@ -331,11 +291,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.runner_interactions.environments.list( connect_protocol_version=1, - environment_ids=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + environment_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], pagination={ "token": "token", "page_size": 0, @@ -399,21 +355,13 @@ async def test_method_update_status_with_all_params(self, async_client: AsyncGit { "change_type": "CHANGE_TYPE_UNSPECIFIED", "path": "path", - }, - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - }, + } ], "clone_url": "cloneUrl", "latest_commit": "latestCommit", "total_changed_files": 0, "total_unpushed_commits": 0, - "unpushed_commits": ["string", "string", "string"], + "unpushed_commits": ["string"], }, "phase": "CONTENT_PHASE_UNSPECIFIED", "session": "session", @@ -439,19 +387,11 @@ async def test_method_update_status_with_all_params(self, async_client: AsyncGit { "port": 1, "url": "url", - }, - { - "port": 1, - "url": "url", - }, - { - "port": 1, - "url": "url", - }, + } ], "ssh": {"url": "url"}, }, - "failure_message": ["string", "string", "string"], + "failure_message": ["string"], "machine": { "failure_message": "failureMessage", "phase": "PHASE_UNSPECIFIED", @@ -475,36 +415,16 @@ async def test_method_update_status_with_all_params(self, async_client: AsyncGit "phase": "CONTENT_PHASE_UNSPECIFIED", "secret_name": "secretName", "warning_message": "warningMessage", - }, - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "warning_message": "warningMessage", - }, + } ], "ssh_public_keys": [ { "id": "id", "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - }, + } ], "status_version": "string", - "warning_message": ["string", "string", "string"], + "warning_message": ["string"], }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/test_automations_files.py b/tests/api_resources/test_automations_files.py index fed1b113..ac653202 100644 --- a/tests/api_resources/test_automations_files.py +++ b/tests/api_resources/test_automations_files.py @@ -38,16 +38,16 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: }, "description": "description", "name": "x", - "triggered_by": ["string", "string", "string"], + "triggered_by": ["string"], } }, "tasks": { "foo": { "command": "x", - "depends_on": ["string", "string", "string"], + "depends_on": ["string"], "description": "description", "name": "x", - "triggered_by": ["string", "string", "string"], + "triggered_by": ["string"], } }, }, @@ -105,16 +105,16 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> }, "description": "description", "name": "x", - "triggered_by": ["string", "string", "string"], + "triggered_by": ["string"], } }, "tasks": { "foo": { "command": "x", - "depends_on": ["string", "string", "string"], + "depends_on": ["string"], "description": "description", "name": "x", - "triggered_by": ["string", "string", "string"], + "triggered_by": ["string"], } }, }, diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index db5f3ce1..2703867e 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{}, {}, {}]}, + "initializer": {"specs": [{}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -59,33 +59,15 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", "port": 1, - }, - { - "admission": "ADMISSION_LEVEL_UNSPECIFIED", - "name": "x", - "port": 1, - }, - { - "admission": "ADMISSION_LEVEL_UNSPECIFIED", - "name": "x", - "port": 1, - }, + } ], - "secrets": [{}, {}, {}], + "secrets": [{}], "spec_version": "string", "ssh_public_keys": [ { "id": "id", "value": "value", - }, - { - "id": "id", - "value": "value", - }, - { - "id": "id", - "value": "value", - }, + } ], "timeout": {"disconnected": "disconnected"}, }, @@ -169,26 +151,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( connect_protocol_version=1, filter={ - "creator_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "project_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "runner_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "status_phases": [ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - ], + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ @@ -244,7 +210,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{}, {}, {}]}, + "initializer": {"specs": [{}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -261,33 +227,15 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", "port": 1, - }, - { - "admission": "ADMISSION_LEVEL_UNSPECIFIED", - "name": "x", - "port": 1, - }, - { - "admission": "ADMISSION_LEVEL_UNSPECIFIED", - "name": "x", - "port": 1, - }, + } ], - "secrets": [{}, {}, {}], + "secrets": [{}], "spec_version": "string", "ssh_public_keys": [ { "id": "id", "value": "value", - }, - { - "id": "id", - "value": "value", - }, - { - "id": "id", - "value": "value", - }, + } ], "timeout": {"disconnected": "disconnected"}, }, @@ -383,7 +331,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{}, {}, {}]}, + "initializer": {"specs": [{}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -400,33 +348,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", "port": 1, - }, - { - "admission": "ADMISSION_LEVEL_UNSPECIFIED", - "name": "x", - "port": 1, - }, - { - "admission": "ADMISSION_LEVEL_UNSPECIFIED", - "name": "x", - "port": 1, - }, + } ], - "secrets": [{}, {}, {}], + "secrets": [{}], "spec_version": "string", "ssh_public_keys": [ { "id": "id", "value": "value", - }, - { - "id": "id", - "value": "value", - }, - { - "id": "id", - "value": "value", - }, + } ], "timeout": {"disconnected": "disconnected"}, }, @@ -510,26 +440,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N environment = await async_client.environments.list( connect_protocol_version=1, filter={ - "creator_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "project_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "runner_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "status_phases": [ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - ], + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ @@ -585,7 +499,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{}, {}, {}]}, + "initializer": {"specs": [{}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -602,33 +516,15 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", "port": 1, - }, - { - "admission": "ADMISSION_LEVEL_UNSPECIFIED", - "name": "x", - "port": 1, - }, - { - "admission": "ADMISSION_LEVEL_UNSPECIFIED", - "name": "x", - "port": 1, - }, + } ], - "secrets": [{}, {}, {}], + "secrets": [{}], "spec_version": "string", "ssh_public_keys": [ { "id": "id", "value": "value", - }, - { - "id": "id", - "value": "value", - }, - { - "id": "id", - "value": "value", - }, + } ], "timeout": {"disconnected": "disconnected"}, }, diff --git a/tests/api_resources/test_personal_access_tokens.py b/tests/api_resources/test_personal_access_tokens.py index 4ada66d6..42b26808 100644 --- a/tests/api_resources/test_personal_access_tokens.py +++ b/tests/api_resources/test_personal_access_tokens.py @@ -30,13 +30,7 @@ def test_method_list(self, client: Gitpod) -> None: def test_method_list_with_all_params(self, client: Gitpod) -> None: personal_access_token = client.personal_access_tokens.list( connect_protocol_version=1, - filter={ - "user_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, + filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 0, @@ -124,13 +118,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: personal_access_token = await async_client.personal_access_tokens.list( connect_protocol_version=1, - filter={ - "user_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, + filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 0, diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 04dcaf3f..c06e96d4 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -34,7 +34,7 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( environment_class={}, - initializer={"specs": [{}, {}, {}]}, + initializer={"specs": [{}]}, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", @@ -173,7 +173,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( environment_class={}, - initializer={"specs": [{}, {}, {}]}, + initializer={"specs": [{}]}, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", diff --git a/tests/api_resources/test_runner_interactions.py b/tests/api_resources/test_runner_interactions.py index 5a73d53f..87605b09 100644 --- a/tests/api_resources/test_runner_interactions.py +++ b/tests/api_resources/test_runner_interactions.py @@ -128,13 +128,7 @@ def test_method_list_runner_environment_classes(self, client: Gitpod) -> None: def test_method_list_runner_environment_classes_with_all_params(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.list_runner_environment_classes( connect_protocol_version=1, - filter={ - "environment_class_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, + filter={"environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 0, @@ -185,13 +179,7 @@ def test_method_list_runner_scm_integrations(self, client: Gitpod) -> None: def test_method_list_runner_scm_integrations_with_all_params(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.list_runner_scm_integrations( connect_protocol_version=1, - filter={ - "scm_integration_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, + filter={"scm_integration_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 0, @@ -543,63 +531,13 @@ def test_method_signup_with_all_params(self, client: Gitpod) -> None: { "key": "key", "value": "value", - }, - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, + } ], "description": "xxx", "display_name": "xxx", "enabled": True, "runner_id": "runnerId", - }, - { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, + } ], public_key="U3RhaW5sZXNzIHJvY2tz", connect_timeout_ms=0, @@ -642,31 +580,11 @@ def test_method_update_runner_configuration_schema_with_all_params(self, client: runner_interaction = client.runner_interactions.update_runner_configuration_schema( connect_protocol_version=1, config_schema={ - "environment_classes": [{}, {}, {}], - "runner_config": [{}, {}, {}], + "environment_classes": [{}], + "runner_config": [{}], "scm": [ { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - { - "default_hosts": ["string", "string", "string"], + "default_hosts": ["string"], "name": "name", "oauth": {"callback_url": "callbackUrl"}, "pat": { @@ -674,7 +592,7 @@ def test_method_update_runner_configuration_schema_with_all_params(self, client: "docs_link": "docsLink", }, "scm_id": "scmId", - }, + } ], "version": "version", }, @@ -719,7 +637,7 @@ def test_method_update_status(self, client: Gitpod) -> None: def test_method_update_status_with_all_params(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.update_status( body={ - "additionalInfo": [{}, {}, {}], + "additionalInfo": [{}], "degredationMessage": "degredationMessage", "logUrl": "https://example.com", "region": "region", @@ -867,13 +785,7 @@ async def test_method_list_runner_environment_classes(self, async_client: AsyncG async def test_method_list_runner_environment_classes_with_all_params(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.list_runner_environment_classes( connect_protocol_version=1, - filter={ - "environment_class_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, + filter={"environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 0, @@ -924,13 +836,7 @@ async def test_method_list_runner_scm_integrations(self, async_client: AsyncGitp async def test_method_list_runner_scm_integrations_with_all_params(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.list_runner_scm_integrations( connect_protocol_version=1, - filter={ - "scm_integration_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ] - }, + filter={"scm_integration_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 0, @@ -1282,63 +1188,13 @@ async def test_method_signup_with_all_params(self, async_client: AsyncGitpod) -> { "key": "key", "value": "value", - }, - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, + } ], "description": "xxx", "display_name": "xxx", "enabled": True, "runner_id": "runnerId", - }, - { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - { - "key": "key", - "value": "value", - }, - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, + } ], public_key="U3RhaW5sZXNzIHJvY2tz", connect_timeout_ms=0, @@ -1381,31 +1237,11 @@ async def test_method_update_runner_configuration_schema_with_all_params(self, a runner_interaction = await async_client.runner_interactions.update_runner_configuration_schema( connect_protocol_version=1, config_schema={ - "environment_classes": [{}, {}, {}], - "runner_config": [{}, {}, {}], + "environment_classes": [{}], + "runner_config": [{}], "scm": [ { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - { - "default_hosts": ["string", "string", "string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - }, - { - "default_hosts": ["string", "string", "string"], + "default_hosts": ["string"], "name": "name", "oauth": {"callback_url": "callbackUrl"}, "pat": { @@ -1413,7 +1249,7 @@ async def test_method_update_runner_configuration_schema_with_all_params(self, a "docs_link": "docsLink", }, "scm_id": "scmId", - }, + } ], "version": "version", }, @@ -1458,7 +1294,7 @@ async def test_method_update_status(self, async_client: AsyncGitpod) -> None: async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.update_status( body={ - "additionalInfo": [{}, {}, {}], + "additionalInfo": [{}], "degredationMessage": "degredationMessage", "logUrl": "https://example.com", "region": "region", diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 9bb0341d..53d6aa18 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -130,12 +130,8 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list( connect_protocol_version=1, filter={ - "creator_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "kinds": ["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"], + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "kinds": ["RUNNER_KIND_UNSPECIFIED"], }, pagination={ "token": "token", @@ -528,12 +524,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N runner = await async_client.runners.list( connect_protocol_version=1, filter={ - "creator_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "kinds": ["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"], + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "kinds": ["RUNNER_KIND_UNSPECIFIED"], }, pagination={ "token": "token", diff --git a/tests/api_resources/test_services.py b/tests/api_resources/test_services.py index 115968e2..cc347f63 100644 --- a/tests/api_resources/test_services.py +++ b/tests/api_resources/test_services.py @@ -160,17 +160,9 @@ def test_method_list_create_with_all_params(self, client: Gitpod) -> None: service = client.services.list_create( connect_protocol_version=1, filter={ - "environment_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "references": ["x", "x", "x"], - "service_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", @@ -428,17 +420,9 @@ async def test_method_list_create_with_all_params(self, async_client: AsyncGitpo service = await async_client.services.list_create( connect_protocol_version=1, filter={ - "environment_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], - "references": ["x", "x", "x"], - "service_ids": [ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", diff --git a/tests/api_resources/test_tasks.py b/tests/api_resources/test_tasks.py index f0a4ea03..1e59c290 100644 --- a/tests/api_resources/test_tasks.py +++ b/tests/api_resources/test_tasks.py @@ -33,11 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.tasks.create( connect_protocol_version=1, - depends_on=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -48,7 +44,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{}, {}, {}], + "triggered_by": [{}], }, spec={"command": "command"}, connect_timeout_ms=0, @@ -178,11 +174,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.tasks.create( connect_protocol_version=1, - depends_on=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -193,7 +185,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{}, {}, {}], + "triggered_by": [{}], }, spec={"command": "command"}, connect_timeout_ms=0, From 01f482dfe46e6398d9b2c97b6cfbb7338438b79f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 19 Nov 2024 20:04:01 +0000 Subject: [PATCH 006/505] chore: rebuild project due to codegen change --- pyproject.toml | 1 + requirements-dev.lock | 1 + src/gitpod/_utils/_sync.py | 90 +++++++++++++++++--------------------- tests/test_client.py | 38 ++++++++++++++++ 4 files changed, 80 insertions(+), 50 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 36c8c1ce..68f55994 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,7 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", + "nest_asyncio==1.6.0" ] [tool.rye.scripts] diff --git a/requirements-dev.lock b/requirements-dev.lock index 71257301..afa9adb5 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -51,6 +51,7 @@ mdurl==0.1.2 mypy==1.13.0 mypy-extensions==1.0.0 # via mypy +nest-asyncio==1.6.0 nodeenv==1.8.0 # via pyright nox==2023.4.22 diff --git a/src/gitpod/_utils/_sync.py b/src/gitpod/_utils/_sync.py index d0d81033..8b3aaf2b 100644 --- a/src/gitpod/_utils/_sync.py +++ b/src/gitpod/_utils/_sync.py @@ -1,56 +1,62 @@ from __future__ import annotations +import sys +import asyncio import functools -from typing import TypeVar, Callable, Awaitable +import contextvars +from typing import Any, TypeVar, Callable, Awaitable from typing_extensions import ParamSpec -import anyio -import anyio.to_thread - -from ._reflection import function_has_argument - T_Retval = TypeVar("T_Retval") T_ParamSpec = ParamSpec("T_ParamSpec") -# copied from `asyncer`, https://github.com/tiangolo/asyncer -def asyncify( - function: Callable[T_ParamSpec, T_Retval], - *, - cancellable: bool = False, - limiter: anyio.CapacityLimiter | None = None, -) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: +if sys.version_info >= (3, 9): + to_thread = asyncio.to_thread +else: + # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread + # for Python 3.8 support + async def to_thread( + func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs + ) -> Any: + """Asynchronously run function *func* in a separate thread. + + Any *args and **kwargs supplied for this function are directly passed + to *func*. Also, the current :class:`contextvars.Context` is propagated, + allowing context variables from the main thread to be accessed in the + separate thread. + + Returns a coroutine that can be awaited to get the eventual result of *func*. + """ + loop = asyncio.events.get_running_loop() + ctx = contextvars.copy_context() + func_call = functools.partial(ctx.run, func, *args, **kwargs) + return await loop.run_in_executor(None, func_call) + + +# inspired by `asyncer`, https://github.com/tiangolo/asyncer +def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ Take a blocking function and create an async one that receives the same - positional and keyword arguments, and that when called, calls the original function - in a worker thread using `anyio.to_thread.run_sync()`. Internally, - `asyncer.asyncify()` uses the same `anyio.to_thread.run_sync()`, but it supports - keyword arguments additional to positional arguments and it adds better support for - autocompletion and inline errors for the arguments of the function called and the - return value. - - If the `cancellable` option is enabled and the task waiting for its completion is - cancelled, the thread will still run its course but its return value (or any raised - exception) will be ignored. + positional and keyword arguments. For python version 3.9 and above, it uses + asyncio.to_thread to run the function in a separate thread. For python version + 3.8, it uses locally defined copy of the asyncio.to_thread function which was + introduced in python 3.9. - Use it like this: + Usage: - ```Python - def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str: - # Do work - return "Some result" + ```python + def blocking_func(arg1, arg2, kwarg1=None): + # blocking code + return result - result = await to_thread.asyncify(do_work)("spam", "ham", kwarg1="a", kwarg2="b") - print(result) + result = asyncify(blocking_function)(arg1, arg2, kwarg1=value1) ``` ## Arguments `function`: a blocking regular callable (e.g. a function) - `cancellable`: `True` to allow cancellation of the operation - `limiter`: capacity limiter to use to limit the total amount of threads running - (if omitted, the default limiter is used) ## Return @@ -60,22 +66,6 @@ def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str: """ async def wrapper(*args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs) -> T_Retval: - partial_f = functools.partial(function, *args, **kwargs) - - # In `v4.1.0` anyio added the `abandon_on_cancel` argument and deprecated the old - # `cancellable` argument, so we need to use the new `abandon_on_cancel` to avoid - # surfacing deprecation warnings. - if function_has_argument(anyio.to_thread.run_sync, "abandon_on_cancel"): - return await anyio.to_thread.run_sync( - partial_f, - abandon_on_cancel=cancellable, - limiter=limiter, - ) - - return await anyio.to_thread.run_sync( - partial_f, - cancellable=cancellable, - limiter=limiter, - ) + return await to_thread(function, *args, **kwargs) return wrapper diff --git a/tests/test_client.py b/tests/test_client.py index edce69cd..753b0feb 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -4,11 +4,14 @@ import gc import os +import sys import json import asyncio import inspect +import subprocess import tracemalloc from typing import Any, Union, cast +from textwrap import dedent from unittest import mock from typing_extensions import Literal @@ -1508,3 +1511,38 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" + + def test_get_platform(self) -> None: + # A previous implementation of asyncify could leave threads unterminated when + # used with nest_asyncio. + # + # Since nest_asyncio.apply() is global and cannot be un-applied, this + # test is run in a separate process to avoid affecting other tests. + test_code = dedent(""" + import asyncio + import nest_asyncio + import threading + + from gitpod._utils import asyncify + from gitpod._base_client import get_platform + + async def test_main() -> None: + result = await asyncify(get_platform)() + print(result) + for thread in threading.enumerate(): + print(thread.name) + + nest_asyncio.apply() + asyncio.run(test_main()) + """) + with subprocess.Popen( + [sys.executable, "-c", test_code], + text=True, + ) as process: + try: + process.wait(2) + if process.returncode: + raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") + except subprocess.TimeoutExpired as e: + process.kill() + raise AssertionError("calling get_platform using asyncify resulted in a hung process") from e From 3243e1521b1d3ae36b3eabac176d2c987f2f874d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 22 Nov 2024 11:35:53 +0000 Subject: [PATCH 007/505] chore(internal): fix compat model_dump method when warnings are passed --- src/gitpod/_compat.py | 3 ++- tests/test_models.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gitpod/_compat.py b/src/gitpod/_compat.py index 4794129c..df173f85 100644 --- a/src/gitpod/_compat.py +++ b/src/gitpod/_compat.py @@ -145,7 +145,8 @@ def model_dump( exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, - warnings=warnings, + # warnings are not supported in Pydantic v1 + warnings=warnings if PYDANTIC_V2 else True, ) return cast( "dict[str, Any]", diff --git a/tests/test_models.py b/tests/test_models.py index 9217b518..b9bf37ee 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -561,6 +561,14 @@ class Model(BaseModel): m.model_dump(warnings=False) +def test_compat_method_no_error_for_warnings() -> None: + class Model(BaseModel): + foo: Optional[str] + + m = Model(foo="hello") + assert isinstance(model_dump(m, warnings=False), dict) + + def test_to_json() -> None: class Model(BaseModel): foo: Optional[str] = Field(alias="FOO", default=None) From de6cf8125afb87747eee723884fe898e2603fbc3 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 22 Nov 2024 16:06:18 +0000 Subject: [PATCH 008/505] docs: add info log level to readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d58829ab..6a85cb56 100644 --- a/README.md +++ b/README.md @@ -170,12 +170,14 @@ Note that requests that time out are [retried twice by default](#retries). We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module. -You can enable logging by setting the environment variable `GITPOD_LOG` to `debug`. +You can enable logging by setting the environment variable `GITPOD_LOG` to `info`. ```shell -$ export GITPOD_LOG=debug +$ export GITPOD_LOG=info ``` +Or to `debug` for more verbose logging. + ### How to tell whether `None` means `null` or missing In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`: From 7be859ebe5d8fbed886e13ba0d31df639630d0b2 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 26 Nov 2024 04:10:27 +0000 Subject: [PATCH 009/505] chore: remove now unused `cached-property` dep --- pyproject.toml | 1 - src/gitpod/_compat.py | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 68f55994..e8242fef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,6 @@ dependencies = [ "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", - "cached-property; python_version < '3.8'", ] requires-python = ">= 3.8" classifiers = [ diff --git a/src/gitpod/_compat.py b/src/gitpod/_compat.py index df173f85..92d9ee61 100644 --- a/src/gitpod/_compat.py +++ b/src/gitpod/_compat.py @@ -214,9 +214,6 @@ def __set_name__(self, owner: type[Any], name: str) -> None: ... # __set__ is not defined at runtime, but @cached_property is designed to be settable def __set__(self, instance: object, value: _T) -> None: ... else: - try: - from functools import cached_property as cached_property - except ImportError: - from cached_property import cached_property as cached_property + from functools import cached_property as cached_property typed_cached_property = cached_property From ad04f52276c38cdff6957112a7ab7a3eb5fad747 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 28 Nov 2024 04:07:57 +0000 Subject: [PATCH 010/505] chore(internal): exclude mypy from running on tests --- mypy.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index 333d91d4..cdf75b39 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,7 +5,10 @@ show_error_codes = True # Exclude _files.py because mypy isn't smart enough to apply # the correct type narrowing and as this is an internal module # it's fine to just use Pyright. -exclude = ^(src/gitpod/_files\.py|_dev/.*\.py)$ +# +# We also exclude our `tests` as mypy doesn't always infer +# types correctly and Pyright will still catch any type errors. +exclude = ^(src/gitpod/_files\.py|_dev/.*\.py|tests/.*)$ strict_equality = True implicit_reexport = True From 094d413b30bbf372f653a2708bbc04940ef08c7b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 28 Nov 2024 18:42:28 +0000 Subject: [PATCH 011/505] fix(client): compat with new httpx 0.28.0 release --- src/gitpod/_base_client.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 064ec567..92ad9e5b 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -792,6 +792,7 @@ def __init__( custom_query: Mapping[str, object] | None = None, _strict_response_validation: bool, ) -> None: + kwargs: dict[str, Any] = {} if limits is not None: warnings.warn( "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", @@ -804,6 +805,7 @@ def __init__( limits = DEFAULT_CONNECTION_LIMITS if transport is not None: + kwargs["transport"] = transport warnings.warn( "The `transport` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -813,6 +815,7 @@ def __init__( raise ValueError("The `http_client` argument is mutually exclusive with `transport`") if proxies is not None: + kwargs["proxies"] = proxies warnings.warn( "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -856,10 +859,9 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, limits=limits, follow_redirects=True, + **kwargs, # type: ignore ) def is_closed(self) -> bool: @@ -1358,6 +1360,7 @@ def __init__( custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: + kwargs: dict[str, Any] = {} if limits is not None: warnings.warn( "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", @@ -1370,6 +1373,7 @@ def __init__( limits = DEFAULT_CONNECTION_LIMITS if transport is not None: + kwargs["transport"] = transport warnings.warn( "The `transport` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -1379,6 +1383,7 @@ def __init__( raise ValueError("The `http_client` argument is mutually exclusive with `transport`") if proxies is not None: + kwargs["proxies"] = proxies warnings.warn( "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -1422,10 +1427,9 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, limits=limits, follow_redirects=True, + **kwargs, # type: ignore ) def is_closed(self) -> bool: From 2750b40f68546dc4451b73c270d07c1d6676e740 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 3 Dec 2024 04:18:44 +0000 Subject: [PATCH 012/505] chore(internal): bump pyright --- requirements-dev.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index afa9adb5..f569dc14 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -68,7 +68,7 @@ pydantic-core==2.23.4 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.380 +pyright==1.1.389 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 @@ -97,6 +97,7 @@ typing-extensions==4.12.2 # via mypy # via pydantic # via pydantic-core + # via pyright virtualenv==20.24.5 # via nox zipp==3.17.0 From cb0903764845ca1ff69bd688e007039d3ff9ffb3 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 4 Dec 2024 04:23:16 +0000 Subject: [PATCH 013/505] chore: make the `Omit` type public --- src/gitpod/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gitpod/__init__.py b/src/gitpod/__init__.py index bf8d4c31..4bba6ebd 100644 --- a/src/gitpod/__init__.py +++ b/src/gitpod/__init__.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from . import types -from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes from ._utils import file_from_path from ._client import Client, Gitpod, Stream, Timeout, Transport, AsyncClient, AsyncGitpod, AsyncStream, RequestOptions from ._models import BaseModel @@ -36,6 +36,7 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "Omit", "GitpodError", "APIError", "APIStatusError", From 2decbdb598737c5924d756254ba79782d3d003c4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 04:16:41 +0000 Subject: [PATCH 014/505] chore(internal): bump pydantic dependency --- requirements-dev.lock | 4 ++-- requirements.lock | 4 ++-- src/gitpod/_types.py | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index f569dc14..3c057bc9 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -62,9 +62,9 @@ platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 # via pytest -pydantic==2.9.2 +pydantic==2.10.3 # via gitpod -pydantic-core==2.23.4 +pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich diff --git a/requirements.lock b/requirements.lock index aabc471e..7e0380a4 100644 --- a/requirements.lock +++ b/requirements.lock @@ -30,9 +30,9 @@ httpx==0.25.2 idna==3.4 # via anyio # via httpx -pydantic==2.9.2 +pydantic==2.10.3 # via gitpod -pydantic-core==2.23.4 +pydantic-core==2.27.1 # via pydantic sniffio==1.3.0 # via anyio diff --git a/src/gitpod/_types.py b/src/gitpod/_types.py index 08a95394..618f1886 100644 --- a/src/gitpod/_types.py +++ b/src/gitpod/_types.py @@ -192,10 +192,8 @@ def get(self, __key: str) -> str | None: ... StrBytesIntFloat = Union[str, bytes, int, float] # Note: copied from Pydantic -# https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49 -IncEx: TypeAlias = Union[ - Set[int], Set[str], Mapping[int, Union["IncEx", Literal[True]]], Mapping[str, Union["IncEx", Literal[True]]] -] +# https://github.com/pydantic/pydantic/blob/6f31f8f68ef011f84357330186f603ff295312fd/pydantic/main.py#L79 +IncEx: TypeAlias = Union[Set[int], Set[str], Mapping[int, Union["IncEx", bool]], Mapping[str, Union["IncEx", bool]]] PostParser = Callable[[Any], Any] From 7e03887de749e71ca8e73530d68fadf292c7f2dc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 04:21:28 +0000 Subject: [PATCH 015/505] docs(readme): fix http client proxies example --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6a85cb56..0d12171b 100644 --- a/README.md +++ b/README.md @@ -268,18 +268,19 @@ can also get all the extra fields on the Pydantic model as a dict with You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including: -- Support for proxies -- Custom transports +- Support for [proxies](https://www.python-httpx.org/advanced/proxies/) +- Custom [transports](https://www.python-httpx.org/advanced/transports/) - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality ```python +import httpx from gitpod import Gitpod, DefaultHttpxClient client = Gitpod( # Or use the `GITPOD_BASE_URL` env var base_url="http://my.test.server.example.com:8083", http_client=DefaultHttpxClient( - proxies="http://my.test.proxy.example.com", + proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), ) From c5c298ca46cd9aba2b6196bc7bfe2a4706403729 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 04:10:54 +0000 Subject: [PATCH 016/505] chore(internal): codegen related update --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- src/gitpod/_models.py | 3 +++ src/gitpod/_response.py | 20 ++++++++++---------- src/gitpod/_utils/__init__.py | 1 + src/gitpod/_utils/_typing.py | 31 ++++++++++++++++++++++++++++++- tests/test_models.py | 18 +++++++++++++++++- tests/utils.py | 4 ++++ 8 files changed, 67 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e8242fef..4b41b836 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.7, <5", + "typing-extensions>=4.10, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", diff --git a/requirements-dev.lock b/requirements-dev.lock index 3c057bc9..d047e259 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -68,7 +68,7 @@ pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.389 +pyright==1.1.390 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 6cb469e2..7a547ce5 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -46,6 +46,7 @@ strip_not_given, extract_type_arg, is_annotated_type, + is_type_alias_type, strip_annotated_type, ) from ._compat import ( @@ -428,6 +429,8 @@ def construct_type(*, value: object, type_: object) -> object: # we allow `object` as the input type because otherwise, passing things like # `Literal['value']` will be reported as a type error by type checkers type_ = cast("type[object]", type_) + if is_type_alias_type(type_): + type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` if is_annotated_type(type_): diff --git a/src/gitpod/_response.py b/src/gitpod/_response.py index 095cb424..73b2ce0b 100644 --- a/src/gitpod/_response.py +++ b/src/gitpod/_response.py @@ -25,7 +25,7 @@ import pydantic from ._types import NoneType -from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base +from ._utils import is_given, extract_type_arg, is_annotated_type, is_type_alias_type, extract_type_var_from_base from ._models import BaseModel, is_basemodel from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type @@ -126,9 +126,15 @@ def __repr__(self) -> str: ) def _parse(self, *, to: type[_T] | None = None) -> R | _T: + cast_to = to if to is not None else self._cast_to + + # unwrap `TypeAlias('Name', T)` -> `T` + if is_type_alias_type(cast_to): + cast_to = cast_to.__value__ # type: ignore[unreachable] + # unwrap `Annotated[T, ...]` -> `T` - if to and is_annotated_type(to): - to = extract_type_arg(to, 0) + if cast_to and is_annotated_type(cast_to): + cast_to = extract_type_arg(cast_to, 0) if self._is_sse_stream: if to: @@ -164,18 +170,12 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: return cast( R, stream_cls( - cast_to=self._cast_to, + cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), ), ) - cast_to = to if to is not None else self._cast_to - - # unwrap `Annotated[T, ...]` -> `T` - if is_annotated_type(cast_to): - cast_to = extract_type_arg(cast_to, 0) - if cast_to is NoneType: return cast(R, None) diff --git a/src/gitpod/_utils/__init__.py b/src/gitpod/_utils/__init__.py index a7cff3c0..d4fda26f 100644 --- a/src/gitpod/_utils/__init__.py +++ b/src/gitpod/_utils/__init__.py @@ -39,6 +39,7 @@ is_iterable_type as is_iterable_type, is_required_type as is_required_type, is_annotated_type as is_annotated_type, + is_type_alias_type as is_type_alias_type, strip_annotated_type as strip_annotated_type, extract_type_var_from_base as extract_type_var_from_base, ) diff --git a/src/gitpod/_utils/_typing.py b/src/gitpod/_utils/_typing.py index c036991f..278749b1 100644 --- a/src/gitpod/_utils/_typing.py +++ b/src/gitpod/_utils/_typing.py @@ -1,8 +1,17 @@ from __future__ import annotations +import sys +import typing +import typing_extensions from typing import Any, TypeVar, Iterable, cast from collections import abc as _c_abc -from typing_extensions import Required, Annotated, get_args, get_origin +from typing_extensions import ( + TypeIs, + Required, + Annotated, + get_args, + get_origin, +) from .._types import InheritsGeneric from .._compat import is_union as _is_union @@ -36,6 +45,26 @@ def is_typevar(typ: type) -> bool: return type(typ) == TypeVar # type: ignore +_TYPE_ALIAS_TYPES: tuple[type[typing_extensions.TypeAliasType], ...] = (typing_extensions.TypeAliasType,) +if sys.version_info >= (3, 12): + _TYPE_ALIAS_TYPES = (*_TYPE_ALIAS_TYPES, typing.TypeAliasType) + + +def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]: + """Return whether the provided argument is an instance of `TypeAliasType`. + + ```python + type Int = int + is_type_alias_type(Int) + # > True + Str = TypeAliasType("Str", str) + is_type_alias_type(Str) + # > True + ``` + """ + return isinstance(tp, _TYPE_ALIAS_TYPES) + + # Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]] def strip_annotated_type(typ: type) -> type: if is_required_type(typ) or is_annotated_type(typ): diff --git a/tests/test_models.py b/tests/test_models.py index b9bf37ee..e2f4b78f 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,7 +1,7 @@ import json from typing import Any, Dict, List, Union, Optional, cast from datetime import datetime, timezone -from typing_extensions import Literal, Annotated +from typing_extensions import Literal, Annotated, TypeAliasType import pytest import pydantic @@ -828,3 +828,19 @@ class B(BaseModel): # if the discriminator details object stays the same between invocations then # we hit the cache assert UnionType.__discriminator__ is discriminator + + +@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +def test_type_alias_type() -> None: + Alias = TypeAliasType("Alias", str) + + class Model(BaseModel): + alias: Alias + union: Union[int, Alias] + + m = construct_type(value={"alias": "foo", "union": "bar"}, type_=Model) + assert isinstance(m, Model) + assert isinstance(m.alias, str) + assert m.alias == "foo" + assert isinstance(m.union, str) + assert m.union == "bar" diff --git a/tests/utils.py b/tests/utils.py index 0a80aa6a..d7dbee62 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -16,6 +16,7 @@ is_union_type, extract_type_arg, is_annotated_type, + is_type_alias_type, ) from gitpod._compat import PYDANTIC_V2, field_outer_type, get_model_fields from gitpod._models import BaseModel @@ -51,6 +52,9 @@ def assert_matches_type( path: list[str], allow_none: bool = False, ) -> None: + if is_type_alias_type(type_): + type_ = type_.__value__ + # unwrap `Annotated[T, ...]` -> `T` if is_annotated_type(type_): type_ = extract_type_arg(type_, 0) From f0fdd833ca8945226fa0f8787daef6da34df09d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 04:08:49 +0000 Subject: [PATCH 017/505] chore(internal): codegen related update --- src/gitpod/_client.py | 240 ++++++++++-------- .../resources/organizations/organizations.py | 17 +- 2 files changed, 140 insertions(+), 117 deletions(-) diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 6d7ffc33..35976abf 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -8,7 +8,7 @@ import httpx -from . import resources, _exceptions +from . import _exceptions from ._qs import Querystring from ._types import ( NOT_GIVEN, @@ -24,6 +24,15 @@ get_async_library, ) from ._version import __version__ +from .resources import ( + tasks, + projects, + services, + environments, + automations_files, + environment_classes, + personal_access_tokens, +) from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import APIStatusError from ._base_client import ( @@ -31,33 +40,28 @@ SyncAPIClient, AsyncAPIClient, ) +from .resources.runners import runners +from .resources.organizations import organizations +from .resources.runner_interactions import runner_interactions +from .resources.runner_configurations import runner_configurations +from .resources.environment_automations import environment_automations -__all__ = [ - "Timeout", - "Transport", - "ProxiesTypes", - "RequestOptions", - "resources", - "Gitpod", - "AsyncGitpod", - "Client", - "AsyncClient", -] +__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gitpod", "AsyncGitpod", "Client", "AsyncClient"] class Gitpod(SyncAPIClient): - services: resources.ServicesResource - automations_files: resources.AutomationsFilesResource - tasks: resources.TasksResource - environment_automations: resources.EnvironmentAutomationsResource - environments: resources.EnvironmentsResource - environment_classes: resources.EnvironmentClassesResource - organizations: resources.OrganizationsResource - projects: resources.ProjectsResource - runner_configurations: resources.RunnerConfigurationsResource - runner_interactions: resources.RunnerInteractionsResource - runners: resources.RunnersResource - personal_access_tokens: resources.PersonalAccessTokensResource + services: services.ServicesResource + automations_files: automations_files.AutomationsFilesResource + tasks: tasks.TasksResource + environment_automations: environment_automations.EnvironmentAutomationsResource + environments: environments.EnvironmentsResource + environment_classes: environment_classes.EnvironmentClassesResource + organizations: organizations.OrganizationsResource + projects: projects.ProjectsResource + runner_configurations: runner_configurations.RunnerConfigurationsResource + runner_interactions: runner_interactions.RunnerInteractionsResource + runners: runners.RunnersResource + personal_access_tokens: personal_access_tokens.PersonalAccessTokensResource with_raw_response: GitpodWithRawResponse with_streaming_response: GitpodWithStreamedResponse @@ -102,18 +106,18 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.services = resources.ServicesResource(self) - self.automations_files = resources.AutomationsFilesResource(self) - self.tasks = resources.TasksResource(self) - self.environment_automations = resources.EnvironmentAutomationsResource(self) - self.environments = resources.EnvironmentsResource(self) - self.environment_classes = resources.EnvironmentClassesResource(self) - self.organizations = resources.OrganizationsResource(self) - self.projects = resources.ProjectsResource(self) - self.runner_configurations = resources.RunnerConfigurationsResource(self) - self.runner_interactions = resources.RunnerInteractionsResource(self) - self.runners = resources.RunnersResource(self) - self.personal_access_tokens = resources.PersonalAccessTokensResource(self) + self.services = services.ServicesResource(self) + self.automations_files = automations_files.AutomationsFilesResource(self) + self.tasks = tasks.TasksResource(self) + self.environment_automations = environment_automations.EnvironmentAutomationsResource(self) + self.environments = environments.EnvironmentsResource(self) + self.environment_classes = environment_classes.EnvironmentClassesResource(self) + self.organizations = organizations.OrganizationsResource(self) + self.projects = projects.ProjectsResource(self) + self.runner_configurations = runner_configurations.RunnerConfigurationsResource(self) + self.runner_interactions = runner_interactions.RunnerInteractionsResource(self) + self.runners = runners.RunnersResource(self) + self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResource(self) self.with_raw_response = GitpodWithRawResponse(self) self.with_streaming_response = GitpodWithStreamedResponse(self) @@ -215,18 +219,18 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): - services: resources.AsyncServicesResource - automations_files: resources.AsyncAutomationsFilesResource - tasks: resources.AsyncTasksResource - environment_automations: resources.AsyncEnvironmentAutomationsResource - environments: resources.AsyncEnvironmentsResource - environment_classes: resources.AsyncEnvironmentClassesResource - organizations: resources.AsyncOrganizationsResource - projects: resources.AsyncProjectsResource - runner_configurations: resources.AsyncRunnerConfigurationsResource - runner_interactions: resources.AsyncRunnerInteractionsResource - runners: resources.AsyncRunnersResource - personal_access_tokens: resources.AsyncPersonalAccessTokensResource + services: services.AsyncServicesResource + automations_files: automations_files.AsyncAutomationsFilesResource + tasks: tasks.AsyncTasksResource + environment_automations: environment_automations.AsyncEnvironmentAutomationsResource + environments: environments.AsyncEnvironmentsResource + environment_classes: environment_classes.AsyncEnvironmentClassesResource + organizations: organizations.AsyncOrganizationsResource + projects: projects.AsyncProjectsResource + runner_configurations: runner_configurations.AsyncRunnerConfigurationsResource + runner_interactions: runner_interactions.AsyncRunnerInteractionsResource + runners: runners.AsyncRunnersResource + personal_access_tokens: personal_access_tokens.AsyncPersonalAccessTokensResource with_raw_response: AsyncGitpodWithRawResponse with_streaming_response: AsyncGitpodWithStreamedResponse @@ -271,18 +275,18 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.services = resources.AsyncServicesResource(self) - self.automations_files = resources.AsyncAutomationsFilesResource(self) - self.tasks = resources.AsyncTasksResource(self) - self.environment_automations = resources.AsyncEnvironmentAutomationsResource(self) - self.environments = resources.AsyncEnvironmentsResource(self) - self.environment_classes = resources.AsyncEnvironmentClassesResource(self) - self.organizations = resources.AsyncOrganizationsResource(self) - self.projects = resources.AsyncProjectsResource(self) - self.runner_configurations = resources.AsyncRunnerConfigurationsResource(self) - self.runner_interactions = resources.AsyncRunnerInteractionsResource(self) - self.runners = resources.AsyncRunnersResource(self) - self.personal_access_tokens = resources.AsyncPersonalAccessTokensResource(self) + self.services = services.AsyncServicesResource(self) + self.automations_files = automations_files.AsyncAutomationsFilesResource(self) + self.tasks = tasks.AsyncTasksResource(self) + self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResource(self) + self.environments = environments.AsyncEnvironmentsResource(self) + self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self) + self.organizations = organizations.AsyncOrganizationsResource(self) + self.projects = projects.AsyncProjectsResource(self) + self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResource(self) + self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResource(self) + self.runners = runners.AsyncRunnersResource(self) + self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResource(self) self.with_raw_response = AsyncGitpodWithRawResponse(self) self.with_streaming_response = AsyncGitpodWithStreamedResponse(self) @@ -385,90 +389,110 @@ def _make_status_error( class GitpodWithRawResponse: def __init__(self, client: Gitpod) -> None: - self.services = resources.ServicesResourceWithRawResponse(client.services) - self.automations_files = resources.AutomationsFilesResourceWithRawResponse(client.automations_files) - self.tasks = resources.TasksResourceWithRawResponse(client.tasks) - self.environment_automations = resources.EnvironmentAutomationsResourceWithRawResponse( + self.services = services.ServicesResourceWithRawResponse(client.services) + self.automations_files = automations_files.AutomationsFilesResourceWithRawResponse(client.automations_files) + self.tasks = tasks.TasksResourceWithRawResponse(client.tasks) + self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) - self.environments = resources.EnvironmentsResourceWithRawResponse(client.environments) - self.environment_classes = resources.EnvironmentClassesResourceWithRawResponse(client.environment_classes) - self.organizations = resources.OrganizationsResourceWithRawResponse(client.organizations) - self.projects = resources.ProjectsResourceWithRawResponse(client.projects) - self.runner_configurations = resources.RunnerConfigurationsResourceWithRawResponse(client.runner_configurations) - self.runner_interactions = resources.RunnerInteractionsResourceWithRawResponse(client.runner_interactions) - self.runners = resources.RunnersResourceWithRawResponse(client.runners) - self.personal_access_tokens = resources.PersonalAccessTokensResourceWithRawResponse( + self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) + self.environment_classes = environment_classes.EnvironmentClassesResourceWithRawResponse( + client.environment_classes + ) + self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations) + self.projects = projects.ProjectsResourceWithRawResponse(client.projects) + self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithRawResponse( + client.runner_configurations + ) + self.runner_interactions = runner_interactions.RunnerInteractionsResourceWithRawResponse( + client.runner_interactions + ) + self.runners = runners.RunnersResourceWithRawResponse(client.runners) + self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens ) class AsyncGitpodWithRawResponse: def __init__(self, client: AsyncGitpod) -> None: - self.services = resources.AsyncServicesResourceWithRawResponse(client.services) - self.automations_files = resources.AsyncAutomationsFilesResourceWithRawResponse(client.automations_files) - self.tasks = resources.AsyncTasksResourceWithRawResponse(client.tasks) - self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithRawResponse( + self.services = services.AsyncServicesResourceWithRawResponse(client.services) + self.automations_files = automations_files.AsyncAutomationsFilesResourceWithRawResponse( + client.automations_files + ) + self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks) + self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) - self.environments = resources.AsyncEnvironmentsResourceWithRawResponse(client.environments) - self.environment_classes = resources.AsyncEnvironmentClassesResourceWithRawResponse(client.environment_classes) - self.organizations = resources.AsyncOrganizationsResourceWithRawResponse(client.organizations) - self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) - self.runner_configurations = resources.AsyncRunnerConfigurationsResourceWithRawResponse( + self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) + self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithRawResponse( + client.environment_classes + ) + self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations) + self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) + self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithRawResponse( client.runner_configurations ) - self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithRawResponse(client.runner_interactions) - self.runners = resources.AsyncRunnersResourceWithRawResponse(client.runners) - self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithRawResponse( + self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResourceWithRawResponse( + client.runner_interactions + ) + self.runners = runners.AsyncRunnersResourceWithRawResponse(client.runners) + self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens ) class GitpodWithStreamedResponse: def __init__(self, client: Gitpod) -> None: - self.services = resources.ServicesResourceWithStreamingResponse(client.services) - self.automations_files = resources.AutomationsFilesResourceWithStreamingResponse(client.automations_files) - self.tasks = resources.TasksResourceWithStreamingResponse(client.tasks) - self.environment_automations = resources.EnvironmentAutomationsResourceWithStreamingResponse( + self.services = services.ServicesResourceWithStreamingResponse(client.services) + self.automations_files = automations_files.AutomationsFilesResourceWithStreamingResponse( + client.automations_files + ) + self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks) + self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) - self.environments = resources.EnvironmentsResourceWithStreamingResponse(client.environments) - self.environment_classes = resources.EnvironmentClassesResourceWithStreamingResponse(client.environment_classes) - self.organizations = resources.OrganizationsResourceWithStreamingResponse(client.organizations) - self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) - self.runner_configurations = resources.RunnerConfigurationsResourceWithStreamingResponse( + self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) + self.environment_classes = environment_classes.EnvironmentClassesResourceWithStreamingResponse( + client.environment_classes + ) + self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations) + self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) + self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithStreamingResponse( client.runner_configurations ) - self.runner_interactions = resources.RunnerInteractionsResourceWithStreamingResponse(client.runner_interactions) - self.runners = resources.RunnersResourceWithStreamingResponse(client.runners) - self.personal_access_tokens = resources.PersonalAccessTokensResourceWithStreamingResponse( + self.runner_interactions = runner_interactions.RunnerInteractionsResourceWithStreamingResponse( + client.runner_interactions + ) + self.runners = runners.RunnersResourceWithStreamingResponse(client.runners) + self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens ) class AsyncGitpodWithStreamedResponse: def __init__(self, client: AsyncGitpod) -> None: - self.services = resources.AsyncServicesResourceWithStreamingResponse(client.services) - self.automations_files = resources.AsyncAutomationsFilesResourceWithStreamingResponse(client.automations_files) - self.tasks = resources.AsyncTasksResourceWithStreamingResponse(client.tasks) - self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithStreamingResponse( + self.services = services.AsyncServicesResourceWithStreamingResponse(client.services) + self.automations_files = automations_files.AsyncAutomationsFilesResourceWithStreamingResponse( + client.automations_files + ) + self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks) + self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) - self.environments = resources.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) - self.environment_classes = resources.AsyncEnvironmentClassesResourceWithStreamingResponse( + self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) + self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithStreamingResponse( client.environment_classes ) - self.organizations = resources.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) - self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) - self.runner_configurations = resources.AsyncRunnerConfigurationsResourceWithStreamingResponse( + self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) + self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) + self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithStreamingResponse( client.runner_configurations ) - self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithStreamingResponse( + self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResourceWithStreamingResponse( client.runner_interactions ) - self.runners = resources.AsyncRunnersResourceWithStreamingResponse(client.runners) - self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithStreamingResponse( + self.runners = runners.AsyncRunnersResourceWithStreamingResponse(client.runners) + self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 019b79b8..5f0d93f5 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -6,14 +6,6 @@ import httpx -from .invite import ( - InviteResource, - AsyncInviteResource, - InviteResourceWithRawResponse, - AsyncInviteResourceWithRawResponse, - InviteResourceWithStreamingResponse, - AsyncInviteResourceWithStreamingResponse, -) from ...types import organization_leave_params, organization_set_role_params from .members import ( MembersResource, @@ -38,7 +30,14 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .invite.invite import InviteResource, AsyncInviteResource +from .invite.invite import ( + InviteResource, + AsyncInviteResource, + InviteResourceWithRawResponse, + AsyncInviteResourceWithRawResponse, + InviteResourceWithStreamingResponse, + AsyncInviteResourceWithStreamingResponse, +) from ..._base_client import make_request_options __all__ = ["OrganizationsResource", "AsyncOrganizationsResource"] From 80257faf30d8527b1e24e904928c5952c264d38c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 04:09:25 +0000 Subject: [PATCH 018/505] chore(internal): codegen related update --- src/gitpod/_client.py | 240 ++++++++---------- .../resources/organizations/organizations.py | 17 +- 2 files changed, 117 insertions(+), 140 deletions(-) diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 35976abf..6d7ffc33 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -8,7 +8,7 @@ import httpx -from . import _exceptions +from . import resources, _exceptions from ._qs import Querystring from ._types import ( NOT_GIVEN, @@ -24,15 +24,6 @@ get_async_library, ) from ._version import __version__ -from .resources import ( - tasks, - projects, - services, - environments, - automations_files, - environment_classes, - personal_access_tokens, -) from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import APIStatusError from ._base_client import ( @@ -40,28 +31,33 @@ SyncAPIClient, AsyncAPIClient, ) -from .resources.runners import runners -from .resources.organizations import organizations -from .resources.runner_interactions import runner_interactions -from .resources.runner_configurations import runner_configurations -from .resources.environment_automations import environment_automations -__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gitpod", "AsyncGitpod", "Client", "AsyncClient"] +__all__ = [ + "Timeout", + "Transport", + "ProxiesTypes", + "RequestOptions", + "resources", + "Gitpod", + "AsyncGitpod", + "Client", + "AsyncClient", +] class Gitpod(SyncAPIClient): - services: services.ServicesResource - automations_files: automations_files.AutomationsFilesResource - tasks: tasks.TasksResource - environment_automations: environment_automations.EnvironmentAutomationsResource - environments: environments.EnvironmentsResource - environment_classes: environment_classes.EnvironmentClassesResource - organizations: organizations.OrganizationsResource - projects: projects.ProjectsResource - runner_configurations: runner_configurations.RunnerConfigurationsResource - runner_interactions: runner_interactions.RunnerInteractionsResource - runners: runners.RunnersResource - personal_access_tokens: personal_access_tokens.PersonalAccessTokensResource + services: resources.ServicesResource + automations_files: resources.AutomationsFilesResource + tasks: resources.TasksResource + environment_automations: resources.EnvironmentAutomationsResource + environments: resources.EnvironmentsResource + environment_classes: resources.EnvironmentClassesResource + organizations: resources.OrganizationsResource + projects: resources.ProjectsResource + runner_configurations: resources.RunnerConfigurationsResource + runner_interactions: resources.RunnerInteractionsResource + runners: resources.RunnersResource + personal_access_tokens: resources.PersonalAccessTokensResource with_raw_response: GitpodWithRawResponse with_streaming_response: GitpodWithStreamedResponse @@ -106,18 +102,18 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.services = services.ServicesResource(self) - self.automations_files = automations_files.AutomationsFilesResource(self) - self.tasks = tasks.TasksResource(self) - self.environment_automations = environment_automations.EnvironmentAutomationsResource(self) - self.environments = environments.EnvironmentsResource(self) - self.environment_classes = environment_classes.EnvironmentClassesResource(self) - self.organizations = organizations.OrganizationsResource(self) - self.projects = projects.ProjectsResource(self) - self.runner_configurations = runner_configurations.RunnerConfigurationsResource(self) - self.runner_interactions = runner_interactions.RunnerInteractionsResource(self) - self.runners = runners.RunnersResource(self) - self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResource(self) + self.services = resources.ServicesResource(self) + self.automations_files = resources.AutomationsFilesResource(self) + self.tasks = resources.TasksResource(self) + self.environment_automations = resources.EnvironmentAutomationsResource(self) + self.environments = resources.EnvironmentsResource(self) + self.environment_classes = resources.EnvironmentClassesResource(self) + self.organizations = resources.OrganizationsResource(self) + self.projects = resources.ProjectsResource(self) + self.runner_configurations = resources.RunnerConfigurationsResource(self) + self.runner_interactions = resources.RunnerInteractionsResource(self) + self.runners = resources.RunnersResource(self) + self.personal_access_tokens = resources.PersonalAccessTokensResource(self) self.with_raw_response = GitpodWithRawResponse(self) self.with_streaming_response = GitpodWithStreamedResponse(self) @@ -219,18 +215,18 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): - services: services.AsyncServicesResource - automations_files: automations_files.AsyncAutomationsFilesResource - tasks: tasks.AsyncTasksResource - environment_automations: environment_automations.AsyncEnvironmentAutomationsResource - environments: environments.AsyncEnvironmentsResource - environment_classes: environment_classes.AsyncEnvironmentClassesResource - organizations: organizations.AsyncOrganizationsResource - projects: projects.AsyncProjectsResource - runner_configurations: runner_configurations.AsyncRunnerConfigurationsResource - runner_interactions: runner_interactions.AsyncRunnerInteractionsResource - runners: runners.AsyncRunnersResource - personal_access_tokens: personal_access_tokens.AsyncPersonalAccessTokensResource + services: resources.AsyncServicesResource + automations_files: resources.AsyncAutomationsFilesResource + tasks: resources.AsyncTasksResource + environment_automations: resources.AsyncEnvironmentAutomationsResource + environments: resources.AsyncEnvironmentsResource + environment_classes: resources.AsyncEnvironmentClassesResource + organizations: resources.AsyncOrganizationsResource + projects: resources.AsyncProjectsResource + runner_configurations: resources.AsyncRunnerConfigurationsResource + runner_interactions: resources.AsyncRunnerInteractionsResource + runners: resources.AsyncRunnersResource + personal_access_tokens: resources.AsyncPersonalAccessTokensResource with_raw_response: AsyncGitpodWithRawResponse with_streaming_response: AsyncGitpodWithStreamedResponse @@ -275,18 +271,18 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.services = services.AsyncServicesResource(self) - self.automations_files = automations_files.AsyncAutomationsFilesResource(self) - self.tasks = tasks.AsyncTasksResource(self) - self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResource(self) - self.environments = environments.AsyncEnvironmentsResource(self) - self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self) - self.organizations = organizations.AsyncOrganizationsResource(self) - self.projects = projects.AsyncProjectsResource(self) - self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResource(self) - self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResource(self) - self.runners = runners.AsyncRunnersResource(self) - self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResource(self) + self.services = resources.AsyncServicesResource(self) + self.automations_files = resources.AsyncAutomationsFilesResource(self) + self.tasks = resources.AsyncTasksResource(self) + self.environment_automations = resources.AsyncEnvironmentAutomationsResource(self) + self.environments = resources.AsyncEnvironmentsResource(self) + self.environment_classes = resources.AsyncEnvironmentClassesResource(self) + self.organizations = resources.AsyncOrganizationsResource(self) + self.projects = resources.AsyncProjectsResource(self) + self.runner_configurations = resources.AsyncRunnerConfigurationsResource(self) + self.runner_interactions = resources.AsyncRunnerInteractionsResource(self) + self.runners = resources.AsyncRunnersResource(self) + self.personal_access_tokens = resources.AsyncPersonalAccessTokensResource(self) self.with_raw_response = AsyncGitpodWithRawResponse(self) self.with_streaming_response = AsyncGitpodWithStreamedResponse(self) @@ -389,110 +385,90 @@ def _make_status_error( class GitpodWithRawResponse: def __init__(self, client: Gitpod) -> None: - self.services = services.ServicesResourceWithRawResponse(client.services) - self.automations_files = automations_files.AutomationsFilesResourceWithRawResponse(client.automations_files) - self.tasks = tasks.TasksResourceWithRawResponse(client.tasks) - self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithRawResponse( + self.services = resources.ServicesResourceWithRawResponse(client.services) + self.automations_files = resources.AutomationsFilesResourceWithRawResponse(client.automations_files) + self.tasks = resources.TasksResourceWithRawResponse(client.tasks) + self.environment_automations = resources.EnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) - self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) - self.environment_classes = environment_classes.EnvironmentClassesResourceWithRawResponse( - client.environment_classes - ) - self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations) - self.projects = projects.ProjectsResourceWithRawResponse(client.projects) - self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithRawResponse( - client.runner_configurations - ) - self.runner_interactions = runner_interactions.RunnerInteractionsResourceWithRawResponse( - client.runner_interactions - ) - self.runners = runners.RunnersResourceWithRawResponse(client.runners) - self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithRawResponse( + self.environments = resources.EnvironmentsResourceWithRawResponse(client.environments) + self.environment_classes = resources.EnvironmentClassesResourceWithRawResponse(client.environment_classes) + self.organizations = resources.OrganizationsResourceWithRawResponse(client.organizations) + self.projects = resources.ProjectsResourceWithRawResponse(client.projects) + self.runner_configurations = resources.RunnerConfigurationsResourceWithRawResponse(client.runner_configurations) + self.runner_interactions = resources.RunnerInteractionsResourceWithRawResponse(client.runner_interactions) + self.runners = resources.RunnersResourceWithRawResponse(client.runners) + self.personal_access_tokens = resources.PersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens ) class AsyncGitpodWithRawResponse: def __init__(self, client: AsyncGitpod) -> None: - self.services = services.AsyncServicesResourceWithRawResponse(client.services) - self.automations_files = automations_files.AsyncAutomationsFilesResourceWithRawResponse( - client.automations_files - ) - self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks) - self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithRawResponse( + self.services = resources.AsyncServicesResourceWithRawResponse(client.services) + self.automations_files = resources.AsyncAutomationsFilesResourceWithRawResponse(client.automations_files) + self.tasks = resources.AsyncTasksResourceWithRawResponse(client.tasks) + self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) - self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) - self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithRawResponse( - client.environment_classes - ) - self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations) - self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) - self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithRawResponse( + self.environments = resources.AsyncEnvironmentsResourceWithRawResponse(client.environments) + self.environment_classes = resources.AsyncEnvironmentClassesResourceWithRawResponse(client.environment_classes) + self.organizations = resources.AsyncOrganizationsResourceWithRawResponse(client.organizations) + self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) + self.runner_configurations = resources.AsyncRunnerConfigurationsResourceWithRawResponse( client.runner_configurations ) - self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResourceWithRawResponse( - client.runner_interactions - ) - self.runners = runners.AsyncRunnersResourceWithRawResponse(client.runners) - self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithRawResponse( + self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithRawResponse(client.runner_interactions) + self.runners = resources.AsyncRunnersResourceWithRawResponse(client.runners) + self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens ) class GitpodWithStreamedResponse: def __init__(self, client: Gitpod) -> None: - self.services = services.ServicesResourceWithStreamingResponse(client.services) - self.automations_files = automations_files.AutomationsFilesResourceWithStreamingResponse( - client.automations_files - ) - self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks) - self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithStreamingResponse( + self.services = resources.ServicesResourceWithStreamingResponse(client.services) + self.automations_files = resources.AutomationsFilesResourceWithStreamingResponse(client.automations_files) + self.tasks = resources.TasksResourceWithStreamingResponse(client.tasks) + self.environment_automations = resources.EnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) - self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) - self.environment_classes = environment_classes.EnvironmentClassesResourceWithStreamingResponse( - client.environment_classes - ) - self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations) - self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) - self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithStreamingResponse( + self.environments = resources.EnvironmentsResourceWithStreamingResponse(client.environments) + self.environment_classes = resources.EnvironmentClassesResourceWithStreamingResponse(client.environment_classes) + self.organizations = resources.OrganizationsResourceWithStreamingResponse(client.organizations) + self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) + self.runner_configurations = resources.RunnerConfigurationsResourceWithStreamingResponse( client.runner_configurations ) - self.runner_interactions = runner_interactions.RunnerInteractionsResourceWithStreamingResponse( - client.runner_interactions - ) - self.runners = runners.RunnersResourceWithStreamingResponse(client.runners) - self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithStreamingResponse( + self.runner_interactions = resources.RunnerInteractionsResourceWithStreamingResponse(client.runner_interactions) + self.runners = resources.RunnersResourceWithStreamingResponse(client.runners) + self.personal_access_tokens = resources.PersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens ) class AsyncGitpodWithStreamedResponse: def __init__(self, client: AsyncGitpod) -> None: - self.services = services.AsyncServicesResourceWithStreamingResponse(client.services) - self.automations_files = automations_files.AsyncAutomationsFilesResourceWithStreamingResponse( - client.automations_files - ) - self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks) - self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithStreamingResponse( + self.services = resources.AsyncServicesResourceWithStreamingResponse(client.services) + self.automations_files = resources.AsyncAutomationsFilesResourceWithStreamingResponse(client.automations_files) + self.tasks = resources.AsyncTasksResourceWithStreamingResponse(client.tasks) + self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) - self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) - self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithStreamingResponse( + self.environments = resources.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) + self.environment_classes = resources.AsyncEnvironmentClassesResourceWithStreamingResponse( client.environment_classes ) - self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) - self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) - self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithStreamingResponse( + self.organizations = resources.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) + self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) + self.runner_configurations = resources.AsyncRunnerConfigurationsResourceWithStreamingResponse( client.runner_configurations ) - self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResourceWithStreamingResponse( + self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithStreamingResponse( client.runner_interactions ) - self.runners = runners.AsyncRunnersResourceWithStreamingResponse(client.runners) - self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithStreamingResponse( + self.runners = resources.AsyncRunnersResourceWithStreamingResponse(client.runners) + self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 5f0d93f5..019b79b8 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -6,6 +6,14 @@ import httpx +from .invite import ( + InviteResource, + AsyncInviteResource, + InviteResourceWithRawResponse, + AsyncInviteResourceWithRawResponse, + InviteResourceWithStreamingResponse, + AsyncInviteResourceWithStreamingResponse, +) from ...types import organization_leave_params, organization_set_role_params from .members import ( MembersResource, @@ -30,14 +38,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .invite.invite import ( - InviteResource, - AsyncInviteResource, - InviteResourceWithRawResponse, - AsyncInviteResourceWithRawResponse, - InviteResourceWithStreamingResponse, - AsyncInviteResourceWithStreamingResponse, -) +from .invite.invite import InviteResource, AsyncInviteResource from ..._base_client import make_request_options __all__ = ["OrganizationsResource", "AsyncOrganizationsResource"] From 16164b4894910b26837f02052aa341f3c302cce4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 04:10:58 +0000 Subject: [PATCH 019/505] chore(internal): remove some duplicated imports --- .../resources/organizations/organizations.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 019b79b8..5f0d93f5 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -6,14 +6,6 @@ import httpx -from .invite import ( - InviteResource, - AsyncInviteResource, - InviteResourceWithRawResponse, - AsyncInviteResourceWithRawResponse, - InviteResourceWithStreamingResponse, - AsyncInviteResourceWithStreamingResponse, -) from ...types import organization_leave_params, organization_set_role_params from .members import ( MembersResource, @@ -38,7 +30,14 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .invite.invite import InviteResource, AsyncInviteResource +from .invite.invite import ( + InviteResource, + AsyncInviteResource, + InviteResourceWithRawResponse, + AsyncInviteResourceWithRawResponse, + InviteResourceWithStreamingResponse, + AsyncInviteResourceWithStreamingResponse, +) from ..._base_client import make_request_options __all__ = ["OrganizationsResource", "AsyncOrganizationsResource"] From 2a4ab3d317cd060a5c33044bffdb005304926af1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 04:11:37 +0000 Subject: [PATCH 020/505] chore(internal): updated imports --- src/gitpod/_client.py | 240 +++++++++++++++++++++++------------------- 1 file changed, 132 insertions(+), 108 deletions(-) diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 6d7ffc33..35976abf 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -8,7 +8,7 @@ import httpx -from . import resources, _exceptions +from . import _exceptions from ._qs import Querystring from ._types import ( NOT_GIVEN, @@ -24,6 +24,15 @@ get_async_library, ) from ._version import __version__ +from .resources import ( + tasks, + projects, + services, + environments, + automations_files, + environment_classes, + personal_access_tokens, +) from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import APIStatusError from ._base_client import ( @@ -31,33 +40,28 @@ SyncAPIClient, AsyncAPIClient, ) +from .resources.runners import runners +from .resources.organizations import organizations +from .resources.runner_interactions import runner_interactions +from .resources.runner_configurations import runner_configurations +from .resources.environment_automations import environment_automations -__all__ = [ - "Timeout", - "Transport", - "ProxiesTypes", - "RequestOptions", - "resources", - "Gitpod", - "AsyncGitpod", - "Client", - "AsyncClient", -] +__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gitpod", "AsyncGitpod", "Client", "AsyncClient"] class Gitpod(SyncAPIClient): - services: resources.ServicesResource - automations_files: resources.AutomationsFilesResource - tasks: resources.TasksResource - environment_automations: resources.EnvironmentAutomationsResource - environments: resources.EnvironmentsResource - environment_classes: resources.EnvironmentClassesResource - organizations: resources.OrganizationsResource - projects: resources.ProjectsResource - runner_configurations: resources.RunnerConfigurationsResource - runner_interactions: resources.RunnerInteractionsResource - runners: resources.RunnersResource - personal_access_tokens: resources.PersonalAccessTokensResource + services: services.ServicesResource + automations_files: automations_files.AutomationsFilesResource + tasks: tasks.TasksResource + environment_automations: environment_automations.EnvironmentAutomationsResource + environments: environments.EnvironmentsResource + environment_classes: environment_classes.EnvironmentClassesResource + organizations: organizations.OrganizationsResource + projects: projects.ProjectsResource + runner_configurations: runner_configurations.RunnerConfigurationsResource + runner_interactions: runner_interactions.RunnerInteractionsResource + runners: runners.RunnersResource + personal_access_tokens: personal_access_tokens.PersonalAccessTokensResource with_raw_response: GitpodWithRawResponse with_streaming_response: GitpodWithStreamedResponse @@ -102,18 +106,18 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.services = resources.ServicesResource(self) - self.automations_files = resources.AutomationsFilesResource(self) - self.tasks = resources.TasksResource(self) - self.environment_automations = resources.EnvironmentAutomationsResource(self) - self.environments = resources.EnvironmentsResource(self) - self.environment_classes = resources.EnvironmentClassesResource(self) - self.organizations = resources.OrganizationsResource(self) - self.projects = resources.ProjectsResource(self) - self.runner_configurations = resources.RunnerConfigurationsResource(self) - self.runner_interactions = resources.RunnerInteractionsResource(self) - self.runners = resources.RunnersResource(self) - self.personal_access_tokens = resources.PersonalAccessTokensResource(self) + self.services = services.ServicesResource(self) + self.automations_files = automations_files.AutomationsFilesResource(self) + self.tasks = tasks.TasksResource(self) + self.environment_automations = environment_automations.EnvironmentAutomationsResource(self) + self.environments = environments.EnvironmentsResource(self) + self.environment_classes = environment_classes.EnvironmentClassesResource(self) + self.organizations = organizations.OrganizationsResource(self) + self.projects = projects.ProjectsResource(self) + self.runner_configurations = runner_configurations.RunnerConfigurationsResource(self) + self.runner_interactions = runner_interactions.RunnerInteractionsResource(self) + self.runners = runners.RunnersResource(self) + self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResource(self) self.with_raw_response = GitpodWithRawResponse(self) self.with_streaming_response = GitpodWithStreamedResponse(self) @@ -215,18 +219,18 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): - services: resources.AsyncServicesResource - automations_files: resources.AsyncAutomationsFilesResource - tasks: resources.AsyncTasksResource - environment_automations: resources.AsyncEnvironmentAutomationsResource - environments: resources.AsyncEnvironmentsResource - environment_classes: resources.AsyncEnvironmentClassesResource - organizations: resources.AsyncOrganizationsResource - projects: resources.AsyncProjectsResource - runner_configurations: resources.AsyncRunnerConfigurationsResource - runner_interactions: resources.AsyncRunnerInteractionsResource - runners: resources.AsyncRunnersResource - personal_access_tokens: resources.AsyncPersonalAccessTokensResource + services: services.AsyncServicesResource + automations_files: automations_files.AsyncAutomationsFilesResource + tasks: tasks.AsyncTasksResource + environment_automations: environment_automations.AsyncEnvironmentAutomationsResource + environments: environments.AsyncEnvironmentsResource + environment_classes: environment_classes.AsyncEnvironmentClassesResource + organizations: organizations.AsyncOrganizationsResource + projects: projects.AsyncProjectsResource + runner_configurations: runner_configurations.AsyncRunnerConfigurationsResource + runner_interactions: runner_interactions.AsyncRunnerInteractionsResource + runners: runners.AsyncRunnersResource + personal_access_tokens: personal_access_tokens.AsyncPersonalAccessTokensResource with_raw_response: AsyncGitpodWithRawResponse with_streaming_response: AsyncGitpodWithStreamedResponse @@ -271,18 +275,18 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.services = resources.AsyncServicesResource(self) - self.automations_files = resources.AsyncAutomationsFilesResource(self) - self.tasks = resources.AsyncTasksResource(self) - self.environment_automations = resources.AsyncEnvironmentAutomationsResource(self) - self.environments = resources.AsyncEnvironmentsResource(self) - self.environment_classes = resources.AsyncEnvironmentClassesResource(self) - self.organizations = resources.AsyncOrganizationsResource(self) - self.projects = resources.AsyncProjectsResource(self) - self.runner_configurations = resources.AsyncRunnerConfigurationsResource(self) - self.runner_interactions = resources.AsyncRunnerInteractionsResource(self) - self.runners = resources.AsyncRunnersResource(self) - self.personal_access_tokens = resources.AsyncPersonalAccessTokensResource(self) + self.services = services.AsyncServicesResource(self) + self.automations_files = automations_files.AsyncAutomationsFilesResource(self) + self.tasks = tasks.AsyncTasksResource(self) + self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResource(self) + self.environments = environments.AsyncEnvironmentsResource(self) + self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self) + self.organizations = organizations.AsyncOrganizationsResource(self) + self.projects = projects.AsyncProjectsResource(self) + self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResource(self) + self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResource(self) + self.runners = runners.AsyncRunnersResource(self) + self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResource(self) self.with_raw_response = AsyncGitpodWithRawResponse(self) self.with_streaming_response = AsyncGitpodWithStreamedResponse(self) @@ -385,90 +389,110 @@ def _make_status_error( class GitpodWithRawResponse: def __init__(self, client: Gitpod) -> None: - self.services = resources.ServicesResourceWithRawResponse(client.services) - self.automations_files = resources.AutomationsFilesResourceWithRawResponse(client.automations_files) - self.tasks = resources.TasksResourceWithRawResponse(client.tasks) - self.environment_automations = resources.EnvironmentAutomationsResourceWithRawResponse( + self.services = services.ServicesResourceWithRawResponse(client.services) + self.automations_files = automations_files.AutomationsFilesResourceWithRawResponse(client.automations_files) + self.tasks = tasks.TasksResourceWithRawResponse(client.tasks) + self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) - self.environments = resources.EnvironmentsResourceWithRawResponse(client.environments) - self.environment_classes = resources.EnvironmentClassesResourceWithRawResponse(client.environment_classes) - self.organizations = resources.OrganizationsResourceWithRawResponse(client.organizations) - self.projects = resources.ProjectsResourceWithRawResponse(client.projects) - self.runner_configurations = resources.RunnerConfigurationsResourceWithRawResponse(client.runner_configurations) - self.runner_interactions = resources.RunnerInteractionsResourceWithRawResponse(client.runner_interactions) - self.runners = resources.RunnersResourceWithRawResponse(client.runners) - self.personal_access_tokens = resources.PersonalAccessTokensResourceWithRawResponse( + self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) + self.environment_classes = environment_classes.EnvironmentClassesResourceWithRawResponse( + client.environment_classes + ) + self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations) + self.projects = projects.ProjectsResourceWithRawResponse(client.projects) + self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithRawResponse( + client.runner_configurations + ) + self.runner_interactions = runner_interactions.RunnerInteractionsResourceWithRawResponse( + client.runner_interactions + ) + self.runners = runners.RunnersResourceWithRawResponse(client.runners) + self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens ) class AsyncGitpodWithRawResponse: def __init__(self, client: AsyncGitpod) -> None: - self.services = resources.AsyncServicesResourceWithRawResponse(client.services) - self.automations_files = resources.AsyncAutomationsFilesResourceWithRawResponse(client.automations_files) - self.tasks = resources.AsyncTasksResourceWithRawResponse(client.tasks) - self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithRawResponse( + self.services = services.AsyncServicesResourceWithRawResponse(client.services) + self.automations_files = automations_files.AsyncAutomationsFilesResourceWithRawResponse( + client.automations_files + ) + self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks) + self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) - self.environments = resources.AsyncEnvironmentsResourceWithRawResponse(client.environments) - self.environment_classes = resources.AsyncEnvironmentClassesResourceWithRawResponse(client.environment_classes) - self.organizations = resources.AsyncOrganizationsResourceWithRawResponse(client.organizations) - self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) - self.runner_configurations = resources.AsyncRunnerConfigurationsResourceWithRawResponse( + self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) + self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithRawResponse( + client.environment_classes + ) + self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations) + self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) + self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithRawResponse( client.runner_configurations ) - self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithRawResponse(client.runner_interactions) - self.runners = resources.AsyncRunnersResourceWithRawResponse(client.runners) - self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithRawResponse( + self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResourceWithRawResponse( + client.runner_interactions + ) + self.runners = runners.AsyncRunnersResourceWithRawResponse(client.runners) + self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens ) class GitpodWithStreamedResponse: def __init__(self, client: Gitpod) -> None: - self.services = resources.ServicesResourceWithStreamingResponse(client.services) - self.automations_files = resources.AutomationsFilesResourceWithStreamingResponse(client.automations_files) - self.tasks = resources.TasksResourceWithStreamingResponse(client.tasks) - self.environment_automations = resources.EnvironmentAutomationsResourceWithStreamingResponse( + self.services = services.ServicesResourceWithStreamingResponse(client.services) + self.automations_files = automations_files.AutomationsFilesResourceWithStreamingResponse( + client.automations_files + ) + self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks) + self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) - self.environments = resources.EnvironmentsResourceWithStreamingResponse(client.environments) - self.environment_classes = resources.EnvironmentClassesResourceWithStreamingResponse(client.environment_classes) - self.organizations = resources.OrganizationsResourceWithStreamingResponse(client.organizations) - self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) - self.runner_configurations = resources.RunnerConfigurationsResourceWithStreamingResponse( + self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) + self.environment_classes = environment_classes.EnvironmentClassesResourceWithStreamingResponse( + client.environment_classes + ) + self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations) + self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) + self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithStreamingResponse( client.runner_configurations ) - self.runner_interactions = resources.RunnerInteractionsResourceWithStreamingResponse(client.runner_interactions) - self.runners = resources.RunnersResourceWithStreamingResponse(client.runners) - self.personal_access_tokens = resources.PersonalAccessTokensResourceWithStreamingResponse( + self.runner_interactions = runner_interactions.RunnerInteractionsResourceWithStreamingResponse( + client.runner_interactions + ) + self.runners = runners.RunnersResourceWithStreamingResponse(client.runners) + self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens ) class AsyncGitpodWithStreamedResponse: def __init__(self, client: AsyncGitpod) -> None: - self.services = resources.AsyncServicesResourceWithStreamingResponse(client.services) - self.automations_files = resources.AsyncAutomationsFilesResourceWithStreamingResponse(client.automations_files) - self.tasks = resources.AsyncTasksResourceWithStreamingResponse(client.tasks) - self.environment_automations = resources.AsyncEnvironmentAutomationsResourceWithStreamingResponse( + self.services = services.AsyncServicesResourceWithStreamingResponse(client.services) + self.automations_files = automations_files.AsyncAutomationsFilesResourceWithStreamingResponse( + client.automations_files + ) + self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks) + self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) - self.environments = resources.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) - self.environment_classes = resources.AsyncEnvironmentClassesResourceWithStreamingResponse( + self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) + self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithStreamingResponse( client.environment_classes ) - self.organizations = resources.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) - self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) - self.runner_configurations = resources.AsyncRunnerConfigurationsResourceWithStreamingResponse( + self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) + self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) + self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithStreamingResponse( client.runner_configurations ) - self.runner_interactions = resources.AsyncRunnerInteractionsResourceWithStreamingResponse( + self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResourceWithStreamingResponse( client.runner_interactions ) - self.runners = resources.AsyncRunnersResourceWithStreamingResponse(client.runners) - self.personal_access_tokens = resources.AsyncPersonalAccessTokensResourceWithStreamingResponse( + self.runners = runners.AsyncRunnersResourceWithStreamingResponse(client.runners) + self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens ) From a58033e2a9b4a6dcbc09fc3923a7e6dca80b5e53 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 04:18:19 +0000 Subject: [PATCH 021/505] docs(readme): example snippet for client context manager --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0d12171b..c08d217b 100644 --- a/README.md +++ b/README.md @@ -296,6 +296,16 @@ client.with_options(http_client=DefaultHttpxClient(...)) By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. +```py +from gitpod import Gitpod + +with Gitpod() as client: + # make requests here + ... + +# HTTP client is now closed +``` + ## Versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: From 009bb8d14648cbc07a9df892bf4c79a662a03cf8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 04:19:26 +0000 Subject: [PATCH 022/505] chore(internal): fix some typos --- tests/test_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 753b0feb..f49d0d39 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -313,11 +313,11 @@ def test_default_query_option(self) -> None: FinalRequestOptions( method="get", url="/foo", - params={"foo": "baz", "query_param": "overriden"}, + params={"foo": "baz", "query_param": "overridden"}, ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} def test_request_extra_json(self) -> None: request = self.client._build_request( @@ -1042,11 +1042,11 @@ def test_default_query_option(self) -> None: FinalRequestOptions( method="get", url="/foo", - params={"foo": "baz", "query_param": "overriden"}, + params={"foo": "baz", "query_param": "overridden"}, ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} def test_request_extra_json(self) -> None: request = self.client._build_request( From 51c80cc9a648db59c72084fb2244a9156c1baab6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 04:12:36 +0000 Subject: [PATCH 023/505] chore(internal): codegen related update --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 4d4c7f9c..01fd4f23 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Gitpod + Copyright 2025 Gitpod Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 77ee49b220eaf5e58a087a88157665061a346412 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 04:19:35 +0000 Subject: [PATCH 024/505] chore: add missing isclass check --- src/gitpod/_models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 7a547ce5..d56ea1d9 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -488,7 +488,11 @@ def construct_type(*, value: object, type_: object) -> object: _, items_type = get_args(type_) # Dict[_, items_type] return {key: construct_type(value=item, type_=items_type) for key, item in value.items()} - if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)): + if ( + not is_literal_type(type_) + and inspect.isclass(origin) + and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)) + ): if is_list(value): return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value] From 240943daec6602605ed468b76b26902d870b6e88 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 04:15:40 +0000 Subject: [PATCH 025/505] chore(internal): bump httpx dependency --- pyproject.toml | 2 +- requirements-dev.lock | 5 ++--- requirements.lock | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4b41b836..dec24b08 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - "nest_asyncio==1.6.0" + "nest_asyncio==1.6.0", ] [tool.rye.scripts] diff --git a/requirements-dev.lock b/requirements-dev.lock index d047e259..8ce360c9 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -35,7 +35,7 @@ h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx -httpx==0.25.2 +httpx==0.28.1 # via gitpod # via respx idna==3.4 @@ -76,7 +76,7 @@ python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 # via dirty-equals -respx==0.20.2 +respx==0.22.0 rich==13.7.1 ruff==0.6.9 setuptools==68.2.2 @@ -86,7 +86,6 @@ six==1.16.0 sniffio==1.3.0 # via anyio # via gitpod - # via httpx time-machine==2.9.0 tomli==2.0.2 # via mypy diff --git a/requirements.lock b/requirements.lock index 7e0380a4..2699011b 100644 --- a/requirements.lock +++ b/requirements.lock @@ -25,7 +25,7 @@ h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx -httpx==0.25.2 +httpx==0.28.1 # via gitpod idna==3.4 # via anyio @@ -37,7 +37,6 @@ pydantic-core==2.27.1 sniffio==1.3.0 # via anyio # via gitpod - # via httpx typing-extensions==4.12.2 # via anyio # via gitpod From 60c26f1537ea7182e863abf0389652ba7d009378 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 04:19:03 +0000 Subject: [PATCH 026/505] chore(internal): update examples --- tests/api_resources/test_environments.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 2703867e..171140aa 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -69,7 +69,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "value": "value", } ], - "timeout": {"disconnected": "disconnected"}, + "timeout": {"disconnected": "+9125115.360s"}, }, connect_timeout_ms=0, ) @@ -237,7 +237,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "value": "value", } ], - "timeout": {"disconnected": "disconnected"}, + "timeout": {"disconnected": "+9125115.360s"}, }, connect_timeout_ms=0, ) @@ -358,7 +358,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "value": "value", } ], - "timeout": {"disconnected": "disconnected"}, + "timeout": {"disconnected": "+9125115.360s"}, }, connect_timeout_ms=0, ) @@ -526,7 +526,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "value": "value", } ], - "timeout": {"disconnected": "disconnected"}, + "timeout": {"disconnected": "+9125115.360s"}, }, connect_timeout_ms=0, ) From 1701d9008c09e78b211d5c63bd34e5cb209165dc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 04:19:28 +0000 Subject: [PATCH 027/505] fix(client): only call .close() when needed --- src/gitpod/_base_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 92ad9e5b..6e59c860 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -767,6 +767,9 @@ def __init__(self, **kwargs: Any) -> None: class SyncHttpxClientWrapper(DefaultHttpxClient): def __del__(self) -> None: + if self.is_closed: + return + try: self.close() except Exception: @@ -1334,6 +1337,9 @@ def __init__(self, **kwargs: Any) -> None: class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): def __del__(self) -> None: + if self.is_closed: + return + try: # TODO(someday): support non asyncio runtimes here asyncio.get_running_loop().create_task(self.aclose()) From d62441c1216f342e429c6847f913b5a1946b02eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 04:15:36 +0000 Subject: [PATCH 028/505] docs: fix typos --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c08d217b..149ff9a5 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ except gitpod.APIStatusError as e: print(e.response) ``` -Error codes are as followed: +Error codes are as follows: | Status Code | Error Type | | ----------- | -------------------------- | @@ -238,8 +238,7 @@ If you need to access undocumented endpoints, params, or response properties, th #### Undocumented endpoints To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other -http verbs. Options on the client will be respected (such as retries) will be respected when making this -request. +http verbs. Options on the client will be respected (such as retries) when making this request. ```py import httpx From 1e7564a042924c141409549ee6371971bdace159 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 04:16:41 +0000 Subject: [PATCH 029/505] chore(internal): codegen related update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 149ff9a5..04e31882 100644 --- a/README.md +++ b/README.md @@ -310,7 +310,7 @@ with Gitpod() as client: This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: 1. Changes that only affect static types, without breaking runtime behavior. -2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_ 3. Changes that we do not expect to impact the vast majority of users in practice. We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. From 955bab1651278d1aff9b2b8a831f886b6623cad1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 04:35:08 +0000 Subject: [PATCH 030/505] fix(api): better support union schemas with common properties --- .../host_authentication_tokens.py | 105 +-- .../runner_configurations.py | 216 +----- .../runner_interactions.py | 361 +--------- .../task_create_list_response.py | 18 +- .../task_execution_create_list_response.py | 7 +- ...task_execution_create_retrieve_response.py | 7 +- .../task_execution_list_response.py | 7 +- .../task_execution_retrieve_response.py | 7 +- ...ion_update_task_execution_status_params.py | 9 +- .../task_list_response.py | 18 +- .../task_start_response.py | 7 +- .../task_update_params.py | 9 +- .../environment_create_from_project_params.py | 14 +- ...nvironment_create_from_project_response.py | 14 +- src/gitpod/types/environment_create_params.py | 14 +- .../types/environment_create_response.py | 14 +- src/gitpod/types/environment_list_response.py | 14 +- .../types/environment_retrieve_response.py | 14 +- ...roject_create_from_environment_response.py | 7 +- src/gitpod/types/project_create_params.py | 8 +- src/gitpod/types/project_create_response.py | 7 +- src/gitpod/types/project_retrieve_response.py | 7 +- .../runner_configuration_validate_params.py | 32 +- .../runner_configuration_validate_response.py | 6 +- .../configuration_schema_create_response.py | 28 +- .../configuration_schema_retrieve_response.py | 28 +- .../environment_class_update_params.py | 9 +- .../host_authentication_token_list_params.py | 9 +- ...host_authentication_token_update_params.py | 22 +- .../scm_integration_create_params.py | 9 +- ...n_list_runner_scm_integrations_response.py | 10 +- ...runner_interaction_send_response_params.py | 70 +- ...date_runner_configuration_schema_params.py | 20 +- ...runner_interaction_update_status_params.py | 9 +- .../environment_list_response.py | 14 +- .../environment_retrieve_response.py | 14 +- .../types/runner_update_runner_params.py | 9 +- .../types/service_list_create_response.py | 7 +- src/gitpod/types/service_list_response.py | 7 +- src/gitpod/types/service_update_params.py | 15 +- src/gitpod/types/task_create_params.py | 8 +- src/gitpod/types/task_create_response.py | 10 +- .../types/task_retrieve_create_response.py | 17 +- src/gitpod/types/task_retrieve_response.py | 10 +- .../test_host_authentication_tokens.py | 112 +-- tests/api_resources/test_environments.py | 104 ++- tests/api_resources/test_projects.py | 30 +- .../test_runner_configurations.py | 224 ++---- .../api_resources/test_runner_interactions.py | 638 ++++++------------ tests/api_resources/test_tasks.py | 16 +- 50 files changed, 771 insertions(+), 1600 deletions(-) diff --git a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py index fb9308fa..15eec02d 100644 --- a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py @@ -2,14 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -173,11 +172,10 @@ def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) - @overload def update( self, *, - body: object, + body: host_authentication_token_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -203,54 +201,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["body", "connect_protocol_version"]) - def update( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -505,11 +455,10 @@ async def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) - @overload async def update( self, *, - body: object, + body: host_authentication_token_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -535,54 +484,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["body", "connect_protocol_version"]) - async def update( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { diff --git a/src/gitpod/resources/runner_configurations/runner_configurations.py b/src/gitpod/resources/runner_configurations/runner_configurations.py index f19aa8fc..bc7eecd5 100644 --- a/src/gitpod/resources/runner_configurations/runner_configurations.py +++ b/src/gitpod/resources/runner_configurations/runner_configurations.py @@ -2,8 +2,7 @@ from __future__ import annotations -from typing import Any, cast -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx @@ -11,7 +10,6 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -98,11 +96,10 @@ def with_streaming_response(self) -> RunnerConfigurationsResourceWithStreamingRe """ return RunnerConfigurationsResourceWithStreamingResponse(self) - @overload def validate( self, *, - body: object, + body: runner_configuration_validate_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -130,90 +127,6 @@ def validate( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def validate( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. - - environment - class, SCM integration) with the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def validate( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. - - environment - class, SCM integration) with the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["body", "connect_protocol_version"]) - def validate( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: extra_headers = { **strip_not_given( { @@ -223,18 +136,13 @@ def validate( ), **(extra_headers or {}), } - return cast( - RunnerConfigurationValidateResponse, - self._post( - "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", - body=maybe_transform(body, runner_configuration_validate_params.RunnerConfigurationValidateParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast( - Any, RunnerConfigurationValidateResponse - ), # Union types cannot be passed in as arguments in the type system + return self._post( + "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", + body=maybe_transform(body, runner_configuration_validate_params.RunnerConfigurationValidateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + cast_to=RunnerConfigurationValidateResponse, ) @@ -274,11 +182,10 @@ def with_streaming_response(self) -> AsyncRunnerConfigurationsResourceWithStream """ return AsyncRunnerConfigurationsResourceWithStreamingResponse(self) - @overload async def validate( self, *, - body: object, + body: runner_configuration_validate_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -306,90 +213,6 @@ async def validate( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def validate( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. - - environment - class, SCM integration) with the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def validate( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. - - environment - class, SCM integration) with the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["body", "connect_protocol_version"]) - async def validate( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: extra_headers = { **strip_not_given( { @@ -399,20 +222,15 @@ async def validate( ), **(extra_headers or {}), } - return cast( - RunnerConfigurationValidateResponse, - await self._post( - "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", - body=await async_maybe_transform( - body, runner_configuration_validate_params.RunnerConfigurationValidateParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast( - Any, RunnerConfigurationValidateResponse - ), # Union types cannot be passed in as arguments in the type system + return await self._post( + "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", + body=await async_maybe_transform( + body, runner_configuration_validate_params.RunnerConfigurationValidateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + cast_to=RunnerConfigurationValidateResponse, ) diff --git a/src/gitpod/resources/runner_interactions/runner_interactions.py b/src/gitpod/resources/runner_interactions/runner_interactions.py index 6d74805a..d4e1f9d3 100644 --- a/src/gitpod/resources/runner_interactions/runner_interactions.py +++ b/src/gitpod/resources/runner_interactions/runner_interactions.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx @@ -28,7 +28,6 @@ ) from ..._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -388,11 +387,10 @@ def mark_active( cast_to=object, ) - @overload def send_response( self, *, - body: object, + body: runner_interaction_send_response_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -418,182 +416,6 @@ def send_response( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["body", "connect_protocol_version"]) - def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -1102,11 +924,10 @@ async def mark_active( cast_to=object, ) - @overload async def send_response( self, *, - body: object, + body: runner_interaction_send_response_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1132,182 +953,6 @@ async def send_response( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["body", "connect_protocol_version"]) - async def send_response( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { diff --git a/src/gitpod/types/environment_automations/task_create_list_response.py b/src/gitpod/types/environment_automations/task_create_list_response.py index fdf76ae2..bb3c3d49 100644 --- a/src/gitpod/types/environment_automations/task_create_list_response.py +++ b/src/gitpod/types/environment_automations/task_create_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -8,7 +8,15 @@ from ..._models import BaseModel -__all__ = ["TaskCreateListResponse", "Pagination", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] +__all__ = [ + "TaskCreateListResponse", + "Pagination", + "Task", + "TaskMetadata", + "TaskMetadataCreator", + "TaskMetadataTriggeredBy", + "TaskSpec", +] class Pagination(BaseModel): @@ -36,6 +44,10 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" +class TaskMetadataTriggeredBy: + pass + + class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ @@ -152,7 +164,7 @@ class TaskMetadata(BaseModel): the task in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the task.""" diff --git a/src/gitpod/types/environment_automations/task_execution_create_list_response.py b/src/gitpod/types/environment_automations/task_execution_create_list_response.py index d9695004..8550a451 100644 --- a/src/gitpod/types/environment_automations/task_execution_create_list_response.py +++ b/src/gitpod/types/environment_automations/task_execution_create_list_response.py @@ -16,6 +16,7 @@ "TaskExecutionMetadataCreator", "TaskExecutionSpec", "TaskExecutionSpecPlan", + "TaskExecutionSpecPlanStep", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -336,8 +337,12 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" +class TaskExecutionSpecPlanStep: + pass + + class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[Union[object, object, object]]] = None + steps: Optional[List[TaskExecutionSpecPlanStep]] = None class TaskExecutionSpec(BaseModel): diff --git a/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py b/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py index 5a0ca7bb..d26a33b1 100644 --- a/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py +++ b/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py @@ -15,6 +15,7 @@ "TaskExecutionMetadataCreator", "TaskExecutionSpec", "TaskExecutionSpecPlan", + "TaskExecutionSpecPlanStep", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -327,8 +328,12 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" +class TaskExecutionSpecPlanStep: + pass + + class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[Union[object, object, object]]] = None + steps: Optional[List[TaskExecutionSpecPlanStep]] = None class TaskExecutionSpec(BaseModel): diff --git a/src/gitpod/types/environment_automations/task_execution_list_response.py b/src/gitpod/types/environment_automations/task_execution_list_response.py index 4b201f86..60048a2b 100644 --- a/src/gitpod/types/environment_automations/task_execution_list_response.py +++ b/src/gitpod/types/environment_automations/task_execution_list_response.py @@ -16,6 +16,7 @@ "TaskExecutionMetadataCreator", "TaskExecutionSpec", "TaskExecutionSpecPlan", + "TaskExecutionSpecPlanStep", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -336,8 +337,12 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" +class TaskExecutionSpecPlanStep: + pass + + class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[Union[object, object, object]]] = None + steps: Optional[List[TaskExecutionSpecPlanStep]] = None class TaskExecutionSpec(BaseModel): diff --git a/src/gitpod/types/environment_automations/task_execution_retrieve_response.py b/src/gitpod/types/environment_automations/task_execution_retrieve_response.py index 1e81e276..2da79f54 100644 --- a/src/gitpod/types/environment_automations/task_execution_retrieve_response.py +++ b/src/gitpod/types/environment_automations/task_execution_retrieve_response.py @@ -15,6 +15,7 @@ "TaskExecutionMetadataCreator", "TaskExecutionSpec", "TaskExecutionSpecPlan", + "TaskExecutionSpecPlanStep", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -327,8 +328,12 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" +class TaskExecutionSpecPlanStep: + pass + + class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[Union[object, object, object]]] = None + steps: Optional[List[TaskExecutionSpecPlanStep]] = None class TaskExecutionSpec(BaseModel): diff --git a/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py b/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py index dda988a7..9fa24822 100644 --- a/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py +++ b/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py @@ -5,16 +5,19 @@ from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -from ...types.environment_automations import task_execution_update_task_execution_status_params -__all__ = ["TaskExecutionUpdateTaskExecutionStatusParams"] +__all__ = ["TaskExecutionUpdateTaskExecutionStatusParams", "Body"] class TaskExecutionUpdateTaskExecutionStatusParams(TypedDict, total=False): - body: Required[task_execution_update_task_execution_status_params.Body] + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" + + +class Body: + pass diff --git a/src/gitpod/types/environment_automations/task_list_response.py b/src/gitpod/types/environment_automations/task_list_response.py index e73d0fe7..1ef850b9 100644 --- a/src/gitpod/types/environment_automations/task_list_response.py +++ b/src/gitpod/types/environment_automations/task_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -8,7 +8,15 @@ from ..._models import BaseModel -__all__ = ["TaskListResponse", "Pagination", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] +__all__ = [ + "TaskListResponse", + "Pagination", + "Task", + "TaskMetadata", + "TaskMetadataCreator", + "TaskMetadataTriggeredBy", + "TaskSpec", +] class Pagination(BaseModel): @@ -36,6 +44,10 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" +class TaskMetadataTriggeredBy: + pass + + class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ @@ -152,7 +164,7 @@ class TaskMetadata(BaseModel): the task in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the task.""" diff --git a/src/gitpod/types/environment_automations/task_start_response.py b/src/gitpod/types/environment_automations/task_start_response.py index d54b3807..415e447a 100644 --- a/src/gitpod/types/environment_automations/task_start_response.py +++ b/src/gitpod/types/environment_automations/task_start_response.py @@ -15,6 +15,7 @@ "TaskExecutionMetadataCreator", "TaskExecutionSpec", "TaskExecutionSpecPlan", + "TaskExecutionSpecPlanStep", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -327,8 +328,12 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" +class TaskExecutionSpecPlanStep: + pass + + class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[Union[object, object, object]]] = None + steps: Optional[List[TaskExecutionSpecPlanStep]] = None class TaskExecutionSpec(BaseModel): diff --git a/src/gitpod/types/environment_automations/task_update_params.py b/src/gitpod/types/environment_automations/task_update_params.py index c4658fc6..b89872fc 100644 --- a/src/gitpod/types/environment_automations/task_update_params.py +++ b/src/gitpod/types/environment_automations/task_update_params.py @@ -6,9 +6,8 @@ from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -from ...types.environment_automations import task_update_params -__all__ = ["TaskUpdateParams"] +__all__ = ["TaskUpdateParams", "Metadata"] class TaskUpdateParams(TypedDict, total=False): @@ -20,9 +19,13 @@ class TaskUpdateParams(TypedDict, total=False): depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] """dependencies specifies the IDs of the automations this task depends on.""" - metadata: task_update_params.Metadata + metadata: Metadata spec: Union[object, object] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" + + +class Metadata: + pass diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index bea4167e..b4269a08 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -13,9 +13,11 @@ "SpecAutomationsFile", "SpecContent", "SpecContentInitializer", + "SpecContentInitializerSpec", "SpecDevcontainer", "SpecMachine", "SpecPort", + "SpecSecret", "SpecSSHPublicKey", "SpecTimeout", ] @@ -47,8 +49,12 @@ class SpecAutomationsFile(TypedDict, total=False): session: str +class SpecContentInitializerSpec: + pass + + class SpecContentInitializer(TypedDict, total=False): - specs: Iterable[Union[object, object, object]] + specs: Iterable[SpecContentInitializerSpec] class SpecContent(TypedDict, total=False): @@ -98,6 +104,10 @@ class SpecPort(TypedDict, total=False): """port number""" +class SpecSecret: + pass + + class SpecSSHPublicKey(TypedDict, total=False): id: str """id is the unique identifier of the public key""" @@ -204,7 +214,7 @@ class Spec(TypedDict, total=False): ports: Iterable[SpecPort] """ports is the set of ports which ought to be exposed to the internet""" - secrets: Iterable[Union[object, object, object, object]] + secrets: Iterable[SpecSecret] """secrets are confidential data that is mounted into the environment""" spec_version: Annotated[Union[str, float], PropertyInfo(alias="specVersion")] diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index 4c362490..4cc06297 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -17,9 +17,11 @@ "EnvironmentSpecAutomationsFile", "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", + "EnvironmentSpecContentInitializerSpec", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", + "EnvironmentSpecSecret", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -190,8 +192,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None +class EnvironmentSpecContentInitializerSpec: + pass + + class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[Union[object, object, object]]] = None + specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None class EnvironmentSpecContent(BaseModel): @@ -237,6 +243,10 @@ class EnvironmentSpecPort(BaseModel): """port number""" +class EnvironmentSpecSecret: + pass + + class EnvironmentSpecSSHPublicKey(BaseModel): id: Optional[str] = None """id is the unique identifier of the public key""" @@ -344,7 +354,7 @@ class EnvironmentSpec(BaseModel): ports: Optional[List[EnvironmentSpecPort]] = None """ports is the set of ports which ought to be exposed to the internet""" - secrets: Optional[List[Union[object, object, object, object]]] = None + secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index c1b47dba..1b11b976 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -13,9 +13,11 @@ "SpecAutomationsFile", "SpecContent", "SpecContentInitializer", + "SpecContentInitializerSpec", "SpecDevcontainer", "SpecMachine", "SpecPort", + "SpecSecret", "SpecSSHPublicKey", "SpecTimeout", ] @@ -45,8 +47,12 @@ class SpecAutomationsFile(TypedDict, total=False): session: str +class SpecContentInitializerSpec: + pass + + class SpecContentInitializer(TypedDict, total=False): - specs: Iterable[Union[object, object, object]] + specs: Iterable[SpecContentInitializerSpec] class SpecContent(TypedDict, total=False): @@ -96,6 +102,10 @@ class SpecPort(TypedDict, total=False): """port number""" +class SpecSecret: + pass + + class SpecSSHPublicKey(TypedDict, total=False): id: str """id is the unique identifier of the public key""" @@ -202,7 +212,7 @@ class Spec(TypedDict, total=False): ports: Iterable[SpecPort] """ports is the set of ports which ought to be exposed to the internet""" - secrets: Iterable[Union[object, object, object, object]] + secrets: Iterable[SpecSecret] """secrets are confidential data that is mounted into the environment""" spec_version: Annotated[Union[str, float], PropertyInfo(alias="specVersion")] diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index c622ca32..ca2b1df5 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -17,9 +17,11 @@ "EnvironmentSpecAutomationsFile", "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", + "EnvironmentSpecContentInitializerSpec", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", + "EnvironmentSpecSecret", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -190,8 +192,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None +class EnvironmentSpecContentInitializerSpec: + pass + + class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[Union[object, object, object]]] = None + specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None class EnvironmentSpecContent(BaseModel): @@ -237,6 +243,10 @@ class EnvironmentSpecPort(BaseModel): """port number""" +class EnvironmentSpecSecret: + pass + + class EnvironmentSpecSSHPublicKey(BaseModel): id: Optional[str] = None """id is the unique identifier of the public key""" @@ -344,7 +354,7 @@ class EnvironmentSpec(BaseModel): ports: Optional[List[EnvironmentSpecPort]] = None """ports is the set of ports which ought to be exposed to the internet""" - secrets: Optional[List[Union[object, object, object, object]]] = None + secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py index 110ddb59..bb11b143 100644 --- a/src/gitpod/types/environment_list_response.py +++ b/src/gitpod/types/environment_list_response.py @@ -17,9 +17,11 @@ "EnvironmentSpecAutomationsFile", "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", + "EnvironmentSpecContentInitializerSpec", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", + "EnvironmentSpecSecret", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -191,8 +193,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None +class EnvironmentSpecContentInitializerSpec: + pass + + class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[Union[object, object, object]]] = None + specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None class EnvironmentSpecContent(BaseModel): @@ -238,6 +244,10 @@ class EnvironmentSpecPort(BaseModel): """port number""" +class EnvironmentSpecSecret: + pass + + class EnvironmentSpecSSHPublicKey(BaseModel): id: Optional[str] = None """id is the unique identifier of the public key""" @@ -345,7 +355,7 @@ class EnvironmentSpec(BaseModel): ports: Optional[List[EnvironmentSpecPort]] = None """ports is the set of ports which ought to be exposed to the internet""" - secrets: Optional[List[Union[object, object, object, object]]] = None + secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index fc2eab03..c603be06 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -17,9 +17,11 @@ "EnvironmentSpecAutomationsFile", "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", + "EnvironmentSpecContentInitializerSpec", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", + "EnvironmentSpecSecret", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -190,8 +192,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None +class EnvironmentSpecContentInitializerSpec: + pass + + class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[Union[object, object, object]]] = None + specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None class EnvironmentSpecContent(BaseModel): @@ -237,6 +243,10 @@ class EnvironmentSpecPort(BaseModel): """port number""" +class EnvironmentSpecSecret: + pass + + class EnvironmentSpecSSHPublicKey(BaseModel): id: Optional[str] = None """id is the unique identifier of the public key""" @@ -344,7 +354,7 @@ class EnvironmentSpec(BaseModel): ports: Optional[List[EnvironmentSpecPort]] = None """ports is the set of ports which ought to be exposed to the internet""" - secrets: Optional[List[Union[object, object, object, object]]] = None + secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py index 3bf6e1b3..6a9e0ca7 100644 --- a/src/gitpod/types/project_create_from_environment_response.py +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -12,6 +12,7 @@ "ProjectCreateFromEnvironmentResponse", "Project", "ProjectInitializer", + "ProjectInitializerSpec", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -19,8 +20,12 @@ ] +class ProjectInitializerSpec: + pass + + class ProjectInitializer(BaseModel): - specs: Optional[List[Union[object, object, object]]] = None + specs: Optional[List[ProjectInitializerSpec]] = None class ProjectMetadataCreator(BaseModel): diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index 03fcad08..83d88cb9 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -7,7 +7,7 @@ from .._utils import PropertyInfo -__all__ = ["ProjectCreateParams", "Initializer"] +__all__ = ["ProjectCreateParams", "Initializer", "InitializerSpec"] class ProjectCreateParams(TypedDict, total=False): @@ -37,5 +37,9 @@ class ProjectCreateParams(TypedDict, total=False): """Define the timeout, in ms""" +class InitializerSpec: + pass + + class Initializer(TypedDict, total=False): - specs: Iterable[Union[object, object, object]] + specs: Iterable[InitializerSpec] diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py index 97278748..2ca765f0 100644 --- a/src/gitpod/types/project_create_response.py +++ b/src/gitpod/types/project_create_response.py @@ -12,6 +12,7 @@ "ProjectCreateResponse", "Project", "ProjectInitializer", + "ProjectInitializerSpec", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -19,8 +20,12 @@ ] +class ProjectInitializerSpec: + pass + + class ProjectInitializer(BaseModel): - specs: Optional[List[Union[object, object, object]]] = None + specs: Optional[List[ProjectInitializerSpec]] = None class ProjectMetadataCreator(BaseModel): diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py index df9cb4a1..524e6152 100644 --- a/src/gitpod/types/project_retrieve_response.py +++ b/src/gitpod/types/project_retrieve_response.py @@ -12,6 +12,7 @@ "ProjectRetrieveResponse", "Project", "ProjectInitializer", + "ProjectInitializerSpec", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -19,8 +20,12 @@ ] +class ProjectInitializerSpec: + pass + + class ProjectInitializer(BaseModel): - specs: Optional[List[Union[object, object, object]]] = None + specs: Optional[List[ProjectInitializerSpec]] = None class ProjectMetadataCreator(BaseModel): diff --git a/src/gitpod/types/runner_configuration_validate_params.py b/src/gitpod/types/runner_configuration_validate_params.py index 5f440dce..b6b19213 100644 --- a/src/gitpod/types/runner_configuration_validate_params.py +++ b/src/gitpod/types/runner_configuration_validate_params.py @@ -2,16 +2,15 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["RunnerConfigurationValidateParams", "Variant0", "Variant1", "Variant2"] +__all__ = ["RunnerConfigurationValidateParams", "Body"] -class Variant0(TypedDict, total=False): - body: Required[object] +class RunnerConfigurationValidateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -20,24 +19,5 @@ class Variant0(TypedDict, total=False): """Define the timeout, in ms""" -class Variant1(TypedDict, total=False): - body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2(TypedDict, total=False): - body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -RunnerConfigurationValidateParams: TypeAlias = Union[Variant0, Variant1, Variant2] +class Body: + pass diff --git a/src/gitpod/types/runner_configuration_validate_response.py b/src/gitpod/types/runner_configuration_validate_response.py index 040bb7f5..26849219 100644 --- a/src/gitpod/types/runner_configuration_validate_response.py +++ b/src/gitpod/types/runner_configuration_validate_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union -from typing_extensions import TypeAlias __all__ = ["RunnerConfigurationValidateResponse"] -RunnerConfigurationValidateResponse: TypeAlias = Union[object, object, object] + +class RunnerConfigurationValidateResponse: + pass diff --git a/src/gitpod/types/runner_configurations/configuration_schema_create_response.py b/src/gitpod/types/runner_configurations/configuration_schema_create_response.py index 88c94cad..0222e259 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_create_response.py +++ b/src/gitpod/types/runner_configurations/configuration_schema_create_response.py @@ -1,12 +1,28 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from pydantic import Field as FieldInfo from ..._models import BaseModel -__all__ = ["ConfigurationSchemaCreateResponse", "Schema", "SchemaScm", "SchemaScmOAuth", "SchemaScmPat"] +__all__ = [ + "ConfigurationSchemaCreateResponse", + "Schema", + "SchemaEnvironmentClass", + "SchemaRunnerConfig", + "SchemaScm", + "SchemaScmOAuth", + "SchemaScmPat", +] + + +class SchemaEnvironmentClass: + pass + + +class SchemaRunnerConfig: + pass class SchemaScmOAuth(BaseModel): @@ -41,13 +57,9 @@ class SchemaScm(BaseModel): class Schema(BaseModel): - environment_classes: Optional[List[Union[object, object, object, object, object, object]]] = FieldInfo( - alias="environmentClasses", default=None - ) + environment_classes: Optional[List[SchemaEnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) - runner_config: Optional[List[Union[object, object, object, object, object, object]]] = FieldInfo( - alias="runnerConfig", default=None - ) + runner_config: Optional[List[SchemaRunnerConfig]] = FieldInfo(alias="runnerConfig", default=None) scm: Optional[List[SchemaScm]] = None diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py index 03cdbf6a..ac96d70f 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py +++ b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py @@ -1,12 +1,28 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from pydantic import Field as FieldInfo from ..._models import BaseModel -__all__ = ["ConfigurationSchemaRetrieveResponse", "Schema", "SchemaScm", "SchemaScmOAuth", "SchemaScmPat"] +__all__ = [ + "ConfigurationSchemaRetrieveResponse", + "Schema", + "SchemaEnvironmentClass", + "SchemaRunnerConfig", + "SchemaScm", + "SchemaScmOAuth", + "SchemaScmPat", +] + + +class SchemaEnvironmentClass: + pass + + +class SchemaRunnerConfig: + pass class SchemaScmOAuth(BaseModel): @@ -41,13 +57,9 @@ class SchemaScm(BaseModel): class Schema(BaseModel): - environment_classes: Optional[List[Union[object, object, object, object, object, object]]] = FieldInfo( - alias="environmentClasses", default=None - ) + environment_classes: Optional[List[SchemaEnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) - runner_config: Optional[List[Union[object, object, object, object, object, object]]] = FieldInfo( - alias="runnerConfig", default=None - ) + runner_config: Optional[List[SchemaRunnerConfig]] = FieldInfo(alias="runnerConfig", default=None) scm: Optional[List[SchemaScm]] = None diff --git a/src/gitpod/types/runner_configurations/environment_class_update_params.py b/src/gitpod/types/runner_configurations/environment_class_update_params.py index b4d6d8a3..fbd48e58 100644 --- a/src/gitpod/types/runner_configurations/environment_class_update_params.py +++ b/src/gitpod/types/runner_configurations/environment_class_update_params.py @@ -5,16 +5,19 @@ from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -from ...types.runner_configurations import environment_class_update_params -__all__ = ["EnvironmentClassUpdateParams"] +__all__ = ["EnvironmentClassUpdateParams", "Body"] class EnvironmentClassUpdateParams(TypedDict, total=False): - body: Required[environment_class_update_params.Body] + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" + + +class Body: + pass diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py index 5c9c596a..e8141dc5 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py @@ -5,16 +5,15 @@ from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -from ...types.runner_configurations import host_authentication_token_list_params -__all__ = ["HostAuthenticationTokenListParams", "Pagination"] +__all__ = ["HostAuthenticationTokenListParams", "Filter", "Pagination"] class HostAuthenticationTokenListParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: host_authentication_token_list_params.Filter + filter: Filter pagination: Pagination @@ -22,6 +21,10 @@ class HostAuthenticationTokenListParams(TypedDict, total=False): """Define the timeout, in ms""" +class Filter: + pass + + class Pagination(TypedDict, total=False): token: str """ diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py index adf4dd15..5dd0c59d 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py @@ -2,16 +2,15 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenUpdateParams", "Variant0", "Variant1"] +__all__ = ["HostAuthenticationTokenUpdateParams", "Body"] -class Variant0(TypedDict, total=False): - body: Required[object] +class HostAuthenticationTokenUpdateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -20,14 +19,5 @@ class Variant0(TypedDict, total=False): """Define the timeout, in ms""" -class Variant1(TypedDict, total=False): - body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -HostAuthenticationTokenUpdateParams: TypeAlias = Union[Variant0, Variant1] +class Body: + pass diff --git a/src/gitpod/types/runner_configurations/scm_integration_create_params.py b/src/gitpod/types/runner_configurations/scm_integration_create_params.py index 456f8f76..f9fcee84 100644 --- a/src/gitpod/types/runner_configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runner_configurations/scm_integration_create_params.py @@ -5,16 +5,19 @@ from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -from ...types.runner_configurations import scm_integration_create_params -__all__ = ["ScmIntegrationCreateParams"] +__all__ = ["ScmIntegrationCreateParams", "Body"] class ScmIntegrationCreateParams(TypedDict, total=False): - body: Required[scm_integration_create_params.Body] + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" + + +class Body: + pass diff --git a/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py b/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py index e6a747ab..1314f477 100644 --- a/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py +++ b/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["RunnerInteractionListRunnerScmIntegrationsResponse", "Pagination"] +__all__ = ["RunnerInteractionListRunnerScmIntegrationsResponse", "Pagination", "ScmIntegration"] class Pagination(BaseModel): @@ -17,9 +17,13 @@ class Pagination(BaseModel): """ +class ScmIntegration: + pass + + class RunnerInteractionListRunnerScmIntegrationsResponse(BaseModel): pagination: Optional[Pagination] = None """pagination contains the pagination options for listing SCM integrations""" - scm_integrations: Optional[List[Union[object, object]]] = FieldInfo(alias="scmIntegrations", default=None) + scm_integrations: Optional[List[ScmIntegration]] = FieldInfo(alias="scmIntegrations", default=None) """The SCM integrations configured for the runner""" diff --git a/src/gitpod/types/runner_interaction_send_response_params.py b/src/gitpod/types/runner_interaction_send_response_params.py index ea94fed1..9f1c24c3 100644 --- a/src/gitpod/types/runner_interaction_send_response_params.py +++ b/src/gitpod/types/runner_interaction_send_response_params.py @@ -2,24 +2,15 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = [ - "RunnerInteractionSendResponseParams", - "Variant0", - "Variant1", - "Variant2", - "Variant3", - "Variant4", - "Variant5", -] +__all__ = ["RunnerInteractionSendResponseParams", "Body"] -class Variant0(TypedDict, total=False): - body: Required[object] +class RunnerInteractionSendResponseParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -28,54 +19,5 @@ class Variant0(TypedDict, total=False): """Define the timeout, in ms""" -class Variant1(TypedDict, total=False): - body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2(TypedDict, total=False): - body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant3(TypedDict, total=False): - body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant4(TypedDict, total=False): - body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant5(TypedDict, total=False): - body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -RunnerInteractionSendResponseParams: TypeAlias = Union[Variant0, Variant1, Variant2, Variant3, Variant4, Variant5] +class Body: + pass diff --git a/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py b/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py index fb803bea..4b56dcf0 100644 --- a/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py +++ b/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import List, Iterable from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,6 +10,8 @@ __all__ = [ "RunnerInteractionUpdateRunnerConfigurationSchemaParams", "ConfigSchema", + "ConfigSchemaEnvironmentClass", + "ConfigSchemaRunnerConfig", "ConfigSchemaScm", "ConfigSchemaScmOAuth", "ConfigSchemaScmPat", @@ -30,6 +32,14 @@ class RunnerInteractionUpdateRunnerConfigurationSchemaParams(TypedDict, total=Fa """Define the timeout, in ms""" +class ConfigSchemaEnvironmentClass: + pass + + +class ConfigSchemaRunnerConfig: + pass + + class ConfigSchemaScmOAuth(TypedDict, total=False): callback_url: Annotated[str, PropertyInfo(alias="callbackUrl")] """ @@ -62,13 +72,9 @@ class ConfigSchemaScm(TypedDict, total=False): class ConfigSchema(TypedDict, total=False): - environment_classes: Annotated[ - Iterable[Union[object, object, object, object, object, object]], PropertyInfo(alias="environmentClasses") - ] + environment_classes: Annotated[Iterable[ConfigSchemaEnvironmentClass], PropertyInfo(alias="environmentClasses")] - runner_config: Annotated[ - Iterable[Union[object, object, object, object, object, object]], PropertyInfo(alias="runnerConfig") - ] + runner_config: Annotated[Iterable[ConfigSchemaRunnerConfig], PropertyInfo(alias="runnerConfig")] scm: Iterable[ConfigSchemaScm] diff --git a/src/gitpod/types/runner_interaction_update_status_params.py b/src/gitpod/types/runner_interaction_update_status_params.py index ae3666c9..c2502df4 100644 --- a/src/gitpod/types/runner_interaction_update_status_params.py +++ b/src/gitpod/types/runner_interaction_update_status_params.py @@ -4,17 +4,20 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ..types import runner_interaction_update_status_params from .._utils import PropertyInfo -__all__ = ["RunnerInteractionUpdateStatusParams"] +__all__ = ["RunnerInteractionUpdateStatusParams", "Body"] class RunnerInteractionUpdateStatusParams(TypedDict, total=False): - body: Required[runner_interaction_update_status_params.Body] + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" + + +class Body: + pass diff --git a/src/gitpod/types/runner_interactions/environment_list_response.py b/src/gitpod/types/runner_interactions/environment_list_response.py index f178ffc7..aca7c7cc 100644 --- a/src/gitpod/types/runner_interactions/environment_list_response.py +++ b/src/gitpod/types/runner_interactions/environment_list_response.py @@ -17,9 +17,11 @@ "EnvironmentSpecAutomationsFile", "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", + "EnvironmentSpecContentInitializerSpec", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", + "EnvironmentSpecSecret", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "Pagination", @@ -177,8 +179,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None +class EnvironmentSpecContentInitializerSpec: + pass + + class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[Union[object, object, object]]] = None + specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None class EnvironmentSpecContent(BaseModel): @@ -224,6 +230,10 @@ class EnvironmentSpecPort(BaseModel): """port number""" +class EnvironmentSpecSecret: + pass + + class EnvironmentSpecSSHPublicKey(BaseModel): id: Optional[str] = None """id is the unique identifier of the public key""" @@ -331,7 +341,7 @@ class EnvironmentSpec(BaseModel): ports: Optional[List[EnvironmentSpecPort]] = None """ports is the set of ports which ought to be exposed to the internet""" - secrets: Optional[List[Union[object, object, object, object]]] = None + secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) diff --git a/src/gitpod/types/runner_interactions/environment_retrieve_response.py b/src/gitpod/types/runner_interactions/environment_retrieve_response.py index 9294c99a..9c47a9bb 100644 --- a/src/gitpod/types/runner_interactions/environment_retrieve_response.py +++ b/src/gitpod/types/runner_interactions/environment_retrieve_response.py @@ -17,9 +17,11 @@ "EnvironmentSpecAutomationsFile", "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", + "EnvironmentSpecContentInitializerSpec", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", + "EnvironmentSpecSecret", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", ] @@ -176,8 +178,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None +class EnvironmentSpecContentInitializerSpec: + pass + + class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[Union[object, object, object]]] = None + specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None class EnvironmentSpecContent(BaseModel): @@ -223,6 +229,10 @@ class EnvironmentSpecPort(BaseModel): """port number""" +class EnvironmentSpecSecret: + pass + + class EnvironmentSpecSSHPublicKey(BaseModel): id: Optional[str] = None """id is the unique identifier of the public key""" @@ -330,7 +340,7 @@ class EnvironmentSpec(BaseModel): ports: Optional[List[EnvironmentSpecPort]] = None """ports is the set of ports which ought to be exposed to the internet""" - secrets: Optional[List[Union[object, object, object, object]]] = None + secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) diff --git a/src/gitpod/types/runner_update_runner_params.py b/src/gitpod/types/runner_update_runner_params.py index cafdbece..6295fc6c 100644 --- a/src/gitpod/types/runner_update_runner_params.py +++ b/src/gitpod/types/runner_update_runner_params.py @@ -4,17 +4,20 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ..types import runner_update_runner_params from .._utils import PropertyInfo -__all__ = ["RunnerUpdateRunnerParams"] +__all__ = ["RunnerUpdateRunnerParams", "Body"] class RunnerUpdateRunnerParams(TypedDict, total=False): - body: Required[runner_update_runner_params.Body] + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" + + +class Body: + pass diff --git a/src/gitpod/types/service_list_create_response.py b/src/gitpod/types/service_list_create_response.py index 81bfb8ce..e9d3190e 100644 --- a/src/gitpod/types/service_list_create_response.py +++ b/src/gitpod/types/service_list_create_response.py @@ -14,6 +14,7 @@ "Service", "ServiceMetadata", "ServiceMetadataCreator", + "ServiceMetadataTriggeredBy", "ServiceSpec", "ServiceSpecCommands", "ServiceStatus", @@ -45,6 +46,10 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" +class ServiceMetadataTriggeredBy: + pass + + class ServiceMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ @@ -161,7 +166,7 @@ class ServiceMetadata(BaseModel): identify the service in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/service_list_response.py b/src/gitpod/types/service_list_response.py index 42506210..2057aa8b 100644 --- a/src/gitpod/types/service_list_response.py +++ b/src/gitpod/types/service_list_response.py @@ -14,6 +14,7 @@ "Service", "ServiceMetadata", "ServiceMetadataCreator", + "ServiceMetadataTriggeredBy", "ServiceSpec", "ServiceSpecCommands", "ServiceStatus", @@ -45,6 +46,10 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" +class ServiceMetadataTriggeredBy: + pass + + class ServiceMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ @@ -161,7 +166,7 @@ class ServiceMetadata(BaseModel): identify the service in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/service_update_params.py b/src/gitpod/types/service_update_params.py index e56003e7..b9ec55c2 100644 --- a/src/gitpod/types/service_update_params.py +++ b/src/gitpod/types/service_update_params.py @@ -5,10 +5,9 @@ from typing import Union from typing_extensions import Literal, Required, Annotated, TypedDict -from ..types import service_update_params from .._utils import PropertyInfo -__all__ = ["ServiceUpdateParams"] +__all__ = ["ServiceUpdateParams", "Metadata", "Status"] class ServiceUpdateParams(TypedDict, total=False): @@ -17,7 +16,7 @@ class ServiceUpdateParams(TypedDict, total=False): id: str - metadata: service_update_params.Metadata + metadata: Metadata spec: Union[object, object] """Changing the spec of a service is a complex operation. @@ -26,7 +25,7 @@ class ServiceUpdateParams(TypedDict, total=False): If the service is running, it must be stopped first. """ - status: service_update_params.Status + status: Status """Service status updates are only expected from the executing environment. As a client of this API you are not expected to provide this field. Updating @@ -35,3 +34,11 @@ class ServiceUpdateParams(TypedDict, total=False): connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" + + +class Metadata: + pass + + +class Status: + pass diff --git a/src/gitpod/types/task_create_params.py b/src/gitpod/types/task_create_params.py index 5911ed60..797a0373 100644 --- a/src/gitpod/types/task_create_params.py +++ b/src/gitpod/types/task_create_params.py @@ -8,7 +8,7 @@ from .._utils import PropertyInfo -__all__ = ["TaskCreateParams", "Metadata", "MetadataCreator", "Spec"] +__all__ = ["TaskCreateParams", "Metadata", "MetadataCreator", "MetadataTriggeredBy", "Spec"] class TaskCreateParams(TypedDict, total=False): @@ -42,6 +42,10 @@ class MetadataCreator(TypedDict, total=False): """Principal is the principal of the subject""" +class MetadataTriggeredBy: + pass + + class Metadata(TypedDict, total=False): created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] """ @@ -158,7 +162,7 @@ class Metadata(TypedDict, total=False): the task in user interactions (e.g. the CLI). """ - triggered_by: Annotated[Iterable[Union[object, object, object, object]], PropertyInfo(alias="triggeredBy")] + triggered_by: Annotated[Iterable[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] """triggered_by is a list of trigger that start the task.""" diff --git a/src/gitpod/types/task_create_response.py b/src/gitpod/types/task_create_response.py index 3bdbef53..374bef47 100644 --- a/src/gitpod/types/task_create_response.py +++ b/src/gitpod/types/task_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -8,7 +8,7 @@ from .._models import BaseModel -__all__ = ["TaskCreateResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] +__all__ = ["TaskCreateResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", "TaskSpec"] class TaskMetadataCreator(BaseModel): @@ -28,6 +28,10 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" +class TaskMetadataTriggeredBy: + pass + + class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ @@ -144,7 +148,7 @@ class TaskMetadata(BaseModel): the task in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the task.""" diff --git a/src/gitpod/types/task_retrieve_create_response.py b/src/gitpod/types/task_retrieve_create_response.py index 4a6599fe..b79cd808 100644 --- a/src/gitpod/types/task_retrieve_create_response.py +++ b/src/gitpod/types/task_retrieve_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -8,7 +8,14 @@ from .._models import BaseModel -__all__ = ["TaskRetrieveCreateResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] +__all__ = [ + "TaskRetrieveCreateResponse", + "Task", + "TaskMetadata", + "TaskMetadataCreator", + "TaskMetadataTriggeredBy", + "TaskSpec", +] class TaskMetadataCreator(BaseModel): @@ -28,6 +35,10 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" +class TaskMetadataTriggeredBy: + pass + + class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ @@ -144,7 +155,7 @@ class TaskMetadata(BaseModel): the task in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the task.""" diff --git a/src/gitpod/types/task_retrieve_response.py b/src/gitpod/types/task_retrieve_response.py index 9ce93799..5d18b57f 100644 --- a/src/gitpod/types/task_retrieve_response.py +++ b/src/gitpod/types/task_retrieve_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -8,7 +8,7 @@ from .._models import BaseModel -__all__ = ["TaskRetrieveResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskSpec"] +__all__ = ["TaskRetrieveResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", "TaskSpec"] class TaskMetadataCreator(BaseModel): @@ -28,6 +28,10 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" +class TaskMetadataTriggeredBy: + pass + + class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ @@ -144,7 +148,7 @@ class TaskMetadata(BaseModel): the task in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[Union[object, object, object, object]]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the task.""" diff --git a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py index dd8a5f52..622647b6 100644 --- a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py @@ -106,7 +106,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: + def test_method_update(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( body={}, connect_protocol_version=1, @@ -114,59 +114,19 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( - body={}, + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "token": "x", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + def test_raw_response_update(self, client: Gitpod) -> None: response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( body={}, connect_protocol_version=1, @@ -178,7 +138,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + def test_streaming_response_update(self, client: Gitpod) -> None: with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( body={}, connect_protocol_version=1, @@ -364,7 +324,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_update(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( body={}, connect_protocol_version=1, @@ -372,59 +332,19 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( - body={}, + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "token": "x", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( body={}, connect_protocol_version=1, @@ -436,7 +356,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( body={}, connect_protocol_version=1, diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 171140aa..3935be54 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -42,7 +42,20 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{}]}, + "initializer": { + "specs": [ + { + "contextUrl": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -61,7 +74,16 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "port": 1, } ], - "secrets": [{}], + "secrets": [ + { + "environmentVariable": "environmentVariable", + "filePath": "filePath", + "gitCredentialHost": "gitCredentialHost", + "name": "name", + "source": "source", + "sourceRef": "sourceRef", + } + ], "spec_version": "string", "ssh_public_keys": [ { @@ -210,7 +232,20 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{}]}, + "initializer": { + "specs": [ + { + "contextUrl": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -229,7 +264,16 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "port": 1, } ], - "secrets": [{}], + "secrets": [ + { + "environmentVariable": "environmentVariable", + "filePath": "filePath", + "gitCredentialHost": "gitCredentialHost", + "name": "name", + "source": "source", + "sourceRef": "sourceRef", + } + ], "spec_version": "string", "ssh_public_keys": [ { @@ -331,7 +375,20 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{}]}, + "initializer": { + "specs": [ + { + "contextUrl": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -350,7 +407,16 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "port": 1, } ], - "secrets": [{}], + "secrets": [ + { + "environmentVariable": "environmentVariable", + "filePath": "filePath", + "gitCredentialHost": "gitCredentialHost", + "name": "name", + "source": "source", + "sourceRef": "sourceRef", + } + ], "spec_version": "string", "ssh_public_keys": [ { @@ -499,7 +565,20 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{}]}, + "initializer": { + "specs": [ + { + "contextUrl": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -518,7 +597,16 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "port": 1, } ], - "secrets": [{}], + "secrets": [ + { + "environmentVariable": "environmentVariable", + "filePath": "filePath", + "gitCredentialHost": "gitCredentialHost", + "name": "name", + "source": "source", + "sourceRef": "sourceRef", + } + ], "spec_version": "string", "ssh_public_keys": [ { diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index c06e96d4..42bc2961 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -34,7 +34,20 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( environment_class={}, - initializer={"specs": [{}]}, + initializer={ + "specs": [ + { + "contextUrl": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", @@ -173,7 +186,20 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( environment_class={}, - initializer={"specs": [{}]}, + initializer={ + "specs": [ + { + "contextUrl": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", diff --git a/tests/api_resources/test_runner_configurations.py b/tests/api_resources/test_runner_configurations.py index cfb45e26..97f21bc1 100644 --- a/tests/api_resources/test_runner_configurations.py +++ b/tests/api_resources/test_runner_configurations.py @@ -18,7 +18,7 @@ class TestRunnerConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_validate_overload_1(self, client: Gitpod) -> None: + def test_method_validate(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( body={}, connect_protocol_version=1, @@ -26,102 +26,32 @@ def test_method_validate_overload_1(self, client: Gitpod) -> None: assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> None: + def test_method_validate_with_all_params(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: - response = client.runner_configurations.with_raw_response.validate( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: - with client.runner_configurations.with_streaming_response.validate( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_configuration = response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_validate_overload_2(self, client: Gitpod) -> None: - runner_configuration = client.runner_configurations.validate( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: - runner_configuration = client.runner_configurations.validate( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: - response = client.runner_configurations.with_raw_response.validate( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: - with client.runner_configurations.with_streaming_response.validate( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_configuration = response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_validate_overload_3(self, client: Gitpod) -> None: - runner_configuration = client.runner_configurations.validate( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - def test_method_validate_with_all_params_overload_3(self, client: Gitpod) -> None: - runner_configuration = client.runner_configurations.validate( - body={}, + body={ + "environmentClass": { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmIntegration": {}, + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - def test_raw_response_validate_overload_3(self, client: Gitpod) -> None: + def test_raw_response_validate(self, client: Gitpod) -> None: response = client.runner_configurations.with_raw_response.validate( body={}, connect_protocol_version=1, @@ -133,7 +63,7 @@ def test_raw_response_validate_overload_3(self, client: Gitpod) -> None: assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - def test_streaming_response_validate_overload_3(self, client: Gitpod) -> None: + def test_streaming_response_validate(self, client: Gitpod) -> None: with client.runner_configurations.with_streaming_response.validate( body={}, connect_protocol_version=1, @@ -151,7 +81,7 @@ class TestAsyncRunnerConfigurations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_validate(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( body={}, connect_protocol_version=1, @@ -159,102 +89,32 @@ async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> No assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - async def test_method_validate_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.with_raw_response.validate( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = await response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.with_streaming_response.validate( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_configuration = await response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: - runner_configuration = await async_client.runner_configurations.validate( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - runner_configuration = await async_client.runner_configurations.validate( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.with_raw_response.validate( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = await response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.with_streaming_response.validate( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_configuration = await response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_validate_overload_3(self, async_client: AsyncGitpod) -> None: - runner_configuration = await async_client.runner_configurations.validate( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) - - @parametrize - async def test_method_validate_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - runner_configuration = await async_client.runner_configurations.validate( - body={}, + body={ + "environmentClass": { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmIntegration": {}, + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - async def test_raw_response_validate_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_validate(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.with_raw_response.validate( body={}, connect_protocol_version=1, @@ -266,7 +126,7 @@ async def test_raw_response_validate_overload_3(self, async_client: AsyncGitpod) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - async def test_streaming_response_validate_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_validate(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.with_streaming_response.validate( body={}, connect_protocol_version=1, diff --git a/tests/api_resources/test_runner_interactions.py b/tests/api_resources/test_runner_interactions.py index 87605b09..2179d562 100644 --- a/tests/api_resources/test_runner_interactions.py +++ b/tests/api_resources/test_runner_interactions.py @@ -256,7 +256,7 @@ def test_streaming_response_mark_active(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_send_response_overload_1(self, client: Gitpod) -> None: + def test_method_send_response(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.send_response( body={}, connect_protocol_version=1, @@ -264,231 +264,53 @@ def test_method_send_response_overload_1(self, client: Gitpod) -> None: assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_method_send_response_with_all_params_overload_1(self, client: Gitpod) -> None: + def test_method_send_response_with_all_params(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_1(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_1(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_2(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_2(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_2(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_2(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_3(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_3(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_3(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_3(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_4(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_4(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_4(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_4(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_5(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_5(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response_overload_5(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response_overload_5(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response_overload_6(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params_overload_6(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, + body={ + "callCheckAuthenticationForHost": { + "resp": { + "authenticated": True, + "authentication_url": "authenticationUrl", + "pat_supported": True, + } + }, + "callParseContext": { + "resp": { + "git": { + "branch": "branch", + "clone_url": "cloneUrl", + "commit": "commit", + "host": "host", + "owner": "owner", + "repo": "repo", + "upstream_remote_url": "upstreamRemoteUrl", + }, + "original_context_url": "originalContextUrl", + } + }, + "callPing": {}, + "callValidateConfig": {}, + "error": { + "code": "ERROR_CODE_UNSPECIFIED", + "details": [ + { + "debug": {"foo": "bar"}, + "type": "type", + "value": b"raw file contents", + } + ], + "message": "message", + }, + "requestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_raw_response_send_response_overload_6(self, client: Gitpod) -> None: + def test_raw_response_send_response(self, client: Gitpod) -> None: response = client.runner_interactions.with_raw_response.send_response( body={}, connect_protocol_version=1, @@ -500,7 +322,7 @@ def test_raw_response_send_response_overload_6(self, client: Gitpod) -> None: assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - def test_streaming_response_send_response_overload_6(self, client: Gitpod) -> None: + def test_streaming_response_send_response(self, client: Gitpod) -> None: with client.runner_interactions.with_streaming_response.send_response( body={}, connect_protocol_version=1, @@ -580,8 +402,54 @@ def test_method_update_runner_configuration_schema_with_all_params(self, client: runner_interaction = client.runner_interactions.update_runner_configuration_schema( connect_protocol_version=1, config_schema={ - "environment_classes": [{}], - "runner_config": [{}], + "environment_classes": [ + { + "id": "id", + "bool": {"default": True}, + "description": "description", + "display": {"default": "default"}, + "enum": { + "default": "default", + "values": ["string"], + }, + "int": { + "default": 0, + "max": 0, + "min": 0, + }, + "name": "name", + "required": True, + "secret": True, + "string": { + "default": "default", + "pattern": "pattern", + }, + } + ], + "runner_config": [ + { + "id": "id", + "bool": {"default": True}, + "description": "description", + "display": {"default": "default"}, + "enum": { + "default": "default", + "values": ["string"], + }, + "int": { + "default": 0, + "max": 0, + "min": 0, + }, + "name": "name", + "required": True, + "secret": True, + "string": { + "default": "default", + "pattern": "pattern", + }, + } + ], "scm": [ { "default_hosts": ["string"], @@ -637,7 +505,12 @@ def test_method_update_status(self, client: Gitpod) -> None: def test_method_update_status_with_all_params(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.update_status( body={ - "additionalInfo": [{}], + "additionalInfo": [ + { + "key": "key", + "value": "value", + } + ], "degredationMessage": "degredationMessage", "logUrl": "https://example.com", "region": "region", @@ -913,7 +786,7 @@ async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True @parametrize - async def test_method_send_response_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_send_response(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.send_response( body={}, connect_protocol_version=1, @@ -921,231 +794,53 @@ async def test_method_send_response_overload_1(self, async_client: AsyncGitpod) assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - async def test_method_send_response_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_send_response_with_all_params(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_2(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_3(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_4(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_4(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_4(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_5(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response_overload_5(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response_overload_5(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response_overload_6(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params_overload_6(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, + body={ + "callCheckAuthenticationForHost": { + "resp": { + "authenticated": True, + "authentication_url": "authenticationUrl", + "pat_supported": True, + } + }, + "callParseContext": { + "resp": { + "git": { + "branch": "branch", + "clone_url": "cloneUrl", + "commit": "commit", + "host": "host", + "owner": "owner", + "repo": "repo", + "upstream_remote_url": "upstreamRemoteUrl", + }, + "original_context_url": "originalContextUrl", + } + }, + "callPing": {}, + "callValidateConfig": {}, + "error": { + "code": "ERROR_CODE_UNSPECIFIED", + "details": [ + { + "debug": {"foo": "bar"}, + "type": "type", + "value": b"raw file contents", + } + ], + "message": "message", + }, + "requestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - async def test_raw_response_send_response_overload_6(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_send_response(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_interactions.with_raw_response.send_response( body={}, connect_protocol_version=1, @@ -1157,7 +852,7 @@ async def test_raw_response_send_response_overload_6(self, async_client: AsyncGi assert_matches_type(object, runner_interaction, path=["response"]) @parametrize - async def test_streaming_response_send_response_overload_6(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_send_response(self, async_client: AsyncGitpod) -> None: async with async_client.runner_interactions.with_streaming_response.send_response( body={}, connect_protocol_version=1, @@ -1237,8 +932,54 @@ async def test_method_update_runner_configuration_schema_with_all_params(self, a runner_interaction = await async_client.runner_interactions.update_runner_configuration_schema( connect_protocol_version=1, config_schema={ - "environment_classes": [{}], - "runner_config": [{}], + "environment_classes": [ + { + "id": "id", + "bool": {"default": True}, + "description": "description", + "display": {"default": "default"}, + "enum": { + "default": "default", + "values": ["string"], + }, + "int": { + "default": 0, + "max": 0, + "min": 0, + }, + "name": "name", + "required": True, + "secret": True, + "string": { + "default": "default", + "pattern": "pattern", + }, + } + ], + "runner_config": [ + { + "id": "id", + "bool": {"default": True}, + "description": "description", + "display": {"default": "default"}, + "enum": { + "default": "default", + "values": ["string"], + }, + "int": { + "default": 0, + "max": 0, + "min": 0, + }, + "name": "name", + "required": True, + "secret": True, + "string": { + "default": "default", + "pattern": "pattern", + }, + } + ], "scm": [ { "default_hosts": ["string"], @@ -1294,7 +1035,12 @@ async def test_method_update_status(self, async_client: AsyncGitpod) -> None: async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.update_status( body={ - "additionalInfo": [{}], + "additionalInfo": [ + { + "key": "key", + "value": "value", + } + ], "degredationMessage": "degredationMessage", "logUrl": "https://example.com", "region": "region", diff --git a/tests/api_resources/test_tasks.py b/tests/api_resources/test_tasks.py index 1e59c290..e12ce118 100644 --- a/tests/api_resources/test_tasks.py +++ b/tests/api_resources/test_tasks.py @@ -44,7 +44,13 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{}], + "triggered_by": [ + { + "manual": True, + "postDevcontainerStart": True, + "postEnvironmentStart": True, + } + ], }, spec={"command": "command"}, connect_timeout_ms=0, @@ -185,7 +191,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{}], + "triggered_by": [ + { + "manual": True, + "postDevcontainerStart": True, + "postEnvironmentStart": True, + } + ], }, spec={"command": "command"}, connect_timeout_ms=0, From fca701155e02fab6bd804e5ebd14de55d424d01f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 04:16:19 +0000 Subject: [PATCH 031/505] fix: correctly handle deserialising `cls` fields --- src/gitpod/_models.py | 8 ++++---- tests/test_models.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index d56ea1d9..9a918aab 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -179,14 +179,14 @@ def __str__(self) -> str: @classmethod @override def construct( # pyright: ignore[reportIncompatibleMethodOverride] - cls: Type[ModelT], + __cls: Type[ModelT], _fields_set: set[str] | None = None, **values: object, ) -> ModelT: - m = cls.__new__(cls) + m = __cls.__new__(__cls) fields_values: dict[str, object] = {} - config = get_model_config(cls) + config = get_model_config(__cls) populate_by_name = ( config.allow_population_by_field_name if isinstance(config, _ConfigProtocol) @@ -196,7 +196,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] if _fields_set is None: _fields_set = set() - model_fields = get_model_fields(cls) + model_fields = get_model_fields(__cls) for name, field in model_fields.items(): key = field.alias if key is None or (key not in values and populate_by_name): diff --git a/tests/test_models.py b/tests/test_models.py index e2f4b78f..c581777c 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -844,3 +844,13 @@ class Model(BaseModel): assert m.alias == "foo" assert isinstance(m.union, str) assert m.union == "bar" + + +@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +def test_field_named_cls() -> None: + class Model(BaseModel): + cls: str + + m = construct_type(value={"cls": "foo"}, type_=Model) + assert isinstance(m, Model) + assert isinstance(m.cls, str) From 951c840060d82b727c05d7f5fda8b1b0ebc278f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 04:14:14 +0000 Subject: [PATCH 032/505] chore(internal): codegen related update --- mypy.ini | 2 +- requirements-dev.lock | 4 ++-- src/gitpod/_response.py | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mypy.ini b/mypy.ini index cdf75b39..e2d13204 100644 --- a/mypy.ini +++ b/mypy.ini @@ -41,7 +41,7 @@ cache_fine_grained = True # ``` # Changing this codegen to make mypy happy would increase complexity # and would not be worth it. -disable_error_code = func-returns-value +disable_error_code = func-returns-value,overload-cannot-match # https://github.com/python/mypy/issues/12162 [mypy.overrides] diff --git a/requirements-dev.lock b/requirements-dev.lock index 8ce360c9..a3778f92 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -48,7 +48,7 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.13.0 +mypy==1.14.1 mypy-extensions==1.0.0 # via mypy nest-asyncio==1.6.0 @@ -68,7 +68,7 @@ pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.390 +pyright==1.1.392.post0 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 diff --git a/src/gitpod/_response.py b/src/gitpod/_response.py index 73b2ce0b..4ecb06dd 100644 --- a/src/gitpod/_response.py +++ b/src/gitpod/_response.py @@ -210,7 +210,13 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: raise ValueError(f"Subclasses of httpx.Response cannot be passed to `cast_to`") return cast(R, response) - if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel): + if ( + inspect.isclass( + origin # pyright: ignore[reportUnknownArgumentType] + ) + and not issubclass(origin, BaseModel) + and issubclass(origin, pydantic.BaseModel) + ): raise TypeError("Pydantic models must subclass our base model type, e.g. `from gitpod import BaseModel`") if ( From 736750bdc0c6e48ab9a620a5ab2f9e8e08179cf5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 04:21:07 +0000 Subject: [PATCH 033/505] chore(internal): codegen related update --- .../test_task_executions.py | 4 - .../test_environment_classes.py | 4 - .../test_scm_integration.py | 8 -- tests/api_resources/test_environments.py | 28 +------ tests/api_resources/test_projects.py | 6 +- .../test_runner_configurations.py | 36 +-------- .../api_resources/test_runner_interactions.py | 74 +------------------ tests/api_resources/test_runners.py | 2 - tests/api_resources/test_tasks.py | 13 ++-- 9 files changed, 16 insertions(+), 159 deletions(-) diff --git a/tests/api_resources/environment_automations/test_task_executions.py b/tests/api_resources/environment_automations/test_task_executions.py index 1d40c2a2..89b63492 100644 --- a/tests/api_resources/environment_automations/test_task_executions.py +++ b/tests/api_resources/environment_automations/test_task_executions.py @@ -252,8 +252,6 @@ def test_method_update_task_execution_status_with_all_params(self, client: Gitpo task_execution = client.environment_automations.task_executions.update_task_execution_status( body={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failureMessage": "failureMessage", - "logUrl": "logUrl", "steps": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -527,8 +525,6 @@ async def test_method_update_task_execution_status_with_all_params(self, async_c task_execution = await async_client.environment_automations.task_executions.update_task_execution_status( body={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failureMessage": "failureMessage", - "logUrl": "logUrl", "steps": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", diff --git a/tests/api_resources/runner_configurations/test_environment_classes.py b/tests/api_resources/runner_configurations/test_environment_classes.py index 2d2d96e1..f6b8871e 100644 --- a/tests/api_resources/runner_configurations/test_environment_classes.py +++ b/tests/api_resources/runner_configurations/test_environment_classes.py @@ -32,9 +32,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( body={ "description": "xxx", - "displayName": "xxx", "enabled": True, - "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, connect_protocol_version=1, connect_timeout_ms=0, @@ -128,9 +126,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> environment_class = await async_client.runner_configurations.environment_classes.update( body={ "description": "xxx", - "displayName": "xxx", "enabled": True, - "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, connect_protocol_version=1, connect_timeout_ms=0, diff --git a/tests/api_resources/runner_configurations/test_scm_integration.py b/tests/api_resources/runner_configurations/test_scm_integration.py index d5311fb6..cab99817 100644 --- a/tests/api_resources/runner_configurations/test_scm_integration.py +++ b/tests/api_resources/runner_configurations/test_scm_integration.py @@ -30,11 +30,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runner_configurations.scm_integration.create( body={ "host": "host", - "oauthClientId": "oauthClientId", - "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", "pat": True, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmId": "scmId", }, connect_protocol_version=1, connect_timeout_ms=0, @@ -84,11 +80,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> scm_integration = await async_client.runner_configurations.scm_integration.create( body={ "host": "host", - "oauthClientId": "oauthClientId", - "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", "pat": True, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmId": "scmId", }, connect_protocol_version=1, connect_timeout_ms=0, diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 3935be54..8152aceb 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -45,14 +45,13 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "initializer": { "specs": [ { - "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - }, + } } ] }, @@ -76,12 +75,8 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "secrets": [ { - "environmentVariable": "environmentVariable", - "filePath": "filePath", - "gitCredentialHost": "gitCredentialHost", "name": "name", "source": "source", - "sourceRef": "sourceRef", } ], "spec_version": "string", @@ -235,14 +230,13 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "initializer": { "specs": [ { - "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - }, + } } ] }, @@ -266,12 +260,8 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "secrets": [ { - "environmentVariable": "environmentVariable", - "filePath": "filePath", - "gitCredentialHost": "gitCredentialHost", "name": "name", "source": "source", - "sourceRef": "sourceRef", } ], "spec_version": "string", @@ -378,14 +368,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "initializer": { "specs": [ { - "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - }, + } } ] }, @@ -409,12 +398,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "secrets": [ { - "environmentVariable": "environmentVariable", - "filePath": "filePath", - "gitCredentialHost": "gitCredentialHost", "name": "name", "source": "source", - "sourceRef": "sourceRef", } ], "spec_version": "string", @@ -568,14 +553,13 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "initializer": { "specs": [ { - "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - }, + } } ] }, @@ -599,12 +583,8 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "secrets": [ { - "environmentVariable": "environmentVariable", - "filePath": "filePath", - "gitCredentialHost": "gitCredentialHost", "name": "name", "source": "source", - "sourceRef": "sourceRef", } ], "spec_version": "string", diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 42bc2961..3c291976 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -37,14 +37,13 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: initializer={ "specs": [ { - "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - }, + } } ] }, @@ -189,14 +188,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> initializer={ "specs": [ { - "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - }, + } } ] }, diff --git a/tests/api_resources/test_runner_configurations.py b/tests/api_resources/test_runner_configurations.py index 97f21bc1..203cdb32 100644 --- a/tests/api_resources/test_runner_configurations.py +++ b/tests/api_resources/test_runner_configurations.py @@ -28,23 +28,7 @@ def test_method_validate(self, client: Gitpod) -> None: @parametrize def test_method_validate_with_all_params(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( - body={ - "environmentClass": { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmIntegration": {}, - }, + body={}, connect_protocol_version=1, connect_timeout_ms=0, ) @@ -91,23 +75,7 @@ async def test_method_validate(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( - body={ - "environmentClass": { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmIntegration": {}, - }, + body={}, connect_protocol_version=1, connect_timeout_ms=0, ) diff --git a/tests/api_resources/test_runner_interactions.py b/tests/api_resources/test_runner_interactions.py index 2179d562..a662af6a 100644 --- a/tests/api_resources/test_runner_interactions.py +++ b/tests/api_resources/test_runner_interactions.py @@ -267,29 +267,6 @@ def test_method_send_response(self, client: Gitpod) -> None: def test_method_send_response_with_all_params(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.send_response( body={ - "callCheckAuthenticationForHost": { - "resp": { - "authenticated": True, - "authentication_url": "authenticationUrl", - "pat_supported": True, - } - }, - "callParseContext": { - "resp": { - "git": { - "branch": "branch", - "clone_url": "cloneUrl", - "commit": "commit", - "host": "host", - "owner": "owner", - "repo": "repo", - "upstream_remote_url": "upstreamRemoteUrl", - }, - "original_context_url": "originalContextUrl", - } - }, - "callPing": {}, - "callValidateConfig": {}, "error": { "code": "ERROR_CODE_UNSPECIFIED", "details": [ @@ -300,9 +277,7 @@ def test_method_send_response_with_all_params(self, client: Gitpod) -> None: } ], "message": "message", - }, - "requestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + } }, connect_protocol_version=1, connect_timeout_ms=0, @@ -505,17 +480,7 @@ def test_method_update_status(self, client: Gitpod) -> None: def test_method_update_status_with_all_params(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.update_status( body={ - "additionalInfo": [ - { - "key": "key", - "value": "value", - } - ], - "degredationMessage": "degredationMessage", - "logUrl": "https://example.com", "region": "region", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "systemDetails": "systemDetails", "version": "version", }, connect_protocol_version=1, @@ -797,29 +762,6 @@ async def test_method_send_response(self, async_client: AsyncGitpod) -> None: async def test_method_send_response_with_all_params(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.send_response( body={ - "callCheckAuthenticationForHost": { - "resp": { - "authenticated": True, - "authentication_url": "authenticationUrl", - "pat_supported": True, - } - }, - "callParseContext": { - "resp": { - "git": { - "branch": "branch", - "clone_url": "cloneUrl", - "commit": "commit", - "host": "host", - "owner": "owner", - "repo": "repo", - "upstream_remote_url": "upstreamRemoteUrl", - }, - "original_context_url": "originalContextUrl", - } - }, - "callPing": {}, - "callValidateConfig": {}, "error": { "code": "ERROR_CODE_UNSPECIFIED", "details": [ @@ -830,9 +772,7 @@ async def test_method_send_response_with_all_params(self, async_client: AsyncGit } ], "message": "message", - }, - "requestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + } }, connect_protocol_version=1, connect_timeout_ms=0, @@ -1035,17 +975,7 @@ async def test_method_update_status(self, async_client: AsyncGitpod) -> None: async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.update_status( body={ - "additionalInfo": [ - { - "key": "key", - "value": "value", - } - ], - "degredationMessage": "degredationMessage", - "logUrl": "https://example.com", "region": "region", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "systemDetails": "systemDetails", "version": "version", }, connect_protocol_version=1, diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 53d6aa18..103743f0 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -381,7 +381,6 @@ def test_method_update_runner_with_all_params(self, client: Gitpod) -> None: runner = client.runners.update_runner( body={ "name": "xxx", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "spec": {}, }, connect_protocol_version=1, @@ -775,7 +774,6 @@ async def test_method_update_runner_with_all_params(self, async_client: AsyncGit runner = await async_client.runners.update_runner( body={ "name": "xxx", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "spec": {}, }, connect_protocol_version=1, diff --git a/tests/api_resources/test_tasks.py b/tests/api_resources/test_tasks.py index e12ce118..6bdacef0 100644 --- a/tests/api_resources/test_tasks.py +++ b/tests/api_resources/test_tasks.py @@ -14,7 +14,6 @@ TaskRetrieveResponse, TaskRetrieveCreateResponse, ) -from gitpod._utils import parse_datetime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -36,7 +35,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "created_at": "2019-12-27T18:11:19.117Z", "creator": { "id": "id", "principal": "PRINCIPAL_UNSPECIFIED", @@ -47,8 +46,8 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "triggered_by": [ { "manual": True, - "postDevcontainerStart": True, - "postEnvironmentStart": True, + "post_devcontainer_start": True, + "post_environment_start": True, } ], }, @@ -183,7 +182,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "created_at": "2019-12-27T18:11:19.117Z", "creator": { "id": "id", "principal": "PRINCIPAL_UNSPECIFIED", @@ -194,8 +193,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "triggered_by": [ { "manual": True, - "postDevcontainerStart": True, - "postEnvironmentStart": True, + "post_devcontainer_start": True, + "post_environment_start": True, } ], }, From a1f8e75223efc095b6a2c526442c5140e8395b9c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 04:34:23 +0000 Subject: [PATCH 034/505] docs(raw responses): fix duplicate `the` --- src/gitpod/resources/automations_files.py | 4 ++-- .../environment_automations/environment_automations.py | 4 ++-- .../resources/environment_automations/task_executions.py | 4 ++-- src/gitpod/resources/environment_automations/tasks.py | 4 ++-- src/gitpod/resources/environment_classes.py | 4 ++-- src/gitpod/resources/environments.py | 4 ++-- src/gitpod/resources/organizations/invite/invite.py | 4 ++-- src/gitpod/resources/organizations/invite/summary.py | 4 ++-- src/gitpod/resources/organizations/members.py | 4 ++-- src/gitpod/resources/organizations/organizations.py | 4 ++-- src/gitpod/resources/personal_access_tokens.py | 4 ++-- src/gitpod/resources/projects.py | 4 ++-- .../resources/runner_configurations/configuration_schema.py | 4 ++-- .../resources/runner_configurations/environment_classes.py | 4 ++-- .../runner_configurations/host_authentication_tokens.py | 4 ++-- .../resources/runner_configurations/runner_configurations.py | 4 ++-- src/gitpod/resources/runner_configurations/scm_integration.py | 4 ++-- src/gitpod/resources/runner_interactions/environments.py | 4 ++-- .../resources/runner_interactions/runner_interactions.py | 4 ++-- src/gitpod/resources/runners/policies.py | 4 ++-- src/gitpod/resources/runners/runners.py | 4 ++-- src/gitpod/resources/services.py | 4 ++-- src/gitpod/resources/tasks.py | 4 ++-- 23 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/gitpod/resources/automations_files.py b/src/gitpod/resources/automations_files.py index b3b1c6f7..0fc4f329 100644 --- a/src/gitpod/resources/automations_files.py +++ b/src/gitpod/resources/automations_files.py @@ -32,7 +32,7 @@ class AutomationsFilesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AutomationsFilesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -112,7 +112,7 @@ class AsyncAutomationsFilesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAutomationsFilesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/environment_automations/environment_automations.py b/src/gitpod/resources/environment_automations/environment_automations.py index 30799d85..69047e6a 100644 --- a/src/gitpod/resources/environment_automations/environment_automations.py +++ b/src/gitpod/resources/environment_automations/environment_automations.py @@ -36,7 +36,7 @@ def task_executions(self) -> TaskExecutionsResource: @cached_property def with_raw_response(self) -> EnvironmentAutomationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def task_executions(self) -> AsyncTaskExecutionsResource: @cached_property def with_raw_response(self) -> AsyncEnvironmentAutomationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/environment_automations/task_executions.py b/src/gitpod/resources/environment_automations/task_executions.py index c1ced3aa..e127edc3 100644 --- a/src/gitpod/resources/environment_automations/task_executions.py +++ b/src/gitpod/resources/environment_automations/task_executions.py @@ -42,7 +42,7 @@ class TaskExecutionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TaskExecutionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -392,7 +392,7 @@ class AsyncTaskExecutionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTaskExecutionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/environment_automations/tasks.py b/src/gitpod/resources/environment_automations/tasks.py index 8f56906b..c9d7e65f 100644 --- a/src/gitpod/resources/environment_automations/tasks.py +++ b/src/gitpod/resources/environment_automations/tasks.py @@ -41,7 +41,7 @@ class TasksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TasksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -339,7 +339,7 @@ class AsyncTasksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/environment_classes.py b/src/gitpod/resources/environment_classes.py index 7d2e7479..47793c09 100644 --- a/src/gitpod/resources/environment_classes.py +++ b/src/gitpod/resources/environment_classes.py @@ -33,7 +33,7 @@ class EnvironmentClassesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EnvironmentClassesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -112,7 +112,7 @@ class AsyncEnvironmentClassesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEnvironmentClassesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/environments.py b/src/gitpod/resources/environments.py index c8f898aa..376502ac 100644 --- a/src/gitpod/resources/environments.py +++ b/src/gitpod/resources/environments.py @@ -41,7 +41,7 @@ class EnvironmentsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -335,7 +335,7 @@ class AsyncEnvironmentsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/organizations/invite/invite.py b/src/gitpod/resources/organizations/invite/invite.py index c1b4b70f..aa334caf 100644 --- a/src/gitpod/resources/organizations/invite/invite.py +++ b/src/gitpod/resources/organizations/invite/invite.py @@ -45,7 +45,7 @@ def summary(self) -> SummaryResource: @cached_property def with_raw_response(self) -> InviteResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -168,7 +168,7 @@ def summary(self) -> AsyncSummaryResource: @cached_property def with_raw_response(self) -> AsyncInviteResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/organizations/invite/summary.py b/src/gitpod/resources/organizations/invite/summary.py index e7dee9f7..de8a1ac2 100644 --- a/src/gitpod/resources/organizations/invite/summary.py +++ b/src/gitpod/resources/organizations/invite/summary.py @@ -32,7 +32,7 @@ class SummaryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -101,7 +101,7 @@ class AsyncSummaryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/organizations/members.py b/src/gitpod/resources/organizations/members.py index 9c7ef93f..bb8b6076 100644 --- a/src/gitpod/resources/organizations/members.py +++ b/src/gitpod/resources/organizations/members.py @@ -32,7 +32,7 @@ class MembersResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MembersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -111,7 +111,7 @@ class AsyncMembersResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMembersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 5f0d93f5..b218c61f 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -55,7 +55,7 @@ def invite(self) -> InviteResource: @cached_property def with_raw_response(self) -> OrganizationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -188,7 +188,7 @@ def invite(self) -> AsyncInviteResource: @cached_property def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/personal_access_tokens.py b/src/gitpod/resources/personal_access_tokens.py index d4a1dbf7..4c13f958 100644 --- a/src/gitpod/resources/personal_access_tokens.py +++ b/src/gitpod/resources/personal_access_tokens.py @@ -32,7 +32,7 @@ class PersonalAccessTokensResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PersonalAccessTokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -157,7 +157,7 @@ class AsyncPersonalAccessTokensResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPersonalAccessTokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/projects.py b/src/gitpod/resources/projects.py index 990dea19..214b5b37 100644 --- a/src/gitpod/resources/projects.py +++ b/src/gitpod/resources/projects.py @@ -39,7 +39,7 @@ class ProjectsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ProjectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -247,7 +247,7 @@ class AsyncProjectsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/runner_configurations/configuration_schema.py b/src/gitpod/resources/runner_configurations/configuration_schema.py index dc1cf365..720f5113 100644 --- a/src/gitpod/resources/runner_configurations/configuration_schema.py +++ b/src/gitpod/resources/runner_configurations/configuration_schema.py @@ -33,7 +33,7 @@ class ConfigurationSchemaResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConfigurationSchemaResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -166,7 +166,7 @@ class AsyncConfigurationSchemaResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConfigurationSchemaResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/runner_configurations/environment_classes.py b/src/gitpod/resources/runner_configurations/environment_classes.py index eb374fe4..1b078bdc 100644 --- a/src/gitpod/resources/runner_configurations/environment_classes.py +++ b/src/gitpod/resources/runner_configurations/environment_classes.py @@ -33,7 +33,7 @@ class EnvironmentClassesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EnvironmentClassesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -158,7 +158,7 @@ class AsyncEnvironmentClassesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEnvironmentClassesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py index 15eec02d..55b796f5 100644 --- a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py @@ -44,7 +44,7 @@ class HostAuthenticationTokensResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HostAuthenticationTokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -327,7 +327,7 @@ class AsyncHostAuthenticationTokensResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHostAuthenticationTokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/runner_configurations/runner_configurations.py b/src/gitpod/resources/runner_configurations/runner_configurations.py index bc7eecd5..63b1bf96 100644 --- a/src/gitpod/resources/runner_configurations/runner_configurations.py +++ b/src/gitpod/resources/runner_configurations/runner_configurations.py @@ -80,7 +80,7 @@ def environment_classes(self) -> EnvironmentClassesResource: @cached_property def with_raw_response(self) -> RunnerConfigurationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -166,7 +166,7 @@ def environment_classes(self) -> AsyncEnvironmentClassesResource: @cached_property def with_raw_response(self) -> AsyncRunnerConfigurationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/runner_configurations/scm_integration.py b/src/gitpod/resources/runner_configurations/scm_integration.py index af3e5fa9..faf0f971 100644 --- a/src/gitpod/resources/runner_configurations/scm_integration.py +++ b/src/gitpod/resources/runner_configurations/scm_integration.py @@ -32,7 +32,7 @@ class ScmIntegrationResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ScmIntegrationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -100,7 +100,7 @@ class AsyncScmIntegrationResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncScmIntegrationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/runner_interactions/environments.py b/src/gitpod/resources/runner_interactions/environments.py index 617f8160..e194ddc8 100644 --- a/src/gitpod/resources/runner_interactions/environments.py +++ b/src/gitpod/resources/runner_interactions/environments.py @@ -38,7 +38,7 @@ class EnvironmentsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -243,7 +243,7 @@ class AsyncEnvironmentsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/runner_interactions/runner_interactions.py b/src/gitpod/resources/runner_interactions/runner_interactions.py index d4e1f9d3..3757ceb3 100644 --- a/src/gitpod/resources/runner_interactions/runner_interactions.py +++ b/src/gitpod/resources/runner_interactions/runner_interactions.py @@ -72,7 +72,7 @@ def environments(self) -> EnvironmentsResource: @cached_property def with_raw_response(self) -> RunnerInteractionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -609,7 +609,7 @@ def environments(self) -> AsyncEnvironmentsResource: @cached_property def with_raw_response(self) -> AsyncRunnerInteractionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 8fad4d9d..057d92ac 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -32,7 +32,7 @@ class PoliciesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -111,7 +111,7 @@ class AsyncPoliciesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index d67db56f..d011ddcc 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -60,7 +60,7 @@ def policies(self) -> PoliciesResource: @cached_property def with_raw_response(self) -> RunnersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -594,7 +594,7 @@ def policies(self) -> AsyncPoliciesResource: @cached_property def with_raw_response(self) -> AsyncRunnersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/services.py b/src/gitpod/resources/services.py index 158e7377..67f5166f 100644 --- a/src/gitpod/resources/services.py +++ b/src/gitpod/resources/services.py @@ -41,7 +41,7 @@ class ServicesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ServicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -405,7 +405,7 @@ class AsyncServicesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncServicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers diff --git a/src/gitpod/resources/tasks.py b/src/gitpod/resources/tasks.py index 70841c47..cc8ddf92 100644 --- a/src/gitpod/resources/tasks.py +++ b/src/gitpod/resources/tasks.py @@ -35,7 +35,7 @@ class TasksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TasksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers @@ -224,7 +224,7 @@ class AsyncTasksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers From a55da2bee5c8d53ea6cd4bcb134a2cbf55d7fd83 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 04:34:48 +0000 Subject: [PATCH 035/505] fix(tests): make test_get_platform less flaky --- tests/test_client.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index f49d0d39..60d6c310 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -6,6 +6,7 @@ import os import sys import json +import time import asyncio import inspect import subprocess @@ -1539,10 +1540,20 @@ async def test_main() -> None: [sys.executable, "-c", test_code], text=True, ) as process: - try: - process.wait(2) - if process.returncode: - raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") - except subprocess.TimeoutExpired as e: - process.kill() - raise AssertionError("calling get_platform using asyncify resulted in a hung process") from e + timeout = 10 # seconds + + start_time = time.monotonic() + while True: + return_code = process.poll() + if return_code is not None: + if return_code != 0: + raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") + + # success + break + + if time.monotonic() - start_time > timeout: + process.kill() + raise AssertionError("calling get_platform using asyncify resulted in a hung process") + + time.sleep(0.1) From 320b718c6d6ba875f5825d530e0064d046136230 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 04:35:10 +0000 Subject: [PATCH 036/505] chore(internal): avoid pytest-asyncio deprecation warning --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index dec24b08..1a28968c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,6 +129,7 @@ testpaths = ["tests"] addopts = "--tb=short" xfail_strict = true asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "session" filterwarnings = [ "error" ] From ee28f81b4826c09248a37f2845e0eeffd490a625 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 04:38:53 +0000 Subject: [PATCH 037/505] chore(internal): codegen related update --- src/gitpod/_response.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_response.py b/src/gitpod/_response.py index 4ecb06dd..9ffc616a 100644 --- a/src/gitpod/_response.py +++ b/src/gitpod/_response.py @@ -136,6 +136,8 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if cast_to and is_annotated_type(cast_to): cast_to = extract_type_arg(cast_to, 0) + origin = get_origin(cast_to) or cast_to + if self._is_sse_stream: if to: if not is_stream_class_type(to): @@ -195,8 +197,6 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if cast_to == bool: return cast(R, response.text.lower() == "true") - origin = get_origin(cast_to) or cast_to - if origin == APIResponse: raise RuntimeError("Unexpected state - cast_to is `APIResponse`") From 2aeb087047fc5b23de22986025e70afc6de14a28 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 04:11:21 +0000 Subject: [PATCH 038/505] chore(internal): minor formatting changes --- .github/workflows/ci.yml | 3 +-- scripts/bootstrap | 2 +- scripts/lint | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40293964..c8a8a4f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ jobs: lint: name: lint runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -30,6 +29,7 @@ jobs: - name: Run lints run: ./scripts/lint + test: name: test runs-on: ubuntu-latest @@ -50,4 +50,3 @@ jobs: - name: Run tests run: ./scripts/test - diff --git a/scripts/bootstrap b/scripts/bootstrap index 8c5c60eb..e84fe62c 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then brew bundle check >/dev/null 2>&1 || { echo "==> Installing Homebrew dependencies…" brew bundle diff --git a/scripts/lint b/scripts/lint index 491fd6be..6a98ee4f 100755 --- a/scripts/lint +++ b/scripts/lint @@ -9,4 +9,3 @@ rye run lint echo "==> Making sure it imports" rye run python -c 'import gitpod' - From 6b019125e18343771084d6e961ef41e711f61649 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 25 Jan 2025 04:29:50 +0000 Subject: [PATCH 039/505] chore(internal): codegen related update --- .../test_task_executions.py | 4 + .../test_environment_classes.py | 4 + .../test_scm_integration.py | 8 ++ tests/api_resources/test_environments.py | 28 ++++++- tests/api_resources/test_projects.py | 6 +- .../test_runner_configurations.py | 36 ++++++++- .../api_resources/test_runner_interactions.py | 74 ++++++++++++++++++- tests/api_resources/test_runners.py | 2 + tests/api_resources/test_tasks.py | 13 ++-- 9 files changed, 159 insertions(+), 16 deletions(-) diff --git a/tests/api_resources/environment_automations/test_task_executions.py b/tests/api_resources/environment_automations/test_task_executions.py index 89b63492..1d40c2a2 100644 --- a/tests/api_resources/environment_automations/test_task_executions.py +++ b/tests/api_resources/environment_automations/test_task_executions.py @@ -252,6 +252,8 @@ def test_method_update_task_execution_status_with_all_params(self, client: Gitpo task_execution = client.environment_automations.task_executions.update_task_execution_status( body={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failureMessage": "failureMessage", + "logUrl": "logUrl", "steps": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -525,6 +527,8 @@ async def test_method_update_task_execution_status_with_all_params(self, async_c task_execution = await async_client.environment_automations.task_executions.update_task_execution_status( body={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failureMessage": "failureMessage", + "logUrl": "logUrl", "steps": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", diff --git a/tests/api_resources/runner_configurations/test_environment_classes.py b/tests/api_resources/runner_configurations/test_environment_classes.py index f6b8871e..2d2d96e1 100644 --- a/tests/api_resources/runner_configurations/test_environment_classes.py +++ b/tests/api_resources/runner_configurations/test_environment_classes.py @@ -32,7 +32,9 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( body={ "description": "xxx", + "displayName": "xxx", "enabled": True, + "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, connect_protocol_version=1, connect_timeout_ms=0, @@ -126,7 +128,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> environment_class = await async_client.runner_configurations.environment_classes.update( body={ "description": "xxx", + "displayName": "xxx", "enabled": True, + "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, connect_protocol_version=1, connect_timeout_ms=0, diff --git a/tests/api_resources/runner_configurations/test_scm_integration.py b/tests/api_resources/runner_configurations/test_scm_integration.py index cab99817..d5311fb6 100644 --- a/tests/api_resources/runner_configurations/test_scm_integration.py +++ b/tests/api_resources/runner_configurations/test_scm_integration.py @@ -30,7 +30,11 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runner_configurations.scm_integration.create( body={ "host": "host", + "oauthClientId": "oauthClientId", + "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", "pat": True, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmId": "scmId", }, connect_protocol_version=1, connect_timeout_ms=0, @@ -80,7 +84,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> scm_integration = await async_client.runner_configurations.scm_integration.create( body={ "host": "host", + "oauthClientId": "oauthClientId", + "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", "pat": True, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmId": "scmId", }, connect_protocol_version=1, connect_timeout_ms=0, diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 8152aceb..3935be54 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -45,13 +45,14 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "initializer": { "specs": [ { + "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - } + }, } ] }, @@ -75,8 +76,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "secrets": [ { + "environmentVariable": "environmentVariable", + "filePath": "filePath", + "gitCredentialHost": "gitCredentialHost", "name": "name", "source": "source", + "sourceRef": "sourceRef", } ], "spec_version": "string", @@ -230,13 +235,14 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "initializer": { "specs": [ { + "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - } + }, } ] }, @@ -260,8 +266,12 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "secrets": [ { + "environmentVariable": "environmentVariable", + "filePath": "filePath", + "gitCredentialHost": "gitCredentialHost", "name": "name", "source": "source", + "sourceRef": "sourceRef", } ], "spec_version": "string", @@ -368,13 +378,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "initializer": { "specs": [ { + "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - } + }, } ] }, @@ -398,8 +409,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "secrets": [ { + "environmentVariable": "environmentVariable", + "filePath": "filePath", + "gitCredentialHost": "gitCredentialHost", "name": "name", "source": "source", + "sourceRef": "sourceRef", } ], "spec_version": "string", @@ -553,13 +568,14 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "initializer": { "specs": [ { + "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - } + }, } ] }, @@ -583,8 +599,12 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "secrets": [ { + "environmentVariable": "environmentVariable", + "filePath": "filePath", + "gitCredentialHost": "gitCredentialHost", "name": "name", "source": "source", + "sourceRef": "sourceRef", } ], "spec_version": "string", diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 3c291976..42bc2961 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -37,13 +37,14 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: initializer={ "specs": [ { + "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - } + }, } ] }, @@ -188,13 +189,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> initializer={ "specs": [ { + "contextUrl": {"url": "https://example.com"}, "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", "remote_uri": "remoteUri", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", - } + }, } ] }, diff --git a/tests/api_resources/test_runner_configurations.py b/tests/api_resources/test_runner_configurations.py index 203cdb32..97f21bc1 100644 --- a/tests/api_resources/test_runner_configurations.py +++ b/tests/api_resources/test_runner_configurations.py @@ -28,7 +28,23 @@ def test_method_validate(self, client: Gitpod) -> None: @parametrize def test_method_validate_with_all_params(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( - body={}, + body={ + "environmentClass": { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmIntegration": {}, + }, connect_protocol_version=1, connect_timeout_ms=0, ) @@ -75,7 +91,23 @@ async def test_method_validate(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( - body={}, + body={ + "environmentClass": { + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmIntegration": {}, + }, connect_protocol_version=1, connect_timeout_ms=0, ) diff --git a/tests/api_resources/test_runner_interactions.py b/tests/api_resources/test_runner_interactions.py index a662af6a..2179d562 100644 --- a/tests/api_resources/test_runner_interactions.py +++ b/tests/api_resources/test_runner_interactions.py @@ -267,6 +267,29 @@ def test_method_send_response(self, client: Gitpod) -> None: def test_method_send_response_with_all_params(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.send_response( body={ + "callCheckAuthenticationForHost": { + "resp": { + "authenticated": True, + "authentication_url": "authenticationUrl", + "pat_supported": True, + } + }, + "callParseContext": { + "resp": { + "git": { + "branch": "branch", + "clone_url": "cloneUrl", + "commit": "commit", + "host": "host", + "owner": "owner", + "repo": "repo", + "upstream_remote_url": "upstreamRemoteUrl", + }, + "original_context_url": "originalContextUrl", + } + }, + "callPing": {}, + "callValidateConfig": {}, "error": { "code": "ERROR_CODE_UNSPECIFIED", "details": [ @@ -277,7 +300,9 @@ def test_method_send_response_with_all_params(self, client: Gitpod) -> None: } ], "message": "message", - } + }, + "requestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, connect_protocol_version=1, connect_timeout_ms=0, @@ -480,7 +505,17 @@ def test_method_update_status(self, client: Gitpod) -> None: def test_method_update_status_with_all_params(self, client: Gitpod) -> None: runner_interaction = client.runner_interactions.update_status( body={ + "additionalInfo": [ + { + "key": "key", + "value": "value", + } + ], + "degredationMessage": "degredationMessage", + "logUrl": "https://example.com", "region": "region", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "systemDetails": "systemDetails", "version": "version", }, connect_protocol_version=1, @@ -762,6 +797,29 @@ async def test_method_send_response(self, async_client: AsyncGitpod) -> None: async def test_method_send_response_with_all_params(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.send_response( body={ + "callCheckAuthenticationForHost": { + "resp": { + "authenticated": True, + "authentication_url": "authenticationUrl", + "pat_supported": True, + } + }, + "callParseContext": { + "resp": { + "git": { + "branch": "branch", + "clone_url": "cloneUrl", + "commit": "commit", + "host": "host", + "owner": "owner", + "repo": "repo", + "upstream_remote_url": "upstreamRemoteUrl", + }, + "original_context_url": "originalContextUrl", + } + }, + "callPing": {}, + "callValidateConfig": {}, "error": { "code": "ERROR_CODE_UNSPECIFIED", "details": [ @@ -772,7 +830,9 @@ async def test_method_send_response_with_all_params(self, async_client: AsyncGit } ], "message": "message", - } + }, + "requestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, connect_protocol_version=1, connect_timeout_ms=0, @@ -975,7 +1035,17 @@ async def test_method_update_status(self, async_client: AsyncGitpod) -> None: async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: runner_interaction = await async_client.runner_interactions.update_status( body={ + "additionalInfo": [ + { + "key": "key", + "value": "value", + } + ], + "degredationMessage": "degredationMessage", + "logUrl": "https://example.com", "region": "region", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "systemDetails": "systemDetails", "version": "version", }, connect_protocol_version=1, diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 103743f0..53d6aa18 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -381,6 +381,7 @@ def test_method_update_runner_with_all_params(self, client: Gitpod) -> None: runner = client.runners.update_runner( body={ "name": "xxx", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "spec": {}, }, connect_protocol_version=1, @@ -774,6 +775,7 @@ async def test_method_update_runner_with_all_params(self, async_client: AsyncGit runner = await async_client.runners.update_runner( body={ "name": "xxx", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "spec": {}, }, connect_protocol_version=1, diff --git a/tests/api_resources/test_tasks.py b/tests/api_resources/test_tasks.py index 6bdacef0..e12ce118 100644 --- a/tests/api_resources/test_tasks.py +++ b/tests/api_resources/test_tasks.py @@ -14,6 +14,7 @@ TaskRetrieveResponse, TaskRetrieveCreateResponse, ) +from gitpod._utils import parse_datetime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -35,7 +36,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ - "created_at": "2019-12-27T18:11:19.117Z", + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { "id": "id", "principal": "PRINCIPAL_UNSPECIFIED", @@ -46,8 +47,8 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "triggered_by": [ { "manual": True, - "post_devcontainer_start": True, - "post_environment_start": True, + "postDevcontainerStart": True, + "postEnvironmentStart": True, } ], }, @@ -182,7 +183,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ - "created_at": "2019-12-27T18:11:19.117Z", + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { "id": "id", "principal": "PRINCIPAL_UNSPECIFIED", @@ -193,8 +194,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "triggered_by": [ { "manual": True, - "post_devcontainer_start": True, - "post_environment_start": True, + "postDevcontainerStart": True, + "postEnvironmentStart": True, } ], }, From 4fbfa73eb874113541bc23e6a7918be5597af6b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 13:46:04 +0000 Subject: [PATCH 040/505] feat(api): update via SDK Studio --- .stats.yml | 4 +- api.md | 48 +- src/gitpod/_client.py | 9 + src/gitpod/resources/__init__.py | 14 + src/gitpod/resources/editors.py | 452 +++++++++++++++++ .../task_executions.py | 204 +------- .../environment_automations/tasks.py | 213 ++------ src/gitpod/resources/projects.py | 169 +------ .../configuration_schema.py | 141 +----- .../host_authentication_tokens.py | 142 ------ .../runner_interactions.py | 14 +- src/gitpod/resources/runners/runners.py | 150 +----- src/gitpod/resources/services.py | 275 +---------- src/gitpod/resources/tasks.py | 141 +----- src/gitpod/types/__init__.py | 16 +- .../types/automations_file_upsert_params.py | 6 +- ...create_params.py => editor_list_params.py} | 19 +- src/gitpod/types/editor_list_response.py | 45 ++ .../types/editor_resolve_editor_url_params.py | 26 + .../editor_resolve_editor_url_response.py | 12 + ...st_params.py => editor_retrieve_params.py} | 15 +- src/gitpod/types/editor_retrieve_response.py | 28 ++ .../types/environment_automations/__init__.py | 4 - .../task_create_list_params.py | 49 -- .../task_create_list_response.py | 192 -------- .../task_execution_create_list_params.py | 61 --- .../task_execution_create_list_response.py | 457 ------------------ ...task_execution_create_retrieve_response.py | 32 +- .../task_execution_list_params.py | 50 +- .../task_execution_list_response.py | 32 +- .../task_execution_retrieve_params.py | 10 +- .../task_execution_retrieve_response.py | 32 +- .../task_list_params.py | 38 +- .../task_list_response.py | 5 +- .../task_start_response.py | 32 +- .../task_update_params.py | 10 +- .../environment_create_from_project_params.py | 15 +- ...nvironment_create_from_project_response.py | 227 ++++++++- src/gitpod/types/environment_create_params.py | 15 +- .../types/environment_create_response.py | 227 ++++++++- src/gitpod/types/environment_list_params.py | 13 + src/gitpod/types/environment_list_response.py | 227 ++++++++- .../types/environment_retrieve_response.py | 227 ++++++++- .../organizations/member_list_response.py | 3 + src/gitpod/types/project_create_params.py | 12 +- src/gitpod/types/project_retrieve_params.py | 27 -- src/gitpod/types/project_retrieve_response.py | 298 ------------ ..._check_authentication_for_host_response.py | 2 + .../types/runner_configurations/__init__.py | 10 - .../configuration_schema_retrieve_params.py | 27 -- .../configuration_schema_retrieve_response.py | 71 --- ...st_authentication_token_create_response.py | 93 ++++ ...host_authentication_token_list_response.py | 93 ++++ ...st_authentication_token_retrieve_params.py | 27 -- ..._authentication_token_retrieve_response.py | 32 -- src/gitpod/types/runner_create_params.py | 4 +- src/gitpod/types/runner_create_response.py | 9 +- .../types/runner_get_runner_response.py | 9 +- ...ost_authentication_token_value_response.py | 111 ++++- .../environment_list_response.py | 212 +++++++- .../environment_retrieve_response.py | 212 +++++++- .../environment_update_status_params.py | 121 ++++- src/gitpod/types/runner_list_params.py | 4 +- src/gitpod/types/runner_list_response.py | 9 +- src/gitpod/types/runner_retrieve_params.py | 27 -- src/gitpod/types/runner_retrieve_response.py | 412 ---------------- .../types/service_list_create_response.py | 296 ------------ src/gitpod/types/service_list_response.py | 296 ------------ src/gitpod/types/service_update_params.py | 9 +- src/gitpod/types/task_create_params.py | 3 + src/gitpod/types/task_create_response.py | 5 +- .../types/task_retrieve_create_response.py | 5 +- src/gitpod/types/task_retrieve_params.py | 27 -- src/gitpod/types/task_retrieve_response.py | 174 ------- .../test_task_executions.py | 129 +---- .../environment_automations/test_tasks.py | 125 +---- .../test_configuration_schema.py | 93 +--- .../test_host_authentication_tokens.py | 94 +--- .../runner_interactions/test_environments.py | 19 +- tests/api_resources/test_automations_files.py | 4 + tests/api_resources/test_editors.py | 276 +++++++++++ tests/api_resources/test_environments.py | 14 +- tests/api_resources/test_projects.py | 89 ---- .../api_resources/test_runner_interactions.py | 4 + tests/api_resources/test_runners.py | 89 ---- tests/api_resources/test_services.py | 188 ------- tests/api_resources/test_tasks.py | 104 +--- 87 files changed, 3012 insertions(+), 4954 deletions(-) create mode 100644 src/gitpod/resources/editors.py rename src/gitpod/types/{service_list_create_params.py => editor_list_params.py} (58%) create mode 100644 src/gitpod/types/editor_list_response.py create mode 100644 src/gitpod/types/editor_resolve_editor_url_params.py create mode 100644 src/gitpod/types/editor_resolve_editor_url_response.py rename src/gitpod/types/{service_list_params.py => editor_retrieve_params.py} (74%) create mode 100644 src/gitpod/types/editor_retrieve_response.py delete mode 100644 src/gitpod/types/environment_automations/task_create_list_params.py delete mode 100644 src/gitpod/types/environment_automations/task_create_list_response.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_create_list_params.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_create_list_response.py delete mode 100644 src/gitpod/types/project_retrieve_params.py delete mode 100644 src/gitpod/types/project_retrieve_response.py delete mode 100644 src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py delete mode 100644 src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py delete mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py delete mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py delete mode 100644 src/gitpod/types/runner_retrieve_params.py delete mode 100644 src/gitpod/types/runner_retrieve_response.py delete mode 100644 src/gitpod/types/service_list_create_response.py delete mode 100644 src/gitpod/types/service_list_response.py delete mode 100644 src/gitpod/types/task_retrieve_params.py delete mode 100644 src/gitpod/types/task_retrieve_response.py create mode 100644 tests/api_resources/test_editors.py diff --git a/.stats.yml b/.stats.yml index 7728de32..e5a41ec0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 71 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e382faa61767fc46a2a12e401bc7504f3b8925829c6ecaea5b2553281a5c4e7a.yml +configured_endpoints: 64 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a56421de8c29e0197c90fcbce09d837e8736c3a808b36b242b5c317231ce91fe.yml diff --git a/api.md b/api.md index a7db6efe..76f2eb4e 100644 --- a/api.md +++ b/api.md @@ -5,9 +5,7 @@ Types: ```python from gitpod.types import ( ServiceUpdateResponse, - ServiceListResponse, ServiceDeleteResponse, - ServiceListCreateResponse, ServiceStartResponse, ServiceStopResponse, ) @@ -16,9 +14,7 @@ from gitpod.types import ( Methods: - client.services.update(\*\*params) -> object -- client.services.list(\*\*params) -> ServiceListResponse - client.services.delete(\*\*params) -> object -- client.services.list_create(\*\*params) -> ServiceListCreateResponse - client.services.start(\*\*params) -> object - client.services.stop(\*\*params) -> object @@ -39,15 +35,28 @@ Methods: Types: ```python -from gitpod.types import TaskCreateResponse, TaskRetrieveResponse, TaskRetrieveCreateResponse +from gitpod.types import TaskCreateResponse, TaskRetrieveCreateResponse ``` Methods: - client.tasks.create(\*\*params) -> TaskCreateResponse -- client.tasks.retrieve(\*\*params) -> TaskRetrieveResponse - client.tasks.retrieve_create(\*\*params) -> TaskRetrieveCreateResponse +# Editors + +Types: + +```python +from gitpod.types import EditorRetrieveResponse, EditorListResponse, EditorResolveEditorURLResponse +``` + +Methods: + +- client.editors.retrieve(\*\*params) -> EditorRetrieveResponse +- client.editors.list(\*\*params) -> EditorListResponse +- client.editors.resolve_editor_url(\*\*params) -> EditorResolveEditorURLResponse + # EnvironmentAutomations ## Tasks @@ -59,7 +68,6 @@ from gitpod.types.environment_automations import ( TaskUpdateResponse, TaskListResponse, TaskDeleteResponse, - TaskCreateListResponse, TaskStartResponse, ) ``` @@ -67,9 +75,8 @@ from gitpod.types.environment_automations import ( Methods: - client.environment_automations.tasks.update(\*\*params) -> object -- client.environment_automations.tasks.list(\*\*params) -> TaskListResponse +- client.environment_automations.tasks.list(\*\*params) -> TaskListResponse - client.environment_automations.tasks.delete(\*\*params) -> object -- client.environment_automations.tasks.create_list(\*\*params) -> TaskCreateListResponse - client.environment_automations.tasks.start(\*\*params) -> TaskStartResponse ## TaskExecutions @@ -80,7 +87,6 @@ Types: from gitpod.types.environment_automations import ( TaskExecutionRetrieveResponse, TaskExecutionListResponse, - TaskExecutionCreateListResponse, TaskExecutionCreateRetrieveResponse, TaskExecutionStopResponse, TaskExecutionUpdateTaskExecutionStatusResponse, @@ -89,9 +95,8 @@ from gitpod.types.environment_automations import ( Methods: -- client.environment_automations.task_executions.retrieve(\*\*params) -> TaskExecutionRetrieveResponse -- client.environment_automations.task_executions.list(\*\*params) -> TaskExecutionListResponse -- client.environment_automations.task_executions.create_list(\*\*params) -> TaskExecutionCreateListResponse +- client.environment_automations.task_executions.retrieve(\*\*params) -> TaskExecutionRetrieveResponse +- client.environment_automations.task_executions.list(\*\*params) -> TaskExecutionListResponse - client.environment_automations.task_executions.create_retrieve(\*\*params) -> TaskExecutionCreateRetrieveResponse - client.environment_automations.task_executions.stop(\*\*params) -> object - client.environment_automations.task_executions.update_task_execution_status(\*\*params) -> object @@ -185,17 +190,12 @@ Methods: Types: ```python -from gitpod.types import ( - ProjectCreateResponse, - ProjectRetrieveResponse, - ProjectCreateFromEnvironmentResponse, -) +from gitpod.types import ProjectCreateResponse, ProjectCreateFromEnvironmentResponse ``` Methods: - client.projects.create(\*\*params) -> ProjectCreateResponse -- client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse - client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse # RunnerConfigurations @@ -217,7 +217,6 @@ Types: ```python from gitpod.types.runner_configurations import ( HostAuthenticationTokenCreateResponse, - HostAuthenticationTokenRetrieveResponse, HostAuthenticationTokenUpdateResponse, HostAuthenticationTokenListResponse, HostAuthenticationTokenDeleteResponse, @@ -227,7 +226,6 @@ from gitpod.types.runner_configurations import ( Methods: - client.runner_configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse -- client.runner_configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse - client.runner_configurations.host_authentication_tokens.update(\*\*params) -> object - client.runner_configurations.host_authentication_tokens.list(\*\*params) -> HostAuthenticationTokenListResponse - client.runner_configurations.host_authentication_tokens.delete(\*\*params) -> object @@ -237,16 +235,12 @@ Methods: Types: ```python -from gitpod.types.runner_configurations import ( - ConfigurationSchemaCreateResponse, - ConfigurationSchemaRetrieveResponse, -) +from gitpod.types.runner_configurations import ConfigurationSchemaCreateResponse ``` Methods: - client.runner_configurations.configuration_schema.create(\*\*params) -> ConfigurationSchemaCreateResponse -- client.runner_configurations.configuration_schema.retrieve(\*\*params) -> ConfigurationSchemaRetrieveResponse ## ScmIntegration @@ -331,7 +325,6 @@ Types: ```python from gitpod.types import ( RunnerCreateResponse, - RunnerRetrieveResponse, RunnerListResponse, RunnerCheckAuthenticationForHostResponse, RunnerCreateRunnerTokenResponse, @@ -345,7 +338,6 @@ from gitpod.types import ( Methods: - client.runners.create(\*\*params) -> RunnerCreateResponse -- client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse - client.runners.list(\*\*params) -> RunnerListResponse - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 35976abf..2d71f5e0 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -26,6 +26,7 @@ from ._version import __version__ from .resources import ( tasks, + editors, projects, services, environments, @@ -53,6 +54,7 @@ class Gitpod(SyncAPIClient): services: services.ServicesResource automations_files: automations_files.AutomationsFilesResource tasks: tasks.TasksResource + editors: editors.EditorsResource environment_automations: environment_automations.EnvironmentAutomationsResource environments: environments.EnvironmentsResource environment_classes: environment_classes.EnvironmentClassesResource @@ -109,6 +111,7 @@ def __init__( self.services = services.ServicesResource(self) self.automations_files = automations_files.AutomationsFilesResource(self) self.tasks = tasks.TasksResource(self) + self.editors = editors.EditorsResource(self) self.environment_automations = environment_automations.EnvironmentAutomationsResource(self) self.environments = environments.EnvironmentsResource(self) self.environment_classes = environment_classes.EnvironmentClassesResource(self) @@ -222,6 +225,7 @@ class AsyncGitpod(AsyncAPIClient): services: services.AsyncServicesResource automations_files: automations_files.AsyncAutomationsFilesResource tasks: tasks.AsyncTasksResource + editors: editors.AsyncEditorsResource environment_automations: environment_automations.AsyncEnvironmentAutomationsResource environments: environments.AsyncEnvironmentsResource environment_classes: environment_classes.AsyncEnvironmentClassesResource @@ -278,6 +282,7 @@ def __init__( self.services = services.AsyncServicesResource(self) self.automations_files = automations_files.AsyncAutomationsFilesResource(self) self.tasks = tasks.AsyncTasksResource(self) + self.editors = editors.AsyncEditorsResource(self) self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResource(self) self.environments = environments.AsyncEnvironmentsResource(self) self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self) @@ -392,6 +397,7 @@ def __init__(self, client: Gitpod) -> None: self.services = services.ServicesResourceWithRawResponse(client.services) self.automations_files = automations_files.AutomationsFilesResourceWithRawResponse(client.automations_files) self.tasks = tasks.TasksResourceWithRawResponse(client.tasks) + self.editors = editors.EditorsResourceWithRawResponse(client.editors) self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) @@ -420,6 +426,7 @@ def __init__(self, client: AsyncGitpod) -> None: client.automations_files ) self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks) + self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors) self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithRawResponse( client.environment_automations ) @@ -448,6 +455,7 @@ def __init__(self, client: Gitpod) -> None: client.automations_files ) self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks) + self.editors = editors.EditorsResourceWithStreamingResponse(client.editors) self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) @@ -476,6 +484,7 @@ def __init__(self, client: AsyncGitpod) -> None: client.automations_files ) self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks) + self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors) self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithStreamingResponse( client.environment_automations ) diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index 3290b9ec..9fe24e89 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -8,6 +8,14 @@ TasksResourceWithStreamingResponse, AsyncTasksResourceWithStreamingResponse, ) +from .editors import ( + EditorsResource, + AsyncEditorsResource, + EditorsResourceWithRawResponse, + AsyncEditorsResourceWithRawResponse, + EditorsResourceWithStreamingResponse, + AsyncEditorsResourceWithStreamingResponse, +) from .runners import ( RunnersResource, AsyncRunnersResource, @@ -116,6 +124,12 @@ "AsyncTasksResourceWithRawResponse", "TasksResourceWithStreamingResponse", "AsyncTasksResourceWithStreamingResponse", + "EditorsResource", + "AsyncEditorsResource", + "EditorsResourceWithRawResponse", + "AsyncEditorsResourceWithRawResponse", + "EditorsResourceWithStreamingResponse", + "AsyncEditorsResourceWithStreamingResponse", "EnvironmentAutomationsResource", "AsyncEnvironmentAutomationsResource", "EnvironmentAutomationsResourceWithRawResponse", diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py new file mode 100644 index 00000000..1d6829f4 --- /dev/null +++ b/src/gitpod/resources/editors.py @@ -0,0 +1,452 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..types import editor_list_params, editor_retrieve_params, editor_resolve_editor_url_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.editor_list_response import EditorListResponse +from ..types.editor_retrieve_response import EditorRetrieveResponse +from ..types.editor_resolve_editor_url_response import EditorResolveEditorURLResponse + +__all__ = ["EditorsResource", "AsyncEditorsResource"] + + +class EditorsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EditorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EditorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EditorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EditorsResourceWithStreamingResponse(self) + + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorRetrieveResponse: + """ + GetEditor returns the editor with the given ID + + Args: + connect_protocol_version: Define the version of the Connect protocol + + id: id is the ID of the editor to get + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EditorService/GetEditor", + body=maybe_transform({"id": id}, editor_retrieve_params.EditorRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EditorRetrieveResponse, + ) + + def list( + self, + *, + connect_protocol_version: Literal[1], + pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorListResponse: + """ + ListEditors lists all editors available to the caller + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environments + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EditorService/ListEditors", + body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EditorListResponse, + ) + + def resolve_editor_url( + self, + *, + connect_protocol_version: Literal[1], + editor_id: str | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorResolveEditorURLResponse: + """ + ResolveEditorURL resolves the editor's URL for an environment + + Args: + connect_protocol_version: Define the version of the Connect protocol + + editor_id: editorId is the ID of the editor to resolve the URL for + + environment_id: environmentId is the ID of the environment to resolve the URL for + + organization_id: organizationId is the ID of the organization to resolve the URL for + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EditorService/ResolveEditorURL", + body=maybe_transform( + { + "editor_id": editor_id, + "environment_id": environment_id, + "organization_id": organization_id, + }, + editor_resolve_editor_url_params.EditorResolveEditorURLParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EditorResolveEditorURLResponse, + ) + + +class AsyncEditorsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEditorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEditorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEditorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEditorsResourceWithStreamingResponse(self) + + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorRetrieveResponse: + """ + GetEditor returns the editor with the given ID + + Args: + connect_protocol_version: Define the version of the Connect protocol + + id: id is the ID of the editor to get + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EditorService/GetEditor", + body=await async_maybe_transform({"id": id}, editor_retrieve_params.EditorRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EditorRetrieveResponse, + ) + + async def list( + self, + *, + connect_protocol_version: Literal[1], + pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorListResponse: + """ + ListEditors lists all editors available to the caller + + Args: + connect_protocol_version: Define the version of the Connect protocol + + pagination: pagination contains the pagination options for listing environments + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EditorService/ListEditors", + body=await async_maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EditorListResponse, + ) + + async def resolve_editor_url( + self, + *, + connect_protocol_version: Literal[1], + editor_id: str | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorResolveEditorURLResponse: + """ + ResolveEditorURL resolves the editor's URL for an environment + + Args: + connect_protocol_version: Define the version of the Connect protocol + + editor_id: editorId is the ID of the editor to resolve the URL for + + environment_id: environmentId is the ID of the environment to resolve the URL for + + organization_id: organizationId is the ID of the organization to resolve the URL for + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EditorService/ResolveEditorURL", + body=await async_maybe_transform( + { + "editor_id": editor_id, + "environment_id": environment_id, + "organization_id": organization_id, + }, + editor_resolve_editor_url_params.EditorResolveEditorURLParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EditorResolveEditorURLResponse, + ) + + +class EditorsResourceWithRawResponse: + def __init__(self, editors: EditorsResource) -> None: + self._editors = editors + + self.retrieve = to_raw_response_wrapper( + editors.retrieve, + ) + self.list = to_raw_response_wrapper( + editors.list, + ) + self.resolve_editor_url = to_raw_response_wrapper( + editors.resolve_editor_url, + ) + + +class AsyncEditorsResourceWithRawResponse: + def __init__(self, editors: AsyncEditorsResource) -> None: + self._editors = editors + + self.retrieve = async_to_raw_response_wrapper( + editors.retrieve, + ) + self.list = async_to_raw_response_wrapper( + editors.list, + ) + self.resolve_editor_url = async_to_raw_response_wrapper( + editors.resolve_editor_url, + ) + + +class EditorsResourceWithStreamingResponse: + def __init__(self, editors: EditorsResource) -> None: + self._editors = editors + + self.retrieve = to_streamed_response_wrapper( + editors.retrieve, + ) + self.list = to_streamed_response_wrapper( + editors.list, + ) + self.resolve_editor_url = to_streamed_response_wrapper( + editors.resolve_editor_url, + ) + + +class AsyncEditorsResourceWithStreamingResponse: + def __init__(self, editors: AsyncEditorsResource) -> None: + self._editors = editors + + self.retrieve = async_to_streamed_response_wrapper( + editors.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + editors.list, + ) + self.resolve_editor_url = async_to_streamed_response_wrapper( + editors.resolve_editor_url, + ) diff --git a/src/gitpod/resources/environment_automations/task_executions.py b/src/gitpod/resources/environment_automations/task_executions.py index e127edc3..cc506cca 100644 --- a/src/gitpod/resources/environment_automations/task_executions.py +++ b/src/gitpod/resources/environment_automations/task_executions.py @@ -26,13 +26,11 @@ task_execution_list_params, task_execution_stop_params, task_execution_retrieve_params, - task_execution_create_list_params, task_execution_create_retrieve_params, task_execution_update_task_execution_status_params, ) from ...types.environment_automations.task_execution_list_response import TaskExecutionListResponse from ...types.environment_automations.task_execution_retrieve_response import TaskExecutionRetrieveResponse -from ...types.environment_automations.task_execution_create_list_response import TaskExecutionCreateListResponse from ...types.environment_automations.task_execution_create_retrieve_response import TaskExecutionCreateRetrieveResponse __all__ = ["TaskExecutionsResource", "AsyncTaskExecutionsResource"] @@ -62,11 +60,7 @@ def retrieve( self, *, connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -100,23 +94,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + body=maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - task_execution_retrieve_params.TaskExecutionRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=TaskExecutionRetrieveResponse, ) @@ -125,11 +107,8 @@ def list( self, *, connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -141,66 +120,6 @@ def list( """ ListTaskExecutions - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - task_execution_list_params.TaskExecutionListParams, - ), - ), - cast_to=TaskExecutionListResponse, - ) - - def create_list( - self, - *, - connect_protocol_version: Literal[1], - filter: task_execution_create_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_execution_create_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionCreateListResponse: - """ - ListTaskExecutions - Args: connect_protocol_version: Define the version of the Connect protocol @@ -234,12 +153,12 @@ def create_list( "filter": filter, "pagination": pagination, }, - task_execution_create_list_params.TaskExecutionCreateListParams, + task_execution_list_params.TaskExecutionListParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=TaskExecutionCreateListResponse, + cast_to=TaskExecutionListResponse, ) def create_retrieve( @@ -412,11 +331,7 @@ async def retrieve( self, *, connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -450,23 +365,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + body=await async_maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - task_execution_retrieve_params.TaskExecutionRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=TaskExecutionRetrieveResponse, ) @@ -475,11 +378,8 @@ async def list( self, *, connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -491,66 +391,6 @@ async def list( """ ListTaskExecutions - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - task_execution_list_params.TaskExecutionListParams, - ), - ), - cast_to=TaskExecutionListResponse, - ) - - async def create_list( - self, - *, - connect_protocol_version: Literal[1], - filter: task_execution_create_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_execution_create_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionCreateListResponse: - """ - ListTaskExecutions - Args: connect_protocol_version: Define the version of the Connect protocol @@ -584,12 +424,12 @@ async def create_list( "filter": filter, "pagination": pagination, }, - task_execution_create_list_params.TaskExecutionCreateListParams, + task_execution_list_params.TaskExecutionListParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=TaskExecutionCreateListResponse, + cast_to=TaskExecutionListResponse, ) async def create_retrieve( @@ -750,9 +590,6 @@ def __init__(self, task_executions: TaskExecutionsResource) -> None: self.list = to_raw_response_wrapper( task_executions.list, ) - self.create_list = to_raw_response_wrapper( - task_executions.create_list, - ) self.create_retrieve = to_raw_response_wrapper( task_executions.create_retrieve, ) @@ -774,9 +611,6 @@ def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: self.list = async_to_raw_response_wrapper( task_executions.list, ) - self.create_list = async_to_raw_response_wrapper( - task_executions.create_list, - ) self.create_retrieve = async_to_raw_response_wrapper( task_executions.create_retrieve, ) @@ -798,9 +632,6 @@ def __init__(self, task_executions: TaskExecutionsResource) -> None: self.list = to_streamed_response_wrapper( task_executions.list, ) - self.create_list = to_streamed_response_wrapper( - task_executions.create_list, - ) self.create_retrieve = to_streamed_response_wrapper( task_executions.create_retrieve, ) @@ -822,9 +653,6 @@ def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: self.list = async_to_streamed_response_wrapper( task_executions.list, ) - self.create_list = async_to_streamed_response_wrapper( - task_executions.create_list, - ) self.create_retrieve = async_to_streamed_response_wrapper( task_executions.create_retrieve, ) diff --git a/src/gitpod/resources/environment_automations/tasks.py b/src/gitpod/resources/environment_automations/tasks.py index c9d7e65f..a0143da6 100644 --- a/src/gitpod/resources/environment_automations/tasks.py +++ b/src/gitpod/resources/environment_automations/tasks.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Union +from typing import List from typing_extensions import Literal import httpx @@ -23,16 +23,9 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.environment_automations import ( - task_list_params, - task_start_params, - task_delete_params, - task_update_params, - task_create_list_params, -) +from ...types.environment_automations import task_list_params, task_start_params, task_delete_params, task_update_params from ...types.environment_automations.task_list_response import TaskListResponse from ...types.environment_automations.task_start_response import TaskStartResponse -from ...types.environment_automations.task_create_list_response import TaskCreateListResponse __all__ = ["TasksResource", "AsyncTasksResource"] @@ -64,7 +57,7 @@ def update( id: str | NotGiven = NOT_GIVEN, depends_on: List[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: Union[object, object] | NotGiven = NOT_GIVEN, + spec: task_update_params.Spec | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -121,11 +114,8 @@ def list( self, *, connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + filter: task_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -140,6 +130,10 @@ def list( Args: connect_protocol_version: Define the version of the Connect protocol + filter: filter contains the filter options for listing tasks + + pagination: pagination contains the pagination options for listing tasks + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -159,23 +153,17 @@ def list( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.EnvironmentAutomationService/ListTasks", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + task_list_params.TaskListParams, + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - task_list_params.TaskListParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=TaskListResponse, ) @@ -227,64 +215,6 @@ def delete( cast_to=object, ) - def create_list( - self, - *, - connect_protocol_version: Literal[1], - filter: task_create_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_create_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskCreateListResponse: - """ - ListTasks - - Args: - connect_protocol_version: Define the version of the Connect protocol - - filter: filter contains the filter options for listing tasks - - pagination: pagination contains the pagination options for listing tasks - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/ListTasks", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - task_create_list_params.TaskCreateListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskCreateListResponse, - ) - def start( self, *, @@ -362,7 +292,7 @@ async def update( id: str | NotGiven = NOT_GIVEN, depends_on: List[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: Union[object, object] | NotGiven = NOT_GIVEN, + spec: task_update_params.Spec | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -419,11 +349,8 @@ async def list( self, *, connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + filter: task_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -438,6 +365,10 @@ async def list( Args: connect_protocol_version: Define the version of the Connect protocol + filter: filter contains the filter options for listing tasks + + pagination: pagination contains the pagination options for listing tasks + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -457,23 +388,17 @@ async def list( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.EnvironmentAutomationService/ListTasks", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + task_list_params.TaskListParams, + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - task_list_params.TaskListParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=TaskListResponse, ) @@ -525,64 +450,6 @@ async def delete( cast_to=object, ) - async def create_list( - self, - *, - connect_protocol_version: Literal[1], - filter: task_create_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_create_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskCreateListResponse: - """ - ListTasks - - Args: - connect_protocol_version: Define the version of the Connect protocol - - filter: filter contains the filter options for listing tasks - - pagination: pagination contains the pagination options for listing tasks - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/ListTasks", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - task_create_list_params.TaskCreateListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskCreateListResponse, - ) - async def start( self, *, @@ -646,9 +513,6 @@ def __init__(self, tasks: TasksResource) -> None: self.delete = to_raw_response_wrapper( tasks.delete, ) - self.create_list = to_raw_response_wrapper( - tasks.create_list, - ) self.start = to_raw_response_wrapper( tasks.start, ) @@ -667,9 +531,6 @@ def __init__(self, tasks: AsyncTasksResource) -> None: self.delete = async_to_raw_response_wrapper( tasks.delete, ) - self.create_list = async_to_raw_response_wrapper( - tasks.create_list, - ) self.start = async_to_raw_response_wrapper( tasks.start, ) @@ -688,9 +549,6 @@ def __init__(self, tasks: TasksResource) -> None: self.delete = to_streamed_response_wrapper( tasks.delete, ) - self.create_list = to_streamed_response_wrapper( - tasks.create_list, - ) self.start = to_streamed_response_wrapper( tasks.start, ) @@ -709,9 +567,6 @@ def __init__(self, tasks: AsyncTasksResource) -> None: self.delete = async_to_streamed_response_wrapper( tasks.delete, ) - self.create_list = async_to_streamed_response_wrapper( - tasks.create_list, - ) self.start = async_to_streamed_response_wrapper( tasks.start, ) diff --git a/src/gitpod/resources/projects.py b/src/gitpod/resources/projects.py index 214b5b37..42a6c691 100644 --- a/src/gitpod/resources/projects.py +++ b/src/gitpod/resources/projects.py @@ -7,11 +7,7 @@ import httpx -from ..types import ( - project_create_params, - project_retrieve_params, - project_create_from_environment_params, -) +from ..types import project_create_params, project_create_from_environment_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( is_given, @@ -29,7 +25,6 @@ ) from .._base_client import make_request_options from ..types.project_create_response import ProjectCreateResponse -from ..types.project_retrieve_response import ProjectRetrieveResponse from ..types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse __all__ = ["ProjectsResource", "AsyncProjectsResource"] @@ -81,10 +76,18 @@ def create( connect_protocol_version: Define the version of the Connect protocol automations_file_path: automations_file_path is the path to the automations file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` connect_timeout_ms: Define the timeout, in ms @@ -123,69 +126,6 @@ def create( cast_to=ProjectCreateResponse, ) - def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectRetrieveResponse: - """ - GetProject retrieves a single Project. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.ProjectService/GetProject", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - project_retrieve_params.ProjectRetrieveParams, - ), - ), - cast_to=ProjectRetrieveResponse, - ) - def create_from_environment( self, *, @@ -289,10 +229,18 @@ async def create( connect_protocol_version: Define the version of the Connect protocol automations_file_path: automations_file_path is the path to the automations file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` connect_timeout_ms: Define the timeout, in ms @@ -331,69 +279,6 @@ async def create( cast_to=ProjectCreateResponse, ) - async def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectRetrieveResponse: - """ - GetProject retrieves a single Project. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.ProjectService/GetProject", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - project_retrieve_params.ProjectRetrieveParams, - ), - ), - cast_to=ProjectRetrieveResponse, - ) - async def create_from_environment( self, *, @@ -458,9 +343,6 @@ def __init__(self, projects: ProjectsResource) -> None: self.create = to_raw_response_wrapper( projects.create, ) - self.retrieve = to_raw_response_wrapper( - projects.retrieve, - ) self.create_from_environment = to_raw_response_wrapper( projects.create_from_environment, ) @@ -473,9 +355,6 @@ def __init__(self, projects: AsyncProjectsResource) -> None: self.create = async_to_raw_response_wrapper( projects.create, ) - self.retrieve = async_to_raw_response_wrapper( - projects.retrieve, - ) self.create_from_environment = async_to_raw_response_wrapper( projects.create_from_environment, ) @@ -488,9 +367,6 @@ def __init__(self, projects: ProjectsResource) -> None: self.create = to_streamed_response_wrapper( projects.create, ) - self.retrieve = to_streamed_response_wrapper( - projects.retrieve, - ) self.create_from_environment = to_streamed_response_wrapper( projects.create_from_environment, ) @@ -503,9 +379,6 @@ def __init__(self, projects: AsyncProjectsResource) -> None: self.create = async_to_streamed_response_wrapper( projects.create, ) - self.retrieve = async_to_streamed_response_wrapper( - projects.retrieve, - ) self.create_from_environment = async_to_streamed_response_wrapper( projects.create_from_environment, ) diff --git a/src/gitpod/resources/runner_configurations/configuration_schema.py b/src/gitpod/resources/runner_configurations/configuration_schema.py index 720f5113..b7579ba4 100644 --- a/src/gitpod/resources/runner_configurations/configuration_schema.py +++ b/src/gitpod/resources/runner_configurations/configuration_schema.py @@ -22,9 +22,8 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.runner_configurations import configuration_schema_create_params, configuration_schema_retrieve_params +from ...types.runner_configurations import configuration_schema_create_params from ...types.runner_configurations.configuration_schema_create_response import ConfigurationSchemaCreateResponse -from ...types.runner_configurations.configuration_schema_retrieve_response import ConfigurationSchemaRetrieveResponse __all__ = ["ConfigurationSchemaResource", "AsyncConfigurationSchemaResource"] @@ -98,69 +97,6 @@ def create( cast_to=ConfigurationSchemaCreateResponse, ) - def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationSchemaRetrieveResponse: - """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - configuration_schema_retrieve_params.ConfigurationSchemaRetrieveParams, - ), - ), - cast_to=ConfigurationSchemaRetrieveResponse, - ) - class AsyncConfigurationSchemaResource(AsyncAPIResource): @cached_property @@ -231,69 +167,6 @@ async def create( cast_to=ConfigurationSchemaCreateResponse, ) - async def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationSchemaRetrieveResponse: - """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - configuration_schema_retrieve_params.ConfigurationSchemaRetrieveParams, - ), - ), - cast_to=ConfigurationSchemaRetrieveResponse, - ) - class ConfigurationSchemaResourceWithRawResponse: def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: @@ -302,9 +175,6 @@ def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: self.create = to_raw_response_wrapper( configuration_schema.create, ) - self.retrieve = to_raw_response_wrapper( - configuration_schema.retrieve, - ) class AsyncConfigurationSchemaResourceWithRawResponse: @@ -314,9 +184,6 @@ def __init__(self, configuration_schema: AsyncConfigurationSchemaResource) -> No self.create = async_to_raw_response_wrapper( configuration_schema.create, ) - self.retrieve = async_to_raw_response_wrapper( - configuration_schema.retrieve, - ) class ConfigurationSchemaResourceWithStreamingResponse: @@ -326,9 +193,6 @@ def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: self.create = to_streamed_response_wrapper( configuration_schema.create, ) - self.retrieve = to_streamed_response_wrapper( - configuration_schema.retrieve, - ) class AsyncConfigurationSchemaResourceWithStreamingResponse: @@ -338,6 +202,3 @@ def __init__(self, configuration_schema: AsyncConfigurationSchemaResource) -> No self.create = async_to_streamed_response_wrapper( configuration_schema.create, ) - self.retrieve = async_to_streamed_response_wrapper( - configuration_schema.retrieve, - ) diff --git a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py index 55b796f5..d11201a5 100644 --- a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py @@ -27,15 +27,11 @@ host_authentication_token_create_params, host_authentication_token_delete_params, host_authentication_token_update_params, - host_authentication_token_retrieve_params, ) from ...types.runner_configurations.host_authentication_token_list_response import HostAuthenticationTokenListResponse from ...types.runner_configurations.host_authentication_token_create_response import ( HostAuthenticationTokenCreateResponse, ) -from ...types.runner_configurations.host_authentication_token_retrieve_response import ( - HostAuthenticationTokenRetrieveResponse, -) __all__ = ["HostAuthenticationTokensResource", "AsyncHostAuthenticationTokensResource"] @@ -109,69 +105,6 @@ def create( cast_to=HostAuthenticationTokenCreateResponse, ) - def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostAuthenticationTokenRetrieveResponse: - """ - GetHostAuthenticationToken - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams, - ), - ), - cast_to=HostAuthenticationTokenRetrieveResponse, - ) - def update( self, *, @@ -392,69 +325,6 @@ async def create( cast_to=HostAuthenticationTokenCreateResponse, ) - async def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostAuthenticationTokenRetrieveResponse: - """ - GetHostAuthenticationToken - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams, - ), - ), - cast_to=HostAuthenticationTokenRetrieveResponse, - ) - async def update( self, *, @@ -615,9 +485,6 @@ def __init__(self, host_authentication_tokens: HostAuthenticationTokensResource) self.create = to_raw_response_wrapper( host_authentication_tokens.create, ) - self.retrieve = to_raw_response_wrapper( - host_authentication_tokens.retrieve, - ) self.update = to_raw_response_wrapper( host_authentication_tokens.update, ) @@ -636,9 +503,6 @@ def __init__(self, host_authentication_tokens: AsyncHostAuthenticationTokensReso self.create = async_to_raw_response_wrapper( host_authentication_tokens.create, ) - self.retrieve = async_to_raw_response_wrapper( - host_authentication_tokens.retrieve, - ) self.update = async_to_raw_response_wrapper( host_authentication_tokens.update, ) @@ -657,9 +521,6 @@ def __init__(self, host_authentication_tokens: HostAuthenticationTokensResource) self.create = to_streamed_response_wrapper( host_authentication_tokens.create, ) - self.retrieve = to_streamed_response_wrapper( - host_authentication_tokens.retrieve, - ) self.update = to_streamed_response_wrapper( host_authentication_tokens.update, ) @@ -678,9 +539,6 @@ def __init__(self, host_authentication_tokens: AsyncHostAuthenticationTokensReso self.create = async_to_streamed_response_wrapper( host_authentication_tokens.create, ) - self.retrieve = async_to_streamed_response_wrapper( - host_authentication_tokens.retrieve, - ) self.update = async_to_streamed_response_wrapper( host_authentication_tokens.update, ) diff --git a/src/gitpod/resources/runner_interactions/runner_interactions.py b/src/gitpod/resources/runner_interactions/runner_interactions.py index 3757ceb3..731708e4 100644 --- a/src/gitpod/resources/runner_interactions/runner_interactions.py +++ b/src/gitpod/resources/runner_interactions/runner_interactions.py @@ -289,8 +289,11 @@ def list_runner_scm_integrations( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerInteractionListRunnerScmIntegrationsResponse: - """ - ListRunnerSCMIntegrations + """ListRunnerSCMIntegrations returns the SCM integrations configured for the + runner. + + For local runners, this returns the SCM integrations configured on the + organization's local-configuration runner. Args: connect_protocol_version: Define the version of the Connect protocol @@ -826,8 +829,11 @@ async def list_runner_scm_integrations( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerInteractionListRunnerScmIntegrationsResponse: - """ - ListRunnerSCMIntegrations + """ListRunnerSCMIntegrations returns the SCM integrations configured for the + runner. + + For local runners, this returns the SCM integrations configured on the + organization's local-configuration runner. Args: connect_protocol_version: Define the version of the Connect protocol diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index d011ddcc..16d0c4b2 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -9,7 +9,6 @@ from ...types import ( runner_list_params, runner_create_params, - runner_retrieve_params, runner_get_runner_params, runner_delete_runner_params, runner_update_runner_params, @@ -43,7 +42,6 @@ from ..._base_client import make_request_options from ...types.runner_list_response import RunnerListResponse from ...types.runner_create_response import RunnerCreateResponse -from ...types.runner_retrieve_response import RunnerRetrieveResponse from ...types.runner_get_runner_response import RunnerGetRunnerResponse from ...types.runner_parse_context_url_response import RunnerParseContextURLResponse from ...types.runner_create_runner_token_response import RunnerCreateRunnerTokenResponse @@ -80,7 +78,10 @@ def create( self, *, connect_protocol_version: Literal[1], - kind: Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"] | NotGiven = NOT_GIVEN, + kind: Literal[ + "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" + ] + | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, @@ -139,69 +140,6 @@ def create( cast_to=RunnerCreateResponse, ) - def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerRetrieveResponse: - """ - GetRunner returns a single runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.RunnerService/GetRunner", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - runner_retrieve_params.RunnerRetrieveParams, - ), - ), - cast_to=RunnerRetrieveResponse, - ) - def list( self, *, @@ -614,7 +552,10 @@ async def create( self, *, connect_protocol_version: Literal[1], - kind: Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"] | NotGiven = NOT_GIVEN, + kind: Literal[ + "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" + ] + | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, @@ -673,69 +614,6 @@ async def create( cast_to=RunnerCreateResponse, ) - async def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerRetrieveResponse: - """ - GetRunner returns a single runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.RunnerService/GetRunner", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - runner_retrieve_params.RunnerRetrieveParams, - ), - ), - cast_to=RunnerRetrieveResponse, - ) - async def list( self, *, @@ -1127,9 +1005,6 @@ def __init__(self, runners: RunnersResource) -> None: self.create = to_raw_response_wrapper( runners.create, ) - self.retrieve = to_raw_response_wrapper( - runners.retrieve, - ) self.list = to_raw_response_wrapper( runners.list, ) @@ -1164,9 +1039,6 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.create = async_to_raw_response_wrapper( runners.create, ) - self.retrieve = async_to_raw_response_wrapper( - runners.retrieve, - ) self.list = async_to_raw_response_wrapper( runners.list, ) @@ -1201,9 +1073,6 @@ def __init__(self, runners: RunnersResource) -> None: self.create = to_streamed_response_wrapper( runners.create, ) - self.retrieve = to_streamed_response_wrapper( - runners.retrieve, - ) self.list = to_streamed_response_wrapper( runners.list, ) @@ -1238,9 +1107,6 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.create = async_to_streamed_response_wrapper( runners.create, ) - self.retrieve = async_to_streamed_response_wrapper( - runners.retrieve, - ) self.list = async_to_streamed_response_wrapper( runners.list, ) diff --git a/src/gitpod/resources/services.py b/src/gitpod/resources/services.py index 67f5166f..08b46fa3 100644 --- a/src/gitpod/resources/services.py +++ b/src/gitpod/resources/services.py @@ -2,18 +2,15 @@ from __future__ import annotations -from typing import Union from typing_extensions import Literal import httpx from ..types import ( - service_list_params, service_stop_params, service_start_params, service_delete_params, service_update_params, - service_list_create_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( @@ -31,8 +28,6 @@ async_to_streamed_response_wrapper, ) from .._base_client import make_request_options -from ..types.service_list_response import ServiceListResponse -from ..types.service_list_create_response import ServiceListCreateResponse __all__ = ["ServicesResource", "AsyncServicesResource"] @@ -63,7 +58,7 @@ def update( connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: Union[object, object] | NotGiven = NOT_GIVEN, + spec: service_update_params.Spec | NotGiven = NOT_GIVEN, status: service_update_params.Status | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -123,69 +118,6 @@ def update( cast_to=object, ) - def list( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceListResponse: - """ - ListServices - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.EnvironmentAutomationService/ListServices", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - service_list_params.ServiceListParams, - ), - ), - cast_to=ServiceListResponse, - ) - def delete( self, *, @@ -242,64 +174,6 @@ def delete( cast_to=object, ) - def list_create( - self, - *, - connect_protocol_version: Literal[1], - filter: service_list_create_params.Filter | NotGiven = NOT_GIVEN, - pagination: service_list_create_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceListCreateResponse: - """ - ListServices - - Args: - connect_protocol_version: Define the version of the Connect protocol - - filter: filter contains the filter options for listing services - - pagination: pagination contains the pagination options for listing environments - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/ListServices", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - service_list_create_params.ServiceListCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ServiceListCreateResponse, - ) - def start( self, *, @@ -427,7 +301,7 @@ async def update( connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: Union[object, object] | NotGiven = NOT_GIVEN, + spec: service_update_params.Spec | NotGiven = NOT_GIVEN, status: service_update_params.Status | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -487,69 +361,6 @@ async def update( cast_to=object, ) - async def list( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceListResponse: - """ - ListServices - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.EnvironmentAutomationService/ListServices", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - service_list_params.ServiceListParams, - ), - ), - cast_to=ServiceListResponse, - ) - async def delete( self, *, @@ -606,64 +417,6 @@ async def delete( cast_to=object, ) - async def list_create( - self, - *, - connect_protocol_version: Literal[1], - filter: service_list_create_params.Filter | NotGiven = NOT_GIVEN, - pagination: service_list_create_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceListCreateResponse: - """ - ListServices - - Args: - connect_protocol_version: Define the version of the Connect protocol - - filter: filter contains the filter options for listing services - - pagination: pagination contains the pagination options for listing environments - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/ListServices", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - service_list_create_params.ServiceListCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ServiceListCreateResponse, - ) - async def start( self, *, @@ -772,15 +525,9 @@ def __init__(self, services: ServicesResource) -> None: self.update = to_raw_response_wrapper( services.update, ) - self.list = to_raw_response_wrapper( - services.list, - ) self.delete = to_raw_response_wrapper( services.delete, ) - self.list_create = to_raw_response_wrapper( - services.list_create, - ) self.start = to_raw_response_wrapper( services.start, ) @@ -796,15 +543,9 @@ def __init__(self, services: AsyncServicesResource) -> None: self.update = async_to_raw_response_wrapper( services.update, ) - self.list = async_to_raw_response_wrapper( - services.list, - ) self.delete = async_to_raw_response_wrapper( services.delete, ) - self.list_create = async_to_raw_response_wrapper( - services.list_create, - ) self.start = async_to_raw_response_wrapper( services.start, ) @@ -820,15 +561,9 @@ def __init__(self, services: ServicesResource) -> None: self.update = to_streamed_response_wrapper( services.update, ) - self.list = to_streamed_response_wrapper( - services.list, - ) self.delete = to_streamed_response_wrapper( services.delete, ) - self.list_create = to_streamed_response_wrapper( - services.list_create, - ) self.start = to_streamed_response_wrapper( services.start, ) @@ -844,15 +579,9 @@ def __init__(self, services: AsyncServicesResource) -> None: self.update = async_to_streamed_response_wrapper( services.update, ) - self.list = async_to_streamed_response_wrapper( - services.list, - ) self.delete = async_to_streamed_response_wrapper( services.delete, ) - self.list_create = async_to_streamed_response_wrapper( - services.list_create, - ) self.start = async_to_streamed_response_wrapper( services.start, ) diff --git a/src/gitpod/resources/tasks.py b/src/gitpod/resources/tasks.py index cc8ddf92..64ea8c58 100644 --- a/src/gitpod/resources/tasks.py +++ b/src/gitpod/resources/tasks.py @@ -7,7 +7,7 @@ import httpx -from ..types import task_create_params, task_retrieve_params, task_retrieve_create_params +from ..types import task_create_params, task_retrieve_create_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( is_given, @@ -25,7 +25,6 @@ ) from .._base_client import make_request_options from ..types.task_create_response import TaskCreateResponse -from ..types.task_retrieve_response import TaskRetrieveResponse from ..types.task_retrieve_create_response import TaskRetrieveCreateResponse __all__ = ["TasksResource", "AsyncTasksResource"] @@ -109,69 +108,6 @@ def create( cast_to=TaskCreateResponse, ) - def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskRetrieveResponse: - """ - GetTask - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.EnvironmentAutomationService/GetTask", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - task_retrieve_params.TaskRetrieveParams, - ), - ), - cast_to=TaskRetrieveResponse, - ) - def retrieve_create( self, *, @@ -298,69 +234,6 @@ async def create( cast_to=TaskCreateResponse, ) - async def retrieve( - self, - *, - connect_protocol_version: Literal[1], - base64: str | NotGiven = NOT_GIVEN, - compression: str | NotGiven = NOT_GIVEN, - connect: str | NotGiven = NOT_GIVEN, - encoding: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskRetrieveResponse: - """ - GetTask - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.EnvironmentAutomationService/GetTask", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "base64": base64, - "compression": compression, - "connect": connect, - "encoding": encoding, - "message": message, - }, - task_retrieve_params.TaskRetrieveParams, - ), - ), - cast_to=TaskRetrieveResponse, - ) - async def retrieve_create( self, *, @@ -416,9 +289,6 @@ def __init__(self, tasks: TasksResource) -> None: self.create = to_raw_response_wrapper( tasks.create, ) - self.retrieve = to_raw_response_wrapper( - tasks.retrieve, - ) self.retrieve_create = to_raw_response_wrapper( tasks.retrieve_create, ) @@ -431,9 +301,6 @@ def __init__(self, tasks: AsyncTasksResource) -> None: self.create = async_to_raw_response_wrapper( tasks.create, ) - self.retrieve = async_to_raw_response_wrapper( - tasks.retrieve, - ) self.retrieve_create = async_to_raw_response_wrapper( tasks.retrieve_create, ) @@ -446,9 +313,6 @@ def __init__(self, tasks: TasksResource) -> None: self.create = to_streamed_response_wrapper( tasks.create, ) - self.retrieve = to_streamed_response_wrapper( - tasks.retrieve, - ) self.retrieve_create = to_streamed_response_wrapper( tasks.retrieve_create, ) @@ -461,9 +325,6 @@ def __init__(self, tasks: AsyncTasksResource) -> None: self.create = async_to_streamed_response_wrapper( tasks.create, ) - self.retrieve = async_to_streamed_response_wrapper( - tasks.retrieve, - ) self.retrieve_create = async_to_streamed_response_wrapper( tasks.retrieve_create, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index e33aeb77..86aae494 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -2,41 +2,35 @@ from __future__ import annotations +from .editor_list_params import EditorListParams as EditorListParams from .runner_list_params import RunnerListParams as RunnerListParams from .task_create_params import TaskCreateParams as TaskCreateParams -from .service_list_params import ServiceListParams as ServiceListParams from .service_stop_params import ServiceStopParams as ServiceStopParams +from .editor_list_response import EditorListResponse as EditorListResponse from .runner_create_params import RunnerCreateParams as RunnerCreateParams from .runner_list_response import RunnerListResponse as RunnerListResponse from .service_start_params import ServiceStartParams as ServiceStartParams from .task_create_response import TaskCreateResponse as TaskCreateResponse -from .task_retrieve_params import TaskRetrieveParams as TaskRetrieveParams from .project_create_params import ProjectCreateParams as ProjectCreateParams from .service_delete_params import ServiceDeleteParams as ServiceDeleteParams -from .service_list_response import ServiceListResponse as ServiceListResponse from .service_update_params import ServiceUpdateParams as ServiceUpdateParams +from .editor_retrieve_params import EditorRetrieveParams as EditorRetrieveParams from .runner_create_response import RunnerCreateResponse as RunnerCreateResponse -from .runner_retrieve_params import RunnerRetrieveParams as RunnerRetrieveParams -from .task_retrieve_response import TaskRetrieveResponse as TaskRetrieveResponse from .environment_list_params import EnvironmentListParams as EnvironmentListParams from .project_create_response import ProjectCreateResponse as ProjectCreateResponse -from .project_retrieve_params import ProjectRetrieveParams as ProjectRetrieveParams +from .editor_retrieve_response import EditorRetrieveResponse as EditorRetrieveResponse from .environment_start_params import EnvironmentStartParams as EnvironmentStartParams from .runner_get_runner_params import RunnerGetRunnerParams as RunnerGetRunnerParams -from .runner_retrieve_response import RunnerRetrieveResponse as RunnerRetrieveResponse from .environment_create_params import EnvironmentCreateParams as EnvironmentCreateParams from .environment_list_response import EnvironmentListResponse as EnvironmentListResponse from .organization_leave_params import OrganizationLeaveParams as OrganizationLeaveParams -from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse from .runner_get_runner_response import RunnerGetRunnerResponse as RunnerGetRunnerResponse -from .service_list_create_params import ServiceListCreateParams as ServiceListCreateParams from .environment_create_response import EnvironmentCreateResponse as EnvironmentCreateResponse from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams from .runner_delete_runner_params import RunnerDeleteRunnerParams as RunnerDeleteRunnerParams from .runner_update_runner_params import RunnerUpdateRunnerParams as RunnerUpdateRunnerParams from .task_retrieve_create_params import TaskRetrieveCreateParams as TaskRetrieveCreateParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams -from .service_list_create_response import ServiceListCreateResponse as ServiceListCreateResponse from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse from .task_retrieve_create_response import TaskRetrieveCreateResponse as TaskRetrieveCreateResponse @@ -44,10 +38,12 @@ from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams from .automations_file_upsert_response import AutomationsFileUpsertResponse as AutomationsFileUpsertResponse +from .editor_resolve_editor_url_params import EditorResolveEditorURLParams as EditorResolveEditorURLParams from .runner_interaction_signup_params import RunnerInteractionSignupParams as RunnerInteractionSignupParams from .personal_access_token_list_params import PersonalAccessTokenListParams as PersonalAccessTokenListParams from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse +from .editor_resolve_editor_url_response import EditorResolveEditorURLResponse as EditorResolveEditorURLResponse from .runner_interaction_signup_response import RunnerInteractionSignupResponse as RunnerInteractionSignupResponse from .personal_access_token_delete_params import PersonalAccessTokenDeleteParams as PersonalAccessTokenDeleteParams from .personal_access_token_list_response import PersonalAccessTokenListResponse as PersonalAccessTokenListResponse diff --git a/src/gitpod/types/automations_file_upsert_params.py b/src/gitpod/types/automations_file_upsert_params.py index 49148f19..af2ad035 100644 --- a/src/gitpod/types/automations_file_upsert_params.py +++ b/src/gitpod/types/automations_file_upsert_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -71,6 +71,8 @@ class AutomationsFileServices(TypedDict, total=False): name: str + runs_on: Annotated[Union[object, object], PropertyInfo(alias="runsOn")] + triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] @@ -83,6 +85,8 @@ class AutomationsFileTasks(TypedDict, total=False): name: str + runs_on: Annotated[Union[object, object], PropertyInfo(alias="runsOn")] + triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] diff --git a/src/gitpod/types/service_list_create_params.py b/src/gitpod/types/editor_list_params.py similarity index 58% rename from src/gitpod/types/service_list_create_params.py rename to src/gitpod/types/editor_list_params.py index 1a5eb592..610436cf 100644 --- a/src/gitpod/types/service_list_create_params.py +++ b/src/gitpod/types/editor_list_params.py @@ -2,21 +2,17 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["ServiceListCreateParams", "Filter", "Pagination"] +__all__ = ["EditorListParams", "Pagination"] -class ServiceListCreateParams(TypedDict, total=False): +class EditorListParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: Filter - """filter contains the filter options for listing services""" - pagination: Pagination """pagination contains the pagination options for listing environments""" @@ -24,17 +20,6 @@ class ServiceListCreateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] - """environment_ids filters the response to only services of these environments""" - - references: List[str] - """references filters the response to only services with these references""" - - service_ids: Annotated[List[str], PropertyInfo(alias="serviceIds")] - """service_ids filters the response to only services with these IDs""" - - class Pagination(TypedDict, total=False): token: str """ diff --git a/src/gitpod/types/editor_list_response.py b/src/gitpod/types/editor_list_response.py new file mode 100644 index 00000000..683f2a26 --- /dev/null +++ b/src/gitpod/types/editor_list_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EditorListResponse", "Editor", "Pagination"] + + +class Editor(BaseModel): + id: Optional[str] = None + + icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) + + installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) + + name: Optional[str] = None + + short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) + + url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) + + +class Pagination(BaseModel): + token: Optional[str] = None + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Optional[int] = FieldInfo(alias="pageSize", default=None) + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ + + +class EditorListResponse(BaseModel): + editors: Optional[List[Editor]] = None + """editors contains the list of editors""" + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/editor_resolve_editor_url_params.py b/src/gitpod/types/editor_resolve_editor_url_params.py new file mode 100644 index 00000000..633fa6fd --- /dev/null +++ b/src/gitpod/types/editor_resolve_editor_url_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EditorResolveEditorURLParams"] + + +class EditorResolveEditorURLParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + editor_id: Annotated[str, PropertyInfo(alias="editorId")] + """editorId is the ID of the editor to resolve the URL for""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environmentId is the ID of the environment to resolve the URL for""" + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organizationId is the ID of the organization to resolve the URL for""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/editor_resolve_editor_url_response.py b/src/gitpod/types/editor_resolve_editor_url_response.py new file mode 100644 index 00000000..68e452be --- /dev/null +++ b/src/gitpod/types/editor_resolve_editor_url_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["EditorResolveEditorURLResponse"] + + +class EditorResolveEditorURLResponse(BaseModel): + url: Optional[str] = None + """url is the resolved editor URL""" diff --git a/src/gitpod/types/service_list_params.py b/src/gitpod/types/editor_retrieve_params.py similarity index 74% rename from src/gitpod/types/service_list_params.py rename to src/gitpod/types/editor_retrieve_params.py index 619baec5..a0a1e574 100644 --- a/src/gitpod/types/service_list_params.py +++ b/src/gitpod/types/editor_retrieve_params.py @@ -6,22 +6,15 @@ from .._utils import PropertyInfo -__all__ = ["ServiceListParams"] +__all__ = ["EditorRetrieveParams"] -class ServiceListParams(TypedDict, total=False): +class EditorRetrieveParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: str - - compression: str - - connect: str - - encoding: str - - message: str + id: str + """id is the ID of the editor to get""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/editor_retrieve_response.py b/src/gitpod/types/editor_retrieve_response.py new file mode 100644 index 00000000..774b3d09 --- /dev/null +++ b/src/gitpod/types/editor_retrieve_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EditorRetrieveResponse", "Editor"] + + +class Editor(BaseModel): + id: Optional[str] = None + + icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) + + installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) + + name: Optional[str] = None + + short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) + + url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) + + +class EditorRetrieveResponse(BaseModel): + editor: Optional[Editor] = None + """editor contains the editor""" diff --git a/src/gitpod/types/environment_automations/__init__.py b/src/gitpod/types/environment_automations/__init__.py index ddf0450b..d1000b3e 100644 --- a/src/gitpod/types/environment_automations/__init__.py +++ b/src/gitpod/types/environment_automations/__init__.py @@ -8,15 +8,11 @@ from .task_list_response import TaskListResponse as TaskListResponse from .task_update_params import TaskUpdateParams as TaskUpdateParams from .task_start_response import TaskStartResponse as TaskStartResponse -from .task_create_list_params import TaskCreateListParams as TaskCreateListParams -from .task_create_list_response import TaskCreateListResponse as TaskCreateListResponse from .task_execution_list_params import TaskExecutionListParams as TaskExecutionListParams from .task_execution_stop_params import TaskExecutionStopParams as TaskExecutionStopParams from .task_execution_list_response import TaskExecutionListResponse as TaskExecutionListResponse from .task_execution_retrieve_params import TaskExecutionRetrieveParams as TaskExecutionRetrieveParams from .task_execution_retrieve_response import TaskExecutionRetrieveResponse as TaskExecutionRetrieveResponse -from .task_execution_create_list_params import TaskExecutionCreateListParams as TaskExecutionCreateListParams -from .task_execution_create_list_response import TaskExecutionCreateListResponse as TaskExecutionCreateListResponse from .task_execution_create_retrieve_params import ( TaskExecutionCreateRetrieveParams as TaskExecutionCreateRetrieveParams, ) diff --git a/src/gitpod/types/environment_automations/task_create_list_params.py b/src/gitpod/types/environment_automations/task_create_list_params.py deleted file mode 100644 index 601844e0..00000000 --- a/src/gitpod/types/environment_automations/task_create_list_params.py +++ /dev/null @@ -1,49 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["TaskCreateListParams", "Filter", "Pagination"] - - -class TaskCreateListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - """filter contains the filter options for listing tasks""" - - pagination: Pagination - """pagination contains the pagination options for listing tasks""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] - """environment_ids filters the response to only tasks of these environments""" - - references: List[str] - """references filters the response to only services with these references""" - - task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] - """task_ids filters the response to only tasks with these IDs""" - - -class Pagination(TypedDict, total=False): - token: str - """ - Token for the next set of results that was returned as next_token of a - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/environment_automations/task_create_list_response.py b/src/gitpod/types/environment_automations/task_create_list_response.py deleted file mode 100644 index bb3c3d49..00000000 --- a/src/gitpod/types/environment_automations/task_create_list_response.py +++ /dev/null @@ -1,192 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = [ - "TaskCreateListResponse", - "Pagination", - "Task", - "TaskMetadata", - "TaskMetadataCreator", - "TaskMetadataTriggeredBy", - "TaskSpec", -] - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class TaskMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskMetadataTriggeredBy: - pass - - -class TaskMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskMetadataCreator] = None - """creator describes the principal who created the task.""" - - description: Optional[str] = None - """description is a user-facing description for the task. - - It can be used to provide context and documentation for the task. - """ - - name: Optional[str] = None - """name is a user-facing name for the task. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the task. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the task which must be unique on the - environment. It is used to express dependencies between tasks, and to identify - the task in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the task.""" - - -class TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - -class Task(BaseModel): - id: Optional[str] = None - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - """dependencies specifies the IDs of the automations this task depends on.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[TaskMetadata] = None - - spec: Optional[TaskSpec] = None - - -class TaskCreateListResponse(BaseModel): - pagination: Optional[Pagination] = None - - tasks: Optional[List[Task]] = None diff --git a/src/gitpod/types/environment_automations/task_execution_create_list_params.py b/src/gitpod/types/environment_automations/task_execution_create_list_params.py deleted file mode 100644 index 24926cb6..00000000 --- a/src/gitpod/types/environment_automations/task_execution_create_list_params.py +++ /dev/null @@ -1,61 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["TaskExecutionCreateListParams", "Filter", "Pagination"] - - -class TaskExecutionCreateListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - """filter contains the filter options for listing task runs""" - - pagination: Pagination - """pagination contains the pagination options for listing task runs""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] - """environment_ids filters the response to only task runs of these environments""" - - phases: List[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] - """phases filters the response to only task runs in these phases""" - - task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] - """task_ids filters the response to only task runs of these tasks""" - - task_references: Annotated[List[str], PropertyInfo(alias="taskReferences")] - """task_references filters the response to only task runs with this reference""" - - -class Pagination(TypedDict, total=False): - token: str - """ - Token for the next set of results that was returned as next_token of a - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/environment_automations/task_execution_create_list_response.py b/src/gitpod/types/environment_automations/task_execution_create_list_response.py deleted file mode 100644 index 8550a451..00000000 --- a/src/gitpod/types/environment_automations/task_execution_create_list_response.py +++ /dev/null @@ -1,457 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = [ - "TaskExecutionCreateListResponse", - "Pagination", - "TaskExecution", - "TaskExecutionMetadata", - "TaskExecutionMetadataCreator", - "TaskExecutionSpec", - "TaskExecutionSpecPlan", - "TaskExecutionSpecPlanStep", - "TaskExecutionStatus", - "TaskExecutionStatusStep", -] - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class TaskExecutionMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskExecutionMetadata(BaseModel): - completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskExecutionMetadataCreator] = None - """creator describes the principal who created/started the task run.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - """environment_id is the ID of the environment in which the task run is executed.""" - - started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) - """started_by describes the trigger that started the task execution.""" - - task_id: Optional[str] = FieldInfo(alias="taskId", default=None) - """task_id is the ID of the main task being executed.""" - - -class TaskExecutionSpecPlanStep: - pass - - -class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[TaskExecutionSpecPlanStep]] = None - - -class TaskExecutionSpec(BaseModel): - desired_phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the task execution should be in. - - Used to stop a running task execution early. - """ - - plan: Optional[List[TaskExecutionSpecPlan]] = None - """plan is a list of groups of steps. - - The steps in a group are executed concurrently, while the groups are executed - sequentially. The order of the groups is the order in which they are executed. - """ - - -class TaskExecutionStatusStep(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. - - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ - - -class TaskExecutionStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. - - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url is the URL to the logs of the task's steps. - - If this is empty, the task either has no logs or has not yet started. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ - - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. - """ - - steps: Optional[List[TaskExecutionStatusStep]] = None - """steps provides the status for each individual step of the task execution. - - If a step is missing it has not yet started. - """ - - -class TaskExecution(BaseModel): - id: Optional[str] = None - - metadata: Optional[TaskExecutionMetadata] = None - - spec: Optional[TaskExecutionSpec] = None - - status: Optional[TaskExecutionStatus] = None - - -class TaskExecutionCreateListResponse(BaseModel): - pagination: Optional[Pagination] = None - - task_executions: Optional[List[TaskExecution]] = FieldInfo(alias="taskExecutions", default=None) diff --git a/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py b/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py index d26a33b1..8c4be184 100644 --- a/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py +++ b/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py @@ -365,10 +365,10 @@ class TaskExecutionStatusStep(BaseModel): """ID is the ID of the execution step""" failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. + """failure_message summarises why the step failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty the step has failed to operate and will likely transition + to a failed state. """ phase: Optional[ @@ -381,18 +381,15 @@ class TaskExecutionStatusStep(BaseModel): "TASK_EXECUTION_PHASE_STOPPED", ] ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ + """phase is the current phase of the execution step""" class TaskExecutionStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. + """failure_message summarises why the task execution failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty the task execution has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) @@ -411,18 +408,15 @@ class TaskExecutionStatus(BaseModel): "TASK_EXECUTION_PHASE_STOPPED", ] ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ + """the phase of a task execution represents the aggregated phase of all steps.""" - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) """version of the status update. - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. + Task executions themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. """ steps: Optional[List[TaskExecutionStatusStep]] = None diff --git a/src/gitpod/types/environment_automations/task_execution_list_params.py b/src/gitpod/types/environment_automations/task_execution_list_params.py index dcc6cf70..d730d88d 100644 --- a/src/gitpod/types/environment_automations/task_execution_list_params.py +++ b/src/gitpod/types/environment_automations/task_execution_list_params.py @@ -2,26 +2,60 @@ from __future__ import annotations +from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["TaskExecutionListParams"] +__all__ = ["TaskExecutionListParams", "Filter", "Pagination"] class TaskExecutionListParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: str + filter: Filter + """filter contains the filter options for listing task runs""" - compression: str + pagination: Pagination + """pagination contains the pagination options for listing task runs""" - connect: str + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" - encoding: str - message: str +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only task runs of these environments""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + phases: List[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] + """phases filters the response to only task runs in these phases""" + + task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] + """task_ids filters the response to only task runs of these tasks""" + + task_references: Annotated[List[str], PropertyInfo(alias="taskReferences")] + """task_references filters the response to only task runs with this reference""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environment_automations/task_execution_list_response.py b/src/gitpod/types/environment_automations/task_execution_list_response.py index 60048a2b..1498e42a 100644 --- a/src/gitpod/types/environment_automations/task_execution_list_response.py +++ b/src/gitpod/types/environment_automations/task_execution_list_response.py @@ -374,10 +374,10 @@ class TaskExecutionStatusStep(BaseModel): """ID is the ID of the execution step""" failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. + """failure_message summarises why the step failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty the step has failed to operate and will likely transition + to a failed state. """ phase: Optional[ @@ -390,18 +390,15 @@ class TaskExecutionStatusStep(BaseModel): "TASK_EXECUTION_PHASE_STOPPED", ] ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ + """phase is the current phase of the execution step""" class TaskExecutionStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. + """failure_message summarises why the task execution failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty the task execution has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) @@ -420,18 +417,15 @@ class TaskExecutionStatus(BaseModel): "TASK_EXECUTION_PHASE_STOPPED", ] ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ + """the phase of a task execution represents the aggregated phase of all steps.""" - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) """version of the status update. - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. + Task executions themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. """ steps: Optional[List[TaskExecutionStatusStep]] = None diff --git a/src/gitpod/types/environment_automations/task_execution_retrieve_params.py b/src/gitpod/types/environment_automations/task_execution_retrieve_params.py index c109c67f..f18d67d1 100644 --- a/src/gitpod/types/environment_automations/task_execution_retrieve_params.py +++ b/src/gitpod/types/environment_automations/task_execution_retrieve_params.py @@ -13,15 +13,7 @@ class TaskExecutionRetrieveParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: str - - compression: str - - connect: str - - encoding: str - - message: str + id: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_execution_retrieve_response.py b/src/gitpod/types/environment_automations/task_execution_retrieve_response.py index 2da79f54..960aeacc 100644 --- a/src/gitpod/types/environment_automations/task_execution_retrieve_response.py +++ b/src/gitpod/types/environment_automations/task_execution_retrieve_response.py @@ -365,10 +365,10 @@ class TaskExecutionStatusStep(BaseModel): """ID is the ID of the execution step""" failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. + """failure_message summarises why the step failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty the step has failed to operate and will likely transition + to a failed state. """ phase: Optional[ @@ -381,18 +381,15 @@ class TaskExecutionStatusStep(BaseModel): "TASK_EXECUTION_PHASE_STOPPED", ] ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ + """phase is the current phase of the execution step""" class TaskExecutionStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. + """failure_message summarises why the task execution failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty the task execution has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) @@ -411,18 +408,15 @@ class TaskExecutionStatus(BaseModel): "TASK_EXECUTION_PHASE_STOPPED", ] ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ + """the phase of a task execution represents the aggregated phase of all steps.""" - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) """version of the status update. - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. + Task executions themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. """ steps: Optional[List[TaskExecutionStatusStep]] = None diff --git a/src/gitpod/types/environment_automations/task_list_params.py b/src/gitpod/types/environment_automations/task_list_params.py index f74ba3d5..44679a8a 100644 --- a/src/gitpod/types/environment_automations/task_list_params.py +++ b/src/gitpod/types/environment_automations/task_list_params.py @@ -2,26 +2,48 @@ from __future__ import annotations +from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["TaskListParams"] +__all__ = ["TaskListParams", "Filter", "Pagination"] class TaskListParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: str + filter: Filter + """filter contains the filter options for listing tasks""" - compression: str + pagination: Pagination + """pagination contains the pagination options for listing tasks""" - connect: str + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" - encoding: str - message: str +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only tasks of these environments""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + references: List[str] + """references filters the response to only services with these references""" + + task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] + """task_ids filters the response to only tasks with these IDs""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environment_automations/task_list_response.py b/src/gitpod/types/environment_automations/task_list_response.py index 1ef850b9..b460a4fe 100644 --- a/src/gitpod/types/environment_automations/task_list_response.py +++ b/src/gitpod/types/environment_automations/task_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -172,6 +172,9 @@ class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" + runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + class Task(BaseModel): id: Optional[str] = None diff --git a/src/gitpod/types/environment_automations/task_start_response.py b/src/gitpod/types/environment_automations/task_start_response.py index 415e447a..8a20139d 100644 --- a/src/gitpod/types/environment_automations/task_start_response.py +++ b/src/gitpod/types/environment_automations/task_start_response.py @@ -365,10 +365,10 @@ class TaskExecutionStatusStep(BaseModel): """ID is the ID of the execution step""" failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. + """failure_message summarises why the step failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty the step has failed to operate and will likely transition + to a failed state. """ phase: Optional[ @@ -381,18 +381,15 @@ class TaskExecutionStatusStep(BaseModel): "TASK_EXECUTION_PHASE_STOPPED", ] ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ + """phase is the current phase of the execution step""" class TaskExecutionStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. + """failure_message summarises why the task execution failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty the task execution has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) @@ -411,18 +408,15 @@ class TaskExecutionStatus(BaseModel): "TASK_EXECUTION_PHASE_STOPPED", ] ] = None - """ - the phase of a environment is a simple, high-level summary of where the - environment is in its lifecycle - """ + """the phase of a task execution represents the aggregated phase of all steps.""" - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) """version of the status update. - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. + Task executions themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. """ steps: Optional[List[TaskExecutionStatusStep]] = None diff --git a/src/gitpod/types/environment_automations/task_update_params.py b/src/gitpod/types/environment_automations/task_update_params.py index b89872fc..8f740ab7 100644 --- a/src/gitpod/types/environment_automations/task_update_params.py +++ b/src/gitpod/types/environment_automations/task_update_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Union +from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["TaskUpdateParams", "Metadata"] +__all__ = ["TaskUpdateParams", "Metadata", "Spec"] class TaskUpdateParams(TypedDict, total=False): @@ -21,7 +21,7 @@ class TaskUpdateParams(TypedDict, total=False): metadata: Metadata - spec: Union[object, object] + spec: Spec connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" @@ -29,3 +29,7 @@ class TaskUpdateParams(TypedDict, total=False): class Metadata: pass + + +class Spec: + pass diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index b4269a08..c3319113 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -43,7 +43,12 @@ class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: str @@ -74,7 +79,11 @@ class SpecDevcontainer(TypedDict, total=False): devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] """ devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: str @@ -217,7 +226,7 @@ class Spec(TypedDict, total=False): secrets: Iterable[SpecSecret] """secrets are confidential data that is mounted into the environment""" - spec_version: Annotated[Union[str, float], PropertyInfo(alias="specVersion")] + spec_version: Annotated[Union[int, str], PropertyInfo(alias="specVersion")] """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index 4cc06297..233bb62b 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -25,6 +25,7 @@ "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", + "EnvironmentStatusActivitySignal", "EnvironmentStatusAutomationsFile", "EnvironmentStatusContent", "EnvironmentStatusContentGit", @@ -160,6 +161,98 @@ class EnvironmentMetadata(BaseModel): creator: Optional[EnvironmentMetadataCreator] = None """creator is the identity of the creator of the environment""" + last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + name: Optional[str] = None """name is the name of the environment as specified by the user""" @@ -186,7 +279,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -217,7 +315,11 @@ class EnvironmentSpecDevcontainer(BaseModel): devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -357,7 +459,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -372,6 +474,107 @@ class EnvironmentSpec(BaseModel): """Timeout configures the environment timeout""" +class EnvironmentStatusActivitySignal(BaseModel): + source: Optional[str] = None + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Optional[datetime] = None + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + class EnvironmentStatusAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ @@ -631,7 +834,7 @@ class EnvironmentStatusMachine(BaseModel): class EnvironmentStatusRunnerAck(BaseModel): message: Optional[str] = None - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) status_code: Optional[ Literal[ @@ -660,6 +863,9 @@ class EnvironmentStatusSecret(BaseModel): secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) """warning_message contains warnings, e.g. @@ -685,6 +891,9 @@ class EnvironmentStatusSSHPublicKey(BaseModel): class EnvironmentStatus(BaseModel): + activity_signal: Optional[EnvironmentStatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) + """EnvironmentActivitySignal used to signal activity for an environment.""" + automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) """automations_file contains the status of the automations file.""" @@ -740,13 +949,13 @@ class EnvironmentStatus(BaseModel): ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys contains the status of the environment ssh public keys""" - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) """version of the status update. - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. + Environment instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. """ warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index 1b11b976..ceb052e3 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -41,7 +41,12 @@ class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: str @@ -72,7 +77,11 @@ class SpecDevcontainer(TypedDict, total=False): devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] """ devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: str @@ -215,7 +224,7 @@ class Spec(TypedDict, total=False): secrets: Iterable[SpecSecret] """secrets are confidential data that is mounted into the environment""" - spec_version: Annotated[Union[str, float], PropertyInfo(alias="specVersion")] + spec_version: Annotated[Union[int, str], PropertyInfo(alias="specVersion")] """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index ca2b1df5..a2f8df56 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -25,6 +25,7 @@ "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", + "EnvironmentStatusActivitySignal", "EnvironmentStatusAutomationsFile", "EnvironmentStatusContent", "EnvironmentStatusContentGit", @@ -160,6 +161,98 @@ class EnvironmentMetadata(BaseModel): creator: Optional[EnvironmentMetadataCreator] = None """creator is the identity of the creator of the environment""" + last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + name: Optional[str] = None """name is the name of the environment as specified by the user""" @@ -186,7 +279,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -217,7 +315,11 @@ class EnvironmentSpecDevcontainer(BaseModel): devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -357,7 +459,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -372,6 +474,107 @@ class EnvironmentSpec(BaseModel): """Timeout configures the environment timeout""" +class EnvironmentStatusActivitySignal(BaseModel): + source: Optional[str] = None + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Optional[datetime] = None + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + class EnvironmentStatusAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ @@ -631,7 +834,7 @@ class EnvironmentStatusMachine(BaseModel): class EnvironmentStatusRunnerAck(BaseModel): message: Optional[str] = None - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) status_code: Optional[ Literal[ @@ -660,6 +863,9 @@ class EnvironmentStatusSecret(BaseModel): secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) """warning_message contains warnings, e.g. @@ -685,6 +891,9 @@ class EnvironmentStatusSSHPublicKey(BaseModel): class EnvironmentStatus(BaseModel): + activity_signal: Optional[EnvironmentStatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) + """EnvironmentActivitySignal used to signal activity for an environment.""" + automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) """automations_file contains the status of the automations file.""" @@ -740,13 +949,13 @@ class EnvironmentStatus(BaseModel): ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys contains the status of the environment ssh public keys""" - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) """version of the status update. - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. + Environment instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. """ warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index e5be7002..d0f5b6eb 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -44,6 +44,19 @@ class Filter(TypedDict, total=False): runner_ids filters the response to only Environments running on these Runner IDs """ + runner_kinds: Annotated[ + List[ + Literal[ + "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" + ] + ], + PropertyInfo(alias="runnerKinds"), + ] + """ + runner_kinds filters the response to only Environments running on these Runner + Kinds + """ + status_phases: Annotated[ List[ Literal[ diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py index bb11b143..1e363180 100644 --- a/src/gitpod/types/environment_list_response.py +++ b/src/gitpod/types/environment_list_response.py @@ -25,6 +25,7 @@ "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", + "EnvironmentStatusActivitySignal", "EnvironmentStatusAutomationsFile", "EnvironmentStatusContent", "EnvironmentStatusContentGit", @@ -161,6 +162,98 @@ class EnvironmentMetadata(BaseModel): creator: Optional[EnvironmentMetadataCreator] = None """creator is the identity of the creator of the environment""" + last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + name: Optional[str] = None """name is the name of the environment as specified by the user""" @@ -187,7 +280,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -218,7 +316,11 @@ class EnvironmentSpecDevcontainer(BaseModel): devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -358,7 +460,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -373,6 +475,107 @@ class EnvironmentSpec(BaseModel): """Timeout configures the environment timeout""" +class EnvironmentStatusActivitySignal(BaseModel): + source: Optional[str] = None + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Optional[datetime] = None + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + class EnvironmentStatusAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ @@ -632,7 +835,7 @@ class EnvironmentStatusMachine(BaseModel): class EnvironmentStatusRunnerAck(BaseModel): message: Optional[str] = None - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) status_code: Optional[ Literal[ @@ -661,6 +864,9 @@ class EnvironmentStatusSecret(BaseModel): secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) """warning_message contains warnings, e.g. @@ -686,6 +892,9 @@ class EnvironmentStatusSSHPublicKey(BaseModel): class EnvironmentStatus(BaseModel): + activity_signal: Optional[EnvironmentStatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) + """EnvironmentActivitySignal used to signal activity for an environment.""" + automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) """automations_file contains the status of the automations file.""" @@ -741,13 +950,13 @@ class EnvironmentStatus(BaseModel): ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys contains the status of the environment ssh public keys""" - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) """version of the status update. - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. + Environment instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. """ warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index c603be06..6806cc5e 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -25,6 +25,7 @@ "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", + "EnvironmentStatusActivitySignal", "EnvironmentStatusAutomationsFile", "EnvironmentStatusContent", "EnvironmentStatusContentGit", @@ -160,6 +161,98 @@ class EnvironmentMetadata(BaseModel): creator: Optional[EnvironmentMetadataCreator] = None """creator is the identity of the creator of the environment""" + last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + name: Optional[str] = None """name is the name of the environment as specified by the user""" @@ -186,7 +279,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -217,7 +315,11 @@ class EnvironmentSpecDevcontainer(BaseModel): devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -357,7 +459,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -372,6 +474,107 @@ class EnvironmentSpec(BaseModel): """Timeout configures the environment timeout""" +class EnvironmentStatusActivitySignal(BaseModel): + source: Optional[str] = None + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Optional[datetime] = None + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + class EnvironmentStatusAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ @@ -631,7 +834,7 @@ class EnvironmentStatusMachine(BaseModel): class EnvironmentStatusRunnerAck(BaseModel): message: Optional[str] = None - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) status_code: Optional[ Literal[ @@ -660,6 +863,9 @@ class EnvironmentStatusSecret(BaseModel): secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) """warning_message contains warnings, e.g. @@ -685,6 +891,9 @@ class EnvironmentStatusSSHPublicKey(BaseModel): class EnvironmentStatus(BaseModel): + activity_signal: Optional[EnvironmentStatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) + """EnvironmentActivitySignal used to signal activity for an environment.""" + automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) """automations_file contains the status of the automations file.""" @@ -740,13 +949,13 @@ class EnvironmentStatus(BaseModel): ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys contains the status of the environment ssh public keys""" - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) """version of the status update. - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. + Environment instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. """ warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) diff --git a/src/gitpod/types/organizations/member_list_response.py b/src/gitpod/types/organizations/member_list_response.py index 137d1351..85ae8a9d 100644 --- a/src/gitpod/types/organizations/member_list_response.py +++ b/src/gitpod/types/organizations/member_list_response.py @@ -18,6 +18,9 @@ class Member(BaseModel): full_name: Optional[str] = FieldInfo(alias="fullName", default=None) + login_provider: Optional[str] = FieldInfo(alias="loginProvider", default=None) + """login_provider is the login provider the user uses to sign in""" + member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) """ A Timestamp represents a point in time independent of any time zone or local diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index 83d88cb9..259bd607 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -22,13 +22,21 @@ class ProjectCreateParams(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] """ devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ name: str diff --git a/src/gitpod/types/project_retrieve_params.py b/src/gitpod/types/project_retrieve_params.py deleted file mode 100644 index 9ebcf753..00000000 --- a/src/gitpod/types/project_retrieve_params.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["ProjectRetrieveParams"] - - -class ProjectRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - base64: str - - compression: str - - connect: str - - encoding: str - - message: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py deleted file mode 100644 index 524e6152..00000000 --- a/src/gitpod/types/project_retrieve_response.py +++ /dev/null @@ -1,298 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = [ - "ProjectRetrieveResponse", - "Project", - "ProjectInitializer", - "ProjectInitializerSpec", - "ProjectMetadata", - "ProjectMetadataCreator", - "ProjectUsedBy", - "ProjectUsedBySubject", -] - - -class ProjectInitializerSpec: - pass - - -class ProjectInitializer(BaseModel): - specs: Optional[List[ProjectInitializerSpec]] = None - - -class ProjectMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[ProjectMetadataCreator] = None - """creator is the identity of the project creator""" - - name: Optional[str] = None - """name is the human readable name of the project""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class ProjectUsedBySubject(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectUsedBy(BaseModel): - subjects: Optional[List[ProjectUsedBySubject]] = None - """ - Subjects are the 10 most recent subjects who have used the project to create an - environment - """ - - total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) - """Total number of unique subjects who have used the project""" - - -class Project(BaseModel): - environment_class: Union[object, object, object] = FieldInfo(alias="environmentClass") - - id: Optional[str] = None - """id is the unique identifier for the project""" - - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - initializer: Optional[ProjectInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - metadata: Optional[ProjectMetadata] = None - - used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) - - -class ProjectRetrieveResponse(BaseModel): - project: Optional[Project] = None diff --git a/src/gitpod/types/runner_check_authentication_for_host_response.py b/src/gitpod/types/runner_check_authentication_for_host_response.py index 38f8b973..fe73a2a0 100644 --- a/src/gitpod/types/runner_check_authentication_for_host_response.py +++ b/src/gitpod/types/runner_check_authentication_for_host_response.py @@ -15,3 +15,5 @@ class RunnerCheckAuthenticationForHostResponse(BaseModel): authentication_url: Optional[str] = FieldInfo(alias="authenticationUrl", default=None) pat_supported: Optional[bool] = FieldInfo(alias="patSupported", default=None) + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) diff --git a/src/gitpod/types/runner_configurations/__init__.py b/src/gitpod/types/runner_configurations/__init__.py index bab7e5ce..8e730de9 100644 --- a/src/gitpod/types/runner_configurations/__init__.py +++ b/src/gitpod/types/runner_configurations/__init__.py @@ -9,13 +9,9 @@ from .scm_integration_create_response import ScmIntegrationCreateResponse as ScmIntegrationCreateResponse from .configuration_schema_create_params import ConfigurationSchemaCreateParams as ConfigurationSchemaCreateParams from .configuration_schema_create_response import ConfigurationSchemaCreateResponse as ConfigurationSchemaCreateResponse -from .configuration_schema_retrieve_params import ConfigurationSchemaRetrieveParams as ConfigurationSchemaRetrieveParams from .host_authentication_token_list_params import ( HostAuthenticationTokenListParams as HostAuthenticationTokenListParams, ) -from .configuration_schema_retrieve_response import ( - ConfigurationSchemaRetrieveResponse as ConfigurationSchemaRetrieveResponse, -) from .host_authentication_token_create_params import ( HostAuthenticationTokenCreateParams as HostAuthenticationTokenCreateParams, ) @@ -31,9 +27,3 @@ from .host_authentication_token_create_response import ( HostAuthenticationTokenCreateResponse as HostAuthenticationTokenCreateResponse, ) -from .host_authentication_token_retrieve_params import ( - HostAuthenticationTokenRetrieveParams as HostAuthenticationTokenRetrieveParams, -) -from .host_authentication_token_retrieve_response import ( - HostAuthenticationTokenRetrieveResponse as HostAuthenticationTokenRetrieveResponse, -) diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py deleted file mode 100644 index 4ba5ac37..00000000 --- a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["ConfigurationSchemaRetrieveParams"] - - -class ConfigurationSchemaRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - base64: str - - compression: str - - connect: str - - encoding: str - - message: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py deleted file mode 100644 index ac96d70f..00000000 --- a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py +++ /dev/null @@ -1,71 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = [ - "ConfigurationSchemaRetrieveResponse", - "Schema", - "SchemaEnvironmentClass", - "SchemaRunnerConfig", - "SchemaScm", - "SchemaScmOAuth", - "SchemaScmPat", -] - - -class SchemaEnvironmentClass: - pass - - -class SchemaRunnerConfig: - pass - - -class SchemaScmOAuth(BaseModel): - callback_url: Optional[str] = FieldInfo(alias="callbackUrl", default=None) - """ - callback_url is the URL the OAuth app will redirect to after the user has - authenticated. - """ - - -class SchemaScmPat(BaseModel): - description: Optional[str] = None - """description is a human-readable description of the PAT.""" - - docs_link: Optional[str] = FieldInfo(alias="docsLink", default=None) - """ - docs_link is a link to the documentation on how to create a PAT for this SCM - system. - """ - - -class SchemaScm(BaseModel): - default_hosts: Optional[List[str]] = FieldInfo(alias="defaultHosts", default=None) - - name: Optional[str] = None - - oauth: Optional[SchemaScmOAuth] = None - - pat: Optional[SchemaScmPat] = None - - scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) - - -class Schema(BaseModel): - environment_classes: Optional[List[SchemaEnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) - - runner_config: Optional[List[SchemaRunnerConfig]] = FieldInfo(alias="runnerConfig", default=None) - - scm: Optional[List[SchemaScm]] = None - - version: Optional[str] = None - """The schema version""" - - -class ConfigurationSchemaRetrieveResponse(BaseModel): - schema_: Optional[Schema] = FieldInfo(alias="schema", default=None) diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py b/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py index 1ce9bac5..0ddfb651 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from datetime import datetime from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -13,6 +14,98 @@ class Token(BaseModel): id: Optional[str] = None + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + host: Optional[str] = None runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py index 93f1b005..3347a5e9 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from datetime import datetime from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -21,6 +22,98 @@ class Pagination(BaseModel): class Token(BaseModel): id: Optional[str] = None + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + host: Optional[str] = None runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py deleted file mode 100644 index 21eda2d1..00000000 --- a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["HostAuthenticationTokenRetrieveParams"] - - -class HostAuthenticationTokenRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - base64: str - - compression: str - - connect: str - - encoding: str - - message: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py deleted file mode 100644 index cd4d8a29..00000000 --- a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py +++ /dev/null @@ -1,32 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HostAuthenticationTokenRetrieveResponse", "Token"] - - -class Token(BaseModel): - id: Optional[str] = None - - host: Optional[str] = None - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - source: Optional[ - Literal[ - "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", - "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", - ] - ] = None - - user_id: Optional[str] = FieldInfo(alias="userId", default=None) - - -class HostAuthenticationTokenRetrieveResponse(BaseModel): - token: Optional[Token] = None diff --git a/src/gitpod/types/runner_create_params.py b/src/gitpod/types/runner_create_params.py index 6dfedea5..4e37b01e 100644 --- a/src/gitpod/types/runner_create_params.py +++ b/src/gitpod/types/runner_create_params.py @@ -13,7 +13,9 @@ class RunnerCreateParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - kind: Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"] + kind: Literal[ + "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" + ] """RunnerKind represents the kind of a runner""" name: str diff --git a/src/gitpod/types/runner_create_response.py b/src/gitpod/types/runner_create_response.py index 4888ede0..46747b0b 100644 --- a/src/gitpod/types/runner_create_response.py +++ b/src/gitpod/types/runner_create_response.py @@ -84,6 +84,11 @@ class RunnerStatus(BaseModel): a CloudFormation stack URL. """ + capabilities: Optional[ + List[Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"]] + ] = None + """capabilities is a list of capabilities the runner supports.""" + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) message: Optional[str] = None @@ -301,7 +306,9 @@ class Runner(BaseModel): creator: Optional[RunnerCreator] = None """creator is the identity of the creator of the environment""" - kind: Optional[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] = None + kind: Optional[ + Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] + ] = None """RunnerKind represents the kind of a runner""" name: Optional[str] = None diff --git a/src/gitpod/types/runner_get_runner_response.py b/src/gitpod/types/runner_get_runner_response.py index 9598eb2b..b03fcf18 100644 --- a/src/gitpod/types/runner_get_runner_response.py +++ b/src/gitpod/types/runner_get_runner_response.py @@ -84,6 +84,11 @@ class RunnerStatus(BaseModel): a CloudFormation stack URL. """ + capabilities: Optional[ + List[Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"]] + ] = None + """capabilities is a list of capabilities the runner supports.""" + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) message: Optional[str] = None @@ -301,7 +306,9 @@ class Runner(BaseModel): creator: Optional[RunnerCreator] = None """creator is the identity of the creator of the environment""" - kind: Optional[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] = None + kind: Optional[ + Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] + ] = None """RunnerKind represents the kind of a runner""" name: Optional[str] = None diff --git a/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py b/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py index ad28e81c..ecfaf690 100644 --- a/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py +++ b/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py @@ -1,6 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,11 +12,118 @@ class RunnerInteractionGetHostAuthenticationTokenValueResponse(BaseModel): + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + refresh_token: Optional[str] = FieldInfo(alias="refreshToken", default=None) + """ + The host authentication token's refresh token encrypted as NaCL anonymous sealed + box using the runner's public key + """ + + source: Optional[ + Literal[ + "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", + ] + ] = None + """The host authentication token's source""" + token_id: Optional[str] = FieldInfo(alias="tokenId", default=None) """The host authentication token's ID""" value: Optional[str] = None """ The authentication token encrypted as NaCL anonymous sealed box using the - runner's public key. + runner's public key """ diff --git a/src/gitpod/types/runner_interactions/environment_list_response.py b/src/gitpod/types/runner_interactions/environment_list_response.py index aca7c7cc..65e80b00 100644 --- a/src/gitpod/types/runner_interactions/environment_list_response.py +++ b/src/gitpod/types/runner_interactions/environment_list_response.py @@ -11,6 +11,7 @@ __all__ = [ "EnvironmentListResponse", "Environment", + "EnvironmentActivitySignal", "EnvironmentMetadata", "EnvironmentMetadataCreator", "EnvironmentSpec", @@ -28,6 +29,107 @@ ] +class EnvironmentActivitySignal(BaseModel): + source: Optional[str] = None + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Optional[datetime] = None + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + class EnvironmentMetadataCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -147,6 +249,98 @@ class EnvironmentMetadata(BaseModel): creator: Optional[EnvironmentMetadataCreator] = None """creator is the identity of the creator of the environment""" + last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + name: Optional[str] = None """name is the name of the environment as specified by the user""" @@ -173,7 +367,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -204,7 +403,11 @@ class EnvironmentSpecDevcontainer(BaseModel): devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -344,7 +547,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -367,6 +570,9 @@ class Environment(BaseModel): manager """ + activity_signal: Optional[EnvironmentActivitySignal] = FieldInfo(alias="activitySignal", default=None) + """EnvironmentActivitySignal used to signal activity for an environment.""" + environment_access_token: Optional[str] = FieldInfo(alias="environmentAccessToken", default=None) """The environment's access token""" diff --git a/src/gitpod/types/runner_interactions/environment_retrieve_response.py b/src/gitpod/types/runner_interactions/environment_retrieve_response.py index 9c47a9bb..19d0d970 100644 --- a/src/gitpod/types/runner_interactions/environment_retrieve_response.py +++ b/src/gitpod/types/runner_interactions/environment_retrieve_response.py @@ -11,6 +11,7 @@ __all__ = [ "EnvironmentRetrieveResponse", "Environment", + "EnvironmentActivitySignal", "EnvironmentMetadata", "EnvironmentMetadataCreator", "EnvironmentSpec", @@ -27,6 +28,107 @@ ] +class EnvironmentActivitySignal(BaseModel): + source: Optional[str] = None + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Optional[datetime] = None + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + class EnvironmentMetadataCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -146,6 +248,98 @@ class EnvironmentMetadata(BaseModel): creator: Optional[EnvironmentMetadataCreator] = None """creator is the identity of the creator of the environment""" + last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + name: Optional[str] = None """name is the name of the environment as specified by the user""" @@ -172,7 +366,12 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -203,7 +402,11 @@ class EnvironmentSpecDevcontainer(BaseModel): devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo - root + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` """ session: Optional[str] = None @@ -343,7 +546,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -366,6 +569,9 @@ class Environment(BaseModel): manager """ + activity_signal: Optional[EnvironmentActivitySignal] = FieldInfo(alias="activitySignal", default=None) + """EnvironmentActivitySignal used to signal activity for an environment.""" + environment_access_token: Optional[str] = FieldInfo(alias="environmentAccessToken", default=None) """The environment's access token""" diff --git a/src/gitpod/types/runner_interactions/environment_update_status_params.py b/src/gitpod/types/runner_interactions/environment_update_status_params.py index 012c7c03..56bb0f21 100644 --- a/src/gitpod/types/runner_interactions/environment_update_status_params.py +++ b/src/gitpod/types/runner_interactions/environment_update_status_params.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import List, Union, Iterable +from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,6 +11,7 @@ __all__ = [ "EnvironmentUpdateStatusParams", "Status", + "StatusActivitySignal", "StatusAutomationsFile", "StatusContent", "StatusContentGit", @@ -43,6 +45,107 @@ class EnvironmentUpdateStatusParams(TypedDict, total=False): """Define the timeout, in ms""" +class StatusActivitySignal(TypedDict, total=False): + source: str + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + class StatusAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ @@ -295,7 +398,7 @@ class StatusMachine(TypedDict, total=False): class StatusRunnerAck(TypedDict, total=False): message: str - spec_version: Annotated[Union[str, float], PropertyInfo(alias="specVersion")] + spec_version: Annotated[Union[int, str], PropertyInfo(alias="specVersion")] status_code: Annotated[ Literal[ @@ -323,6 +426,9 @@ class StatusSecret(TypedDict, total=False): secret_name: Annotated[str, PropertyInfo(alias="secretName")] + session: str + """session is the session that is currently active in the environment.""" + warning_message: Annotated[str, PropertyInfo(alias="warningMessage")] """warning_message contains warnings, e.g. @@ -346,6 +452,9 @@ class StatusSSHPublicKey(TypedDict, total=False): class Status(TypedDict, total=False): + activity_signal: Annotated[StatusActivitySignal, PropertyInfo(alias="activitySignal")] + """EnvironmentActivitySignal used to signal activity for an environment.""" + automations_file: Annotated[StatusAutomationsFile, PropertyInfo(alias="automationsFile")] """automations_file contains the status of the automations file.""" @@ -399,13 +508,13 @@ class Status(TypedDict, total=False): ssh_public_keys: Annotated[Iterable[StatusSSHPublicKey], PropertyInfo(alias="sshPublicKeys")] """ssh_public_keys contains the status of the environment ssh public keys""" - status_version: Annotated[Union[str, float], PropertyInfo(alias="statusVersion")] + status_version: Annotated[Union[int, str], PropertyInfo(alias="statusVersion")] """version of the status update. - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. + Environment instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. """ warning_message: Annotated[List[str], PropertyInfo(alias="warningMessage")] diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py index e6dbbb38..e6b35d23 100644 --- a/src/gitpod/types/runner_list_params.py +++ b/src/gitpod/types/runner_list_params.py @@ -27,7 +27,9 @@ class Filter(TypedDict, total=False): creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] """creator_ids filters the response to only runner created by specified users""" - kinds: List[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] + kinds: List[ + Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] + ] """kinds filters the response to only runners of the specified kinds""" diff --git a/src/gitpod/types/runner_list_response.py b/src/gitpod/types/runner_list_response.py index 09f823d4..66f0ce79 100644 --- a/src/gitpod/types/runner_list_response.py +++ b/src/gitpod/types/runner_list_response.py @@ -93,6 +93,11 @@ class RunnerStatus(BaseModel): a CloudFormation stack URL. """ + capabilities: Optional[ + List[Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"]] + ] = None + """capabilities is a list of capabilities the runner supports.""" + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) message: Optional[str] = None @@ -310,7 +315,9 @@ class Runner(BaseModel): creator: Optional[RunnerCreator] = None """creator is the identity of the creator of the environment""" - kind: Optional[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] = None + kind: Optional[ + Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] + ] = None """RunnerKind represents the kind of a runner""" name: Optional[str] = None diff --git a/src/gitpod/types/runner_retrieve_params.py b/src/gitpod/types/runner_retrieve_params.py deleted file mode 100644 index b748bd50..00000000 --- a/src/gitpod/types/runner_retrieve_params.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["RunnerRetrieveParams"] - - -class RunnerRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - base64: str - - compression: str - - connect: str - - encoding: str - - message: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_retrieve_response.py b/src/gitpod/types/runner_retrieve_response.py deleted file mode 100644 index 3f3c18b7..00000000 --- a/src/gitpod/types/runner_retrieve_response.py +++ /dev/null @@ -1,412 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = [ - "RunnerRetrieveResponse", - "Runner", - "RunnerCreator", - "RunnerSpec", - "RunnerSpecConfiguration", - "RunnerStatus", - "RunnerStatusAdditionalInfo", -] - - -class RunnerCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class RunnerSpecConfiguration(BaseModel): - auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) - """auto_update indicates whether the runner should automatically update itself.""" - - region: Optional[str] = None - """ - Region to deploy the runner in, if applicable. This is mainly used for remote - runners, and is only a hint. The runner may be deployed in a different region. - See the runner's status for the actual region. - """ - - release_channel: Optional[ - Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] - ] = FieldInfo(alias="releaseChannel", default=None) - """The release channel the runner is on""" - - -class RunnerSpec(BaseModel): - configuration: Optional[RunnerSpecConfiguration] = None - """The runner's configuration""" - - desired_phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """RunnerPhase represents the phase a runner is in""" - - -class RunnerStatusAdditionalInfo(BaseModel): - key: Optional[str] = None - - value: Optional[str] = None - - -class RunnerStatus(BaseModel): - additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) - """additional_info contains additional information about the runner, e.g. - - a CloudFormation stack URL. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - - message: Optional[str] = None - """ - The runner's reported message which is shown to users. This message adds more - context to the runner's phase. - """ - - phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = None - """RunnerPhase represents the phase a runner is in""" - - region: Optional[str] = None - """region is the region the runner is running in, if applicable.""" - - system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - version: Optional[str] = None - - -class Runner(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[RunnerCreator] = None - """creator is the identity of the creator of the environment""" - - kind: Optional[Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE"]] = None - """RunnerKind represents the kind of a runner""" - - name: Optional[str] = None - """The runner's name which is shown to users""" - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - spec: Optional[RunnerSpec] = None - """The runner's specification""" - - status: Optional[RunnerStatus] = None - """RunnerStatus represents the status of a runner""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class RunnerRetrieveResponse(BaseModel): - runner: Optional[Runner] = None diff --git a/src/gitpod/types/service_list_create_response.py b/src/gitpod/types/service_list_create_response.py deleted file mode 100644 index e9d3190e..00000000 --- a/src/gitpod/types/service_list_create_response.py +++ /dev/null @@ -1,296 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = [ - "ServiceListCreateResponse", - "Pagination", - "Service", - "ServiceMetadata", - "ServiceMetadataCreator", - "ServiceMetadataTriggeredBy", - "ServiceSpec", - "ServiceSpecCommands", - "ServiceStatus", -] - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class ServiceMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ServiceMetadataTriggeredBy: - pass - - -class ServiceMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[ServiceMetadataCreator] = None - """creator describes the principal who created the service.""" - - description: Optional[str] = None - """description is a user-facing description for the service. - - It can be used to provide context and documentation for the service. - """ - - name: Optional[str] = None - """name is a user-facing name for the service. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the service. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the service which must be unique on - the environment. It is used to express dependencies between services, and to - identify the service in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the service.""" - - -class ServiceSpecCommands(BaseModel): - ready: Optional[str] = None - """ - ready is an optional command that is run repeatedly until it exits with a zero - exit code. If set, the service will first go into a Starting phase, and then - into a Running phase once the ready command exits with a zero exit code. - """ - - start: Optional[str] = None - """ - start is the command to start and run the service. If start exits, the service - will transition to the following phase: - - - Stopped: if the exit code is 0 - - Failed: if the exit code is not 0 If the stop command is not set, the start - command will receive a SIGTERM signal when the service is requested to stop. - If it does not exit within 2 minutes, it will receive a SIGKILL signal. - """ - - stop: Optional[str] = None - """ - stop is an optional command that runs when the service is requested to stop. If - set, instead of sending a SIGTERM signal to the start command, the stop command - will be run. Once the stop command exits, the start command will receive a - SIGKILL signal. If the stop command exits with a non-zero exit code, the service - will transition to the Failed phase. If the stop command does not exit within 2 - minutes, a SIGKILL signal will be sent to both the start and stop commands. - """ - - -class ServiceSpec(BaseModel): - commands: Optional[ServiceSpecCommands] = None - """ - commands contains the commands to start, stop and check the readiness of the - service - """ - - desired_phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """Phase is the desired phase of the environment""" - - session: Optional[str] = None - """session should be changed to trigger a restart of the service. - - If a service exits it will not be restarted until the session is changed. - """ - - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - -class ServiceStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. - - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. - """ - - phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = None - """ - the phase of an environment is a simple, high-level summary of where the - environment is in its lifecycle - """ - - session: Optional[str] = None - """session is the current session of the service.""" - - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. - """ - - -class Service(BaseModel): - id: Optional[str] = None - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[ServiceMetadata] = None - - spec: Optional[ServiceSpec] = None - - status: Optional[ServiceStatus] = None - - -class ServiceListCreateResponse(BaseModel): - pagination: Optional[Pagination] = None - - services: Optional[List[Service]] = None diff --git a/src/gitpod/types/service_list_response.py b/src/gitpod/types/service_list_response.py deleted file mode 100644 index 2057aa8b..00000000 --- a/src/gitpod/types/service_list_response.py +++ /dev/null @@ -1,296 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = [ - "ServiceListResponse", - "Pagination", - "Service", - "ServiceMetadata", - "ServiceMetadataCreator", - "ServiceMetadataTriggeredBy", - "ServiceSpec", - "ServiceSpecCommands", - "ServiceStatus", -] - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class ServiceMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ServiceMetadataTriggeredBy: - pass - - -class ServiceMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[ServiceMetadataCreator] = None - """creator describes the principal who created the service.""" - - description: Optional[str] = None - """description is a user-facing description for the service. - - It can be used to provide context and documentation for the service. - """ - - name: Optional[str] = None - """name is a user-facing name for the service. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the service. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the service which must be unique on - the environment. It is used to express dependencies between services, and to - identify the service in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the service.""" - - -class ServiceSpecCommands(BaseModel): - ready: Optional[str] = None - """ - ready is an optional command that is run repeatedly until it exits with a zero - exit code. If set, the service will first go into a Starting phase, and then - into a Running phase once the ready command exits with a zero exit code. - """ - - start: Optional[str] = None - """ - start is the command to start and run the service. If start exits, the service - will transition to the following phase: - - - Stopped: if the exit code is 0 - - Failed: if the exit code is not 0 If the stop command is not set, the start - command will receive a SIGTERM signal when the service is requested to stop. - If it does not exit within 2 minutes, it will receive a SIGKILL signal. - """ - - stop: Optional[str] = None - """ - stop is an optional command that runs when the service is requested to stop. If - set, instead of sending a SIGTERM signal to the start command, the stop command - will be run. Once the stop command exits, the start command will receive a - SIGKILL signal. If the stop command exits with a non-zero exit code, the service - will transition to the Failed phase. If the stop command does not exit within 2 - minutes, a SIGKILL signal will be sent to both the start and stop commands. - """ - - -class ServiceSpec(BaseModel): - commands: Optional[ServiceSpecCommands] = None - """ - commands contains the commands to start, stop and check the readiness of the - service - """ - - desired_phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """Phase is the desired phase of the environment""" - - session: Optional[str] = None - """session should be changed to trigger a restart of the service. - - If a service exits it will not be restarted until the session is changed. - """ - - spec_version: Union[str, float, None] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - -class ServiceStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. - - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. - """ - - phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = None - """ - the phase of an environment is a simple, high-level summary of where the - environment is in its lifecycle - """ - - session: Optional[str] = None - """session is the current session of the service.""" - - status_version: Union[str, float, None] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Environment instances themselves are unversioned, but their statuus has - different versions. The value of this field has no semantic meaning (e.g. don't - interpret it as as a timestemp), but it can be used to impose a partial order. - If a.status_version < b.status_version then a was the status before b. - """ - - -class Service(BaseModel): - id: Optional[str] = None - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[ServiceMetadata] = None - - spec: Optional[ServiceSpec] = None - - status: Optional[ServiceStatus] = None - - -class ServiceListResponse(BaseModel): - pagination: Optional[Pagination] = None - - services: Optional[List[Service]] = None diff --git a/src/gitpod/types/service_update_params.py b/src/gitpod/types/service_update_params.py index b9ec55c2..49e1d271 100644 --- a/src/gitpod/types/service_update_params.py +++ b/src/gitpod/types/service_update_params.py @@ -2,12 +2,11 @@ from __future__ import annotations -from typing import Union from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["ServiceUpdateParams", "Metadata", "Status"] +__all__ = ["ServiceUpdateParams", "Metadata", "Spec", "Status"] class ServiceUpdateParams(TypedDict, total=False): @@ -18,7 +17,7 @@ class ServiceUpdateParams(TypedDict, total=False): metadata: Metadata - spec: Union[object, object] + spec: Spec """Changing the spec of a service is a complex operation. The spec of a service can only be updated if the service is in a stopped state. @@ -40,5 +39,9 @@ class Metadata: pass +class Spec: + pass + + class Status: pass diff --git a/src/gitpod/types/task_create_params.py b/src/gitpod/types/task_create_params.py index 797a0373..f9814758 100644 --- a/src/gitpod/types/task_create_params.py +++ b/src/gitpod/types/task_create_params.py @@ -169,3 +169,6 @@ class Metadata(TypedDict, total=False): class Spec(TypedDict, total=False): command: str """command contains the command the task should execute""" + + runs_on: Annotated[Union[object, object], PropertyInfo(alias="runsOn")] + """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/task_create_response.py b/src/gitpod/types/task_create_response.py index 374bef47..6711bbda 100644 --- a/src/gitpod/types/task_create_response.py +++ b/src/gitpod/types/task_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -156,6 +156,9 @@ class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" + runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + class Task(BaseModel): id: Optional[str] = None diff --git a/src/gitpod/types/task_retrieve_create_response.py b/src/gitpod/types/task_retrieve_create_response.py index b79cd808..579e6097 100644 --- a/src/gitpod/types/task_retrieve_create_response.py +++ b/src/gitpod/types/task_retrieve_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -163,6 +163,9 @@ class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" + runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + class Task(BaseModel): id: Optional[str] = None diff --git a/src/gitpod/types/task_retrieve_params.py b/src/gitpod/types/task_retrieve_params.py deleted file mode 100644 index 7c5553ed..00000000 --- a/src/gitpod/types/task_retrieve_params.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["TaskRetrieveParams"] - - -class TaskRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - base64: str - - compression: str - - connect: str - - encoding: str - - message: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/task_retrieve_response.py b/src/gitpod/types/task_retrieve_response.py deleted file mode 100644 index 5d18b57f..00000000 --- a/src/gitpod/types/task_retrieve_response.py +++ /dev/null @@ -1,174 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["TaskRetrieveResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", "TaskSpec"] - - -class TaskMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskMetadataTriggeredBy: - pass - - -class TaskMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskMetadataCreator] = None - """creator describes the principal who created the task.""" - - description: Optional[str] = None - """description is a user-facing description for the task. - - It can be used to provide context and documentation for the task. - """ - - name: Optional[str] = None - """name is a user-facing name for the task. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the task. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the task which must be unique on the - environment. It is used to express dependencies between tasks, and to identify - the task in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the task.""" - - -class TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - -class Task(BaseModel): - id: Optional[str] = None - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - """dependencies specifies the IDs of the automations this task depends on.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[TaskMetadata] = None - - spec: Optional[TaskSpec] = None - - -class TaskRetrieveResponse(BaseModel): - task: Optional[Task] = None diff --git a/tests/api_resources/environment_automations/test_task_executions.py b/tests/api_resources/environment_automations/test_task_executions.py index 1d40c2a2..96eae4f2 100644 --- a/tests/api_resources/environment_automations/test_task_executions.py +++ b/tests/api_resources/environment_automations/test_task_executions.py @@ -12,7 +12,6 @@ from gitpod.types.environment_automations import ( TaskExecutionListResponse, TaskExecutionRetrieveResponse, - TaskExecutionCreateListResponse, TaskExecutionCreateRetrieveResponse, ) @@ -33,11 +32,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task_execution = client.environment_automations.task_executions.retrieve( connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @@ -76,50 +71,6 @@ def test_method_list(self, client: Gitpod) -> None: @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task_execution = client.environment_automations.task_executions.list( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environment_automations.task_executions.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environment_automations.task_executions.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_create_list(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.create_list( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) - - @parametrize - def test_method_create_list_with_all_params(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.create_list( connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -133,29 +84,29 @@ def test_method_create_list_with_all_params(self, client: Gitpod) -> None: }, connect_timeout_ms=0, ) - assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize - def test_raw_response_create_list(self, client: Gitpod) -> None: - response = client.environment_automations.task_executions.with_raw_response.create_list( + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.environment_automations.task_executions.with_raw_response.list( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" task_execution = response.parse() - assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize - def test_streaming_response_create_list(self, client: Gitpod) -> None: - with client.environment_automations.task_executions.with_streaming_response.create_list( + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.environment_automations.task_executions.with_streaming_response.list( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" task_execution = response.parse() - assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) assert cast(Any, response.is_closed) is True @@ -308,11 +259,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environment_automations.task_executions.retrieve( connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @@ -351,50 +298,6 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environment_automations.task_executions.list( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.task_executions.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.task_executions.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_create_list(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.create_list( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) - - @parametrize - async def test_method_create_list_with_all_params(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.create_list( connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -408,29 +311,29 @@ async def test_method_create_list_with_all_params(self, async_client: AsyncGitpo }, connect_timeout_ms=0, ) - assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize - async def test_raw_response_create_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.task_executions.with_raw_response.create_list( + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environment_automations.task_executions.with_raw_response.list( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" task_execution = await response.parse() - assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize - async def test_streaming_response_create_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.task_executions.with_streaming_response.create_list( + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environment_automations.task_executions.with_streaming_response.list( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" task_execution = await response.parse() - assert_matches_type(TaskExecutionCreateListResponse, task_execution, path=["response"]) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environment_automations/test_tasks.py b/tests/api_resources/environment_automations/test_tasks.py index 804d10aa..d9002a9b 100644 --- a/tests/api_resources/environment_automations/test_tasks.py +++ b/tests/api_resources/environment_automations/test_tasks.py @@ -12,7 +12,6 @@ from gitpod.types.environment_automations import ( TaskListResponse, TaskStartResponse, - TaskCreateListResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -75,11 +74,15 @@ def test_method_list(self, client: Gitpod) -> None: def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environment_automations.tasks.list( connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, connect_timeout_ms=0, ) assert_matches_type(TaskListResponse, task, path=["response"]) @@ -148,54 +151,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_create_list(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.create_list( - connect_protocol_version=1, - ) - assert_matches_type(TaskCreateListResponse, task, path=["response"]) - - @parametrize - def test_method_create_list_with_all_params(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.create_list( - connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], - "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - }, - pagination={ - "token": "token", - "page_size": 0, - }, - connect_timeout_ms=0, - ) - assert_matches_type(TaskCreateListResponse, task, path=["response"]) - - @parametrize - def test_raw_response_create_list(self, client: Gitpod) -> None: - response = client.environment_automations.tasks.with_raw_response.create_list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = response.parse() - assert_matches_type(TaskCreateListResponse, task, path=["response"]) - - @parametrize - def test_streaming_response_create_list(self, client: Gitpod) -> None: - with client.environment_automations.tasks.with_streaming_response.create_list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = response.parse() - assert_matches_type(TaskCreateListResponse, task, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_start(self, client: Gitpod) -> None: task = client.environment_automations.tasks.start( @@ -294,11 +249,15 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environment_automations.tasks.list( connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, connect_timeout_ms=0, ) assert_matches_type(TaskListResponse, task, path=["response"]) @@ -367,54 +326,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_create_list(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.create_list( - connect_protocol_version=1, - ) - assert_matches_type(TaskCreateListResponse, task, path=["response"]) - - @parametrize - async def test_method_create_list_with_all_params(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.create_list( - connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], - "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - }, - pagination={ - "token": "token", - "page_size": 0, - }, - connect_timeout_ms=0, - ) - assert_matches_type(TaskCreateListResponse, task, path=["response"]) - - @parametrize - async def test_raw_response_create_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.tasks.with_raw_response.create_list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = await response.parse() - assert_matches_type(TaskCreateListResponse, task, path=["response"]) - - @parametrize - async def test_streaming_response_create_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.tasks.with_streaming_response.create_list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = await response.parse() - assert_matches_type(TaskCreateListResponse, task, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: task = await async_client.environment_automations.tasks.start( diff --git a/tests/api_resources/runner_configurations/test_configuration_schema.py b/tests/api_resources/runner_configurations/test_configuration_schema.py index dbb54e48..f9459506 100644 --- a/tests/api_resources/runner_configurations/test_configuration_schema.py +++ b/tests/api_resources/runner_configurations/test_configuration_schema.py @@ -9,10 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types.runner_configurations import ( - ConfigurationSchemaCreateResponse, - ConfigurationSchemaRetrieveResponse, -) +from gitpod.types.runner_configurations import ConfigurationSchemaCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -60,50 +57,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_configurations.configuration_schema.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration_schema = response.parse() - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_configurations.configuration_schema.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration_schema = response.parse() - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - assert cast(Any, response.is_closed) is True - class TestAsyncConfigurationSchema: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -147,47 +100,3 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.configuration_schema.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration_schema = await response.parse() - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.configuration_schema.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration_schema = await response.parse() - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py index 622647b6..1f403169 100644 --- a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py @@ -9,10 +9,10 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod._utils import parse_datetime from gitpod.types.runner_configurations import ( HostAuthenticationTokenListResponse, HostAuthenticationTokenCreateResponse, - HostAuthenticationTokenRetrieveResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -61,50 +61,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = response.parse() - assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = response.parse() - assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_update(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( @@ -119,6 +75,8 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: body={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "token": "x", + "expiresAt": parse_datetime("2019-12-27T18:11:19.117Z"), + "refreshToken": "refreshToken", }, connect_protocol_version=1, connect_timeout_ms=0, @@ -279,50 +237,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = await response.parse() - assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = await response.parse() - assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( @@ -337,6 +251,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> body={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "token": "x", + "expiresAt": parse_datetime("2019-12-27T18:11:19.117Z"), + "refreshToken": "refreshToken", }, connect_protocol_version=1, connect_timeout_ms=0, diff --git a/tests/api_resources/runner_interactions/test_environments.py b/tests/api_resources/runner_interactions/test_environments.py index aa13dda2..dd607a2b 100644 --- a/tests/api_resources/runner_interactions/test_environments.py +++ b/tests/api_resources/runner_interactions/test_environments.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod._utils import parse_datetime from gitpod.types.runner_interactions import ( EnvironmentListResponse, EnvironmentRetrieveResponse, @@ -120,6 +121,10 @@ def test_method_update_status_with_all_params(self, client: Gitpod) -> None: environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", status={ + "activity_signal": { + "source": "xxx", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + }, "automations_file": { "automations_file_path": "automationsFilePath", "automations_file_presence": "PRESENCE_UNSPECIFIED", @@ -187,7 +192,7 @@ def test_method_update_status_with_all_params(self, client: Gitpod) -> None: "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "runner_ack": { "message": "message", - "spec_version": "string", + "spec_version": 0, "status_code": "STATUS_CODE_UNSPECIFIED", }, "secrets": [ @@ -195,6 +200,7 @@ def test_method_update_status_with_all_params(self, client: Gitpod) -> None: "failure_message": "failureMessage", "phase": "CONTENT_PHASE_UNSPECIFIED", "secret_name": "secretName", + "session": "session", "warning_message": "warningMessage", } ], @@ -204,7 +210,7 @@ def test_method_update_status_with_all_params(self, client: Gitpod) -> None: "phase": "CONTENT_PHASE_UNSPECIFIED", } ], - "status_version": "string", + "status_version": 0, "warning_message": ["string"], }, connect_timeout_ms=0, @@ -339,6 +345,10 @@ async def test_method_update_status_with_all_params(self, async_client: AsyncGit environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", status={ + "activity_signal": { + "source": "xxx", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + }, "automations_file": { "automations_file_path": "automationsFilePath", "automations_file_presence": "PRESENCE_UNSPECIFIED", @@ -406,7 +416,7 @@ async def test_method_update_status_with_all_params(self, async_client: AsyncGit "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "runner_ack": { "message": "message", - "spec_version": "string", + "spec_version": 0, "status_code": "STATUS_CODE_UNSPECIFIED", }, "secrets": [ @@ -414,6 +424,7 @@ async def test_method_update_status_with_all_params(self, async_client: AsyncGit "failure_message": "failureMessage", "phase": "CONTENT_PHASE_UNSPECIFIED", "secret_name": "secretName", + "session": "session", "warning_message": "warningMessage", } ], @@ -423,7 +434,7 @@ async def test_method_update_status_with_all_params(self, async_client: AsyncGit "phase": "CONTENT_PHASE_UNSPECIFIED", } ], - "status_version": "string", + "status_version": 0, "warning_message": ["string"], }, connect_timeout_ms=0, diff --git a/tests/api_resources/test_automations_files.py b/tests/api_resources/test_automations_files.py index ac653202..7de778ab 100644 --- a/tests/api_resources/test_automations_files.py +++ b/tests/api_resources/test_automations_files.py @@ -38,6 +38,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: }, "description": "description", "name": "x", + "runs_on": {}, "triggered_by": ["string"], } }, @@ -47,6 +48,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "depends_on": ["string"], "description": "description", "name": "x", + "runs_on": {}, "triggered_by": ["string"], } }, @@ -105,6 +107,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> }, "description": "description", "name": "x", + "runs_on": {}, "triggered_by": ["string"], } }, @@ -114,6 +117,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "depends_on": ["string"], "description": "description", "name": "x", + "runs_on": {}, "triggered_by": ["string"], } }, diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py new file mode 100644 index 00000000..049029bd --- /dev/null +++ b/tests/api_resources/test_editors.py @@ -0,0 +1,276 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + EditorListResponse, + EditorRetrieveResponse, + EditorResolveEditorURLResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEditors: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + editor = client.editors.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + editor = client.editors.retrieve( + connect_protocol_version=1, + id="id", + connect_timeout_ms=0, + ) + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.editors.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = response.parse() + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.editors.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = response.parse() + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + editor = client.editors.list( + connect_protocol_version=1, + ) + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + editor = client.editors.list( + connect_protocol_version=1, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.editors.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = response.parse() + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.editors.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = response.parse() + assert_matches_type(EditorListResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_resolve_editor_url(self, client: Gitpod) -> None: + editor = client.editors.resolve_editor_url( + connect_protocol_version=1, + ) + assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) + + @parametrize + def test_method_resolve_editor_url_with_all_params(self, client: Gitpod) -> None: + editor = client.editors.resolve_editor_url( + connect_protocol_version=1, + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) + + @parametrize + def test_raw_response_resolve_editor_url(self, client: Gitpod) -> None: + response = client.editors.with_raw_response.resolve_editor_url( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = response.parse() + assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) + + @parametrize + def test_streaming_response_resolve_editor_url(self, client: Gitpod) -> None: + with client.editors.with_streaming_response.resolve_editor_url( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = response.parse() + assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEditors: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.retrieve( + connect_protocol_version=1, + id="id", + connect_timeout_ms=0, + ) + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.editors.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = await response.parse() + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.editors.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = await response.parse() + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.list( + connect_protocol_version=1, + ) + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.list( + connect_protocol_version=1, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.editors.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = await response.parse() + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.editors.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = await response.parse() + assert_matches_type(EditorListResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_resolve_editor_url(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.resolve_editor_url( + connect_protocol_version=1, + ) + assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) + + @parametrize + async def test_method_resolve_editor_url_with_all_params(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.resolve_editor_url( + connect_protocol_version=1, + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) + + @parametrize + async def test_raw_response_resolve_editor_url(self, async_client: AsyncGitpod) -> None: + response = await async_client.editors.with_raw_response.resolve_editor_url( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = await response.parse() + assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) + + @parametrize + async def test_streaming_response_resolve_editor_url(self, async_client: AsyncGitpod) -> None: + async with async_client.editors.with_streaming_response.resolve_editor_url( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = await response.parse() + assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 3935be54..5921333a 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -80,11 +80,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "filePath": "filePath", "gitCredentialHost": "gitCredentialHost", "name": "name", + "session": "session", "source": "source", "sourceRef": "sourceRef", } ], - "spec_version": "string", + "spec_version": 0, "ssh_public_keys": [ { "id": "id", @@ -176,6 +177,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -270,11 +272,12 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "filePath": "filePath", "gitCredentialHost": "gitCredentialHost", "name": "name", + "session": "session", "source": "source", "sourceRef": "sourceRef", } ], - "spec_version": "string", + "spec_version": 0, "ssh_public_keys": [ { "id": "id", @@ -413,11 +416,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "filePath": "filePath", "gitCredentialHost": "gitCredentialHost", "name": "name", + "session": "session", "source": "source", "sourceRef": "sourceRef", } ], - "spec_version": "string", + "spec_version": 0, "ssh_public_keys": [ { "id": "id", @@ -509,6 +513,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -603,11 +608,12 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "filePath": "filePath", "gitCredentialHost": "gitCredentialHost", "name": "name", + "session": "session", "source": "source", "sourceRef": "sourceRef", } ], - "spec_version": "string", + "spec_version": 0, "ssh_public_keys": [ { "id": "id", diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 42bc2961..2fa50bf0 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -11,7 +11,6 @@ from tests.utils import assert_matches_type from gitpod.types import ( ProjectCreateResponse, - ProjectRetrieveResponse, ProjectCreateFromEnvironmentResponse, ) @@ -84,50 +83,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - project = client.projects.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - project = client.projects.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() - assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: project = client.projects.create_from_environment( @@ -236,50 +191,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() - assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( diff --git a/tests/api_resources/test_runner_interactions.py b/tests/api_resources/test_runner_interactions.py index 2179d562..735ae817 100644 --- a/tests/api_resources/test_runner_interactions.py +++ b/tests/api_resources/test_runner_interactions.py @@ -272,6 +272,7 @@ def test_method_send_response_with_all_params(self, client: Gitpod) -> None: "authenticated": True, "authentication_url": "authenticationUrl", "pat_supported": True, + "scm_id": "scmId", } }, "callParseContext": { @@ -511,6 +512,7 @@ def test_method_update_status_with_all_params(self, client: Gitpod) -> None: "value": "value", } ], + "capabilities": ["RUNNER_CAPABILITY_UNSPECIFIED"], "degredationMessage": "degredationMessage", "logUrl": "https://example.com", "region": "region", @@ -802,6 +804,7 @@ async def test_method_send_response_with_all_params(self, async_client: AsyncGit "authenticated": True, "authentication_url": "authenticationUrl", "pat_supported": True, + "scm_id": "scmId", } }, "callParseContext": { @@ -1041,6 +1044,7 @@ async def test_method_update_status_with_all_params(self, async_client: AsyncGit "value": "value", } ], + "capabilities": ["RUNNER_CAPABILITY_UNSPECIFIED"], "degredationMessage": "degredationMessage", "logUrl": "https://example.com", "region": "region", diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 53d6aa18..f708a3c0 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -12,7 +12,6 @@ from gitpod.types import ( RunnerListResponse, RunnerCreateResponse, - RunnerRetrieveResponse, RunnerGetRunnerResponse, RunnerParseContextURLResponse, RunnerCreateRunnerTokenResponse, @@ -74,50 +73,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - runner = client.runners.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - runner = client.runners.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner = response.parse() - assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner = response.parse() - assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_list(self, client: Gitpod) -> None: runner = client.runners.list( @@ -468,50 +423,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner = await response.parse() - assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner = await response.parse() - assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( diff --git a/tests/api_resources/test_services.py b/tests/api_resources/test_services.py index cc347f63..e5abe090 100644 --- a/tests/api_resources/test_services.py +++ b/tests/api_resources/test_services.py @@ -9,10 +9,6 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import ( - ServiceListResponse, - ServiceListCreateResponse, -) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -63,50 +59,6 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_list(self, client: Gitpod) -> None: - service = client.services.list( - connect_protocol_version=1, - ) - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Gitpod) -> None: - service = client.services.list( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.services.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service = response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.services.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service = response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_delete(self, client: Gitpod) -> None: service = client.services.delete( @@ -148,54 +100,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_list_create(self, client: Gitpod) -> None: - service = client.services.list_create( - connect_protocol_version=1, - ) - assert_matches_type(ServiceListCreateResponse, service, path=["response"]) - - @parametrize - def test_method_list_create_with_all_params(self, client: Gitpod) -> None: - service = client.services.list_create( - connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], - "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - }, - pagination={ - "token": "token", - "page_size": 0, - }, - connect_timeout_ms=0, - ) - assert_matches_type(ServiceListCreateResponse, service, path=["response"]) - - @parametrize - def test_raw_response_list_create(self, client: Gitpod) -> None: - response = client.services.with_raw_response.list_create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service = response.parse() - assert_matches_type(ServiceListCreateResponse, service, path=["response"]) - - @parametrize - def test_streaming_response_list_create(self, client: Gitpod) -> None: - with client.services.with_streaming_response.list_create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service = response.parse() - assert_matches_type(ServiceListCreateResponse, service, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_start(self, client: Gitpod) -> None: service = client.services.start( @@ -323,50 +227,6 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_list(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.list( - connect_protocol_version=1, - ) - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.list( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.services.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service = await response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.services.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service = await response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: service = await async_client.services.delete( @@ -408,54 +268,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_list_create(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.list_create( - connect_protocol_version=1, - ) - assert_matches_type(ServiceListCreateResponse, service, path=["response"]) - - @parametrize - async def test_method_list_create_with_all_params(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.list_create( - connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], - "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - }, - pagination={ - "token": "token", - "page_size": 0, - }, - connect_timeout_ms=0, - ) - assert_matches_type(ServiceListCreateResponse, service, path=["response"]) - - @parametrize - async def test_raw_response_list_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.services.with_raw_response.list_create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service = await response.parse() - assert_matches_type(ServiceListCreateResponse, service, path=["response"]) - - @parametrize - async def test_streaming_response_list_create(self, async_client: AsyncGitpod) -> None: - async with async_client.services.with_streaming_response.list_create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service = await response.parse() - assert_matches_type(ServiceListCreateResponse, service, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: service = await async_client.services.start( diff --git a/tests/api_resources/test_tasks.py b/tests/api_resources/test_tasks.py index e12ce118..41c234ea 100644 --- a/tests/api_resources/test_tasks.py +++ b/tests/api_resources/test_tasks.py @@ -9,11 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import ( - TaskCreateResponse, - TaskRetrieveResponse, - TaskRetrieveCreateResponse, -) +from gitpod.types import TaskCreateResponse, TaskRetrieveCreateResponse from gitpod._utils import parse_datetime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -52,7 +48,10 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: } ], }, - spec={"command": "command"}, + spec={ + "command": "command", + "runs_on": {}, + }, connect_timeout_ms=0, ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @@ -81,50 +80,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - task = client.tasks.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - task = client.tasks.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.tasks.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = response.parse() - assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.tasks.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = response.parse() - assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_retrieve_create(self, client: Gitpod) -> None: task = client.tasks.retrieve_create( @@ -199,7 +154,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> } ], }, - spec={"command": "command"}, + spec={ + "command": "command", + "runs_on": {}, + }, connect_timeout_ms=0, ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @@ -228,50 +186,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - task = await async_client.tasks.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - task = await async_client.tasks.retrieve( - connect_protocol_version=1, - base64="base64", - compression="compression", - connect="connect", - encoding="encoding", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.tasks.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = await response.parse() - assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.tasks.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = await response.parse() - assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_retrieve_create(self, async_client: AsyncGitpod) -> None: task = await async_client.tasks.retrieve_create( From 7e102394d771319c960c929fa516a953c326dadd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 13:51:19 +0000 Subject: [PATCH 041/505] feat(api): update via SDK Studio --- .stats.yml | 2 +- api.md | 155 +- src/gitpod/_client.py | 62 +- src/gitpod/resources/__init__.py | 56 - .../environment_automations/__init__.py | 47 - .../environment_automations.py | 134 -- .../task_executions.py | 664 --------- .../__init__.py | 28 +- .../environments/automations/__init__.py | 47 + .../environments/automations/automations.py | 134 ++ .../automations}/services.py | 154 +- .../automations}/tasks.py | 153 +- .../{ => environments}/environments.py | 54 +- .../runner_interactions/environments.py | 504 ------- .../runner_interactions.py | 1296 ----------------- src/gitpod/resources/tasks.py | 330 ----- src/gitpod/types/__init__.py | 46 - .../types/environment_automations/__init__.py | 24 - .../task_execution_create_retrieve_params.py | 19 - ...task_execution_create_retrieve_response.py | 440 ------ .../task_execution_list_params.py | 61 - .../task_execution_list_response.py | 451 ------ .../task_execution_retrieve_params.py | 19 - .../task_execution_retrieve_response.py | 440 ------ .../task_execution_stop_params.py | 19 - ...ion_update_task_execution_status_params.py | 23 - src/gitpod/types/environments/__init__.py | 3 + .../environments/automations/__init__.py | 18 + .../automations}/service_delete_params.py | 2 +- .../automations/service_list_params.py} | 30 +- .../automations/service_list_response.py | 296 ++++ .../automations}/service_start_params.py | 2 +- .../automations}/service_stop_params.py | 2 +- .../automations}/service_update_params.py | 2 +- .../automations}/task_create_params.py | 2 +- .../automations}/task_create_response.py | 2 +- .../automations}/task_delete_params.py | 2 +- .../automations}/task_list_params.py | 2 +- .../automations}/task_list_response.py | 2 +- .../automations}/task_start_params.py | 2 +- .../automations}/task_start_response.py | 2 +- .../automations}/task_update_params.py | 2 +- ..._host_authentication_token_value_params.py | 26 - ...ost_authentication_token_value_response.py | 129 -- ...r_interaction_get_latest_version_params.py | 26 - ...interaction_get_latest_version_response.py | 26 - ..._list_runner_environment_classes_params.py | 48 - ...ist_runner_environment_classes_response.py | 62 - ...ion_list_runner_scm_integrations_params.py | 48 - ...n_list_runner_scm_integrations_response.py | 29 - .../runner_interaction_mark_active_params.py | 20 - ...runner_interaction_send_response_params.py | 23 - .../types/runner_interaction_signup_params.py | 60 - .../runner_interaction_signup_response.py | 14 - ...date_runner_configuration_schema_params.py | 82 -- ...runner_interaction_update_status_params.py | 23 - .../types/runner_interactions/__init__.py | 9 - .../environment_list_response.py | 605 -------- .../environment_retrieve_params.py | 23 - .../environment_retrieve_response.py | 592 -------- .../environment_update_status_params.py | 524 ------- .../types/task_retrieve_create_params.py | 19 - .../types/task_retrieve_create_response.py | 184 --- .../test_task_executions.py | 474 ------ .../__init__.py | 0 .../automations}/__init__.py | 0 .../automations}/test_services.py | 163 ++- .../automations}/test_tasks.py | 192 ++- .../runner_interactions/test_environments.py | 466 ------ .../api_resources/test_runner_interactions.py | 1084 -------------- tests/api_resources/test_tasks.py | 227 --- 71 files changed, 1201 insertions(+), 9710 deletions(-) delete mode 100644 src/gitpod/resources/environment_automations/__init__.py delete mode 100644 src/gitpod/resources/environment_automations/environment_automations.py delete mode 100644 src/gitpod/resources/environment_automations/task_executions.py rename src/gitpod/resources/{runner_interactions => environments}/__init__.py (51%) create mode 100644 src/gitpod/resources/environments/automations/__init__.py create mode 100644 src/gitpod/resources/environments/automations/automations.py rename src/gitpod/resources/{ => environments/automations}/services.py (80%) rename src/gitpod/resources/{environment_automations => environments/automations}/tasks.py (78%) rename src/gitpod/resources/{ => environments}/environments.py (93%) delete mode 100644 src/gitpod/resources/runner_interactions/environments.py delete mode 100644 src/gitpod/resources/runner_interactions/runner_interactions.py delete mode 100644 src/gitpod/resources/tasks.py delete mode 100644 src/gitpod/types/environment_automations/__init__.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_create_retrieve_params.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_list_params.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_list_response.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_retrieve_params.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_retrieve_response.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_stop_params.py delete mode 100644 src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py create mode 100644 src/gitpod/types/environments/__init__.py create mode 100644 src/gitpod/types/environments/automations/__init__.py rename src/gitpod/types/{ => environments/automations}/service_delete_params.py (94%) rename src/gitpod/types/{runner_interactions/environment_list_params.py => environments/automations/service_list_params.py} (58%) create mode 100644 src/gitpod/types/environments/automations/service_list_response.py rename src/gitpod/types/{ => environments/automations}/service_start_params.py (94%) rename src/gitpod/types/{ => environments/automations}/service_stop_params.py (94%) rename src/gitpod/types/{ => environments/automations}/service_update_params.py (97%) rename src/gitpod/types/{ => environments/automations}/task_create_params.py (99%) rename src/gitpod/types/{ => environments/automations}/task_create_response.py (99%) rename src/gitpod/types/{environment_automations => environments/automations}/task_delete_params.py (94%) rename src/gitpod/types/{environment_automations => environments/automations}/task_list_params.py (97%) rename src/gitpod/types/{environment_automations => environments/automations}/task_list_response.py (99%) rename src/gitpod/types/{environment_automations => environments/automations}/task_start_params.py (94%) rename src/gitpod/types/{environment_automations => environments/automations}/task_start_response.py (99%) rename src/gitpod/types/{environment_automations => environments/automations}/task_update_params.py (95%) delete mode 100644 src/gitpod/types/runner_interaction_get_host_authentication_token_value_params.py delete mode 100644 src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py delete mode 100644 src/gitpod/types/runner_interaction_get_latest_version_params.py delete mode 100644 src/gitpod/types/runner_interaction_get_latest_version_response.py delete mode 100644 src/gitpod/types/runner_interaction_list_runner_environment_classes_params.py delete mode 100644 src/gitpod/types/runner_interaction_list_runner_environment_classes_response.py delete mode 100644 src/gitpod/types/runner_interaction_list_runner_scm_integrations_params.py delete mode 100644 src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py delete mode 100644 src/gitpod/types/runner_interaction_mark_active_params.py delete mode 100644 src/gitpod/types/runner_interaction_send_response_params.py delete mode 100644 src/gitpod/types/runner_interaction_signup_params.py delete mode 100644 src/gitpod/types/runner_interaction_signup_response.py delete mode 100644 src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py delete mode 100644 src/gitpod/types/runner_interaction_update_status_params.py delete mode 100644 src/gitpod/types/runner_interactions/__init__.py delete mode 100644 src/gitpod/types/runner_interactions/environment_list_response.py delete mode 100644 src/gitpod/types/runner_interactions/environment_retrieve_params.py delete mode 100644 src/gitpod/types/runner_interactions/environment_retrieve_response.py delete mode 100644 src/gitpod/types/runner_interactions/environment_update_status_params.py delete mode 100644 src/gitpod/types/task_retrieve_create_params.py delete mode 100644 src/gitpod/types/task_retrieve_create_response.py delete mode 100644 tests/api_resources/environment_automations/test_task_executions.py rename tests/api_resources/{environment_automations => environments}/__init__.py (100%) rename tests/api_resources/{runner_interactions => environments/automations}/__init__.py (100%) rename tests/api_resources/{ => environments/automations}/test_services.py (63%) rename tests/api_resources/{environment_automations => environments/automations}/test_tasks.py (61%) delete mode 100644 tests/api_resources/runner_interactions/test_environments.py delete mode 100644 tests/api_resources/test_runner_interactions.py delete mode 100644 tests/api_resources/test_tasks.py diff --git a/.stats.yml b/.stats.yml index e5a41ec0..98c4a5a8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 64 +configured_endpoints: 48 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a56421de8c29e0197c90fcbce09d837e8736c3a808b36b242b5c317231ce91fe.yml diff --git a/api.md b/api.md index 76f2eb4e..9a5dcc23 100644 --- a/api.md +++ b/api.md @@ -1,23 +1,3 @@ -# Services - -Types: - -```python -from gitpod.types import ( - ServiceUpdateResponse, - ServiceDeleteResponse, - ServiceStartResponse, - ServiceStopResponse, -) -``` - -Methods: - -- client.services.update(\*\*params) -> object -- client.services.delete(\*\*params) -> object -- client.services.start(\*\*params) -> object -- client.services.stop(\*\*params) -> object - # AutomationsFiles Types: @@ -30,19 +10,6 @@ Methods: - client.automations_files.upsert(\*\*params) -> AutomationsFileUpsertResponse -# Tasks - -Types: - -```python -from gitpod.types import TaskCreateResponse, TaskRetrieveCreateResponse -``` - -Methods: - -- client.tasks.create(\*\*params) -> TaskCreateResponse -- client.tasks.retrieve_create(\*\*params) -> TaskRetrieveCreateResponse - # Editors Types: @@ -57,71 +24,73 @@ Methods: - client.editors.list(\*\*params) -> EditorListResponse - client.editors.resolve_editor_url(\*\*params) -> EditorResolveEditorURLResponse -# EnvironmentAutomations - -## Tasks +# Environments Types: ```python -from gitpod.types.environment_automations import ( - TaskUpdateResponse, - TaskListResponse, - TaskDeleteResponse, - TaskStartResponse, +from gitpod.types import ( + EnvironmentCreateResponse, + EnvironmentRetrieveResponse, + EnvironmentListResponse, + EnvironmentCreateFromProjectResponse, + EnvironmentStartResponse, ) ``` Methods: -- client.environment_automations.tasks.update(\*\*params) -> object -- client.environment_automations.tasks.list(\*\*params) -> TaskListResponse -- client.environment_automations.tasks.delete(\*\*params) -> object -- client.environment_automations.tasks.start(\*\*params) -> TaskStartResponse +- client.environments.create(\*\*params) -> EnvironmentCreateResponse +- client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse +- client.environments.list(\*\*params) -> EnvironmentListResponse +- client.environments.create_from_project(\*\*params) -> EnvironmentCreateFromProjectResponse +- client.environments.start(\*\*params) -> object -## TaskExecutions +## Automations + +### Tasks Types: ```python -from gitpod.types.environment_automations import ( - TaskExecutionRetrieveResponse, - TaskExecutionListResponse, - TaskExecutionCreateRetrieveResponse, - TaskExecutionStopResponse, - TaskExecutionUpdateTaskExecutionStatusResponse, +from gitpod.types.environments.automations import ( + TaskCreateResponse, + TaskUpdateResponse, + TaskListResponse, + TaskDeleteResponse, + TaskStartResponse, ) ``` Methods: -- client.environment_automations.task_executions.retrieve(\*\*params) -> TaskExecutionRetrieveResponse -- client.environment_automations.task_executions.list(\*\*params) -> TaskExecutionListResponse -- client.environment_automations.task_executions.create_retrieve(\*\*params) -> TaskExecutionCreateRetrieveResponse -- client.environment_automations.task_executions.stop(\*\*params) -> object -- client.environment_automations.task_executions.update_task_execution_status(\*\*params) -> object +- client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse +- client.environments.automations.tasks.update(\*\*params) -> object +- client.environments.automations.tasks.list(\*\*params) -> TaskListResponse +- client.environments.automations.tasks.delete(\*\*params) -> object +- client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse -# Environments +### Services Types: ```python -from gitpod.types import ( - EnvironmentCreateResponse, - EnvironmentRetrieveResponse, - EnvironmentListResponse, - EnvironmentCreateFromProjectResponse, - EnvironmentStartResponse, +from gitpod.types.environments.automations import ( + ServiceUpdateResponse, + ServiceListResponse, + ServiceDeleteResponse, + ServiceStartResponse, + ServiceStopResponse, ) ``` Methods: -- client.environments.create(\*\*params) -> EnvironmentCreateResponse -- client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse -- client.environments.list(\*\*params) -> EnvironmentListResponse -- client.environments.create_from_project(\*\*params) -> EnvironmentCreateFromProjectResponse -- client.environments.start(\*\*params) -> object +- client.environments.automations.services.update(\*\*params) -> object +- client.environments.automations.services.list(\*\*params) -> ServiceListResponse +- client.environments.automations.services.delete(\*\*params) -> object +- client.environments.automations.services.start(\*\*params) -> object +- client.environments.automations.services.stop(\*\*params) -> object # EnvironmentClasses @@ -270,54 +239,6 @@ Methods: - client.runner_configurations.environment_classes.update(\*\*params) -> object - client.runner_configurations.environment_classes.list(\*\*params) -> EnvironmentClassListResponse -# RunnerInteractions - -Types: - -```python -from gitpod.types import ( - RunnerInteractionGetHostAuthenticationTokenValueResponse, - RunnerInteractionGetLatestVersionResponse, - RunnerInteractionListRunnerEnvironmentClassesResponse, - RunnerInteractionListRunnerScmIntegrationsResponse, - RunnerInteractionMarkActiveResponse, - RunnerInteractionSendResponseResponse, - RunnerInteractionSignupResponse, - RunnerInteractionUpdateRunnerConfigurationSchemaResponse, - RunnerInteractionUpdateStatusResponse, -) -``` - -Methods: - -- client.runner_interactions.get_host_authentication_token_value(\*\*params) -> RunnerInteractionGetHostAuthenticationTokenValueResponse -- client.runner_interactions.get_latest_version(\*\*params) -> RunnerInteractionGetLatestVersionResponse -- client.runner_interactions.list_runner_environment_classes(\*\*params) -> RunnerInteractionListRunnerEnvironmentClassesResponse -- client.runner_interactions.list_runner_scm_integrations(\*\*params) -> RunnerInteractionListRunnerScmIntegrationsResponse -- client.runner_interactions.mark_active(\*\*params) -> object -- client.runner_interactions.send_response(\*\*params) -> object -- client.runner_interactions.signup(\*\*params) -> RunnerInteractionSignupResponse -- client.runner_interactions.update_runner_configuration_schema(\*\*params) -> object -- client.runner_interactions.update_status(\*\*params) -> object - -## Environments - -Types: - -```python -from gitpod.types.runner_interactions import ( - EnvironmentRetrieveResponse, - EnvironmentListResponse, - EnvironmentUpdateStatusResponse, -) -``` - -Methods: - -- client.runner_interactions.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse -- client.runner_interactions.environments.list(\*\*params) -> EnvironmentListResponse -- client.runner_interactions.environments.update_status(\*\*params) -> object - # Runners Types: diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 2d71f5e0..475b3624 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -24,16 +24,7 @@ get_async_library, ) from ._version import __version__ -from .resources import ( - tasks, - editors, - projects, - services, - environments, - automations_files, - environment_classes, - personal_access_tokens, -) +from .resources import editors, projects, automations_files, environment_classes, personal_access_tokens from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import APIStatusError from ._base_client import ( @@ -42,26 +33,21 @@ AsyncAPIClient, ) from .resources.runners import runners +from .resources.environments import environments from .resources.organizations import organizations -from .resources.runner_interactions import runner_interactions from .resources.runner_configurations import runner_configurations -from .resources.environment_automations import environment_automations __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gitpod", "AsyncGitpod", "Client", "AsyncClient"] class Gitpod(SyncAPIClient): - services: services.ServicesResource automations_files: automations_files.AutomationsFilesResource - tasks: tasks.TasksResource editors: editors.EditorsResource - environment_automations: environment_automations.EnvironmentAutomationsResource environments: environments.EnvironmentsResource environment_classes: environment_classes.EnvironmentClassesResource organizations: organizations.OrganizationsResource projects: projects.ProjectsResource runner_configurations: runner_configurations.RunnerConfigurationsResource - runner_interactions: runner_interactions.RunnerInteractionsResource runners: runners.RunnersResource personal_access_tokens: personal_access_tokens.PersonalAccessTokensResource with_raw_response: GitpodWithRawResponse @@ -108,17 +94,13 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.services = services.ServicesResource(self) self.automations_files = automations_files.AutomationsFilesResource(self) - self.tasks = tasks.TasksResource(self) self.editors = editors.EditorsResource(self) - self.environment_automations = environment_automations.EnvironmentAutomationsResource(self) self.environments = environments.EnvironmentsResource(self) self.environment_classes = environment_classes.EnvironmentClassesResource(self) self.organizations = organizations.OrganizationsResource(self) self.projects = projects.ProjectsResource(self) self.runner_configurations = runner_configurations.RunnerConfigurationsResource(self) - self.runner_interactions = runner_interactions.RunnerInteractionsResource(self) self.runners = runners.RunnersResource(self) self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResource(self) self.with_raw_response = GitpodWithRawResponse(self) @@ -222,17 +204,13 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): - services: services.AsyncServicesResource automations_files: automations_files.AsyncAutomationsFilesResource - tasks: tasks.AsyncTasksResource editors: editors.AsyncEditorsResource - environment_automations: environment_automations.AsyncEnvironmentAutomationsResource environments: environments.AsyncEnvironmentsResource environment_classes: environment_classes.AsyncEnvironmentClassesResource organizations: organizations.AsyncOrganizationsResource projects: projects.AsyncProjectsResource runner_configurations: runner_configurations.AsyncRunnerConfigurationsResource - runner_interactions: runner_interactions.AsyncRunnerInteractionsResource runners: runners.AsyncRunnersResource personal_access_tokens: personal_access_tokens.AsyncPersonalAccessTokensResource with_raw_response: AsyncGitpodWithRawResponse @@ -279,17 +257,13 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.services = services.AsyncServicesResource(self) self.automations_files = automations_files.AsyncAutomationsFilesResource(self) - self.tasks = tasks.AsyncTasksResource(self) self.editors = editors.AsyncEditorsResource(self) - self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResource(self) self.environments = environments.AsyncEnvironmentsResource(self) self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self) self.organizations = organizations.AsyncOrganizationsResource(self) self.projects = projects.AsyncProjectsResource(self) self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResource(self) - self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResource(self) self.runners = runners.AsyncRunnersResource(self) self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResource(self) self.with_raw_response = AsyncGitpodWithRawResponse(self) @@ -394,13 +368,8 @@ def _make_status_error( class GitpodWithRawResponse: def __init__(self, client: Gitpod) -> None: - self.services = services.ServicesResourceWithRawResponse(client.services) self.automations_files = automations_files.AutomationsFilesResourceWithRawResponse(client.automations_files) - self.tasks = tasks.TasksResourceWithRawResponse(client.tasks) self.editors = editors.EditorsResourceWithRawResponse(client.editors) - self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithRawResponse( - client.environment_automations - ) self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) self.environment_classes = environment_classes.EnvironmentClassesResourceWithRawResponse( client.environment_classes @@ -410,9 +379,6 @@ def __init__(self, client: Gitpod) -> None: self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithRawResponse( client.runner_configurations ) - self.runner_interactions = runner_interactions.RunnerInteractionsResourceWithRawResponse( - client.runner_interactions - ) self.runners = runners.RunnersResourceWithRawResponse(client.runners) self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens @@ -421,15 +387,10 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithRawResponse: def __init__(self, client: AsyncGitpod) -> None: - self.services = services.AsyncServicesResourceWithRawResponse(client.services) self.automations_files = automations_files.AsyncAutomationsFilesResourceWithRawResponse( client.automations_files ) - self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks) self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors) - self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithRawResponse( - client.environment_automations - ) self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithRawResponse( client.environment_classes @@ -439,9 +400,6 @@ def __init__(self, client: AsyncGitpod) -> None: self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithRawResponse( client.runner_configurations ) - self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResourceWithRawResponse( - client.runner_interactions - ) self.runners = runners.AsyncRunnersResourceWithRawResponse(client.runners) self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithRawResponse( client.personal_access_tokens @@ -450,15 +408,10 @@ def __init__(self, client: AsyncGitpod) -> None: class GitpodWithStreamedResponse: def __init__(self, client: Gitpod) -> None: - self.services = services.ServicesResourceWithStreamingResponse(client.services) self.automations_files = automations_files.AutomationsFilesResourceWithStreamingResponse( client.automations_files ) - self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks) self.editors = editors.EditorsResourceWithStreamingResponse(client.editors) - self.environment_automations = environment_automations.EnvironmentAutomationsResourceWithStreamingResponse( - client.environment_automations - ) self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) self.environment_classes = environment_classes.EnvironmentClassesResourceWithStreamingResponse( client.environment_classes @@ -468,9 +421,6 @@ def __init__(self, client: Gitpod) -> None: self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithStreamingResponse( client.runner_configurations ) - self.runner_interactions = runner_interactions.RunnerInteractionsResourceWithStreamingResponse( - client.runner_interactions - ) self.runners = runners.RunnersResourceWithStreamingResponse(client.runners) self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens @@ -479,15 +429,10 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithStreamedResponse: def __init__(self, client: AsyncGitpod) -> None: - self.services = services.AsyncServicesResourceWithStreamingResponse(client.services) self.automations_files = automations_files.AsyncAutomationsFilesResourceWithStreamingResponse( client.automations_files ) - self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks) self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors) - self.environment_automations = environment_automations.AsyncEnvironmentAutomationsResourceWithStreamingResponse( - client.environment_automations - ) self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithStreamingResponse( client.environment_classes @@ -497,9 +442,6 @@ def __init__(self, client: AsyncGitpod) -> None: self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithStreamingResponse( client.runner_configurations ) - self.runner_interactions = runner_interactions.AsyncRunnerInteractionsResourceWithStreamingResponse( - client.runner_interactions - ) self.runners = runners.AsyncRunnersResourceWithStreamingResponse(client.runners) self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithStreamingResponse( client.personal_access_tokens diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index 9fe24e89..f87409f8 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .tasks import ( - TasksResource, - AsyncTasksResource, - TasksResourceWithRawResponse, - AsyncTasksResourceWithRawResponse, - TasksResourceWithStreamingResponse, - AsyncTasksResourceWithStreamingResponse, -) from .editors import ( EditorsResource, AsyncEditorsResource, @@ -32,14 +24,6 @@ ProjectsResourceWithStreamingResponse, AsyncProjectsResourceWithStreamingResponse, ) -from .services import ( - ServicesResource, - AsyncServicesResource, - ServicesResourceWithRawResponse, - AsyncServicesResourceWithRawResponse, - ServicesResourceWithStreamingResponse, - AsyncServicesResourceWithStreamingResponse, -) from .environments import ( EnvironmentsResource, AsyncEnvironmentsResource, @@ -72,14 +56,6 @@ EnvironmentClassesResourceWithStreamingResponse, AsyncEnvironmentClassesResourceWithStreamingResponse, ) -from .runner_interactions import ( - RunnerInteractionsResource, - AsyncRunnerInteractionsResource, - RunnerInteractionsResourceWithRawResponse, - AsyncRunnerInteractionsResourceWithRawResponse, - RunnerInteractionsResourceWithStreamingResponse, - AsyncRunnerInteractionsResourceWithStreamingResponse, -) from .runner_configurations import ( RunnerConfigurationsResource, AsyncRunnerConfigurationsResource, @@ -96,46 +72,20 @@ PersonalAccessTokensResourceWithStreamingResponse, AsyncPersonalAccessTokensResourceWithStreamingResponse, ) -from .environment_automations import ( - EnvironmentAutomationsResource, - AsyncEnvironmentAutomationsResource, - EnvironmentAutomationsResourceWithRawResponse, - AsyncEnvironmentAutomationsResourceWithRawResponse, - EnvironmentAutomationsResourceWithStreamingResponse, - AsyncEnvironmentAutomationsResourceWithStreamingResponse, -) __all__ = [ - "ServicesResource", - "AsyncServicesResource", - "ServicesResourceWithRawResponse", - "AsyncServicesResourceWithRawResponse", - "ServicesResourceWithStreamingResponse", - "AsyncServicesResourceWithStreamingResponse", "AutomationsFilesResource", "AsyncAutomationsFilesResource", "AutomationsFilesResourceWithRawResponse", "AsyncAutomationsFilesResourceWithRawResponse", "AutomationsFilesResourceWithStreamingResponse", "AsyncAutomationsFilesResourceWithStreamingResponse", - "TasksResource", - "AsyncTasksResource", - "TasksResourceWithRawResponse", - "AsyncTasksResourceWithRawResponse", - "TasksResourceWithStreamingResponse", - "AsyncTasksResourceWithStreamingResponse", "EditorsResource", "AsyncEditorsResource", "EditorsResourceWithRawResponse", "AsyncEditorsResourceWithRawResponse", "EditorsResourceWithStreamingResponse", "AsyncEditorsResourceWithStreamingResponse", - "EnvironmentAutomationsResource", - "AsyncEnvironmentAutomationsResource", - "EnvironmentAutomationsResourceWithRawResponse", - "AsyncEnvironmentAutomationsResourceWithRawResponse", - "EnvironmentAutomationsResourceWithStreamingResponse", - "AsyncEnvironmentAutomationsResourceWithStreamingResponse", "EnvironmentsResource", "AsyncEnvironmentsResource", "EnvironmentsResourceWithRawResponse", @@ -166,12 +116,6 @@ "AsyncRunnerConfigurationsResourceWithRawResponse", "RunnerConfigurationsResourceWithStreamingResponse", "AsyncRunnerConfigurationsResourceWithStreamingResponse", - "RunnerInteractionsResource", - "AsyncRunnerInteractionsResource", - "RunnerInteractionsResourceWithRawResponse", - "AsyncRunnerInteractionsResourceWithRawResponse", - "RunnerInteractionsResourceWithStreamingResponse", - "AsyncRunnerInteractionsResourceWithStreamingResponse", "RunnersResource", "AsyncRunnersResource", "RunnersResourceWithRawResponse", diff --git a/src/gitpod/resources/environment_automations/__init__.py b/src/gitpod/resources/environment_automations/__init__.py deleted file mode 100644 index db0fddb0..00000000 --- a/src/gitpod/resources/environment_automations/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .tasks import ( - TasksResource, - AsyncTasksResource, - TasksResourceWithRawResponse, - AsyncTasksResourceWithRawResponse, - TasksResourceWithStreamingResponse, - AsyncTasksResourceWithStreamingResponse, -) -from .task_executions import ( - TaskExecutionsResource, - AsyncTaskExecutionsResource, - TaskExecutionsResourceWithRawResponse, - AsyncTaskExecutionsResourceWithRawResponse, - TaskExecutionsResourceWithStreamingResponse, - AsyncTaskExecutionsResourceWithStreamingResponse, -) -from .environment_automations import ( - EnvironmentAutomationsResource, - AsyncEnvironmentAutomationsResource, - EnvironmentAutomationsResourceWithRawResponse, - AsyncEnvironmentAutomationsResourceWithRawResponse, - EnvironmentAutomationsResourceWithStreamingResponse, - AsyncEnvironmentAutomationsResourceWithStreamingResponse, -) - -__all__ = [ - "TasksResource", - "AsyncTasksResource", - "TasksResourceWithRawResponse", - "AsyncTasksResourceWithRawResponse", - "TasksResourceWithStreamingResponse", - "AsyncTasksResourceWithStreamingResponse", - "TaskExecutionsResource", - "AsyncTaskExecutionsResource", - "TaskExecutionsResourceWithRawResponse", - "AsyncTaskExecutionsResourceWithRawResponse", - "TaskExecutionsResourceWithStreamingResponse", - "AsyncTaskExecutionsResourceWithStreamingResponse", - "EnvironmentAutomationsResource", - "AsyncEnvironmentAutomationsResource", - "EnvironmentAutomationsResourceWithRawResponse", - "AsyncEnvironmentAutomationsResourceWithRawResponse", - "EnvironmentAutomationsResourceWithStreamingResponse", - "AsyncEnvironmentAutomationsResourceWithStreamingResponse", -] diff --git a/src/gitpod/resources/environment_automations/environment_automations.py b/src/gitpod/resources/environment_automations/environment_automations.py deleted file mode 100644 index 69047e6a..00000000 --- a/src/gitpod/resources/environment_automations/environment_automations.py +++ /dev/null @@ -1,134 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .tasks import ( - TasksResource, - AsyncTasksResource, - TasksResourceWithRawResponse, - AsyncTasksResourceWithRawResponse, - TasksResourceWithStreamingResponse, - AsyncTasksResourceWithStreamingResponse, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from .task_executions import ( - TaskExecutionsResource, - AsyncTaskExecutionsResource, - TaskExecutionsResourceWithRawResponse, - AsyncTaskExecutionsResourceWithRawResponse, - TaskExecutionsResourceWithStreamingResponse, - AsyncTaskExecutionsResourceWithStreamingResponse, -) - -__all__ = ["EnvironmentAutomationsResource", "AsyncEnvironmentAutomationsResource"] - - -class EnvironmentAutomationsResource(SyncAPIResource): - @cached_property - def tasks(self) -> TasksResource: - return TasksResource(self._client) - - @cached_property - def task_executions(self) -> TaskExecutionsResource: - return TaskExecutionsResource(self._client) - - @cached_property - def with_raw_response(self) -> EnvironmentAutomationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return EnvironmentAutomationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> EnvironmentAutomationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return EnvironmentAutomationsResourceWithStreamingResponse(self) - - -class AsyncEnvironmentAutomationsResource(AsyncAPIResource): - @cached_property - def tasks(self) -> AsyncTasksResource: - return AsyncTasksResource(self._client) - - @cached_property - def task_executions(self) -> AsyncTaskExecutionsResource: - return AsyncTaskExecutionsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncEnvironmentAutomationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncEnvironmentAutomationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncEnvironmentAutomationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncEnvironmentAutomationsResourceWithStreamingResponse(self) - - -class EnvironmentAutomationsResourceWithRawResponse: - def __init__(self, environment_automations: EnvironmentAutomationsResource) -> None: - self._environment_automations = environment_automations - - @cached_property - def tasks(self) -> TasksResourceWithRawResponse: - return TasksResourceWithRawResponse(self._environment_automations.tasks) - - @cached_property - def task_executions(self) -> TaskExecutionsResourceWithRawResponse: - return TaskExecutionsResourceWithRawResponse(self._environment_automations.task_executions) - - -class AsyncEnvironmentAutomationsResourceWithRawResponse: - def __init__(self, environment_automations: AsyncEnvironmentAutomationsResource) -> None: - self._environment_automations = environment_automations - - @cached_property - def tasks(self) -> AsyncTasksResourceWithRawResponse: - return AsyncTasksResourceWithRawResponse(self._environment_automations.tasks) - - @cached_property - def task_executions(self) -> AsyncTaskExecutionsResourceWithRawResponse: - return AsyncTaskExecutionsResourceWithRawResponse(self._environment_automations.task_executions) - - -class EnvironmentAutomationsResourceWithStreamingResponse: - def __init__(self, environment_automations: EnvironmentAutomationsResource) -> None: - self._environment_automations = environment_automations - - @cached_property - def tasks(self) -> TasksResourceWithStreamingResponse: - return TasksResourceWithStreamingResponse(self._environment_automations.tasks) - - @cached_property - def task_executions(self) -> TaskExecutionsResourceWithStreamingResponse: - return TaskExecutionsResourceWithStreamingResponse(self._environment_automations.task_executions) - - -class AsyncEnvironmentAutomationsResourceWithStreamingResponse: - def __init__(self, environment_automations: AsyncEnvironmentAutomationsResource) -> None: - self._environment_automations = environment_automations - - @cached_property - def tasks(self) -> AsyncTasksResourceWithStreamingResponse: - return AsyncTasksResourceWithStreamingResponse(self._environment_automations.tasks) - - @cached_property - def task_executions(self) -> AsyncTaskExecutionsResourceWithStreamingResponse: - return AsyncTaskExecutionsResourceWithStreamingResponse(self._environment_automations.task_executions) diff --git a/src/gitpod/resources/environment_automations/task_executions.py b/src/gitpod/resources/environment_automations/task_executions.py deleted file mode 100644 index cc506cca..00000000 --- a/src/gitpod/resources/environment_automations/task_executions.py +++ /dev/null @@ -1,664 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.environment_automations import ( - task_execution_list_params, - task_execution_stop_params, - task_execution_retrieve_params, - task_execution_create_retrieve_params, - task_execution_update_task_execution_status_params, -) -from ...types.environment_automations.task_execution_list_response import TaskExecutionListResponse -from ...types.environment_automations.task_execution_retrieve_response import TaskExecutionRetrieveResponse -from ...types.environment_automations.task_execution_create_retrieve_response import TaskExecutionCreateRetrieveResponse - -__all__ = ["TaskExecutionsResource", "AsyncTaskExecutionsResource"] - - -class TaskExecutionsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> TaskExecutionsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return TaskExecutionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> TaskExecutionsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return TaskExecutionsResourceWithStreamingResponse(self) - - def retrieve( - self, - *, - connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionRetrieveResponse: - """ - GetTaskExecution - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", - body=maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskExecutionRetrieveResponse, - ) - - def list( - self, - *, - connect_protocol_version: Literal[1], - filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionListResponse: - """ - ListTaskExecutions - - Args: - connect_protocol_version: Define the version of the Connect protocol - - filter: filter contains the filter options for listing task runs - - pagination: pagination contains the pagination options for listing task runs - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - task_execution_list_params.TaskExecutionListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskExecutionListResponse, - ) - - def create_retrieve( - self, - *, - connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionCreateRetrieveResponse: - """ - GetTaskExecution - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", - body=maybe_transform({"id": id}, task_execution_create_retrieve_params.TaskExecutionCreateRetrieveParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskExecutionCreateRetrieveResponse, - ) - - def stop( - self, - *, - connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - StopTaskExecution - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", - body=maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def update_task_execution_status( - self, - *, - body: task_execution_update_task_execution_status_params.Body, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """UpdateTaskExecutionStatus updates the status of a task execution. - - Only the - environment executing a task execution is expected to call this function. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", - body=maybe_transform( - body, task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncTaskExecutionsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncTaskExecutionsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncTaskExecutionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncTaskExecutionsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncTaskExecutionsResourceWithStreamingResponse(self) - - async def retrieve( - self, - *, - connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionRetrieveResponse: - """ - GetTaskExecution - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", - body=await async_maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskExecutionRetrieveResponse, - ) - - async def list( - self, - *, - connect_protocol_version: Literal[1], - filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionListResponse: - """ - ListTaskExecutions - - Args: - connect_protocol_version: Define the version of the Connect protocol - - filter: filter contains the filter options for listing task runs - - pagination: pagination contains the pagination options for listing task runs - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - task_execution_list_params.TaskExecutionListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskExecutionListResponse, - ) - - async def create_retrieve( - self, - *, - connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionCreateRetrieveResponse: - """ - GetTaskExecution - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", - body=await async_maybe_transform( - {"id": id}, task_execution_create_retrieve_params.TaskExecutionCreateRetrieveParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskExecutionCreateRetrieveResponse, - ) - - async def stop( - self, - *, - connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - StopTaskExecution - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", - body=await async_maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def update_task_execution_status( - self, - *, - body: task_execution_update_task_execution_status_params.Body, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """UpdateTaskExecutionStatus updates the status of a task execution. - - Only the - environment executing a task execution is expected to call this function. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", - body=await async_maybe_transform( - body, task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class TaskExecutionsResourceWithRawResponse: - def __init__(self, task_executions: TaskExecutionsResource) -> None: - self._task_executions = task_executions - - self.retrieve = to_raw_response_wrapper( - task_executions.retrieve, - ) - self.list = to_raw_response_wrapper( - task_executions.list, - ) - self.create_retrieve = to_raw_response_wrapper( - task_executions.create_retrieve, - ) - self.stop = to_raw_response_wrapper( - task_executions.stop, - ) - self.update_task_execution_status = to_raw_response_wrapper( - task_executions.update_task_execution_status, - ) - - -class AsyncTaskExecutionsResourceWithRawResponse: - def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: - self._task_executions = task_executions - - self.retrieve = async_to_raw_response_wrapper( - task_executions.retrieve, - ) - self.list = async_to_raw_response_wrapper( - task_executions.list, - ) - self.create_retrieve = async_to_raw_response_wrapper( - task_executions.create_retrieve, - ) - self.stop = async_to_raw_response_wrapper( - task_executions.stop, - ) - self.update_task_execution_status = async_to_raw_response_wrapper( - task_executions.update_task_execution_status, - ) - - -class TaskExecutionsResourceWithStreamingResponse: - def __init__(self, task_executions: TaskExecutionsResource) -> None: - self._task_executions = task_executions - - self.retrieve = to_streamed_response_wrapper( - task_executions.retrieve, - ) - self.list = to_streamed_response_wrapper( - task_executions.list, - ) - self.create_retrieve = to_streamed_response_wrapper( - task_executions.create_retrieve, - ) - self.stop = to_streamed_response_wrapper( - task_executions.stop, - ) - self.update_task_execution_status = to_streamed_response_wrapper( - task_executions.update_task_execution_status, - ) - - -class AsyncTaskExecutionsResourceWithStreamingResponse: - def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: - self._task_executions = task_executions - - self.retrieve = async_to_streamed_response_wrapper( - task_executions.retrieve, - ) - self.list = async_to_streamed_response_wrapper( - task_executions.list, - ) - self.create_retrieve = async_to_streamed_response_wrapper( - task_executions.create_retrieve, - ) - self.stop = async_to_streamed_response_wrapper( - task_executions.stop, - ) - self.update_task_execution_status = async_to_streamed_response_wrapper( - task_executions.update_task_execution_status, - ) diff --git a/src/gitpod/resources/runner_interactions/__init__.py b/src/gitpod/resources/environments/__init__.py similarity index 51% rename from src/gitpod/resources/runner_interactions/__init__.py rename to src/gitpod/resources/environments/__init__.py index 6f7456f6..8390b0a9 100644 --- a/src/gitpod/resources/runner_interactions/__init__.py +++ b/src/gitpod/resources/environments/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .automations import ( + AutomationsResource, + AsyncAutomationsResource, + AutomationsResourceWithRawResponse, + AsyncAutomationsResourceWithRawResponse, + AutomationsResourceWithStreamingResponse, + AsyncAutomationsResourceWithStreamingResponse, +) from .environments import ( EnvironmentsResource, AsyncEnvironmentsResource, @@ -8,26 +16,18 @@ EnvironmentsResourceWithStreamingResponse, AsyncEnvironmentsResourceWithStreamingResponse, ) -from .runner_interactions import ( - RunnerInteractionsResource, - AsyncRunnerInteractionsResource, - RunnerInteractionsResourceWithRawResponse, - AsyncRunnerInteractionsResourceWithRawResponse, - RunnerInteractionsResourceWithStreamingResponse, - AsyncRunnerInteractionsResourceWithStreamingResponse, -) __all__ = [ + "AutomationsResource", + "AsyncAutomationsResource", + "AutomationsResourceWithRawResponse", + "AsyncAutomationsResourceWithRawResponse", + "AutomationsResourceWithStreamingResponse", + "AsyncAutomationsResourceWithStreamingResponse", "EnvironmentsResource", "AsyncEnvironmentsResource", "EnvironmentsResourceWithRawResponse", "AsyncEnvironmentsResourceWithRawResponse", "EnvironmentsResourceWithStreamingResponse", "AsyncEnvironmentsResourceWithStreamingResponse", - "RunnerInteractionsResource", - "AsyncRunnerInteractionsResource", - "RunnerInteractionsResourceWithRawResponse", - "AsyncRunnerInteractionsResourceWithRawResponse", - "RunnerInteractionsResourceWithStreamingResponse", - "AsyncRunnerInteractionsResourceWithStreamingResponse", ] diff --git a/src/gitpod/resources/environments/automations/__init__.py b/src/gitpod/resources/environments/automations/__init__.py new file mode 100644 index 00000000..cd4b0ca7 --- /dev/null +++ b/src/gitpod/resources/environments/automations/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .tasks import ( + TasksResource, + AsyncTasksResource, + TasksResourceWithRawResponse, + AsyncTasksResourceWithRawResponse, + TasksResourceWithStreamingResponse, + AsyncTasksResourceWithStreamingResponse, +) +from .services import ( + ServicesResource, + AsyncServicesResource, + ServicesResourceWithRawResponse, + AsyncServicesResourceWithRawResponse, + ServicesResourceWithStreamingResponse, + AsyncServicesResourceWithStreamingResponse, +) +from .automations import ( + AutomationsResource, + AsyncAutomationsResource, + AutomationsResourceWithRawResponse, + AsyncAutomationsResourceWithRawResponse, + AutomationsResourceWithStreamingResponse, + AsyncAutomationsResourceWithStreamingResponse, +) + +__all__ = [ + "TasksResource", + "AsyncTasksResource", + "TasksResourceWithRawResponse", + "AsyncTasksResourceWithRawResponse", + "TasksResourceWithStreamingResponse", + "AsyncTasksResourceWithStreamingResponse", + "ServicesResource", + "AsyncServicesResource", + "ServicesResourceWithRawResponse", + "AsyncServicesResourceWithRawResponse", + "ServicesResourceWithStreamingResponse", + "AsyncServicesResourceWithStreamingResponse", + "AutomationsResource", + "AsyncAutomationsResource", + "AutomationsResourceWithRawResponse", + "AsyncAutomationsResourceWithRawResponse", + "AutomationsResourceWithStreamingResponse", + "AsyncAutomationsResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py new file mode 100644 index 00000000..68f0404a --- /dev/null +++ b/src/gitpod/resources/environments/automations/automations.py @@ -0,0 +1,134 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .tasks import ( + TasksResource, + AsyncTasksResource, + TasksResourceWithRawResponse, + AsyncTasksResourceWithRawResponse, + TasksResourceWithStreamingResponse, + AsyncTasksResourceWithStreamingResponse, +) +from .services import ( + ServicesResource, + AsyncServicesResource, + ServicesResourceWithRawResponse, + AsyncServicesResourceWithRawResponse, + ServicesResourceWithStreamingResponse, + AsyncServicesResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["AutomationsResource", "AsyncAutomationsResource"] + + +class AutomationsResource(SyncAPIResource): + @cached_property + def tasks(self) -> TasksResource: + return TasksResource(self._client) + + @cached_property + def services(self) -> ServicesResource: + return ServicesResource(self._client) + + @cached_property + def with_raw_response(self) -> AutomationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AutomationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AutomationsResourceWithStreamingResponse(self) + + +class AsyncAutomationsResource(AsyncAPIResource): + @cached_property + def tasks(self) -> AsyncTasksResource: + return AsyncTasksResource(self._client) + + @cached_property + def services(self) -> AsyncServicesResource: + return AsyncServicesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncAutomationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncAutomationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncAutomationsResourceWithStreamingResponse(self) + + +class AutomationsResourceWithRawResponse: + def __init__(self, automations: AutomationsResource) -> None: + self._automations = automations + + @cached_property + def tasks(self) -> TasksResourceWithRawResponse: + return TasksResourceWithRawResponse(self._automations.tasks) + + @cached_property + def services(self) -> ServicesResourceWithRawResponse: + return ServicesResourceWithRawResponse(self._automations.services) + + +class AsyncAutomationsResourceWithRawResponse: + def __init__(self, automations: AsyncAutomationsResource) -> None: + self._automations = automations + + @cached_property + def tasks(self) -> AsyncTasksResourceWithRawResponse: + return AsyncTasksResourceWithRawResponse(self._automations.tasks) + + @cached_property + def services(self) -> AsyncServicesResourceWithRawResponse: + return AsyncServicesResourceWithRawResponse(self._automations.services) + + +class AutomationsResourceWithStreamingResponse: + def __init__(self, automations: AutomationsResource) -> None: + self._automations = automations + + @cached_property + def tasks(self) -> TasksResourceWithStreamingResponse: + return TasksResourceWithStreamingResponse(self._automations.tasks) + + @cached_property + def services(self) -> ServicesResourceWithStreamingResponse: + return ServicesResourceWithStreamingResponse(self._automations.services) + + +class AsyncAutomationsResourceWithStreamingResponse: + def __init__(self, automations: AsyncAutomationsResource) -> None: + self._automations = automations + + @cached_property + def tasks(self) -> AsyncTasksResourceWithStreamingResponse: + return AsyncTasksResourceWithStreamingResponse(self._automations.tasks) + + @cached_property + def services(self) -> AsyncServicesResourceWithStreamingResponse: + return AsyncServicesResourceWithStreamingResponse(self._automations.services) diff --git a/src/gitpod/resources/services.py b/src/gitpod/resources/environments/automations/services.py similarity index 80% rename from src/gitpod/resources/services.py rename to src/gitpod/resources/environments/automations/services.py index 08b46fa3..24e89981 100644 --- a/src/gitpod/resources/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -6,28 +6,30 @@ import httpx -from ..types import ( - service_stop_params, - service_start_params, - service_delete_params, - service_update_params, -) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( is_given, maybe_transform, strip_not_given, async_maybe_transform, ) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options +from ...._base_client import make_request_options +from ....types.environments.automations import ( + service_list_params, + service_stop_params, + service_start_params, + service_delete_params, + service_update_params, +) +from ....types.environments.automations.service_list_response import ServiceListResponse __all__ = ["ServicesResource", "AsyncServicesResource"] @@ -118,6 +120,64 @@ def update( cast_to=object, ) + def list( + self, + *, + connect_protocol_version: Literal[1], + filter: service_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceListResponse: + """ + ListServices + + Args: + connect_protocol_version: Define the version of the Connect protocol + + filter: filter contains the filter options for listing services + + pagination: pagination contains the pagination options for listing services + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/ListServices", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + service_list_params.ServiceListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ServiceListResponse, + ) + def delete( self, *, @@ -361,6 +421,64 @@ async def update( cast_to=object, ) + async def list( + self, + *, + connect_protocol_version: Literal[1], + filter: service_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceListResponse: + """ + ListServices + + Args: + connect_protocol_version: Define the version of the Connect protocol + + filter: filter contains the filter options for listing services + + pagination: pagination contains the pagination options for listing services + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/ListServices", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + service_list_params.ServiceListParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ServiceListResponse, + ) + async def delete( self, *, @@ -525,6 +643,9 @@ def __init__(self, services: ServicesResource) -> None: self.update = to_raw_response_wrapper( services.update, ) + self.list = to_raw_response_wrapper( + services.list, + ) self.delete = to_raw_response_wrapper( services.delete, ) @@ -543,6 +664,9 @@ def __init__(self, services: AsyncServicesResource) -> None: self.update = async_to_raw_response_wrapper( services.update, ) + self.list = async_to_raw_response_wrapper( + services.list, + ) self.delete = async_to_raw_response_wrapper( services.delete, ) @@ -561,6 +685,9 @@ def __init__(self, services: ServicesResource) -> None: self.update = to_streamed_response_wrapper( services.update, ) + self.list = to_streamed_response_wrapper( + services.list, + ) self.delete = to_streamed_response_wrapper( services.delete, ) @@ -579,6 +706,9 @@ def __init__(self, services: AsyncServicesResource) -> None: self.update = async_to_streamed_response_wrapper( services.update, ) + self.list = async_to_streamed_response_wrapper( + services.list, + ) self.delete = async_to_streamed_response_wrapper( services.delete, ) diff --git a/src/gitpod/resources/environment_automations/tasks.py b/src/gitpod/resources/environments/automations/tasks.py similarity index 78% rename from src/gitpod/resources/environment_automations/tasks.py rename to src/gitpod/resources/environments/automations/tasks.py index a0143da6..b74c0a74 100644 --- a/src/gitpod/resources/environment_automations/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks.py @@ -7,25 +7,32 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( is_given, maybe_transform, strip_not_given, async_maybe_transform, ) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options -from ...types.environment_automations import task_list_params, task_start_params, task_delete_params, task_update_params -from ...types.environment_automations.task_list_response import TaskListResponse -from ...types.environment_automations.task_start_response import TaskStartResponse +from ...._base_client import make_request_options +from ....types.environments.automations import ( + task_list_params, + task_start_params, + task_create_params, + task_delete_params, + task_update_params, +) +from ....types.environments.automations.task_list_response import TaskListResponse +from ....types.environments.automations.task_start_response import TaskStartResponse +from ....types.environments.automations.task_create_response import TaskCreateResponse __all__ = ["TasksResource", "AsyncTasksResource"] @@ -50,6 +57,64 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse: """ return TasksResourceWithStreamingResponse(self) + def create( + self, + *, + connect_protocol_version: Literal[1], + depends_on: List[str] | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, + spec: task_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskCreateResponse: + """ + CreateTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/CreateTask", + body=maybe_transform( + { + "depends_on": depends_on, + "environment_id": environment_id, + "metadata": metadata, + "spec": spec, + }, + task_create_params.TaskCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskCreateResponse, + ) + def update( self, *, @@ -285,6 +350,64 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: """ return AsyncTasksResourceWithStreamingResponse(self) + async def create( + self, + *, + connect_protocol_version: Literal[1], + depends_on: List[str] | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, + spec: task_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskCreateResponse: + """ + CreateTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/CreateTask", + body=await async_maybe_transform( + { + "depends_on": depends_on, + "environment_id": environment_id, + "metadata": metadata, + "spec": spec, + }, + task_create_params.TaskCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskCreateResponse, + ) + async def update( self, *, @@ -504,6 +627,9 @@ class TasksResourceWithRawResponse: def __init__(self, tasks: TasksResource) -> None: self._tasks = tasks + self.create = to_raw_response_wrapper( + tasks.create, + ) self.update = to_raw_response_wrapper( tasks.update, ) @@ -522,6 +648,9 @@ class AsyncTasksResourceWithRawResponse: def __init__(self, tasks: AsyncTasksResource) -> None: self._tasks = tasks + self.create = async_to_raw_response_wrapper( + tasks.create, + ) self.update = async_to_raw_response_wrapper( tasks.update, ) @@ -540,6 +669,9 @@ class TasksResourceWithStreamingResponse: def __init__(self, tasks: TasksResource) -> None: self._tasks = tasks + self.create = to_streamed_response_wrapper( + tasks.create, + ) self.update = to_streamed_response_wrapper( tasks.update, ) @@ -558,6 +690,9 @@ class AsyncTasksResourceWithStreamingResponse: def __init__(self, tasks: AsyncTasksResource) -> None: self._tasks = tasks + self.create = async_to_streamed_response_wrapper( + tasks.create, + ) self.update = async_to_streamed_response_wrapper( tasks.update, ) diff --git a/src/gitpod/resources/environments.py b/src/gitpod/resources/environments/environments.py similarity index 93% rename from src/gitpod/resources/environments.py rename to src/gitpod/resources/environments/environments.py index 376502ac..6b744c75 100644 --- a/src/gitpod/resources/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -6,38 +6,50 @@ import httpx -from ..types import ( +from ...types import ( environment_list_params, environment_start_params, environment_create_params, environment_retrieve_params, environment_create_from_project_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( is_given, maybe_transform, strip_not_given, async_maybe_transform, ) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options -from ..types.environment_list_response import EnvironmentListResponse -from ..types.environment_create_response import EnvironmentCreateResponse -from ..types.environment_retrieve_response import EnvironmentRetrieveResponse -from ..types.environment_create_from_project_response import EnvironmentCreateFromProjectResponse +from ..._base_client import make_request_options +from .automations.automations import ( + AutomationsResource, + AsyncAutomationsResource, + AutomationsResourceWithRawResponse, + AsyncAutomationsResourceWithRawResponse, + AutomationsResourceWithStreamingResponse, + AsyncAutomationsResourceWithStreamingResponse, +) +from ...types.environment_list_response import EnvironmentListResponse +from ...types.environment_create_response import EnvironmentCreateResponse +from ...types.environment_retrieve_response import EnvironmentRetrieveResponse +from ...types.environment_create_from_project_response import EnvironmentCreateFromProjectResponse __all__ = ["EnvironmentsResource", "AsyncEnvironmentsResource"] class EnvironmentsResource(SyncAPIResource): + @cached_property + def automations(self) -> AutomationsResource: + return AutomationsResource(self._client) + @cached_property def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: """ @@ -332,6 +344,10 @@ def start( class AsyncEnvironmentsResource(AsyncAPIResource): + @cached_property + def automations(self) -> AsyncAutomationsResource: + return AsyncAutomationsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: """ @@ -647,6 +663,10 @@ def __init__(self, environments: EnvironmentsResource) -> None: environments.start, ) + @cached_property + def automations(self) -> AutomationsResourceWithRawResponse: + return AutomationsResourceWithRawResponse(self._environments.automations) + class AsyncEnvironmentsResourceWithRawResponse: def __init__(self, environments: AsyncEnvironmentsResource) -> None: @@ -668,6 +688,10 @@ def __init__(self, environments: AsyncEnvironmentsResource) -> None: environments.start, ) + @cached_property + def automations(self) -> AsyncAutomationsResourceWithRawResponse: + return AsyncAutomationsResourceWithRawResponse(self._environments.automations) + class EnvironmentsResourceWithStreamingResponse: def __init__(self, environments: EnvironmentsResource) -> None: @@ -689,6 +713,10 @@ def __init__(self, environments: EnvironmentsResource) -> None: environments.start, ) + @cached_property + def automations(self) -> AutomationsResourceWithStreamingResponse: + return AutomationsResourceWithStreamingResponse(self._environments.automations) + class AsyncEnvironmentsResourceWithStreamingResponse: def __init__(self, environments: AsyncEnvironmentsResource) -> None: @@ -709,3 +737,7 @@ def __init__(self, environments: AsyncEnvironmentsResource) -> None: self.start = async_to_streamed_response_wrapper( environments.start, ) + + @cached_property + def automations(self) -> AsyncAutomationsResourceWithStreamingResponse: + return AsyncAutomationsResourceWithStreamingResponse(self._environments.automations) diff --git a/src/gitpod/resources/runner_interactions/environments.py b/src/gitpod/resources/runner_interactions/environments.py deleted file mode 100644 index e194ddc8..00000000 --- a/src/gitpod/resources/runner_interactions/environments.py +++ /dev/null @@ -1,504 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.runner_interactions import ( - environment_list_params, - environment_retrieve_params, - environment_update_status_params, -) -from ...types.runner_interactions.environment_list_response import EnvironmentListResponse -from ...types.runner_interactions.environment_retrieve_response import EnvironmentRetrieveResponse - -__all__ = ["EnvironmentsResource", "AsyncEnvironmentsResource"] - - -class EnvironmentsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return EnvironmentsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return EnvironmentsResourceWithStreamingResponse(self) - - def retrieve( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentRetrieveResponse: - """ - GetRunnerEnvironment returns the environment given it is owned by the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: The environment's ID - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/GetRunnerEnvironment", - body=maybe_transform( - { - "environment_id": environment_id, - "runner_id": runner_id, - }, - environment_retrieve_params.EnvironmentRetrieveParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=EnvironmentRetrieveResponse, - ) - - def list( - self, - *, - connect_protocol_version: Literal[1], - environment_ids: List[str] | NotGiven = NOT_GIVEN, - pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentListResponse: - """ - ListRunnerEnvironments returns the environments this runner is responsible for. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_ids: An optional list of environment IDs to fetch. If this list is empty/not provided - all environments that ought to run on the runner are returned. - - pagination: pagination contains the pagination options for listing environments - - runner_id: The runner's identifier - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironments", - body=maybe_transform( - { - "environment_ids": environment_ids, - "pagination": pagination, - "runner_id": runner_id, - }, - environment_list_params.EnvironmentListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=EnvironmentListResponse, - ) - - def update_status( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - status: environment_update_status_params.Status | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerEnvironmentStatus updates the status of an environment this runner - is responsible for. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: The environment's ID - - runner_id: The runner's identity - - status: EnvironmentStatus describes an environment status - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerEnvironmentStatus", - body=maybe_transform( - { - "environment_id": environment_id, - "runner_id": runner_id, - "status": status, - }, - environment_update_status_params.EnvironmentUpdateStatusParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncEnvironmentsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncEnvironmentsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncEnvironmentsResourceWithStreamingResponse(self) - - async def retrieve( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentRetrieveResponse: - """ - GetRunnerEnvironment returns the environment given it is owned by the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: The environment's ID - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/GetRunnerEnvironment", - body=await async_maybe_transform( - { - "environment_id": environment_id, - "runner_id": runner_id, - }, - environment_retrieve_params.EnvironmentRetrieveParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=EnvironmentRetrieveResponse, - ) - - async def list( - self, - *, - connect_protocol_version: Literal[1], - environment_ids: List[str] | NotGiven = NOT_GIVEN, - pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentListResponse: - """ - ListRunnerEnvironments returns the environments this runner is responsible for. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_ids: An optional list of environment IDs to fetch. If this list is empty/not provided - all environments that ought to run on the runner are returned. - - pagination: pagination contains the pagination options for listing environments - - runner_id: The runner's identifier - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironments", - body=await async_maybe_transform( - { - "environment_ids": environment_ids, - "pagination": pagination, - "runner_id": runner_id, - }, - environment_list_params.EnvironmentListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=EnvironmentListResponse, - ) - - async def update_status( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - status: environment_update_status_params.Status | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerEnvironmentStatus updates the status of an environment this runner - is responsible for. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: The environment's ID - - runner_id: The runner's identity - - status: EnvironmentStatus describes an environment status - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerEnvironmentStatus", - body=await async_maybe_transform( - { - "environment_id": environment_id, - "runner_id": runner_id, - "status": status, - }, - environment_update_status_params.EnvironmentUpdateStatusParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class EnvironmentsResourceWithRawResponse: - def __init__(self, environments: EnvironmentsResource) -> None: - self._environments = environments - - self.retrieve = to_raw_response_wrapper( - environments.retrieve, - ) - self.list = to_raw_response_wrapper( - environments.list, - ) - self.update_status = to_raw_response_wrapper( - environments.update_status, - ) - - -class AsyncEnvironmentsResourceWithRawResponse: - def __init__(self, environments: AsyncEnvironmentsResource) -> None: - self._environments = environments - - self.retrieve = async_to_raw_response_wrapper( - environments.retrieve, - ) - self.list = async_to_raw_response_wrapper( - environments.list, - ) - self.update_status = async_to_raw_response_wrapper( - environments.update_status, - ) - - -class EnvironmentsResourceWithStreamingResponse: - def __init__(self, environments: EnvironmentsResource) -> None: - self._environments = environments - - self.retrieve = to_streamed_response_wrapper( - environments.retrieve, - ) - self.list = to_streamed_response_wrapper( - environments.list, - ) - self.update_status = to_streamed_response_wrapper( - environments.update_status, - ) - - -class AsyncEnvironmentsResourceWithStreamingResponse: - def __init__(self, environments: AsyncEnvironmentsResource) -> None: - self._environments = environments - - self.retrieve = async_to_streamed_response_wrapper( - environments.retrieve, - ) - self.list = async_to_streamed_response_wrapper( - environments.list, - ) - self.update_status = async_to_streamed_response_wrapper( - environments.update_status, - ) diff --git a/src/gitpod/resources/runner_interactions/runner_interactions.py b/src/gitpod/resources/runner_interactions/runner_interactions.py deleted file mode 100644 index 731708e4..00000000 --- a/src/gitpod/resources/runner_interactions/runner_interactions.py +++ /dev/null @@ -1,1296 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Literal - -import httpx - -from ...types import ( - runner_interaction_signup_params, - runner_interaction_mark_active_params, - runner_interaction_send_response_params, - runner_interaction_update_status_params, - runner_interaction_get_latest_version_params, - runner_interaction_list_runner_scm_integrations_params, - runner_interaction_list_runner_environment_classes_params, - runner_interaction_update_runner_configuration_schema_params, - runner_interaction_get_host_authentication_token_value_params, -) -from ..._types import ( - NOT_GIVEN, - Body, - Query, - Headers, - NotGiven, - Base64FileInput, -) -from ..._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .environments import ( - EnvironmentsResource, - AsyncEnvironmentsResource, - EnvironmentsResourceWithRawResponse, - AsyncEnvironmentsResourceWithRawResponse, - EnvironmentsResourceWithStreamingResponse, - AsyncEnvironmentsResourceWithStreamingResponse, -) -from ..._base_client import make_request_options -from ...types.runner_interaction_signup_response import RunnerInteractionSignupResponse -from ...types.runner_interaction_get_latest_version_response import RunnerInteractionGetLatestVersionResponse -from ...types.runner_interaction_list_runner_scm_integrations_response import ( - RunnerInteractionListRunnerScmIntegrationsResponse, -) -from ...types.runner_interaction_list_runner_environment_classes_response import ( - RunnerInteractionListRunnerEnvironmentClassesResponse, -) -from ...types.runner_interaction_get_host_authentication_token_value_response import ( - RunnerInteractionGetHostAuthenticationTokenValueResponse, -) - -__all__ = ["RunnerInteractionsResource", "AsyncRunnerInteractionsResource"] - - -class RunnerInteractionsResource(SyncAPIResource): - @cached_property - def environments(self) -> EnvironmentsResource: - return EnvironmentsResource(self._client) - - @cached_property - def with_raw_response(self) -> RunnerInteractionsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return RunnerInteractionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RunnerInteractionsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return RunnerInteractionsResourceWithStreamingResponse(self) - - def get_host_authentication_token_value( - self, - *, - connect_protocol_version: Literal[1], - host: str | NotGiven = NOT_GIVEN, - principal_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionGetHostAuthenticationTokenValueResponse: - """ - GetRunnerHostAuthenticationToken returns an authentication token for the given - host. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - host: The host to get the authentication token for - - principal_id: The principal's ID to get the authentication token for - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/GetHostAuthenticationTokenValue", - body=maybe_transform( - { - "host": host, - "principal_id": principal_id, - "runner_id": runner_id, - }, - runner_interaction_get_host_authentication_token_value_params.RunnerInteractionGetHostAuthenticationTokenValueParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionGetHostAuthenticationTokenValueResponse, - ) - - def get_latest_version( - self, - *, - connect_protocol_version: Literal[1], - current_version: str | NotGiven = NOT_GIVEN, - infrastructure_version: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionGetLatestVersionResponse: - """ - GetLatestVersion returns the latest version of the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - current_version: The current version of the runner - - infrastructure_version: The version of the infrastructure - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/GetLatestVersion", - body=maybe_transform( - { - "current_version": current_version, - "infrastructure_version": infrastructure_version, - "runner_id": runner_id, - }, - runner_interaction_get_latest_version_params.RunnerInteractionGetLatestVersionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionGetLatestVersionResponse, - ) - - def list_runner_environment_classes( - self, - *, - connect_protocol_version: Literal[1], - filter: runner_interaction_list_runner_environment_classes_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_interaction_list_runner_environment_classes_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionListRunnerEnvironmentClassesResponse: - """ - ListRunnerEnvironmentClasses returns the environment classes configured for the - runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - pagination: pagination contains the pagination options for listing environment classes - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironmentClasses", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - "runner_id": runner_id, - }, - runner_interaction_list_runner_environment_classes_params.RunnerInteractionListRunnerEnvironmentClassesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionListRunnerEnvironmentClassesResponse, - ) - - def list_runner_scm_integrations( - self, - *, - connect_protocol_version: Literal[1], - filter: runner_interaction_list_runner_scm_integrations_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_interaction_list_runner_scm_integrations_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionListRunnerScmIntegrationsResponse: - """ListRunnerSCMIntegrations returns the SCM integrations configured for the - runner. - - For local runners, this returns the SCM integrations configured on the - organization's local-configuration runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - pagination: pagination contains the pagination options for listing SCM integrations - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerSCMIntegrations", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - "runner_id": runner_id, - }, - runner_interaction_list_runner_scm_integrations_params.RunnerInteractionListRunnerScmIntegrationsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionListRunnerScmIntegrationsResponse, - ) - - def mark_active( - self, - *, - connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """MarkRunnerActive marks a runner as available. - - This must be called every 30 - seconds to keep the runner active. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/MarkRunnerActive", - body=maybe_transform( - {"runner_id": runner_id}, runner_interaction_mark_active_params.RunnerInteractionMarkActiveParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def send_response( - self, - *, - body: runner_interaction_send_response_params.Body, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/SendResponse", - body=maybe_transform(body, runner_interaction_send_response_params.RunnerInteractionSendResponseParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def signup( - self, - *, - connect_protocol_version: Literal[1], - environment_classes: Iterable[runner_interaction_signup_params.EnvironmentClass] | NotGiven = NOT_GIVEN, - public_key: Union[str, Base64FileInput] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionSignupResponse: - """Signup is called by a runner to sign up with the backend. - - This is the first call - a runner makes. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_classes: The environment classes this runner has to offer - - public_key: The runner's public key. Must be an ECDH public key encoded in PKIX, ASN.1 DER - format. - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/Signup", - body=maybe_transform( - { - "environment_classes": environment_classes, - "public_key": public_key, - }, - runner_interaction_signup_params.RunnerInteractionSignupParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionSignupResponse, - ) - - def update_runner_configuration_schema( - self, - *, - connect_protocol_version: Literal[1], - config_schema: runner_interaction_update_runner_configuration_schema_params.ConfigSchema | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerConfigurationSchema updates the runner's configuration schema. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - config_schema: config_schema is the schema for the runner's configuration - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerConfigurationSchema", - body=maybe_transform( - { - "config_schema": config_schema, - "runner_id": runner_id, - }, - runner_interaction_update_runner_configuration_schema_params.RunnerInteractionUpdateRunnerConfigurationSchemaParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def update_status( - self, - *, - body: runner_interaction_update_status_params.Body, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerStatus updates the status of the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerStatus", - body=maybe_transform(body, runner_interaction_update_status_params.RunnerInteractionUpdateStatusParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncRunnerInteractionsResource(AsyncAPIResource): - @cached_property - def environments(self) -> AsyncEnvironmentsResource: - return AsyncEnvironmentsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncRunnerInteractionsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncRunnerInteractionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRunnerInteractionsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncRunnerInteractionsResourceWithStreamingResponse(self) - - async def get_host_authentication_token_value( - self, - *, - connect_protocol_version: Literal[1], - host: str | NotGiven = NOT_GIVEN, - principal_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionGetHostAuthenticationTokenValueResponse: - """ - GetRunnerHostAuthenticationToken returns an authentication token for the given - host. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - host: The host to get the authentication token for - - principal_id: The principal's ID to get the authentication token for - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/GetHostAuthenticationTokenValue", - body=await async_maybe_transform( - { - "host": host, - "principal_id": principal_id, - "runner_id": runner_id, - }, - runner_interaction_get_host_authentication_token_value_params.RunnerInteractionGetHostAuthenticationTokenValueParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionGetHostAuthenticationTokenValueResponse, - ) - - async def get_latest_version( - self, - *, - connect_protocol_version: Literal[1], - current_version: str | NotGiven = NOT_GIVEN, - infrastructure_version: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionGetLatestVersionResponse: - """ - GetLatestVersion returns the latest version of the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - current_version: The current version of the runner - - infrastructure_version: The version of the infrastructure - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/GetLatestVersion", - body=await async_maybe_transform( - { - "current_version": current_version, - "infrastructure_version": infrastructure_version, - "runner_id": runner_id, - }, - runner_interaction_get_latest_version_params.RunnerInteractionGetLatestVersionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionGetLatestVersionResponse, - ) - - async def list_runner_environment_classes( - self, - *, - connect_protocol_version: Literal[1], - filter: runner_interaction_list_runner_environment_classes_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_interaction_list_runner_environment_classes_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionListRunnerEnvironmentClassesResponse: - """ - ListRunnerEnvironmentClasses returns the environment classes configured for the - runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - pagination: pagination contains the pagination options for listing environment classes - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerEnvironmentClasses", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - "runner_id": runner_id, - }, - runner_interaction_list_runner_environment_classes_params.RunnerInteractionListRunnerEnvironmentClassesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionListRunnerEnvironmentClassesResponse, - ) - - async def list_runner_scm_integrations( - self, - *, - connect_protocol_version: Literal[1], - filter: runner_interaction_list_runner_scm_integrations_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_interaction_list_runner_scm_integrations_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionListRunnerScmIntegrationsResponse: - """ListRunnerSCMIntegrations returns the SCM integrations configured for the - runner. - - For local runners, this returns the SCM integrations configured on the - organization's local-configuration runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - pagination: pagination contains the pagination options for listing SCM integrations - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/ListRunnerSCMIntegrations", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - "runner_id": runner_id, - }, - runner_interaction_list_runner_scm_integrations_params.RunnerInteractionListRunnerScmIntegrationsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionListRunnerScmIntegrationsResponse, - ) - - async def mark_active( - self, - *, - connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """MarkRunnerActive marks a runner as available. - - This must be called every 30 - seconds to keep the runner active. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/MarkRunnerActive", - body=await async_maybe_transform( - {"runner_id": runner_id}, runner_interaction_mark_active_params.RunnerInteractionMarkActiveParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def send_response( - self, - *, - body: runner_interaction_send_response_params.Body, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - SendResponse sends a response to a request. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/SendResponse", - body=await async_maybe_transform( - body, runner_interaction_send_response_params.RunnerInteractionSendResponseParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def signup( - self, - *, - connect_protocol_version: Literal[1], - environment_classes: Iterable[runner_interaction_signup_params.EnvironmentClass] | NotGiven = NOT_GIVEN, - public_key: Union[str, Base64FileInput] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerInteractionSignupResponse: - """Signup is called by a runner to sign up with the backend. - - This is the first call - a runner makes. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_classes: The environment classes this runner has to offer - - public_key: The runner's public key. Must be an ECDH public key encoded in PKIX, ASN.1 DER - format. - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/Signup", - body=await async_maybe_transform( - { - "environment_classes": environment_classes, - "public_key": public_key, - }, - runner_interaction_signup_params.RunnerInteractionSignupParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerInteractionSignupResponse, - ) - - async def update_runner_configuration_schema( - self, - *, - connect_protocol_version: Literal[1], - config_schema: runner_interaction_update_runner_configuration_schema_params.ConfigSchema | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerConfigurationSchema updates the runner's configuration schema. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - config_schema: config_schema is the schema for the runner's configuration - - runner_id: The runner's identity - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerConfigurationSchema", - body=await async_maybe_transform( - { - "config_schema": config_schema, - "runner_id": runner_id, - }, - runner_interaction_update_runner_configuration_schema_params.RunnerInteractionUpdateRunnerConfigurationSchemaParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def update_status( - self, - *, - body: runner_interaction_update_status_params.Body, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunnerStatus updates the status of the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerInteractionService/UpdateRunnerStatus", - body=await async_maybe_transform( - body, runner_interaction_update_status_params.RunnerInteractionUpdateStatusParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class RunnerInteractionsResourceWithRawResponse: - def __init__(self, runner_interactions: RunnerInteractionsResource) -> None: - self._runner_interactions = runner_interactions - - self.get_host_authentication_token_value = to_raw_response_wrapper( - runner_interactions.get_host_authentication_token_value, - ) - self.get_latest_version = to_raw_response_wrapper( - runner_interactions.get_latest_version, - ) - self.list_runner_environment_classes = to_raw_response_wrapper( - runner_interactions.list_runner_environment_classes, - ) - self.list_runner_scm_integrations = to_raw_response_wrapper( - runner_interactions.list_runner_scm_integrations, - ) - self.mark_active = to_raw_response_wrapper( - runner_interactions.mark_active, - ) - self.send_response = to_raw_response_wrapper( - runner_interactions.send_response, - ) - self.signup = to_raw_response_wrapper( - runner_interactions.signup, - ) - self.update_runner_configuration_schema = to_raw_response_wrapper( - runner_interactions.update_runner_configuration_schema, - ) - self.update_status = to_raw_response_wrapper( - runner_interactions.update_status, - ) - - @cached_property - def environments(self) -> EnvironmentsResourceWithRawResponse: - return EnvironmentsResourceWithRawResponse(self._runner_interactions.environments) - - -class AsyncRunnerInteractionsResourceWithRawResponse: - def __init__(self, runner_interactions: AsyncRunnerInteractionsResource) -> None: - self._runner_interactions = runner_interactions - - self.get_host_authentication_token_value = async_to_raw_response_wrapper( - runner_interactions.get_host_authentication_token_value, - ) - self.get_latest_version = async_to_raw_response_wrapper( - runner_interactions.get_latest_version, - ) - self.list_runner_environment_classes = async_to_raw_response_wrapper( - runner_interactions.list_runner_environment_classes, - ) - self.list_runner_scm_integrations = async_to_raw_response_wrapper( - runner_interactions.list_runner_scm_integrations, - ) - self.mark_active = async_to_raw_response_wrapper( - runner_interactions.mark_active, - ) - self.send_response = async_to_raw_response_wrapper( - runner_interactions.send_response, - ) - self.signup = async_to_raw_response_wrapper( - runner_interactions.signup, - ) - self.update_runner_configuration_schema = async_to_raw_response_wrapper( - runner_interactions.update_runner_configuration_schema, - ) - self.update_status = async_to_raw_response_wrapper( - runner_interactions.update_status, - ) - - @cached_property - def environments(self) -> AsyncEnvironmentsResourceWithRawResponse: - return AsyncEnvironmentsResourceWithRawResponse(self._runner_interactions.environments) - - -class RunnerInteractionsResourceWithStreamingResponse: - def __init__(self, runner_interactions: RunnerInteractionsResource) -> None: - self._runner_interactions = runner_interactions - - self.get_host_authentication_token_value = to_streamed_response_wrapper( - runner_interactions.get_host_authentication_token_value, - ) - self.get_latest_version = to_streamed_response_wrapper( - runner_interactions.get_latest_version, - ) - self.list_runner_environment_classes = to_streamed_response_wrapper( - runner_interactions.list_runner_environment_classes, - ) - self.list_runner_scm_integrations = to_streamed_response_wrapper( - runner_interactions.list_runner_scm_integrations, - ) - self.mark_active = to_streamed_response_wrapper( - runner_interactions.mark_active, - ) - self.send_response = to_streamed_response_wrapper( - runner_interactions.send_response, - ) - self.signup = to_streamed_response_wrapper( - runner_interactions.signup, - ) - self.update_runner_configuration_schema = to_streamed_response_wrapper( - runner_interactions.update_runner_configuration_schema, - ) - self.update_status = to_streamed_response_wrapper( - runner_interactions.update_status, - ) - - @cached_property - def environments(self) -> EnvironmentsResourceWithStreamingResponse: - return EnvironmentsResourceWithStreamingResponse(self._runner_interactions.environments) - - -class AsyncRunnerInteractionsResourceWithStreamingResponse: - def __init__(self, runner_interactions: AsyncRunnerInteractionsResource) -> None: - self._runner_interactions = runner_interactions - - self.get_host_authentication_token_value = async_to_streamed_response_wrapper( - runner_interactions.get_host_authentication_token_value, - ) - self.get_latest_version = async_to_streamed_response_wrapper( - runner_interactions.get_latest_version, - ) - self.list_runner_environment_classes = async_to_streamed_response_wrapper( - runner_interactions.list_runner_environment_classes, - ) - self.list_runner_scm_integrations = async_to_streamed_response_wrapper( - runner_interactions.list_runner_scm_integrations, - ) - self.mark_active = async_to_streamed_response_wrapper( - runner_interactions.mark_active, - ) - self.send_response = async_to_streamed_response_wrapper( - runner_interactions.send_response, - ) - self.signup = async_to_streamed_response_wrapper( - runner_interactions.signup, - ) - self.update_runner_configuration_schema = async_to_streamed_response_wrapper( - runner_interactions.update_runner_configuration_schema, - ) - self.update_status = async_to_streamed_response_wrapper( - runner_interactions.update_status, - ) - - @cached_property - def environments(self) -> AsyncEnvironmentsResourceWithStreamingResponse: - return AsyncEnvironmentsResourceWithStreamingResponse(self._runner_interactions.environments) diff --git a/src/gitpod/resources/tasks.py b/src/gitpod/resources/tasks.py deleted file mode 100644 index 64ea8c58..00000000 --- a/src/gitpod/resources/tasks.py +++ /dev/null @@ -1,330 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal - -import httpx - -from ..types import task_create_params, task_retrieve_create_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options -from ..types.task_create_response import TaskCreateResponse -from ..types.task_retrieve_create_response import TaskRetrieveCreateResponse - -__all__ = ["TasksResource", "AsyncTasksResource"] - - -class TasksResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> TasksResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return TasksResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> TasksResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return TasksResourceWithStreamingResponse(self) - - def create( - self, - *, - connect_protocol_version: Literal[1], - depends_on: List[str] | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, - spec: task_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskCreateResponse: - """ - CreateTask - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/CreateTask", - body=maybe_transform( - { - "depends_on": depends_on, - "environment_id": environment_id, - "metadata": metadata, - "spec": spec, - }, - task_create_params.TaskCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskCreateResponse, - ) - - def retrieve_create( - self, - *, - connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskRetrieveCreateResponse: - """ - GetTask - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/GetTask", - body=maybe_transform({"id": id}, task_retrieve_create_params.TaskRetrieveCreateParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskRetrieveCreateResponse, - ) - - -class AsyncTasksResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncTasksResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncTasksResourceWithStreamingResponse(self) - - async def create( - self, - *, - connect_protocol_version: Literal[1], - depends_on: List[str] | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, - spec: task_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskCreateResponse: - """ - CreateTask - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/CreateTask", - body=await async_maybe_transform( - { - "depends_on": depends_on, - "environment_id": environment_id, - "metadata": metadata, - "spec": spec, - }, - task_create_params.TaskCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskCreateResponse, - ) - - async def retrieve_create( - self, - *, - connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskRetrieveCreateResponse: - """ - GetTask - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/GetTask", - body=await async_maybe_transform({"id": id}, task_retrieve_create_params.TaskRetrieveCreateParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=TaskRetrieveCreateResponse, - ) - - -class TasksResourceWithRawResponse: - def __init__(self, tasks: TasksResource) -> None: - self._tasks = tasks - - self.create = to_raw_response_wrapper( - tasks.create, - ) - self.retrieve_create = to_raw_response_wrapper( - tasks.retrieve_create, - ) - - -class AsyncTasksResourceWithRawResponse: - def __init__(self, tasks: AsyncTasksResource) -> None: - self._tasks = tasks - - self.create = async_to_raw_response_wrapper( - tasks.create, - ) - self.retrieve_create = async_to_raw_response_wrapper( - tasks.retrieve_create, - ) - - -class TasksResourceWithStreamingResponse: - def __init__(self, tasks: TasksResource) -> None: - self._tasks = tasks - - self.create = to_streamed_response_wrapper( - tasks.create, - ) - self.retrieve_create = to_streamed_response_wrapper( - tasks.retrieve_create, - ) - - -class AsyncTasksResourceWithStreamingResponse: - def __init__(self, tasks: AsyncTasksResource) -> None: - self._tasks = tasks - - self.create = async_to_streamed_response_wrapper( - tasks.create, - ) - self.retrieve_create = async_to_streamed_response_wrapper( - tasks.retrieve_create, - ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 86aae494..d3764a14 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -4,16 +4,10 @@ from .editor_list_params import EditorListParams as EditorListParams from .runner_list_params import RunnerListParams as RunnerListParams -from .task_create_params import TaskCreateParams as TaskCreateParams -from .service_stop_params import ServiceStopParams as ServiceStopParams from .editor_list_response import EditorListResponse as EditorListResponse from .runner_create_params import RunnerCreateParams as RunnerCreateParams from .runner_list_response import RunnerListResponse as RunnerListResponse -from .service_start_params import ServiceStartParams as ServiceStartParams -from .task_create_response import TaskCreateResponse as TaskCreateResponse from .project_create_params import ProjectCreateParams as ProjectCreateParams -from .service_delete_params import ServiceDeleteParams as ServiceDeleteParams -from .service_update_params import ServiceUpdateParams as ServiceUpdateParams from .editor_retrieve_params import EditorRetrieveParams as EditorRetrieveParams from .runner_create_response import RunnerCreateResponse as RunnerCreateResponse from .environment_list_params import EnvironmentListParams as EnvironmentListParams @@ -29,29 +23,22 @@ from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams from .runner_delete_runner_params import RunnerDeleteRunnerParams as RunnerDeleteRunnerParams from .runner_update_runner_params import RunnerUpdateRunnerParams as RunnerUpdateRunnerParams -from .task_retrieve_create_params import TaskRetrieveCreateParams as TaskRetrieveCreateParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse -from .task_retrieve_create_response import TaskRetrieveCreateResponse as TaskRetrieveCreateResponse from .automations_file_upsert_params import AutomationsFileUpsertParams as AutomationsFileUpsertParams from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams from .automations_file_upsert_response import AutomationsFileUpsertResponse as AutomationsFileUpsertResponse from .editor_resolve_editor_url_params import EditorResolveEditorURLParams as EditorResolveEditorURLParams -from .runner_interaction_signup_params import RunnerInteractionSignupParams as RunnerInteractionSignupParams from .personal_access_token_list_params import PersonalAccessTokenListParams as PersonalAccessTokenListParams from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse from .editor_resolve_editor_url_response import EditorResolveEditorURLResponse as EditorResolveEditorURLResponse -from .runner_interaction_signup_response import RunnerInteractionSignupResponse as RunnerInteractionSignupResponse from .personal_access_token_delete_params import PersonalAccessTokenDeleteParams as PersonalAccessTokenDeleteParams from .personal_access_token_list_response import PersonalAccessTokenListResponse as PersonalAccessTokenListResponse from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse from .runner_configuration_validate_params import RunnerConfigurationValidateParams as RunnerConfigurationValidateParams -from .runner_interaction_mark_active_params import ( - RunnerInteractionMarkActiveParams as RunnerInteractionMarkActiveParams, -) from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, ) @@ -61,12 +48,6 @@ from .runner_configuration_validate_response import ( RunnerConfigurationValidateResponse as RunnerConfigurationValidateResponse, ) -from .runner_interaction_send_response_params import ( - RunnerInteractionSendResponseParams as RunnerInteractionSendResponseParams, -) -from .runner_interaction_update_status_params import ( - RunnerInteractionUpdateStatusParams as RunnerInteractionUpdateStatusParams, -) from .environment_create_from_project_response import ( EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, ) @@ -76,33 +57,6 @@ from .runner_check_authentication_for_host_params import ( RunnerCheckAuthenticationForHostParams as RunnerCheckAuthenticationForHostParams, ) -from .runner_interaction_get_latest_version_params import ( - RunnerInteractionGetLatestVersionParams as RunnerInteractionGetLatestVersionParams, -) from .runner_check_authentication_for_host_response import ( RunnerCheckAuthenticationForHostResponse as RunnerCheckAuthenticationForHostResponse, ) -from .runner_interaction_get_latest_version_response import ( - RunnerInteractionGetLatestVersionResponse as RunnerInteractionGetLatestVersionResponse, -) -from .runner_interaction_list_runner_scm_integrations_params import ( - RunnerInteractionListRunnerScmIntegrationsParams as RunnerInteractionListRunnerScmIntegrationsParams, -) -from .runner_interaction_list_runner_scm_integrations_response import ( - RunnerInteractionListRunnerScmIntegrationsResponse as RunnerInteractionListRunnerScmIntegrationsResponse, -) -from .runner_interaction_list_runner_environment_classes_params import ( - RunnerInteractionListRunnerEnvironmentClassesParams as RunnerInteractionListRunnerEnvironmentClassesParams, -) -from .runner_interaction_list_runner_environment_classes_response import ( - RunnerInteractionListRunnerEnvironmentClassesResponse as RunnerInteractionListRunnerEnvironmentClassesResponse, -) -from .runner_interaction_update_runner_configuration_schema_params import ( - RunnerInteractionUpdateRunnerConfigurationSchemaParams as RunnerInteractionUpdateRunnerConfigurationSchemaParams, -) -from .runner_interaction_get_host_authentication_token_value_params import ( - RunnerInteractionGetHostAuthenticationTokenValueParams as RunnerInteractionGetHostAuthenticationTokenValueParams, -) -from .runner_interaction_get_host_authentication_token_value_response import ( - RunnerInteractionGetHostAuthenticationTokenValueResponse as RunnerInteractionGetHostAuthenticationTokenValueResponse, -) diff --git a/src/gitpod/types/environment_automations/__init__.py b/src/gitpod/types/environment_automations/__init__.py deleted file mode 100644 index d1000b3e..00000000 --- a/src/gitpod/types/environment_automations/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .task_list_params import TaskListParams as TaskListParams -from .task_start_params import TaskStartParams as TaskStartParams -from .task_delete_params import TaskDeleteParams as TaskDeleteParams -from .task_list_response import TaskListResponse as TaskListResponse -from .task_update_params import TaskUpdateParams as TaskUpdateParams -from .task_start_response import TaskStartResponse as TaskStartResponse -from .task_execution_list_params import TaskExecutionListParams as TaskExecutionListParams -from .task_execution_stop_params import TaskExecutionStopParams as TaskExecutionStopParams -from .task_execution_list_response import TaskExecutionListResponse as TaskExecutionListResponse -from .task_execution_retrieve_params import TaskExecutionRetrieveParams as TaskExecutionRetrieveParams -from .task_execution_retrieve_response import TaskExecutionRetrieveResponse as TaskExecutionRetrieveResponse -from .task_execution_create_retrieve_params import ( - TaskExecutionCreateRetrieveParams as TaskExecutionCreateRetrieveParams, -) -from .task_execution_create_retrieve_response import ( - TaskExecutionCreateRetrieveResponse as TaskExecutionCreateRetrieveResponse, -) -from .task_execution_update_task_execution_status_params import ( - TaskExecutionUpdateTaskExecutionStatusParams as TaskExecutionUpdateTaskExecutionStatusParams, -) diff --git a/src/gitpod/types/environment_automations/task_execution_create_retrieve_params.py b/src/gitpod/types/environment_automations/task_execution_create_retrieve_params.py deleted file mode 100644 index 057567ba..00000000 --- a/src/gitpod/types/environment_automations/task_execution_create_retrieve_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["TaskExecutionCreateRetrieveParams"] - - -class TaskExecutionCreateRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py b/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py deleted file mode 100644 index 8c4be184..00000000 --- a/src/gitpod/types/environment_automations/task_execution_create_retrieve_response.py +++ /dev/null @@ -1,440 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = [ - "TaskExecutionCreateRetrieveResponse", - "TaskExecution", - "TaskExecutionMetadata", - "TaskExecutionMetadataCreator", - "TaskExecutionSpec", - "TaskExecutionSpecPlan", - "TaskExecutionSpecPlanStep", - "TaskExecutionStatus", - "TaskExecutionStatusStep", -] - - -class TaskExecutionMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskExecutionMetadata(BaseModel): - completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskExecutionMetadataCreator] = None - """creator describes the principal who created/started the task run.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - """environment_id is the ID of the environment in which the task run is executed.""" - - started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) - """started_by describes the trigger that started the task execution.""" - - task_id: Optional[str] = FieldInfo(alias="taskId", default=None) - """task_id is the ID of the main task being executed.""" - - -class TaskExecutionSpecPlanStep: - pass - - -class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[TaskExecutionSpecPlanStep]] = None - - -class TaskExecutionSpec(BaseModel): - desired_phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the task execution should be in. - - Used to stop a running task execution early. - """ - - plan: Optional[List[TaskExecutionSpecPlan]] = None - """plan is a list of groups of steps. - - The steps in a group are executed concurrently, while the groups are executed - sequentially. The order of the groups is the order in which they are executed. - """ - - -class TaskExecutionStatusStep(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. - - If this is non-empty the step has failed to operate and will likely transition - to a failed state. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """phase is the current phase of the execution step""" - - -class TaskExecutionStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the task execution failed to operate. - - If this is non-empty the task execution has failed to operate and will likely - transition to a failed state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url is the URL to the logs of the task's steps. - - If this is empty, the task either has no logs or has not yet started. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """the phase of a task execution represents the aggregated phase of all steps.""" - - status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Task executions themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - steps: Optional[List[TaskExecutionStatusStep]] = None - """steps provides the status for each individual step of the task execution. - - If a step is missing it has not yet started. - """ - - -class TaskExecution(BaseModel): - id: Optional[str] = None - - metadata: Optional[TaskExecutionMetadata] = None - - spec: Optional[TaskExecutionSpec] = None - - status: Optional[TaskExecutionStatus] = None - - -class TaskExecutionCreateRetrieveResponse(BaseModel): - task_execution: Optional[TaskExecution] = FieldInfo(alias="taskExecution", default=None) diff --git a/src/gitpod/types/environment_automations/task_execution_list_params.py b/src/gitpod/types/environment_automations/task_execution_list_params.py deleted file mode 100644 index d730d88d..00000000 --- a/src/gitpod/types/environment_automations/task_execution_list_params.py +++ /dev/null @@ -1,61 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["TaskExecutionListParams", "Filter", "Pagination"] - - -class TaskExecutionListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - """filter contains the filter options for listing task runs""" - - pagination: Pagination - """pagination contains the pagination options for listing task runs""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] - """environment_ids filters the response to only task runs of these environments""" - - phases: List[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] - """phases filters the response to only task runs in these phases""" - - task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] - """task_ids filters the response to only task runs of these tasks""" - - task_references: Annotated[List[str], PropertyInfo(alias="taskReferences")] - """task_references filters the response to only task runs with this reference""" - - -class Pagination(TypedDict, total=False): - token: str - """ - Token for the next set of results that was returned as next_token of a - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/environment_automations/task_execution_list_response.py b/src/gitpod/types/environment_automations/task_execution_list_response.py deleted file mode 100644 index 1498e42a..00000000 --- a/src/gitpod/types/environment_automations/task_execution_list_response.py +++ /dev/null @@ -1,451 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = [ - "TaskExecutionListResponse", - "Pagination", - "TaskExecution", - "TaskExecutionMetadata", - "TaskExecutionMetadataCreator", - "TaskExecutionSpec", - "TaskExecutionSpecPlan", - "TaskExecutionSpecPlanStep", - "TaskExecutionStatus", - "TaskExecutionStatusStep", -] - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class TaskExecutionMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskExecutionMetadata(BaseModel): - completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskExecutionMetadataCreator] = None - """creator describes the principal who created/started the task run.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - """environment_id is the ID of the environment in which the task run is executed.""" - - started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) - """started_by describes the trigger that started the task execution.""" - - task_id: Optional[str] = FieldInfo(alias="taskId", default=None) - """task_id is the ID of the main task being executed.""" - - -class TaskExecutionSpecPlanStep: - pass - - -class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[TaskExecutionSpecPlanStep]] = None - - -class TaskExecutionSpec(BaseModel): - desired_phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the task execution should be in. - - Used to stop a running task execution early. - """ - - plan: Optional[List[TaskExecutionSpecPlan]] = None - """plan is a list of groups of steps. - - The steps in a group are executed concurrently, while the groups are executed - sequentially. The order of the groups is the order in which they are executed. - """ - - -class TaskExecutionStatusStep(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. - - If this is non-empty the step has failed to operate and will likely transition - to a failed state. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """phase is the current phase of the execution step""" - - -class TaskExecutionStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the task execution failed to operate. - - If this is non-empty the task execution has failed to operate and will likely - transition to a failed state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url is the URL to the logs of the task's steps. - - If this is empty, the task either has no logs or has not yet started. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """the phase of a task execution represents the aggregated phase of all steps.""" - - status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Task executions themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - steps: Optional[List[TaskExecutionStatusStep]] = None - """steps provides the status for each individual step of the task execution. - - If a step is missing it has not yet started. - """ - - -class TaskExecution(BaseModel): - id: Optional[str] = None - - metadata: Optional[TaskExecutionMetadata] = None - - spec: Optional[TaskExecutionSpec] = None - - status: Optional[TaskExecutionStatus] = None - - -class TaskExecutionListResponse(BaseModel): - pagination: Optional[Pagination] = None - - task_executions: Optional[List[TaskExecution]] = FieldInfo(alias="taskExecutions", default=None) diff --git a/src/gitpod/types/environment_automations/task_execution_retrieve_params.py b/src/gitpod/types/environment_automations/task_execution_retrieve_params.py deleted file mode 100644 index f18d67d1..00000000 --- a/src/gitpod/types/environment_automations/task_execution_retrieve_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["TaskExecutionRetrieveParams"] - - -class TaskExecutionRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_execution_retrieve_response.py b/src/gitpod/types/environment_automations/task_execution_retrieve_response.py deleted file mode 100644 index 960aeacc..00000000 --- a/src/gitpod/types/environment_automations/task_execution_retrieve_response.py +++ /dev/null @@ -1,440 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = [ - "TaskExecutionRetrieveResponse", - "TaskExecution", - "TaskExecutionMetadata", - "TaskExecutionMetadataCreator", - "TaskExecutionSpec", - "TaskExecutionSpecPlan", - "TaskExecutionSpecPlanStep", - "TaskExecutionStatus", - "TaskExecutionStatusStep", -] - - -class TaskExecutionMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskExecutionMetadata(BaseModel): - completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskExecutionMetadataCreator] = None - """creator describes the principal who created/started the task run.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - """environment_id is the ID of the environment in which the task run is executed.""" - - started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) - """started_by describes the trigger that started the task execution.""" - - task_id: Optional[str] = FieldInfo(alias="taskId", default=None) - """task_id is the ID of the main task being executed.""" - - -class TaskExecutionSpecPlanStep: - pass - - -class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[TaskExecutionSpecPlanStep]] = None - - -class TaskExecutionSpec(BaseModel): - desired_phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the task execution should be in. - - Used to stop a running task execution early. - """ - - plan: Optional[List[TaskExecutionSpecPlan]] = None - """plan is a list of groups of steps. - - The steps in a group are executed concurrently, while the groups are executed - sequentially. The order of the groups is the order in which they are executed. - """ - - -class TaskExecutionStatusStep(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. - - If this is non-empty the step has failed to operate and will likely transition - to a failed state. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """phase is the current phase of the execution step""" - - -class TaskExecutionStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the task execution failed to operate. - - If this is non-empty the task execution has failed to operate and will likely - transition to a failed state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url is the URL to the logs of the task's steps. - - If this is empty, the task either has no logs or has not yet started. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """the phase of a task execution represents the aggregated phase of all steps.""" - - status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Task executions themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - steps: Optional[List[TaskExecutionStatusStep]] = None - """steps provides the status for each individual step of the task execution. - - If a step is missing it has not yet started. - """ - - -class TaskExecution(BaseModel): - id: Optional[str] = None - - metadata: Optional[TaskExecutionMetadata] = None - - spec: Optional[TaskExecutionSpec] = None - - status: Optional[TaskExecutionStatus] = None - - -class TaskExecutionRetrieveResponse(BaseModel): - task_execution: Optional[TaskExecution] = FieldInfo(alias="taskExecution", default=None) diff --git a/src/gitpod/types/environment_automations/task_execution_stop_params.py b/src/gitpod/types/environment_automations/task_execution_stop_params.py deleted file mode 100644 index dc7659c0..00000000 --- a/src/gitpod/types/environment_automations/task_execution_stop_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["TaskExecutionStopParams"] - - -class TaskExecutionStopParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py b/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py deleted file mode 100644 index 9fa24822..00000000 --- a/src/gitpod/types/environment_automations/task_execution_update_task_execution_status_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["TaskExecutionUpdateTaskExecutionStatusParams", "Body"] - - -class TaskExecutionUpdateTaskExecutionStatusParams(TypedDict, total=False): - body: Required[Body] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Body: - pass diff --git a/src/gitpod/types/environments/__init__.py b/src/gitpod/types/environments/__init__.py new file mode 100644 index 00000000..f8ee8b14 --- /dev/null +++ b/src/gitpod/types/environments/__init__.py @@ -0,0 +1,3 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations diff --git a/src/gitpod/types/environments/automations/__init__.py b/src/gitpod/types/environments/automations/__init__.py new file mode 100644 index 00000000..ee7c957c --- /dev/null +++ b/src/gitpod/types/environments/automations/__init__.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .task_list_params import TaskListParams as TaskListParams +from .task_start_params import TaskStartParams as TaskStartParams +from .task_create_params import TaskCreateParams as TaskCreateParams +from .task_delete_params import TaskDeleteParams as TaskDeleteParams +from .task_list_response import TaskListResponse as TaskListResponse +from .task_update_params import TaskUpdateParams as TaskUpdateParams +from .service_list_params import ServiceListParams as ServiceListParams +from .service_stop_params import ServiceStopParams as ServiceStopParams +from .task_start_response import TaskStartResponse as TaskStartResponse +from .service_start_params import ServiceStartParams as ServiceStartParams +from .task_create_response import TaskCreateResponse as TaskCreateResponse +from .service_delete_params import ServiceDeleteParams as ServiceDeleteParams +from .service_list_response import ServiceListResponse as ServiceListResponse +from .service_update_params import ServiceUpdateParams as ServiceUpdateParams diff --git a/src/gitpod/types/service_delete_params.py b/src/gitpod/types/environments/automations/service_delete_params.py similarity index 94% rename from src/gitpod/types/service_delete_params.py rename to src/gitpod/types/environments/automations/service_delete_params.py index 274244b4..11a2198a 100644 --- a/src/gitpod/types/service_delete_params.py +++ b/src/gitpod/types/environments/automations/service_delete_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from .._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["ServiceDeleteParams"] diff --git a/src/gitpod/types/runner_interactions/environment_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py similarity index 58% rename from src/gitpod/types/runner_interactions/environment_list_params.py rename to src/gitpod/types/environments/automations/service_list_params.py index 504d854d..40ddeee9 100644 --- a/src/gitpod/types/runner_interactions/environment_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -5,32 +5,36 @@ from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo -__all__ = ["EnvironmentListParams", "Pagination"] +__all__ = ["ServiceListParams", "Filter", "Pagination"] -class EnvironmentListParams(TypedDict, total=False): +class ServiceListParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] - """An optional list of environment IDs to fetch. - - If this list is empty/not provided all environments that ought to run on the - runner are returned. - """ + filter: Filter + """filter contains the filter options for listing services""" pagination: Pagination - """pagination contains the pagination options for listing environments""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """The runner's identifier""" + """pagination contains the pagination options for listing services""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only services of these environments""" + + references: List[str] + """references filters the response to only services with these references""" + + service_ids: Annotated[List[str], PropertyInfo(alias="serviceIds")] + """service_ids filters the response to only services with these IDs""" + + class Pagination(TypedDict, total=False): token: str """ diff --git a/src/gitpod/types/environments/automations/service_list_response.py b/src/gitpod/types/environments/automations/service_list_response.py new file mode 100644 index 00000000..52ddbe1e --- /dev/null +++ b/src/gitpod/types/environments/automations/service_list_response.py @@ -0,0 +1,296 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "ServiceListResponse", + "Pagination", + "Service", + "ServiceMetadata", + "ServiceMetadataCreator", + "ServiceMetadataTriggeredBy", + "ServiceSpec", + "ServiceSpecCommands", + "ServiceStatus", +] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. + + Empty if there are no more results + """ + + +class ServiceMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ServiceMetadataTriggeredBy: + pass + + +class ServiceMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ServiceMetadataCreator] = None + """creator describes the principal who created the service.""" + + description: Optional[str] = None + """description is a user-facing description for the service. + + It can be used to provide context and documentation for the service. + """ + + name: Optional[str] = None + """name is a user-facing name for the service. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the service. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the service which must be unique on + the environment. It is used to express dependencies between services, and to + identify the service in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the service.""" + + +class ServiceSpecCommands(BaseModel): + ready: Optional[str] = None + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. + """ + + start: Optional[str] = None + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: Optional[str] = None + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. + """ + + +class ServiceSpec(BaseModel): + commands: Optional[ServiceSpecCommands] = None + """ + commands contains the commands to start, stop and check the readiness of the + service + """ + + desired_phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the service should be in. + + Used to start or stop the service. + """ + + runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the service should run on.""" + + session: Optional[str] = None + """session should be changed to trigger a restart of the service. + + If a service exits it will not be restarted until the session is changed. + """ + + spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + +class ServiceStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the service failed to operate. + + If this is non-empty the service has failed to operate and will likely + transition to a failed state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url contains the URL at which the service logs can be accessed.""" + + phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = None + """phase is the current phase of the service.""" + + session: Optional[str] = None + """session is the current session of the service.""" + + status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Service instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. + """ + + +class Service(BaseModel): + id: Optional[str] = None + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[ServiceMetadata] = None + + spec: Optional[ServiceSpec] = None + + status: Optional[ServiceStatus] = None + + +class ServiceListResponse(BaseModel): + pagination: Optional[Pagination] = None + + services: Optional[List[Service]] = None diff --git a/src/gitpod/types/service_start_params.py b/src/gitpod/types/environments/automations/service_start_params.py similarity index 94% rename from src/gitpod/types/service_start_params.py rename to src/gitpod/types/environments/automations/service_start_params.py index c552b27d..69eee8a0 100644 --- a/src/gitpod/types/service_start_params.py +++ b/src/gitpod/types/environments/automations/service_start_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from .._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["ServiceStartParams"] diff --git a/src/gitpod/types/service_stop_params.py b/src/gitpod/types/environments/automations/service_stop_params.py similarity index 94% rename from src/gitpod/types/service_stop_params.py rename to src/gitpod/types/environments/automations/service_stop_params.py index d69f3cdb..a86b4148 100644 --- a/src/gitpod/types/service_stop_params.py +++ b/src/gitpod/types/environments/automations/service_stop_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from .._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["ServiceStopParams"] diff --git a/src/gitpod/types/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py similarity index 97% rename from src/gitpod/types/service_update_params.py rename to src/gitpod/types/environments/automations/service_update_params.py index 49e1d271..623a0640 100644 --- a/src/gitpod/types/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from .._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["ServiceUpdateParams", "Metadata", "Spec", "Status"] diff --git a/src/gitpod/types/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py similarity index 99% rename from src/gitpod/types/task_create_params.py rename to src/gitpod/types/environments/automations/task_create_params.py index f9814758..d45c4d9c 100644 --- a/src/gitpod/types/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -6,7 +6,7 @@ from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypedDict -from .._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["TaskCreateParams", "Metadata", "MetadataCreator", "MetadataTriggeredBy", "Spec"] diff --git a/src/gitpod/types/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py similarity index 99% rename from src/gitpod/types/task_create_response.py rename to src/gitpod/types/environments/automations/task_create_response.py index 6711bbda..fa0f55e7 100644 --- a/src/gitpod/types/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo -from .._models import BaseModel +from ...._models import BaseModel __all__ = ["TaskCreateResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", "TaskSpec"] diff --git a/src/gitpod/types/environment_automations/task_delete_params.py b/src/gitpod/types/environments/automations/task_delete_params.py similarity index 94% rename from src/gitpod/types/environment_automations/task_delete_params.py rename to src/gitpod/types/environments/automations/task_delete_params.py index 25d40d78..2c11ff0c 100644 --- a/src/gitpod/types/environment_automations/task_delete_params.py +++ b/src/gitpod/types/environments/automations/task_delete_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["TaskDeleteParams"] diff --git a/src/gitpod/types/environment_automations/task_list_params.py b/src/gitpod/types/environments/automations/task_list_params.py similarity index 97% rename from src/gitpod/types/environment_automations/task_list_params.py rename to src/gitpod/types/environments/automations/task_list_params.py index 44679a8a..e44966c5 100644 --- a/src/gitpod/types/environment_automations/task_list_params.py +++ b/src/gitpod/types/environments/automations/task_list_params.py @@ -5,7 +5,7 @@ from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["TaskListParams", "Filter", "Pagination"] diff --git a/src/gitpod/types/environment_automations/task_list_response.py b/src/gitpod/types/environments/automations/task_list_response.py similarity index 99% rename from src/gitpod/types/environment_automations/task_list_response.py rename to src/gitpod/types/environments/automations/task_list_response.py index b460a4fe..742b3c55 100644 --- a/src/gitpod/types/environment_automations/task_list_response.py +++ b/src/gitpod/types/environments/automations/task_list_response.py @@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo -from ..._models import BaseModel +from ...._models import BaseModel __all__ = [ "TaskListResponse", diff --git a/src/gitpod/types/environment_automations/task_start_params.py b/src/gitpod/types/environments/automations/task_start_params.py similarity index 94% rename from src/gitpod/types/environment_automations/task_start_params.py rename to src/gitpod/types/environments/automations/task_start_params.py index 9324c00a..222ca23f 100644 --- a/src/gitpod/types/environment_automations/task_start_params.py +++ b/src/gitpod/types/environments/automations/task_start_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["TaskStartParams"] diff --git a/src/gitpod/types/environment_automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py similarity index 99% rename from src/gitpod/types/environment_automations/task_start_response.py rename to src/gitpod/types/environments/automations/task_start_response.py index 8a20139d..4e4e9dff 100644 --- a/src/gitpod/types/environment_automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo -from ..._models import BaseModel +from ...._models import BaseModel __all__ = [ "TaskStartResponse", diff --git a/src/gitpod/types/environment_automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py similarity index 95% rename from src/gitpod/types/environment_automations/task_update_params.py rename to src/gitpod/types/environments/automations/task_update_params.py index 8f740ab7..19c461b8 100644 --- a/src/gitpod/types/environment_automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -5,7 +5,7 @@ from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["TaskUpdateParams", "Metadata", "Spec"] diff --git a/src/gitpod/types/runner_interaction_get_host_authentication_token_value_params.py b/src/gitpod/types/runner_interaction_get_host_authentication_token_value_params.py deleted file mode 100644 index e95c495c..00000000 --- a/src/gitpod/types/runner_interaction_get_host_authentication_token_value_params.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["RunnerInteractionGetHostAuthenticationTokenValueParams"] - - -class RunnerInteractionGetHostAuthenticationTokenValueParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - host: str - """The host to get the authentication token for""" - - principal_id: Annotated[str, PropertyInfo(alias="principalId")] - """The principal's ID to get the authentication token for""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """The runner's identity""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py b/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py deleted file mode 100644 index ecfaf690..00000000 --- a/src/gitpod/types/runner_interaction_get_host_authentication_token_value_response.py +++ /dev/null @@ -1,129 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["RunnerInteractionGetHostAuthenticationTokenValueResponse"] - - -class RunnerInteractionGetHostAuthenticationTokenValueResponse(BaseModel): - expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - refresh_token: Optional[str] = FieldInfo(alias="refreshToken", default=None) - """ - The host authentication token's refresh token encrypted as NaCL anonymous sealed - box using the runner's public key - """ - - source: Optional[ - Literal[ - "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", - "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", - ] - ] = None - """The host authentication token's source""" - - token_id: Optional[str] = FieldInfo(alias="tokenId", default=None) - """The host authentication token's ID""" - - value: Optional[str] = None - """ - The authentication token encrypted as NaCL anonymous sealed box using the - runner's public key - """ diff --git a/src/gitpod/types/runner_interaction_get_latest_version_params.py b/src/gitpod/types/runner_interaction_get_latest_version_params.py deleted file mode 100644 index cb8e8b39..00000000 --- a/src/gitpod/types/runner_interaction_get_latest_version_params.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["RunnerInteractionGetLatestVersionParams"] - - -class RunnerInteractionGetLatestVersionParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - current_version: Annotated[str, PropertyInfo(alias="currentVersion")] - """The current version of the runner""" - - infrastructure_version: Annotated[str, PropertyInfo(alias="infrastructureVersion")] - """The version of the infrastructure""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """The runner's identity""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_interaction_get_latest_version_response.py b/src/gitpod/types/runner_interaction_get_latest_version_response.py deleted file mode 100644 index 907917e0..00000000 --- a/src/gitpod/types/runner_interaction_get_latest_version_response.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["RunnerInteractionGetLatestVersionResponse"] - - -class RunnerInteractionGetLatestVersionResponse(BaseModel): - auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) - """auto-update indicates if the runner should be updated automatically""" - - gitpod_cli_download_url: Optional[str] = FieldInfo(alias="gitpodCliDownloadUrl", default=None) - """gitpod_cli_download_url is the URL to download the gitpod CLI""" - - runner_image: Optional[str] = FieldInfo(alias="runnerImage", default=None) - """The container image of the runner""" - - supervisor_download_url: Optional[str] = FieldInfo(alias="supervisorDownloadUrl", default=None) - """supervisor_download_url is the URL to download the supervisor""" - - version: Optional[str] = None - """The latest version of the runner""" diff --git a/src/gitpod/types/runner_interaction_list_runner_environment_classes_params.py b/src/gitpod/types/runner_interaction_list_runner_environment_classes_params.py deleted file mode 100644 index 7d26ea06..00000000 --- a/src/gitpod/types/runner_interaction_list_runner_environment_classes_params.py +++ /dev/null @@ -1,48 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["RunnerInteractionListRunnerEnvironmentClassesParams", "Filter", "Pagination"] - - -class RunnerInteractionListRunnerEnvironmentClassesParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - - pagination: Pagination - """pagination contains the pagination options for listing environment classes""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """The runner's identity""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - environment_class_ids: Annotated[List[str], PropertyInfo(alias="environmentClassIds")] - """ - environment_class_ids filters the response to only environment classes with - these IDs - """ - - -class Pagination(TypedDict, total=False): - token: str - """ - Token for the next set of results that was returned as next_token of a - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/runner_interaction_list_runner_environment_classes_response.py b/src/gitpod/types/runner_interaction_list_runner_environment_classes_response.py deleted file mode 100644 index 5a41a1fc..00000000 --- a/src/gitpod/types/runner_interaction_list_runner_environment_classes_response.py +++ /dev/null @@ -1,62 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = [ - "RunnerInteractionListRunnerEnvironmentClassesResponse", - "EnvironmentClass", - "EnvironmentClassConfiguration", - "Pagination", -] - - -class EnvironmentClassConfiguration(BaseModel): - key: Optional[str] = None - - value: Optional[str] = None - - -class EnvironmentClass(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the environment class""" - - configuration: Optional[List[EnvironmentClassConfiguration]] = None - """configuration describes the configuration of the environment class""" - - description: Optional[str] = None - """description is a human readable description of the environment class""" - - display_name: Optional[str] = FieldInfo(alias="displayName", default=None) - """display_name is the human readable name of the environment class""" - - enabled: Optional[bool] = None - """ - enabled indicates whether the environment class can be used to create new - environments. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """ - runner_id is the unique identifier of the runner the environment class belongs - to - """ - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class RunnerInteractionListRunnerEnvironmentClassesResponse(BaseModel): - environment_classes: Optional[List[EnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) - """The environment classes configured for the runner""" - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing environment classes""" diff --git a/src/gitpod/types/runner_interaction_list_runner_scm_integrations_params.py b/src/gitpod/types/runner_interaction_list_runner_scm_integrations_params.py deleted file mode 100644 index 23eb2308..00000000 --- a/src/gitpod/types/runner_interaction_list_runner_scm_integrations_params.py +++ /dev/null @@ -1,48 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["RunnerInteractionListRunnerScmIntegrationsParams", "Filter", "Pagination"] - - -class RunnerInteractionListRunnerScmIntegrationsParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - - pagination: Pagination - """pagination contains the pagination options for listing SCM integrations""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """The runner's identity""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - scm_integration_ids: Annotated[List[str], PropertyInfo(alias="scmIntegrationIds")] - """ - environment_class_ids filters the response to only SCM integrations with these - IDs - """ - - -class Pagination(TypedDict, total=False): - token: str - """ - Token for the next set of results that was returned as next_token of a - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py b/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py deleted file mode 100644 index 1314f477..00000000 --- a/src/gitpod/types/runner_interaction_list_runner_scm_integrations_response.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["RunnerInteractionListRunnerScmIntegrationsResponse", "Pagination", "ScmIntegration"] - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class ScmIntegration: - pass - - -class RunnerInteractionListRunnerScmIntegrationsResponse(BaseModel): - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing SCM integrations""" - - scm_integrations: Optional[List[ScmIntegration]] = FieldInfo(alias="scmIntegrations", default=None) - """The SCM integrations configured for the runner""" diff --git a/src/gitpod/types/runner_interaction_mark_active_params.py b/src/gitpod/types/runner_interaction_mark_active_params.py deleted file mode 100644 index 68ebd411..00000000 --- a/src/gitpod/types/runner_interaction_mark_active_params.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["RunnerInteractionMarkActiveParams"] - - -class RunnerInteractionMarkActiveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """The runner's identity""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_interaction_send_response_params.py b/src/gitpod/types/runner_interaction_send_response_params.py deleted file mode 100644 index 9f1c24c3..00000000 --- a/src/gitpod/types/runner_interaction_send_response_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["RunnerInteractionSendResponseParams", "Body"] - - -class RunnerInteractionSendResponseParams(TypedDict, total=False): - body: Required[Body] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Body: - pass diff --git a/src/gitpod/types/runner_interaction_signup_params.py b/src/gitpod/types/runner_interaction_signup_params.py deleted file mode 100644 index 1efc7527..00000000 --- a/src/gitpod/types/runner_interaction_signup_params.py +++ /dev/null @@ -1,60 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._types import Base64FileInput -from .._utils import PropertyInfo - -__all__ = ["RunnerInteractionSignupParams", "EnvironmentClass", "EnvironmentClassConfiguration"] - - -class RunnerInteractionSignupParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - environment_classes: Annotated[Iterable[EnvironmentClass], PropertyInfo(alias="environmentClasses")] - """The environment classes this runner has to offer""" - - public_key: Annotated[Union[str, Base64FileInput], PropertyInfo(alias="publicKey", format="base64")] - """The runner's public key. - - Must be an ECDH public key encoded in PKIX, ASN.1 DER format. - """ - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class EnvironmentClassConfiguration(TypedDict, total=False): - key: str - - value: str - - -class EnvironmentClass(TypedDict, total=False): - id: str - """id is the unique identifier of the environment class""" - - configuration: Iterable[EnvironmentClassConfiguration] - """configuration describes the configuration of the environment class""" - - description: str - """description is a human readable description of the environment class""" - - display_name: Annotated[str, PropertyInfo(alias="displayName")] - """display_name is the human readable name of the environment class""" - - enabled: bool - """ - enabled indicates whether the environment class can be used to create new - environments. - """ - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """ - runner_id is the unique identifier of the runner the environment class belongs - to - """ diff --git a/src/gitpod/types/runner_interaction_signup_response.py b/src/gitpod/types/runner_interaction_signup_response.py deleted file mode 100644 index 7a8ffc7d..00000000 --- a/src/gitpod/types/runner_interaction_signup_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["RunnerInteractionSignupResponse"] - - -class RunnerInteractionSignupResponse(BaseModel): - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """The runner's identity""" diff --git a/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py b/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py deleted file mode 100644 index 4b56dcf0..00000000 --- a/src/gitpod/types/runner_interaction_update_runner_configuration_schema_params.py +++ /dev/null @@ -1,82 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = [ - "RunnerInteractionUpdateRunnerConfigurationSchemaParams", - "ConfigSchema", - "ConfigSchemaEnvironmentClass", - "ConfigSchemaRunnerConfig", - "ConfigSchemaScm", - "ConfigSchemaScmOAuth", - "ConfigSchemaScmPat", -] - - -class RunnerInteractionUpdateRunnerConfigurationSchemaParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - config_schema: Annotated[ConfigSchema, PropertyInfo(alias="configSchema")] - """config_schema is the schema for the runner's configuration""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """The runner's identity""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class ConfigSchemaEnvironmentClass: - pass - - -class ConfigSchemaRunnerConfig: - pass - - -class ConfigSchemaScmOAuth(TypedDict, total=False): - callback_url: Annotated[str, PropertyInfo(alias="callbackUrl")] - """ - callback_url is the URL the OAuth app will redirect to after the user has - authenticated. - """ - - -class ConfigSchemaScmPat(TypedDict, total=False): - description: str - """description is a human-readable description of the PAT.""" - - docs_link: Annotated[str, PropertyInfo(alias="docsLink")] - """ - docs_link is a link to the documentation on how to create a PAT for this SCM - system. - """ - - -class ConfigSchemaScm(TypedDict, total=False): - default_hosts: Annotated[List[str], PropertyInfo(alias="defaultHosts")] - - name: str - - oauth: ConfigSchemaScmOAuth - - pat: ConfigSchemaScmPat - - scm_id: Annotated[str, PropertyInfo(alias="scmId")] - - -class ConfigSchema(TypedDict, total=False): - environment_classes: Annotated[Iterable[ConfigSchemaEnvironmentClass], PropertyInfo(alias="environmentClasses")] - - runner_config: Annotated[Iterable[ConfigSchemaRunnerConfig], PropertyInfo(alias="runnerConfig")] - - scm: Iterable[ConfigSchemaScm] - - version: str - """The schema version""" diff --git a/src/gitpod/types/runner_interaction_update_status_params.py b/src/gitpod/types/runner_interaction_update_status_params.py deleted file mode 100644 index c2502df4..00000000 --- a/src/gitpod/types/runner_interaction_update_status_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["RunnerInteractionUpdateStatusParams", "Body"] - - -class RunnerInteractionUpdateStatusParams(TypedDict, total=False): - body: Required[Body] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Body: - pass diff --git a/src/gitpod/types/runner_interactions/__init__.py b/src/gitpod/types/runner_interactions/__init__.py deleted file mode 100644 index d8022bb2..00000000 --- a/src/gitpod/types/runner_interactions/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .environment_list_params import EnvironmentListParams as EnvironmentListParams -from .environment_list_response import EnvironmentListResponse as EnvironmentListResponse -from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams -from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse -from .environment_update_status_params import EnvironmentUpdateStatusParams as EnvironmentUpdateStatusParams diff --git a/src/gitpod/types/runner_interactions/environment_list_response.py b/src/gitpod/types/runner_interactions/environment_list_response.py deleted file mode 100644 index 65e80b00..00000000 --- a/src/gitpod/types/runner_interactions/environment_list_response.py +++ /dev/null @@ -1,605 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = [ - "EnvironmentListResponse", - "Environment", - "EnvironmentActivitySignal", - "EnvironmentMetadata", - "EnvironmentMetadataCreator", - "EnvironmentSpec", - "EnvironmentSpecAutomationsFile", - "EnvironmentSpecContent", - "EnvironmentSpecContentInitializer", - "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecDevcontainer", - "EnvironmentSpecMachine", - "EnvironmentSpecPort", - "EnvironmentSpecSecret", - "EnvironmentSpecSSHPublicKey", - "EnvironmentSpecTimeout", - "Pagination", -] - - -class EnvironmentActivitySignal(BaseModel): - source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity - signal. - """ - - timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class EnvironmentMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class EnvironmentMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. - +internal - not yet implemented - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[EnvironmentMetadataCreator] = None - """creator is the identity of the creator of the environment""" - - last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - name: Optional[str] = None - """name is the name of the environment as specified by the user""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was - created - """ - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """ - If the Environment was started from a project, the project_id will reference the - project. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """Runner is the ID of the runner that runs this environment.""" - - -class EnvironmentSpecAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecContentInitializerSpec: - pass - - -class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None - - -class EnvironmentSpecContent(BaseModel): - git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) - """The Git email address""" - - git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) - """The Git username""" - - initializer: Optional[EnvironmentSpecContentInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - session: Optional[str] = None - - -class EnvironmentSpecDevcontainer(BaseModel): - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecMachine(BaseModel): - class_: Optional[str] = FieldInfo(alias="class", default=None) - """Class denotes the class of the environment we ought to start""" - - session: Optional[str] = None - - -class EnvironmentSpecPort(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - name: Optional[str] = None - """name of this port""" - - port: Optional[int] = None - """port number""" - - -class EnvironmentSpecSecret: - pass - - -class EnvironmentSpecSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - value: Optional[str] = None - """value is the actual public key in the public key file format""" - - -class EnvironmentSpecTimeout(BaseModel): - disconnected: Optional[str] = None - """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". - """ - - -class EnvironmentSpec(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file is the automations file spec of the environment""" - - content: Optional[EnvironmentSpecContent] = None - """content is the content spec of the environment""" - - desired_phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """Phase is the desired phase of the environment""" - - devcontainer: Optional[EnvironmentSpecDevcontainer] = None - """devcontainer is the devcontainer spec of the environment""" - - machine: Optional[EnvironmentSpecMachine] = None - """machine is the machine spec of the environment""" - - ports: Optional[List[EnvironmentSpecPort]] = None - """ports is the set of ports which ought to be exposed to the internet""" - - secrets: Optional[List[EnvironmentSpecSecret]] = None - """secrets are confidential data that is mounted into the environment""" - - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys are the public keys used to ssh into the environment""" - - timeout: Optional[EnvironmentSpecTimeout] = None - """Timeout configures the environment timeout""" - - -class Environment(BaseModel): - id: Optional[str] = None - """ID is a unique identifier of this environment. - - No other environment with the same name must be managed by this environment - manager - """ - - activity_signal: Optional[EnvironmentActivitySignal] = FieldInfo(alias="activitySignal", default=None) - """EnvironmentActivitySignal used to signal activity for an environment.""" - - environment_access_token: Optional[str] = FieldInfo(alias="environmentAccessToken", default=None) - """The environment's access token""" - - metadata: Optional[EnvironmentMetadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for - other parts of the system to function - """ - - spec: Optional[EnvironmentSpec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment - start - """ - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class EnvironmentListResponse(BaseModel): - environments: Optional[List[Environment]] = None - """The environments running on the runner""" - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/runner_interactions/environment_retrieve_params.py b/src/gitpod/types/runner_interactions/environment_retrieve_params.py deleted file mode 100644 index a7bf9537..00000000 --- a/src/gitpod/types/runner_interactions/environment_retrieve_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["EnvironmentRetrieveParams"] - - -class EnvironmentRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - """The environment's ID""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """The runner's identity""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_interactions/environment_retrieve_response.py b/src/gitpod/types/runner_interactions/environment_retrieve_response.py deleted file mode 100644 index 19d0d970..00000000 --- a/src/gitpod/types/runner_interactions/environment_retrieve_response.py +++ /dev/null @@ -1,592 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = [ - "EnvironmentRetrieveResponse", - "Environment", - "EnvironmentActivitySignal", - "EnvironmentMetadata", - "EnvironmentMetadataCreator", - "EnvironmentSpec", - "EnvironmentSpecAutomationsFile", - "EnvironmentSpecContent", - "EnvironmentSpecContentInitializer", - "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecDevcontainer", - "EnvironmentSpecMachine", - "EnvironmentSpecPort", - "EnvironmentSpecSecret", - "EnvironmentSpecSSHPublicKey", - "EnvironmentSpecTimeout", -] - - -class EnvironmentActivitySignal(BaseModel): - source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity - signal. - """ - - timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class EnvironmentMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class EnvironmentMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. - +internal - not yet implemented - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[EnvironmentMetadataCreator] = None - """creator is the identity of the creator of the environment""" - - last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - name: Optional[str] = None - """name is the name of the environment as specified by the user""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was - created - """ - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """ - If the Environment was started from a project, the project_id will reference the - project. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """Runner is the ID of the runner that runs this environment.""" - - -class EnvironmentSpecAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecContentInitializerSpec: - pass - - -class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None - - -class EnvironmentSpecContent(BaseModel): - git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) - """The Git email address""" - - git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) - """The Git username""" - - initializer: Optional[EnvironmentSpecContentInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - session: Optional[str] = None - - -class EnvironmentSpecDevcontainer(BaseModel): - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecMachine(BaseModel): - class_: Optional[str] = FieldInfo(alias="class", default=None) - """Class denotes the class of the environment we ought to start""" - - session: Optional[str] = None - - -class EnvironmentSpecPort(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - name: Optional[str] = None - """name of this port""" - - port: Optional[int] = None - """port number""" - - -class EnvironmentSpecSecret: - pass - - -class EnvironmentSpecSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - value: Optional[str] = None - """value is the actual public key in the public key file format""" - - -class EnvironmentSpecTimeout(BaseModel): - disconnected: Optional[str] = None - """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". - """ - - -class EnvironmentSpec(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file is the automations file spec of the environment""" - - content: Optional[EnvironmentSpecContent] = None - """content is the content spec of the environment""" - - desired_phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """Phase is the desired phase of the environment""" - - devcontainer: Optional[EnvironmentSpecDevcontainer] = None - """devcontainer is the devcontainer spec of the environment""" - - machine: Optional[EnvironmentSpecMachine] = None - """machine is the machine spec of the environment""" - - ports: Optional[List[EnvironmentSpecPort]] = None - """ports is the set of ports which ought to be exposed to the internet""" - - secrets: Optional[List[EnvironmentSpecSecret]] = None - """secrets are confidential data that is mounted into the environment""" - - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys are the public keys used to ssh into the environment""" - - timeout: Optional[EnvironmentSpecTimeout] = None - """Timeout configures the environment timeout""" - - -class Environment(BaseModel): - id: Optional[str] = None - """ID is a unique identifier of this environment. - - No other environment with the same name must be managed by this environment - manager - """ - - activity_signal: Optional[EnvironmentActivitySignal] = FieldInfo(alias="activitySignal", default=None) - """EnvironmentActivitySignal used to signal activity for an environment.""" - - environment_access_token: Optional[str] = FieldInfo(alias="environmentAccessToken", default=None) - """The environment's access token""" - - metadata: Optional[EnvironmentMetadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for - other parts of the system to function - """ - - spec: Optional[EnvironmentSpec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment - start - """ - - -class EnvironmentRetrieveResponse(BaseModel): - environment: Optional[Environment] = None diff --git a/src/gitpod/types/runner_interactions/environment_update_status_params.py b/src/gitpod/types/runner_interactions/environment_update_status_params.py deleted file mode 100644 index 56bb0f21..00000000 --- a/src/gitpod/types/runner_interactions/environment_update_status_params.py +++ /dev/null @@ -1,524 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union, Iterable -from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = [ - "EnvironmentUpdateStatusParams", - "Status", - "StatusActivitySignal", - "StatusAutomationsFile", - "StatusContent", - "StatusContentGit", - "StatusContentGitChangedFile", - "StatusDevcontainer", - "StatusEnvironmentURLs", - "StatusEnvironmentURLsPort", - "StatusEnvironmentURLsSSH", - "StatusMachine", - "StatusMachineVersions", - "StatusRunnerAck", - "StatusSecret", - "StatusSSHPublicKey", -] - - -class EnvironmentUpdateStatusParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - """The environment's ID""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """The runner's identity""" - - status: Status - """EnvironmentStatus describes an environment status""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class StatusActivitySignal(TypedDict, total=False): - source: str - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity - signal. - """ - - timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class StatusAutomationsFile(TypedDict, total=False): - automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] - """ - automations_file_path is the path to the automations file relative to the repo - root. - """ - - automations_file_presence: Annotated[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"], - PropertyInfo(alias="automationsFilePresence"), - ] - """ - automations_file_presence indicates how an automations file is present in the - environment. - """ - - failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] - """ - failure_message contains the reason the automations file failed to be applied. - This is only set if the phase is FAILED. - """ - - phase: Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - """phase is the current phase of the automations file.""" - - session: str - """ - session is the automations file session that is currently applied in the - environment. - """ - - -class StatusContentGitChangedFile(TypedDict, total=False): - change_type: Annotated[ - Literal[ - "CHANGE_TYPE_UNSPECIFIED", - "CHANGE_TYPE_ADDED", - "CHANGE_TYPE_MODIFIED", - "CHANGE_TYPE_DELETED", - "CHANGE_TYPE_RENAMED", - "CHANGE_TYPE_COPIED", - "CHANGE_TYPE_UPDATED_BUT_UNMERGED", - "CHANGE_TYPE_UNTRACKED", - ], - PropertyInfo(alias="changeType"), - ] - """ChangeType is the type of change that happened to the file""" - - path: str - """path is the path of the file""" - - -class StatusContentGit(TypedDict, total=False): - branch: str - """branch is branch we're currently on""" - - changed_files: Annotated[Iterable[StatusContentGitChangedFile], PropertyInfo(alias="changedFiles")] - """ - changed_files is an array of changed files in the environment, possibly - truncated - """ - - clone_url: Annotated[str, PropertyInfo(alias="cloneUrl")] - """ - clone_url is the repository url as you would pass it to "git clone". Only HTTPS - clone URLs are supported. - """ - - latest_commit: Annotated[str, PropertyInfo(alias="latestCommit")] - """latest_commit is the most recent commit on the current branch""" - - total_changed_files: Annotated[int, PropertyInfo(alias="totalChangedFiles")] - - total_unpushed_commits: Annotated[int, PropertyInfo(alias="totalUnpushedCommits")] - """the total number of unpushed changes""" - - unpushed_commits: Annotated[List[str], PropertyInfo(alias="unpushedCommits")] - """ - unpushed_commits is an array of unpushed changes in the environment, possibly - truncated - """ - - -class StatusContent(TypedDict, total=False): - content_location_in_machine: Annotated[str, PropertyInfo(alias="contentLocationInMachine")] - """content_location_in_machine is the location of the content in the machine""" - - failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] - """failure_message contains the reason the content initialization failed.""" - - git: StatusContentGit - """ - git is the Git working copy status of the environment. Note: this is a - best-effort field and more often than not will not be present. Its absence does - not indicate the absence of a working copy. - """ - - phase: Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - """phase is the current phase of the environment content""" - - session: str - """session is the session that is currently active in the environment.""" - - warning_message: Annotated[str, PropertyInfo(alias="warningMessage")] - """warning_message contains warnings, e.g. - - when the content is present but not in the expected state. - """ - - -class StatusDevcontainer(TypedDict, total=False): - container_id: Annotated[str, PropertyInfo(alias="containerId")] - """container_id is the ID of the container.""" - - container_name: Annotated[str, PropertyInfo(alias="containerName")] - """ - container_name is the name of the container that is used to connect to the - devcontainer - """ - - devcontainerconfig_in_sync: Annotated[bool, PropertyInfo(alias="devcontainerconfigInSync")] - """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. - - the devcontainer config file. - """ - - devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - devcontainer_file_presence: Annotated[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"], - PropertyInfo(alias="devcontainerFilePresence"), - ] - """ - devcontainer_file_presence indicates how the devcontainer file is present in the - repo. - """ - - failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] - """failure_message contains the reason the devcontainer failed to operate.""" - - phase: Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] - """phase is the current phase of the devcontainer""" - - remote_user: Annotated[str, PropertyInfo(alias="remoteUser")] - """remote_user is the user that is used to connect to the devcontainer""" - - remote_workspace_folder: Annotated[str, PropertyInfo(alias="remoteWorkspaceFolder")] - """ - remote_workspace_folder is the folder that is used to connect to the - devcontainer - """ - - secrets_in_sync: Annotated[bool, PropertyInfo(alias="secretsInSync")] - """secrets_in_sync indicates if the secrets are up to date w.r.t. - - the running devcontainer. - """ - - session: str - """session is the session that is currently active in the devcontainer.""" - - warning_message: Annotated[str, PropertyInfo(alias="warningMessage")] - """warning_message contains warnings, e.g. - - when the devcontainer is present but not in the expected state. - """ - - -class StatusEnvironmentURLsPort(TypedDict, total=False): - port: int - """port is the port number of the environment port""" - - url: str - """url is the URL at which the environment port can be accessed""" - - -class StatusEnvironmentURLsSSH(TypedDict, total=False): - url: str - - -class StatusEnvironmentURLs(TypedDict, total=False): - logs: str - """logs is the URL at which the environment logs can be accessed.""" - - ports: Iterable[StatusEnvironmentURLsPort] - - ssh: StatusEnvironmentURLsSSH - """SSH is the URL at which the environment can be accessed via SSH.""" - - -class StatusMachineVersions(TypedDict, total=False): - supervisor_commit: Annotated[str, PropertyInfo(alias="supervisorCommit")] - - supervisor_version: Annotated[str, PropertyInfo(alias="supervisorVersion")] - - -class StatusMachine(TypedDict, total=False): - failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] - """failure_message contains the reason the machine failed to operate.""" - - phase: Literal[ - "PHASE_UNSPECIFIED", - "PHASE_CREATING", - "PHASE_STARTING", - "PHASE_RUNNING", - "PHASE_STOPPING", - "PHASE_STOPPED", - "PHASE_DELETING", - "PHASE_DELETED", - ] - """phase is the current phase of the environment machine""" - - session: str - """session is the session that is currently active in the machine.""" - - timeout: str - """timeout contains the reason the environment has timed out. - - If this field is empty, the environment has not timed out. - """ - - versions: StatusMachineVersions - """versions contains the versions of components in the machine.""" - - warning_message: Annotated[str, PropertyInfo(alias="warningMessage")] - """warning_message contains warnings, e.g. - - when the machine is present but not in the expected state. - """ - - -class StatusRunnerAck(TypedDict, total=False): - message: str - - spec_version: Annotated[Union[int, str], PropertyInfo(alias="specVersion")] - - status_code: Annotated[ - Literal[ - "STATUS_CODE_UNSPECIFIED", - "STATUS_CODE_OK", - "STATUS_CODE_INVALID_RESOURCE", - "STATUS_CODE_FAILED_PRECONDITION", - ], - PropertyInfo(alias="statusCode"), - ] - - -class StatusSecret(TypedDict, total=False): - failure_message: Annotated[str, PropertyInfo(alias="failureMessage")] - """failure_message contains the reason the secret failed to be materialize.""" - - phase: Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - - secret_name: Annotated[str, PropertyInfo(alias="secretName")] - - session: str - """session is the session that is currently active in the environment.""" - - warning_message: Annotated[str, PropertyInfo(alias="warningMessage")] - """warning_message contains warnings, e.g. - - when the secret is present but not in the expected state. - """ - - -class StatusSSHPublicKey(TypedDict, total=False): - id: str - """id is the unique identifier of the public key""" - - phase: Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - """phase is the current phase of the public key""" - - -class Status(TypedDict, total=False): - activity_signal: Annotated[StatusActivitySignal, PropertyInfo(alias="activitySignal")] - """EnvironmentActivitySignal used to signal activity for an environment.""" - - automations_file: Annotated[StatusAutomationsFile, PropertyInfo(alias="automationsFile")] - """automations_file contains the status of the automations file.""" - - content: StatusContent - """content contains the status of the environment content.""" - - devcontainer: StatusDevcontainer - """devcontainer contains the status of the devcontainer.""" - - environment_urls: Annotated[StatusEnvironmentURLs, PropertyInfo(alias="environmentUrls")] - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. - """ - - failure_message: Annotated[List[str], PropertyInfo(alias="failureMessage")] - """failure_message summarises why the environment failed to operate. - - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. - """ - - machine: StatusMachine - """machine contains the status of the environment machine""" - - phase: Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - """ - the phase of an environment is a simple, high-level summary of where the - environment is in its lifecycle - """ - - runner_ack: Annotated[StatusRunnerAck, PropertyInfo(alias="runnerAck")] - """ - RunnerACK is the acknowledgement from the runner that is has received the - environment spec. - """ - - secrets: Iterable[StatusSecret] - """secrets contains the status of the environment secrets""" - - ssh_public_keys: Annotated[Iterable[StatusSSHPublicKey], PropertyInfo(alias="sshPublicKeys")] - """ssh_public_keys contains the status of the environment ssh public keys""" - - status_version: Annotated[Union[int, str], PropertyInfo(alias="statusVersion")] - """version of the status update. - - Environment instances themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - warning_message: Annotated[List[str], PropertyInfo(alias="warningMessage")] - """warning_message contains warnings, e.g. - - when the environment is present but not in the expected state. - """ diff --git a/src/gitpod/types/task_retrieve_create_params.py b/src/gitpod/types/task_retrieve_create_params.py deleted file mode 100644 index 9171f208..00000000 --- a/src/gitpod/types/task_retrieve_create_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["TaskRetrieveCreateParams"] - - -class TaskRetrieveCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/task_retrieve_create_response.py b/src/gitpod/types/task_retrieve_create_response.py deleted file mode 100644 index 579e6097..00000000 --- a/src/gitpod/types/task_retrieve_create_response.py +++ /dev/null @@ -1,184 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = [ - "TaskRetrieveCreateResponse", - "Task", - "TaskMetadata", - "TaskMetadataCreator", - "TaskMetadataTriggeredBy", - "TaskSpec", -] - - -class TaskMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskMetadataTriggeredBy: - pass - - -class TaskMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskMetadataCreator] = None - """creator describes the principal who created the task.""" - - description: Optional[str] = None - """description is a user-facing description for the task. - - It can be used to provide context and documentation for the task. - """ - - name: Optional[str] = None - """name is a user-facing name for the task. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the task. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the task which must be unique on the - environment. It is used to express dependencies between tasks, and to identify - the task in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the task.""" - - -class TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class Task(BaseModel): - id: Optional[str] = None - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - """dependencies specifies the IDs of the automations this task depends on.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[TaskMetadata] = None - - spec: Optional[TaskSpec] = None - - -class TaskRetrieveCreateResponse(BaseModel): - task: Optional[Task] = None diff --git a/tests/api_resources/environment_automations/test_task_executions.py b/tests/api_resources/environment_automations/test_task_executions.py deleted file mode 100644 index 96eae4f2..00000000 --- a/tests/api_resources/environment_automations/test_task_executions.py +++ /dev/null @@ -1,474 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types.environment_automations import ( - TaskExecutionListResponse, - TaskExecutionRetrieveResponse, - TaskExecutionCreateRetrieveResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestTaskExecutions: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.retrieve( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environment_automations.task_executions.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environment_automations.task_executions.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.list( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.list( - connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], - "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "task_references": ["string"], - }, - pagination={ - "token": "token", - "page_size": 0, - }, - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environment_automations.task_executions.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environment_automations.task_executions.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_create_retrieve(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.create_retrieve( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) - - @parametrize - def test_method_create_retrieve_with_all_params(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.create_retrieve( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) - - @parametrize - def test_raw_response_create_retrieve(self, client: Gitpod) -> None: - response = client.environment_automations.task_executions.with_raw_response.create_retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_create_retrieve(self, client: Gitpod) -> None: - with client.environment_automations.task_executions.with_streaming_response.create_retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_stop(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.stop( - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_method_stop_with_all_params(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.stop( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.environment_automations.task_executions.with_raw_response.stop( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.environment_automations.task_executions.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_task_execution_status(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_method_update_task_execution_status_with_all_params(self, client: Gitpod) -> None: - task_execution = client.environment_automations.task_executions.update_task_execution_status( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failureMessage": "failureMessage", - "logUrl": "logUrl", - "steps": [ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - } - ], - }, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_raw_response_update_task_execution_status(self, client: Gitpod) -> None: - response = client.environment_automations.task_executions.with_raw_response.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_update_task_execution_status(self, client: Gitpod) -> None: - with client.environment_automations.task_executions.with_streaming_response.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncTaskExecutions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.retrieve( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.task_executions.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.task_executions.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.list( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.list( - connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], - "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "task_references": ["string"], - }, - pagination={ - "token": "token", - "page_size": 0, - }, - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.task_executions.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.task_executions.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_create_retrieve(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.create_retrieve( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) - - @parametrize - async def test_method_create_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.create_retrieve( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_create_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.task_executions.with_raw_response.create_retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_create_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.task_executions.with_streaming_response.create_retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(TaskExecutionCreateRetrieveResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_stop(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.stop( - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.stop( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.task_executions.with_raw_response.stop( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.task_executions.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_task_execution_status(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_method_update_task_execution_status_with_all_params(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environment_automations.task_executions.update_task_execution_status( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failureMessage": "failureMessage", - "logUrl": "logUrl", - "steps": [ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - } - ], - }, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: - response = ( - await async_client.environment_automations.task_executions.with_raw_response.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.task_executions.with_streaming_response.update_task_execution_status( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environment_automations/__init__.py b/tests/api_resources/environments/__init__.py similarity index 100% rename from tests/api_resources/environment_automations/__init__.py rename to tests/api_resources/environments/__init__.py diff --git a/tests/api_resources/runner_interactions/__init__.py b/tests/api_resources/environments/automations/__init__.py similarity index 100% rename from tests/api_resources/runner_interactions/__init__.py rename to tests/api_resources/environments/automations/__init__.py diff --git a/tests/api_resources/test_services.py b/tests/api_resources/environments/automations/test_services.py similarity index 63% rename from tests/api_resources/test_services.py rename to tests/api_resources/environments/automations/test_services.py index e5abe090..febc1726 100644 --- a/tests/api_resources/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -9,6 +9,9 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.types.environments.automations import ( + ServiceListResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -18,14 +21,14 @@ class TestServices: @parametrize def test_method_update(self, client: Gitpod) -> None: - service = client.services.update( + service = client.environments.automations.services.update( connect_protocol_version=1, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: - service = client.services.update( + service = client.environments.automations.services.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={}, @@ -37,7 +40,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.services.with_raw_response.update( + response = client.environments.automations.services.with_raw_response.update( connect_protocol_version=1, ) @@ -48,7 +51,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.services.with_streaming_response.update( + with client.environments.automations.services.with_streaming_response.update( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -59,16 +62,64 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_list(self, client: Gitpod) -> None: + service = client.environments.automations.services.list( + connect_protocol_version=1, + ) + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + service = client.environments.automations.services.list( + connect_protocol_version=1, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.environments.automations.services.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = response.parse() + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.environments.automations.services.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = response.parse() + assert_matches_type(ServiceListResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_delete(self, client: Gitpod) -> None: - service = client.services.delete( + service = client.environments.automations.services.delete( connect_protocol_version=1, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: - service = client.services.delete( + service = client.environments.automations.services.delete( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, @@ -78,7 +129,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.services.with_raw_response.delete( + response = client.environments.automations.services.with_raw_response.delete( connect_protocol_version=1, ) @@ -89,7 +140,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.services.with_streaming_response.delete( + with client.environments.automations.services.with_streaming_response.delete( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -102,14 +153,14 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - service = client.services.start( + service = client.environments.automations.services.start( connect_protocol_version=1, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: - service = client.services.start( + service = client.environments.automations.services.start( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -118,7 +169,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.services.with_raw_response.start( + response = client.environments.automations.services.with_raw_response.start( connect_protocol_version=1, ) @@ -129,7 +180,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.services.with_streaming_response.start( + with client.environments.automations.services.with_streaming_response.start( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -142,14 +193,14 @@ def test_streaming_response_start(self, client: Gitpod) -> None: @parametrize def test_method_stop(self, client: Gitpod) -> None: - service = client.services.stop( + service = client.environments.automations.services.stop( connect_protocol_version=1, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: - service = client.services.stop( + service = client.environments.automations.services.stop( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -158,7 +209,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.services.with_raw_response.stop( + response = client.environments.automations.services.with_raw_response.stop( connect_protocol_version=1, ) @@ -169,7 +220,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.services.with_streaming_response.stop( + with client.environments.automations.services.with_streaming_response.stop( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -186,14 +237,14 @@ class TestAsyncServices: @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.update( + service = await async_client.environments.automations.services.update( connect_protocol_version=1, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.update( + service = await async_client.environments.automations.services.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={}, @@ -205,7 +256,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.services.with_raw_response.update( + response = await async_client.environments.automations.services.with_raw_response.update( connect_protocol_version=1, ) @@ -216,7 +267,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.services.with_streaming_response.update( + async with async_client.environments.automations.services.with_streaming_response.update( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -227,16 +278,64 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + service = await async_client.environments.automations.services.list( + connect_protocol_version=1, + ) + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + service = await async_client.environments.automations.services.list( + connect_protocol_version=1, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.services.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = await response.parse() + assert_matches_type(ServiceListResponse, service, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.services.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = await response.parse() + assert_matches_type(ServiceListResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.delete( + service = await async_client.environments.automations.services.delete( connect_protocol_version=1, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.delete( + service = await async_client.environments.automations.services.delete( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, @@ -246,7 +345,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.services.with_raw_response.delete( + response = await async_client.environments.automations.services.with_raw_response.delete( connect_protocol_version=1, ) @@ -257,7 +356,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.services.with_streaming_response.delete( + async with async_client.environments.automations.services.with_streaming_response.delete( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -270,14 +369,14 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.start( + service = await async_client.environments.automations.services.start( connect_protocol_version=1, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.start( + service = await async_client.environments.automations.services.start( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -286,7 +385,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.services.with_raw_response.start( + response = await async_client.environments.automations.services.with_raw_response.start( connect_protocol_version=1, ) @@ -297,7 +396,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.services.with_streaming_response.start( + async with async_client.environments.automations.services.with_streaming_response.start( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -310,14 +409,14 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.stop( + service = await async_client.environments.automations.services.stop( connect_protocol_version=1, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: - service = await async_client.services.stop( + service = await async_client.environments.automations.services.stop( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -326,7 +425,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.services.with_raw_response.stop( + response = await async_client.environments.automations.services.with_raw_response.stop( connect_protocol_version=1, ) @@ -337,7 +436,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.services.with_streaming_response.stop( + async with async_client.environments.automations.services.with_streaming_response.stop( connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/environment_automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py similarity index 61% rename from tests/api_resources/environment_automations/test_tasks.py rename to tests/api_resources/environments/automations/test_tasks.py index d9002a9b..bddf67f8 100644 --- a/tests/api_resources/environment_automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -9,9 +9,11 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types.environment_automations import ( +from gitpod._utils import parse_datetime +from gitpod.types.environments.automations import ( TaskListResponse, TaskStartResponse, + TaskCreateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,16 +22,78 @@ class TestTasks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_create(self, client: Gitpod) -> None: + task = client.environments.automations.tasks.create( + connect_protocol_version=1, + ) + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + task = client.environments.automations.tasks.create( + connect_protocol_version=1, + depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={ + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "creator": { + "id": "id", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "description": "description", + "name": "x", + "reference": "reference", + "triggered_by": [ + { + "manual": True, + "postDevcontainerStart": True, + "postEnvironmentStart": True, + } + ], + }, + spec={ + "command": "command", + "runs_on": {}, + }, + connect_timeout_ms=0, + ) + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.environments.automations.tasks.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.environments.automations.tasks.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_update(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.update( + task = client.environments.automations.tasks.update( connect_protocol_version=1, ) assert_matches_type(object, task, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.update( + task = client.environments.automations.tasks.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -41,7 +105,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.environment_automations.tasks.with_raw_response.update( + response = client.environments.automations.tasks.with_raw_response.update( connect_protocol_version=1, ) @@ -52,7 +116,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.environment_automations.tasks.with_streaming_response.update( + with client.environments.automations.tasks.with_streaming_response.update( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -65,14 +129,14 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.list( + task = client.environments.automations.tasks.list( connect_protocol_version=1, ) assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.list( + task = client.environments.automations.tasks.list( connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -89,7 +153,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environment_automations.tasks.with_raw_response.list( + response = client.environments.automations.tasks.with_raw_response.list( connect_protocol_version=1, ) @@ -100,7 +164,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environment_automations.tasks.with_streaming_response.list( + with client.environments.automations.tasks.with_streaming_response.list( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -113,14 +177,14 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.delete( + task = client.environments.automations.tasks.delete( connect_protocol_version=1, ) assert_matches_type(object, task, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.delete( + task = client.environments.automations.tasks.delete( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -129,7 +193,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.environment_automations.tasks.with_raw_response.delete( + response = client.environments.automations.tasks.with_raw_response.delete( connect_protocol_version=1, ) @@ -140,7 +204,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.environment_automations.tasks.with_streaming_response.delete( + with client.environments.automations.tasks.with_streaming_response.delete( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -153,14 +217,14 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.start( + task = client.environments.automations.tasks.start( connect_protocol_version=1, ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: - task = client.environment_automations.tasks.start( + task = client.environments.automations.tasks.start( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -169,7 +233,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environment_automations.tasks.with_raw_response.start( + response = client.environments.automations.tasks.with_raw_response.start( connect_protocol_version=1, ) @@ -180,7 +244,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environment_automations.tasks.with_streaming_response.start( + with client.environments.automations.tasks.with_streaming_response.start( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -195,16 +259,78 @@ def test_streaming_response_start(self, client: Gitpod) -> None: class TestAsyncTasks: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + task = await async_client.environments.automations.tasks.create( + connect_protocol_version=1, + ) + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.environments.automations.tasks.create( + connect_protocol_version=1, + depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={ + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "creator": { + "id": "id", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "description": "description", + "name": "x", + "reference": "reference", + "triggered_by": [ + { + "manual": True, + "postDevcontainerStart": True, + "postEnvironmentStart": True, + } + ], + }, + spec={ + "command": "command", + "runs_on": {}, + }, + connect_timeout_ms=0, + ) + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.tasks.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.tasks.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(TaskCreateResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.update( + task = await async_client.environments.automations.tasks.update( connect_protocol_version=1, ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.update( + task = await async_client.environments.automations.tasks.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -216,7 +342,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.tasks.with_raw_response.update( + response = await async_client.environments.automations.tasks.with_raw_response.update( connect_protocol_version=1, ) @@ -227,7 +353,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.tasks.with_streaming_response.update( + async with async_client.environments.automations.tasks.with_streaming_response.update( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -240,14 +366,14 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.list( + task = await async_client.environments.automations.tasks.list( connect_protocol_version=1, ) assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.list( + task = await async_client.environments.automations.tasks.list( connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -264,7 +390,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.tasks.with_raw_response.list( + response = await async_client.environments.automations.tasks.with_raw_response.list( connect_protocol_version=1, ) @@ -275,7 +401,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.tasks.with_streaming_response.list( + async with async_client.environments.automations.tasks.with_streaming_response.list( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -288,14 +414,14 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.delete( + task = await async_client.environments.automations.tasks.delete( connect_protocol_version=1, ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.delete( + task = await async_client.environments.automations.tasks.delete( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -304,7 +430,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.tasks.with_raw_response.delete( + response = await async_client.environments.automations.tasks.with_raw_response.delete( connect_protocol_version=1, ) @@ -315,7 +441,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.tasks.with_streaming_response.delete( + async with async_client.environments.automations.tasks.with_streaming_response.delete( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -328,14 +454,14 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.start( + task = await async_client.environments.automations.tasks.start( connect_protocol_version=1, ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: - task = await async_client.environment_automations.tasks.start( + task = await async_client.environments.automations.tasks.start( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -344,7 +470,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_automations.tasks.with_raw_response.start( + response = await async_client.environments.automations.tasks.with_raw_response.start( connect_protocol_version=1, ) @@ -355,7 +481,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_automations.tasks.with_streaming_response.start( + async with async_client.environments.automations.tasks.with_streaming_response.start( connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runner_interactions/test_environments.py b/tests/api_resources/runner_interactions/test_environments.py deleted file mode 100644 index dd607a2b..00000000 --- a/tests/api_resources/runner_interactions/test_environments.py +++ /dev/null @@ -1,466 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod._utils import parse_datetime -from gitpod.types.runner_interactions import ( - EnvironmentListResponse, - EnvironmentRetrieveResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestEnvironments: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - environment = client.runner_interactions.environments.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - environment = client.runner_interactions.environments.retrieve( - connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_interactions.environments.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = response.parse() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_interactions.environments.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = response.parse() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list(self, client: Gitpod) -> None: - environment = client.runner_interactions.environments.list( - connect_protocol_version=1, - ) - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Gitpod) -> None: - environment = client.runner_interactions.environments.list( - connect_protocol_version=1, - environment_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runner_interactions.environments.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = response.parse() - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runner_interactions.environments.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = response.parse() - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_status(self, client: Gitpod) -> None: - environment = client.runner_interactions.environments.update_status( - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_method_update_status_with_all_params(self, client: Gitpod) -> None: - environment = client.runner_interactions.environments.update_status( - connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - status={ - "activity_signal": { - "source": "xxx", - "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), - }, - "automations_file": { - "automations_file_path": "automationsFilePath", - "automations_file_presence": "PRESENCE_UNSPECIFIED", - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "session": "session", - }, - "content": { - "content_location_in_machine": "contentLocationInMachine", - "failure_message": "failureMessage", - "git": { - "branch": "branch", - "changed_files": [ - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - } - ], - "clone_url": "cloneUrl", - "latest_commit": "latestCommit", - "total_changed_files": 0, - "total_unpushed_commits": 0, - "unpushed_commits": ["string"], - }, - "phase": "CONTENT_PHASE_UNSPECIFIED", - "session": "session", - "warning_message": "warningMessage", - }, - "devcontainer": { - "container_id": "containerId", - "container_name": "containerName", - "devcontainerconfig_in_sync": True, - "devcontainer_file_path": "devcontainerFilePath", - "devcontainer_file_presence": "PRESENCE_UNSPECIFIED", - "failure_message": "failureMessage", - "phase": "PHASE_UNSPECIFIED", - "remote_user": "remoteUser", - "remote_workspace_folder": "remoteWorkspaceFolder", - "secrets_in_sync": True, - "session": "session", - "warning_message": "warningMessage", - }, - "environment_urls": { - "logs": "logs", - "ports": [ - { - "port": 1, - "url": "url", - } - ], - "ssh": {"url": "url"}, - }, - "failure_message": ["string"], - "machine": { - "failure_message": "failureMessage", - "phase": "PHASE_UNSPECIFIED", - "session": "session", - "timeout": "timeout", - "versions": { - "supervisor_commit": "supervisorCommit", - "supervisor_version": "supervisorVersion", - }, - "warning_message": "warningMessage", - }, - "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", - "runner_ack": { - "message": "message", - "spec_version": 0, - "status_code": "STATUS_CODE_UNSPECIFIED", - }, - "secrets": [ - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "session": "session", - "warning_message": "warningMessage", - } - ], - "ssh_public_keys": [ - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - } - ], - "status_version": 0, - "warning_message": ["string"], - }, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_raw_response_update_status(self, client: Gitpod) -> None: - response = client.runner_interactions.environments.with_raw_response.update_status( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = response.parse() - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_streaming_response_update_status(self, client: Gitpod) -> None: - with client.runner_interactions.environments.with_streaming_response.update_status( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = response.parse() - assert_matches_type(object, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncEnvironments: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environments.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environments.retrieve( - connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.environments.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = await response.parse() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.environments.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = await response.parse() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environments.list( - connect_protocol_version=1, - ) - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environments.list( - connect_protocol_version=1, - environment_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.environments.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = await response.parse() - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.environments.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = await response.parse() - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_status(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environments.update_status( - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: - environment = await async_client.runner_interactions.environments.update_status( - connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - status={ - "activity_signal": { - "source": "xxx", - "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), - }, - "automations_file": { - "automations_file_path": "automationsFilePath", - "automations_file_presence": "PRESENCE_UNSPECIFIED", - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "session": "session", - }, - "content": { - "content_location_in_machine": "contentLocationInMachine", - "failure_message": "failureMessage", - "git": { - "branch": "branch", - "changed_files": [ - { - "change_type": "CHANGE_TYPE_UNSPECIFIED", - "path": "path", - } - ], - "clone_url": "cloneUrl", - "latest_commit": "latestCommit", - "total_changed_files": 0, - "total_unpushed_commits": 0, - "unpushed_commits": ["string"], - }, - "phase": "CONTENT_PHASE_UNSPECIFIED", - "session": "session", - "warning_message": "warningMessage", - }, - "devcontainer": { - "container_id": "containerId", - "container_name": "containerName", - "devcontainerconfig_in_sync": True, - "devcontainer_file_path": "devcontainerFilePath", - "devcontainer_file_presence": "PRESENCE_UNSPECIFIED", - "failure_message": "failureMessage", - "phase": "PHASE_UNSPECIFIED", - "remote_user": "remoteUser", - "remote_workspace_folder": "remoteWorkspaceFolder", - "secrets_in_sync": True, - "session": "session", - "warning_message": "warningMessage", - }, - "environment_urls": { - "logs": "logs", - "ports": [ - { - "port": 1, - "url": "url", - } - ], - "ssh": {"url": "url"}, - }, - "failure_message": ["string"], - "machine": { - "failure_message": "failureMessage", - "phase": "PHASE_UNSPECIFIED", - "session": "session", - "timeout": "timeout", - "versions": { - "supervisor_commit": "supervisorCommit", - "supervisor_version": "supervisorVersion", - }, - "warning_message": "warningMessage", - }, - "phase": "ENVIRONMENT_PHASE_UNSPECIFIED", - "runner_ack": { - "message": "message", - "spec_version": 0, - "status_code": "STATUS_CODE_UNSPECIFIED", - }, - "secrets": [ - { - "failure_message": "failureMessage", - "phase": "CONTENT_PHASE_UNSPECIFIED", - "secret_name": "secretName", - "session": "session", - "warning_message": "warningMessage", - } - ], - "ssh_public_keys": [ - { - "id": "id", - "phase": "CONTENT_PHASE_UNSPECIFIED", - } - ], - "status_version": 0, - "warning_message": ["string"], - }, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_raw_response_update_status(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.environments.with_raw_response.update_status( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = await response.parse() - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_streaming_response_update_status(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.environments.with_streaming_response.update_status( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = await response.parse() - assert_matches_type(object, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runner_interactions.py b/tests/api_resources/test_runner_interactions.py deleted file mode 100644 index 735ae817..00000000 --- a/tests/api_resources/test_runner_interactions.py +++ /dev/null @@ -1,1084 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types import ( - RunnerInteractionSignupResponse, - RunnerInteractionGetLatestVersionResponse, - RunnerInteractionListRunnerScmIntegrationsResponse, - RunnerInteractionListRunnerEnvironmentClassesResponse, - RunnerInteractionGetHostAuthenticationTokenValueResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestRunnerInteractions: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_get_host_authentication_token_value(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.get_host_authentication_token_value( - connect_protocol_version=1, - ) - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_method_get_host_authentication_token_value_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.get_host_authentication_token_value( - connect_protocol_version=1, - host="host", - principal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_raw_response_get_host_authentication_token_value(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.get_host_authentication_token_value( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_streaming_response_get_host_authentication_token_value(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.get_host_authentication_token_value( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_get_latest_version(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.get_latest_version( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - def test_method_get_latest_version_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.get_latest_version( - connect_protocol_version=1, - current_version="currentVersion", - infrastructure_version="infrastructureVersion", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_get_latest_version(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.get_latest_version( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_get_latest_version(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.get_latest_version( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list_runner_environment_classes(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.list_runner_environment_classes( - connect_protocol_version=1, - ) - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_method_list_runner_environment_classes_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.list_runner_environment_classes( - connect_protocol_version=1, - filter={"environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_raw_response_list_runner_environment_classes(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.list_runner_environment_classes( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - def test_streaming_response_list_runner_environment_classes(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.list_runner_environment_classes( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list_runner_scm_integrations(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.list_runner_scm_integrations( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - def test_method_list_runner_scm_integrations_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.list_runner_scm_integrations( - connect_protocol_version=1, - filter={"scm_integration_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_list_runner_scm_integrations(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.list_runner_scm_integrations( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_list_runner_scm_integrations(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.list_runner_scm_integrations( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type( - RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_mark_active(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.mark_active( - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.mark_active( - connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_mark_active(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.mark_active( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_mark_active(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.mark_active( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_send_response(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_send_response_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.send_response( - body={ - "callCheckAuthenticationForHost": { - "resp": { - "authenticated": True, - "authentication_url": "authenticationUrl", - "pat_supported": True, - "scm_id": "scmId", - } - }, - "callParseContext": { - "resp": { - "git": { - "branch": "branch", - "clone_url": "cloneUrl", - "commit": "commit", - "host": "host", - "owner": "owner", - "repo": "repo", - "upstream_remote_url": "upstreamRemoteUrl", - }, - "original_context_url": "originalContextUrl", - } - }, - "callPing": {}, - "callValidateConfig": {}, - "error": { - "code": "ERROR_CODE_UNSPECIFIED", - "details": [ - { - "debug": {"foo": "bar"}, - "type": "type", - "value": b"raw file contents", - } - ], - "message": "message", - }, - "requestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_send_response(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_send_response(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_signup(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.signup( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) - - @parametrize - def test_method_signup_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.signup( - connect_protocol_version=1, - environment_classes=[ - { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - } - ], - public_key="U3RhaW5sZXNzIHJvY2tz", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_signup(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.signup( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_signup(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.signup( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_runner_configuration_schema(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.update_runner_configuration_schema( - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_update_runner_configuration_schema_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.update_runner_configuration_schema( - connect_protocol_version=1, - config_schema={ - "environment_classes": [ - { - "id": "id", - "bool": {"default": True}, - "description": "description", - "display": {"default": "default"}, - "enum": { - "default": "default", - "values": ["string"], - }, - "int": { - "default": 0, - "max": 0, - "min": 0, - }, - "name": "name", - "required": True, - "secret": True, - "string": { - "default": "default", - "pattern": "pattern", - }, - } - ], - "runner_config": [ - { - "id": "id", - "bool": {"default": True}, - "description": "description", - "display": {"default": "default"}, - "enum": { - "default": "default", - "values": ["string"], - }, - "int": { - "default": 0, - "max": 0, - "min": 0, - }, - "name": "name", - "required": True, - "secret": True, - "string": { - "default": "default", - "pattern": "pattern", - }, - } - ], - "scm": [ - { - "default_hosts": ["string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - } - ], - "version": "version", - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_update_runner_configuration_schema(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.update_runner_configuration_schema( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_update_runner_configuration_schema(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.update_runner_configuration_schema( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_status(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.update_status( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_method_update_status_with_all_params(self, client: Gitpod) -> None: - runner_interaction = client.runner_interactions.update_status( - body={ - "additionalInfo": [ - { - "key": "key", - "value": "value", - } - ], - "capabilities": ["RUNNER_CAPABILITY_UNSPECIFIED"], - "degredationMessage": "degredationMessage", - "logUrl": "https://example.com", - "region": "region", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "systemDetails": "systemDetails", - "version": "version", - }, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_raw_response_update_status(self, client: Gitpod) -> None: - response = client.runner_interactions.with_raw_response.update_status( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - def test_streaming_response_update_status(self, client: Gitpod) -> None: - with client.runner_interactions.with_streaming_response.update_status( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncRunnerInteractions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.get_host_authentication_token_value( - connect_protocol_version=1, - ) - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_method_get_host_authentication_token_value_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.get_host_authentication_token_value( - connect_protocol_version=1, - host="host", - principal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_raw_response_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.get_host_authentication_token_value( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_streaming_response_get_host_authentication_token_value(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.get_host_authentication_token_value( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionGetHostAuthenticationTokenValueResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_get_latest_version(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.get_latest_version( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_method_get_latest_version_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.get_latest_version( - connect_protocol_version=1, - current_version="currentVersion", - infrastructure_version="infrastructureVersion", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_get_latest_version(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.get_latest_version( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_get_latest_version(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.get_latest_version( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(RunnerInteractionGetLatestVersionResponse, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.list_runner_environment_classes( - connect_protocol_version=1, - ) - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_method_list_runner_environment_classes_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.list_runner_environment_classes( - connect_protocol_version=1, - filter={"environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_raw_response_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.list_runner_environment_classes( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - @parametrize - async def test_streaming_response_list_runner_environment_classes(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.list_runner_environment_classes( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionListRunnerEnvironmentClassesResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.list_runner_scm_integrations( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_method_list_runner_scm_integrations_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.list_runner_scm_integrations( - connect_protocol_version=1, - filter={"scm_integration_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, - pagination={ - "token": "token", - "page_size": 0, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.list_runner_scm_integrations( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_list_runner_scm_integrations(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.list_runner_scm_integrations( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type( - RunnerInteractionListRunnerScmIntegrationsResponse, runner_interaction, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.mark_active( - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.mark_active( - connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.mark_active( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.mark_active( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_send_response(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_send_response_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.send_response( - body={ - "callCheckAuthenticationForHost": { - "resp": { - "authenticated": True, - "authentication_url": "authenticationUrl", - "pat_supported": True, - "scm_id": "scmId", - } - }, - "callParseContext": { - "resp": { - "git": { - "branch": "branch", - "clone_url": "cloneUrl", - "commit": "commit", - "host": "host", - "owner": "owner", - "repo": "repo", - "upstream_remote_url": "upstreamRemoteUrl", - }, - "original_context_url": "originalContextUrl", - } - }, - "callPing": {}, - "callValidateConfig": {}, - "error": { - "code": "ERROR_CODE_UNSPECIFIED", - "details": [ - { - "debug": {"foo": "bar"}, - "type": "type", - "value": b"raw file contents", - } - ], - "message": "message", - }, - "requestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_send_response(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.send_response( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_send_response(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.send_response( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_signup(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.signup( - connect_protocol_version=1, - ) - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_method_signup_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.signup( - connect_protocol_version=1, - environment_classes=[ - { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - } - ], - public_key="U3RhaW5sZXNzIHJvY2tz", - connect_timeout_ms=0, - ) - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_signup(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.signup( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_signup(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.signup( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(RunnerInteractionSignupResponse, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.update_runner_configuration_schema( - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_update_runner_configuration_schema_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.update_runner_configuration_schema( - connect_protocol_version=1, - config_schema={ - "environment_classes": [ - { - "id": "id", - "bool": {"default": True}, - "description": "description", - "display": {"default": "default"}, - "enum": { - "default": "default", - "values": ["string"], - }, - "int": { - "default": 0, - "max": 0, - "min": 0, - }, - "name": "name", - "required": True, - "secret": True, - "string": { - "default": "default", - "pattern": "pattern", - }, - } - ], - "runner_config": [ - { - "id": "id", - "bool": {"default": True}, - "description": "description", - "display": {"default": "default"}, - "enum": { - "default": "default", - "values": ["string"], - }, - "int": { - "default": 0, - "max": 0, - "min": 0, - }, - "name": "name", - "required": True, - "secret": True, - "string": { - "default": "default", - "pattern": "pattern", - }, - } - ], - "scm": [ - { - "default_hosts": ["string"], - "name": "name", - "oauth": {"callback_url": "callbackUrl"}, - "pat": { - "description": "description", - "docs_link": "docsLink", - }, - "scm_id": "scmId", - } - ], - "version": "version", - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.update_runner_configuration_schema( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_update_runner_configuration_schema(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.update_runner_configuration_schema( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_status(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.update_status( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_method_update_status_with_all_params(self, async_client: AsyncGitpod) -> None: - runner_interaction = await async_client.runner_interactions.update_status( - body={ - "additionalInfo": [ - { - "key": "key", - "value": "value", - } - ], - "capabilities": ["RUNNER_CAPABILITY_UNSPECIFIED"], - "degredationMessage": "degredationMessage", - "logUrl": "https://example.com", - "region": "region", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "systemDetails": "systemDetails", - "version": "version", - }, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_raw_response_update_status(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_interactions.with_raw_response.update_status( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - @parametrize - async def test_streaming_response_update_status(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_interactions.with_streaming_response.update_status( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner_interaction = await response.parse() - assert_matches_type(object, runner_interaction, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_tasks.py b/tests/api_resources/test_tasks.py deleted file mode 100644 index 41c234ea..00000000 --- a/tests/api_resources/test_tasks.py +++ /dev/null @@ -1,227 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types import TaskCreateResponse, TaskRetrieveCreateResponse -from gitpod._utils import parse_datetime - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestTasks: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Gitpod) -> None: - task = client.tasks.create( - connect_protocol_version=1, - ) - assert_matches_type(TaskCreateResponse, task, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Gitpod) -> None: - task = client.tasks.create( - connect_protocol_version=1, - depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={ - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "creator": { - "id": "id", - "principal": "PRINCIPAL_UNSPECIFIED", - }, - "description": "description", - "name": "x", - "reference": "reference", - "triggered_by": [ - { - "manual": True, - "postDevcontainerStart": True, - "postEnvironmentStart": True, - } - ], - }, - spec={ - "command": "command", - "runs_on": {}, - }, - connect_timeout_ms=0, - ) - assert_matches_type(TaskCreateResponse, task, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Gitpod) -> None: - response = client.tasks.with_raw_response.create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = response.parse() - assert_matches_type(TaskCreateResponse, task, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Gitpod) -> None: - with client.tasks.with_streaming_response.create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = response.parse() - assert_matches_type(TaskCreateResponse, task, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_retrieve_create(self, client: Gitpod) -> None: - task = client.tasks.retrieve_create( - connect_protocol_version=1, - ) - assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) - - @parametrize - def test_method_retrieve_create_with_all_params(self, client: Gitpod) -> None: - task = client.tasks.retrieve_create( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) - - @parametrize - def test_raw_response_retrieve_create(self, client: Gitpod) -> None: - response = client.tasks.with_raw_response.retrieve_create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = response.parse() - assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) - - @parametrize - def test_streaming_response_retrieve_create(self, client: Gitpod) -> None: - with client.tasks.with_streaming_response.retrieve_create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = response.parse() - assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncTasks: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncGitpod) -> None: - task = await async_client.tasks.create( - connect_protocol_version=1, - ) - assert_matches_type(TaskCreateResponse, task, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: - task = await async_client.tasks.create( - connect_protocol_version=1, - depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={ - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "creator": { - "id": "id", - "principal": "PRINCIPAL_UNSPECIFIED", - }, - "description": "description", - "name": "x", - "reference": "reference", - "triggered_by": [ - { - "manual": True, - "postDevcontainerStart": True, - "postEnvironmentStart": True, - } - ], - }, - spec={ - "command": "command", - "runs_on": {}, - }, - connect_timeout_ms=0, - ) - assert_matches_type(TaskCreateResponse, task, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.tasks.with_raw_response.create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = await response.parse() - assert_matches_type(TaskCreateResponse, task, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.tasks.with_streaming_response.create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = await response.parse() - assert_matches_type(TaskCreateResponse, task, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_retrieve_create(self, async_client: AsyncGitpod) -> None: - task = await async_client.tasks.retrieve_create( - connect_protocol_version=1, - ) - assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) - - @parametrize - async def test_method_retrieve_create_with_all_params(self, async_client: AsyncGitpod) -> None: - task = await async_client.tasks.retrieve_create( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) - - @parametrize - async def test_raw_response_retrieve_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.tasks.with_raw_response.retrieve_create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = await response.parse() - assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve_create(self, async_client: AsyncGitpod) -> None: - async with async_client.tasks.with_streaming_response.retrieve_create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = await response.parse() - assert_matches_type(TaskRetrieveCreateResponse, task, path=["response"]) - - assert cast(Any, response.is_closed) is True From ec83a74f773b17786193b8396ad284477c9482ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 13:55:33 +0000 Subject: [PATCH 042/505] feat(api): update via SDK Studio --- README.md | 24 ++++-- src/gitpod/_client.py | 36 ++++++++- tests/conftest.py | 6 +- tests/test_client.py | 169 +++++++++++++++++++++++++++++++----------- 4 files changed, 183 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 04e31882..4bcacec7 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,9 @@ The full API of this library can be found in [api.md](api.md). ```python from gitpod import Gitpod -client = Gitpod() +client = Gitpod( + auth_token="My Auth Token", +) runner = client.runners.create( connect_protocol_version=1, @@ -45,7 +47,9 @@ Simply import `AsyncGitpod` instead of `Gitpod` and use `await` with each API ca import asyncio from gitpod import AsyncGitpod -client = AsyncGitpod() +client = AsyncGitpod( + auth_token="My Auth Token", +) async def main() -> None: @@ -82,7 +86,9 @@ All errors inherit from `gitpod.APIError`. import gitpod from gitpod import Gitpod -client = Gitpod() +client = Gitpod( + auth_token="My Auth Token", +) try: client.runners.create( @@ -127,6 +133,7 @@ from gitpod import Gitpod client = Gitpod( # default is 2 max_retries=0, + auth_token="My Auth Token", ) # Or, configure per-request: @@ -147,11 +154,13 @@ from gitpod import Gitpod client = Gitpod( # 20 seconds (default is 1 minute) timeout=20.0, + auth_token="My Auth Token", ) # More granular control: client = Gitpod( timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), + auth_token="My Auth Token", ) # Override per-request: @@ -197,7 +206,9 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to ```py from gitpod import Gitpod -client = Gitpod() +client = Gitpod( + auth_token="My Auth Token", +) response = client.runners.with_raw_response.create( connect_protocol_version=1, ) @@ -282,6 +293,7 @@ client = Gitpod( proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), + auth_token="My Auth Token", ) ``` @@ -298,7 +310,9 @@ By default the library closes underlying HTTP connections whenever the client is ```py from gitpod import Gitpod -with Gitpod() as client: +with Gitpod( + auth_token="My Auth Token", +) as client: # make requests here ... diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 475b3624..d0181949 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -26,7 +26,7 @@ from ._version import __version__ from .resources import editors, projects, automations_files, environment_classes, personal_access_tokens from ._streaming import Stream as Stream, AsyncStream as AsyncStream -from ._exceptions import APIStatusError +from ._exceptions import GitpodError, APIStatusError from ._base_client import ( DEFAULT_MAX_RETRIES, SyncAPIClient, @@ -54,10 +54,12 @@ class Gitpod(SyncAPIClient): with_streaming_response: GitpodWithStreamedResponse # client options + auth_token: str def __init__( self, *, + auth_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -77,7 +79,18 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new synchronous gitpod client instance.""" + """Construct a new synchronous gitpod client instance. + + This automatically infers the `auth_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided. + """ + if auth_token is None: + auth_token = os.environ.get("GITPOD_API_KEY") + if auth_token is None: + raise GitpodError( + "The auth_token client option must be set either by passing auth_token to the client or by setting the GITPOD_API_KEY environment variable" + ) + self.auth_token = auth_token + if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -123,6 +136,7 @@ def default_headers(self) -> dict[str, str | Omit]: def copy( self, *, + auth_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.Client | None = None, @@ -156,6 +170,7 @@ def copy( http_client = http_client or self._client return self.__class__( + auth_token=auth_token or self.auth_token, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, @@ -217,10 +232,12 @@ class AsyncGitpod(AsyncAPIClient): with_streaming_response: AsyncGitpodWithStreamedResponse # client options + auth_token: str def __init__( self, *, + auth_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -240,7 +257,18 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new async gitpod client instance.""" + """Construct a new async gitpod client instance. + + This automatically infers the `auth_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided. + """ + if auth_token is None: + auth_token = os.environ.get("GITPOD_API_KEY") + if auth_token is None: + raise GitpodError( + "The auth_token client option must be set either by passing auth_token to the client or by setting the GITPOD_API_KEY environment variable" + ) + self.auth_token = auth_token + if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -286,6 +314,7 @@ def default_headers(self) -> dict[str, str | Omit]: def copy( self, *, + auth_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.AsyncClient | None = None, @@ -319,6 +348,7 @@ def copy( http_client = http_client or self._client return self.__class__( + auth_token=auth_token or self.auth_token, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, diff --git a/tests/conftest.py b/tests/conftest.py index ef7ca2c5..e83791ad 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,6 +28,8 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") +auth_token = "My Auth Token" + @pytest.fixture(scope="session") def client(request: FixtureRequest) -> Iterator[Gitpod]: @@ -35,7 +37,7 @@ def client(request: FixtureRequest) -> Iterator[Gitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - with Gitpod(base_url=base_url, _strict_response_validation=strict) as client: + with Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=strict) as client: yield client @@ -45,5 +47,5 @@ async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncGitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - async with AsyncGitpod(base_url=base_url, _strict_response_validation=strict) as client: + async with AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=strict) as client: yield client diff --git a/tests/test_client.py b/tests/test_client.py index 60d6c310..ee17c4f6 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -31,6 +31,7 @@ from .utils import update_env base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") +auth_token = "My Auth Token" def _get_params(client: BaseClient[Any, Any]) -> dict[str, str]: @@ -52,7 +53,7 @@ def _get_open_connections(client: Gitpod | AsyncGitpod) -> int: class TestGitpod: - client = Gitpod(base_url=base_url, _strict_response_validation=True) + client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) @pytest.mark.respx(base_url=base_url) def test_raw_response(self, respx_mock: MockRouter) -> None: @@ -78,6 +79,10 @@ def test_copy(self) -> None: copied = self.client.copy() assert id(copied) != id(self.client) + copied = self.client.copy(auth_token="another My Auth Token") + assert copied.auth_token == "another My Auth Token" + assert self.client.auth_token == "My Auth Token" + def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -95,7 +100,9 @@ def test_copy_default_options(self) -> None: assert isinstance(self.client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + client = Gitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"} + ) assert client.default_headers["X-Foo"] == "bar" # does not override the already given value when not specified @@ -127,7 +134,9 @@ def test_copy_default_headers(self) -> None: client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) def test_copy_default_query(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, default_query={"foo": "bar"}) + client = Gitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_query={"foo": "bar"} + ) assert _get_params(client)["foo"] == "bar" # does not override the already given value when not specified @@ -250,7 +259,9 @@ def test_request_timeout(self) -> None: assert timeout == httpx.Timeout(100.0) def test_client_timeout_option(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, timeout=httpx.Timeout(0)) + client = Gitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, timeout=httpx.Timeout(0) + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -259,7 +270,9 @@ def test_client_timeout_option(self) -> None: def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: - client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = Gitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -267,7 +280,9 @@ def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: - client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = Gitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -275,7 +290,9 @@ def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = Gitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -284,16 +301,24 @@ def test_http_client_timeout_option(self) -> None: async def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): async with httpx.AsyncClient() as http_client: - Gitpod(base_url=base_url, _strict_response_validation=True, http_client=cast(Any, http_client)) + Gitpod( + base_url=base_url, + auth_token=auth_token, + _strict_response_validation=True, + http_client=cast(Any, http_client), + ) def test_default_headers_option(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + client = Gitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"} + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" client2 = Gitpod( base_url=base_url, + auth_token=auth_token, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -305,7 +330,12 @@ def test_default_headers_option(self) -> None: assert request.headers.get("x-stainless-lang") == "my-overriding-header" def test_default_query_option(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, default_query={"query_param": "bar"}) + client = Gitpod( + base_url=base_url, + auth_token=auth_token, + _strict_response_validation=True, + default_query={"query_param": "bar"}, + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) url = httpx.URL(request.url) assert dict(url.params) == {"query_param": "bar"} @@ -504,7 +534,9 @@ class Model(BaseModel): assert response.foo == 2 def test_base_url_setter(self) -> None: - client = Gitpod(base_url="https://example.com/from_init", _strict_response_validation=True) + client = Gitpod( + base_url="https://example.com/from_init", auth_token=auth_token, _strict_response_validation=True + ) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -513,15 +545,18 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = Gitpod(_strict_response_validation=True) + client = Gitpod(auth_token=auth_token, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( "client", [ - Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + Gitpod( + base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True + ), Gitpod( base_url="http://localhost:5000/custom/path/", + auth_token=auth_token, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -541,9 +576,12 @@ def test_base_url_trailing_slash(self, client: Gitpod) -> None: @pytest.mark.parametrize( "client", [ - Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + Gitpod( + base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True + ), Gitpod( base_url="http://localhost:5000/custom/path/", + auth_token=auth_token, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -563,9 +601,12 @@ def test_base_url_no_trailing_slash(self, client: Gitpod) -> None: @pytest.mark.parametrize( "client", [ - Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + Gitpod( + base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True + ), Gitpod( base_url="http://localhost:5000/custom/path/", + auth_token=auth_token, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -583,7 +624,7 @@ def test_absolute_request_url(self, client: Gitpod) -> None: assert request.url == "https://myapi.com/foo" def test_copied_client_does_not_close_http(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True) + client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) assert not client.is_closed() copied = client.copy() @@ -594,7 +635,7 @@ def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() def test_client_context_manager(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True) + client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) with client as c2: assert c2 is client assert not c2.is_closed() @@ -615,7 +656,9 @@ class Model(BaseModel): def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - Gitpod(base_url=base_url, _strict_response_validation=True, max_retries=cast(Any, None)) + Gitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, max_retries=cast(Any, None) + ) @pytest.mark.respx(base_url=base_url) def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: @@ -624,12 +667,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = Gitpod(base_url=base_url, _strict_response_validation=True) + strict_client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Gitpod(base_url=base_url, _strict_response_validation=False) + client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=False) response = client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -657,7 +700,7 @@ class Model(BaseModel): ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True) + client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) @@ -779,7 +822,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: class TestAsyncGitpod: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio @@ -807,6 +850,10 @@ def test_copy(self) -> None: copied = self.client.copy() assert id(copied) != id(self.client) + copied = self.client.copy(auth_token="another My Auth Token") + assert copied.auth_token == "another My Auth Token" + assert self.client.auth_token == "My Auth Token" + def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -824,7 +871,9 @@ def test_copy_default_options(self) -> None: assert isinstance(self.client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + client = AsyncGitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"} + ) assert client.default_headers["X-Foo"] == "bar" # does not override the already given value when not specified @@ -856,7 +905,9 @@ def test_copy_default_headers(self) -> None: client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) def test_copy_default_query(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_query={"foo": "bar"}) + client = AsyncGitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_query={"foo": "bar"} + ) assert _get_params(client)["foo"] == "bar" # does not override the already given value when not specified @@ -979,7 +1030,9 @@ async def test_request_timeout(self) -> None: assert timeout == httpx.Timeout(100.0) async def test_client_timeout_option(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, timeout=httpx.Timeout(0)) + client = AsyncGitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, timeout=httpx.Timeout(0) + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -988,7 +1041,9 @@ async def test_client_timeout_option(self) -> None: async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = AsyncGitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -996,7 +1051,9 @@ async def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = AsyncGitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1004,7 +1061,9 @@ async def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = AsyncGitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1013,16 +1072,24 @@ async def test_http_client_timeout_option(self) -> None: def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): with httpx.Client() as http_client: - AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=cast(Any, http_client)) + AsyncGitpod( + base_url=base_url, + auth_token=auth_token, + _strict_response_validation=True, + http_client=cast(Any, http_client), + ) def test_default_headers_option(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + client = AsyncGitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"} + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" client2 = AsyncGitpod( base_url=base_url, + auth_token=auth_token, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -1034,7 +1101,12 @@ def test_default_headers_option(self) -> None: assert request.headers.get("x-stainless-lang") == "my-overriding-header" def test_default_query_option(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_query={"query_param": "bar"}) + client = AsyncGitpod( + base_url=base_url, + auth_token=auth_token, + _strict_response_validation=True, + default_query={"query_param": "bar"}, + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) url = httpx.URL(request.url) assert dict(url.params) == {"query_param": "bar"} @@ -1233,7 +1305,9 @@ class Model(BaseModel): assert response.foo == 2 def test_base_url_setter(self) -> None: - client = AsyncGitpod(base_url="https://example.com/from_init", _strict_response_validation=True) + client = AsyncGitpod( + base_url="https://example.com/from_init", auth_token=auth_token, _strict_response_validation=True + ) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -1242,15 +1316,18 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = AsyncGitpod(_strict_response_validation=True) + client = AsyncGitpod(auth_token=auth_token, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( "client", [ - AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + AsyncGitpod( + base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True + ), AsyncGitpod( base_url="http://localhost:5000/custom/path/", + auth_token=auth_token, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1270,9 +1347,12 @@ def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: @pytest.mark.parametrize( "client", [ - AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + AsyncGitpod( + base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True + ), AsyncGitpod( base_url="http://localhost:5000/custom/path/", + auth_token=auth_token, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1292,9 +1372,12 @@ def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: @pytest.mark.parametrize( "client", [ - AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), + AsyncGitpod( + base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True + ), AsyncGitpod( base_url="http://localhost:5000/custom/path/", + auth_token=auth_token, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1312,7 +1395,7 @@ def test_absolute_request_url(self, client: AsyncGitpod) -> None: assert request.url == "https://myapi.com/foo" async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) assert not client.is_closed() copied = client.copy() @@ -1324,7 +1407,7 @@ async def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() async def test_client_context_manager(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) async with client as c2: assert c2 is client assert not c2.is_closed() @@ -1346,7 +1429,9 @@ class Model(BaseModel): async def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - AsyncGitpod(base_url=base_url, _strict_response_validation=True, max_retries=cast(Any, None)) + AsyncGitpod( + base_url=base_url, auth_token=auth_token, _strict_response_validation=True, max_retries=cast(Any, None) + ) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio @@ -1356,12 +1441,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + strict_client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncGitpod(base_url=base_url, _strict_response_validation=False) + client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=False) response = await client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -1390,7 +1475,7 @@ class Model(BaseModel): @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @pytest.mark.asyncio async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) From 6cfe46dbfee176c6f5255fc464df3f28605eedcb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 13:56:10 +0000 Subject: [PATCH 043/505] feat(api): update via SDK Studio --- src/gitpod/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index d0181949..102ca188 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -94,7 +94,7 @@ def __init__( if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: - base_url = f"https://localhost:8080/test-api" + base_url = f"https://app.gitpod.io/app" super().__init__( version=__version__, @@ -272,7 +272,7 @@ def __init__( if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: - base_url = f"https://localhost:8080/test-api" + base_url = f"https://app.gitpod.io/app" super().__init__( version=__version__, From d7d29cb601fafb88ce0fa8611fdc7a74fd7d282a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 13:56:32 +0000 Subject: [PATCH 044/505] feat(api): update via SDK Studio --- src/gitpod/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 102ca188..74b9b40d 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -94,7 +94,7 @@ def __init__( if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: - base_url = f"https://app.gitpod.io/app" + base_url = f"https://app.gitpod.io/api" super().__init__( version=__version__, @@ -272,7 +272,7 @@ def __init__( if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: - base_url = f"https://app.gitpod.io/app" + base_url = f"https://app.gitpod.io/api" super().__init__( version=__version__, From 5789863dfa18862ba4bd23f4a652b99d6671e517 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 14:06:12 +0000 Subject: [PATCH 045/505] feat(api): update via SDK Studio --- .stats.yml | 2 +- api.md | 18 + src/gitpod/_client.py | 10 +- src/gitpod/resources/__init__.py | 14 + src/gitpod/resources/identity.py | 435 ++++++++++++++++++ src/gitpod/types/__init__.py | 10 + .../types/identity_exchange_token_params.py | 20 + .../types/identity_exchange_token_response.py | 14 + ...ntity_get_authenticated_identity_params.py | 19 + ...ity_get_authenticated_identity_response.py | 34 ++ .../types/identity_get_id_token_params.py | 20 + .../types/identity_get_id_token_response.py | 11 + tests/api_resources/test_identity.py | 272 +++++++++++ 13 files changed, 877 insertions(+), 2 deletions(-) create mode 100644 src/gitpod/resources/identity.py create mode 100644 src/gitpod/types/identity_exchange_token_params.py create mode 100644 src/gitpod/types/identity_exchange_token_response.py create mode 100644 src/gitpod/types/identity_get_authenticated_identity_params.py create mode 100644 src/gitpod/types/identity_get_authenticated_identity_response.py create mode 100644 src/gitpod/types/identity_get_id_token_params.py create mode 100644 src/gitpod/types/identity_get_id_token_response.py create mode 100644 tests/api_resources/test_identity.py diff --git a/.stats.yml b/.stats.yml index 98c4a5a8..fda04931 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 48 +configured_endpoints: 51 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a56421de8c29e0197c90fcbce09d837e8736c3a808b36b242b5c317231ce91fe.yml diff --git a/api.md b/api.md index 9a5dcc23..f273f89c 100644 --- a/api.md +++ b/api.md @@ -92,6 +92,24 @@ Methods: - client.environments.automations.services.start(\*\*params) -> object - client.environments.automations.services.stop(\*\*params) -> object +# Identity + +Types: + +```python +from gitpod.types import ( + IdentityExchangeTokenResponse, + IdentityGetAuthenticatedIdentityResponse, + IdentityGetIDTokenResponse, +) +``` + +Methods: + +- client.identity.exchange_token(\*\*params) -> IdentityExchangeTokenResponse +- client.identity.get_authenticated_identity(\*\*params) -> IdentityGetAuthenticatedIdentityResponse +- client.identity.get_id_token(\*\*params) -> IdentityGetIDTokenResponse + # EnvironmentClasses Types: diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 74b9b40d..d7a16372 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -24,7 +24,7 @@ get_async_library, ) from ._version import __version__ -from .resources import editors, projects, automations_files, environment_classes, personal_access_tokens +from .resources import editors, identity, projects, automations_files, environment_classes, personal_access_tokens from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import GitpodError, APIStatusError from ._base_client import ( @@ -44,6 +44,7 @@ class Gitpod(SyncAPIClient): automations_files: automations_files.AutomationsFilesResource editors: editors.EditorsResource environments: environments.EnvironmentsResource + identity: identity.IdentityResource environment_classes: environment_classes.EnvironmentClassesResource organizations: organizations.OrganizationsResource projects: projects.ProjectsResource @@ -110,6 +111,7 @@ def __init__( self.automations_files = automations_files.AutomationsFilesResource(self) self.editors = editors.EditorsResource(self) self.environments = environments.EnvironmentsResource(self) + self.identity = identity.IdentityResource(self) self.environment_classes = environment_classes.EnvironmentClassesResource(self) self.organizations = organizations.OrganizationsResource(self) self.projects = projects.ProjectsResource(self) @@ -222,6 +224,7 @@ class AsyncGitpod(AsyncAPIClient): automations_files: automations_files.AsyncAutomationsFilesResource editors: editors.AsyncEditorsResource environments: environments.AsyncEnvironmentsResource + identity: identity.AsyncIdentityResource environment_classes: environment_classes.AsyncEnvironmentClassesResource organizations: organizations.AsyncOrganizationsResource projects: projects.AsyncProjectsResource @@ -288,6 +291,7 @@ def __init__( self.automations_files = automations_files.AsyncAutomationsFilesResource(self) self.editors = editors.AsyncEditorsResource(self) self.environments = environments.AsyncEnvironmentsResource(self) + self.identity = identity.AsyncIdentityResource(self) self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self) self.organizations = organizations.AsyncOrganizationsResource(self) self.projects = projects.AsyncProjectsResource(self) @@ -401,6 +405,7 @@ def __init__(self, client: Gitpod) -> None: self.automations_files = automations_files.AutomationsFilesResourceWithRawResponse(client.automations_files) self.editors = editors.EditorsResourceWithRawResponse(client.editors) self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) + self.identity = identity.IdentityResourceWithRawResponse(client.identity) self.environment_classes = environment_classes.EnvironmentClassesResourceWithRawResponse( client.environment_classes ) @@ -422,6 +427,7 @@ def __init__(self, client: AsyncGitpod) -> None: ) self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) + self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity) self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithRawResponse( client.environment_classes ) @@ -443,6 +449,7 @@ def __init__(self, client: Gitpod) -> None: ) self.editors = editors.EditorsResourceWithStreamingResponse(client.editors) self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) + self.identity = identity.IdentityResourceWithStreamingResponse(client.identity) self.environment_classes = environment_classes.EnvironmentClassesResourceWithStreamingResponse( client.environment_classes ) @@ -464,6 +471,7 @@ def __init__(self, client: AsyncGitpod) -> None: ) self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) + self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity) self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithStreamingResponse( client.environment_classes ) diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index f87409f8..80d277b5 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -16,6 +16,14 @@ RunnersResourceWithStreamingResponse, AsyncRunnersResourceWithStreamingResponse, ) +from .identity import ( + IdentityResource, + AsyncIdentityResource, + IdentityResourceWithRawResponse, + AsyncIdentityResourceWithRawResponse, + IdentityResourceWithStreamingResponse, + AsyncIdentityResourceWithStreamingResponse, +) from .projects import ( ProjectsResource, AsyncProjectsResource, @@ -92,6 +100,12 @@ "AsyncEnvironmentsResourceWithRawResponse", "EnvironmentsResourceWithStreamingResponse", "AsyncEnvironmentsResourceWithStreamingResponse", + "IdentityResource", + "AsyncIdentityResource", + "IdentityResourceWithRawResponse", + "AsyncIdentityResourceWithRawResponse", + "IdentityResourceWithStreamingResponse", + "AsyncIdentityResourceWithStreamingResponse", "EnvironmentClassesResource", "AsyncEnvironmentClassesResource", "EnvironmentClassesResourceWithRawResponse", diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py new file mode 100644 index 00000000..1dd95ed9 --- /dev/null +++ b/src/gitpod/resources/identity.py @@ -0,0 +1,435 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal + +import httpx + +from ..types import ( + identity_get_id_token_params, + identity_exchange_token_params, + identity_get_authenticated_identity_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.identity_get_id_token_response import IdentityGetIDTokenResponse +from ..types.identity_exchange_token_response import IdentityExchangeTokenResponse +from ..types.identity_get_authenticated_identity_response import IdentityGetAuthenticatedIdentityResponse + +__all__ = ["IdentityResource", "AsyncIdentityResource"] + + +class IdentityResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> IdentityResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return IdentityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return IdentityResourceWithStreamingResponse(self) + + def exchange_token( + self, + *, + connect_protocol_version: Literal[1], + exchange_token: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityExchangeTokenResponse: + """ + ExchangeToken trades an exchange token for a new access token. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + exchange_token: exchange_token is the token to exchange + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.IdentityService/ExchangeToken", + body=maybe_transform( + {"exchange_token": exchange_token}, identity_exchange_token_params.IdentityExchangeTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityExchangeTokenResponse, + ) + + def get_authenticated_identity( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityGetAuthenticatedIdentityResponse: + """ + GetAuthenticatedIdentity allows to retrieve the current identity. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", + body=maybe_transform( + body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityGetAuthenticatedIdentityResponse, + ) + + def get_id_token( + self, + *, + connect_protocol_version: Literal[1], + audience: List[str] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityGetIDTokenResponse: + """ + GetIDToken returns a token that can be used to authenticate the user against the + other services. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.IdentityService/GetIDToken", + body=maybe_transform({"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityGetIDTokenResponse, + ) + + +class AsyncIdentityResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncIdentityResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncIdentityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncIdentityResourceWithStreamingResponse(self) + + async def exchange_token( + self, + *, + connect_protocol_version: Literal[1], + exchange_token: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityExchangeTokenResponse: + """ + ExchangeToken trades an exchange token for a new access token. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + exchange_token: exchange_token is the token to exchange + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.IdentityService/ExchangeToken", + body=await async_maybe_transform( + {"exchange_token": exchange_token}, identity_exchange_token_params.IdentityExchangeTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityExchangeTokenResponse, + ) + + async def get_authenticated_identity( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityGetAuthenticatedIdentityResponse: + """ + GetAuthenticatedIdentity allows to retrieve the current identity. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", + body=await async_maybe_transform( + body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityGetAuthenticatedIdentityResponse, + ) + + async def get_id_token( + self, + *, + connect_protocol_version: Literal[1], + audience: List[str] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityGetIDTokenResponse: + """ + GetIDToken returns a token that can be used to authenticate the user against the + other services. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.IdentityService/GetIDToken", + body=await async_maybe_transform( + {"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityGetIDTokenResponse, + ) + + +class IdentityResourceWithRawResponse: + def __init__(self, identity: IdentityResource) -> None: + self._identity = identity + + self.exchange_token = to_raw_response_wrapper( + identity.exchange_token, + ) + self.get_authenticated_identity = to_raw_response_wrapper( + identity.get_authenticated_identity, + ) + self.get_id_token = to_raw_response_wrapper( + identity.get_id_token, + ) + + +class AsyncIdentityResourceWithRawResponse: + def __init__(self, identity: AsyncIdentityResource) -> None: + self._identity = identity + + self.exchange_token = async_to_raw_response_wrapper( + identity.exchange_token, + ) + self.get_authenticated_identity = async_to_raw_response_wrapper( + identity.get_authenticated_identity, + ) + self.get_id_token = async_to_raw_response_wrapper( + identity.get_id_token, + ) + + +class IdentityResourceWithStreamingResponse: + def __init__(self, identity: IdentityResource) -> None: + self._identity = identity + + self.exchange_token = to_streamed_response_wrapper( + identity.exchange_token, + ) + self.get_authenticated_identity = to_streamed_response_wrapper( + identity.get_authenticated_identity, + ) + self.get_id_token = to_streamed_response_wrapper( + identity.get_id_token, + ) + + +class AsyncIdentityResourceWithStreamingResponse: + def __init__(self, identity: AsyncIdentityResource) -> None: + self._identity = identity + + self.exchange_token = async_to_streamed_response_wrapper( + identity.exchange_token, + ) + self.get_authenticated_identity = async_to_streamed_response_wrapper( + identity.get_authenticated_identity, + ) + self.get_id_token = async_to_streamed_response_wrapper( + identity.get_id_token, + ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index d3764a14..f082231e 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -23,14 +23,18 @@ from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams from .runner_delete_runner_params import RunnerDeleteRunnerParams as RunnerDeleteRunnerParams from .runner_update_runner_params import RunnerUpdateRunnerParams as RunnerUpdateRunnerParams +from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse from .automations_file_upsert_params import AutomationsFileUpsertParams as AutomationsFileUpsertParams +from .identity_exchange_token_params import IdentityExchangeTokenParams as IdentityExchangeTokenParams +from .identity_get_id_token_response import IdentityGetIDTokenResponse as IdentityGetIDTokenResponse from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams from .automations_file_upsert_response import AutomationsFileUpsertResponse as AutomationsFileUpsertResponse from .editor_resolve_editor_url_params import EditorResolveEditorURLParams as EditorResolveEditorURLParams +from .identity_exchange_token_response import IdentityExchangeTokenResponse as IdentityExchangeTokenResponse from .personal_access_token_list_params import PersonalAccessTokenListParams as PersonalAccessTokenListParams from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse @@ -54,9 +58,15 @@ from .project_create_from_environment_response import ( ProjectCreateFromEnvironmentResponse as ProjectCreateFromEnvironmentResponse, ) +from .identity_get_authenticated_identity_params import ( + IdentityGetAuthenticatedIdentityParams as IdentityGetAuthenticatedIdentityParams, +) from .runner_check_authentication_for_host_params import ( RunnerCheckAuthenticationForHostParams as RunnerCheckAuthenticationForHostParams, ) +from .identity_get_authenticated_identity_response import ( + IdentityGetAuthenticatedIdentityResponse as IdentityGetAuthenticatedIdentityResponse, +) from .runner_check_authentication_for_host_response import ( RunnerCheckAuthenticationForHostResponse as RunnerCheckAuthenticationForHostResponse, ) diff --git a/src/gitpod/types/identity_exchange_token_params.py b/src/gitpod/types/identity_exchange_token_params.py new file mode 100644 index 00000000..bb8becb3 --- /dev/null +++ b/src/gitpod/types/identity_exchange_token_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["IdentityExchangeTokenParams"] + + +class IdentityExchangeTokenParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + exchange_token: Annotated[str, PropertyInfo(alias="exchangeToken")] + """exchange_token is the token to exchange""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_exchange_token_response.py b/src/gitpod/types/identity_exchange_token_response.py new file mode 100644 index 00000000..c101adb6 --- /dev/null +++ b/src/gitpod/types/identity_exchange_token_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["IdentityExchangeTokenResponse"] + + +class IdentityExchangeTokenResponse(BaseModel): + access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) + """access_token is the new access token""" diff --git a/src/gitpod/types/identity_get_authenticated_identity_params.py b/src/gitpod/types/identity_get_authenticated_identity_params.py new file mode 100644 index 00000000..457fe1f9 --- /dev/null +++ b/src/gitpod/types/identity_get_authenticated_identity_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["IdentityGetAuthenticatedIdentityParams"] + + +class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_authenticated_identity_response.py b/src/gitpod/types/identity_get_authenticated_identity_response.py new file mode 100644 index 00000000..fb9635ba --- /dev/null +++ b/src/gitpod/types/identity_get_authenticated_identity_response.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["IdentityGetAuthenticatedIdentityResponse", "Subject"] + + +class Subject(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class IdentityGetAuthenticatedIdentityResponse(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + + subject: Optional[Subject] = None + """subject is the identity of the current user""" diff --git a/src/gitpod/types/identity_get_id_token_params.py b/src/gitpod/types/identity_get_id_token_params.py new file mode 100644 index 00000000..7291a3b6 --- /dev/null +++ b/src/gitpod/types/identity_get_id_token_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["IdentityGetIDTokenParams"] + + +class IdentityGetIDTokenParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + audience: List[str] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_id_token_response.py b/src/gitpod/types/identity_get_id_token_response.py new file mode 100644 index 00000000..e327e686 --- /dev/null +++ b/src/gitpod/types/identity_get_id_token_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["IdentityGetIDTokenResponse"] + + +class IdentityGetIDTokenResponse(BaseModel): + token: Optional[str] = None diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py new file mode 100644 index 00000000..ae92d5e8 --- /dev/null +++ b/tests/api_resources/test_identity.py @@ -0,0 +1,272 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + IdentityGetIDTokenResponse, + IdentityExchangeTokenResponse, + IdentityGetAuthenticatedIdentityResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestIdentity: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_exchange_token(self, client: Gitpod) -> None: + identity = client.identity.exchange_token( + connect_protocol_version=1, + ) + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: + identity = client.identity.exchange_token( + connect_protocol_version=1, + exchange_token="exchangeToken", + connect_timeout_ms=0, + ) + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + def test_raw_response_exchange_token(self, client: Gitpod) -> None: + response = client.identity.with_raw_response.exchange_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = response.parse() + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + def test_streaming_response_exchange_token(self, client: Gitpod) -> None: + with client.identity.with_streaming_response.exchange_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = response.parse() + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_authenticated_identity(self, client: Gitpod) -> None: + identity = client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: + identity = client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: + response = client.identity.with_raw_response.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = response.parse() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: + with client.identity.with_streaming_response.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = response.parse() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_id_token(self, client: Gitpod) -> None: + identity = client.identity.get_id_token( + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: + identity = client.identity.get_id_token( + connect_protocol_version=1, + audience=["string"], + connect_timeout_ms=0, + ) + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + def test_raw_response_get_id_token(self, client: Gitpod) -> None: + response = client.identity.with_raw_response.get_id_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = response.parse() + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + def test_streaming_response_get_id_token(self, client: Gitpod) -> None: + with client.identity.with_streaming_response.get_id_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = response.parse() + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncIdentity: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.exchange_token( + connect_protocol_version=1, + ) + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.exchange_token( + connect_protocol_version=1, + exchange_token="exchangeToken", + connect_timeout_ms=0, + ) + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.identity.with_raw_response.exchange_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = await response.parse() + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: + async with async_client.identity.with_streaming_response.exchange_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = await response.parse() + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: + response = await async_client.identity.with_raw_response.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = await response.parse() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: + async with async_client.identity.with_streaming_response.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = await response.parse() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_id_token( + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_id_token( + connect_protocol_version=1, + audience=["string"], + connect_timeout_ms=0, + ) + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.identity.with_raw_response.get_id_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = await response.parse() + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: + async with async_client.identity.with_streaming_response.get_id_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = await response.parse() + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True From 10c5e7cda47c8c221e98050c92d270ca63fa9953 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 14:16:53 +0000 Subject: [PATCH 046/505] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index fda04931..47f9df92 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 51 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a56421de8c29e0197c90fcbce09d837e8736c3a808b36b242b5c317231ce91fe.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b81ab7eb96e1bf876ada508a9db17fdb4b336c92b5bee7196f43a07fdc18c3be.yml From 1649a2d35557a3bb4d1a10537edf387d4e83bbf1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:28:32 +0000 Subject: [PATCH 047/505] feat(api): update via SDK Studio --- .stats.yml | 2 +- README.md | 24 +- api.md | 93 ++-- src/gitpod/_client.py | 68 +-- src/gitpod/resources/__init__.py | 42 -- src/gitpod/resources/automations_files.py | 224 --------- src/gitpod/resources/environment_classes.py | 10 +- .../environments/automations/__init__.py | 14 + .../environments/automations/automations.py | 190 ++++++++ .../environments/automations/services.py | 46 +- .../automations/task_executions.py} | 324 ++++++++----- .../environments/automations/tasks.py | 108 +++++ .../resources/environments/environments.py | 14 +- src/gitpod/resources/identity.py | 435 ----------------- .../resources/organizations/invite/summary.py | 8 +- src/gitpod/resources/projects.py | 117 ++++- .../configuration_schema.py | 113 ++++- .../environment_classes.py | 2 + .../host_authentication_tokens.py | 114 +++++ .../runner_configurations.py | 8 +- src/gitpod/resources/runners/runners.py | 136 +++++- src/gitpod/types/__init__.py | 22 +- src/gitpod/types/editor_list_params.py | 34 -- src/gitpod/types/editor_list_response.py | 45 -- .../types/editor_resolve_editor_url_params.py | 26 - .../editor_resolve_editor_url_response.py | 12 - src/gitpod/types/editor_retrieve_response.py | 28 -- .../types/environment_class_list_params.py | 4 +- .../types/environment_class_list_response.py | 10 +- .../environment_create_from_project_params.py | 13 +- ...nvironment_create_from_project_response.py | 88 ++-- src/gitpod/types/environment_create_params.py | 13 +- .../types/environment_create_response.py | 88 ++-- src/gitpod/types/environment_list_params.py | 4 +- src/gitpod/types/environment_list_response.py | 92 ++-- .../types/environment_retrieve_response.py | 88 ++-- src/gitpod/types/environments/__init__.py | 3 + .../automation_upsert_params.py} | 35 +- .../automation_upsert_response.py} | 6 +- .../environments/automations/__init__.py | 10 + .../automations/service_list_params.py | 4 +- .../automations/service_list_response.py | 52 +- .../automations/service_update_params.py | 12 +- .../automations/task_create_params.py | 14 +- .../automations/task_create_response.py | 14 +- .../automations/task_execution_list_params.py | 61 +++ .../task_execution_list_response.py | 458 ++++++++++++++++++ .../task_execution_retrieve_params.py} | 9 +- .../task_execution_retrieve_response.py | 447 +++++++++++++++++ .../task_execution_stop_params.py} | 10 +- ...ion_update_task_execution_status_params.py | 23 + .../automations/task_list_params.py | 4 +- .../automations/task_list_response.py | 18 +- .../automations/task_retrieve_params.py | 19 + .../automations/task_retrieve_response.py | 181 +++++++ .../automations/task_start_response.py | 39 +- .../types/identity_exchange_token_response.py | 14 - ...ity_get_authenticated_identity_response.py | 34 -- .../types/identity_get_id_token_response.py | 11 - .../organizations/invite_create_response.py | 6 +- .../organizations/invite_retrieve_response.py | 6 +- .../types/organizations/member_list_params.py | 4 +- .../organizations/member_list_response.py | 8 +- .../personal_access_token_list_params.py | 4 +- .../personal_access_token_list_response.py | 16 +- ...roject_create_from_environment_response.py | 8 +- src/gitpod/types/project_create_response.py | 8 +- ...n_params.py => project_retrieve_params.py} | 8 +- src/gitpod/types/project_retrieve_response.py | 298 ++++++++++++ .../types/runner_configurations/__init__.py | 10 + .../configuration_schema_retrieve_params.py | 19 + .../configuration_schema_retrieve_response.py | 71 +++ .../environment_class_list_params.py | 4 +- .../environment_class_list_response.py | 10 +- ...st_authentication_token_create_response.py | 4 +- .../host_authentication_token_list_params.py | 4 +- ...host_authentication_token_list_response.py | 8 +- ...st_authentication_token_retrieve_params.py | 19 + ..._authentication_token_retrieve_response.py | 125 +++++ src/gitpod/types/runner_create_response.py | 12 +- .../types/runner_get_runner_response.py | 12 +- src/gitpod/types/runner_list_params.py | 4 +- src/gitpod/types/runner_list_response.py | 16 +- ...ve_params.py => runner_retrieve_params.py} | 7 +- src/gitpod/types/runner_retrieve_response.py | 419 ++++++++++++++++ .../types/runners/policy_list_params.py | 4 +- .../types/runners/policy_list_response.py | 4 +- .../automations/test_task_executions.py | 393 +++++++++++++++ .../environments/automations/test_tasks.py | 81 ++++ .../test_automations.py} | 46 +- .../test_configuration_schema.py | 85 +++- .../test_host_authentication_tokens.py | 81 ++++ tests/api_resources/test_editors.py | 276 ----------- tests/api_resources/test_environments.py | 8 +- tests/api_resources/test_identity.py | 272 ----------- tests/api_resources/test_projects.py | 81 ++++ tests/api_resources/test_runners.py | 81 ++++ tests/conftest.py | 6 +- tests/test_client.py | 169 ++----- 99 files changed, 4556 insertions(+), 2278 deletions(-) delete mode 100644 src/gitpod/resources/automations_files.py rename src/gitpod/resources/{editors.py => environments/automations/task_executions.py} (54%) delete mode 100644 src/gitpod/resources/identity.py delete mode 100644 src/gitpod/types/editor_list_params.py delete mode 100644 src/gitpod/types/editor_list_response.py delete mode 100644 src/gitpod/types/editor_resolve_editor_url_params.py delete mode 100644 src/gitpod/types/editor_resolve_editor_url_response.py delete mode 100644 src/gitpod/types/editor_retrieve_response.py rename src/gitpod/types/{automations_file_upsert_params.py => environments/automation_upsert_params.py} (69%) rename src/gitpod/types/{automations_file_upsert_response.py => environments/automation_upsert_response.py} (74%) create mode 100644 src/gitpod/types/environments/automations/task_execution_list_params.py create mode 100644 src/gitpod/types/environments/automations/task_execution_list_response.py rename src/gitpod/types/{identity_get_id_token_params.py => environments/automations/task_execution_retrieve_params.py} (73%) create mode 100644 src/gitpod/types/environments/automations/task_execution_retrieve_response.py rename src/gitpod/types/{identity_get_authenticated_identity_params.py => environments/automations/task_execution_stop_params.py} (72%) create mode 100644 src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py create mode 100644 src/gitpod/types/environments/automations/task_retrieve_params.py create mode 100644 src/gitpod/types/environments/automations/task_retrieve_response.py delete mode 100644 src/gitpod/types/identity_exchange_token_response.py delete mode 100644 src/gitpod/types/identity_get_authenticated_identity_response.py delete mode 100644 src/gitpod/types/identity_get_id_token_response.py rename src/gitpod/types/{identity_exchange_token_params.py => project_retrieve_params.py} (69%) create mode 100644 src/gitpod/types/project_retrieve_response.py create mode 100644 src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py create mode 100644 src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py create mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py rename src/gitpod/types/{editor_retrieve_params.py => runner_retrieve_params.py} (77%) create mode 100644 src/gitpod/types/runner_retrieve_response.py create mode 100644 tests/api_resources/environments/automations/test_task_executions.py rename tests/api_resources/{test_automations_files.py => environments/test_automations.py} (72%) delete mode 100644 tests/api_resources/test_editors.py delete mode 100644 tests/api_resources/test_identity.py diff --git a/.stats.yml b/.stats.yml index 47f9df92..caf4ddcc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 51 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b81ab7eb96e1bf876ada508a9db17fdb4b336c92b5bee7196f43a07fdc18c3be.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6d44c8845e1deee92c3e6406d5b67aa72616ec5e21ab8c722ae0a2c214c14784.yml diff --git a/README.md b/README.md index 4bcacec7..04e31882 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,7 @@ The full API of this library can be found in [api.md](api.md). ```python from gitpod import Gitpod -client = Gitpod( - auth_token="My Auth Token", -) +client = Gitpod() runner = client.runners.create( connect_protocol_version=1, @@ -47,9 +45,7 @@ Simply import `AsyncGitpod` instead of `Gitpod` and use `await` with each API ca import asyncio from gitpod import AsyncGitpod -client = AsyncGitpod( - auth_token="My Auth Token", -) +client = AsyncGitpod() async def main() -> None: @@ -86,9 +82,7 @@ All errors inherit from `gitpod.APIError`. import gitpod from gitpod import Gitpod -client = Gitpod( - auth_token="My Auth Token", -) +client = Gitpod() try: client.runners.create( @@ -133,7 +127,6 @@ from gitpod import Gitpod client = Gitpod( # default is 2 max_retries=0, - auth_token="My Auth Token", ) # Or, configure per-request: @@ -154,13 +147,11 @@ from gitpod import Gitpod client = Gitpod( # 20 seconds (default is 1 minute) timeout=20.0, - auth_token="My Auth Token", ) # More granular control: client = Gitpod( timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), - auth_token="My Auth Token", ) # Override per-request: @@ -206,9 +197,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to ```py from gitpod import Gitpod -client = Gitpod( - auth_token="My Auth Token", -) +client = Gitpod() response = client.runners.with_raw_response.create( connect_protocol_version=1, ) @@ -293,7 +282,6 @@ client = Gitpod( proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), - auth_token="My Auth Token", ) ``` @@ -310,9 +298,7 @@ By default the library closes underlying HTTP connections whenever the client is ```py from gitpod import Gitpod -with Gitpod( - auth_token="My Auth Token", -) as client: +with Gitpod() as client: # make requests here ... diff --git a/api.md b/api.md index f273f89c..27079ea5 100644 --- a/api.md +++ b/api.md @@ -1,29 +1,3 @@ -# AutomationsFiles - -Types: - -```python -from gitpod.types import AutomationsFileUpsertResponse -``` - -Methods: - -- client.automations_files.upsert(\*\*params) -> AutomationsFileUpsertResponse - -# Editors - -Types: - -```python -from gitpod.types import EditorRetrieveResponse, EditorListResponse, EditorResolveEditorURLResponse -``` - -Methods: - -- client.editors.retrieve(\*\*params) -> EditorRetrieveResponse -- client.editors.list(\*\*params) -> EditorListResponse -- client.editors.resolve_editor_url(\*\*params) -> EditorResolveEditorURLResponse - # Environments Types: @@ -48,6 +22,16 @@ Methods: ## Automations +Types: + +```python +from gitpod.types.environments import AutomationUpsertResponse +``` + +Methods: + +- client.environments.automations.upsert(\*\*params) -> AutomationUpsertResponse + ### Tasks Types: @@ -55,6 +39,7 @@ Types: ```python from gitpod.types.environments.automations import ( TaskCreateResponse, + TaskRetrieveResponse, TaskUpdateResponse, TaskListResponse, TaskDeleteResponse, @@ -65,11 +50,32 @@ from gitpod.types.environments.automations import ( Methods: - client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse +- client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse - client.environments.automations.tasks.update(\*\*params) -> object - client.environments.automations.tasks.list(\*\*params) -> TaskListResponse - client.environments.automations.tasks.delete(\*\*params) -> object - client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse +### TaskExecutions + +Types: + +```python +from gitpod.types.environments.automations import ( + TaskExecutionRetrieveResponse, + TaskExecutionListResponse, + TaskExecutionStopResponse, + TaskExecutionUpdateTaskExecutionStatusResponse, +) +``` + +Methods: + +- client.environments.automations.task_executions.retrieve(\*\*params) -> TaskExecutionRetrieveResponse +- client.environments.automations.task_executions.list(\*\*params) -> TaskExecutionListResponse +- client.environments.automations.task_executions.stop(\*\*params) -> object +- client.environments.automations.task_executions.update_task_execution_status(\*\*params) -> object + ### Services Types: @@ -92,24 +98,6 @@ Methods: - client.environments.automations.services.start(\*\*params) -> object - client.environments.automations.services.stop(\*\*params) -> object -# Identity - -Types: - -```python -from gitpod.types import ( - IdentityExchangeTokenResponse, - IdentityGetAuthenticatedIdentityResponse, - IdentityGetIDTokenResponse, -) -``` - -Methods: - -- client.identity.exchange_token(\*\*params) -> IdentityExchangeTokenResponse -- client.identity.get_authenticated_identity(\*\*params) -> IdentityGetAuthenticatedIdentityResponse -- client.identity.get_id_token(\*\*params) -> IdentityGetIDTokenResponse - # EnvironmentClasses Types: @@ -177,12 +165,17 @@ Methods: Types: ```python -from gitpod.types import ProjectCreateResponse, ProjectCreateFromEnvironmentResponse +from gitpod.types import ( + ProjectCreateResponse, + ProjectRetrieveResponse, + ProjectCreateFromEnvironmentResponse, +) ``` Methods: - client.projects.create(\*\*params) -> ProjectCreateResponse +- client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse - client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse # RunnerConfigurations @@ -204,6 +197,7 @@ Types: ```python from gitpod.types.runner_configurations import ( HostAuthenticationTokenCreateResponse, + HostAuthenticationTokenRetrieveResponse, HostAuthenticationTokenUpdateResponse, HostAuthenticationTokenListResponse, HostAuthenticationTokenDeleteResponse, @@ -213,6 +207,7 @@ from gitpod.types.runner_configurations import ( Methods: - client.runner_configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse +- client.runner_configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse - client.runner_configurations.host_authentication_tokens.update(\*\*params) -> object - client.runner_configurations.host_authentication_tokens.list(\*\*params) -> HostAuthenticationTokenListResponse - client.runner_configurations.host_authentication_tokens.delete(\*\*params) -> object @@ -222,12 +217,16 @@ Methods: Types: ```python -from gitpod.types.runner_configurations import ConfigurationSchemaCreateResponse +from gitpod.types.runner_configurations import ( + ConfigurationSchemaCreateResponse, + ConfigurationSchemaRetrieveResponse, +) ``` Methods: - client.runner_configurations.configuration_schema.create(\*\*params) -> ConfigurationSchemaCreateResponse +- client.runner_configurations.configuration_schema.retrieve(\*\*params) -> ConfigurationSchemaRetrieveResponse ## ScmIntegration @@ -264,6 +263,7 @@ Types: ```python from gitpod.types import ( RunnerCreateResponse, + RunnerRetrieveResponse, RunnerListResponse, RunnerCheckAuthenticationForHostResponse, RunnerCreateRunnerTokenResponse, @@ -277,6 +277,7 @@ from gitpod.types import ( Methods: - client.runners.create(\*\*params) -> RunnerCreateResponse +- client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse - client.runners.list(\*\*params) -> RunnerListResponse - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index d7a16372..b1c0e7fe 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -24,9 +24,9 @@ get_async_library, ) from ._version import __version__ -from .resources import editors, identity, projects, automations_files, environment_classes, personal_access_tokens +from .resources import projects, environment_classes, personal_access_tokens from ._streaming import Stream as Stream, AsyncStream as AsyncStream -from ._exceptions import GitpodError, APIStatusError +from ._exceptions import APIStatusError from ._base_client import ( DEFAULT_MAX_RETRIES, SyncAPIClient, @@ -41,10 +41,7 @@ class Gitpod(SyncAPIClient): - automations_files: automations_files.AutomationsFilesResource - editors: editors.EditorsResource environments: environments.EnvironmentsResource - identity: identity.IdentityResource environment_classes: environment_classes.EnvironmentClassesResource organizations: organizations.OrganizationsResource projects: projects.ProjectsResource @@ -55,12 +52,10 @@ class Gitpod(SyncAPIClient): with_streaming_response: GitpodWithStreamedResponse # client options - auth_token: str def __init__( self, *, - auth_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -80,18 +75,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new synchronous gitpod client instance. - - This automatically infers the `auth_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided. - """ - if auth_token is None: - auth_token = os.environ.get("GITPOD_API_KEY") - if auth_token is None: - raise GitpodError( - "The auth_token client option must be set either by passing auth_token to the client or by setting the GITPOD_API_KEY environment variable" - ) - self.auth_token = auth_token - + """Construct a new synchronous gitpod client instance.""" if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -108,10 +92,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.automations_files = automations_files.AutomationsFilesResource(self) - self.editors = editors.EditorsResource(self) self.environments = environments.EnvironmentsResource(self) - self.identity = identity.IdentityResource(self) self.environment_classes = environment_classes.EnvironmentClassesResource(self) self.organizations = organizations.OrganizationsResource(self) self.projects = projects.ProjectsResource(self) @@ -138,7 +119,6 @@ def default_headers(self) -> dict[str, str | Omit]: def copy( self, *, - auth_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.Client | None = None, @@ -172,7 +152,6 @@ def copy( http_client = http_client or self._client return self.__class__( - auth_token=auth_token or self.auth_token, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, @@ -221,10 +200,7 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): - automations_files: automations_files.AsyncAutomationsFilesResource - editors: editors.AsyncEditorsResource environments: environments.AsyncEnvironmentsResource - identity: identity.AsyncIdentityResource environment_classes: environment_classes.AsyncEnvironmentClassesResource organizations: organizations.AsyncOrganizationsResource projects: projects.AsyncProjectsResource @@ -235,12 +211,10 @@ class AsyncGitpod(AsyncAPIClient): with_streaming_response: AsyncGitpodWithStreamedResponse # client options - auth_token: str def __init__( self, *, - auth_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -260,18 +234,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new async gitpod client instance. - - This automatically infers the `auth_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided. - """ - if auth_token is None: - auth_token = os.environ.get("GITPOD_API_KEY") - if auth_token is None: - raise GitpodError( - "The auth_token client option must be set either by passing auth_token to the client or by setting the GITPOD_API_KEY environment variable" - ) - self.auth_token = auth_token - + """Construct a new async gitpod client instance.""" if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -288,10 +251,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.automations_files = automations_files.AsyncAutomationsFilesResource(self) - self.editors = editors.AsyncEditorsResource(self) self.environments = environments.AsyncEnvironmentsResource(self) - self.identity = identity.AsyncIdentityResource(self) self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self) self.organizations = organizations.AsyncOrganizationsResource(self) self.projects = projects.AsyncProjectsResource(self) @@ -318,7 +278,6 @@ def default_headers(self) -> dict[str, str | Omit]: def copy( self, *, - auth_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.AsyncClient | None = None, @@ -352,7 +311,6 @@ def copy( http_client = http_client or self._client return self.__class__( - auth_token=auth_token or self.auth_token, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, @@ -402,10 +360,7 @@ def _make_status_error( class GitpodWithRawResponse: def __init__(self, client: Gitpod) -> None: - self.automations_files = automations_files.AutomationsFilesResourceWithRawResponse(client.automations_files) - self.editors = editors.EditorsResourceWithRawResponse(client.editors) self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) - self.identity = identity.IdentityResourceWithRawResponse(client.identity) self.environment_classes = environment_classes.EnvironmentClassesResourceWithRawResponse( client.environment_classes ) @@ -422,12 +377,7 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithRawResponse: def __init__(self, client: AsyncGitpod) -> None: - self.automations_files = automations_files.AsyncAutomationsFilesResourceWithRawResponse( - client.automations_files - ) - self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) - self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity) self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithRawResponse( client.environment_classes ) @@ -444,12 +394,7 @@ def __init__(self, client: AsyncGitpod) -> None: class GitpodWithStreamedResponse: def __init__(self, client: Gitpod) -> None: - self.automations_files = automations_files.AutomationsFilesResourceWithStreamingResponse( - client.automations_files - ) - self.editors = editors.EditorsResourceWithStreamingResponse(client.editors) self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) - self.identity = identity.IdentityResourceWithStreamingResponse(client.identity) self.environment_classes = environment_classes.EnvironmentClassesResourceWithStreamingResponse( client.environment_classes ) @@ -466,12 +411,7 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithStreamedResponse: def __init__(self, client: AsyncGitpod) -> None: - self.automations_files = automations_files.AsyncAutomationsFilesResourceWithStreamingResponse( - client.automations_files - ) - self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) - self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity) self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithStreamingResponse( client.environment_classes ) diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index 80d277b5..d8a15780 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .editors import ( - EditorsResource, - AsyncEditorsResource, - EditorsResourceWithRawResponse, - AsyncEditorsResourceWithRawResponse, - EditorsResourceWithStreamingResponse, - AsyncEditorsResourceWithStreamingResponse, -) from .runners import ( RunnersResource, AsyncRunnersResource, @@ -16,14 +8,6 @@ RunnersResourceWithStreamingResponse, AsyncRunnersResourceWithStreamingResponse, ) -from .identity import ( - IdentityResource, - AsyncIdentityResource, - IdentityResourceWithRawResponse, - AsyncIdentityResourceWithRawResponse, - IdentityResourceWithStreamingResponse, - AsyncIdentityResourceWithStreamingResponse, -) from .projects import ( ProjectsResource, AsyncProjectsResource, @@ -48,14 +32,6 @@ OrganizationsResourceWithStreamingResponse, AsyncOrganizationsResourceWithStreamingResponse, ) -from .automations_files import ( - AutomationsFilesResource, - AsyncAutomationsFilesResource, - AutomationsFilesResourceWithRawResponse, - AsyncAutomationsFilesResourceWithRawResponse, - AutomationsFilesResourceWithStreamingResponse, - AsyncAutomationsFilesResourceWithStreamingResponse, -) from .environment_classes import ( EnvironmentClassesResource, AsyncEnvironmentClassesResource, @@ -82,30 +58,12 @@ ) __all__ = [ - "AutomationsFilesResource", - "AsyncAutomationsFilesResource", - "AutomationsFilesResourceWithRawResponse", - "AsyncAutomationsFilesResourceWithRawResponse", - "AutomationsFilesResourceWithStreamingResponse", - "AsyncAutomationsFilesResourceWithStreamingResponse", - "EditorsResource", - "AsyncEditorsResource", - "EditorsResourceWithRawResponse", - "AsyncEditorsResourceWithRawResponse", - "EditorsResourceWithStreamingResponse", - "AsyncEditorsResourceWithStreamingResponse", "EnvironmentsResource", "AsyncEnvironmentsResource", "EnvironmentsResourceWithRawResponse", "AsyncEnvironmentsResourceWithRawResponse", "EnvironmentsResourceWithStreamingResponse", "AsyncEnvironmentsResourceWithStreamingResponse", - "IdentityResource", - "AsyncIdentityResource", - "IdentityResourceWithRawResponse", - "AsyncIdentityResourceWithRawResponse", - "IdentityResourceWithStreamingResponse", - "AsyncIdentityResourceWithStreamingResponse", "EnvironmentClassesResource", "AsyncEnvironmentClassesResource", "EnvironmentClassesResourceWithRawResponse", diff --git a/src/gitpod/resources/automations_files.py b/src/gitpod/resources/automations_files.py deleted file mode 100644 index 0fc4f329..00000000 --- a/src/gitpod/resources/automations_files.py +++ /dev/null @@ -1,224 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from ..types import automations_file_upsert_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options -from ..types.automations_file_upsert_response import AutomationsFileUpsertResponse - -__all__ = ["AutomationsFilesResource", "AsyncAutomationsFilesResource"] - - -class AutomationsFilesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AutomationsFilesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AutomationsFilesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AutomationsFilesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AutomationsFilesResourceWithStreamingResponse(self) - - def upsert( - self, - *, - connect_protocol_version: Literal[1], - automations_file: automations_file_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AutomationsFileUpsertResponse: - """ - UpsertAutomationsFile upserts the automations file for the given environment. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - automations_file: WARN: Do not remove any field here, as it will break reading automation yaml - files. We error if there are any unknown fields in the yaml (to ensure the yaml - is correct), but would break if we removed any fields. This includes marking a - field as "reserved" in the proto file, this will also break reading the yaml. - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", - body=maybe_transform( - { - "automations_file": automations_file, - "environment_id": environment_id, - }, - automations_file_upsert_params.AutomationsFileUpsertParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=AutomationsFileUpsertResponse, - ) - - -class AsyncAutomationsFilesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAutomationsFilesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncAutomationsFilesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAutomationsFilesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncAutomationsFilesResourceWithStreamingResponse(self) - - async def upsert( - self, - *, - connect_protocol_version: Literal[1], - automations_file: automations_file_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AutomationsFileUpsertResponse: - """ - UpsertAutomationsFile upserts the automations file for the given environment. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - automations_file: WARN: Do not remove any field here, as it will break reading automation yaml - files. We error if there are any unknown fields in the yaml (to ensure the yaml - is correct), but would break if we removed any fields. This includes marking a - field as "reserved" in the proto file, this will also break reading the yaml. - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", - body=await async_maybe_transform( - { - "automations_file": automations_file, - "environment_id": environment_id, - }, - automations_file_upsert_params.AutomationsFileUpsertParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=AutomationsFileUpsertResponse, - ) - - -class AutomationsFilesResourceWithRawResponse: - def __init__(self, automations_files: AutomationsFilesResource) -> None: - self._automations_files = automations_files - - self.upsert = to_raw_response_wrapper( - automations_files.upsert, - ) - - -class AsyncAutomationsFilesResourceWithRawResponse: - def __init__(self, automations_files: AsyncAutomationsFilesResource) -> None: - self._automations_files = automations_files - - self.upsert = async_to_raw_response_wrapper( - automations_files.upsert, - ) - - -class AutomationsFilesResourceWithStreamingResponse: - def __init__(self, automations_files: AutomationsFilesResource) -> None: - self._automations_files = automations_files - - self.upsert = to_streamed_response_wrapper( - automations_files.upsert, - ) - - -class AsyncAutomationsFilesResourceWithStreamingResponse: - def __init__(self, automations_files: AsyncAutomationsFilesResource) -> None: - self._automations_files = automations_files - - self.upsert = async_to_streamed_response_wrapper( - automations_files.upsert, - ) diff --git a/src/gitpod/resources/environment_classes.py b/src/gitpod/resources/environment_classes.py index 47793c09..23a78c0b 100644 --- a/src/gitpod/resources/environment_classes.py +++ b/src/gitpod/resources/environment_classes.py @@ -65,8 +65,9 @@ def list( ) -> EnvironmentClassListResponse: """ ListEnvironmentClasses returns the list of environment classes with runner - details a user is able to use based on the query buf:lint:ignore - RPC_REQUEST_RESPONSE_UNIQUE + details a user is able to use based on the + + query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: connect_protocol_version: Define the version of the Connect protocol @@ -144,8 +145,9 @@ async def list( ) -> EnvironmentClassListResponse: """ ListEnvironmentClasses returns the list of environment classes with runner - details a user is able to use based on the query buf:lint:ignore - RPC_REQUEST_RESPONSE_UNIQUE + details a user is able to use based on the + + query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: connect_protocol_version: Define the version of the Connect protocol diff --git a/src/gitpod/resources/environments/automations/__init__.py b/src/gitpod/resources/environments/automations/__init__.py index cd4b0ca7..c761c0b5 100644 --- a/src/gitpod/resources/environments/automations/__init__.py +++ b/src/gitpod/resources/environments/automations/__init__.py @@ -24,6 +24,14 @@ AutomationsResourceWithStreamingResponse, AsyncAutomationsResourceWithStreamingResponse, ) +from .task_executions import ( + TaskExecutionsResource, + AsyncTaskExecutionsResource, + TaskExecutionsResourceWithRawResponse, + AsyncTaskExecutionsResourceWithRawResponse, + TaskExecutionsResourceWithStreamingResponse, + AsyncTaskExecutionsResourceWithStreamingResponse, +) __all__ = [ "TasksResource", @@ -32,6 +40,12 @@ "AsyncTasksResourceWithRawResponse", "TasksResourceWithStreamingResponse", "AsyncTasksResourceWithStreamingResponse", + "TaskExecutionsResource", + "AsyncTaskExecutionsResource", + "TaskExecutionsResourceWithRawResponse", + "AsyncTaskExecutionsResourceWithRawResponse", + "TaskExecutionsResourceWithStreamingResponse", + "AsyncTaskExecutionsResourceWithStreamingResponse", "ServicesResource", "AsyncServicesResource", "ServicesResourceWithRawResponse", diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index 68f0404a..8d618ab1 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -2,6 +2,10 @@ from __future__ import annotations +from typing_extensions import Literal + +import httpx + from .tasks import ( TasksResource, AsyncTasksResource, @@ -18,8 +22,32 @@ ServicesResourceWithStreamingResponse, AsyncServicesResourceWithStreamingResponse, ) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import make_request_options +from .task_executions import ( + TaskExecutionsResource, + AsyncTaskExecutionsResource, + TaskExecutionsResourceWithRawResponse, + AsyncTaskExecutionsResourceWithRawResponse, + TaskExecutionsResourceWithStreamingResponse, + AsyncTaskExecutionsResourceWithStreamingResponse, +) +from ....types.environments import automation_upsert_params +from ....types.environments.automation_upsert_response import AutomationUpsertResponse __all__ = ["AutomationsResource", "AsyncAutomationsResource"] @@ -29,6 +57,10 @@ class AutomationsResource(SyncAPIResource): def tasks(self) -> TasksResource: return TasksResource(self._client) + @cached_property + def task_executions(self) -> TaskExecutionsResource: + return TaskExecutionsResource(self._client) + @cached_property def services(self) -> ServicesResource: return ServicesResource(self._client) @@ -52,12 +84,77 @@ def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: """ return AutomationsResourceWithStreamingResponse(self) + def upsert( + self, + *, + connect_protocol_version: Literal[1], + automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AutomationUpsertResponse: + """ + UpsertAutomationsFile upserts the automations file for the given environment. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + automations_file: WARN: Do not remove any field here, as it will break reading automation yaml + files. We error if there are any + + unknown fields in the yaml (to ensure the yaml is correct), but would break if + we removed any fields. This includes marking a field as "reserved" in the proto + file, this will also break reading the yaml. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", + body=maybe_transform( + { + "automations_file": automations_file, + "environment_id": environment_id, + }, + automation_upsert_params.AutomationUpsertParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationUpsertResponse, + ) + class AsyncAutomationsResource(AsyncAPIResource): @cached_property def tasks(self) -> AsyncTasksResource: return AsyncTasksResource(self._client) + @cached_property + def task_executions(self) -> AsyncTaskExecutionsResource: + return AsyncTaskExecutionsResource(self._client) + @cached_property def services(self) -> AsyncServicesResource: return AsyncServicesResource(self._client) @@ -81,15 +178,84 @@ def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingRespon """ return AsyncAutomationsResourceWithStreamingResponse(self) + async def upsert( + self, + *, + connect_protocol_version: Literal[1], + automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AutomationUpsertResponse: + """ + UpsertAutomationsFile upserts the automations file for the given environment. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + automations_file: WARN: Do not remove any field here, as it will break reading automation yaml + files. We error if there are any + + unknown fields in the yaml (to ensure the yaml is correct), but would break if + we removed any fields. This includes marking a field as "reserved" in the proto + file, this will also break reading the yaml. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", + body=await async_maybe_transform( + { + "automations_file": automations_file, + "environment_id": environment_id, + }, + automation_upsert_params.AutomationUpsertParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationUpsertResponse, + ) + class AutomationsResourceWithRawResponse: def __init__(self, automations: AutomationsResource) -> None: self._automations = automations + self.upsert = to_raw_response_wrapper( + automations.upsert, + ) + @cached_property def tasks(self) -> TasksResourceWithRawResponse: return TasksResourceWithRawResponse(self._automations.tasks) + @cached_property + def task_executions(self) -> TaskExecutionsResourceWithRawResponse: + return TaskExecutionsResourceWithRawResponse(self._automations.task_executions) + @cached_property def services(self) -> ServicesResourceWithRawResponse: return ServicesResourceWithRawResponse(self._automations.services) @@ -99,10 +265,18 @@ class AsyncAutomationsResourceWithRawResponse: def __init__(self, automations: AsyncAutomationsResource) -> None: self._automations = automations + self.upsert = async_to_raw_response_wrapper( + automations.upsert, + ) + @cached_property def tasks(self) -> AsyncTasksResourceWithRawResponse: return AsyncTasksResourceWithRawResponse(self._automations.tasks) + @cached_property + def task_executions(self) -> AsyncTaskExecutionsResourceWithRawResponse: + return AsyncTaskExecutionsResourceWithRawResponse(self._automations.task_executions) + @cached_property def services(self) -> AsyncServicesResourceWithRawResponse: return AsyncServicesResourceWithRawResponse(self._automations.services) @@ -112,10 +286,18 @@ class AutomationsResourceWithStreamingResponse: def __init__(self, automations: AutomationsResource) -> None: self._automations = automations + self.upsert = to_streamed_response_wrapper( + automations.upsert, + ) + @cached_property def tasks(self) -> TasksResourceWithStreamingResponse: return TasksResourceWithStreamingResponse(self._automations.tasks) + @cached_property + def task_executions(self) -> TaskExecutionsResourceWithStreamingResponse: + return TaskExecutionsResourceWithStreamingResponse(self._automations.task_executions) + @cached_property def services(self) -> ServicesResourceWithStreamingResponse: return ServicesResourceWithStreamingResponse(self._automations.services) @@ -125,10 +307,18 @@ class AsyncAutomationsResourceWithStreamingResponse: def __init__(self, automations: AsyncAutomationsResource) -> None: self._automations = automations + self.upsert = async_to_streamed_response_wrapper( + automations.upsert, + ) + @cached_property def tasks(self) -> AsyncTasksResourceWithStreamingResponse: return AsyncTasksResourceWithStreamingResponse(self._automations.tasks) + @cached_property + def task_executions(self) -> AsyncTaskExecutionsResourceWithStreamingResponse: + return AsyncTaskExecutionsResourceWithStreamingResponse(self._automations.task_executions) + @cached_property def services(self) -> AsyncServicesResourceWithStreamingResponse: return AsyncServicesResourceWithStreamingResponse(self._automations.services) diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index 24e89981..67694136 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -76,13 +76,16 @@ def update( Args: connect_protocol_version: Define the version of the Connect protocol - spec: Changing the spec of a service is a complex operation. The spec of a service can - only be updated if the service is in a stopped state. If the service is running, - it must be stopped first. + spec: Changing the spec of a service is a complex operation. The spec of a service + + can only be updated if the service is in a stopped state. If the service is + running, it must be stopped first. status: Service status updates are only expected from the executing environment. As a - client of this API you are not expected to provide this field. Updating this - field requires the `environmentservice:update_status` permission. + client + + of this API you are not expected to provide this field. Updating this field + requires the `environmentservice:update_status` permission. connect_timeout_ms: Define the timeout, in ms @@ -195,7 +198,9 @@ def delete( """DeleteService deletes a service. This call does not block until the service is - deleted. If the service is not stopped it will be stopped before deletion. + deleted. + + If the service is not stopped it will be stopped before deletion. Args: connect_protocol_version: Define the version of the Connect protocol @@ -250,9 +255,10 @@ def start( """StartService starts a service. This call does not block until the service is - started. This call will not error if the service is already running or has been started. + This call will not error if the service is already running or has been started. + Args: connect_protocol_version: Define the version of the Connect protocol @@ -300,9 +306,10 @@ def stop( """StopService stops a service. This call does not block until the service is - stopped. This call will not error if the service is already stopped or has been stopped. + This call will not error if the service is already stopped or has been stopped. + Args: connect_protocol_version: Define the version of the Connect protocol @@ -377,13 +384,16 @@ async def update( Args: connect_protocol_version: Define the version of the Connect protocol - spec: Changing the spec of a service is a complex operation. The spec of a service can - only be updated if the service is in a stopped state. If the service is running, - it must be stopped first. + spec: Changing the spec of a service is a complex operation. The spec of a service + + can only be updated if the service is in a stopped state. If the service is + running, it must be stopped first. status: Service status updates are only expected from the executing environment. As a - client of this API you are not expected to provide this field. Updating this - field requires the `environmentservice:update_status` permission. + client + + of this API you are not expected to provide this field. Updating this field + requires the `environmentservice:update_status` permission. connect_timeout_ms: Define the timeout, in ms @@ -496,7 +506,9 @@ async def delete( """DeleteService deletes a service. This call does not block until the service is - deleted. If the service is not stopped it will be stopped before deletion. + deleted. + + If the service is not stopped it will be stopped before deletion. Args: connect_protocol_version: Define the version of the Connect protocol @@ -551,9 +563,10 @@ async def start( """StartService starts a service. This call does not block until the service is - started. This call will not error if the service is already running or has been started. + This call will not error if the service is already running or has been started. + Args: connect_protocol_version: Define the version of the Connect protocol @@ -601,9 +614,10 @@ async def stop( """StopService stops a service. This call does not block until the service is - stopped. This call will not error if the service is already stopped or has been stopped. + This call will not error if the service is already stopped or has been stopped. + Args: connect_protocol_version: Define the version of the Connect protocol diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/environments/automations/task_executions.py similarity index 54% rename from src/gitpod/resources/editors.py rename to src/gitpod/resources/environments/automations/task_executions.py index 1d6829f4..cb17125c 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/environments/automations/task_executions.py @@ -6,49 +6,53 @@ import httpx -from ..types import editor_list_params, editor_retrieve_params, editor_resolve_editor_url_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( is_given, maybe_transform, strip_not_given, async_maybe_transform, ) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options -from ..types.editor_list_response import EditorListResponse -from ..types.editor_retrieve_response import EditorRetrieveResponse -from ..types.editor_resolve_editor_url_response import EditorResolveEditorURLResponse +from ...._base_client import make_request_options +from ....types.environments.automations import ( + task_execution_list_params, + task_execution_stop_params, + task_execution_retrieve_params, + task_execution_update_task_execution_status_params, +) +from ....types.environments.automations.task_execution_list_response import TaskExecutionListResponse +from ....types.environments.automations.task_execution_retrieve_response import TaskExecutionRetrieveResponse -__all__ = ["EditorsResource", "AsyncEditorsResource"] +__all__ = ["TaskExecutionsResource", "AsyncTaskExecutionsResource"] -class EditorsResource(SyncAPIResource): +class TaskExecutionsResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> EditorsResourceWithRawResponse: + def with_raw_response(self) -> TaskExecutionsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return EditorsResourceWithRawResponse(self) + return TaskExecutionsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> EditorsResourceWithStreamingResponse: + def with_streaming_response(self) -> TaskExecutionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return EditorsResourceWithStreamingResponse(self) + return TaskExecutionsResourceWithStreamingResponse(self) def retrieve( self, @@ -62,15 +66,13 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EditorRetrieveResponse: + ) -> TaskExecutionRetrieveResponse: """ - GetEditor returns the editor with the given ID + GetTaskExecution Args: connect_protocol_version: Define the version of the Connect protocol - id: id is the ID of the editor to get - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -91,19 +93,20 @@ def retrieve( **(extra_headers or {}), } return self._post( - "/gitpod.v1.EditorService/GetEditor", - body=maybe_transform({"id": id}, editor_retrieve_params.EditorRetrieveParams), + "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + body=maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EditorRetrieveResponse, + cast_to=TaskExecutionRetrieveResponse, ) def list( self, *, connect_protocol_version: Literal[1], - pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, + filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -111,14 +114,16 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EditorListResponse: + ) -> TaskExecutionListResponse: """ - ListEditors lists all editors available to the caller + ListTaskExecutions Args: connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environments + filter: filter contains the filter options for listing task runs + + pagination: pagination contains the pagination options for listing task runs connect_timeout_ms: Define the timeout, in ms @@ -140,21 +145,25 @@ def list( **(extra_headers or {}), } return self._post( - "/gitpod.v1.EditorService/ListEditors", - body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + task_execution_list_params.TaskExecutionListParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EditorListResponse, + cast_to=TaskExecutionListResponse, ) - def resolve_editor_url( + def stop( self, *, connect_protocol_version: Literal[1], - editor_id: str | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -162,18 +171,61 @@ def resolve_editor_url( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EditorResolveEditorURLResponse: + ) -> object: """ - ResolveEditorURL resolves the editor's URL for an environment + StopTaskExecution Args: connect_protocol_version: Define the version of the Connect protocol - editor_id: editorId is the ID of the editor to resolve the URL for + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers - environment_id: environmentId is the ID of the environment to resolve the URL for + extra_query: Add additional query parameters to the request - organization_id: organizationId is the ID of the organization to resolve the URL for + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", + body=maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def update_task_execution_status( + self, + *, + body: task_execution_update_task_execution_status_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """UpdateTaskExecutionStatus updates the status of a task execution. + + Only the + environment executing a task execution is expected to call this function. + + Args: + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -195,41 +247,36 @@ def resolve_editor_url( **(extra_headers or {}), } return self._post( - "/gitpod.v1.EditorService/ResolveEditorURL", + "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", body=maybe_transform( - { - "editor_id": editor_id, - "environment_id": environment_id, - "organization_id": organization_id, - }, - editor_resolve_editor_url_params.EditorResolveEditorURLParams, + body, task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EditorResolveEditorURLResponse, + cast_to=object, ) -class AsyncEditorsResource(AsyncAPIResource): +class AsyncTaskExecutionsResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncEditorsResourceWithRawResponse: + def with_raw_response(self) -> AsyncTaskExecutionsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return AsyncEditorsResourceWithRawResponse(self) + return AsyncTaskExecutionsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncEditorsResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncTaskExecutionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return AsyncEditorsResourceWithStreamingResponse(self) + return AsyncTaskExecutionsResourceWithStreamingResponse(self) async def retrieve( self, @@ -243,15 +290,13 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EditorRetrieveResponse: + ) -> TaskExecutionRetrieveResponse: """ - GetEditor returns the editor with the given ID + GetTaskExecution Args: connect_protocol_version: Define the version of the Connect protocol - id: id is the ID of the editor to get - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -272,19 +317,20 @@ async def retrieve( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EditorService/GetEditor", - body=await async_maybe_transform({"id": id}, editor_retrieve_params.EditorRetrieveParams), + "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + body=await async_maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EditorRetrieveResponse, + cast_to=TaskExecutionRetrieveResponse, ) async def list( self, *, connect_protocol_version: Literal[1], - pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, + filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -292,14 +338,16 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EditorListResponse: + ) -> TaskExecutionListResponse: """ - ListEditors lists all editors available to the caller + ListTaskExecutions Args: connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environments + filter: filter contains the filter options for listing task runs + + pagination: pagination contains the pagination options for listing task runs connect_timeout_ms: Define the timeout, in ms @@ -321,21 +369,25 @@ async def list( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EditorService/ListEditors", - body=await async_maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + body=await async_maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + task_execution_list_params.TaskExecutionListParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EditorListResponse, + cast_to=TaskExecutionListResponse, ) - async def resolve_editor_url( + async def stop( self, *, connect_protocol_version: Literal[1], - editor_id: str | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -343,18 +395,61 @@ async def resolve_editor_url( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EditorResolveEditorURLResponse: + ) -> object: """ - ResolveEditorURL resolves the editor's URL for an environment + StopTaskExecution Args: connect_protocol_version: Define the version of the Connect protocol - editor_id: editorId is the ID of the editor to resolve the URL for + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", + body=await async_maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def update_task_execution_status( + self, + *, + body: task_execution_update_task_execution_status_params.Body, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """UpdateTaskExecutionStatus updates the status of a task execution. - environment_id: environmentId is the ID of the environment to resolve the URL for + Only the + environment executing a task execution is expected to call this function. - organization_id: organizationId is the ID of the organization to resolve the URL for + Args: + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -376,77 +471,84 @@ async def resolve_editor_url( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EditorService/ResolveEditorURL", + "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", body=await async_maybe_transform( - { - "editor_id": editor_id, - "environment_id": environment_id, - "organization_id": organization_id, - }, - editor_resolve_editor_url_params.EditorResolveEditorURLParams, + body, task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EditorResolveEditorURLResponse, + cast_to=object, ) -class EditorsResourceWithRawResponse: - def __init__(self, editors: EditorsResource) -> None: - self._editors = editors +class TaskExecutionsResourceWithRawResponse: + def __init__(self, task_executions: TaskExecutionsResource) -> None: + self._task_executions = task_executions self.retrieve = to_raw_response_wrapper( - editors.retrieve, + task_executions.retrieve, ) self.list = to_raw_response_wrapper( - editors.list, + task_executions.list, + ) + self.stop = to_raw_response_wrapper( + task_executions.stop, ) - self.resolve_editor_url = to_raw_response_wrapper( - editors.resolve_editor_url, + self.update_task_execution_status = to_raw_response_wrapper( + task_executions.update_task_execution_status, ) -class AsyncEditorsResourceWithRawResponse: - def __init__(self, editors: AsyncEditorsResource) -> None: - self._editors = editors +class AsyncTaskExecutionsResourceWithRawResponse: + def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: + self._task_executions = task_executions self.retrieve = async_to_raw_response_wrapper( - editors.retrieve, + task_executions.retrieve, ) self.list = async_to_raw_response_wrapper( - editors.list, + task_executions.list, ) - self.resolve_editor_url = async_to_raw_response_wrapper( - editors.resolve_editor_url, + self.stop = async_to_raw_response_wrapper( + task_executions.stop, + ) + self.update_task_execution_status = async_to_raw_response_wrapper( + task_executions.update_task_execution_status, ) -class EditorsResourceWithStreamingResponse: - def __init__(self, editors: EditorsResource) -> None: - self._editors = editors +class TaskExecutionsResourceWithStreamingResponse: + def __init__(self, task_executions: TaskExecutionsResource) -> None: + self._task_executions = task_executions self.retrieve = to_streamed_response_wrapper( - editors.retrieve, + task_executions.retrieve, ) self.list = to_streamed_response_wrapper( - editors.list, + task_executions.list, + ) + self.stop = to_streamed_response_wrapper( + task_executions.stop, ) - self.resolve_editor_url = to_streamed_response_wrapper( - editors.resolve_editor_url, + self.update_task_execution_status = to_streamed_response_wrapper( + task_executions.update_task_execution_status, ) -class AsyncEditorsResourceWithStreamingResponse: - def __init__(self, editors: AsyncEditorsResource) -> None: - self._editors = editors +class AsyncTaskExecutionsResourceWithStreamingResponse: + def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: + self._task_executions = task_executions self.retrieve = async_to_streamed_response_wrapper( - editors.retrieve, + task_executions.retrieve, ) self.list = async_to_streamed_response_wrapper( - editors.list, + task_executions.list, + ) + self.stop = async_to_streamed_response_wrapper( + task_executions.stop, ) - self.resolve_editor_url = async_to_streamed_response_wrapper( - editors.resolve_editor_url, + self.update_task_execution_status = async_to_streamed_response_wrapper( + task_executions.update_task_execution_status, ) diff --git a/src/gitpod/resources/environments/automations/tasks.py b/src/gitpod/resources/environments/automations/tasks.py index b74c0a74..13345d51 100644 --- a/src/gitpod/resources/environments/automations/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks.py @@ -29,10 +29,12 @@ task_create_params, task_delete_params, task_update_params, + task_retrieve_params, ) from ....types.environments.automations.task_list_response import TaskListResponse from ....types.environments.automations.task_start_response import TaskStartResponse from ....types.environments.automations.task_create_response import TaskCreateResponse +from ....types.environments.automations.task_retrieve_response import TaskRetrieveResponse __all__ = ["TasksResource", "AsyncTasksResource"] @@ -115,6 +117,53 @@ def create( cast_to=TaskCreateResponse, ) + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskRetrieveResponse: + """ + GetTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/GetTask", + body=maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskRetrieveResponse, + ) + def update( self, *, @@ -408,6 +457,53 @@ async def create( cast_to=TaskCreateResponse, ) + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TaskRetrieveResponse: + """ + GetTask + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/GetTask", + body=await async_maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TaskRetrieveResponse, + ) + async def update( self, *, @@ -630,6 +726,9 @@ def __init__(self, tasks: TasksResource) -> None: self.create = to_raw_response_wrapper( tasks.create, ) + self.retrieve = to_raw_response_wrapper( + tasks.retrieve, + ) self.update = to_raw_response_wrapper( tasks.update, ) @@ -651,6 +750,9 @@ def __init__(self, tasks: AsyncTasksResource) -> None: self.create = async_to_raw_response_wrapper( tasks.create, ) + self.retrieve = async_to_raw_response_wrapper( + tasks.retrieve, + ) self.update = async_to_raw_response_wrapper( tasks.update, ) @@ -672,6 +774,9 @@ def __init__(self, tasks: TasksResource) -> None: self.create = to_streamed_response_wrapper( tasks.create, ) + self.retrieve = to_streamed_response_wrapper( + tasks.retrieve, + ) self.update = to_streamed_response_wrapper( tasks.update, ) @@ -693,6 +798,9 @@ def __init__(self, tasks: AsyncTasksResource) -> None: self.create = async_to_streamed_response_wrapper( tasks.create, ) + self.retrieve = async_to_streamed_response_wrapper( + tasks.retrieve, + ) self.update = async_to_streamed_response_wrapper( tasks.update, ) diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 6b744c75..0bf75063 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -89,6 +89,7 @@ def create( connect_protocol_version: Define the version of the Connect protocol spec: EnvironmentSpec specifies the configuration of an environment for an environment + start connect_timeout_ms: Define the timeout, in ms @@ -255,6 +256,7 @@ def create_from_project( connect_protocol_version: Define the version of the Connect protocol spec: EnvironmentSpec specifies the configuration of an environment for an environment + start connect_timeout_ms: Define the timeout, in ms @@ -306,8 +308,9 @@ def start( ) -> object: """StartEnvironment starts an environment. - This function is idempotent, i.e. if the - environment is already running no error is returned. + This function is idempotent, i.e. if + + the environment is already running no error is returned. Args: connect_protocol_version: Define the version of the Connect protocol @@ -387,6 +390,7 @@ async def create( connect_protocol_version: Define the version of the Connect protocol spec: EnvironmentSpec specifies the configuration of an environment for an environment + start connect_timeout_ms: Define the timeout, in ms @@ -553,6 +557,7 @@ async def create_from_project( connect_protocol_version: Define the version of the Connect protocol spec: EnvironmentSpec specifies the configuration of an environment for an environment + start connect_timeout_ms: Define the timeout, in ms @@ -604,8 +609,9 @@ async def start( ) -> object: """StartEnvironment starts an environment. - This function is idempotent, i.e. if the - environment is already running no error is returned. + This function is idempotent, i.e. if + + the environment is already running no error is returned. Args: connect_protocol_version: Define the version of the Connect protocol diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py deleted file mode 100644 index 1dd95ed9..00000000 --- a/src/gitpod/resources/identity.py +++ /dev/null @@ -1,435 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal - -import httpx - -from ..types import ( - identity_get_id_token_params, - identity_exchange_token_params, - identity_get_authenticated_identity_params, -) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options -from ..types.identity_get_id_token_response import IdentityGetIDTokenResponse -from ..types.identity_exchange_token_response import IdentityExchangeTokenResponse -from ..types.identity_get_authenticated_identity_response import IdentityGetAuthenticatedIdentityResponse - -__all__ = ["IdentityResource", "AsyncIdentityResource"] - - -class IdentityResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> IdentityResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return IdentityResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return IdentityResourceWithStreamingResponse(self) - - def exchange_token( - self, - *, - connect_protocol_version: Literal[1], - exchange_token: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IdentityExchangeTokenResponse: - """ - ExchangeToken trades an exchange token for a new access token. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - exchange_token: exchange_token is the token to exchange - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.IdentityService/ExchangeToken", - body=maybe_transform( - {"exchange_token": exchange_token}, identity_exchange_token_params.IdentityExchangeTokenParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=IdentityExchangeTokenResponse, - ) - - def get_authenticated_identity( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IdentityGetAuthenticatedIdentityResponse: - """ - GetAuthenticatedIdentity allows to retrieve the current identity. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=maybe_transform( - body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=IdentityGetAuthenticatedIdentityResponse, - ) - - def get_id_token( - self, - *, - connect_protocol_version: Literal[1], - audience: List[str] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IdentityGetIDTokenResponse: - """ - GetIDToken returns a token that can be used to authenticate the user against the - other services. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.IdentityService/GetIDToken", - body=maybe_transform({"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=IdentityGetIDTokenResponse, - ) - - -class AsyncIdentityResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncIdentityResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncIdentityResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncIdentityResourceWithStreamingResponse(self) - - async def exchange_token( - self, - *, - connect_protocol_version: Literal[1], - exchange_token: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IdentityExchangeTokenResponse: - """ - ExchangeToken trades an exchange token for a new access token. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - exchange_token: exchange_token is the token to exchange - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.IdentityService/ExchangeToken", - body=await async_maybe_transform( - {"exchange_token": exchange_token}, identity_exchange_token_params.IdentityExchangeTokenParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=IdentityExchangeTokenResponse, - ) - - async def get_authenticated_identity( - self, - *, - body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IdentityGetAuthenticatedIdentityResponse: - """ - GetAuthenticatedIdentity allows to retrieve the current identity. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=await async_maybe_transform( - body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=IdentityGetAuthenticatedIdentityResponse, - ) - - async def get_id_token( - self, - *, - connect_protocol_version: Literal[1], - audience: List[str] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IdentityGetIDTokenResponse: - """ - GetIDToken returns a token that can be used to authenticate the user against the - other services. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.IdentityService/GetIDToken", - body=await async_maybe_transform( - {"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=IdentityGetIDTokenResponse, - ) - - -class IdentityResourceWithRawResponse: - def __init__(self, identity: IdentityResource) -> None: - self._identity = identity - - self.exchange_token = to_raw_response_wrapper( - identity.exchange_token, - ) - self.get_authenticated_identity = to_raw_response_wrapper( - identity.get_authenticated_identity, - ) - self.get_id_token = to_raw_response_wrapper( - identity.get_id_token, - ) - - -class AsyncIdentityResourceWithRawResponse: - def __init__(self, identity: AsyncIdentityResource) -> None: - self._identity = identity - - self.exchange_token = async_to_raw_response_wrapper( - identity.exchange_token, - ) - self.get_authenticated_identity = async_to_raw_response_wrapper( - identity.get_authenticated_identity, - ) - self.get_id_token = async_to_raw_response_wrapper( - identity.get_id_token, - ) - - -class IdentityResourceWithStreamingResponse: - def __init__(self, identity: IdentityResource) -> None: - self._identity = identity - - self.exchange_token = to_streamed_response_wrapper( - identity.exchange_token, - ) - self.get_authenticated_identity = to_streamed_response_wrapper( - identity.get_authenticated_identity, - ) - self.get_id_token = to_streamed_response_wrapper( - identity.get_id_token, - ) - - -class AsyncIdentityResourceWithStreamingResponse: - def __init__(self, identity: AsyncIdentityResource) -> None: - self._identity = identity - - self.exchange_token = async_to_streamed_response_wrapper( - identity.exchange_token, - ) - self.get_authenticated_identity = async_to_streamed_response_wrapper( - identity.get_authenticated_identity, - ) - self.get_id_token = async_to_streamed_response_wrapper( - identity.get_id_token, - ) diff --git a/src/gitpod/resources/organizations/invite/summary.py b/src/gitpod/resources/organizations/invite/summary.py index de8a1ac2..d2f030a9 100644 --- a/src/gitpod/resources/organizations/invite/summary.py +++ b/src/gitpod/resources/organizations/invite/summary.py @@ -63,7 +63,9 @@ def retrieve( ) -> SummaryRetrieveResponse: """ GetOrganizationInviteSummary retrieves a summary of the organization based on an - Invite ID. Used to discover which organization an invite is for. + Invite ID. + + Used to discover which organization an invite is for. Args: connect_protocol_version: Define the version of the Connect protocol @@ -132,7 +134,9 @@ async def retrieve( ) -> SummaryRetrieveResponse: """ GetOrganizationInviteSummary retrieves a summary of the organization based on an - Invite ID. Used to discover which organization an invite is for. + Invite ID. + + Used to discover which organization an invite is for. Args: connect_protocol_version: Define the version of the Connect protocol diff --git a/src/gitpod/resources/projects.py b/src/gitpod/resources/projects.py index 42a6c691..686d3ca5 100644 --- a/src/gitpod/resources/projects.py +++ b/src/gitpod/resources/projects.py @@ -7,7 +7,11 @@ import httpx -from ..types import project_create_params, project_create_from_environment_params +from ..types import ( + project_create_params, + project_retrieve_params, + project_create_from_environment_params, +) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( is_given, @@ -25,6 +29,7 @@ ) from .._base_client import make_request_options from ..types.project_create_response import ProjectCreateResponse +from ..types.project_retrieve_response import ProjectRetrieveResponse from ..types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse __all__ = ["ProjectsResource", "AsyncProjectsResource"] @@ -126,6 +131,55 @@ def create( cast_to=ProjectCreateResponse, ) + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + project_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectRetrieveResponse: + """ + GetProject retrieves a single Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + project_id: project_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.ProjectService/GetProject", + body=maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectRetrieveResponse, + ) + def create_from_environment( self, *, @@ -279,6 +333,55 @@ async def create( cast_to=ProjectCreateResponse, ) + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + project_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectRetrieveResponse: + """ + GetProject retrieves a single Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + project_id: project_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.ProjectService/GetProject", + body=await async_maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectRetrieveResponse, + ) + async def create_from_environment( self, *, @@ -343,6 +446,9 @@ def __init__(self, projects: ProjectsResource) -> None: self.create = to_raw_response_wrapper( projects.create, ) + self.retrieve = to_raw_response_wrapper( + projects.retrieve, + ) self.create_from_environment = to_raw_response_wrapper( projects.create_from_environment, ) @@ -355,6 +461,9 @@ def __init__(self, projects: AsyncProjectsResource) -> None: self.create = async_to_raw_response_wrapper( projects.create, ) + self.retrieve = async_to_raw_response_wrapper( + projects.retrieve, + ) self.create_from_environment = async_to_raw_response_wrapper( projects.create_from_environment, ) @@ -367,6 +476,9 @@ def __init__(self, projects: ProjectsResource) -> None: self.create = to_streamed_response_wrapper( projects.create, ) + self.retrieve = to_streamed_response_wrapper( + projects.retrieve, + ) self.create_from_environment = to_streamed_response_wrapper( projects.create_from_environment, ) @@ -379,6 +491,9 @@ def __init__(self, projects: AsyncProjectsResource) -> None: self.create = async_to_streamed_response_wrapper( projects.create, ) + self.retrieve = async_to_streamed_response_wrapper( + projects.retrieve, + ) self.create_from_environment = async_to_streamed_response_wrapper( projects.create_from_environment, ) diff --git a/src/gitpod/resources/runner_configurations/configuration_schema.py b/src/gitpod/resources/runner_configurations/configuration_schema.py index b7579ba4..102168b8 100644 --- a/src/gitpod/resources/runner_configurations/configuration_schema.py +++ b/src/gitpod/resources/runner_configurations/configuration_schema.py @@ -22,8 +22,9 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.runner_configurations import configuration_schema_create_params +from ...types.runner_configurations import configuration_schema_create_params, configuration_schema_retrieve_params from ...types.runner_configurations.configuration_schema_create_response import ConfigurationSchemaCreateResponse +from ...types.runner_configurations.configuration_schema_retrieve_response import ConfigurationSchemaRetrieveResponse __all__ = ["ConfigurationSchemaResource", "AsyncConfigurationSchemaResource"] @@ -97,6 +98,55 @@ def create( cast_to=ConfigurationSchemaCreateResponse, ) + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigurationSchemaRetrieveResponse: + """ + GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + body=maybe_transform( + {"runner_id": runner_id}, configuration_schema_retrieve_params.ConfigurationSchemaRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ConfigurationSchemaRetrieveResponse, + ) + class AsyncConfigurationSchemaResource(AsyncAPIResource): @cached_property @@ -167,6 +217,55 @@ async def create( cast_to=ConfigurationSchemaCreateResponse, ) + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigurationSchemaRetrieveResponse: + """ + GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + body=await async_maybe_transform( + {"runner_id": runner_id}, configuration_schema_retrieve_params.ConfigurationSchemaRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ConfigurationSchemaRetrieveResponse, + ) + class ConfigurationSchemaResourceWithRawResponse: def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: @@ -175,6 +274,9 @@ def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: self.create = to_raw_response_wrapper( configuration_schema.create, ) + self.retrieve = to_raw_response_wrapper( + configuration_schema.retrieve, + ) class AsyncConfigurationSchemaResourceWithRawResponse: @@ -184,6 +286,9 @@ def __init__(self, configuration_schema: AsyncConfigurationSchemaResource) -> No self.create = async_to_raw_response_wrapper( configuration_schema.create, ) + self.retrieve = async_to_raw_response_wrapper( + configuration_schema.retrieve, + ) class ConfigurationSchemaResourceWithStreamingResponse: @@ -193,6 +298,9 @@ def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: self.create = to_streamed_response_wrapper( configuration_schema.create, ) + self.retrieve = to_streamed_response_wrapper( + configuration_schema.retrieve, + ) class AsyncConfigurationSchemaResourceWithStreamingResponse: @@ -202,3 +310,6 @@ def __init__(self, configuration_schema: AsyncConfigurationSchemaResource) -> No self.create = async_to_streamed_response_wrapper( configuration_schema.create, ) + self.retrieve = async_to_streamed_response_wrapper( + configuration_schema.retrieve, + ) diff --git a/src/gitpod/resources/runner_configurations/environment_classes.py b/src/gitpod/resources/runner_configurations/environment_classes.py index 1b078bdc..0a2bbb27 100644 --- a/src/gitpod/resources/runner_configurations/environment_classes.py +++ b/src/gitpod/resources/runner_configurations/environment_classes.py @@ -112,6 +112,7 @@ def list( ) -> EnvironmentClassListResponse: """ ListEnvironmentClasses returns all environment classes configured for a runner. + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: @@ -237,6 +238,7 @@ async def list( ) -> EnvironmentClassListResponse: """ ListEnvironmentClasses returns all environment classes configured for a runner. + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: diff --git a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py index d11201a5..43d226f4 100644 --- a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py @@ -27,11 +27,15 @@ host_authentication_token_create_params, host_authentication_token_delete_params, host_authentication_token_update_params, + host_authentication_token_retrieve_params, ) from ...types.runner_configurations.host_authentication_token_list_response import HostAuthenticationTokenListResponse from ...types.runner_configurations.host_authentication_token_create_response import ( HostAuthenticationTokenCreateResponse, ) +from ...types.runner_configurations.host_authentication_token_retrieve_response import ( + HostAuthenticationTokenRetrieveResponse, +) __all__ = ["HostAuthenticationTokensResource", "AsyncHostAuthenticationTokensResource"] @@ -105,6 +109,55 @@ def create( cast_to=HostAuthenticationTokenCreateResponse, ) + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HostAuthenticationTokenRetrieveResponse: + """ + GetHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + body=maybe_transform( + {"id": id}, host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HostAuthenticationTokenRetrieveResponse, + ) + def update( self, *, @@ -325,6 +378,55 @@ async def create( cast_to=HostAuthenticationTokenCreateResponse, ) + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HostAuthenticationTokenRetrieveResponse: + """ + GetHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + body=await async_maybe_transform( + {"id": id}, host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HostAuthenticationTokenRetrieveResponse, + ) + async def update( self, *, @@ -485,6 +587,9 @@ def __init__(self, host_authentication_tokens: HostAuthenticationTokensResource) self.create = to_raw_response_wrapper( host_authentication_tokens.create, ) + self.retrieve = to_raw_response_wrapper( + host_authentication_tokens.retrieve, + ) self.update = to_raw_response_wrapper( host_authentication_tokens.update, ) @@ -503,6 +608,9 @@ def __init__(self, host_authentication_tokens: AsyncHostAuthenticationTokensReso self.create = async_to_raw_response_wrapper( host_authentication_tokens.create, ) + self.retrieve = async_to_raw_response_wrapper( + host_authentication_tokens.retrieve, + ) self.update = async_to_raw_response_wrapper( host_authentication_tokens.update, ) @@ -521,6 +629,9 @@ def __init__(self, host_authentication_tokens: HostAuthenticationTokensResource) self.create = to_streamed_response_wrapper( host_authentication_tokens.create, ) + self.retrieve = to_streamed_response_wrapper( + host_authentication_tokens.retrieve, + ) self.update = to_streamed_response_wrapper( host_authentication_tokens.update, ) @@ -539,6 +650,9 @@ def __init__(self, host_authentication_tokens: AsyncHostAuthenticationTokensReso self.create = async_to_streamed_response_wrapper( host_authentication_tokens.create, ) + self.retrieve = async_to_streamed_response_wrapper( + host_authentication_tokens.retrieve, + ) self.update = async_to_streamed_response_wrapper( host_authentication_tokens.update, ) diff --git a/src/gitpod/resources/runner_configurations/runner_configurations.py b/src/gitpod/resources/runner_configurations/runner_configurations.py index 63b1bf96..92482d9b 100644 --- a/src/gitpod/resources/runner_configurations/runner_configurations.py +++ b/src/gitpod/resources/runner_configurations/runner_configurations.py @@ -112,7 +112,9 @@ def validate( """ValidateRunnerConfiguration validates a runner configuration (e.g. environment - class, SCM integration) with the runner. + class, SCM integration) + + with the runner. Args: connect_protocol_version: Define the version of the Connect protocol @@ -198,7 +200,9 @@ async def validate( """ValidateRunnerConfiguration validates a runner configuration (e.g. environment - class, SCM integration) with the runner. + class, SCM integration) + + with the runner. Args: connect_protocol_version: Define the version of the Connect protocol diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 16d0c4b2..d35f2d9b 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -9,6 +9,7 @@ from ...types import ( runner_list_params, runner_create_params, + runner_retrieve_params, runner_get_runner_params, runner_delete_runner_params, runner_update_runner_params, @@ -42,6 +43,7 @@ from ..._base_client import make_request_options from ...types.runner_list_response import RunnerListResponse from ...types.runner_create_response import RunnerCreateResponse +from ...types.runner_retrieve_response import RunnerRetrieveResponse from ...types.runner_get_runner_response import RunnerGetRunnerResponse from ...types.runner_parse_context_url_response import RunnerParseContextURLResponse from ...types.runner_create_runner_token_response import RunnerCreateRunnerTokenResponse @@ -95,6 +97,7 @@ def create( """CreateRunner creates a new runner with the server. Registrations are very + short-lived and must be renewed every 30 seconds. Runners can be registered for an entire organisation or a single user. @@ -140,6 +143,53 @@ def create( cast_to=RunnerCreateResponse, ) + def retrieve( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerRetrieveResponse: + """ + GetRunner returns a single runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/GetRunner", + body=maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerRetrieveResponse, + ) + def list( self, *, @@ -212,9 +262,10 @@ def check_authentication_for_host( ) -> RunnerCheckAuthenticationForHostResponse: """ CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. If not, this function will return a URL - that the user should visit to authenticate, or indicate that Personal Access - Tokens are supported. + particular host, e.g. an SCM system. + + If not, this function will return a URL that the user should visit to + authenticate, or indicate that Personal Access Tokens are supported. Args: connect_protocol_version: Define the version of the Connect protocol @@ -266,10 +317,10 @@ def create_runner_token( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateRunnerTokenResponse: - """CreateRunnerToken returns a token that can be used to authenticate as the - runner. + """ + CreateRunnerToken returns a token that can be used to authenticate as the - Use this call to renew an outdated token - this does not expire any + runner. Use this call to renew an outdated token - this does not expire any previouly issued tokens. Args: @@ -569,6 +620,7 @@ async def create( """CreateRunner creates a new runner with the server. Registrations are very + short-lived and must be renewed every 30 seconds. Runners can be registered for an entire organisation or a single user. @@ -614,6 +666,53 @@ async def create( cast_to=RunnerCreateResponse, ) + async def retrieve( + self, + *, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerRetrieveResponse: + """ + GetRunner returns a single runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/GetRunner", + body=await async_maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerRetrieveResponse, + ) + async def list( self, *, @@ -686,9 +785,10 @@ async def check_authentication_for_host( ) -> RunnerCheckAuthenticationForHostResponse: """ CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. If not, this function will return a URL - that the user should visit to authenticate, or indicate that Personal Access - Tokens are supported. + particular host, e.g. an SCM system. + + If not, this function will return a URL that the user should visit to + authenticate, or indicate that Personal Access Tokens are supported. Args: connect_protocol_version: Define the version of the Connect protocol @@ -740,10 +840,10 @@ async def create_runner_token( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateRunnerTokenResponse: - """CreateRunnerToken returns a token that can be used to authenticate as the - runner. + """ + CreateRunnerToken returns a token that can be used to authenticate as the - Use this call to renew an outdated token - this does not expire any + runner. Use this call to renew an outdated token - this does not expire any previouly issued tokens. Args: @@ -1005,6 +1105,9 @@ def __init__(self, runners: RunnersResource) -> None: self.create = to_raw_response_wrapper( runners.create, ) + self.retrieve = to_raw_response_wrapper( + runners.retrieve, + ) self.list = to_raw_response_wrapper( runners.list, ) @@ -1039,6 +1142,9 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.create = async_to_raw_response_wrapper( runners.create, ) + self.retrieve = async_to_raw_response_wrapper( + runners.retrieve, + ) self.list = async_to_raw_response_wrapper( runners.list, ) @@ -1073,6 +1179,9 @@ def __init__(self, runners: RunnersResource) -> None: self.create = to_streamed_response_wrapper( runners.create, ) + self.retrieve = to_streamed_response_wrapper( + runners.retrieve, + ) self.list = to_streamed_response_wrapper( runners.list, ) @@ -1107,6 +1216,9 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.create = async_to_streamed_response_wrapper( runners.create, ) + self.retrieve = async_to_streamed_response_wrapper( + runners.retrieve, + ) self.list = async_to_streamed_response_wrapper( runners.list, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index f082231e..26e3f716 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -2,43 +2,35 @@ from __future__ import annotations -from .editor_list_params import EditorListParams as EditorListParams from .runner_list_params import RunnerListParams as RunnerListParams -from .editor_list_response import EditorListResponse as EditorListResponse from .runner_create_params import RunnerCreateParams as RunnerCreateParams from .runner_list_response import RunnerListResponse as RunnerListResponse from .project_create_params import ProjectCreateParams as ProjectCreateParams -from .editor_retrieve_params import EditorRetrieveParams as EditorRetrieveParams from .runner_create_response import RunnerCreateResponse as RunnerCreateResponse +from .runner_retrieve_params import RunnerRetrieveParams as RunnerRetrieveParams from .environment_list_params import EnvironmentListParams as EnvironmentListParams from .project_create_response import ProjectCreateResponse as ProjectCreateResponse -from .editor_retrieve_response import EditorRetrieveResponse as EditorRetrieveResponse +from .project_retrieve_params import ProjectRetrieveParams as ProjectRetrieveParams from .environment_start_params import EnvironmentStartParams as EnvironmentStartParams from .runner_get_runner_params import RunnerGetRunnerParams as RunnerGetRunnerParams +from .runner_retrieve_response import RunnerRetrieveResponse as RunnerRetrieveResponse from .environment_create_params import EnvironmentCreateParams as EnvironmentCreateParams from .environment_list_response import EnvironmentListResponse as EnvironmentListResponse from .organization_leave_params import OrganizationLeaveParams as OrganizationLeaveParams +from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse from .runner_get_runner_response import RunnerGetRunnerResponse as RunnerGetRunnerResponse from .environment_create_response import EnvironmentCreateResponse as EnvironmentCreateResponse from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams from .runner_delete_runner_params import RunnerDeleteRunnerParams as RunnerDeleteRunnerParams from .runner_update_runner_params import RunnerUpdateRunnerParams as RunnerUpdateRunnerParams -from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse -from .automations_file_upsert_params import AutomationsFileUpsertParams as AutomationsFileUpsertParams -from .identity_exchange_token_params import IdentityExchangeTokenParams as IdentityExchangeTokenParams -from .identity_get_id_token_response import IdentityGetIDTokenResponse as IdentityGetIDTokenResponse from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams -from .automations_file_upsert_response import AutomationsFileUpsertResponse as AutomationsFileUpsertResponse -from .editor_resolve_editor_url_params import EditorResolveEditorURLParams as EditorResolveEditorURLParams -from .identity_exchange_token_response import IdentityExchangeTokenResponse as IdentityExchangeTokenResponse from .personal_access_token_list_params import PersonalAccessTokenListParams as PersonalAccessTokenListParams from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse -from .editor_resolve_editor_url_response import EditorResolveEditorURLResponse as EditorResolveEditorURLResponse from .personal_access_token_delete_params import PersonalAccessTokenDeleteParams as PersonalAccessTokenDeleteParams from .personal_access_token_list_response import PersonalAccessTokenListResponse as PersonalAccessTokenListResponse from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse @@ -58,15 +50,9 @@ from .project_create_from_environment_response import ( ProjectCreateFromEnvironmentResponse as ProjectCreateFromEnvironmentResponse, ) -from .identity_get_authenticated_identity_params import ( - IdentityGetAuthenticatedIdentityParams as IdentityGetAuthenticatedIdentityParams, -) from .runner_check_authentication_for_host_params import ( RunnerCheckAuthenticationForHostParams as RunnerCheckAuthenticationForHostParams, ) -from .identity_get_authenticated_identity_response import ( - IdentityGetAuthenticatedIdentityResponse as IdentityGetAuthenticatedIdentityResponse, -) from .runner_check_authentication_for_host_response import ( RunnerCheckAuthenticationForHostResponse as RunnerCheckAuthenticationForHostResponse, ) diff --git a/src/gitpod/types/editor_list_params.py b/src/gitpod/types/editor_list_params.py deleted file mode 100644 index 610436cf..00000000 --- a/src/gitpod/types/editor_list_params.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["EditorListParams", "Pagination"] - - -class EditorListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - pagination: Pagination - """pagination contains the pagination options for listing environments""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Pagination(TypedDict, total=False): - token: str - """ - Token for the next set of results that was returned as next_token of a - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/editor_list_response.py b/src/gitpod/types/editor_list_response.py deleted file mode 100644 index 683f2a26..00000000 --- a/src/gitpod/types/editor_list_response.py +++ /dev/null @@ -1,45 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["EditorListResponse", "Editor", "Pagination"] - - -class Editor(BaseModel): - id: Optional[str] = None - - icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) - - installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) - - name: Optional[str] = None - - short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) - - url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) - - -class Pagination(BaseModel): - token: Optional[str] = None - """ - Token for the next set of results that was returned as next_token of a - PaginationResponse - """ - - page_size: Optional[int] = FieldInfo(alias="pageSize", default=None) - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ - - -class EditorListResponse(BaseModel): - editors: Optional[List[Editor]] = None - """editors contains the list of editors""" - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/editor_resolve_editor_url_params.py b/src/gitpod/types/editor_resolve_editor_url_params.py deleted file mode 100644 index 633fa6fd..00000000 --- a/src/gitpod/types/editor_resolve_editor_url_params.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["EditorResolveEditorURLParams"] - - -class EditorResolveEditorURLParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - editor_id: Annotated[str, PropertyInfo(alias="editorId")] - """editorId is the ID of the editor to resolve the URL for""" - - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - """environmentId is the ID of the environment to resolve the URL for""" - - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organizationId is the ID of the organization to resolve the URL for""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/editor_resolve_editor_url_response.py b/src/gitpod/types/editor_resolve_editor_url_response.py deleted file mode 100644 index 68e452be..00000000 --- a/src/gitpod/types/editor_resolve_editor_url_response.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel - -__all__ = ["EditorResolveEditorURLResponse"] - - -class EditorResolveEditorURLResponse(BaseModel): - url: Optional[str] = None - """url is the resolved editor URL""" diff --git a/src/gitpod/types/editor_retrieve_response.py b/src/gitpod/types/editor_retrieve_response.py deleted file mode 100644 index 774b3d09..00000000 --- a/src/gitpod/types/editor_retrieve_response.py +++ /dev/null @@ -1,28 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["EditorRetrieveResponse", "Editor"] - - -class Editor(BaseModel): - id: Optional[str] = None - - icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) - - installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) - - name: Optional[str] = None - - short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) - - url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) - - -class EditorRetrieveResponse(BaseModel): - editor: Optional[Editor] = None - """editor contains the editor""" diff --git a/src/gitpod/types/environment_class_list_params.py b/src/gitpod/types/environment_class_list_params.py index 3e562591..3c2c3a7b 100644 --- a/src/gitpod/types/environment_class_list_params.py +++ b/src/gitpod/types/environment_class_list_params.py @@ -25,8 +25,8 @@ class EnvironmentClassListParams(TypedDict, total=False): class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/environment_class_list_response.py b/src/gitpod/types/environment_class_list_response.py index 0bec0318..d90c6349 100644 --- a/src/gitpod/types/environment_class_list_response.py +++ b/src/gitpod/types/environment_class_list_response.py @@ -29,9 +29,9 @@ class EnvironmentClass(BaseModel): """display_name is the human readable name of the environment class""" enabled: Optional[bool] = None - """ - enabled indicates whether the environment class can be used to create new - environments. + """enabled indicates whether the environment class can be used to create + + new environments. """ runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) @@ -43,9 +43,9 @@ class EnvironmentClass(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index c3319113..4a26e700 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union, Iterable +from typing import Iterable from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -30,8 +30,8 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False): project_id: Annotated[str, PropertyInfo(alias="projectId")] spec: Spec - """ - EnvironmentSpec specifies the configuration of an environment for an environment + """EnvironmentSpec specifies the configuration of an environment for an environment + start """ @@ -43,8 +43,9 @@ class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): + environment, + + relative to the repo root. path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') @@ -226,7 +227,7 @@ class Spec(TypedDict, total=False): secrets: Iterable[SpecSecret] """secrets are confidential data that is mounted into the environment""" - spec_version: Annotated[Union[int, str], PropertyInfo(alias="specVersion")] + spec_version: Annotated[str, PropertyInfo(alias="specVersion")] """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index 233bb62b..c15fc515 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -61,14 +61,14 @@ class EnvironmentMetadataCreator(BaseModel): class EnvironmentMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. + """annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -162,8 +162,8 @@ class EnvironmentMetadata(BaseModel): """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -260,8 +260,8 @@ class EnvironmentMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was + """original_context_url is the normalized URL from which the environment was + created """ @@ -279,8 +279,9 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): + environment, + + relative to the repo root. path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') @@ -459,7 +460,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -476,15 +477,15 @@ class EnvironmentSpec(BaseModel): class EnvironmentStatusActivitySignal(BaseModel): source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity + """source of the activity signal, such as "VS Code", "SSH", or "Automations". + + It should be a human-readable string that describes the source of the activity signal. """ timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -591,8 +592,8 @@ class EnvironmentStatusAutomationsFile(BaseModel): """ failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """ - failure_message contains the reason the automations file failed to be applied. + """failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. """ @@ -641,8 +642,8 @@ class EnvironmentStatusContentGit(BaseModel): changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( alias="changedFiles", default=None ) - """ - changed_files is an array of changed files in the environment, possibly + """changed_files is an array of changed files in the environment, possibly + truncated """ @@ -661,8 +662,8 @@ class EnvironmentStatusContentGit(BaseModel): """the total number of unpushed changes""" unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """ - unpushed_commits is an array of unpushed changes in the environment, possibly + """unpushed_commits is an array of unpushed changes in the environment, possibly + truncated """ @@ -816,9 +817,9 @@ class EnvironmentStatusMachine(BaseModel): """session is the session that is currently active in the machine.""" timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. + """timeout contains the reason the environment has timed out. If this field is - If this field is empty, the environment has not timed out. + empty, the environment has not timed out. """ versions: Optional[EnvironmentStatusMachineVersions] = None @@ -834,7 +835,7 @@ class EnvironmentStatusMachine(BaseModel): class EnvironmentStatusRunnerAck(BaseModel): message: Optional[str] = None - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) status_code: Optional[ Literal[ @@ -904,16 +905,18 @@ class EnvironmentStatus(BaseModel): """devcontainer contains the status of the devcontainer.""" environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. + """environment_url contains the URL at which the environment can be accessed. + + This field is only set if the environment is running. """ failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the environment failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty + + the environment has failed to operate and will likely transition to a stopped + state. """ machine: Optional[EnvironmentStatusMachine] = None @@ -932,14 +935,14 @@ class EnvironmentStatus(BaseModel): "ENVIRONMENT_PHASE_DELETED", ] ] = None - """ - the phase of an environment is a simple, high-level summary of where the + """the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle """ runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """ - RunnerACK is the acknowledgement from the runner that is has received the + """RunnerACK is the acknowledgement from the runner that is has received the + environment spec. """ @@ -949,7 +952,7 @@ class EnvironmentStatus(BaseModel): ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys contains the status of the environment ssh public keys""" - status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """version of the status update. Environment instances themselves are unversioned, but their status has different @@ -967,21 +970,20 @@ class EnvironmentStatus(BaseModel): class Environment(BaseModel): id: Optional[str] = None - """ID is a unique identifier of this environment. + """ID is a unique identifier of this environment. No other environment with the - No other environment with the same name must be managed by this environment - manager + same name must be managed by this environment manager """ metadata: Optional[EnvironmentMetadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for + """EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function """ spec: Optional[EnvironmentSpec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment + """EnvironmentSpec specifies the configuration of an environment for an environment + start """ diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index ceb052e3..068e97bc 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union, Iterable +from typing import Iterable from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -28,8 +28,8 @@ class EnvironmentCreateParams(TypedDict, total=False): """Define the version of the Connect protocol""" spec: Spec - """ - EnvironmentSpec specifies the configuration of an environment for an environment + """EnvironmentSpec specifies the configuration of an environment for an environment + start """ @@ -41,8 +41,9 @@ class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): + environment, + + relative to the repo root. path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') @@ -224,7 +225,7 @@ class Spec(TypedDict, total=False): secrets: Iterable[SpecSecret] """secrets are confidential data that is mounted into the environment""" - spec_version: Annotated[Union[int, str], PropertyInfo(alias="specVersion")] + spec_version: Annotated[str, PropertyInfo(alias="specVersion")] """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index a2f8df56..6b9ce0cc 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -61,14 +61,14 @@ class EnvironmentMetadataCreator(BaseModel): class EnvironmentMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. + """annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -162,8 +162,8 @@ class EnvironmentMetadata(BaseModel): """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -260,8 +260,8 @@ class EnvironmentMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was + """original_context_url is the normalized URL from which the environment was + created """ @@ -279,8 +279,9 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): + environment, + + relative to the repo root. path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') @@ -459,7 +460,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -476,15 +477,15 @@ class EnvironmentSpec(BaseModel): class EnvironmentStatusActivitySignal(BaseModel): source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity + """source of the activity signal, such as "VS Code", "SSH", or "Automations". + + It should be a human-readable string that describes the source of the activity signal. """ timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -591,8 +592,8 @@ class EnvironmentStatusAutomationsFile(BaseModel): """ failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """ - failure_message contains the reason the automations file failed to be applied. + """failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. """ @@ -641,8 +642,8 @@ class EnvironmentStatusContentGit(BaseModel): changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( alias="changedFiles", default=None ) - """ - changed_files is an array of changed files in the environment, possibly + """changed_files is an array of changed files in the environment, possibly + truncated """ @@ -661,8 +662,8 @@ class EnvironmentStatusContentGit(BaseModel): """the total number of unpushed changes""" unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """ - unpushed_commits is an array of unpushed changes in the environment, possibly + """unpushed_commits is an array of unpushed changes in the environment, possibly + truncated """ @@ -816,9 +817,9 @@ class EnvironmentStatusMachine(BaseModel): """session is the session that is currently active in the machine.""" timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. + """timeout contains the reason the environment has timed out. If this field is - If this field is empty, the environment has not timed out. + empty, the environment has not timed out. """ versions: Optional[EnvironmentStatusMachineVersions] = None @@ -834,7 +835,7 @@ class EnvironmentStatusMachine(BaseModel): class EnvironmentStatusRunnerAck(BaseModel): message: Optional[str] = None - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) status_code: Optional[ Literal[ @@ -904,16 +905,18 @@ class EnvironmentStatus(BaseModel): """devcontainer contains the status of the devcontainer.""" environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. + """environment_url contains the URL at which the environment can be accessed. + + This field is only set if the environment is running. """ failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the environment failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty + + the environment has failed to operate and will likely transition to a stopped + state. """ machine: Optional[EnvironmentStatusMachine] = None @@ -932,14 +935,14 @@ class EnvironmentStatus(BaseModel): "ENVIRONMENT_PHASE_DELETED", ] ] = None - """ - the phase of an environment is a simple, high-level summary of where the + """the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle """ runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """ - RunnerACK is the acknowledgement from the runner that is has received the + """RunnerACK is the acknowledgement from the runner that is has received the + environment spec. """ @@ -949,7 +952,7 @@ class EnvironmentStatus(BaseModel): ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys contains the status of the environment ssh public keys""" - status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """version of the status update. Environment instances themselves are unversioned, but their status has different @@ -967,21 +970,20 @@ class EnvironmentStatus(BaseModel): class Environment(BaseModel): id: Optional[str] = None - """ID is a unique identifier of this environment. + """ID is a unique identifier of this environment. No other environment with the - No other environment with the same name must be managed by this environment - manager + same name must be managed by this environment manager """ metadata: Optional[EnvironmentMetadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for + """EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function """ spec: Optional[EnvironmentSpec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment + """EnvironmentSpec specifies the configuration of an environment for an environment + start """ diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index d0f5b6eb..69fc3b4d 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -81,8 +81,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py index 1e363180..a0571591 100644 --- a/src/gitpod/types/environment_list_response.py +++ b/src/gitpod/types/environment_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -62,14 +62,14 @@ class EnvironmentMetadataCreator(BaseModel): class EnvironmentMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. + """annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -163,8 +163,8 @@ class EnvironmentMetadata(BaseModel): """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -261,8 +261,8 @@ class EnvironmentMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was + """original_context_url is the normalized URL from which the environment was + created """ @@ -280,8 +280,9 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): + environment, + + relative to the repo root. path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') @@ -460,7 +461,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -477,15 +478,15 @@ class EnvironmentSpec(BaseModel): class EnvironmentStatusActivitySignal(BaseModel): source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity + """source of the activity signal, such as "VS Code", "SSH", or "Automations". + + It should be a human-readable string that describes the source of the activity signal. """ timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -592,8 +593,8 @@ class EnvironmentStatusAutomationsFile(BaseModel): """ failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """ - failure_message contains the reason the automations file failed to be applied. + """failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. """ @@ -642,8 +643,8 @@ class EnvironmentStatusContentGit(BaseModel): changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( alias="changedFiles", default=None ) - """ - changed_files is an array of changed files in the environment, possibly + """changed_files is an array of changed files in the environment, possibly + truncated """ @@ -662,8 +663,8 @@ class EnvironmentStatusContentGit(BaseModel): """the total number of unpushed changes""" unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """ - unpushed_commits is an array of unpushed changes in the environment, possibly + """unpushed_commits is an array of unpushed changes in the environment, possibly + truncated """ @@ -817,9 +818,9 @@ class EnvironmentStatusMachine(BaseModel): """session is the session that is currently active in the machine.""" timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. + """timeout contains the reason the environment has timed out. If this field is - If this field is empty, the environment has not timed out. + empty, the environment has not timed out. """ versions: Optional[EnvironmentStatusMachineVersions] = None @@ -835,7 +836,7 @@ class EnvironmentStatusMachine(BaseModel): class EnvironmentStatusRunnerAck(BaseModel): message: Optional[str] = None - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) status_code: Optional[ Literal[ @@ -905,16 +906,18 @@ class EnvironmentStatus(BaseModel): """devcontainer contains the status of the devcontainer.""" environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. + """environment_url contains the URL at which the environment can be accessed. + + This field is only set if the environment is running. """ failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the environment failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty + + the environment has failed to operate and will likely transition to a stopped + state. """ machine: Optional[EnvironmentStatusMachine] = None @@ -933,14 +936,14 @@ class EnvironmentStatus(BaseModel): "ENVIRONMENT_PHASE_DELETED", ] ] = None - """ - the phase of an environment is a simple, high-level summary of where the + """the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle """ runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """ - RunnerACK is the acknowledgement from the runner that is has received the + """RunnerACK is the acknowledgement from the runner that is has received the + environment spec. """ @@ -950,7 +953,7 @@ class EnvironmentStatus(BaseModel): ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys contains the status of the environment ssh public keys""" - status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """version of the status update. Environment instances themselves are unversioned, but their status has different @@ -968,21 +971,20 @@ class EnvironmentStatus(BaseModel): class Environment(BaseModel): id: Optional[str] = None - """ID is a unique identifier of this environment. + """ID is a unique identifier of this environment. No other environment with the - No other environment with the same name must be managed by this environment - manager + same name must be managed by this environment manager """ metadata: Optional[EnvironmentMetadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for + """EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function """ spec: Optional[EnvironmentSpec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment + """EnvironmentSpec specifies the configuration of an environment for an environment + start """ @@ -992,9 +994,9 @@ class Environment(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index 6806cc5e..343f1a2c 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -61,14 +61,14 @@ class EnvironmentMetadataCreator(BaseModel): class EnvironmentMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. + """annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -162,8 +162,8 @@ class EnvironmentMetadata(BaseModel): """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -260,8 +260,8 @@ class EnvironmentMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was + """original_context_url is the normalized URL from which the environment was + created """ @@ -279,8 +279,9 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): + environment, + + relative to the repo root. path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') @@ -459,7 +460,7 @@ class EnvironmentSpec(BaseModel): secrets: Optional[List[EnvironmentSpecSecret]] = None """secrets are confidential data that is mounted into the environment""" - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -476,15 +477,15 @@ class EnvironmentSpec(BaseModel): class EnvironmentStatusActivitySignal(BaseModel): source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity + """source of the activity signal, such as "VS Code", "SSH", or "Automations". + + It should be a human-readable string that describes the source of the activity signal. """ timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -591,8 +592,8 @@ class EnvironmentStatusAutomationsFile(BaseModel): """ failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """ - failure_message contains the reason the automations file failed to be applied. + """failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. """ @@ -641,8 +642,8 @@ class EnvironmentStatusContentGit(BaseModel): changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( alias="changedFiles", default=None ) - """ - changed_files is an array of changed files in the environment, possibly + """changed_files is an array of changed files in the environment, possibly + truncated """ @@ -661,8 +662,8 @@ class EnvironmentStatusContentGit(BaseModel): """the total number of unpushed changes""" unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """ - unpushed_commits is an array of unpushed changes in the environment, possibly + """unpushed_commits is an array of unpushed changes in the environment, possibly + truncated """ @@ -816,9 +817,9 @@ class EnvironmentStatusMachine(BaseModel): """session is the session that is currently active in the machine.""" timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. + """timeout contains the reason the environment has timed out. If this field is - If this field is empty, the environment has not timed out. + empty, the environment has not timed out. """ versions: Optional[EnvironmentStatusMachineVersions] = None @@ -834,7 +835,7 @@ class EnvironmentStatusMachine(BaseModel): class EnvironmentStatusRunnerAck(BaseModel): message: Optional[str] = None - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) status_code: Optional[ Literal[ @@ -904,16 +905,18 @@ class EnvironmentStatus(BaseModel): """devcontainer contains the status of the devcontainer.""" environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. + """environment_url contains the URL at which the environment can be accessed. + + This field is only set if the environment is running. """ failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the environment failed to operate. - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. + If this is non-empty + + the environment has failed to operate and will likely transition to a stopped + state. """ machine: Optional[EnvironmentStatusMachine] = None @@ -932,14 +935,14 @@ class EnvironmentStatus(BaseModel): "ENVIRONMENT_PHASE_DELETED", ] ] = None - """ - the phase of an environment is a simple, high-level summary of where the + """the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle """ runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """ - RunnerACK is the acknowledgement from the runner that is has received the + """RunnerACK is the acknowledgement from the runner that is has received the + environment spec. """ @@ -949,7 +952,7 @@ class EnvironmentStatus(BaseModel): ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys contains the status of the environment ssh public keys""" - status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """version of the status update. Environment instances themselves are unversioned, but their status has different @@ -967,21 +970,20 @@ class EnvironmentStatus(BaseModel): class Environment(BaseModel): id: Optional[str] = None - """ID is a unique identifier of this environment. + """ID is a unique identifier of this environment. No other environment with the - No other environment with the same name must be managed by this environment - manager + same name must be managed by this environment manager """ metadata: Optional[EnvironmentMetadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for + """EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function """ spec: Optional[EnvironmentSpec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment + """EnvironmentSpec specifies the configuration of an environment for an environment + start """ diff --git a/src/gitpod/types/environments/__init__.py b/src/gitpod/types/environments/__init__.py index f8ee8b14..ec2c91ca 100644 --- a/src/gitpod/types/environments/__init__.py +++ b/src/gitpod/types/environments/__init__.py @@ -1,3 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations + +from .automation_upsert_params import AutomationUpsertParams as AutomationUpsertParams +from .automation_upsert_response import AutomationUpsertResponse as AutomationUpsertResponse diff --git a/src/gitpod/types/automations_file_upsert_params.py b/src/gitpod/types/environments/automation_upsert_params.py similarity index 69% rename from src/gitpod/types/automations_file_upsert_params.py rename to src/gitpod/types/environments/automation_upsert_params.py index af2ad035..afd240ee 100644 --- a/src/gitpod/types/automations_file_upsert_params.py +++ b/src/gitpod/types/environments/automation_upsert_params.py @@ -5,10 +5,10 @@ from typing import Dict, List, Union from typing_extensions import Literal, Required, Annotated, TypedDict -from .._utils import PropertyInfo +from ..._utils import PropertyInfo __all__ = [ - "AutomationsFileUpsertParams", + "AutomationUpsertParams", "AutomationsFile", "AutomationsFileServices", "AutomationsFileServicesCommands", @@ -16,16 +16,18 @@ ] -class AutomationsFileUpsertParams(TypedDict, total=False): +class AutomationUpsertParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" automations_file: Annotated[AutomationsFile, PropertyInfo(alias="automationsFile")] """ WARN: Do not remove any field here, as it will break reading automation yaml - files. We error if there are any unknown fields in the yaml (to ensure the yaml - is correct), but would break if we removed any fields. This includes marking a - field as "reserved" in the proto file, this will also break reading the yaml. + files. We error if there are any + + unknown fields in the yaml (to ensure the yaml is correct), but would break if + we removed any fields. This includes marking a field as "reserved" in the proto + file, this will also break reading the yaml. """ environment_id: Annotated[str, PropertyInfo(alias="environmentId")] @@ -38,8 +40,10 @@ class AutomationsFileServicesCommands(TypedDict, total=False): ready: str """ ready is an optional command that is run repeatedly until it exits with a zero - exit code. If set, the service will first go into a Starting phase, and then - into a Running phase once the ready command exits with a zero exit code. + exit code. + + If set, the service will first go into a Starting phase, and then into a Running + phase once the ready command exits with a zero exit code. """ start: str @@ -54,13 +58,14 @@ class AutomationsFileServicesCommands(TypedDict, total=False): """ stop: str - """ - stop is an optional command that runs when the service is requested to stop. If - set, instead of sending a SIGTERM signal to the start command, the stop command - will be run. Once the stop command exits, the start command will receive a - SIGKILL signal. If the stop command exits with a non-zero exit code, the service - will transition to the Failed phase. If the stop command does not exit within 2 - minutes, a SIGKILL signal will be sent to both the start and stop commands. + """stop is an optional command that runs when the service is requested to stop. + + If set, instead of sending a SIGTERM signal to the start command, the stop + command will be run. Once the stop command exits, the start command will receive + a SIGKILL signal. If the stop command exits with a non-zero exit code, the + service will transition to the Failed phase. If the stop command does not exit + within 2 minutes, a SIGKILL signal will be sent to both the start and stop + commands. """ diff --git a/src/gitpod/types/automations_file_upsert_response.py b/src/gitpod/types/environments/automation_upsert_response.py similarity index 74% rename from src/gitpod/types/automations_file_upsert_response.py rename to src/gitpod/types/environments/automation_upsert_response.py index dad78447..f01ae1be 100644 --- a/src/gitpod/types/automations_file_upsert_response.py +++ b/src/gitpod/types/environments/automation_upsert_response.py @@ -4,12 +4,12 @@ from pydantic import Field as FieldInfo -from .._models import BaseModel +from ..._models import BaseModel -__all__ = ["AutomationsFileUpsertResponse"] +__all__ = ["AutomationUpsertResponse"] -class AutomationsFileUpsertResponse(BaseModel): +class AutomationUpsertResponse(BaseModel): updated_service_ids: Optional[List[str]] = FieldInfo(alias="updatedServiceIds", default=None) updated_task_ids: Optional[List[str]] = FieldInfo(alias="updatedTaskIds", default=None) diff --git a/src/gitpod/types/environments/automations/__init__.py b/src/gitpod/types/environments/automations/__init__.py index ee7c957c..b6f6483d 100644 --- a/src/gitpod/types/environments/automations/__init__.py +++ b/src/gitpod/types/environments/automations/__init__.py @@ -13,6 +13,16 @@ from .task_start_response import TaskStartResponse as TaskStartResponse from .service_start_params import ServiceStartParams as ServiceStartParams from .task_create_response import TaskCreateResponse as TaskCreateResponse +from .task_retrieve_params import TaskRetrieveParams as TaskRetrieveParams from .service_delete_params import ServiceDeleteParams as ServiceDeleteParams from .service_list_response import ServiceListResponse as ServiceListResponse from .service_update_params import ServiceUpdateParams as ServiceUpdateParams +from .task_retrieve_response import TaskRetrieveResponse as TaskRetrieveResponse +from .task_execution_list_params import TaskExecutionListParams as TaskExecutionListParams +from .task_execution_stop_params import TaskExecutionStopParams as TaskExecutionStopParams +from .task_execution_list_response import TaskExecutionListResponse as TaskExecutionListResponse +from .task_execution_retrieve_params import TaskExecutionRetrieveParams as TaskExecutionRetrieveParams +from .task_execution_retrieve_response import TaskExecutionRetrieveResponse as TaskExecutionRetrieveResponse +from .task_execution_update_task_execution_status_params import ( + TaskExecutionUpdateTaskExecutionStatusParams as TaskExecutionUpdateTaskExecutionStatusParams, +) diff --git a/src/gitpod/types/environments/automations/service_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py index 40ddeee9..2866c3f6 100644 --- a/src/gitpod/types/environments/automations/service_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -37,8 +37,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/environments/automations/service_list_response.py b/src/gitpod/types/environments/automations/service_list_response.py index 52ddbe1e..d63169f4 100644 --- a/src/gitpod/types/environments/automations/service_list_response.py +++ b/src/gitpod/types/environments/automations/service_list_response.py @@ -23,9 +23,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ @@ -52,8 +52,8 @@ class ServiceMetadataTriggeredBy: class ServiceMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -156,14 +156,18 @@ class ServiceMetadata(BaseModel): """name is a user-facing name for the service. Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the service. + system. + + This is a short descriptive name for the service. """ reference: Optional[str] = None """ reference is a user-facing identifier for the service which must be unique on - the environment. It is used to express dependencies between services, and to - identify the service in user interactions (e.g. the CLI). + the environment. + + It is used to express dependencies between services, and to identify the service + in user interactions (e.g. the CLI). """ triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) @@ -174,8 +178,10 @@ class ServiceSpecCommands(BaseModel): ready: Optional[str] = None """ ready is an optional command that is run repeatedly until it exits with a zero - exit code. If set, the service will first go into a Starting phase, and then - into a Running phase once the ready command exits with a zero exit code. + exit code. + + If set, the service will first go into a Starting phase, and then into a Running + phase once the ready command exits with a zero exit code. """ start: Optional[str] = None @@ -190,13 +196,14 @@ class ServiceSpecCommands(BaseModel): """ stop: Optional[str] = None - """ - stop is an optional command that runs when the service is requested to stop. If - set, instead of sending a SIGTERM signal to the start command, the stop command - will be run. Once the stop command exits, the start command will receive a - SIGKILL signal. If the stop command exits with a non-zero exit code, the service - will transition to the Failed phase. If the stop command does not exit within 2 - minutes, a SIGKILL signal will be sent to both the start and stop commands. + """stop is an optional command that runs when the service is requested to stop. + + If set, instead of sending a SIGTERM signal to the start command, the stop + command will be run. Once the stop command exits, the start command will receive + a SIGKILL signal. If the stop command exits with a non-zero exit code, the + service will transition to the Failed phase. If the stop command does not exit + within 2 minutes, a SIGKILL signal will be sent to both the start and stop + commands. """ @@ -229,10 +236,12 @@ class ServiceSpec(BaseModel): session: Optional[str] = None """session should be changed to trigger a restart of the service. - If a service exits it will not be restarted until the session is changed. + If a service exits it will + + not be restarted until the session is changed. """ - spec_version: Union[int, str, None] = FieldInfo(alias="specVersion", default=None) + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) """version of the spec. The value of this field has no semantic meaning (e.g. don't interpret it as as a @@ -245,8 +254,9 @@ class ServiceStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the service failed to operate. - If this is non-empty the service has failed to operate and will likely - transition to a failed state. + If this is non-empty + + the service has failed to operate and will likely transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) @@ -268,7 +278,7 @@ class ServiceStatus(BaseModel): session: Optional[str] = None """session is the current session of the service.""" - status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """version of the status update. Service instances themselves are unversioned, but their status has different diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index 623a0640..6cad65fa 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -18,17 +18,19 @@ class ServiceUpdateParams(TypedDict, total=False): metadata: Metadata spec: Spec - """Changing the spec of a service is a complex operation. + """Changing the spec of a service is a complex operation. The spec of a service - The spec of a service can only be updated if the service is in a stopped state. - If the service is running, it must be stopped first. + can only be updated if the service is in a stopped state. If the service is + running, it must be stopped first. """ status: Status """Service status updates are only expected from the executing environment. - As a client of this API you are not expected to provide this field. Updating - this field requires the `environmentservice:update_status` permission. + As a client + + of this API you are not expected to provide this field. Updating this field + requires the `environmentservice:update_status` permission. """ connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index d45c4d9c..487041fe 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -48,8 +48,8 @@ class MetadataTriggeredBy: class Metadata(TypedDict, total=False): created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -152,14 +152,18 @@ class Metadata(TypedDict, total=False): """name is a user-facing name for the task. Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the task. + system. + + This is a short descriptive name for the task. """ reference: str """ reference is a user-facing identifier for the task which must be unique on the - environment. It is used to express dependencies between tasks, and to identify - the task in user interactions (e.g. the CLI). + environment. + + It is used to express dependencies between tasks, and to identify the task in + user interactions (e.g. the CLI). """ triggered_by: Annotated[Iterable[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index fa0f55e7..1c7b59b7 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -34,8 +34,8 @@ class TaskMetadataTriggeredBy: class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -138,14 +138,18 @@ class TaskMetadata(BaseModel): """name is a user-facing name for the task. Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the task. + system. + + This is a short descriptive name for the task. """ reference: Optional[str] = None """ reference is a user-facing identifier for the task which must be unique on the - environment. It is used to express dependencies between tasks, and to identify - the task in user interactions (e.g. the CLI). + environment. + + It is used to express dependencies between tasks, and to identify the task in + user interactions (e.g. the CLI). """ triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) diff --git a/src/gitpod/types/environments/automations/task_execution_list_params.py b/src/gitpod/types/environments/automations/task_execution_list_params.py new file mode 100644 index 00000000..78c3e7ba --- /dev/null +++ b/src/gitpod/types/environments/automations/task_execution_list_params.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["TaskExecutionListParams", "Filter", "Pagination"] + + +class TaskExecutionListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + filter: Filter + """filter contains the filter options for listing task runs""" + + pagination: Pagination + """pagination contains the pagination options for listing task runs""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only task runs of these environments""" + + phases: List[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] + """phases filters the response to only task runs in these phases""" + + task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] + """task_ids filters the response to only task runs of these tasks""" + + task_references: Annotated[List[str], PropertyInfo(alias="taskReferences")] + """task_references filters the response to only task runs with this reference""" + + +class Pagination(TypedDict, total=False): + token: str + """Token for the next set of results that was returned as next_token of a + + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environments/automations/task_execution_list_response.py b/src/gitpod/types/environments/automations/task_execution_list_response.py new file mode 100644 index 00000000..4995f69f --- /dev/null +++ b/src/gitpod/types/environments/automations/task_execution_list_response.py @@ -0,0 +1,458 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "TaskExecutionListResponse", + "Pagination", + "TaskExecution", + "TaskExecutionMetadata", + "TaskExecutionMetadataCreator", + "TaskExecutionSpec", + "TaskExecutionSpecPlan", + "TaskExecutionSpecPlanStep", + "TaskExecutionStatus", + "TaskExecutionStatusStep", +] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class TaskExecutionMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskExecutionMetadata(BaseModel): + completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskExecutionMetadataCreator] = None + """creator describes the principal who created/started the task run.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """environment_id is the ID of the environment in which the task run is executed.""" + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) + """started_by describes the trigger that started the task execution.""" + + task_id: Optional[str] = FieldInfo(alias="taskId", default=None) + """task_id is the ID of the main task being executed.""" + + +class TaskExecutionSpecPlanStep: + pass + + +class TaskExecutionSpecPlan(BaseModel): + steps: Optional[List[TaskExecutionSpecPlanStep]] = None + + +class TaskExecutionSpec(BaseModel): + desired_phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the task execution should be in. + + Used to stop a running task execution early. + """ + + plan: Optional[List[TaskExecutionSpecPlan]] = None + """plan is a list of groups of steps. + + The steps in a group are executed concurrently, while the groups are executed + sequentially. + + The order of the groups is the order in which they are executed. + """ + + +class TaskExecutionStatusStep(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the step failed to operate. If this is non-empty + + the step has failed to operate and will likely transition to a failed state. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """phase is the current phase of the execution step""" + + +class TaskExecutionStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the task execution failed to operate. + + If this is non-empty + + the task execution has failed to operate and will likely transition to a failed + state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url is the URL to the logs of the task's steps. + + If this is empty, the task either has no logs + + or has not yet started. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """the phase of a task execution represents the aggregated phase of all steps.""" + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Task executions themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. + """ + + steps: Optional[List[TaskExecutionStatusStep]] = None + """steps provides the status for each individual step of the task execution. + + If a step is missing it + + has not yet started. + """ + + +class TaskExecution(BaseModel): + id: Optional[str] = None + + metadata: Optional[TaskExecutionMetadata] = None + + spec: Optional[TaskExecutionSpec] = None + + status: Optional[TaskExecutionStatus] = None + + +class TaskExecutionListResponse(BaseModel): + pagination: Optional[Pagination] = None + + task_executions: Optional[List[TaskExecution]] = FieldInfo(alias="taskExecutions", default=None) diff --git a/src/gitpod/types/identity_get_id_token_params.py b/src/gitpod/types/environments/automations/task_execution_retrieve_params.py similarity index 73% rename from src/gitpod/types/identity_get_id_token_params.py rename to src/gitpod/types/environments/automations/task_execution_retrieve_params.py index 7291a3b6..b13b311d 100644 --- a/src/gitpod/types/identity_get_id_token_params.py +++ b/src/gitpod/types/environments/automations/task_execution_retrieve_params.py @@ -2,19 +2,18 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict -from .._utils import PropertyInfo +from ...._utils import PropertyInfo -__all__ = ["IdentityGetIDTokenParams"] +__all__ = ["TaskExecutionRetrieveParams"] -class IdentityGetIDTokenParams(TypedDict, total=False): +class TaskExecutionRetrieveParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - audience: List[str] + id: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_retrieve_response.py b/src/gitpod/types/environments/automations/task_execution_retrieve_response.py new file mode 100644 index 00000000..79bd6e48 --- /dev/null +++ b/src/gitpod/types/environments/automations/task_execution_retrieve_response.py @@ -0,0 +1,447 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "TaskExecutionRetrieveResponse", + "TaskExecution", + "TaskExecutionMetadata", + "TaskExecutionMetadataCreator", + "TaskExecutionSpec", + "TaskExecutionSpecPlan", + "TaskExecutionSpecPlanStep", + "TaskExecutionStatus", + "TaskExecutionStatusStep", +] + + +class TaskExecutionMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskExecutionMetadata(BaseModel): + completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskExecutionMetadataCreator] = None + """creator describes the principal who created/started the task run.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """environment_id is the ID of the environment in which the task run is executed.""" + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) + """started_by describes the trigger that started the task execution.""" + + task_id: Optional[str] = FieldInfo(alias="taskId", default=None) + """task_id is the ID of the main task being executed.""" + + +class TaskExecutionSpecPlanStep: + pass + + +class TaskExecutionSpecPlan(BaseModel): + steps: Optional[List[TaskExecutionSpecPlanStep]] = None + + +class TaskExecutionSpec(BaseModel): + desired_phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the task execution should be in. + + Used to stop a running task execution early. + """ + + plan: Optional[List[TaskExecutionSpecPlan]] = None + """plan is a list of groups of steps. + + The steps in a group are executed concurrently, while the groups are executed + sequentially. + + The order of the groups is the order in which they are executed. + """ + + +class TaskExecutionStatusStep(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the step failed to operate. If this is non-empty + + the step has failed to operate and will likely transition to a failed state. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """phase is the current phase of the execution step""" + + +class TaskExecutionStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the task execution failed to operate. + + If this is non-empty + + the task execution has failed to operate and will likely transition to a failed + state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url is the URL to the logs of the task's steps. + + If this is empty, the task either has no logs + + or has not yet started. + """ + + phase: Optional[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] = None + """the phase of a task execution represents the aggregated phase of all steps.""" + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Task executions themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. + """ + + steps: Optional[List[TaskExecutionStatusStep]] = None + """steps provides the status for each individual step of the task execution. + + If a step is missing it + + has not yet started. + """ + + +class TaskExecution(BaseModel): + id: Optional[str] = None + + metadata: Optional[TaskExecutionMetadata] = None + + spec: Optional[TaskExecutionSpec] = None + + status: Optional[TaskExecutionStatus] = None + + +class TaskExecutionRetrieveResponse(BaseModel): + task_execution: Optional[TaskExecution] = FieldInfo(alias="taskExecution", default=None) diff --git a/src/gitpod/types/identity_get_authenticated_identity_params.py b/src/gitpod/types/environments/automations/task_execution_stop_params.py similarity index 72% rename from src/gitpod/types/identity_get_authenticated_identity_params.py rename to src/gitpod/types/environments/automations/task_execution_stop_params.py index 457fe1f9..eeb7a922 100644 --- a/src/gitpod/types/identity_get_authenticated_identity_params.py +++ b/src/gitpod/types/environments/automations/task_execution_stop_params.py @@ -4,16 +4,16 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from .._utils import PropertyInfo +from ...._utils import PropertyInfo -__all__ = ["IdentityGetAuthenticatedIdentityParams"] +__all__ = ["TaskExecutionStopParams"] -class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False): - body: Required[object] - +class TaskExecutionStopParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + id: str + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py b/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py new file mode 100644 index 00000000..1d098837 --- /dev/null +++ b/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["TaskExecutionUpdateTaskExecutionStatusParams", "Body"] + + +class TaskExecutionUpdateTaskExecutionStatusParams(TypedDict, total=False): + body: Required[Body] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Body: + pass diff --git a/src/gitpod/types/environments/automations/task_list_params.py b/src/gitpod/types/environments/automations/task_list_params.py index e44966c5..763a6dfd 100644 --- a/src/gitpod/types/environments/automations/task_list_params.py +++ b/src/gitpod/types/environments/automations/task_list_params.py @@ -37,8 +37,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/environments/automations/task_list_response.py b/src/gitpod/types/environments/automations/task_list_response.py index 742b3c55..fc9945a4 100644 --- a/src/gitpod/types/environments/automations/task_list_response.py +++ b/src/gitpod/types/environments/automations/task_list_response.py @@ -21,9 +21,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ @@ -50,8 +50,8 @@ class TaskMetadataTriggeredBy: class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -154,14 +154,18 @@ class TaskMetadata(BaseModel): """name is a user-facing name for the task. Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the task. + system. + + This is a short descriptive name for the task. """ reference: Optional[str] = None """ reference is a user-facing identifier for the task which must be unique on the - environment. It is used to express dependencies between tasks, and to identify - the task in user interactions (e.g. the CLI). + environment. + + It is used to express dependencies between tasks, and to identify the task in + user interactions (e.g. the CLI). """ triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) diff --git a/src/gitpod/types/environments/automations/task_retrieve_params.py b/src/gitpod/types/environments/automations/task_retrieve_params.py new file mode 100644 index 00000000..b0d4d35b --- /dev/null +++ b/src/gitpod/types/environments/automations/task_retrieve_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["TaskRetrieveParams"] + + +class TaskRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py new file mode 100644 index 00000000..324e1e05 --- /dev/null +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -0,0 +1,181 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["TaskRetrieveResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", "TaskSpec"] + + +class TaskMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class TaskMetadataTriggeredBy: + pass + + +class TaskMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[TaskMetadataCreator] = None + """creator describes the principal who created the task.""" + + description: Optional[str] = None + """description is a user-facing description for the task. + + It can be used to provide context and documentation for the task. + """ + + name: Optional[str] = None + """name is a user-facing name for the task. + + Unlike the reference, this field is not unique, and not referenced by the + system. + + This is a short descriptive name for the task. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the task which must be unique on the + environment. + + It is used to express dependencies between tasks, and to identify the task in + user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the task.""" + + +class TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class Task(BaseModel): + id: Optional[str] = None + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + """dependencies specifies the IDs of the automations this task depends on.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[TaskMetadata] = None + + spec: Optional[TaskSpec] = None + + +class TaskRetrieveResponse(BaseModel): + task: Optional[Task] = None diff --git a/src/gitpod/types/environments/automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py index 4e4e9dff..59a79a85 100644 --- a/src/gitpod/types/environments/automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -40,8 +40,8 @@ class TaskExecutionMetadataCreator(BaseModel): class TaskExecutionMetadata(BaseModel): completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -132,8 +132,8 @@ class TaskExecutionMetadata(BaseModel): """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -230,8 +230,8 @@ class TaskExecutionMetadata(BaseModel): """environment_id is the ID of the environment in which the task run is executed.""" started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -356,7 +356,9 @@ class TaskExecutionSpec(BaseModel): """plan is a list of groups of steps. The steps in a group are executed concurrently, while the groups are executed - sequentially. The order of the groups is the order in which they are executed. + sequentially. + + The order of the groups is the order in which they are executed. """ @@ -365,10 +367,9 @@ class TaskExecutionStatusStep(BaseModel): """ID is the ID of the execution step""" failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. + """failure_message summarises why the step failed to operate. If this is non-empty - If this is non-empty the step has failed to operate and will likely transition - to a failed state. + the step has failed to operate and will likely transition to a failed state. """ phase: Optional[ @@ -388,14 +389,18 @@ class TaskExecutionStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the task execution failed to operate. - If this is non-empty the task execution has failed to operate and will likely - transition to a failed state. + If this is non-empty + + the task execution has failed to operate and will likely transition to a failed + state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) """log_url is the URL to the logs of the task's steps. - If this is empty, the task either has no logs or has not yet started. + If this is empty, the task either has no logs + + or has not yet started. """ phase: Optional[ @@ -410,7 +415,7 @@ class TaskExecutionStatus(BaseModel): ] = None """the phase of a task execution represents the aggregated phase of all steps.""" - status_version: Union[int, str, None] = FieldInfo(alias="statusVersion", default=None) + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """version of the status update. Task executions themselves are unversioned, but their status has different @@ -422,7 +427,9 @@ class TaskExecutionStatus(BaseModel): steps: Optional[List[TaskExecutionStatusStep]] = None """steps provides the status for each individual step of the task execution. - If a step is missing it has not yet started. + If a step is missing it + + has not yet started. """ diff --git a/src/gitpod/types/identity_exchange_token_response.py b/src/gitpod/types/identity_exchange_token_response.py deleted file mode 100644 index c101adb6..00000000 --- a/src/gitpod/types/identity_exchange_token_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["IdentityExchangeTokenResponse"] - - -class IdentityExchangeTokenResponse(BaseModel): - access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) - """access_token is the new access token""" diff --git a/src/gitpod/types/identity_get_authenticated_identity_response.py b/src/gitpod/types/identity_get_authenticated_identity_response.py deleted file mode 100644 index fb9635ba..00000000 --- a/src/gitpod/types/identity_get_authenticated_identity_response.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["IdentityGetAuthenticatedIdentityResponse", "Subject"] - - -class Subject(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class IdentityGetAuthenticatedIdentityResponse(BaseModel): - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - - subject: Optional[Subject] = None - """subject is the identity of the current user""" diff --git a/src/gitpod/types/identity_get_id_token_response.py b/src/gitpod/types/identity_get_id_token_response.py deleted file mode 100644 index e327e686..00000000 --- a/src/gitpod/types/identity_get_id_token_response.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel - -__all__ = ["IdentityGetIDTokenResponse"] - - -class IdentityGetIDTokenResponse(BaseModel): - token: Optional[str] = None diff --git a/src/gitpod/types/organizations/invite_create_response.py b/src/gitpod/types/organizations/invite_create_response.py index fb0cbbae..f277e670 100644 --- a/src/gitpod/types/organizations/invite_create_response.py +++ b/src/gitpod/types/organizations/invite_create_response.py @@ -11,9 +11,9 @@ class Invite(BaseModel): invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) - """ - invite_id is the unique identifier of the invite to join the organization. Use - JoinOrganization with this ID to join the organization. + """invite_id is the unique identifier of the invite to join the organization. + + Use JoinOrganization with this ID to join the organization. """ diff --git a/src/gitpod/types/organizations/invite_retrieve_response.py b/src/gitpod/types/organizations/invite_retrieve_response.py index ea2cbb09..1b2a121b 100644 --- a/src/gitpod/types/organizations/invite_retrieve_response.py +++ b/src/gitpod/types/organizations/invite_retrieve_response.py @@ -11,9 +11,9 @@ class Invite(BaseModel): invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) - """ - invite_id is the unique identifier of the invite to join the organization. Use - JoinOrganization with this ID to join the organization. + """invite_id is the unique identifier of the invite to join the organization. + + Use JoinOrganization with this ID to join the organization. """ diff --git a/src/gitpod/types/organizations/member_list_params.py b/src/gitpod/types/organizations/member_list_params.py index 958c7159..943327aa 100644 --- a/src/gitpod/types/organizations/member_list_params.py +++ b/src/gitpod/types/organizations/member_list_params.py @@ -25,8 +25,8 @@ class MemberListParams(TypedDict, total=False): class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/organizations/member_list_response.py b/src/gitpod/types/organizations/member_list_response.py index 85ae8a9d..f615f04b 100644 --- a/src/gitpod/types/organizations/member_list_response.py +++ b/src/gitpod/types/organizations/member_list_response.py @@ -22,8 +22,8 @@ class Member(BaseModel): """login_provider is the login provider the user uses to sign in""" member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -126,9 +126,9 @@ class Member(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ diff --git a/src/gitpod/types/personal_access_token_list_params.py b/src/gitpod/types/personal_access_token_list_params.py index 9a5d90d1..2cca5162 100644 --- a/src/gitpod/types/personal_access_token_list_params.py +++ b/src/gitpod/types/personal_access_token_list_params.py @@ -32,8 +32,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/personal_access_token_list_response.py b/src/gitpod/types/personal_access_token_list_response.py index e8e845d1..4b755efb 100644 --- a/src/gitpod/types/personal_access_token_list_response.py +++ b/src/gitpod/types/personal_access_token_list_response.py @@ -13,9 +13,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ @@ -40,8 +40,8 @@ class PersonalAccessToken(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -136,8 +136,8 @@ class PersonalAccessToken(BaseModel): description: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -228,8 +228,8 @@ class PersonalAccessToken(BaseModel): """ last_used: Optional[datetime] = FieldInfo(alias="lastUsed", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py index 6a9e0ca7..989a3856 100644 --- a/src/gitpod/types/project_create_from_environment_response.py +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -47,8 +47,8 @@ class ProjectMetadataCreator(BaseModel): class ProjectMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -148,8 +148,8 @@ class ProjectMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py index 2ca765f0..805963c2 100644 --- a/src/gitpod/types/project_create_response.py +++ b/src/gitpod/types/project_create_response.py @@ -47,8 +47,8 @@ class ProjectMetadataCreator(BaseModel): class ProjectMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -148,8 +148,8 @@ class ProjectMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/identity_exchange_token_params.py b/src/gitpod/types/project_retrieve_params.py similarity index 69% rename from src/gitpod/types/identity_exchange_token_params.py rename to src/gitpod/types/project_retrieve_params.py index bb8becb3..42abf44b 100644 --- a/src/gitpod/types/identity_exchange_token_params.py +++ b/src/gitpod/types/project_retrieve_params.py @@ -6,15 +6,15 @@ from .._utils import PropertyInfo -__all__ = ["IdentityExchangeTokenParams"] +__all__ = ["ProjectRetrieveParams"] -class IdentityExchangeTokenParams(TypedDict, total=False): +class ProjectRetrieveParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - exchange_token: Annotated[str, PropertyInfo(alias="exchangeToken")] - """exchange_token is the token to exchange""" + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py new file mode 100644 index 00000000..20c86c6d --- /dev/null +++ b/src/gitpod/types/project_retrieve_response.py @@ -0,0 +1,298 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ProjectRetrieveResponse", + "Project", + "ProjectInitializer", + "ProjectInitializerSpec", + "ProjectMetadata", + "ProjectMetadataCreator", + "ProjectUsedBy", + "ProjectUsedBySubject", +] + + +class ProjectInitializerSpec: + pass + + +class ProjectInitializer(BaseModel): + specs: Optional[List[ProjectInitializerSpec]] = None + + +class ProjectMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ProjectMetadataCreator] = None + """creator is the identity of the project creator""" + + name: Optional[str] = None + """name is the human readable name of the project""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class ProjectUsedBySubject(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectUsedBy(BaseModel): + subjects: Optional[List[ProjectUsedBySubject]] = None + """ + Subjects are the 10 most recent subjects who have used the project to create an + environment + """ + + total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) + """Total number of unique subjects who have used the project""" + + +class Project(BaseModel): + environment_class: Union[object, object, object] = FieldInfo(alias="environmentClass") + + id: Optional[str] = None + """id is the unique identifier for the project""" + + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + initializer: Optional[ProjectInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + metadata: Optional[ProjectMetadata] = None + + used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) + + +class ProjectRetrieveResponse(BaseModel): + project: Optional[Project] = None diff --git a/src/gitpod/types/runner_configurations/__init__.py b/src/gitpod/types/runner_configurations/__init__.py index 8e730de9..bab7e5ce 100644 --- a/src/gitpod/types/runner_configurations/__init__.py +++ b/src/gitpod/types/runner_configurations/__init__.py @@ -9,9 +9,13 @@ from .scm_integration_create_response import ScmIntegrationCreateResponse as ScmIntegrationCreateResponse from .configuration_schema_create_params import ConfigurationSchemaCreateParams as ConfigurationSchemaCreateParams from .configuration_schema_create_response import ConfigurationSchemaCreateResponse as ConfigurationSchemaCreateResponse +from .configuration_schema_retrieve_params import ConfigurationSchemaRetrieveParams as ConfigurationSchemaRetrieveParams from .host_authentication_token_list_params import ( HostAuthenticationTokenListParams as HostAuthenticationTokenListParams, ) +from .configuration_schema_retrieve_response import ( + ConfigurationSchemaRetrieveResponse as ConfigurationSchemaRetrieveResponse, +) from .host_authentication_token_create_params import ( HostAuthenticationTokenCreateParams as HostAuthenticationTokenCreateParams, ) @@ -27,3 +31,9 @@ from .host_authentication_token_create_response import ( HostAuthenticationTokenCreateResponse as HostAuthenticationTokenCreateResponse, ) +from .host_authentication_token_retrieve_params import ( + HostAuthenticationTokenRetrieveParams as HostAuthenticationTokenRetrieveParams, +) +from .host_authentication_token_retrieve_response import ( + HostAuthenticationTokenRetrieveResponse as HostAuthenticationTokenRetrieveResponse, +) diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py new file mode 100644 index 00000000..d8ca6699 --- /dev/null +++ b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ConfigurationSchemaRetrieveParams"] + + +class ConfigurationSchemaRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py new file mode 100644 index 00000000..ac96d70f --- /dev/null +++ b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = [ + "ConfigurationSchemaRetrieveResponse", + "Schema", + "SchemaEnvironmentClass", + "SchemaRunnerConfig", + "SchemaScm", + "SchemaScmOAuth", + "SchemaScmPat", +] + + +class SchemaEnvironmentClass: + pass + + +class SchemaRunnerConfig: + pass + + +class SchemaScmOAuth(BaseModel): + callback_url: Optional[str] = FieldInfo(alias="callbackUrl", default=None) + """ + callback_url is the URL the OAuth app will redirect to after the user has + authenticated. + """ + + +class SchemaScmPat(BaseModel): + description: Optional[str] = None + """description is a human-readable description of the PAT.""" + + docs_link: Optional[str] = FieldInfo(alias="docsLink", default=None) + """ + docs_link is a link to the documentation on how to create a PAT for this SCM + system. + """ + + +class SchemaScm(BaseModel): + default_hosts: Optional[List[str]] = FieldInfo(alias="defaultHosts", default=None) + + name: Optional[str] = None + + oauth: Optional[SchemaScmOAuth] = None + + pat: Optional[SchemaScmPat] = None + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + + +class Schema(BaseModel): + environment_classes: Optional[List[SchemaEnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) + + runner_config: Optional[List[SchemaRunnerConfig]] = FieldInfo(alias="runnerConfig", default=None) + + scm: Optional[List[SchemaScm]] = None + + version: Optional[str] = None + """The schema version""" + + +class ConfigurationSchemaRetrieveResponse(BaseModel): + schema_: Optional[Schema] = FieldInfo(alias="schema", default=None) diff --git a/src/gitpod/types/runner_configurations/environment_class_list_params.py b/src/gitpod/types/runner_configurations/environment_class_list_params.py index 28f92ab7..c31f0770 100644 --- a/src/gitpod/types/runner_configurations/environment_class_list_params.py +++ b/src/gitpod/types/runner_configurations/environment_class_list_params.py @@ -25,8 +25,8 @@ class EnvironmentClassListParams(TypedDict, total=False): class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/runner_configurations/environment_class_list_response.py b/src/gitpod/types/runner_configurations/environment_class_list_response.py index 68e5d17f..43a1b685 100644 --- a/src/gitpod/types/runner_configurations/environment_class_list_response.py +++ b/src/gitpod/types/runner_configurations/environment_class_list_response.py @@ -29,9 +29,9 @@ class EnvironmentClass(BaseModel): """display_name is the human readable name of the environment class""" enabled: Optional[bool] = None - """ - enabled indicates whether the environment class can be used to create new - environments. + """enabled indicates whether the environment class can be used to create + + new environments. """ runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) @@ -43,9 +43,9 @@ class EnvironmentClass(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py b/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py index 0ddfb651..490adf7a 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py @@ -15,8 +15,8 @@ class Token(BaseModel): id: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py index e8141dc5..907435a0 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py @@ -27,8 +27,8 @@ class Filter: class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py index 3347a5e9..7be80fe0 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py @@ -13,9 +13,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ @@ -23,8 +23,8 @@ class Token(BaseModel): id: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py new file mode 100644 index 00000000..82d07586 --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["HostAuthenticationTokenRetrieveParams"] + + +class HostAuthenticationTokenRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py new file mode 100644 index 00000000..b0f7be16 --- /dev/null +++ b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py @@ -0,0 +1,125 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HostAuthenticationTokenRetrieveResponse", "Token"] + + +class Token(BaseModel): + id: Optional[str] = None + + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + host: Optional[str] = None + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + source: Optional[ + Literal[ + "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", + ] + ] = None + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + + +class HostAuthenticationTokenRetrieveResponse(BaseModel): + token: Optional[Token] = None diff --git a/src/gitpod/types/runner_create_response.py b/src/gitpod/types/runner_create_response.py index 46747b0b..0a2e92bf 100644 --- a/src/gitpod/types/runner_create_response.py +++ b/src/gitpod/types/runner_create_response.py @@ -116,8 +116,8 @@ class RunnerStatus(BaseModel): system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -212,8 +212,8 @@ class RunnerStatus(BaseModel): class Runner(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -323,8 +323,8 @@ class Runner(BaseModel): """RunnerStatus represents the status of a runner""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runner_get_runner_response.py b/src/gitpod/types/runner_get_runner_response.py index b03fcf18..cda7e27b 100644 --- a/src/gitpod/types/runner_get_runner_response.py +++ b/src/gitpod/types/runner_get_runner_response.py @@ -116,8 +116,8 @@ class RunnerStatus(BaseModel): system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -212,8 +212,8 @@ class RunnerStatus(BaseModel): class Runner(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -323,8 +323,8 @@ class Runner(BaseModel): """RunnerStatus represents the status of a runner""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py index e6b35d23..4155c49d 100644 --- a/src/gitpod/types/runner_list_params.py +++ b/src/gitpod/types/runner_list_params.py @@ -35,8 +35,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/runner_list_response.py b/src/gitpod/types/runner_list_response.py index 66f0ce79..2c0da5a1 100644 --- a/src/gitpod/types/runner_list_response.py +++ b/src/gitpod/types/runner_list_response.py @@ -22,9 +22,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ @@ -125,8 +125,8 @@ class RunnerStatus(BaseModel): system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -221,8 +221,8 @@ class RunnerStatus(BaseModel): class Runner(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -332,8 +332,8 @@ class Runner(BaseModel): """RunnerStatus represents the status of a runner""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local + """A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/editor_retrieve_params.py b/src/gitpod/types/runner_retrieve_params.py similarity index 77% rename from src/gitpod/types/editor_retrieve_params.py rename to src/gitpod/types/runner_retrieve_params.py index a0a1e574..786b07dd 100644 --- a/src/gitpod/types/editor_retrieve_params.py +++ b/src/gitpod/types/runner_retrieve_params.py @@ -6,15 +6,14 @@ from .._utils import PropertyInfo -__all__ = ["EditorRetrieveParams"] +__all__ = ["RunnerRetrieveParams"] -class EditorRetrieveParams(TypedDict, total=False): +class RunnerRetrieveParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - id: str - """id is the ID of the editor to get""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_retrieve_response.py b/src/gitpod/types/runner_retrieve_response.py new file mode 100644 index 00000000..b4ca023b --- /dev/null +++ b/src/gitpod/types/runner_retrieve_response.py @@ -0,0 +1,419 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "RunnerRetrieveResponse", + "Runner", + "RunnerCreator", + "RunnerSpec", + "RunnerSpecConfiguration", + "RunnerStatus", + "RunnerStatusAdditionalInfo", +] + + +class RunnerCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class RunnerSpecConfiguration(BaseModel): + auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) + """auto_update indicates whether the runner should automatically update itself.""" + + region: Optional[str] = None + """ + Region to deploy the runner in, if applicable. This is mainly used for remote + runners, and is only a hint. The runner may be deployed in a different region. + See the runner's status for the actual region. + """ + + release_channel: Optional[ + Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] + ] = FieldInfo(alias="releaseChannel", default=None) + """The release channel the runner is on""" + + +class RunnerSpec(BaseModel): + configuration: Optional[RunnerSpecConfiguration] = None + """The runner's configuration""" + + desired_phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """RunnerPhase represents the phase a runner is in""" + + +class RunnerStatusAdditionalInfo(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class RunnerStatus(BaseModel): + additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) + """additional_info contains additional information about the runner, e.g. + + a CloudFormation stack URL. + """ + + capabilities: Optional[ + List[Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"]] + ] = None + """capabilities is a list of capabilities the runner supports.""" + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + + message: Optional[str] = None + """ + The runner's reported message which is shown to users. This message adds more + context to the runner's phase. + """ + + phase: Optional[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ] + ] = None + """RunnerPhase represents the phase a runner is in""" + + region: Optional[str] = None + """region is the region the runner is running in, if applicable.""" + + system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + version: Optional[str] = None + + +class Runner(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[RunnerCreator] = None + """creator is the identity of the creator of the environment""" + + kind: Optional[ + Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] + ] = None + """RunnerKind represents the kind of a runner""" + + name: Optional[str] = None + """The runner's name which is shown to users""" + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + spec: Optional[RunnerSpec] = None + """The runner's specification""" + + status: Optional[RunnerStatus] = None + """RunnerStatus represents the status of a runner""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class RunnerRetrieveResponse(BaseModel): + runner: Optional[Runner] = None diff --git a/src/gitpod/types/runners/policy_list_params.py b/src/gitpod/types/runners/policy_list_params.py index f6945b88..af0ca922 100644 --- a/src/gitpod/types/runners/policy_list_params.py +++ b/src/gitpod/types/runners/policy_list_params.py @@ -25,8 +25,8 @@ class PolicyListParams(TypedDict, total=False): class Pagination(TypedDict, total=False): token: str - """ - Token for the next set of results that was returned as next_token of a + """Token for the next set of results that was returned as next_token of a + PaginationResponse """ diff --git a/src/gitpod/types/runners/policy_list_response.py b/src/gitpod/types/runners/policy_list_response.py index 730960cb..452fe18d 100644 --- a/src/gitpod/types/runners/policy_list_response.py +++ b/src/gitpod/types/runners/policy_list_response.py @@ -12,9 +12,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. + """Token passed for retreiving the next set of results. Empty if there are no - Empty if there are no more results + more results """ diff --git a/tests/api_resources/environments/automations/test_task_executions.py b/tests/api_resources/environments/automations/test_task_executions.py new file mode 100644 index 00000000..d3e7442e --- /dev/null +++ b/tests/api_resources/environments/automations/test_task_executions.py @@ -0,0 +1,393 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.environments.automations import ( + TaskExecutionListResponse, + TaskExecutionRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTaskExecutions: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.retrieve( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.environments.automations.task_executions.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.environments.automations.task_executions.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.list( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.list( + connect_protocol_version=1, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "task_references": ["string"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.environments.automations.task_executions.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.environments.automations.task_executions.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_stop(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_method_stop_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.stop( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_raw_response_stop(self, client: Gitpod) -> None: + response = client.environments.automations.task_executions.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_stop(self, client: Gitpod) -> None: + with client.environments.automations.task_executions.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_task_execution_status(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_method_update_task_execution_status_with_all_params(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.update_task_execution_status( + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failureMessage": "failureMessage", + "logUrl": "logUrl", + "steps": [ + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + } + ], + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_raw_response_update_task_execution_status(self, client: Gitpod) -> None: + response = client.environments.automations.task_executions.with_raw_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_update_task_execution_status(self, client: Gitpod) -> None: + with client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncTaskExecutions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environments.automations.task_executions.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environments.automations.task_executions.retrieve( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.task_executions.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.task_executions.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environments.automations.task_executions.list( + connect_protocol_version=1, + ) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environments.automations.task_executions.list( + connect_protocol_version=1, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "task_references": ["string"], + }, + pagination={ + "token": "token", + "page_size": 0, + }, + connect_timeout_ms=0, + ) + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.task_executions.with_raw_response.list( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.task_executions.with_streaming_response.list( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_stop(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environments.automations.task_executions.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environments.automations.task_executions.stop( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.task_executions.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.task_executions.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_method_update_task_execution_status_with_all_params(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failureMessage": "failureMessage", + "logUrl": "logUrl", + "steps": [ + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "failure_message": "failureMessage", + "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", + } + ], + }, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + response = ( + await async_client.environments.automations.task_executions.with_raw_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index bddf67f8..2c05eedd 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -14,6 +14,7 @@ TaskListResponse, TaskStartResponse, TaskCreateResponse, + TaskRetrieveResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -84,6 +85,46 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + task = client.environments.automations.tasks.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + task = client.environments.automations.tasks.retrieve( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.environments.automations.tasks.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.environments.automations.tasks.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_update(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( @@ -321,6 +362,46 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + task = await async_client.environments.automations.tasks.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + task = await async_client.environments.automations.tasks.retrieve( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.tasks.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.tasks.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( diff --git a/tests/api_resources/test_automations_files.py b/tests/api_resources/environments/test_automations.py similarity index 72% rename from tests/api_resources/test_automations_files.py rename to tests/api_resources/environments/test_automations.py index 7de778ab..2f6ccfe2 100644 --- a/tests/api_resources/test_automations_files.py +++ b/tests/api_resources/environments/test_automations.py @@ -9,24 +9,24 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import AutomationsFileUpsertResponse +from gitpod.types.environments import AutomationUpsertResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestAutomationsFiles: +class TestAutomations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_upsert(self, client: Gitpod) -> None: - automations_file = client.automations_files.upsert( + automation = client.environments.automations.upsert( connect_protocol_version=1, ) - assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize def test_method_upsert_with_all_params(self, client: Gitpod) -> None: - automations_file = client.automations_files.upsert( + automation = client.environments.automations.upsert( connect_protocol_version=1, automations_file={ "services": { @@ -56,46 +56,46 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize def test_raw_response_upsert(self, client: Gitpod) -> None: - response = client.automations_files.with_raw_response.upsert( + response = client.environments.automations.with_raw_response.upsert( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - automations_file = response.parse() - assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + automation = response.parse() + assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize def test_streaming_response_upsert(self, client: Gitpod) -> None: - with client.automations_files.with_streaming_response.upsert( + with client.environments.automations.with_streaming_response.upsert( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - automations_file = response.parse() - assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + automation = response.parse() + assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) assert cast(Any, response.is_closed) is True -class TestAsyncAutomationsFiles: +class TestAsyncAutomations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_upsert(self, async_client: AsyncGitpod) -> None: - automations_file = await async_client.automations_files.upsert( + automation = await async_client.environments.automations.upsert( connect_protocol_version=1, ) - assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: - automations_file = await async_client.automations_files.upsert( + automation = await async_client.environments.automations.upsert( connect_protocol_version=1, automations_file={ "services": { @@ -125,28 +125,28 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: - response = await async_client.automations_files.with_raw_response.upsert( + response = await async_client.environments.automations.with_raw_response.upsert( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - automations_file = await response.parse() - assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + automation = await response.parse() + assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: - async with async_client.automations_files.with_streaming_response.upsert( + async with async_client.environments.automations.with_streaming_response.upsert( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - automations_file = await response.parse() - assert_matches_type(AutomationsFileUpsertResponse, automations_file, path=["response"]) + automation = await response.parse() + assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/test_configuration_schema.py b/tests/api_resources/runner_configurations/test_configuration_schema.py index f9459506..c3ec0956 100644 --- a/tests/api_resources/runner_configurations/test_configuration_schema.py +++ b/tests/api_resources/runner_configurations/test_configuration_schema.py @@ -9,7 +9,10 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types.runner_configurations import ConfigurationSchemaCreateResponse +from gitpod.types.runner_configurations import ( + ConfigurationSchemaCreateResponse, + ConfigurationSchemaRetrieveResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -57,6 +60,46 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + configuration_schema = client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + configuration_schema = client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runner_configurations.configuration_schema.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + configuration_schema = response.parse() + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runner_configurations.configuration_schema.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + configuration_schema = response.parse() + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncConfigurationSchema: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -100,3 +143,43 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.configuration_schema.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + configuration_schema = await response.parse() + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.configuration_schema.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + configuration_schema = await response.parse() + assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py index 1f403169..03d373c9 100644 --- a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py @@ -13,6 +13,7 @@ from gitpod.types.runner_configurations import ( HostAuthenticationTokenListResponse, HostAuthenticationTokenCreateResponse, + HostAuthenticationTokenRetrieveResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -61,6 +62,46 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_update(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( @@ -237,6 +278,46 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py deleted file mode 100644 index 049029bd..00000000 --- a/tests/api_resources/test_editors.py +++ /dev/null @@ -1,276 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types import ( - EditorListResponse, - EditorRetrieveResponse, - EditorResolveEditorURLResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestEditors: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - editor = client.editors.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - editor = client.editors.retrieve( - connect_protocol_version=1, - id="id", - connect_timeout_ms=0, - ) - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - editor = response.parse() - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - editor = response.parse() - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list(self, client: Gitpod) -> None: - editor = client.editors.list( - connect_protocol_version=1, - ) - assert_matches_type(EditorListResponse, editor, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Gitpod) -> None: - editor = client.editors.list( - connect_protocol_version=1, - pagination={ - "token": "token", - "page_size": 0, - }, - connect_timeout_ms=0, - ) - assert_matches_type(EditorListResponse, editor, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - editor = response.parse() - assert_matches_type(EditorListResponse, editor, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - editor = response.parse() - assert_matches_type(EditorListResponse, editor, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_resolve_editor_url(self, client: Gitpod) -> None: - editor = client.editors.resolve_editor_url( - connect_protocol_version=1, - ) - assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) - - @parametrize - def test_method_resolve_editor_url_with_all_params(self, client: Gitpod) -> None: - editor = client.editors.resolve_editor_url( - connect_protocol_version=1, - editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) - - @parametrize - def test_raw_response_resolve_editor_url(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.resolve_editor_url( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - editor = response.parse() - assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) - - @parametrize - def test_streaming_response_resolve_editor_url(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.resolve_editor_url( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - editor = response.parse() - assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncEditors: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.retrieve( - connect_protocol_version=1, - id="id", - connect_timeout_ms=0, - ) - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - editor = await response.parse() - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - editor = await response.parse() - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.list( - connect_protocol_version=1, - ) - assert_matches_type(EditorListResponse, editor, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.list( - connect_protocol_version=1, - pagination={ - "token": "token", - "page_size": 0, - }, - connect_timeout_ms=0, - ) - assert_matches_type(EditorListResponse, editor, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - editor = await response.parse() - assert_matches_type(EditorListResponse, editor, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - editor = await response.parse() - assert_matches_type(EditorListResponse, editor, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_resolve_editor_url(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.resolve_editor_url( - connect_protocol_version=1, - ) - assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) - - @parametrize - async def test_method_resolve_editor_url_with_all_params(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.resolve_editor_url( - connect_protocol_version=1, - editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) - - @parametrize - async def test_raw_response_resolve_editor_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.resolve_editor_url( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - editor = await response.parse() - assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) - - @parametrize - async def test_streaming_response_resolve_editor_url(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.resolve_editor_url( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - editor = await response.parse() - assert_matches_type(EditorResolveEditorURLResponse, editor, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 5921333a..61b64048 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -85,7 +85,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "sourceRef": "sourceRef", } ], - "spec_version": 0, + "spec_version": "specVersion", "ssh_public_keys": [ { "id": "id", @@ -277,7 +277,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "sourceRef": "sourceRef", } ], - "spec_version": 0, + "spec_version": "specVersion", "ssh_public_keys": [ { "id": "id", @@ -421,7 +421,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "sourceRef": "sourceRef", } ], - "spec_version": 0, + "spec_version": "specVersion", "ssh_public_keys": [ { "id": "id", @@ -613,7 +613,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "sourceRef": "sourceRef", } ], - "spec_version": 0, + "spec_version": "specVersion", "ssh_public_keys": [ { "id": "id", diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py deleted file mode 100644 index ae92d5e8..00000000 --- a/tests/api_resources/test_identity.py +++ /dev/null @@ -1,272 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types import ( - IdentityGetIDTokenResponse, - IdentityExchangeTokenResponse, - IdentityGetAuthenticatedIdentityResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestIdentity: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_exchange_token(self, client: Gitpod) -> None: - identity = client.identity.exchange_token( - connect_protocol_version=1, - ) - assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - - @parametrize - def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: - identity = client.identity.exchange_token( - connect_protocol_version=1, - exchange_token="exchangeToken", - connect_timeout_ms=0, - ) - assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - - @parametrize - def test_raw_response_exchange_token(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.exchange_token( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - identity = response.parse() - assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - - @parametrize - def test_streaming_response_exchange_token(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.exchange_token( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - identity = response.parse() - assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_get_authenticated_identity(self, client: Gitpod) -> None: - identity = client.identity.get_authenticated_identity( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: - identity = client.identity.get_authenticated_identity( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.get_authenticated_identity( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - identity = response.parse() - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.get_authenticated_identity( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - identity = response.parse() - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_get_id_token(self, client: Gitpod) -> None: - identity = client.identity.get_id_token( - connect_protocol_version=1, - ) - assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - - @parametrize - def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: - identity = client.identity.get_id_token( - connect_protocol_version=1, - audience=["string"], - connect_timeout_ms=0, - ) - assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - - @parametrize - def test_raw_response_get_id_token(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.get_id_token( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - identity = response.parse() - assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - - @parametrize - def test_streaming_response_get_id_token(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.get_id_token( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - identity = response.parse() - assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncIdentity: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.exchange_token( - connect_protocol_version=1, - ) - assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - - @parametrize - async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.exchange_token( - connect_protocol_version=1, - exchange_token="exchangeToken", - connect_timeout_ms=0, - ) - assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - - @parametrize - async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.exchange_token( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - identity = await response.parse() - assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - - @parametrize - async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.exchange_token( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - identity = await response.parse() - assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.get_authenticated_identity( - body={}, - connect_protocol_version=1, - ) - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.get_authenticated_identity( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.get_authenticated_identity( - body={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - identity = await response.parse() - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.get_authenticated_identity( - body={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - identity = await response.parse() - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.get_id_token( - connect_protocol_version=1, - ) - assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - - @parametrize - async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.get_id_token( - connect_protocol_version=1, - audience=["string"], - connect_timeout_ms=0, - ) - assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - - @parametrize - async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.get_id_token( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - identity = await response.parse() - assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - - @parametrize - async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.get_id_token( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - identity = await response.parse() - assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 2fa50bf0..05dd31bd 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -11,6 +11,7 @@ from tests.utils import assert_matches_type from gitpod.types import ( ProjectCreateResponse, + ProjectRetrieveResponse, ProjectCreateFromEnvironmentResponse, ) @@ -83,6 +84,46 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + project = client.projects.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + project = client.projects.retrieve( + connect_protocol_version=1, + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: project = client.projects.create_from_environment( @@ -191,6 +232,46 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.retrieve( + connect_protocol_version=1, + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index f708a3c0..fc18a891 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -12,6 +12,7 @@ from gitpod.types import ( RunnerListResponse, RunnerCreateResponse, + RunnerRetrieveResponse, RunnerGetRunnerResponse, RunnerParseContextURLResponse, RunnerCreateRunnerTokenResponse, @@ -73,6 +74,46 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + runner = client.runners.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.retrieve( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_list(self, client: Gitpod) -> None: runner = client.runners.list( @@ -423,6 +464,46 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.retrieve( + connect_protocol_version=1, + ) + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.retrieve( + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.retrieve( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( diff --git a/tests/conftest.py b/tests/conftest.py index e83791ad..ef7ca2c5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,8 +28,6 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -auth_token = "My Auth Token" - @pytest.fixture(scope="session") def client(request: FixtureRequest) -> Iterator[Gitpod]: @@ -37,7 +35,7 @@ def client(request: FixtureRequest) -> Iterator[Gitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - with Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=strict) as client: + with Gitpod(base_url=base_url, _strict_response_validation=strict) as client: yield client @@ -47,5 +45,5 @@ async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncGitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - async with AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=strict) as client: + async with AsyncGitpod(base_url=base_url, _strict_response_validation=strict) as client: yield client diff --git a/tests/test_client.py b/tests/test_client.py index ee17c4f6..60d6c310 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -31,7 +31,6 @@ from .utils import update_env base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -auth_token = "My Auth Token" def _get_params(client: BaseClient[Any, Any]) -> dict[str, str]: @@ -53,7 +52,7 @@ def _get_open_connections(client: Gitpod | AsyncGitpod) -> int: class TestGitpod: - client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + client = Gitpod(base_url=base_url, _strict_response_validation=True) @pytest.mark.respx(base_url=base_url) def test_raw_response(self, respx_mock: MockRouter) -> None: @@ -79,10 +78,6 @@ def test_copy(self) -> None: copied = self.client.copy() assert id(copied) != id(self.client) - copied = self.client.copy(auth_token="another My Auth Token") - assert copied.auth_token == "another My Auth Token" - assert self.client.auth_token == "My Auth Token" - def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -100,9 +95,7 @@ def test_copy_default_options(self) -> None: assert isinstance(self.client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: - client = Gitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"} - ) + client = Gitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) assert client.default_headers["X-Foo"] == "bar" # does not override the already given value when not specified @@ -134,9 +127,7 @@ def test_copy_default_headers(self) -> None: client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) def test_copy_default_query(self) -> None: - client = Gitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_query={"foo": "bar"} - ) + client = Gitpod(base_url=base_url, _strict_response_validation=True, default_query={"foo": "bar"}) assert _get_params(client)["foo"] == "bar" # does not override the already given value when not specified @@ -259,9 +250,7 @@ def test_request_timeout(self) -> None: assert timeout == httpx.Timeout(100.0) def test_client_timeout_option(self) -> None: - client = Gitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, timeout=httpx.Timeout(0) - ) + client = Gitpod(base_url=base_url, _strict_response_validation=True, timeout=httpx.Timeout(0)) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -270,9 +259,7 @@ def test_client_timeout_option(self) -> None: def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: - client = Gitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client - ) + client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -280,9 +267,7 @@ def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: - client = Gitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client - ) + client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -290,9 +275,7 @@ def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = Gitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client - ) + client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -301,24 +284,16 @@ def test_http_client_timeout_option(self) -> None: async def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): async with httpx.AsyncClient() as http_client: - Gitpod( - base_url=base_url, - auth_token=auth_token, - _strict_response_validation=True, - http_client=cast(Any, http_client), - ) + Gitpod(base_url=base_url, _strict_response_validation=True, http_client=cast(Any, http_client)) def test_default_headers_option(self) -> None: - client = Gitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"} - ) + client = Gitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" client2 = Gitpod( base_url=base_url, - auth_token=auth_token, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -330,12 +305,7 @@ def test_default_headers_option(self) -> None: assert request.headers.get("x-stainless-lang") == "my-overriding-header" def test_default_query_option(self) -> None: - client = Gitpod( - base_url=base_url, - auth_token=auth_token, - _strict_response_validation=True, - default_query={"query_param": "bar"}, - ) + client = Gitpod(base_url=base_url, _strict_response_validation=True, default_query={"query_param": "bar"}) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) url = httpx.URL(request.url) assert dict(url.params) == {"query_param": "bar"} @@ -534,9 +504,7 @@ class Model(BaseModel): assert response.foo == 2 def test_base_url_setter(self) -> None: - client = Gitpod( - base_url="https://example.com/from_init", auth_token=auth_token, _strict_response_validation=True - ) + client = Gitpod(base_url="https://example.com/from_init", _strict_response_validation=True) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -545,18 +513,15 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = Gitpod(auth_token=auth_token, _strict_response_validation=True) + client = Gitpod(_strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( "client", [ - Gitpod( - base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True - ), + Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), Gitpod( base_url="http://localhost:5000/custom/path/", - auth_token=auth_token, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -576,12 +541,9 @@ def test_base_url_trailing_slash(self, client: Gitpod) -> None: @pytest.mark.parametrize( "client", [ - Gitpod( - base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True - ), + Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), Gitpod( base_url="http://localhost:5000/custom/path/", - auth_token=auth_token, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -601,12 +563,9 @@ def test_base_url_no_trailing_slash(self, client: Gitpod) -> None: @pytest.mark.parametrize( "client", [ - Gitpod( - base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True - ), + Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), Gitpod( base_url="http://localhost:5000/custom/path/", - auth_token=auth_token, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -624,7 +583,7 @@ def test_absolute_request_url(self, client: Gitpod) -> None: assert request.url == "https://myapi.com/foo" def test_copied_client_does_not_close_http(self) -> None: - client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + client = Gitpod(base_url=base_url, _strict_response_validation=True) assert not client.is_closed() copied = client.copy() @@ -635,7 +594,7 @@ def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() def test_client_context_manager(self) -> None: - client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + client = Gitpod(base_url=base_url, _strict_response_validation=True) with client as c2: assert c2 is client assert not c2.is_closed() @@ -656,9 +615,7 @@ class Model(BaseModel): def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - Gitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, max_retries=cast(Any, None) - ) + Gitpod(base_url=base_url, _strict_response_validation=True, max_retries=cast(Any, None)) @pytest.mark.respx(base_url=base_url) def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: @@ -667,12 +624,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + strict_client = Gitpod(base_url=base_url, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=False) + client = Gitpod(base_url=base_url, _strict_response_validation=False) response = client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -700,7 +657,7 @@ class Model(BaseModel): ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = Gitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + client = Gitpod(base_url=base_url, _strict_response_validation=True) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) @@ -822,7 +779,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: class TestAsyncGitpod: - client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio @@ -850,10 +807,6 @@ def test_copy(self) -> None: copied = self.client.copy() assert id(copied) != id(self.client) - copied = self.client.copy(auth_token="another My Auth Token") - assert copied.auth_token == "another My Auth Token" - assert self.client.auth_token == "My Auth Token" - def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -871,9 +824,7 @@ def test_copy_default_options(self) -> None: assert isinstance(self.client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: - client = AsyncGitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"} - ) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) assert client.default_headers["X-Foo"] == "bar" # does not override the already given value when not specified @@ -905,9 +856,7 @@ def test_copy_default_headers(self) -> None: client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) def test_copy_default_query(self) -> None: - client = AsyncGitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_query={"foo": "bar"} - ) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_query={"foo": "bar"}) assert _get_params(client)["foo"] == "bar" # does not override the already given value when not specified @@ -1030,9 +979,7 @@ async def test_request_timeout(self) -> None: assert timeout == httpx.Timeout(100.0) async def test_client_timeout_option(self) -> None: - client = AsyncGitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, timeout=httpx.Timeout(0) - ) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, timeout=httpx.Timeout(0)) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1041,9 +988,7 @@ async def test_client_timeout_option(self) -> None: async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: - client = AsyncGitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client - ) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1051,9 +996,7 @@ async def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: - client = AsyncGitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client - ) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1061,9 +1004,7 @@ async def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = AsyncGitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, http_client=http_client - ) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1072,24 +1013,16 @@ async def test_http_client_timeout_option(self) -> None: def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): with httpx.Client() as http_client: - AsyncGitpod( - base_url=base_url, - auth_token=auth_token, - _strict_response_validation=True, - http_client=cast(Any, http_client), - ) + AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=cast(Any, http_client)) def test_default_headers_option(self) -> None: - client = AsyncGitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"} - ) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" client2 = AsyncGitpod( base_url=base_url, - auth_token=auth_token, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -1101,12 +1034,7 @@ def test_default_headers_option(self) -> None: assert request.headers.get("x-stainless-lang") == "my-overriding-header" def test_default_query_option(self) -> None: - client = AsyncGitpod( - base_url=base_url, - auth_token=auth_token, - _strict_response_validation=True, - default_query={"query_param": "bar"}, - ) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_query={"query_param": "bar"}) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) url = httpx.URL(request.url) assert dict(url.params) == {"query_param": "bar"} @@ -1305,9 +1233,7 @@ class Model(BaseModel): assert response.foo == 2 def test_base_url_setter(self) -> None: - client = AsyncGitpod( - base_url="https://example.com/from_init", auth_token=auth_token, _strict_response_validation=True - ) + client = AsyncGitpod(base_url="https://example.com/from_init", _strict_response_validation=True) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -1316,18 +1242,15 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = AsyncGitpod(auth_token=auth_token, _strict_response_validation=True) + client = AsyncGitpod(_strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( "client", [ - AsyncGitpod( - base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True - ), + AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), AsyncGitpod( base_url="http://localhost:5000/custom/path/", - auth_token=auth_token, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1347,12 +1270,9 @@ def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: @pytest.mark.parametrize( "client", [ - AsyncGitpod( - base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True - ), + AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), AsyncGitpod( base_url="http://localhost:5000/custom/path/", - auth_token=auth_token, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1372,12 +1292,9 @@ def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: @pytest.mark.parametrize( "client", [ - AsyncGitpod( - base_url="http://localhost:5000/custom/path/", auth_token=auth_token, _strict_response_validation=True - ), + AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), AsyncGitpod( base_url="http://localhost:5000/custom/path/", - auth_token=auth_token, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1395,7 +1312,7 @@ def test_absolute_request_url(self, client: AsyncGitpod) -> None: assert request.url == "https://myapi.com/foo" async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) assert not client.is_closed() copied = client.copy() @@ -1407,7 +1324,7 @@ async def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() async def test_client_context_manager(self) -> None: - client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) async with client as c2: assert c2 is client assert not c2.is_closed() @@ -1429,9 +1346,7 @@ class Model(BaseModel): async def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - AsyncGitpod( - base_url=base_url, auth_token=auth_token, _strict_response_validation=True, max_retries=cast(Any, None) - ) + AsyncGitpod(base_url=base_url, _strict_response_validation=True, max_retries=cast(Any, None)) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio @@ -1441,12 +1356,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + strict_client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=False) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=False) response = await client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -1475,7 +1390,7 @@ class Model(BaseModel): @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @pytest.mark.asyncio async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = AsyncGitpod(base_url=base_url, auth_token=auth_token, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) From d2b439d685421a0d86e49f700f0833ef380e9a0e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:35:56 +0000 Subject: [PATCH 048/505] feat(api): update via SDK Studio --- README.md | 5 ++ src/gitpod/_client.py | 48 +++++++++- tests/conftest.py | 6 +- tests/test_client.py | 199 +++++++++++++++++++++++++++++++++--------- 4 files changed, 211 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 04e31882..dc9f51db 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,11 @@ runner = client.runners.create( print(runner.access_token) ``` +While you can provide a `bearer_token` keyword argument, +we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/) +to add `GITPOD_API_KEY="My Bearer Token"` to your `.env` file +so that your Bearer Token is not stored in source control. + ## Async usage Simply import `AsyncGitpod` instead of `Gitpod` and use `await` with each API call: diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index b1c0e7fe..9674ef46 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -26,7 +26,7 @@ from ._version import __version__ from .resources import projects, environment_classes, personal_access_tokens from ._streaming import Stream as Stream, AsyncStream as AsyncStream -from ._exceptions import APIStatusError +from ._exceptions import GitpodError, APIStatusError from ._base_client import ( DEFAULT_MAX_RETRIES, SyncAPIClient, @@ -52,10 +52,12 @@ class Gitpod(SyncAPIClient): with_streaming_response: GitpodWithStreamedResponse # client options + bearer_token: str def __init__( self, *, + bearer_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -75,7 +77,18 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new synchronous gitpod client instance.""" + """Construct a new synchronous gitpod client instance. + + This automatically infers the `bearer_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided. + """ + if bearer_token is None: + bearer_token = os.environ.get("GITPOD_API_KEY") + if bearer_token is None: + raise GitpodError( + "The bearer_token client option must be set either by passing bearer_token to the client or by setting the GITPOD_API_KEY environment variable" + ) + self.bearer_token = bearer_token + if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -107,6 +120,12 @@ def __init__( def qs(self) -> Querystring: return Querystring(array_format="comma") + @property + @override + def auth_headers(self) -> dict[str, str]: + bearer_token = self.bearer_token + return {"Authorization": f"Bearer {bearer_token}"} + @property @override def default_headers(self) -> dict[str, str | Omit]: @@ -119,6 +138,7 @@ def default_headers(self) -> dict[str, str | Omit]: def copy( self, *, + bearer_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.Client | None = None, @@ -152,6 +172,7 @@ def copy( http_client = http_client or self._client return self.__class__( + bearer_token=bearer_token or self.bearer_token, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, @@ -211,10 +232,12 @@ class AsyncGitpod(AsyncAPIClient): with_streaming_response: AsyncGitpodWithStreamedResponse # client options + bearer_token: str def __init__( self, *, + bearer_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -234,7 +257,18 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new async gitpod client instance.""" + """Construct a new async gitpod client instance. + + This automatically infers the `bearer_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided. + """ + if bearer_token is None: + bearer_token = os.environ.get("GITPOD_API_KEY") + if bearer_token is None: + raise GitpodError( + "The bearer_token client option must be set either by passing bearer_token to the client or by setting the GITPOD_API_KEY environment variable" + ) + self.bearer_token = bearer_token + if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -266,6 +300,12 @@ def __init__( def qs(self) -> Querystring: return Querystring(array_format="comma") + @property + @override + def auth_headers(self) -> dict[str, str]: + bearer_token = self.bearer_token + return {"Authorization": f"Bearer {bearer_token}"} + @property @override def default_headers(self) -> dict[str, str | Omit]: @@ -278,6 +318,7 @@ def default_headers(self) -> dict[str, str | Omit]: def copy( self, *, + bearer_token: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.AsyncClient | None = None, @@ -311,6 +352,7 @@ def copy( http_client = http_client or self._client return self.__class__( + bearer_token=bearer_token or self.bearer_token, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, diff --git a/tests/conftest.py b/tests/conftest.py index ef7ca2c5..d7bb7fa8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,6 +28,8 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") +bearer_token = "My Bearer Token" + @pytest.fixture(scope="session") def client(request: FixtureRequest) -> Iterator[Gitpod]: @@ -35,7 +37,7 @@ def client(request: FixtureRequest) -> Iterator[Gitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - with Gitpod(base_url=base_url, _strict_response_validation=strict) as client: + with Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: yield client @@ -45,5 +47,5 @@ async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncGitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - async with AsyncGitpod(base_url=base_url, _strict_response_validation=strict) as client: + async with AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: yield client diff --git a/tests/test_client.py b/tests/test_client.py index 60d6c310..289b035c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -31,6 +31,7 @@ from .utils import update_env base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") +bearer_token = "My Bearer Token" def _get_params(client: BaseClient[Any, Any]) -> dict[str, str]: @@ -52,7 +53,7 @@ def _get_open_connections(client: Gitpod | AsyncGitpod) -> int: class TestGitpod: - client = Gitpod(base_url=base_url, _strict_response_validation=True) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) @pytest.mark.respx(base_url=base_url) def test_raw_response(self, respx_mock: MockRouter) -> None: @@ -78,6 +79,10 @@ def test_copy(self) -> None: copied = self.client.copy() assert id(copied) != id(self.client) + copied = self.client.copy(bearer_token="another My Bearer Token") + assert copied.bearer_token == "another My Bearer Token" + assert self.client.bearer_token == "My Bearer Token" + def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -95,7 +100,12 @@ def test_copy_default_options(self) -> None: assert isinstance(self.client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + client = Gitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={"X-Foo": "bar"}, + ) assert client.default_headers["X-Foo"] == "bar" # does not override the already given value when not specified @@ -127,7 +137,9 @@ def test_copy_default_headers(self) -> None: client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) def test_copy_default_query(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, default_query={"foo": "bar"}) + client = Gitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} + ) assert _get_params(client)["foo"] == "bar" # does not override the already given value when not specified @@ -250,7 +262,9 @@ def test_request_timeout(self) -> None: assert timeout == httpx.Timeout(100.0) def test_client_timeout_option(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, timeout=httpx.Timeout(0)) + client = Gitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, timeout=httpx.Timeout(0) + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -259,7 +273,9 @@ def test_client_timeout_option(self) -> None: def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: - client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = Gitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -267,7 +283,9 @@ def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: - client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = Gitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -275,7 +293,9 @@ def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = Gitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = Gitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -284,16 +304,27 @@ def test_http_client_timeout_option(self) -> None: async def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): async with httpx.AsyncClient() as http_client: - Gitpod(base_url=base_url, _strict_response_validation=True, http_client=cast(Any, http_client)) + Gitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=cast(Any, http_client), + ) def test_default_headers_option(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + client = Gitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={"X-Foo": "bar"}, + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" client2 = Gitpod( base_url=base_url, + bearer_token=bearer_token, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -305,7 +336,12 @@ def test_default_headers_option(self) -> None: assert request.headers.get("x-stainless-lang") == "my-overriding-header" def test_default_query_option(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True, default_query={"query_param": "bar"}) + client = Gitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_query={"query_param": "bar"}, + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) url = httpx.URL(request.url) assert dict(url.params) == {"query_param": "bar"} @@ -504,7 +540,9 @@ class Model(BaseModel): assert response.foo == 2 def test_base_url_setter(self) -> None: - client = Gitpod(base_url="https://example.com/from_init", _strict_response_validation=True) + client = Gitpod( + base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True + ) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -513,15 +551,20 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = Gitpod(_strict_response_validation=True) + client = Gitpod(bearer_token=bearer_token, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( "client", [ - Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), Gitpod( base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + Gitpod( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -541,9 +584,14 @@ def test_base_url_trailing_slash(self, client: Gitpod) -> None: @pytest.mark.parametrize( "client", [ - Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), Gitpod( base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + Gitpod( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -563,9 +611,14 @@ def test_base_url_no_trailing_slash(self, client: Gitpod) -> None: @pytest.mark.parametrize( "client", [ - Gitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), Gitpod( base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + Gitpod( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -583,7 +636,7 @@ def test_absolute_request_url(self, client: Gitpod) -> None: assert request.url == "https://myapi.com/foo" def test_copied_client_does_not_close_http(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) assert not client.is_closed() copied = client.copy() @@ -594,7 +647,7 @@ def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() def test_client_context_manager(self) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) with client as c2: assert c2 is client assert not c2.is_closed() @@ -615,7 +668,12 @@ class Model(BaseModel): def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - Gitpod(base_url=base_url, _strict_response_validation=True, max_retries=cast(Any, None)) + Gitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + max_retries=cast(Any, None), + ) @pytest.mark.respx(base_url=base_url) def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: @@ -624,12 +682,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = Gitpod(base_url=base_url, _strict_response_validation=True) + strict_client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Gitpod(base_url=base_url, _strict_response_validation=False) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) response = client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -657,7 +715,7 @@ class Model(BaseModel): ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = Gitpod(base_url=base_url, _strict_response_validation=True) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) @@ -779,7 +837,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: class TestAsyncGitpod: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio @@ -807,6 +865,10 @@ def test_copy(self) -> None: copied = self.client.copy() assert id(copied) != id(self.client) + copied = self.client.copy(bearer_token="another My Bearer Token") + assert copied.bearer_token == "another My Bearer Token" + assert self.client.bearer_token == "My Bearer Token" + def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -824,7 +886,12 @@ def test_copy_default_options(self) -> None: assert isinstance(self.client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + client = AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={"X-Foo": "bar"}, + ) assert client.default_headers["X-Foo"] == "bar" # does not override the already given value when not specified @@ -856,7 +923,9 @@ def test_copy_default_headers(self) -> None: client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) def test_copy_default_query(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_query={"foo": "bar"}) + client = AsyncGitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} + ) assert _get_params(client)["foo"] == "bar" # does not override the already given value when not specified @@ -979,7 +1048,9 @@ async def test_request_timeout(self) -> None: assert timeout == httpx.Timeout(100.0) async def test_client_timeout_option(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, timeout=httpx.Timeout(0)) + client = AsyncGitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, timeout=httpx.Timeout(0) + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -988,7 +1059,9 @@ async def test_client_timeout_option(self) -> None: async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = AsyncGitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -996,7 +1069,9 @@ async def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = AsyncGitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1004,7 +1079,9 @@ async def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=http_client) + client = AsyncGitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1013,16 +1090,27 @@ async def test_http_client_timeout_option(self) -> None: def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): with httpx.Client() as http_client: - AsyncGitpod(base_url=base_url, _strict_response_validation=True, http_client=cast(Any, http_client)) + AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=cast(Any, http_client), + ) def test_default_headers_option(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"}) + client = AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={"X-Foo": "bar"}, + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" client2 = AsyncGitpod( base_url=base_url, + bearer_token=bearer_token, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -1034,7 +1122,12 @@ def test_default_headers_option(self) -> None: assert request.headers.get("x-stainless-lang") == "my-overriding-header" def test_default_query_option(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True, default_query={"query_param": "bar"}) + client = AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_query={"query_param": "bar"}, + ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) url = httpx.URL(request.url) assert dict(url.params) == {"query_param": "bar"} @@ -1233,7 +1326,9 @@ class Model(BaseModel): assert response.foo == 2 def test_base_url_setter(self) -> None: - client = AsyncGitpod(base_url="https://example.com/from_init", _strict_response_validation=True) + client = AsyncGitpod( + base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True + ) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -1242,15 +1337,20 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = AsyncGitpod(_strict_response_validation=True) + client = AsyncGitpod(bearer_token=bearer_token, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( "client", [ - AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), AsyncGitpod( base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + AsyncGitpod( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1270,9 +1370,14 @@ def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: @pytest.mark.parametrize( "client", [ - AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), AsyncGitpod( base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + AsyncGitpod( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1292,9 +1397,14 @@ def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: @pytest.mark.parametrize( "client", [ - AsyncGitpod(base_url="http://localhost:5000/custom/path/", _strict_response_validation=True), AsyncGitpod( base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + AsyncGitpod( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1312,7 +1422,7 @@ def test_absolute_request_url(self, client: AsyncGitpod) -> None: assert request.url == "https://myapi.com/foo" async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) assert not client.is_closed() copied = client.copy() @@ -1324,7 +1434,7 @@ async def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() async def test_client_context_manager(self) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) async with client as c2: assert c2 is client assert not c2.is_closed() @@ -1346,7 +1456,12 @@ class Model(BaseModel): async def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - AsyncGitpod(base_url=base_url, _strict_response_validation=True, max_retries=cast(Any, None)) + AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + max_retries=cast(Any, None), + ) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio @@ -1356,12 +1471,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + strict_client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncGitpod(base_url=base_url, _strict_response_validation=False) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) response = await client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -1390,7 +1505,7 @@ class Model(BaseModel): @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @pytest.mark.asyncio async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = AsyncGitpod(base_url=base_url, _strict_response_validation=True) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) From 55419ea4f9acbbdc3f0284636c78239c3c2b038c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:38:54 +0000 Subject: [PATCH 049/505] feat(api): update via SDK Studio --- .stats.yml | 2 +- api.md | 18 + src/gitpod/_client.py | 10 +- src/gitpod/resources/__init__.py | 14 + src/gitpod/resources/identity.py | 435 ++++++++++++++++++ src/gitpod/types/__init__.py | 10 + .../types/identity_exchange_token_params.py | 20 + .../types/identity_exchange_token_response.py | 14 + ...ntity_get_authenticated_identity_params.py | 19 + ...ity_get_authenticated_identity_response.py | 34 ++ .../types/identity_get_id_token_params.py | 20 + .../types/identity_get_id_token_response.py | 11 + tests/api_resources/test_identity.py | 272 +++++++++++ 13 files changed, 877 insertions(+), 2 deletions(-) create mode 100644 src/gitpod/resources/identity.py create mode 100644 src/gitpod/types/identity_exchange_token_params.py create mode 100644 src/gitpod/types/identity_exchange_token_response.py create mode 100644 src/gitpod/types/identity_get_authenticated_identity_params.py create mode 100644 src/gitpod/types/identity_get_authenticated_identity_response.py create mode 100644 src/gitpod/types/identity_get_id_token_params.py create mode 100644 src/gitpod/types/identity_get_id_token_response.py create mode 100644 tests/api_resources/test_identity.py diff --git a/.stats.yml b/.stats.yml index caf4ddcc..77a06efc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 51 +configured_endpoints: 54 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6d44c8845e1deee92c3e6406d5b67aa72616ec5e21ab8c722ae0a2c214c14784.yml diff --git a/api.md b/api.md index 27079ea5..92e91684 100644 --- a/api.md +++ b/api.md @@ -1,3 +1,21 @@ +# Identity + +Types: + +```python +from gitpod.types import ( + IdentityExchangeTokenResponse, + IdentityGetAuthenticatedIdentityResponse, + IdentityGetIDTokenResponse, +) +``` + +Methods: + +- client.identity.exchange_token(\*\*params) -> IdentityExchangeTokenResponse +- client.identity.get_authenticated_identity(\*\*params) -> IdentityGetAuthenticatedIdentityResponse +- client.identity.get_id_token(\*\*params) -> IdentityGetIDTokenResponse + # Environments Types: diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 9674ef46..6501485a 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -24,7 +24,7 @@ get_async_library, ) from ._version import __version__ -from .resources import projects, environment_classes, personal_access_tokens +from .resources import identity, projects, environment_classes, personal_access_tokens from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import GitpodError, APIStatusError from ._base_client import ( @@ -41,6 +41,7 @@ class Gitpod(SyncAPIClient): + identity: identity.IdentityResource environments: environments.EnvironmentsResource environment_classes: environment_classes.EnvironmentClassesResource organizations: organizations.OrganizationsResource @@ -105,6 +106,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) + self.identity = identity.IdentityResource(self) self.environments = environments.EnvironmentsResource(self) self.environment_classes = environment_classes.EnvironmentClassesResource(self) self.organizations = organizations.OrganizationsResource(self) @@ -221,6 +223,7 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): + identity: identity.AsyncIdentityResource environments: environments.AsyncEnvironmentsResource environment_classes: environment_classes.AsyncEnvironmentClassesResource organizations: organizations.AsyncOrganizationsResource @@ -285,6 +288,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) + self.identity = identity.AsyncIdentityResource(self) self.environments = environments.AsyncEnvironmentsResource(self) self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self) self.organizations = organizations.AsyncOrganizationsResource(self) @@ -402,6 +406,7 @@ def _make_status_error( class GitpodWithRawResponse: def __init__(self, client: Gitpod) -> None: + self.identity = identity.IdentityResourceWithRawResponse(client.identity) self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) self.environment_classes = environment_classes.EnvironmentClassesResourceWithRawResponse( client.environment_classes @@ -419,6 +424,7 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithRawResponse: def __init__(self, client: AsyncGitpod) -> None: + self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity) self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithRawResponse( client.environment_classes @@ -436,6 +442,7 @@ def __init__(self, client: AsyncGitpod) -> None: class GitpodWithStreamedResponse: def __init__(self, client: Gitpod) -> None: + self.identity = identity.IdentityResourceWithStreamingResponse(client.identity) self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) self.environment_classes = environment_classes.EnvironmentClassesResourceWithStreamingResponse( client.environment_classes @@ -453,6 +460,7 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithStreamedResponse: def __init__(self, client: AsyncGitpod) -> None: + self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity) self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithStreamingResponse( client.environment_classes diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index d8a15780..a132d983 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -8,6 +8,14 @@ RunnersResourceWithStreamingResponse, AsyncRunnersResourceWithStreamingResponse, ) +from .identity import ( + IdentityResource, + AsyncIdentityResource, + IdentityResourceWithRawResponse, + AsyncIdentityResourceWithRawResponse, + IdentityResourceWithStreamingResponse, + AsyncIdentityResourceWithStreamingResponse, +) from .projects import ( ProjectsResource, AsyncProjectsResource, @@ -58,6 +66,12 @@ ) __all__ = [ + "IdentityResource", + "AsyncIdentityResource", + "IdentityResourceWithRawResponse", + "AsyncIdentityResourceWithRawResponse", + "IdentityResourceWithStreamingResponse", + "AsyncIdentityResourceWithStreamingResponse", "EnvironmentsResource", "AsyncEnvironmentsResource", "EnvironmentsResourceWithRawResponse", diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py new file mode 100644 index 00000000..1dd95ed9 --- /dev/null +++ b/src/gitpod/resources/identity.py @@ -0,0 +1,435 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal + +import httpx + +from ..types import ( + identity_get_id_token_params, + identity_exchange_token_params, + identity_get_authenticated_identity_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.identity_get_id_token_response import IdentityGetIDTokenResponse +from ..types.identity_exchange_token_response import IdentityExchangeTokenResponse +from ..types.identity_get_authenticated_identity_response import IdentityGetAuthenticatedIdentityResponse + +__all__ = ["IdentityResource", "AsyncIdentityResource"] + + +class IdentityResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> IdentityResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return IdentityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return IdentityResourceWithStreamingResponse(self) + + def exchange_token( + self, + *, + connect_protocol_version: Literal[1], + exchange_token: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityExchangeTokenResponse: + """ + ExchangeToken trades an exchange token for a new access token. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + exchange_token: exchange_token is the token to exchange + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.IdentityService/ExchangeToken", + body=maybe_transform( + {"exchange_token": exchange_token}, identity_exchange_token_params.IdentityExchangeTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityExchangeTokenResponse, + ) + + def get_authenticated_identity( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityGetAuthenticatedIdentityResponse: + """ + GetAuthenticatedIdentity allows to retrieve the current identity. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", + body=maybe_transform( + body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityGetAuthenticatedIdentityResponse, + ) + + def get_id_token( + self, + *, + connect_protocol_version: Literal[1], + audience: List[str] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityGetIDTokenResponse: + """ + GetIDToken returns a token that can be used to authenticate the user against the + other services. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.IdentityService/GetIDToken", + body=maybe_transform({"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityGetIDTokenResponse, + ) + + +class AsyncIdentityResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncIdentityResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncIdentityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncIdentityResourceWithStreamingResponse(self) + + async def exchange_token( + self, + *, + connect_protocol_version: Literal[1], + exchange_token: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityExchangeTokenResponse: + """ + ExchangeToken trades an exchange token for a new access token. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + exchange_token: exchange_token is the token to exchange + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.IdentityService/ExchangeToken", + body=await async_maybe_transform( + {"exchange_token": exchange_token}, identity_exchange_token_params.IdentityExchangeTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityExchangeTokenResponse, + ) + + async def get_authenticated_identity( + self, + *, + body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityGetAuthenticatedIdentityResponse: + """ + GetAuthenticatedIdentity allows to retrieve the current identity. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", + body=await async_maybe_transform( + body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityGetAuthenticatedIdentityResponse, + ) + + async def get_id_token( + self, + *, + connect_protocol_version: Literal[1], + audience: List[str] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityGetIDTokenResponse: + """ + GetIDToken returns a token that can be used to authenticate the user against the + other services. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.IdentityService/GetIDToken", + body=await async_maybe_transform( + {"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IdentityGetIDTokenResponse, + ) + + +class IdentityResourceWithRawResponse: + def __init__(self, identity: IdentityResource) -> None: + self._identity = identity + + self.exchange_token = to_raw_response_wrapper( + identity.exchange_token, + ) + self.get_authenticated_identity = to_raw_response_wrapper( + identity.get_authenticated_identity, + ) + self.get_id_token = to_raw_response_wrapper( + identity.get_id_token, + ) + + +class AsyncIdentityResourceWithRawResponse: + def __init__(self, identity: AsyncIdentityResource) -> None: + self._identity = identity + + self.exchange_token = async_to_raw_response_wrapper( + identity.exchange_token, + ) + self.get_authenticated_identity = async_to_raw_response_wrapper( + identity.get_authenticated_identity, + ) + self.get_id_token = async_to_raw_response_wrapper( + identity.get_id_token, + ) + + +class IdentityResourceWithStreamingResponse: + def __init__(self, identity: IdentityResource) -> None: + self._identity = identity + + self.exchange_token = to_streamed_response_wrapper( + identity.exchange_token, + ) + self.get_authenticated_identity = to_streamed_response_wrapper( + identity.get_authenticated_identity, + ) + self.get_id_token = to_streamed_response_wrapper( + identity.get_id_token, + ) + + +class AsyncIdentityResourceWithStreamingResponse: + def __init__(self, identity: AsyncIdentityResource) -> None: + self._identity = identity + + self.exchange_token = async_to_streamed_response_wrapper( + identity.exchange_token, + ) + self.get_authenticated_identity = async_to_streamed_response_wrapper( + identity.get_authenticated_identity, + ) + self.get_id_token = async_to_streamed_response_wrapper( + identity.get_id_token, + ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 26e3f716..e184d631 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -23,11 +23,15 @@ from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams from .runner_delete_runner_params import RunnerDeleteRunnerParams as RunnerDeleteRunnerParams from .runner_update_runner_params import RunnerUpdateRunnerParams as RunnerUpdateRunnerParams +from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse +from .identity_exchange_token_params import IdentityExchangeTokenParams as IdentityExchangeTokenParams +from .identity_get_id_token_response import IdentityGetIDTokenResponse as IdentityGetIDTokenResponse from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams +from .identity_exchange_token_response import IdentityExchangeTokenResponse as IdentityExchangeTokenResponse from .personal_access_token_list_params import PersonalAccessTokenListParams as PersonalAccessTokenListParams from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse @@ -50,9 +54,15 @@ from .project_create_from_environment_response import ( ProjectCreateFromEnvironmentResponse as ProjectCreateFromEnvironmentResponse, ) +from .identity_get_authenticated_identity_params import ( + IdentityGetAuthenticatedIdentityParams as IdentityGetAuthenticatedIdentityParams, +) from .runner_check_authentication_for_host_params import ( RunnerCheckAuthenticationForHostParams as RunnerCheckAuthenticationForHostParams, ) +from .identity_get_authenticated_identity_response import ( + IdentityGetAuthenticatedIdentityResponse as IdentityGetAuthenticatedIdentityResponse, +) from .runner_check_authentication_for_host_response import ( RunnerCheckAuthenticationForHostResponse as RunnerCheckAuthenticationForHostResponse, ) diff --git a/src/gitpod/types/identity_exchange_token_params.py b/src/gitpod/types/identity_exchange_token_params.py new file mode 100644 index 00000000..bb8becb3 --- /dev/null +++ b/src/gitpod/types/identity_exchange_token_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["IdentityExchangeTokenParams"] + + +class IdentityExchangeTokenParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + exchange_token: Annotated[str, PropertyInfo(alias="exchangeToken")] + """exchange_token is the token to exchange""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_exchange_token_response.py b/src/gitpod/types/identity_exchange_token_response.py new file mode 100644 index 00000000..c101adb6 --- /dev/null +++ b/src/gitpod/types/identity_exchange_token_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["IdentityExchangeTokenResponse"] + + +class IdentityExchangeTokenResponse(BaseModel): + access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) + """access_token is the new access token""" diff --git a/src/gitpod/types/identity_get_authenticated_identity_params.py b/src/gitpod/types/identity_get_authenticated_identity_params.py new file mode 100644 index 00000000..457fe1f9 --- /dev/null +++ b/src/gitpod/types/identity_get_authenticated_identity_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["IdentityGetAuthenticatedIdentityParams"] + + +class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False): + body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_authenticated_identity_response.py b/src/gitpod/types/identity_get_authenticated_identity_response.py new file mode 100644 index 00000000..fb9635ba --- /dev/null +++ b/src/gitpod/types/identity_get_authenticated_identity_response.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["IdentityGetAuthenticatedIdentityResponse", "Subject"] + + +class Subject(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class IdentityGetAuthenticatedIdentityResponse(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + + subject: Optional[Subject] = None + """subject is the identity of the current user""" diff --git a/src/gitpod/types/identity_get_id_token_params.py b/src/gitpod/types/identity_get_id_token_params.py new file mode 100644 index 00000000..7291a3b6 --- /dev/null +++ b/src/gitpod/types/identity_get_id_token_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["IdentityGetIDTokenParams"] + + +class IdentityGetIDTokenParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + audience: List[str] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_id_token_response.py b/src/gitpod/types/identity_get_id_token_response.py new file mode 100644 index 00000000..e327e686 --- /dev/null +++ b/src/gitpod/types/identity_get_id_token_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["IdentityGetIDTokenResponse"] + + +class IdentityGetIDTokenResponse(BaseModel): + token: Optional[str] = None diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py new file mode 100644 index 00000000..ae92d5e8 --- /dev/null +++ b/tests/api_resources/test_identity.py @@ -0,0 +1,272 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + IdentityGetIDTokenResponse, + IdentityExchangeTokenResponse, + IdentityGetAuthenticatedIdentityResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestIdentity: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_exchange_token(self, client: Gitpod) -> None: + identity = client.identity.exchange_token( + connect_protocol_version=1, + ) + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: + identity = client.identity.exchange_token( + connect_protocol_version=1, + exchange_token="exchangeToken", + connect_timeout_ms=0, + ) + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + def test_raw_response_exchange_token(self, client: Gitpod) -> None: + response = client.identity.with_raw_response.exchange_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = response.parse() + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + def test_streaming_response_exchange_token(self, client: Gitpod) -> None: + with client.identity.with_streaming_response.exchange_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = response.parse() + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_authenticated_identity(self, client: Gitpod) -> None: + identity = client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: + identity = client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: + response = client.identity.with_raw_response.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = response.parse() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: + with client.identity.with_streaming_response.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = response.parse() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_id_token(self, client: Gitpod) -> None: + identity = client.identity.get_id_token( + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: + identity = client.identity.get_id_token( + connect_protocol_version=1, + audience=["string"], + connect_timeout_ms=0, + ) + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + def test_raw_response_get_id_token(self, client: Gitpod) -> None: + response = client.identity.with_raw_response.get_id_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = response.parse() + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + def test_streaming_response_get_id_token(self, client: Gitpod) -> None: + with client.identity.with_streaming_response.get_id_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = response.parse() + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncIdentity: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.exchange_token( + connect_protocol_version=1, + ) + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.exchange_token( + connect_protocol_version=1, + exchange_token="exchangeToken", + connect_timeout_ms=0, + ) + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.identity.with_raw_response.exchange_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = await response.parse() + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + @parametrize + async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: + async with async_client.identity.with_streaming_response.exchange_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = await response.parse() + assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: + response = await async_client.identity.with_raw_response.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = await response.parse() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: + async with async_client.identity.with_streaming_response.get_authenticated_identity( + body={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = await response.parse() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_id_token( + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_id_token( + connect_protocol_version=1, + audience=["string"], + connect_timeout_ms=0, + ) + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.identity.with_raw_response.get_id_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity = await response.parse() + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + @parametrize + async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: + async with async_client.identity.with_streaming_response.get_id_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity = await response.parse() + assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + + assert cast(Any, response.is_closed) is True From 8af85c63dc566bcbfb8f233903fba62e07fb70cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 03:12:21 +0000 Subject: [PATCH 050/505] chore(internal): codegen related update --- src/gitpod/resources/environment_classes.py | 5 ++--- src/gitpod/resources/projects.py | 5 ++--- .../resources/runner_configurations/environment_classes.py | 5 ++--- src/gitpod/types/environment_class_list_params.py | 3 +-- src/gitpod/types/environments/automation_upsert_params.py | 6 +++--- .../types/environments/automations/service_list_response.py | 4 ++-- .../types/environments/automations/task_create_params.py | 2 +- .../types/environments/automations/task_create_response.py | 4 ++-- .../types/environments/automations/task_list_response.py | 4 ++-- .../environments/automations/task_retrieve_response.py | 4 ++-- .../types/project_create_from_environment_response.py | 4 ++-- src/gitpod/types/project_create_params.py | 4 ++-- src/gitpod/types/project_create_response.py | 4 ++-- src/gitpod/types/project_retrieve_response.py | 4 ++-- .../runner_configurations/environment_class_list_params.py | 3 +-- .../api_resources/environments/automations/test_services.py | 4 ++-- .../environments/automations/test_task_executions.py | 4 ++-- tests/api_resources/environments/automations/test_tasks.py | 4 ++-- tests/api_resources/organizations/test_members.py | 4 ++-- .../runner_configurations/test_environment_classes.py | 4 ++-- .../test_host_authentication_tokens.py | 4 ++-- tests/api_resources/runners/test_policies.py | 4 ++-- tests/api_resources/test_environment_classes.py | 4 ++-- tests/api_resources/test_environments.py | 4 ++-- tests/api_resources/test_personal_access_tokens.py | 4 ++-- tests/api_resources/test_runners.py | 4 ++-- 26 files changed, 50 insertions(+), 55 deletions(-) diff --git a/src/gitpod/resources/environment_classes.py b/src/gitpod/resources/environment_classes.py index 23a78c0b..b7c91338 100644 --- a/src/gitpod/resources/environment_classes.py +++ b/src/gitpod/resources/environment_classes.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Union from typing_extensions import Literal import httpx @@ -53,7 +52,7 @@ def list( self, *, connect_protocol_version: Literal[1], - filter: Union[object, object] | NotGiven = NOT_GIVEN, + filter: object | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -133,7 +132,7 @@ async def list( self, *, connect_protocol_version: Literal[1], - filter: Union[object, object] | NotGiven = NOT_GIVEN, + filter: object | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/gitpod/resources/projects.py b/src/gitpod/resources/projects.py index 686d3ca5..f6757983 100644 --- a/src/gitpod/resources/projects.py +++ b/src/gitpod/resources/projects.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Union from typing_extensions import Literal import httpx @@ -58,7 +57,7 @@ def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: def create( self, *, - environment_class: Union[object, object, object], + environment_class: object, initializer: project_create_params.Initializer, connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, @@ -260,7 +259,7 @@ def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: async def create( self, *, - environment_class: Union[object, object, object], + environment_class: object, initializer: project_create_params.Initializer, connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, diff --git a/src/gitpod/resources/runner_configurations/environment_classes.py b/src/gitpod/resources/runner_configurations/environment_classes.py index 0a2bbb27..c1ecfdd8 100644 --- a/src/gitpod/resources/runner_configurations/environment_classes.py +++ b/src/gitpod/resources/runner_configurations/environment_classes.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Union from typing_extensions import Literal import httpx @@ -100,7 +99,7 @@ def list( self, *, connect_protocol_version: Literal[1], - filter: Union[object, object] | NotGiven = NOT_GIVEN, + filter: object | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -226,7 +225,7 @@ async def list( self, *, connect_protocol_version: Literal[1], - filter: Union[object, object] | NotGiven = NOT_GIVEN, + filter: object | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/gitpod/types/environment_class_list_params.py b/src/gitpod/types/environment_class_list_params.py index 3c2c3a7b..0b6e8bff 100644 --- a/src/gitpod/types/environment_class_list_params.py +++ b/src/gitpod/types/environment_class_list_params.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Union from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -14,7 +13,7 @@ class EnvironmentClassListParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: Union[object, object] + filter: object pagination: Pagination """pagination contains the pagination options for listing environment classes""" diff --git a/src/gitpod/types/environments/automation_upsert_params.py b/src/gitpod/types/environments/automation_upsert_params.py index afd240ee..1be42d07 100644 --- a/src/gitpod/types/environments/automation_upsert_params.py +++ b/src/gitpod/types/environments/automation_upsert_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union +from typing import Dict, List from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -76,7 +76,7 @@ class AutomationsFileServices(TypedDict, total=False): name: str - runs_on: Annotated[Union[object, object], PropertyInfo(alias="runsOn")] + runs_on: Annotated[object, PropertyInfo(alias="runsOn")] triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] @@ -90,7 +90,7 @@ class AutomationsFileTasks(TypedDict, total=False): name: str - runs_on: Annotated[Union[object, object], PropertyInfo(alias="runsOn")] + runs_on: Annotated[object, PropertyInfo(alias="runsOn")] triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] diff --git a/src/gitpod/types/environments/automations/service_list_response.py b/src/gitpod/types/environments/automations/service_list_response.py index d63169f4..54e3a7cd 100644 --- a/src/gitpod/types/environments/automations/service_list_response.py +++ b/src/gitpod/types/environments/automations/service_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -230,7 +230,7 @@ class ServiceSpec(BaseModel): Used to start or stop the service. """ - runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[object] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the service should run on.""" session: Optional[str] = None diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index 487041fe..73e3a894 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -174,5 +174,5 @@ class Spec(TypedDict, total=False): command: str """command contains the command the task should execute""" - runs_on: Annotated[Union[object, object], PropertyInfo(alias="runsOn")] + runs_on: Annotated[object, PropertyInfo(alias="runsOn")] """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index 1c7b59b7..1456b539 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -160,7 +160,7 @@ class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[object] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/environments/automations/task_list_response.py b/src/gitpod/types/environments/automations/task_list_response.py index fc9945a4..4fad3a92 100644 --- a/src/gitpod/types/environments/automations/task_list_response.py +++ b/src/gitpod/types/environments/automations/task_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -176,7 +176,7 @@ class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[object] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index 324e1e05..b79d2e37 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -160,7 +160,7 @@ class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Union[object, object, None] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[object] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py index 989a3856..71597338 100644 --- a/src/gitpod/types/project_create_from_environment_response.py +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -269,7 +269,7 @@ class ProjectUsedBy(BaseModel): class Project(BaseModel): - environment_class: Union[object, object, object] = FieldInfo(alias="environmentClass") + environment_class: object = FieldInfo(alias="environmentClass") id: Optional[str] = None """id is the unique identifier for the project""" diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index 259bd607..daabb2b1 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union, Iterable +from typing import Iterable from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -11,7 +11,7 @@ class ProjectCreateParams(TypedDict, total=False): - environment_class: Required[Annotated[Union[object, object, object], PropertyInfo(alias="environmentClass")]] + environment_class: Required[Annotated[object, PropertyInfo(alias="environmentClass")]] initializer: Required[Initializer] """EnvironmentInitializer specifies how an environment is to be initialized""" diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py index 805963c2..d5247b60 100644 --- a/src/gitpod/types/project_create_response.py +++ b/src/gitpod/types/project_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -269,7 +269,7 @@ class ProjectUsedBy(BaseModel): class Project(BaseModel): - environment_class: Union[object, object, object] = FieldInfo(alias="environmentClass") + environment_class: object = FieldInfo(alias="environmentClass") id: Optional[str] = None """id is the unique identifier for the project""" diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py index 20c86c6d..127cef18 100644 --- a/src/gitpod/types/project_retrieve_response.py +++ b/src/gitpod/types/project_retrieve_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -269,7 +269,7 @@ class ProjectUsedBy(BaseModel): class Project(BaseModel): - environment_class: Union[object, object, object] = FieldInfo(alias="environmentClass") + environment_class: object = FieldInfo(alias="environmentClass") id: Optional[str] = None """id is the unique identifier for the project""" diff --git a/src/gitpod/types/runner_configurations/environment_class_list_params.py b/src/gitpod/types/runner_configurations/environment_class_list_params.py index c31f0770..c348fd4b 100644 --- a/src/gitpod/types/runner_configurations/environment_class_list_params.py +++ b/src/gitpod/types/runner_configurations/environment_class_list_params.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Union from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -14,7 +13,7 @@ class EnvironmentClassListParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: Union[object, object] + filter: object pagination: Pagination """pagination contains the pagination options for listing environment classes""" diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index febc1726..e32257c1 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -80,7 +80,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -296,7 +296,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/environments/automations/test_task_executions.py b/tests/api_resources/environments/automations/test_task_executions.py index d3e7442e..e3ac1d50 100644 --- a/tests/api_resources/environments/automations/test_task_executions.py +++ b/tests/api_resources/environments/automations/test_task_executions.py @@ -79,7 +79,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -266,7 +266,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 2c05eedd..e893858f 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -186,7 +186,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -463,7 +463,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/organizations/test_members.py b/tests/api_resources/organizations/test_members.py index 7477de21..bb5da0f4 100644 --- a/tests/api_resources/organizations/test_members.py +++ b/tests/api_resources/organizations/test_members.py @@ -31,7 +31,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -79,7 +79,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/runner_configurations/test_environment_classes.py b/tests/api_resources/runner_configurations/test_environment_classes.py index 2d2d96e1..c1e7c536 100644 --- a/tests/api_resources/runner_configurations/test_environment_classes.py +++ b/tests/api_resources/runner_configurations/test_environment_classes.py @@ -81,7 +81,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={}, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -177,7 +177,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={}, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py index 03d373c9..8120572a 100644 --- a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py @@ -164,7 +164,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={}, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -380,7 +380,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={}, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index f4b93e21..410b9adb 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -30,7 +30,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: connect_protocol_version=1, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -78,7 +78,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N connect_protocol_version=1, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, diff --git a/tests/api_resources/test_environment_classes.py b/tests/api_resources/test_environment_classes.py index 281063fe..9be76d4c 100644 --- a/tests/api_resources/test_environment_classes.py +++ b/tests/api_resources/test_environment_classes.py @@ -31,7 +31,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={}, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -79,7 +79,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={}, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 61b64048..b6083536 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -183,7 +183,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -519,7 +519,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/test_personal_access_tokens.py b/tests/api_resources/test_personal_access_tokens.py index 42b26808..734793be 100644 --- a/tests/api_resources/test_personal_access_tokens.py +++ b/tests/api_resources/test_personal_access_tokens.py @@ -33,7 +33,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -121,7 +121,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index fc18a891..d58877bc 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -131,7 +131,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) @@ -521,7 +521,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, pagination={ "token": "token", - "page_size": 0, + "page_size": 100, }, connect_timeout_ms=0, ) From ef99c60596c8dc2d93beb561956599972a15d3f6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 13:12:56 +0000 Subject: [PATCH 051/505] feat(api): update via SDK Studio --- .stats.yml | 2 +- api.md | 19 +- src/gitpod/resources/environment_classes.py | 4 +- .../automations/task_executions.py | 141 ++++++- .../resources/organizations/__init__.py | 14 - src/gitpod/resources/organizations/members.py | 222 ---------- .../resources/organizations/organizations.py | 165 ++++++-- src/gitpod/resources/projects.py | 4 +- .../environment_classes.py | 203 +++++++++- .../host_authentication_tokens.py | 379 +++++++++++++++++- .../runner_configurations.py | 172 +++++++- .../runner_configurations/scm_integration.py | 143 ++++++- src/gitpod/resources/runners/runners.py | 127 +++++- src/gitpod/types/__init__.py | 2 + .../types/environment_class_list_params.py | 12 +- .../environment_create_from_project_params.py | 117 +++++- ...nvironment_create_from_project_response.py | 120 +++++- src/gitpod/types/environment_create_params.py | 117 +++++- .../types/environment_create_response.py | 120 +++++- src/gitpod/types/environment_list_response.py | 120 +++++- .../types/environment_retrieve_response.py | 120 +++++- .../environments/automation_upsert_params.py | 28 +- .../automations/service_list_response.py | 40 +- .../automations/service_update_params.py | 133 +++++- .../automations/task_create_params.py | 44 +- .../automations/task_create_response.py | 49 ++- .../task_execution_list_response.py | 59 ++- .../task_execution_retrieve_response.py | 59 ++- ...ion_update_task_execution_status_params.py | 33 +- .../automations/task_list_response.py | 40 +- .../automations/task_retrieve_response.py | 49 ++- .../automations/task_start_response.py | 59 ++- .../automations/task_update_params.py | 81 +++- ...py => organization_list_members_params.py} | 6 +- ... => organization_list_members_response.py} | 6 +- src/gitpod/types/organizations/__init__.py | 2 - ...roject_create_from_environment_response.py | 75 +++- src/gitpod/types/project_create_params.py | 80 +++- src/gitpod/types/project_create_response.py | 75 +++- src/gitpod/types/project_retrieve_response.py | 75 +++- .../runner_configuration_validate_params.py | 112 +++++- .../runner_configuration_validate_response.py | 68 +++- .../configuration_schema_create_response.py | 238 ++++++++++- .../configuration_schema_retrieve_response.py | 238 ++++++++++- .../environment_class_list_params.py | 12 +- .../environment_class_update_params.py | 32 +- .../host_authentication_token_list_params.py | 16 +- ...host_authentication_token_update_params.py | 123 +++++- .../scm_integration_create_params.py | 30 +- .../types/runner_update_runner_params.py | 79 +++- .../environments/automations/test_services.py | 12 +- .../automations/test_task_executions.py | 146 +++++-- .../environments/automations/test_tasks.py | 38 +- .../environments/test_automations.py | 28 +- .../organizations/test_members.py | 110 ----- .../test_environment_classes.py | 218 ++++++++-- .../test_host_authentication_tokens.py | 218 ++++++++-- .../test_scm_integration.py | 132 ++++-- .../api_resources/test_environment_classes.py | 4 +- tests/api_resources/test_environments.py | 84 +--- tests/api_resources/test_organizations.py | 91 +++++ tests/api_resources/test_projects.py | 46 +-- .../test_runner_configurations.py | 174 +++++--- tests/api_resources/test_runners.py | 126 ++++-- 64 files changed, 4739 insertions(+), 952 deletions(-) delete mode 100644 src/gitpod/resources/organizations/members.py rename src/gitpod/types/{organizations/member_list_params.py => organization_list_members_params.py} (87%) rename src/gitpod/types/{organizations/member_list_response.py => organization_list_members_response.py} (97%) delete mode 100644 tests/api_resources/organizations/test_members.py diff --git a/.stats.yml b/.stats.yml index 77a06efc..c91205c9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 54 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6d44c8845e1deee92c3e6406d5b67aa72616ec5e21ab8c722ae0a2c214c14784.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7e374f66c50c3d639f586ea9e146d57787b1b72a9edf1c552ba67ddd5bd4b190.yml diff --git a/api.md b/api.md index 92e91684..17d10f0c 100644 --- a/api.md +++ b/api.md @@ -133,26 +133,19 @@ Methods: Types: ```python -from gitpod.types import OrganizationLeaveResponse, OrganizationSetRoleResponse +from gitpod.types import ( + OrganizationLeaveResponse, + OrganizationListMembersResponse, + OrganizationSetRoleResponse, +) ``` Methods: - client.organizations.leave(\*\*params) -> object +- client.organizations.list_members(\*\*params) -> OrganizationListMembersResponse - client.organizations.set_role(\*\*params) -> object -## Members - -Types: - -```python -from gitpod.types.organizations import MemberListResponse -``` - -Methods: - -- client.organizations.members.list(\*\*params) -> MemberListResponse - ## Invite Types: diff --git a/src/gitpod/resources/environment_classes.py b/src/gitpod/resources/environment_classes.py index b7c91338..54e7fffc 100644 --- a/src/gitpod/resources/environment_classes.py +++ b/src/gitpod/resources/environment_classes.py @@ -52,7 +52,7 @@ def list( self, *, connect_protocol_version: Literal[1], - filter: object | NotGiven = NOT_GIVEN, + filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -132,7 +132,7 @@ async def list( self, *, connect_protocol_version: Literal[1], - filter: object | NotGiven = NOT_GIVEN, + filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/gitpod/resources/environments/automations/task_executions.py b/src/gitpod/resources/environments/automations/task_executions.py index cb17125c..f8c0c3c4 100644 --- a/src/gitpod/resources/environments/automations/task_executions.py +++ b/src/gitpod/resources/environments/automations/task_executions.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -206,10 +207,11 @@ def stop( cast_to=object, ) + @overload def update_task_execution_status( self, *, - body: task_execution_update_task_execution_status_params.Body, + failure_message: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -225,6 +227,12 @@ def update_task_execution_status( environment executing a task execution is expected to call this function. Args: + failure_message: failure_message marks the task execution as failed and provides a message + explaining the failure. + + If an individual step has failed, callers are NOT expected to set this message; + only if the task execution as a whole has failed/cannot be started. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -237,6 +245,60 @@ def update_task_execution_status( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update_task_execution_status( + self, + *, + log_url: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """UpdateTaskExecutionStatus updates the status of a task execution. + + Only the + environment executing a task execution is expected to call this function. + + Args: + log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task + either has no logs or has not yet started. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["failure_message", "connect_protocol_version"], ["log_url", "connect_protocol_version"]) + def update_task_execution_status( + self, + *, + failure_message: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + log_url: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -249,7 +311,11 @@ def update_task_execution_status( return self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", body=maybe_transform( - body, task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams + { + "failure_message": failure_message, + "log_url": log_url, + }, + task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -430,10 +496,11 @@ async def stop( cast_to=object, ) + @overload async def update_task_execution_status( self, *, - body: task_execution_update_task_execution_status_params.Body, + failure_message: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -449,6 +516,12 @@ async def update_task_execution_status( environment executing a task execution is expected to call this function. Args: + failure_message: failure_message marks the task execution as failed and provides a message + explaining the failure. + + If an individual step has failed, callers are NOT expected to set this message; + only if the task execution as a whole has failed/cannot be started. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -461,6 +534,60 @@ async def update_task_execution_status( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update_task_execution_status( + self, + *, + log_url: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """UpdateTaskExecutionStatus updates the status of a task execution. + + Only the + environment executing a task execution is expected to call this function. + + Args: + log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task + either has no logs or has not yet started. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["failure_message", "connect_protocol_version"], ["log_url", "connect_protocol_version"]) + async def update_task_execution_status( + self, + *, + failure_message: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + log_url: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -473,7 +600,11 @@ async def update_task_execution_status( return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", body=await async_maybe_transform( - body, task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams + { + "failure_message": failure_message, + "log_url": log_url, + }, + task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py index a7e31bb1..aa07d9ba 100644 --- a/src/gitpod/resources/organizations/__init__.py +++ b/src/gitpod/resources/organizations/__init__.py @@ -8,14 +8,6 @@ InviteResourceWithStreamingResponse, AsyncInviteResourceWithStreamingResponse, ) -from .members import ( - MembersResource, - AsyncMembersResource, - MembersResourceWithRawResponse, - AsyncMembersResourceWithRawResponse, - MembersResourceWithStreamingResponse, - AsyncMembersResourceWithStreamingResponse, -) from .organizations import ( OrganizationsResource, AsyncOrganizationsResource, @@ -26,12 +18,6 @@ ) __all__ = [ - "MembersResource", - "AsyncMembersResource", - "MembersResourceWithRawResponse", - "AsyncMembersResourceWithRawResponse", - "MembersResourceWithStreamingResponse", - "AsyncMembersResourceWithStreamingResponse", "InviteResource", "AsyncInviteResource", "InviteResourceWithRawResponse", diff --git a/src/gitpod/resources/organizations/members.py b/src/gitpod/resources/organizations/members.py deleted file mode 100644 index bb8b6076..00000000 --- a/src/gitpod/resources/organizations/members.py +++ /dev/null @@ -1,222 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.organizations import member_list_params -from ...types.organizations.member_list_response import MemberListResponse - -__all__ = ["MembersResource", "AsyncMembersResource"] - - -class MembersResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> MembersResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return MembersResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> MembersResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return MembersResourceWithStreamingResponse(self) - - def list( - self, - *, - connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, - pagination: member_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberListResponse: - """ - ListMembers lists all members of the specified organization. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - organization_id: organization_id is the ID of the organization to list members for - - pagination: pagination contains the pagination options for listing members - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.OrganizationService/ListMembers", - body=maybe_transform( - { - "organization_id": organization_id, - "pagination": pagination, - }, - member_list_params.MemberListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=MemberListResponse, - ) - - -class AsyncMembersResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncMembersResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncMembersResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncMembersResourceWithStreamingResponse(self) - - async def list( - self, - *, - connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, - pagination: member_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberListResponse: - """ - ListMembers lists all members of the specified organization. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - organization_id: organization_id is the ID of the organization to list members for - - pagination: pagination contains the pagination options for listing members - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.OrganizationService/ListMembers", - body=await async_maybe_transform( - { - "organization_id": organization_id, - "pagination": pagination, - }, - member_list_params.MemberListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=MemberListResponse, - ) - - -class MembersResourceWithRawResponse: - def __init__(self, members: MembersResource) -> None: - self._members = members - - self.list = to_raw_response_wrapper( - members.list, - ) - - -class AsyncMembersResourceWithRawResponse: - def __init__(self, members: AsyncMembersResource) -> None: - self._members = members - - self.list = async_to_raw_response_wrapper( - members.list, - ) - - -class MembersResourceWithStreamingResponse: - def __init__(self, members: MembersResource) -> None: - self._members = members - - self.list = to_streamed_response_wrapper( - members.list, - ) - - -class AsyncMembersResourceWithStreamingResponse: - def __init__(self, members: AsyncMembersResource) -> None: - self._members = members - - self.list = async_to_streamed_response_wrapper( - members.list, - ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index b218c61f..c081923a 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -6,14 +6,10 @@ import httpx -from ...types import organization_leave_params, organization_set_role_params -from .members import ( - MembersResource, - AsyncMembersResource, - MembersResourceWithRawResponse, - AsyncMembersResourceWithRawResponse, - MembersResourceWithStreamingResponse, - AsyncMembersResourceWithStreamingResponse, +from ...types import ( + organization_leave_params, + organization_set_role_params, + organization_list_members_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( @@ -39,15 +35,12 @@ AsyncInviteResourceWithStreamingResponse, ) from ..._base_client import make_request_options +from ...types.organization_list_members_response import OrganizationListMembersResponse __all__ = ["OrganizationsResource", "AsyncOrganizationsResource"] class OrganizationsResource(SyncAPIResource): - @cached_property - def members(self) -> MembersResource: - return MembersResource(self._client) - @cached_property def invite(self) -> InviteResource: return InviteResource(self._client) @@ -118,6 +111,64 @@ def leave( cast_to=object, ) + def list_members( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationListMembersResponse: + """ + ListMembers lists all members of the specified organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + organization_id: organization_id is the ID of the organization to list members for + + pagination: pagination contains the pagination options for listing members + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/ListMembers", + body=maybe_transform( + { + "organization_id": organization_id, + "pagination": pagination, + }, + organization_list_members_params.OrganizationListMembersParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=OrganizationListMembersResponse, + ) + def set_role( self, *, @@ -177,10 +228,6 @@ def set_role( class AsyncOrganizationsResource(AsyncAPIResource): - @cached_property - def members(self) -> AsyncMembersResource: - return AsyncMembersResource(self._client) - @cached_property def invite(self) -> AsyncInviteResource: return AsyncInviteResource(self._client) @@ -251,6 +298,64 @@ async def leave( cast_to=object, ) + async def list_members( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationListMembersResponse: + """ + ListMembers lists all members of the specified organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + organization_id: organization_id is the ID of the organization to list members for + + pagination: pagination contains the pagination options for listing members + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/ListMembers", + body=await async_maybe_transform( + { + "organization_id": organization_id, + "pagination": pagination, + }, + organization_list_members_params.OrganizationListMembersParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=OrganizationListMembersResponse, + ) + async def set_role( self, *, @@ -316,14 +421,13 @@ def __init__(self, organizations: OrganizationsResource) -> None: self.leave = to_raw_response_wrapper( organizations.leave, ) + self.list_members = to_raw_response_wrapper( + organizations.list_members, + ) self.set_role = to_raw_response_wrapper( organizations.set_role, ) - @cached_property - def members(self) -> MembersResourceWithRawResponse: - return MembersResourceWithRawResponse(self._organizations.members) - @cached_property def invite(self) -> InviteResourceWithRawResponse: return InviteResourceWithRawResponse(self._organizations.invite) @@ -336,14 +440,13 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: self.leave = async_to_raw_response_wrapper( organizations.leave, ) + self.list_members = async_to_raw_response_wrapper( + organizations.list_members, + ) self.set_role = async_to_raw_response_wrapper( organizations.set_role, ) - @cached_property - def members(self) -> AsyncMembersResourceWithRawResponse: - return AsyncMembersResourceWithRawResponse(self._organizations.members) - @cached_property def invite(self) -> AsyncInviteResourceWithRawResponse: return AsyncInviteResourceWithRawResponse(self._organizations.invite) @@ -356,14 +459,13 @@ def __init__(self, organizations: OrganizationsResource) -> None: self.leave = to_streamed_response_wrapper( organizations.leave, ) + self.list_members = to_streamed_response_wrapper( + organizations.list_members, + ) self.set_role = to_streamed_response_wrapper( organizations.set_role, ) - @cached_property - def members(self) -> MembersResourceWithStreamingResponse: - return MembersResourceWithStreamingResponse(self._organizations.members) - @cached_property def invite(self) -> InviteResourceWithStreamingResponse: return InviteResourceWithStreamingResponse(self._organizations.invite) @@ -376,14 +478,13 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: self.leave = async_to_streamed_response_wrapper( organizations.leave, ) + self.list_members = async_to_streamed_response_wrapper( + organizations.list_members, + ) self.set_role = async_to_streamed_response_wrapper( organizations.set_role, ) - @cached_property - def members(self) -> AsyncMembersResourceWithStreamingResponse: - return AsyncMembersResourceWithStreamingResponse(self._organizations.members) - @cached_property def invite(self) -> AsyncInviteResourceWithStreamingResponse: return AsyncInviteResourceWithStreamingResponse(self._organizations.invite) diff --git a/src/gitpod/resources/projects.py b/src/gitpod/resources/projects.py index f6757983..cb1195af 100644 --- a/src/gitpod/resources/projects.py +++ b/src/gitpod/resources/projects.py @@ -57,7 +57,7 @@ def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: def create( self, *, - environment_class: object, + environment_class: project_create_params.EnvironmentClass, initializer: project_create_params.Initializer, connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, @@ -259,7 +259,7 @@ def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: async def create( self, *, - environment_class: object, + environment_class: project_create_params.EnvironmentClass, initializer: project_create_params.Initializer, connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, diff --git a/src/gitpod/resources/runner_configurations/environment_classes.py b/src/gitpod/resources/runner_configurations/environment_classes.py index c1ecfdd8..a5a67325 100644 --- a/src/gitpod/resources/runner_configurations/environment_classes.py +++ b/src/gitpod/resources/runner_configurations/environment_classes.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -48,10 +49,11 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp """ return EnvironmentClassesResourceWithStreamingResponse(self) + @overload def update( self, *, - body: environment_class_update_params.Body, + description: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,6 +79,92 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + *, + display_name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + enabled: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["description", "connect_protocol_version"], + ["display_name", "connect_protocol_version"], + ["enabled", "connect_protocol_version"], + ) + def update( + self, + *, + description: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + display_name: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -88,7 +176,14 @@ def update( } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", - body=maybe_transform(body, environment_class_update_params.EnvironmentClassUpdateParams), + body=maybe_transform( + { + "description": description, + "display_name": display_name, + "enabled": enabled, + }, + environment_class_update_params.EnvironmentClassUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -99,7 +194,7 @@ def list( self, *, connect_protocol_version: Literal[1], - filter: object | NotGiven = NOT_GIVEN, + filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -174,10 +269,11 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin """ return AsyncEnvironmentClassesResourceWithStreamingResponse(self) + @overload async def update( self, *, - body: environment_class_update_params.Body, + description: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -203,6 +299,92 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + *, + display_name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + enabled: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["description", "connect_protocol_version"], + ["display_name", "connect_protocol_version"], + ["enabled", "connect_protocol_version"], + ) + async def update( + self, + *, + description: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + display_name: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -214,7 +396,14 @@ async def update( } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", - body=await async_maybe_transform(body, environment_class_update_params.EnvironmentClassUpdateParams), + body=await async_maybe_transform( + { + "description": description, + "display_name": display_name, + "enabled": enabled, + }, + environment_class_update_params.EnvironmentClassUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -225,7 +414,7 @@ async def list( self, *, connect_protocol_version: Literal[1], - filter: object | NotGiven = NOT_GIVEN, + filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py index 43d226f4..09b54440 100644 --- a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py @@ -2,13 +2,16 @@ from __future__ import annotations -from typing_extensions import Literal +from typing import Union +from datetime import datetime +from typing_extensions import Literal, overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -158,10 +161,11 @@ def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) + @overload def update( self, *, - body: host_authentication_token_update_params.Body, + expires_at: Union[str, datetime], connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -175,6 +179,96 @@ def update( UpdateHostAuthenticationToken Args: + expires_at: A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -187,6 +281,92 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + *, + refresh_token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["expires_at", "connect_protocol_version"], + ["refresh_token", "connect_protocol_version"], + ["token", "connect_protocol_version"], + ) + def update( + self, + *, + expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + refresh_token: str | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -198,7 +378,14 @@ def update( } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", - body=maybe_transform(body, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams), + body=maybe_transform( + { + "expires_at": expires_at, + "refresh_token": refresh_token, + "token": token, + }, + host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -427,10 +614,11 @@ async def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) + @overload async def update( self, *, - body: host_authentication_token_update_params.Body, + expires_at: Union[str, datetime], connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -444,6 +632,96 @@ async def update( UpdateHostAuthenticationToken Args: + expires_at: A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -456,6 +734,92 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + *, + refresh_token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["expires_at", "connect_protocol_version"], + ["refresh_token", "connect_protocol_version"], + ["token", "connect_protocol_version"], + ) + async def update( + self, + *, + expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + refresh_token: str | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -468,7 +832,12 @@ async def update( return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=await async_maybe_transform( - body, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams + { + "expires_at": expires_at, + "refresh_token": refresh_token, + "token": token, + }, + host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/gitpod/resources/runner_configurations/runner_configurations.py b/src/gitpod/resources/runner_configurations/runner_configurations.py index 92482d9b..1b3a2871 100644 --- a/src/gitpod/resources/runner_configurations/runner_configurations.py +++ b/src/gitpod/resources/runner_configurations/runner_configurations.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing_extensions import Literal +from typing import Any, cast +from typing_extensions import Literal, overload import httpx @@ -10,6 +11,7 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -96,11 +98,13 @@ def with_streaming_response(self) -> RunnerConfigurationsResourceWithStreamingRe """ return RunnerConfigurationsResourceWithStreamingResponse(self) + @overload def validate( self, *, - body: runner_configuration_validate_params.Body, + environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass, connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -129,6 +133,61 @@ def validate( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def validate( + self, + *, + scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) + + with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) + def validate( + self, + *, + environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: extra_headers = { **strip_not_given( { @@ -138,13 +197,25 @@ def validate( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", - body=maybe_transform(body, runner_configuration_validate_params.RunnerConfigurationValidateParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + return cast( + RunnerConfigurationValidateResponse, + self._post( + "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", + body=maybe_transform( + { + "environment_class": environment_class, + "runner_id": runner_id, + "scm_integration": scm_integration, + }, + runner_configuration_validate_params.RunnerConfigurationValidateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, RunnerConfigurationValidateResponse + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=RunnerConfigurationValidateResponse, ) @@ -184,11 +255,13 @@ def with_streaming_response(self) -> AsyncRunnerConfigurationsResourceWithStream """ return AsyncRunnerConfigurationsResourceWithStreamingResponse(self) + @overload async def validate( self, *, - body: runner_configuration_validate_params.Body, + environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass, connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -217,6 +290,61 @@ async def validate( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def validate( + self, + *, + scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) + + with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) + async def validate( + self, + *, + environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunnerConfigurationValidateResponse: extra_headers = { **strip_not_given( { @@ -226,15 +354,25 @@ async def validate( ), **(extra_headers or {}), } - return await self._post( - "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", - body=await async_maybe_transform( - body, runner_configuration_validate_params.RunnerConfigurationValidateParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + return cast( + RunnerConfigurationValidateResponse, + await self._post( + "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", + body=await async_maybe_transform( + { + "environment_class": environment_class, + "runner_id": runner_id, + "scm_integration": scm_integration, + }, + runner_configuration_validate_params.RunnerConfigurationValidateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, RunnerConfigurationValidateResponse + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=RunnerConfigurationValidateResponse, ) diff --git a/src/gitpod/resources/runner_configurations/scm_integration.py b/src/gitpod/resources/runner_configurations/scm_integration.py index faf0f971..3a801fa9 100644 --- a/src/gitpod/resources/runner_configurations/scm_integration.py +++ b/src/gitpod/resources/runner_configurations/scm_integration.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -48,10 +49,11 @@ def with_streaming_response(self) -> ScmIntegrationResourceWithStreamingResponse """ return ScmIntegrationResourceWithStreamingResponse(self) + @overload def create( self, *, - body: scm_integration_create_params.Body, + oauth_client_id: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -65,6 +67,46 @@ def create( CreateSCMIntegration creates a new SCM integration on a runner. Args: + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_plaintext_client_secret must also be set. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. + + This will first be encrypted with the runner's public key before being stored. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -77,6 +119,25 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] + ) + def create( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: extra_headers = { **strip_not_given( { @@ -88,7 +149,13 @@ def create( } return self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", - body=maybe_transform(body, scm_integration_create_params.ScmIntegrationCreateParams), + body=maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + }, + scm_integration_create_params.ScmIntegrationCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -116,10 +183,11 @@ def with_streaming_response(self) -> AsyncScmIntegrationResourceWithStreamingRes """ return AsyncScmIntegrationResourceWithStreamingResponse(self) + @overload async def create( self, *, - body: scm_integration_create_params.Body, + oauth_client_id: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -133,6 +201,46 @@ async def create( CreateSCMIntegration creates a new SCM integration on a runner. Args: + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_plaintext_client_secret must also be set. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. + + This will first be encrypted with the runner's public key before being stored. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -145,6 +253,25 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] + ) + async def create( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: extra_headers = { **strip_not_given( { @@ -156,7 +283,13 @@ async def create( } return await self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", - body=await async_maybe_transform(body, scm_integration_create_params.ScmIntegrationCreateParams), + body=await async_maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + }, + scm_integration_create_params.ScmIntegrationCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index d35f2d9b..c0042ba4 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx @@ -20,6 +20,7 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -527,10 +528,45 @@ def parse_context_url( cast_to=RunnerParseContextURLResponse, ) + @overload def update_runner( self, *, - body: runner_update_runner_params.Body, + name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunner updates an environment runner. + + Args: + name: The runner's name which is shown to users + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update_runner( + self, + *, + spec: runner_update_runner_params.SpecSpec, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -556,6 +592,23 @@ def update_runner( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + def update_runner( + self, + *, + name: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: runner_update_runner_params.SpecSpec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -567,7 +620,13 @@ def update_runner( } return self._post( "/gitpod.v1.RunnerService/UpdateRunner", - body=maybe_transform(body, runner_update_runner_params.RunnerUpdateRunnerParams), + body=maybe_transform( + { + "name": name, + "spec": spec, + }, + runner_update_runner_params.RunnerUpdateRunnerParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1050,10 +1109,45 @@ async def parse_context_url( cast_to=RunnerParseContextURLResponse, ) + @overload async def update_runner( self, *, - body: runner_update_runner_params.Body, + name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunner updates an environment runner. + + Args: + name: The runner's name which is shown to users + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update_runner( + self, + *, + spec: runner_update_runner_params.SpecSpec, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1079,6 +1173,23 @@ async def update_runner( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + async def update_runner( + self, + *, + name: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: runner_update_runner_params.SpecSpec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -1090,7 +1201,13 @@ async def update_runner( } return await self._post( "/gitpod.v1.RunnerService/UpdateRunner", - body=await async_maybe_transform(body, runner_update_runner_params.RunnerUpdateRunnerParams), + body=await async_maybe_transform( + { + "name": name, + "spec": spec, + }, + runner_update_runner_params.RunnerUpdateRunnerParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index e184d631..449a944e 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -32,9 +32,11 @@ from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams from .identity_exchange_token_response import IdentityExchangeTokenResponse as IdentityExchangeTokenResponse +from .organization_list_members_params import OrganizationListMembersParams as OrganizationListMembersParams from .personal_access_token_list_params import PersonalAccessTokenListParams as PersonalAccessTokenListParams from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse +from .organization_list_members_response import OrganizationListMembersResponse as OrganizationListMembersResponse from .personal_access_token_delete_params import PersonalAccessTokenDeleteParams as PersonalAccessTokenDeleteParams from .personal_access_token_list_response import PersonalAccessTokenListResponse as PersonalAccessTokenListResponse from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse diff --git a/src/gitpod/types/environment_class_list_params.py b/src/gitpod/types/environment_class_list_params.py index 0b6e8bff..82acdd22 100644 --- a/src/gitpod/types/environment_class_list_params.py +++ b/src/gitpod/types/environment_class_list_params.py @@ -6,14 +6,14 @@ from .._utils import PropertyInfo -__all__ = ["EnvironmentClassListParams", "Pagination"] +__all__ = ["EnvironmentClassListParams", "Filter", "Pagination"] class EnvironmentClassListParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: object + filter: Filter pagination: Pagination """pagination contains the pagination options for listing environment classes""" @@ -22,6 +22,14 @@ class EnvironmentClassListParams(TypedDict, total=False): """Define the timeout, in ms""" +class Filter(TypedDict, total=False): + enabled: Required[bool] + """enabled filters the response to only enabled or disabled environment classes. + + If not set, all environment classes are returned. + """ + + class Pagination(TypedDict, total=False): token: str """Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index 4a26e700..3886c64d 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo @@ -14,10 +14,17 @@ "SpecContent", "SpecContentInitializer", "SpecContentInitializerSpec", + "SpecContentInitializerSpecContextURL", + "SpecContentInitializerSpecContextURLContextURL", + "SpecContentInitializerSpecGit", + "SpecContentInitializerSpecGitGit", "SpecDevcontainer", "SpecMachine", "SpecPort", "SpecSecret", + "SpecSecretEnvironmentVariable", + "SpecSecretFilePath", + "SpecSecretGitCredentialHost", "SpecSSHPublicKey", "SpecTimeout", ] @@ -55,8 +62,49 @@ class SpecAutomationsFile(TypedDict, total=False): session: str -class SpecContentInitializerSpec: - pass +class SpecContentInitializerSpecContextURLContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class SpecContentInitializerSpecContextURL(TypedDict, total=False): + context_url: Required[Annotated[SpecContentInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] + + +class SpecContentInitializerSpecGitGit(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class SpecContentInitializerSpecGit(TypedDict, total=False): + git: Required[SpecContentInitializerSpecGitGit] + + +SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] class SpecContentInitializer(TypedDict, total=False): @@ -114,8 +162,65 @@ class SpecPort(TypedDict, total=False): """port number""" -class SpecSecret: - pass +class SpecSecretEnvironmentVariable(TypedDict, total=False): + environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] + + name: str + """name is the human readable description of the secret""" + + session: str + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: str + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class SpecSecretFilePath(TypedDict, total=False): + file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: str + """name is the human readable description of the secret""" + + session: str + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: str + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class SpecSecretGitCredentialHost(TypedDict, total=False): + git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] + + name: str + """name is the human readable description of the secret""" + + session: str + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: str + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +SpecSecret: TypeAlias = Union[SpecSecretEnvironmentVariable, SpecSecretFilePath, SpecSecretGitCredentialHost] class SpecSSHPublicKey(TypedDict, total=False): diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index c15fc515..d047640b 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -18,10 +18,17 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", + "EnvironmentSpecContentInitializerSpecContextURL", + "EnvironmentSpecContentInitializerSpecContextURLContextURL", + "EnvironmentSpecContentInitializerSpecGit", + "EnvironmentSpecContentInitializerSpecGitGit", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", + "EnvironmentSpecSecretEnvironmentVariable", + "EnvironmentSpecSecretFilePath", + "EnvironmentSpecSecretGitCredentialHost", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -291,8 +298,50 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpec: - pass +class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") + + +class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class EnvironmentSpecContentInitializerSpecGit(BaseModel): + git: EnvironmentSpecContentInitializerSpecGitGit + + +EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ + EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit +] class EnvironmentSpecContentInitializer(BaseModel): @@ -346,8 +395,67 @@ class EnvironmentSpecPort(BaseModel): """port number""" -class EnvironmentSpecSecret: - pass +class EnvironmentSpecSecretEnvironmentVariable(BaseModel): + environment_variable: str = FieldInfo(alias="environmentVariable") + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretFilePath(BaseModel): + file_path: str = FieldInfo(alias="filePath") + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretGitCredentialHost(BaseModel): + git_credential_host: str = FieldInfo(alias="gitCredentialHost") + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +EnvironmentSpecSecret: TypeAlias = Union[ + EnvironmentSpecSecretEnvironmentVariable, EnvironmentSpecSecretFilePath, EnvironmentSpecSecretGitCredentialHost +] class EnvironmentSpecSSHPublicKey(BaseModel): diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index 068e97bc..e45f4aa9 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo @@ -14,10 +14,17 @@ "SpecContent", "SpecContentInitializer", "SpecContentInitializerSpec", + "SpecContentInitializerSpecContextURL", + "SpecContentInitializerSpecContextURLContextURL", + "SpecContentInitializerSpecGit", + "SpecContentInitializerSpecGitGit", "SpecDevcontainer", "SpecMachine", "SpecPort", "SpecSecret", + "SpecSecretEnvironmentVariable", + "SpecSecretFilePath", + "SpecSecretGitCredentialHost", "SpecSSHPublicKey", "SpecTimeout", ] @@ -53,8 +60,49 @@ class SpecAutomationsFile(TypedDict, total=False): session: str -class SpecContentInitializerSpec: - pass +class SpecContentInitializerSpecContextURLContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class SpecContentInitializerSpecContextURL(TypedDict, total=False): + context_url: Required[Annotated[SpecContentInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] + + +class SpecContentInitializerSpecGitGit(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class SpecContentInitializerSpecGit(TypedDict, total=False): + git: Required[SpecContentInitializerSpecGitGit] + + +SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] class SpecContentInitializer(TypedDict, total=False): @@ -112,8 +160,65 @@ class SpecPort(TypedDict, total=False): """port number""" -class SpecSecret: - pass +class SpecSecretEnvironmentVariable(TypedDict, total=False): + environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] + + name: str + """name is the human readable description of the secret""" + + session: str + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: str + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class SpecSecretFilePath(TypedDict, total=False): + file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: str + """name is the human readable description of the secret""" + + session: str + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: str + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class SpecSecretGitCredentialHost(TypedDict, total=False): + git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] + + name: str + """name is the human readable description of the secret""" + + session: str + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: str + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +SpecSecret: TypeAlias = Union[SpecSecretEnvironmentVariable, SpecSecretFilePath, SpecSecretGitCredentialHost] class SpecSSHPublicKey(TypedDict, total=False): diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index 6b9ce0cc..d33eedeb 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -18,10 +18,17 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", + "EnvironmentSpecContentInitializerSpecContextURL", + "EnvironmentSpecContentInitializerSpecContextURLContextURL", + "EnvironmentSpecContentInitializerSpecGit", + "EnvironmentSpecContentInitializerSpecGitGit", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", + "EnvironmentSpecSecretEnvironmentVariable", + "EnvironmentSpecSecretFilePath", + "EnvironmentSpecSecretGitCredentialHost", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -291,8 +298,50 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpec: - pass +class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") + + +class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class EnvironmentSpecContentInitializerSpecGit(BaseModel): + git: EnvironmentSpecContentInitializerSpecGitGit + + +EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ + EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit +] class EnvironmentSpecContentInitializer(BaseModel): @@ -346,8 +395,67 @@ class EnvironmentSpecPort(BaseModel): """port number""" -class EnvironmentSpecSecret: - pass +class EnvironmentSpecSecretEnvironmentVariable(BaseModel): + environment_variable: str = FieldInfo(alias="environmentVariable") + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretFilePath(BaseModel): + file_path: str = FieldInfo(alias="filePath") + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretGitCredentialHost(BaseModel): + git_credential_host: str = FieldInfo(alias="gitCredentialHost") + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +EnvironmentSpecSecret: TypeAlias = Union[ + EnvironmentSpecSecretEnvironmentVariable, EnvironmentSpecSecretFilePath, EnvironmentSpecSecretGitCredentialHost +] class EnvironmentSpecSSHPublicKey(BaseModel): diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py index a0571591..f3e5bc14 100644 --- a/src/gitpod/types/environment_list_response.py +++ b/src/gitpod/types/environment_list_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -18,10 +18,17 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", + "EnvironmentSpecContentInitializerSpecContextURL", + "EnvironmentSpecContentInitializerSpecContextURLContextURL", + "EnvironmentSpecContentInitializerSpecGit", + "EnvironmentSpecContentInitializerSpecGitGit", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", + "EnvironmentSpecSecretEnvironmentVariable", + "EnvironmentSpecSecretFilePath", + "EnvironmentSpecSecretGitCredentialHost", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -292,8 +299,50 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpec: - pass +class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") + + +class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class EnvironmentSpecContentInitializerSpecGit(BaseModel): + git: EnvironmentSpecContentInitializerSpecGitGit + + +EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ + EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit +] class EnvironmentSpecContentInitializer(BaseModel): @@ -347,8 +396,67 @@ class EnvironmentSpecPort(BaseModel): """port number""" -class EnvironmentSpecSecret: - pass +class EnvironmentSpecSecretEnvironmentVariable(BaseModel): + environment_variable: str = FieldInfo(alias="environmentVariable") + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretFilePath(BaseModel): + file_path: str = FieldInfo(alias="filePath") + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretGitCredentialHost(BaseModel): + git_credential_host: str = FieldInfo(alias="gitCredentialHost") + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +EnvironmentSpecSecret: TypeAlias = Union[ + EnvironmentSpecSecretEnvironmentVariable, EnvironmentSpecSecretFilePath, EnvironmentSpecSecretGitCredentialHost +] class EnvironmentSpecSSHPublicKey(BaseModel): diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index 343f1a2c..8ec16fbc 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -18,10 +18,17 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", + "EnvironmentSpecContentInitializerSpecContextURL", + "EnvironmentSpecContentInitializerSpecContextURLContextURL", + "EnvironmentSpecContentInitializerSpecGit", + "EnvironmentSpecContentInitializerSpecGitGit", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", + "EnvironmentSpecSecretEnvironmentVariable", + "EnvironmentSpecSecretFilePath", + "EnvironmentSpecSecretGitCredentialHost", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -291,8 +298,50 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpec: - pass +class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") + + +class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class EnvironmentSpecContentInitializerSpecGit(BaseModel): + git: EnvironmentSpecContentInitializerSpecGitGit + + +EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ + EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit +] class EnvironmentSpecContentInitializer(BaseModel): @@ -346,8 +395,67 @@ class EnvironmentSpecPort(BaseModel): """port number""" -class EnvironmentSpecSecret: - pass +class EnvironmentSpecSecretEnvironmentVariable(BaseModel): + environment_variable: str = FieldInfo(alias="environmentVariable") + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretFilePath(BaseModel): + file_path: str = FieldInfo(alias="filePath") + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretGitCredentialHost(BaseModel): + git_credential_host: str = FieldInfo(alias="gitCredentialHost") + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +EnvironmentSpecSecret: TypeAlias = Union[ + EnvironmentSpecSecretEnvironmentVariable, EnvironmentSpecSecretFilePath, EnvironmentSpecSecretGitCredentialHost +] class EnvironmentSpecSSHPublicKey(BaseModel): diff --git a/src/gitpod/types/environments/automation_upsert_params.py b/src/gitpod/types/environments/automation_upsert_params.py index 1be42d07..3285979c 100644 --- a/src/gitpod/types/environments/automation_upsert_params.py +++ b/src/gitpod/types/environments/automation_upsert_params.py @@ -12,7 +12,11 @@ "AutomationsFile", "AutomationsFileServices", "AutomationsFileServicesCommands", + "AutomationsFileServicesRunsOn", + "AutomationsFileServicesRunsOnDocker", "AutomationsFileTasks", + "AutomationsFileTasksRunsOn", + "AutomationsFileTasksRunsOnDocker", ] @@ -69,6 +73,16 @@ class AutomationsFileServicesCommands(TypedDict, total=False): """ +class AutomationsFileServicesRunsOnDocker(TypedDict, total=False): + environment: List[str] + + image: str + + +class AutomationsFileServicesRunsOn(TypedDict, total=False): + docker: Required[AutomationsFileServicesRunsOnDocker] + + class AutomationsFileServices(TypedDict, total=False): commands: AutomationsFileServicesCommands @@ -76,11 +90,21 @@ class AutomationsFileServices(TypedDict, total=False): name: str - runs_on: Annotated[object, PropertyInfo(alias="runsOn")] + runs_on: Annotated[AutomationsFileServicesRunsOn, PropertyInfo(alias="runsOn")] triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] +class AutomationsFileTasksRunsOnDocker(TypedDict, total=False): + environment: List[str] + + image: str + + +class AutomationsFileTasksRunsOn(TypedDict, total=False): + docker: Required[AutomationsFileTasksRunsOnDocker] + + class AutomationsFileTasks(TypedDict, total=False): command: str @@ -90,7 +114,7 @@ class AutomationsFileTasks(TypedDict, total=False): name: str - runs_on: Annotated[object, PropertyInfo(alias="runsOn")] + runs_on: Annotated[AutomationsFileTasksRunsOn, PropertyInfo(alias="runsOn")] triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] diff --git a/src/gitpod/types/environments/automations/service_list_response.py b/src/gitpod/types/environments/automations/service_list_response.py index 54e3a7cd..3ee87638 100644 --- a/src/gitpod/types/environments/automations/service_list_response.py +++ b/src/gitpod/types/environments/automations/service_list_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -15,8 +15,13 @@ "ServiceMetadata", "ServiceMetadataCreator", "ServiceMetadataTriggeredBy", + "ServiceMetadataTriggeredByManual", + "ServiceMetadataTriggeredByPostDevcontainerStart", + "ServiceMetadataTriggeredByPostEnvironmentStart", "ServiceSpec", "ServiceSpecCommands", + "ServiceSpecRunsOn", + "ServiceSpecRunsOnDocker", "ServiceStatus", ] @@ -46,8 +51,23 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class ServiceMetadataTriggeredBy: - pass +class ServiceMetadataTriggeredByManual(BaseModel): + manual: bool + + +class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + + +class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): + post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + + +ServiceMetadataTriggeredBy: TypeAlias = Union[ + ServiceMetadataTriggeredByManual, + ServiceMetadataTriggeredByPostDevcontainerStart, + ServiceMetadataTriggeredByPostEnvironmentStart, +] class ServiceMetadata(BaseModel): @@ -207,6 +227,16 @@ class ServiceSpecCommands(BaseModel): """ +class ServiceSpecRunsOnDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class ServiceSpecRunsOn(BaseModel): + docker: ServiceSpecRunsOnDocker + + class ServiceSpec(BaseModel): commands: Optional[ServiceSpecCommands] = None """ @@ -230,7 +260,7 @@ class ServiceSpec(BaseModel): Used to start or stop the service. """ - runs_on: Optional[object] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[ServiceSpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the service should run on.""" session: Optional[str] = None diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index 6cad65fa..e31fb35d 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -2,11 +2,37 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["ServiceUpdateParams", "Metadata", "Spec", "Status"] +__all__ = [ + "ServiceUpdateParams", + "Metadata", + "MetadataDescription", + "MetadataName", + "MetadataTriggeredBy", + "MetadataTriggeredByTriggeredBy", + "MetadataTriggeredByTriggeredByTrigger", + "MetadataTriggeredByTriggeredByTriggerManual", + "MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart", + "MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart", + "Spec", + "SpecCommands", + "SpecCommandsCommands", + "SpecCommandsCommandsReady", + "SpecCommandsCommandsStart", + "SpecCommandsCommandsStop", + "SpecRunsOn", + "SpecRunsOnRunsOn", + "SpecRunsOnRunsOnDocker", + "Status", + "StatusFailureMessage", + "StatusLogURL", + "StatusPhase", + "StatusSession", +] class ServiceUpdateParams(TypedDict, total=False): @@ -37,13 +63,104 @@ class ServiceUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Metadata: - pass +class MetadataDescription(TypedDict, total=False): + description: Required[str] -class Spec: - pass +class MetadataName(TypedDict, total=False): + name: Required[str] -class Status: - pass +class MetadataTriggeredByTriggeredByTriggerManual(TypedDict, total=False): + manual: Required[bool] + + +class MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart(TypedDict, total=False): + post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] + + +class MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart(TypedDict, total=False): + post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] + + +MetadataTriggeredByTriggeredByTrigger: TypeAlias = Union[ + MetadataTriggeredByTriggeredByTriggerManual, + MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart, + MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart, +] + + +class MetadataTriggeredByTriggeredBy(TypedDict, total=False): + trigger: Iterable[MetadataTriggeredByTriggeredByTrigger] + + +class MetadataTriggeredBy(TypedDict, total=False): + triggered_by: Required[Annotated[MetadataTriggeredByTriggeredBy, PropertyInfo(alias="triggeredBy")]] + + +Metadata: TypeAlias = Union[MetadataDescription, MetadataName, MetadataTriggeredBy] + + +class SpecCommandsCommandsReady(TypedDict, total=False): + ready: Required[str] + + +class SpecCommandsCommandsStart(TypedDict, total=False): + start: Required[str] + + +class SpecCommandsCommandsStop(TypedDict, total=False): + stop: Required[str] + + +SpecCommandsCommands: TypeAlias = Union[SpecCommandsCommandsReady, SpecCommandsCommandsStart, SpecCommandsCommandsStop] + + +class SpecCommands(TypedDict, total=False): + commands: Required[SpecCommandsCommands] + + +class SpecRunsOnRunsOnDocker(TypedDict, total=False): + environment: List[str] + + image: str + + +class SpecRunsOnRunsOn(TypedDict, total=False): + docker: Required[SpecRunsOnRunsOnDocker] + + +class SpecRunsOn(TypedDict, total=False): + runs_on: Required[Annotated[SpecRunsOnRunsOn, PropertyInfo(alias="runsOn")]] + + +Spec: TypeAlias = Union[SpecCommands, SpecRunsOn] + + +class StatusFailureMessage(TypedDict, total=False): + failure_message: Required[Annotated[str, PropertyInfo(alias="failureMessage")]] + + +class StatusLogURL(TypedDict, total=False): + log_url: Required[Annotated[str, PropertyInfo(alias="logUrl")]] + + +class StatusPhase(TypedDict, total=False): + phase: Required[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] + + +class StatusSession(TypedDict, total=False): + session: Required[str] + + +Status: TypeAlias = Union[StatusFailureMessage, StatusLogURL, StatusPhase, StatusSession] diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index 73e3a894..a1d9bf64 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -4,11 +4,22 @@ from typing import List, Union, Iterable from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["TaskCreateParams", "Metadata", "MetadataCreator", "MetadataTriggeredBy", "Spec"] +__all__ = [ + "TaskCreateParams", + "Metadata", + "MetadataCreator", + "MetadataTriggeredBy", + "MetadataTriggeredByManual", + "MetadataTriggeredByPostDevcontainerStart", + "MetadataTriggeredByPostEnvironmentStart", + "Spec", + "SpecRunsOn", + "SpecRunsOnDocker", +] class TaskCreateParams(TypedDict, total=False): @@ -42,8 +53,21 @@ class MetadataCreator(TypedDict, total=False): """Principal is the principal of the subject""" -class MetadataTriggeredBy: - pass +class MetadataTriggeredByManual(TypedDict, total=False): + manual: Required[bool] + + +class MetadataTriggeredByPostDevcontainerStart(TypedDict, total=False): + post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] + + +class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): + post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] + + +MetadataTriggeredBy: TypeAlias = Union[ + MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart +] class Metadata(TypedDict, total=False): @@ -170,9 +194,19 @@ class Metadata(TypedDict, total=False): """triggered_by is a list of trigger that start the task.""" +class SpecRunsOnDocker(TypedDict, total=False): + environment: List[str] + + image: str + + +class SpecRunsOn(TypedDict, total=False): + docker: Required[SpecRunsOnDocker] + + class Spec(TypedDict, total=False): command: str """command contains the command the task should execute""" - runs_on: Annotated[object, PropertyInfo(alias="runsOn")] + runs_on: Annotated[SpecRunsOn, PropertyInfo(alias="runsOn")] """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index 1456b539..3a91f48b 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -1,14 +1,26 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TaskCreateResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", "TaskSpec"] +__all__ = [ + "TaskCreateResponse", + "Task", + "TaskMetadata", + "TaskMetadataCreator", + "TaskMetadataTriggeredBy", + "TaskMetadataTriggeredByManual", + "TaskMetadataTriggeredByPostDevcontainerStart", + "TaskMetadataTriggeredByPostEnvironmentStart", + "TaskSpec", + "TaskSpecRunsOn", + "TaskSpecRunsOnDocker", +] class TaskMetadataCreator(BaseModel): @@ -28,8 +40,23 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredBy: - pass +class TaskMetadataTriggeredByManual(BaseModel): + manual: bool + + +class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + + +class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): + post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + + +TaskMetadataTriggeredBy: TypeAlias = Union[ + TaskMetadataTriggeredByManual, + TaskMetadataTriggeredByPostDevcontainerStart, + TaskMetadataTriggeredByPostEnvironmentStart, +] class TaskMetadata(BaseModel): @@ -156,11 +183,21 @@ class TaskMetadata(BaseModel): """triggered_by is a list of trigger that start the task.""" +class TaskSpecRunsOnDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskSpecRunsOn(BaseModel): + docker: TaskSpecRunsOnDocker + + class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Optional[object] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/environments/automations/task_execution_list_response.py b/src/gitpod/types/environments/automations/task_execution_list_response.py index 4995f69f..192e7f72 100644 --- a/src/gitpod/types/environments/automations/task_execution_list_response.py +++ b/src/gitpod/types/environments/automations/task_execution_list_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -17,6 +17,12 @@ "TaskExecutionSpec", "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", + "TaskExecutionSpecPlanStepServiceID", + "TaskExecutionSpecPlanStepTask", + "TaskExecutionSpecPlanStepTaskTask", + "TaskExecutionSpecPlanStepTaskTaskSpec", + "TaskExecutionSpecPlanStepTaskTaskSpecRunsOn", + "TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -337,8 +343,53 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStep: - pass +class TaskExecutionSpecPlanStepServiceID(BaseModel): + service_id: str = FieldInfo(alias="serviceId") + + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + +class TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskExecutionSpecPlanStepTaskTaskSpecRunsOn(BaseModel): + docker: TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker + + +class TaskExecutionSpecPlanStepTaskTaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[TaskExecutionSpecPlanStepTaskTaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class TaskExecutionSpecPlanStepTaskTask(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskExecutionSpecPlanStepTaskTaskSpec] = None + + +class TaskExecutionSpecPlanStepTask(BaseModel): + task: TaskExecutionSpecPlanStepTaskTask + + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + +TaskExecutionSpecPlanStep: TypeAlias = Union[TaskExecutionSpecPlanStepServiceID, TaskExecutionSpecPlanStepTask] class TaskExecutionSpecPlan(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_execution_retrieve_response.py b/src/gitpod/types/environments/automations/task_execution_retrieve_response.py index 79bd6e48..dc0a5dc0 100644 --- a/src/gitpod/types/environments/automations/task_execution_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_execution_retrieve_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -16,6 +16,12 @@ "TaskExecutionSpec", "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", + "TaskExecutionSpecPlanStepServiceID", + "TaskExecutionSpecPlanStepTask", + "TaskExecutionSpecPlanStepTaskTask", + "TaskExecutionSpecPlanStepTaskTaskSpec", + "TaskExecutionSpecPlanStepTaskTaskSpecRunsOn", + "TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -328,8 +334,53 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStep: - pass +class TaskExecutionSpecPlanStepServiceID(BaseModel): + service_id: str = FieldInfo(alias="serviceId") + + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + +class TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskExecutionSpecPlanStepTaskTaskSpecRunsOn(BaseModel): + docker: TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker + + +class TaskExecutionSpecPlanStepTaskTaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[TaskExecutionSpecPlanStepTaskTaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class TaskExecutionSpecPlanStepTaskTask(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskExecutionSpecPlanStepTaskTaskSpec] = None + + +class TaskExecutionSpecPlanStepTask(BaseModel): + task: TaskExecutionSpecPlanStepTaskTask + + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + +TaskExecutionSpecPlanStep: TypeAlias = Union[TaskExecutionSpecPlanStepServiceID, TaskExecutionSpecPlanStepTask] class TaskExecutionSpecPlan(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py b/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py index 1d098837..6b28601f 100644 --- a/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py +++ b/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py @@ -2,15 +2,37 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["TaskExecutionUpdateTaskExecutionStatusParams", "Body"] +__all__ = ["TaskExecutionUpdateTaskExecutionStatusParams", "FailureMessage", "LogURL"] -class TaskExecutionUpdateTaskExecutionStatusParams(TypedDict, total=False): - body: Required[Body] +class FailureMessage(TypedDict, total=False): + failure_message: Required[Annotated[str, PropertyInfo(alias="failureMessage")]] + """ + failure_message marks the task execution as failed and provides a message + explaining the failure. + + If an individual step has failed, callers are NOT expected to set this message; + only if the task execution as a whole has failed/cannot be started. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class LogURL(TypedDict, total=False): + log_url: Required[Annotated[str, PropertyInfo(alias="logUrl")]] + """log_url is the URL to the logs of the task's steps. + + If this is empty, the task either has no logs or has not yet started. + """ connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +41,4 @@ class TaskExecutionUpdateTaskExecutionStatusParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +TaskExecutionUpdateTaskExecutionStatusParams: TypeAlias = Union[FailureMessage, LogURL] diff --git a/src/gitpod/types/environments/automations/task_list_response.py b/src/gitpod/types/environments/automations/task_list_response.py index 4fad3a92..eebde115 100644 --- a/src/gitpod/types/environments/automations/task_list_response.py +++ b/src/gitpod/types/environments/automations/task_list_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -15,7 +15,12 @@ "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", + "TaskMetadataTriggeredByManual", + "TaskMetadataTriggeredByPostDevcontainerStart", + "TaskMetadataTriggeredByPostEnvironmentStart", "TaskSpec", + "TaskSpecRunsOn", + "TaskSpecRunsOnDocker", ] @@ -44,8 +49,23 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredBy: - pass +class TaskMetadataTriggeredByManual(BaseModel): + manual: bool + + +class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + + +class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): + post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + + +TaskMetadataTriggeredBy: TypeAlias = Union[ + TaskMetadataTriggeredByManual, + TaskMetadataTriggeredByPostDevcontainerStart, + TaskMetadataTriggeredByPostEnvironmentStart, +] class TaskMetadata(BaseModel): @@ -172,11 +192,21 @@ class TaskMetadata(BaseModel): """triggered_by is a list of trigger that start the task.""" +class TaskSpecRunsOnDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskSpecRunsOn(BaseModel): + docker: TaskSpecRunsOnDocker + + class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Optional[object] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index b79d2e37..a9b4c055 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -1,14 +1,26 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TaskRetrieveResponse", "Task", "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", "TaskSpec"] +__all__ = [ + "TaskRetrieveResponse", + "Task", + "TaskMetadata", + "TaskMetadataCreator", + "TaskMetadataTriggeredBy", + "TaskMetadataTriggeredByManual", + "TaskMetadataTriggeredByPostDevcontainerStart", + "TaskMetadataTriggeredByPostEnvironmentStart", + "TaskSpec", + "TaskSpecRunsOn", + "TaskSpecRunsOnDocker", +] class TaskMetadataCreator(BaseModel): @@ -28,8 +40,23 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredBy: - pass +class TaskMetadataTriggeredByManual(BaseModel): + manual: bool + + +class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + + +class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): + post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + + +TaskMetadataTriggeredBy: TypeAlias = Union[ + TaskMetadataTriggeredByManual, + TaskMetadataTriggeredByPostDevcontainerStart, + TaskMetadataTriggeredByPostEnvironmentStart, +] class TaskMetadata(BaseModel): @@ -156,11 +183,21 @@ class TaskMetadata(BaseModel): """triggered_by is a list of trigger that start the task.""" +class TaskSpecRunsOnDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskSpecRunsOn(BaseModel): + docker: TaskSpecRunsOnDocker + + class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Optional[object] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/environments/automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py index 59a79a85..ff5ebb41 100644 --- a/src/gitpod/types/environments/automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -16,6 +16,12 @@ "TaskExecutionSpec", "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", + "TaskExecutionSpecPlanStepServiceID", + "TaskExecutionSpecPlanStepTask", + "TaskExecutionSpecPlanStepTaskTask", + "TaskExecutionSpecPlanStepTaskTaskSpec", + "TaskExecutionSpecPlanStepTaskTaskSpecRunsOn", + "TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -328,8 +334,53 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStep: - pass +class TaskExecutionSpecPlanStepServiceID(BaseModel): + service_id: str = FieldInfo(alias="serviceId") + + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + +class TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskExecutionSpecPlanStepTaskTaskSpecRunsOn(BaseModel): + docker: TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker + + +class TaskExecutionSpecPlanStepTaskTaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[TaskExecutionSpecPlanStepTaskTaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class TaskExecutionSpecPlanStepTaskTask(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskExecutionSpecPlanStepTaskTaskSpec] = None + + +class TaskExecutionSpecPlanStepTask(BaseModel): + task: TaskExecutionSpecPlanStepTaskTask + + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + +TaskExecutionSpecPlanStep: TypeAlias = Union[TaskExecutionSpecPlanStepServiceID, TaskExecutionSpecPlanStepTask] class TaskExecutionSpecPlan(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index 19c461b8..adb1ba2e 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -2,12 +2,28 @@ from __future__ import annotations -from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["TaskUpdateParams", "Metadata", "Spec"] +__all__ = [ + "TaskUpdateParams", + "Metadata", + "MetadataDescription", + "MetadataName", + "MetadataTriggeredBy", + "MetadataTriggeredByTriggeredBy", + "MetadataTriggeredByTriggeredByTrigger", + "MetadataTriggeredByTriggeredByTriggerManual", + "MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart", + "MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart", + "Spec", + "SpecCommand", + "SpecRunsOn", + "SpecRunsOnRunsOn", + "SpecRunsOnRunsOnDocker", +] class TaskUpdateParams(TypedDict, total=False): @@ -27,9 +43,60 @@ class TaskUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Metadata: - pass +class MetadataDescription(TypedDict, total=False): + description: Required[str] -class Spec: - pass +class MetadataName(TypedDict, total=False): + name: Required[str] + + +class MetadataTriggeredByTriggeredByTriggerManual(TypedDict, total=False): + manual: Required[bool] + + +class MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart(TypedDict, total=False): + post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] + + +class MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart(TypedDict, total=False): + post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] + + +MetadataTriggeredByTriggeredByTrigger: TypeAlias = Union[ + MetadataTriggeredByTriggeredByTriggerManual, + MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart, + MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart, +] + + +class MetadataTriggeredByTriggeredBy(TypedDict, total=False): + trigger: Iterable[MetadataTriggeredByTriggeredByTrigger] + + +class MetadataTriggeredBy(TypedDict, total=False): + triggered_by: Required[Annotated[MetadataTriggeredByTriggeredBy, PropertyInfo(alias="triggeredBy")]] + + +Metadata: TypeAlias = Union[MetadataDescription, MetadataName, MetadataTriggeredBy] + + +class SpecCommand(TypedDict, total=False): + command: Required[str] + + +class SpecRunsOnRunsOnDocker(TypedDict, total=False): + environment: List[str] + + image: str + + +class SpecRunsOnRunsOn(TypedDict, total=False): + docker: Required[SpecRunsOnRunsOnDocker] + + +class SpecRunsOn(TypedDict, total=False): + runs_on: Required[Annotated[SpecRunsOnRunsOn, PropertyInfo(alias="runsOn")]] + + +Spec: TypeAlias = Union[SpecCommand, SpecRunsOn] diff --git a/src/gitpod/types/organizations/member_list_params.py b/src/gitpod/types/organization_list_members_params.py similarity index 87% rename from src/gitpod/types/organizations/member_list_params.py rename to src/gitpod/types/organization_list_members_params.py index 943327aa..77441c33 100644 --- a/src/gitpod/types/organizations/member_list_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -4,12 +4,12 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from .._utils import PropertyInfo -__all__ = ["MemberListParams", "Pagination"] +__all__ = ["OrganizationListMembersParams", "Pagination"] -class MemberListParams(TypedDict, total=False): +class OrganizationListMembersParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" diff --git a/src/gitpod/types/organizations/member_list_response.py b/src/gitpod/types/organization_list_members_response.py similarity index 97% rename from src/gitpod/types/organizations/member_list_response.py rename to src/gitpod/types/organization_list_members_response.py index f615f04b..63fcc10a 100644 --- a/src/gitpod/types/organizations/member_list_response.py +++ b/src/gitpod/types/organization_list_members_response.py @@ -6,9 +6,9 @@ from pydantic import Field as FieldInfo -from ..._models import BaseModel +from .._models import BaseModel -__all__ = ["MemberListResponse", "Member", "Pagination"] +__all__ = ["OrganizationListMembersResponse", "Member", "Pagination"] class Member(BaseModel): @@ -132,7 +132,7 @@ class Pagination(BaseModel): """ -class MemberListResponse(BaseModel): +class OrganizationListMembersResponse(BaseModel): members: Optional[List[Member]] = None """members are the members of the organization""" diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index 615aa157..7230e49f 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -2,9 +2,7 @@ from __future__ import annotations -from .member_list_params import MemberListParams as MemberListParams from .invite_create_params import InviteCreateParams as InviteCreateParams -from .member_list_response import MemberListResponse as MemberListResponse from .invite_create_response import InviteCreateResponse as InviteCreateResponse from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams from .invite_retrieve_response import InviteRetrieveResponse as InviteRetrieveResponse diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py index 71597338..29299602 100644 --- a/src/gitpod/types/project_create_from_environment_response.py +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -11,8 +11,15 @@ __all__ = [ "ProjectCreateFromEnvironmentResponse", "Project", + "ProjectEnvironmentClass", + "ProjectEnvironmentClassEnvironmentClassID", + "ProjectEnvironmentClassLocalRunner", "ProjectInitializer", "ProjectInitializerSpec", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -20,8 +27,66 @@ ] -class ProjectInitializerSpec: - pass +class ProjectEnvironmentClassEnvironmentClassID(BaseModel): + environment_class_id: str = FieldInfo(alias="environmentClassId") + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassLocalRunner(BaseModel): + local_runner: bool = FieldInfo(alias="localRunner") + """Use a local runner for the user""" + + +ProjectEnvironmentClass: TypeAlias = Union[ + ProjectEnvironmentClassEnvironmentClassID, ProjectEnvironmentClassLocalRunner +] + + +class ProjectInitializerSpecContextURLContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") + + +class ProjectInitializerSpecGitGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit + + +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] class ProjectInitializer(BaseModel): @@ -269,7 +334,7 @@ class ProjectUsedBy(BaseModel): class Project(BaseModel): - environment_class: object = FieldInfo(alias="environmentClass") + environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") id: Optional[str] = None """id is the unique identifier for the project""" diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index daabb2b1..0e9a1c4d 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -2,16 +2,27 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -__all__ = ["ProjectCreateParams", "Initializer", "InitializerSpec"] +__all__ = [ + "ProjectCreateParams", + "EnvironmentClass", + "EnvironmentClassEnvironmentClassID", + "EnvironmentClassLocalRunner", + "Initializer", + "InitializerSpec", + "InitializerSpecContextURL", + "InitializerSpecContextURLContextURL", + "InitializerSpecGit", + "InitializerSpecGitGit", +] class ProjectCreateParams(TypedDict, total=False): - environment_class: Required[Annotated[object, PropertyInfo(alias="environmentClass")]] + environment_class: Required[Annotated[EnvironmentClass, PropertyInfo(alias="environmentClass")]] initializer: Required[Initializer] """EnvironmentInitializer specifies how an environment is to be initialized""" @@ -45,8 +56,65 @@ class ProjectCreateParams(TypedDict, total=False): """Define the timeout, in ms""" -class InitializerSpec: - pass +class EnvironmentClassEnvironmentClassID(TypedDict, total=False): + environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class EnvironmentClassLocalRunner(TypedDict, total=False): + local_runner: Required[Annotated[bool, PropertyInfo(alias="localRunner")]] + """Use a local runner for the user""" + + +EnvironmentClass: TypeAlias = Union[EnvironmentClassEnvironmentClassID, EnvironmentClassLocalRunner] + + +class InitializerSpecContextURLContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class InitializerSpecContextURL(TypedDict, total=False): + context_url: Required[Annotated[InitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] + + +class InitializerSpecGitGit(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class InitializerSpecGit(TypedDict, total=False): + git: Required[InitializerSpecGitGit] + + +InitializerSpec: TypeAlias = Union[InitializerSpecContextURL, InitializerSpecGit] class Initializer(TypedDict, total=False): diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py index d5247b60..dfec43dc 100644 --- a/src/gitpod/types/project_create_response.py +++ b/src/gitpod/types/project_create_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -11,8 +11,15 @@ __all__ = [ "ProjectCreateResponse", "Project", + "ProjectEnvironmentClass", + "ProjectEnvironmentClassEnvironmentClassID", + "ProjectEnvironmentClassLocalRunner", "ProjectInitializer", "ProjectInitializerSpec", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -20,8 +27,66 @@ ] -class ProjectInitializerSpec: - pass +class ProjectEnvironmentClassEnvironmentClassID(BaseModel): + environment_class_id: str = FieldInfo(alias="environmentClassId") + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassLocalRunner(BaseModel): + local_runner: bool = FieldInfo(alias="localRunner") + """Use a local runner for the user""" + + +ProjectEnvironmentClass: TypeAlias = Union[ + ProjectEnvironmentClassEnvironmentClassID, ProjectEnvironmentClassLocalRunner +] + + +class ProjectInitializerSpecContextURLContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") + + +class ProjectInitializerSpecGitGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit + + +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] class ProjectInitializer(BaseModel): @@ -269,7 +334,7 @@ class ProjectUsedBy(BaseModel): class Project(BaseModel): - environment_class: object = FieldInfo(alias="environmentClass") + environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") id: Optional[str] = None """id is the unique identifier for the project""" diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py index 127cef18..5744cecd 100644 --- a/src/gitpod/types/project_retrieve_response.py +++ b/src/gitpod/types/project_retrieve_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -11,8 +11,15 @@ __all__ = [ "ProjectRetrieveResponse", "Project", + "ProjectEnvironmentClass", + "ProjectEnvironmentClassEnvironmentClassID", + "ProjectEnvironmentClassLocalRunner", "ProjectInitializer", "ProjectInitializerSpec", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -20,8 +27,66 @@ ] -class ProjectInitializerSpec: - pass +class ProjectEnvironmentClassEnvironmentClassID(BaseModel): + environment_class_id: str = FieldInfo(alias="environmentClassId") + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassLocalRunner(BaseModel): + local_runner: bool = FieldInfo(alias="localRunner") + """Use a local runner for the user""" + + +ProjectEnvironmentClass: TypeAlias = Union[ + ProjectEnvironmentClassEnvironmentClassID, ProjectEnvironmentClassLocalRunner +] + + +class ProjectInitializerSpecContextURLContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") + + +class ProjectInitializerSpecGitGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit + + +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] class ProjectInitializer(BaseModel): @@ -269,7 +334,7 @@ class ProjectUsedBy(BaseModel): class Project(BaseModel): - environment_class: object = FieldInfo(alias="environmentClass") + environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") id: Optional[str] = None """id is the unique identifier for the project""" diff --git a/src/gitpod/types/runner_configuration_validate_params.py b/src/gitpod/types/runner_configuration_validate_params.py index b6b19213..830bdab2 100644 --- a/src/gitpod/types/runner_configuration_validate_params.py +++ b/src/gitpod/types/runner_configuration_validate_params.py @@ -2,22 +2,122 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import Base64FileInput from .._utils import PropertyInfo +from .._models import set_pydantic_config -__all__ = ["RunnerConfigurationValidateParams", "Body"] +__all__ = [ + "RunnerConfigurationValidateParams", + "EnvironmentClass", + "EnvironmentClassEnvironmentClass", + "EnvironmentClassEnvironmentClassConfiguration", + "ScmIntegration", + "ScmIntegrationScmIntegration", + "ScmIntegrationScmIntegrationOAuthClientID", + "ScmIntegrationScmIntegrationOAuthEncryptedClientSecret", + "ScmIntegrationScmIntegrationOAuthPlaintextClientSecret", +] -class RunnerConfigurationValidateParams(TypedDict, total=False): - body: Required[Body] +class EnvironmentClass(TypedDict, total=False): + environment_class: Required[Annotated[EnvironmentClassEnvironmentClass, PropertyInfo(alias="environmentClass")]] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -class Body: - pass +class EnvironmentClassEnvironmentClassConfiguration(TypedDict, total=False): + key: str + + value: str + + +class EnvironmentClassEnvironmentClass(TypedDict, total=False): + id: str + """id is the unique identifier of the environment class""" + + configuration: Iterable[EnvironmentClassEnvironmentClassConfiguration] + """configuration describes the configuration of the environment class""" + + description: str + """description is a human readable description of the environment class""" + + display_name: Annotated[str, PropertyInfo(alias="displayName")] + """display_name is the human readable name of the environment class""" + + enabled: bool + """enabled indicates whether the environment class can be used to create + + new environments. + """ + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ + + +class ScmIntegration(TypedDict, total=False): + scm_integration: Required[Annotated[ScmIntegrationScmIntegration, PropertyInfo(alias="scmIntegration")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class ScmIntegrationScmIntegrationOAuthClientID(TypedDict, total=False): + oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] + """oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_client_secret must also be set. + """ + + +class ScmIntegrationScmIntegrationOAuthEncryptedClientSecret(TypedDict, total=False): + oauth_encrypted_client_secret: Required[ + Annotated[Union[str, Base64FileInput], PropertyInfo(alias="oauthEncryptedClientSecret", format="base64")] + ] + """ + oauth_encrypted_client_secret is the OAuth app's client secret encrypted with + the runner's public key, + + if OAuth is configured. This can be used to e.g. validate an already encrypted + client secret of an existing SCM integration. + """ + + +set_pydantic_config(ScmIntegrationScmIntegrationOAuthEncryptedClientSecret, {"arbitrary_types_allowed": True}) + + +class ScmIntegrationScmIntegrationOAuthPlaintextClientSecret(TypedDict, total=False): + oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + """ + oauth_plaintext_client_secret is the OAuth app's client secret in clear text, if + OAuth is configured. + + This can be set to validate any new client secret before it is encrypted and + stored. This value will not be stored and get encrypted with the runner's public + key before passing it to the runner. + """ + + +ScmIntegrationScmIntegration: TypeAlias = Union[ + ScmIntegrationScmIntegrationOAuthClientID, + ScmIntegrationScmIntegrationOAuthEncryptedClientSecret, + ScmIntegrationScmIntegrationOAuthPlaintextClientSecret, +] + +RunnerConfigurationValidateParams: TypeAlias = Union[EnvironmentClass, ScmIntegration] diff --git a/src/gitpod/types/runner_configuration_validate_response.py b/src/gitpod/types/runner_configuration_validate_response.py index 26849219..6eb4fccc 100644 --- a/src/gitpod/types/runner_configuration_validate_response.py +++ b/src/gitpod/types/runner_configuration_validate_response.py @@ -1,8 +1,70 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Union +from typing_extensions import TypeAlias -__all__ = ["RunnerConfigurationValidateResponse"] +from pydantic import Field as FieldInfo +from .._models import BaseModel -class RunnerConfigurationValidateResponse: - pass +__all__ = [ + "RunnerConfigurationValidateResponse", + "EnvironmentClass", + "EnvironmentClassEnvironmentClass", + "EnvironmentClassEnvironmentClassDescriptionError", + "EnvironmentClassEnvironmentClassDisplayNameError", + "ScmIntegration", + "ScmIntegrationScmIntegration", + "ScmIntegrationScmIntegrationHostError", + "ScmIntegrationScmIntegrationOAuthError", + "ScmIntegrationScmIntegrationPatError", + "ScmIntegrationScmIntegrationScmIDError", +] + + +class EnvironmentClassEnvironmentClassDescriptionError(BaseModel): + description_error: str = FieldInfo(alias="descriptionError") + + +class EnvironmentClassEnvironmentClassDisplayNameError(BaseModel): + display_name_error: str = FieldInfo(alias="displayNameError") + + +EnvironmentClassEnvironmentClass: TypeAlias = Union[ + EnvironmentClassEnvironmentClassDescriptionError, EnvironmentClassEnvironmentClassDisplayNameError +] + + +class EnvironmentClass(BaseModel): + environment_class: EnvironmentClassEnvironmentClass = FieldInfo(alias="environmentClass") + + +class ScmIntegrationScmIntegrationHostError(BaseModel): + host_error: str = FieldInfo(alias="hostError") + + +class ScmIntegrationScmIntegrationOAuthError(BaseModel): + oauth_error: str = FieldInfo(alias="oauthError") + + +class ScmIntegrationScmIntegrationPatError(BaseModel): + pat_error: str = FieldInfo(alias="patError") + + +class ScmIntegrationScmIntegrationScmIDError(BaseModel): + scm_id_error: str = FieldInfo(alias="scmIdError") + + +ScmIntegrationScmIntegration: TypeAlias = Union[ + ScmIntegrationScmIntegrationHostError, + ScmIntegrationScmIntegrationOAuthError, + ScmIntegrationScmIntegrationPatError, + ScmIntegrationScmIntegrationScmIDError, +] + + +class ScmIntegration(BaseModel): + scm_integration: ScmIntegrationScmIntegration = FieldInfo(alias="scmIntegration") + + +RunnerConfigurationValidateResponse: TypeAlias = Union[EnvironmentClass, ScmIntegration] diff --git a/src/gitpod/types/runner_configurations/configuration_schema_create_response.py b/src/gitpod/types/runner_configurations/configuration_schema_create_response.py index 0222e259..0cee49c1 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_create_response.py +++ b/src/gitpod/types/runner_configurations/configuration_schema_create_response.py @@ -1,6 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +import builtins +from typing import List, Union, Optional +from typing_extensions import TypeAlias from pydantic import Field as FieldInfo @@ -10,19 +12,245 @@ "ConfigurationSchemaCreateResponse", "Schema", "SchemaEnvironmentClass", + "SchemaEnvironmentClassBool", + "SchemaEnvironmentClassBoolBool", + "SchemaEnvironmentClassDisplay", + "SchemaEnvironmentClassDisplayDisplay", + "SchemaEnvironmentClassEnum", + "SchemaEnvironmentClassEnumEnum", + "SchemaEnvironmentClassInt", + "SchemaEnvironmentClassIntInt", + "SchemaEnvironmentClassString", + "SchemaEnvironmentClassStringString", "SchemaRunnerConfig", + "SchemaRunnerConfigBool", + "SchemaRunnerConfigBoolBool", + "SchemaRunnerConfigDisplay", + "SchemaRunnerConfigDisplayDisplay", + "SchemaRunnerConfigEnum", + "SchemaRunnerConfigEnumEnum", + "SchemaRunnerConfigInt", + "SchemaRunnerConfigIntInt", + "SchemaRunnerConfigString", + "SchemaRunnerConfigStringString", "SchemaScm", "SchemaScmOAuth", "SchemaScmPat", ] -class SchemaEnvironmentClass: - pass +class SchemaEnvironmentClassBoolBool(BaseModel): + default: Optional[bool] = None -class SchemaRunnerConfig: - pass +class SchemaEnvironmentClassBool(BaseModel): + bool: SchemaEnvironmentClassBoolBool + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None + + +class SchemaEnvironmentClassDisplayDisplay(BaseModel): + default: Optional[str] = None + + +class SchemaEnvironmentClassDisplay(BaseModel): + display: SchemaEnvironmentClassDisplayDisplay + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaEnvironmentClassEnumEnum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaEnvironmentClassEnum(BaseModel): + enum: SchemaEnvironmentClassEnumEnum + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaEnvironmentClassIntInt(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaEnvironmentClassInt(BaseModel): + int: SchemaEnvironmentClassIntInt + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaEnvironmentClassStringString(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + +class SchemaEnvironmentClassString(BaseModel): + string: SchemaEnvironmentClassStringString + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +SchemaEnvironmentClass: TypeAlias = Union[ + SchemaEnvironmentClassBool, + SchemaEnvironmentClassDisplay, + SchemaEnvironmentClassEnum, + SchemaEnvironmentClassInt, + SchemaEnvironmentClassString, +] + + +class SchemaRunnerConfigBoolBool(BaseModel): + default: Optional[bool] = None + + +class SchemaRunnerConfigBool(BaseModel): + bool: SchemaRunnerConfigBoolBool + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None + + +class SchemaRunnerConfigDisplayDisplay(BaseModel): + default: Optional[str] = None + + +class SchemaRunnerConfigDisplay(BaseModel): + display: SchemaRunnerConfigDisplayDisplay + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaRunnerConfigEnumEnum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaRunnerConfigEnum(BaseModel): + enum: SchemaRunnerConfigEnumEnum + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaRunnerConfigIntInt(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaRunnerConfigInt(BaseModel): + int: SchemaRunnerConfigIntInt + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaRunnerConfigStringString(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + +class SchemaRunnerConfigString(BaseModel): + string: SchemaRunnerConfigStringString + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +SchemaRunnerConfig: TypeAlias = Union[ + SchemaRunnerConfigBool, + SchemaRunnerConfigDisplay, + SchemaRunnerConfigEnum, + SchemaRunnerConfigInt, + SchemaRunnerConfigString, +] class SchemaScmOAuth(BaseModel): diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py index ac96d70f..52e90527 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py +++ b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py @@ -1,6 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +import builtins +from typing import List, Union, Optional +from typing_extensions import TypeAlias from pydantic import Field as FieldInfo @@ -10,19 +12,245 @@ "ConfigurationSchemaRetrieveResponse", "Schema", "SchemaEnvironmentClass", + "SchemaEnvironmentClassBool", + "SchemaEnvironmentClassBoolBool", + "SchemaEnvironmentClassDisplay", + "SchemaEnvironmentClassDisplayDisplay", + "SchemaEnvironmentClassEnum", + "SchemaEnvironmentClassEnumEnum", + "SchemaEnvironmentClassInt", + "SchemaEnvironmentClassIntInt", + "SchemaEnvironmentClassString", + "SchemaEnvironmentClassStringString", "SchemaRunnerConfig", + "SchemaRunnerConfigBool", + "SchemaRunnerConfigBoolBool", + "SchemaRunnerConfigDisplay", + "SchemaRunnerConfigDisplayDisplay", + "SchemaRunnerConfigEnum", + "SchemaRunnerConfigEnumEnum", + "SchemaRunnerConfigInt", + "SchemaRunnerConfigIntInt", + "SchemaRunnerConfigString", + "SchemaRunnerConfigStringString", "SchemaScm", "SchemaScmOAuth", "SchemaScmPat", ] -class SchemaEnvironmentClass: - pass +class SchemaEnvironmentClassBoolBool(BaseModel): + default: Optional[bool] = None -class SchemaRunnerConfig: - pass +class SchemaEnvironmentClassBool(BaseModel): + bool: SchemaEnvironmentClassBoolBool + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None + + +class SchemaEnvironmentClassDisplayDisplay(BaseModel): + default: Optional[str] = None + + +class SchemaEnvironmentClassDisplay(BaseModel): + display: SchemaEnvironmentClassDisplayDisplay + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaEnvironmentClassEnumEnum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaEnvironmentClassEnum(BaseModel): + enum: SchemaEnvironmentClassEnumEnum + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaEnvironmentClassIntInt(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaEnvironmentClassInt(BaseModel): + int: SchemaEnvironmentClassIntInt + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaEnvironmentClassStringString(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + +class SchemaEnvironmentClassString(BaseModel): + string: SchemaEnvironmentClassStringString + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +SchemaEnvironmentClass: TypeAlias = Union[ + SchemaEnvironmentClassBool, + SchemaEnvironmentClassDisplay, + SchemaEnvironmentClassEnum, + SchemaEnvironmentClassInt, + SchemaEnvironmentClassString, +] + + +class SchemaRunnerConfigBoolBool(BaseModel): + default: Optional[bool] = None + + +class SchemaRunnerConfigBool(BaseModel): + bool: SchemaRunnerConfigBoolBool + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None + + +class SchemaRunnerConfigDisplayDisplay(BaseModel): + default: Optional[str] = None + + +class SchemaRunnerConfigDisplay(BaseModel): + display: SchemaRunnerConfigDisplayDisplay + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaRunnerConfigEnumEnum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaRunnerConfigEnum(BaseModel): + enum: SchemaRunnerConfigEnumEnum + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaRunnerConfigIntInt(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaRunnerConfigInt(BaseModel): + int: SchemaRunnerConfigIntInt + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +class SchemaRunnerConfigStringString(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + +class SchemaRunnerConfigString(BaseModel): + string: SchemaRunnerConfigStringString + + id: Optional[str] = None + + description: Optional[str] = None + + name: Optional[str] = None + + required: Optional[bool] = None + + secret: Optional[bool] = None + + +SchemaRunnerConfig: TypeAlias = Union[ + SchemaRunnerConfigBool, + SchemaRunnerConfigDisplay, + SchemaRunnerConfigEnum, + SchemaRunnerConfigInt, + SchemaRunnerConfigString, +] class SchemaScmOAuth(BaseModel): diff --git a/src/gitpod/types/runner_configurations/environment_class_list_params.py b/src/gitpod/types/runner_configurations/environment_class_list_params.py index c348fd4b..9cbaf8f3 100644 --- a/src/gitpod/types/runner_configurations/environment_class_list_params.py +++ b/src/gitpod/types/runner_configurations/environment_class_list_params.py @@ -6,14 +6,14 @@ from ..._utils import PropertyInfo -__all__ = ["EnvironmentClassListParams", "Pagination"] +__all__ = ["EnvironmentClassListParams", "Filter", "Pagination"] class EnvironmentClassListParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: object + filter: Filter pagination: Pagination """pagination contains the pagination options for listing environment classes""" @@ -22,6 +22,14 @@ class EnvironmentClassListParams(TypedDict, total=False): """Define the timeout, in ms""" +class Filter(TypedDict, total=False): + enabled: Required[bool] + """enabled filters the response to only enabled or disabled environment classes. + + If not set, all environment classes are returned. + """ + + class Pagination(TypedDict, total=False): token: str """Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/runner_configurations/environment_class_update_params.py b/src/gitpod/types/runner_configurations/environment_class_update_params.py index fbd48e58..f26ca514 100644 --- a/src/gitpod/types/runner_configurations/environment_class_update_params.py +++ b/src/gitpod/types/runner_configurations/environment_class_update_params.py @@ -2,15 +2,16 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo -__all__ = ["EnvironmentClassUpdateParams", "Body"] +__all__ = ["EnvironmentClassUpdateParams", "Description", "DisplayName", "Enabled"] -class EnvironmentClassUpdateParams(TypedDict, total=False): - body: Required[Body] +class Description(TypedDict, total=False): + description: Required[str] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +20,24 @@ class EnvironmentClassUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +class DisplayName(TypedDict, total=False): + display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Enabled(TypedDict, total=False): + enabled: Required[bool] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +EnvironmentClassUpdateParams: TypeAlias = Union[Description, DisplayName, Enabled] diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py index 907435a0..7d1cb306 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenListParams", "Filter", "Pagination"] +__all__ = ["HostAuthenticationTokenListParams", "Filter", "FilterRunnerID", "FilterUserID", "Pagination"] class HostAuthenticationTokenListParams(TypedDict, total=False): @@ -21,8 +22,15 @@ class HostAuthenticationTokenListParams(TypedDict, total=False): """Define the timeout, in ms""" -class Filter: - pass +class FilterRunnerID(TypedDict, total=False): + runner_id: Required[Annotated[str, PropertyInfo(alias="runnerId")]] + + +class FilterUserID(TypedDict, total=False): + user_id: Required[Annotated[str, PropertyInfo(alias="userId")]] + + +Filter: TypeAlias = Union[FilterRunnerID, FilterUserID] class Pagination(TypedDict, total=False): diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py index 5dd0c59d..eb360a36 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py @@ -2,15 +2,127 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenUpdateParams", "Body"] +__all__ = ["HostAuthenticationTokenUpdateParams", "ExpiresAt", "RefreshToken", "Token"] -class HostAuthenticationTokenUpdateParams(TypedDict, total=False): - body: Required[Body] +class ExpiresAt(TypedDict, total=False): + expires_at: Required[Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")]] + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class RefreshToken(TypedDict, total=False): + refresh_token: Required[Annotated[str, PropertyInfo(alias="refreshToken")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Token(TypedDict, total=False): + token: Required[str] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +131,4 @@ class HostAuthenticationTokenUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +HostAuthenticationTokenUpdateParams: TypeAlias = Union[ExpiresAt, RefreshToken, Token] diff --git a/src/gitpod/types/runner_configurations/scm_integration_create_params.py b/src/gitpod/types/runner_configurations/scm_integration_create_params.py index f9fcee84..d32fee9d 100644 --- a/src/gitpod/types/runner_configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runner_configurations/scm_integration_create_params.py @@ -2,15 +2,34 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo -__all__ = ["ScmIntegrationCreateParams", "Body"] +__all__ = ["ScmIntegrationCreateParams", "OAuthClientID", "OAuthPlaintextClientSecret"] -class ScmIntegrationCreateParams(TypedDict, total=False): - body: Required[Body] +class OAuthClientID(TypedDict, total=False): + oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] + """oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_plaintext_client_secret must also be set. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class OAuthPlaintextClientSecret(TypedDict, total=False): + oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + """oauth_plaintext_client_secret is the OAuth app's client secret in clear text. + + This will first be encrypted with the runner's public key before being stored. + """ connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +38,4 @@ class ScmIntegrationCreateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +ScmIntegrationCreateParams: TypeAlias = Union[OAuthClientID, OAuthPlaintextClientSecret] diff --git a/src/gitpod/types/runner_update_runner_params.py b/src/gitpod/types/runner_update_runner_params.py index 6295fc6c..c8750543 100644 --- a/src/gitpod/types/runner_update_runner_params.py +++ b/src/gitpod/types/runner_update_runner_params.py @@ -2,15 +2,27 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -__all__ = ["RunnerUpdateRunnerParams", "Body"] +__all__ = [ + "RunnerUpdateRunnerParams", + "Name", + "Spec", + "SpecSpec", + "SpecSpecConfiguration", + "SpecSpecConfigurationConfiguration", + "SpecSpecConfigurationConfigurationAutoUpdate", + "SpecSpecConfigurationConfigurationReleaseChannel", + "SpecSpecDesiredPhase", +] -class RunnerUpdateRunnerParams(TypedDict, total=False): - body: Required[Body] +class Name(TypedDict, total=False): + name: Required[str] + """The runner's name which is shown to users""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +31,60 @@ class RunnerUpdateRunnerParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +class Spec(TypedDict, total=False): + spec: Required[SpecSpec] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class SpecSpecConfigurationConfigurationAutoUpdate(TypedDict, total=False): + auto_update: Required[Annotated[bool, PropertyInfo(alias="autoUpdate")]] + """auto_update indicates whether the runner should automatically update itself.""" + + +class SpecSpecConfigurationConfigurationReleaseChannel(TypedDict, total=False): + release_channel: Required[ + Annotated[ + Literal[ + "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST" + ], + PropertyInfo(alias="releaseChannel"), + ] + ] + """The release channel the runner is on""" + + +SpecSpecConfigurationConfiguration: TypeAlias = Union[ + SpecSpecConfigurationConfigurationAutoUpdate, SpecSpecConfigurationConfigurationReleaseChannel +] + + +class SpecSpecConfiguration(TypedDict, total=False): + configuration: Required[SpecSpecConfigurationConfiguration] + + +class SpecSpecDesiredPhase(TypedDict, total=False): + desired_phase: Required[ + Annotated[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ], + PropertyInfo(alias="desiredPhase"), + ] + ] + """RunnerPhase represents the phase a runner is in""" + + +SpecSpec: TypeAlias = Union[SpecSpecConfiguration, SpecSpecDesiredPhase] + +RunnerUpdateRunnerParams: TypeAlias = Union[Name, Spec] diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index e32257c1..338ad174 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -31,9 +31,9 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={}, - spec={}, - status={}, + metadata={"description": "description"}, + spec={"commands": {"ready": "ready"}}, + status={"failure_message": "failureMessage"}, connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @@ -247,9 +247,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> service = await async_client.environments.automations.services.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={}, - spec={}, - status={}, + metadata={"description": "description"}, + spec={"commands": {"ready": "ready"}}, + status={"failure_message": "failureMessage"}, connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) diff --git a/tests/api_resources/environments/automations/test_task_executions.py b/tests/api_resources/environments/automations/test_task_executions.py index e3ac1d50..f7d63563 100644 --- a/tests/api_resources/environments/automations/test_task_executions.py +++ b/tests/api_resources/environments/automations/test_task_executions.py @@ -150,37 +150,26 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_task_execution_status(self, client: Gitpod) -> None: + def test_method_update_task_execution_status_overload_1(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.update_task_execution_status( - body={}, + failure_message="failureMessage", connect_protocol_version=1, ) assert_matches_type(object, task_execution, path=["response"]) @parametrize - def test_method_update_task_execution_status_with_all_params(self, client: Gitpod) -> None: + def test_method_update_task_execution_status_with_all_params_overload_1(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.update_task_execution_status( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failureMessage": "failureMessage", - "logUrl": "logUrl", - "steps": [ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - } - ], - }, + failure_message="failureMessage", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @parametrize - def test_raw_response_update_task_execution_status(self, client: Gitpod) -> None: + def test_raw_response_update_task_execution_status_overload_1(self, client: Gitpod) -> None: response = client.environments.automations.task_executions.with_raw_response.update_task_execution_status( - body={}, + failure_message="failureMessage", connect_protocol_version=1, ) @@ -190,9 +179,52 @@ def test_raw_response_update_task_execution_status(self, client: Gitpod) -> None assert_matches_type(object, task_execution, path=["response"]) @parametrize - def test_streaming_response_update_task_execution_status(self, client: Gitpod) -> None: + def test_streaming_response_update_task_execution_status_overload_1(self, client: Gitpod) -> None: with client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( - body={}, + failure_message="failureMessage", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_task_execution_status_overload_2(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.update_task_execution_status( + log_url="logUrl", + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_method_update_task_execution_status_with_all_params_overload_2(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.update_task_execution_status( + log_url="logUrl", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_raw_response_update_task_execution_status_overload_2(self, client: Gitpod) -> None: + response = client.environments.automations.task_executions.with_raw_response.update_task_execution_status( + log_url="logUrl", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_streaming_response_update_task_execution_status_overload_2(self, client: Gitpod) -> None: + with client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( + log_url="logUrl", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -337,38 +369,76 @@ async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + async def test_method_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( - body={}, + failure_message="failureMessage", connect_protocol_version=1, ) assert_matches_type(object, task_execution, path=["response"]) @parametrize - async def test_method_update_task_execution_status_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_task_execution_status_with_all_params_overload_1( + self, async_client: AsyncGitpod + ) -> None: task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failureMessage": "failureMessage", - "logUrl": "logUrl", - "steps": [ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "failure_message": "failureMessage", - "phase": "TASK_EXECUTION_PHASE_UNSPECIFIED", - } - ], - }, + failure_message="failureMessage", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_raw_response_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: + response = ( + await async_client.environments.automations.task_executions.with_raw_response.update_task_execution_status( + failure_message="failureMessage", + connect_protocol_version=1, + ) + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_streaming_response_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( + failure_message="failureMessage", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task_execution = await response.parse() + assert_matches_type(object, task_execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: + task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( + log_url="logUrl", + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_method_update_task_execution_status_with_all_params_overload_2( + self, async_client: AsyncGitpod + ) -> None: + task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( + log_url="logUrl", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @parametrize - async def test_raw_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: response = ( await async_client.environments.automations.task_executions.with_raw_response.update_task_execution_status( - body={}, + log_url="logUrl", connect_protocol_version=1, ) ) @@ -379,9 +449,9 @@ async def test_raw_response_update_task_execution_status(self, async_client: Asy assert_matches_type(object, task_execution, path=["response"]) @parametrize - async def test_streaming_response_update_task_execution_status(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( - body={}, + log_url="logUrl", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index e893858f..febb4ef9 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -45,17 +45,16 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "description": "description", "name": "x", "reference": "reference", - "triggered_by": [ - { - "manual": True, - "postDevcontainerStart": True, - "postEnvironmentStart": True, - } - ], + "triggered_by": [{"manual": True}], }, spec={ "command": "command", - "runs_on": {}, + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, }, connect_timeout_ms=0, ) @@ -138,8 +137,8 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - metadata={}, - spec={}, + metadata={"description": "description"}, + spec={"command": "command"}, connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @@ -322,17 +321,16 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "description": "description", "name": "x", "reference": "reference", - "triggered_by": [ - { - "manual": True, - "postDevcontainerStart": True, - "postEnvironmentStart": True, - } - ], + "triggered_by": [{"manual": True}], }, spec={ "command": "command", - "runs_on": {}, + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, }, connect_timeout_ms=0, ) @@ -415,8 +413,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - metadata={}, - spec={}, + metadata={"description": "description"}, + spec={"command": "command"}, connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 2f6ccfe2..cf302b07 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -38,7 +38,12 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: }, "description": "description", "name": "x", - "runs_on": {}, + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, "triggered_by": ["string"], } }, @@ -48,7 +53,12 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "depends_on": ["string"], "description": "description", "name": "x", - "runs_on": {}, + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, "triggered_by": ["string"], } }, @@ -107,7 +117,12 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> }, "description": "description", "name": "x", - "runs_on": {}, + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, "triggered_by": ["string"], } }, @@ -117,7 +132,12 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "depends_on": ["string"], "description": "description", "name": "x", - "runs_on": {}, + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, "triggered_by": ["string"], } }, diff --git a/tests/api_resources/organizations/test_members.py b/tests/api_resources/organizations/test_members.py deleted file mode 100644 index bb5da0f4..00000000 --- a/tests/api_resources/organizations/test_members.py +++ /dev/null @@ -1,110 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types.organizations import MemberListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestMembers: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Gitpod) -> None: - member = client.organizations.members.list( - connect_protocol_version=1, - ) - assert_matches_type(MemberListResponse, member, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Gitpod) -> None: - member = client.organizations.members.list( - connect_protocol_version=1, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - pagination={ - "token": "token", - "page_size": 100, - }, - connect_timeout_ms=0, - ) - assert_matches_type(MemberListResponse, member, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.organizations.members.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - member = response.parse() - assert_matches_type(MemberListResponse, member, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.organizations.members.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - member = response.parse() - assert_matches_type(MemberListResponse, member, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncMembers: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncGitpod) -> None: - member = await async_client.organizations.members.list( - connect_protocol_version=1, - ) - assert_matches_type(MemberListResponse, member, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - member = await async_client.organizations.members.list( - connect_protocol_version=1, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - pagination={ - "token": "token", - "page_size": 100, - }, - connect_timeout_ms=0, - ) - assert_matches_type(MemberListResponse, member, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.members.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - member = await response.parse() - assert_matches_type(MemberListResponse, member, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.members.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - member = await response.parse() - assert_matches_type(MemberListResponse, member, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/test_environment_classes.py b/tests/api_resources/runner_configurations/test_environment_classes.py index c1e7c536..14f6251e 100644 --- a/tests/api_resources/runner_configurations/test_environment_classes.py +++ b/tests/api_resources/runner_configurations/test_environment_classes.py @@ -20,31 +20,112 @@ class TestEnvironmentClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( - body={}, + description="xxx", connect_protocol_version=1, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( - body={ - "description": "xxx", - "displayName": "xxx", - "enabled": True, - "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, + description="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.runner_configurations.environment_classes.with_raw_response.update( + description="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.runner_configurations.environment_classes.with_streaming_response.update( + description="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.runner_configurations.environment_classes.with_raw_response.update( + display_name="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.runner_configurations.environment_classes.with_streaming_response.update( + display_name="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.update( + enabled=True, + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.update( + enabled=True, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runner_configurations.environment_classes.with_raw_response.update( - body={}, + enabled=True, connect_protocol_version=1, ) @@ -54,9 +135,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(object, environment_class, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runner_configurations.environment_classes.with_streaming_response.update( - body={}, + enabled=True, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -78,7 +159,7 @@ def test_method_list(self, client: Gitpod) -> None: def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.list( connect_protocol_version=1, - filter={}, + filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, @@ -116,31 +197,112 @@ class TestAsyncEnvironmentClasses: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.update( - body={}, + description="xxx", connect_protocol_version=1, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.update( - body={ - "description": "xxx", - "displayName": "xxx", - "enabled": True, - "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, + description="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.environment_classes.with_raw_response.update( + description="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.environment_classes.with_streaming_response.update( + description="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.environment_classes.with_raw_response.update( + display_name="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.environment_classes.with_streaming_response.update( + display_name="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.update( + enabled=True, + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.update( + enabled=True, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.environment_classes.with_raw_response.update( - body={}, + enabled=True, connect_protocol_version=1, ) @@ -150,9 +312,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, environment_class, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.environment_classes.with_streaming_response.update( - body={}, + enabled=True, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -174,7 +336,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.list( connect_protocol_version=1, - filter={}, + filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, diff --git a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py index 8120572a..baff3306 100644 --- a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py @@ -103,31 +103,112 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( - body={}, + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "token": "x", - "expiresAt": parse_datetime("2019-12-27T18:11:19.117Z"), - "refreshToken": "refreshToken", - }, + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + refresh_token="refreshToken", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + token="x", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + token="x", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( - body={}, + token="x", connect_protocol_version=1, ) @@ -137,9 +218,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( - body={}, + token="x", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -161,7 +242,7 @@ def test_method_list(self, client: Gitpod) -> None: def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.list( connect_protocol_version=1, - filter={}, + filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, pagination={ "token": "token", "page_size": 100, @@ -319,31 +400,112 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( - body={}, + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "token": "x", - "expiresAt": parse_datetime("2019-12-27T18:11:19.117Z"), - "refreshToken": "refreshToken", - }, + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + refresh_token="refreshToken", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + token="x", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + token="x", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( - body={}, + token="x", connect_protocol_version=1, ) @@ -353,9 +515,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( - body={}, + token="x", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -377,7 +539,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list( connect_protocol_version=1, - filter={}, + filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, pagination={ "token": "token", "page_size": 100, diff --git a/tests/api_resources/runner_configurations/test_scm_integration.py b/tests/api_resources/runner_configurations/test_scm_integration.py index d5311fb6..e83be4b1 100644 --- a/tests/api_resources/runner_configurations/test_scm_integration.py +++ b/tests/api_resources/runner_configurations/test_scm_integration.py @@ -18,33 +18,26 @@ class TestScmIntegration: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_create(self, client: Gitpod) -> None: + def test_method_create_overload_1(self, client: Gitpod) -> None: scm_integration = client.runner_configurations.scm_integration.create( - body={}, + oauth_client_id="oauthClientId", connect_protocol_version=1, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - def test_method_create_with_all_params(self, client: Gitpod) -> None: + def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: scm_integration = client.runner_configurations.scm_integration.create( - body={ - "host": "host", - "oauthClientId": "oauthClientId", - "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", - "pat": True, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmId": "scmId", - }, + oauth_client_id="oauthClientId", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - def test_raw_response_create(self, client: Gitpod) -> None: + def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.scm_integration.with_raw_response.create( - body={}, + oauth_client_id="oauthClientId", connect_protocol_version=1, ) @@ -54,9 +47,52 @@ def test_raw_response_create(self, client: Gitpod) -> None: assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - def test_streaming_response_create(self, client: Gitpod) -> None: + def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.scm_integration.with_streaming_response.create( - body={}, + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runner_configurations.scm_integration.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runner_configurations.scm_integration.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_create_overload_2(self, client: Gitpod) -> None: + response = client.runner_configurations.scm_integration.with_raw_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: + with client.runner_configurations.scm_integration.with_streaming_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -72,33 +108,69 @@ class TestAsyncScmIntegration: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_create(self, async_client: AsyncGitpod) -> None: + async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runner_configurations.scm_integration.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runner_configurations.scm_integration.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.scm_integration.with_raw_response.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.scm_integration.with_streaming_response.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runner_configurations.scm_integration.create( - body={}, + oauth_plaintext_client_secret="oauthPlaintextClientSecret", connect_protocol_version=1, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runner_configurations.scm_integration.create( - body={ - "host": "host", - "oauthClientId": "oauthClientId", - "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", - "pat": True, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmId": "scmId", - }, + oauth_plaintext_client_secret="oauthPlaintextClientSecret", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.scm_integration.with_raw_response.create( - body={}, + oauth_plaintext_client_secret="oauthPlaintextClientSecret", connect_protocol_version=1, ) @@ -108,9 +180,9 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.scm_integration.with_streaming_response.create( - body={}, + oauth_plaintext_client_secret="oauthPlaintextClientSecret", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_environment_classes.py b/tests/api_resources/test_environment_classes.py index 9be76d4c..8ee23ac0 100644 --- a/tests/api_resources/test_environment_classes.py +++ b/tests/api_resources/test_environment_classes.py @@ -28,7 +28,7 @@ def test_method_list(self, client: Gitpod) -> None: def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.environment_classes.list( connect_protocol_version=1, - filter={}, + filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, @@ -76,7 +76,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.environment_classes.list( connect_protocol_version=1, - filter={}, + filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index b6083536..a949657b 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -42,20 +42,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": { - "specs": [ - { - "contextUrl": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -76,13 +63,11 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "secrets": [ { - "environmentVariable": "environmentVariable", - "filePath": "filePath", - "gitCredentialHost": "gitCredentialHost", + "environment_variable": "environmentVariable", "name": "name", "session": "session", "source": "source", - "sourceRef": "sourceRef", + "source_ref": "sourceRef", } ], "spec_version": "specVersion", @@ -234,20 +219,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": { - "specs": [ - { - "contextUrl": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -268,13 +240,11 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "secrets": [ { - "environmentVariable": "environmentVariable", - "filePath": "filePath", - "gitCredentialHost": "gitCredentialHost", + "environment_variable": "environmentVariable", "name": "name", "session": "session", "source": "source", - "sourceRef": "sourceRef", + "source_ref": "sourceRef", } ], "spec_version": "specVersion", @@ -378,20 +348,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": { - "specs": [ - { - "contextUrl": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -412,13 +369,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "secrets": [ { - "environmentVariable": "environmentVariable", - "filePath": "filePath", - "gitCredentialHost": "gitCredentialHost", + "environment_variable": "environmentVariable", "name": "name", "session": "session", "source": "source", - "sourceRef": "sourceRef", + "source_ref": "sourceRef", } ], "spec_version": "specVersion", @@ -570,20 +525,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": { - "specs": [ - { - "contextUrl": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -604,13 +546,11 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "secrets": [ { - "environmentVariable": "environmentVariable", - "filePath": "filePath", - "gitCredentialHost": "gitCredentialHost", + "environment_variable": "environmentVariable", "name": "name", "session": "session", "source": "source", - "sourceRef": "sourceRef", + "source_ref": "sourceRef", } ], "spec_version": "specVersion", diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 3b4591e8..58d19c5f 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -9,6 +9,9 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.types import ( + OrganizationListMembersResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -56,6 +59,50 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_list_members(self, client: Gitpod) -> None: + organization = client.organizations.list_members( + connect_protocol_version=1, + ) + assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + + @parametrize + def test_method_list_members_with_all_params(self, client: Gitpod) -> None: + organization = client.organizations.list_members( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_list_members(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.list_members( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_list_members(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.list_members( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_set_role(self, client: Gitpod) -> None: organization = client.organizations.set_role( @@ -142,6 +189,50 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_list_members(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.list_members( + connect_protocol_version=1, + ) + assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + + @parametrize + async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.list_members( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.list_members( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.list_members( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 05dd31bd..5529ac09 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -24,7 +24,7 @@ class TestProjects: @parametrize def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={}, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, connect_protocol_version=1, ) @@ -33,21 +33,8 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={}, - initializer={ - "specs": [ - { - "contextUrl": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", @@ -59,7 +46,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( - environment_class={}, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, connect_protocol_version=1, ) @@ -72,7 +59,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( - environment_class={}, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, connect_protocol_version=1, ) as response: @@ -172,7 +159,7 @@ class TestAsyncProjects: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={}, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, connect_protocol_version=1, ) @@ -181,21 +168,8 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={}, - initializer={ - "specs": [ - { - "contextUrl": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", @@ -207,7 +181,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( - environment_class={}, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, connect_protocol_version=1, ) @@ -220,7 +194,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create( - environment_class={}, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, connect_protocol_version=1, ) as response: diff --git a/tests/api_resources/test_runner_configurations.py b/tests/api_resources/test_runner_configurations.py index 97f21bc1..34570373 100644 --- a/tests/api_resources/test_runner_configurations.py +++ b/tests/api_resources/test_runner_configurations.py @@ -18,42 +18,39 @@ class TestRunnerConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_validate(self, client: Gitpod) -> None: + def test_method_validate_overload_1(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( - body={}, + environment_class={}, connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - def test_method_validate_with_all_params(self, client: Gitpod) -> None: + def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( - body={ - "environmentClass": { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmIntegration": {}, + environment_class={ + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", }, connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - def test_raw_response_validate(self, client: Gitpod) -> None: + def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.with_raw_response.validate( - body={}, + environment_class={}, connect_protocol_version=1, ) @@ -63,9 +60,53 @@ def test_raw_response_validate(self, client: Gitpod) -> None: assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - def test_streaming_response_validate(self, client: Gitpod) -> None: + def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.with_streaming_response.validate( - body={}, + environment_class={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_configuration = response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_validate_overload_2(self, client: Gitpod) -> None: + runner_configuration = client.runner_configurations.validate( + scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: + runner_configuration = client.runner_configurations.validate( + scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: + response = client.runner_configurations.with_raw_response.validate( + scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_configuration = response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: + with client.runner_configurations.with_streaming_response.validate( + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -81,42 +122,83 @@ class TestAsyncRunnerConfigurations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_validate(self, async_client: AsyncGitpod) -> None: + async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( - body={}, + environment_class={}, connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_validate_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( - body={ - "environmentClass": { - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmIntegration": {}, + environment_class={ + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", }, connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runner_configurations.with_raw_response.validate( + environment_class={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner_configuration = await response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runner_configurations.with_streaming_response.validate( + environment_class={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner_configuration = await response.parse() + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: + runner_configuration = await async_client.runner_configurations.validate( + scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, + ) + assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + + @parametrize + async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + runner_configuration = await async_client.runner_configurations.validate( + scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - async def test_raw_response_validate(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.with_raw_response.validate( - body={}, + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) @@ -126,9 +208,9 @@ async def test_raw_response_validate(self, async_client: AsyncGitpod) -> None: assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @parametrize - async def test_streaming_response_validate(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.with_streaming_response.validate( - body={}, + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index d58877bc..ffb4d2b6 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -365,30 +365,69 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_runner(self, client: Gitpod) -> None: + def test_method_update_runner_overload_1(self, client: Gitpod) -> None: runner = client.runners.update_runner( - body={}, + name="xxx", connect_protocol_version=1, ) assert_matches_type(object, runner, path=["response"]) @parametrize - def test_method_update_runner_with_all_params(self, client: Gitpod) -> None: + def test_method_update_runner_with_all_params_overload_1(self, client: Gitpod) -> None: runner = client.runners.update_runner( - body={ - "name": "xxx", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "spec": {}, - }, + name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_raw_response_update_runner_overload_1(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.update_runner( + name="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_streaming_response_update_runner_overload_1(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.update_runner( + name="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(object, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_runner_overload_2(self, client: Gitpod) -> None: + runner = client.runners.update_runner( + spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_method_update_runner_with_all_params_overload_2(self, client: Gitpod) -> None: + runner = client.runners.update_runner( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize - def test_raw_response_update_runner(self, client: Gitpod) -> None: + def test_raw_response_update_runner_overload_2(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update_runner( - body={}, + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) @@ -398,9 +437,9 @@ def test_raw_response_update_runner(self, client: Gitpod) -> None: assert_matches_type(object, runner, path=["response"]) @parametrize - def test_streaming_response_update_runner(self, client: Gitpod) -> None: + def test_streaming_response_update_runner_overload_2(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update_runner( - body={}, + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -755,30 +794,69 @@ async def test_streaming_response_parse_context_url(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_runner(self, async_client: AsyncGitpod) -> None: + async def test_method_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update_runner( - body={}, + name="xxx", connect_protocol_version=1, ) assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_method_update_runner_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_runner_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update_runner( - body={ - "name": "xxx", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "spec": {}, - }, + name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_raw_response_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.update_runner( + name="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_streaming_response_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.update_runner( + name="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(object, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update_runner( + spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_method_update_runner_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update_runner( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_raw_response_update_runner(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update_runner( - body={}, + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) @@ -788,9 +866,9 @@ async def test_raw_response_update_runner(self, async_client: AsyncGitpod) -> No assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_streaming_response_update_runner(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update_runner( - body={}, + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) as response: assert not response.is_closed From 0c556305dc9cc464b648977be253c3a135b60744 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 14:10:21 +0000 Subject: [PATCH 052/505] feat(api): update via SDK Studio --- README.md | 59 ++-- src/gitpod/_client.py | 32 ++ src/gitpod/resources/environment_classes.py | 34 -- .../environments/automations/automations.py | 34 -- .../environments/automations/services.py | 154 --------- .../automations/task_executions.py | 144 +-------- .../environments/automations/tasks.py | 183 ----------- .../resources/environments/environments.py | 154 --------- src/gitpod/resources/identity.py | 93 ------ .../resources/organizations/invite/invite.py | 64 ---- .../resources/organizations/invite/summary.py | 34 -- .../resources/organizations/organizations.py | 92 ------ .../resources/personal_access_tokens.py | 64 ---- src/gitpod/resources/projects.py | 94 ------ .../configuration_schema.py | 64 ---- .../environment_classes.py | 104 +------ .../host_authentication_tokens.py | 194 +----------- .../runner_configurations.py | 54 +--- .../runner_configurations/scm_integration.py | 58 +--- src/gitpod/resources/runners/policies.py | 34 -- src/gitpod/resources/runners/runners.py | 292 +----------------- .../types/environment_class_list_params.py | 8 +- .../environment_create_from_project_params.py | 6 - src/gitpod/types/environment_create_params.py | 6 - src/gitpod/types/environment_list_params.py | 8 +- .../types/environment_retrieve_params.py | 8 +- src/gitpod/types/environment_start_params.py | 8 +- .../environments/automation_upsert_params.py | 8 +- .../automations/service_delete_params.py | 10 +- .../automations/service_list_params.py | 8 +- .../automations/service_start_params.py | 10 +- .../automations/service_stop_params.py | 10 +- .../automations/service_update_params.py | 6 - .../automations/task_create_params.py | 6 - .../automations/task_delete_params.py | 10 +- .../automations/task_execution_list_params.py | 8 +- .../task_execution_retrieve_params.py | 10 +- .../automations/task_execution_stop_params.py | 10 +- ...ion_update_task_execution_status_params.py | 14 +- .../automations/task_list_params.py | 8 +- .../automations/task_retrieve_params.py | 10 +- .../automations/task_start_params.py | 10 +- .../automations/task_update_params.py | 8 +- .../types/identity_exchange_token_params.py | 8 +- ...ntity_get_authenticated_identity_params.py | 10 +- .../types/identity_get_id_token_params.py | 10 +- src/gitpod/types/organization_leave_params.py | 8 +- .../types/organization_list_members_params.py | 8 +- .../types/organization_set_role_params.py | 8 +- .../invite/summary_retrieve_params.py | 8 +- .../organizations/invite_create_params.py | 8 +- .../organizations/invite_retrieve_params.py | 8 +- .../personal_access_token_delete_params.py | 8 +- .../personal_access_token_list_params.py | 8 +- .../project_create_from_environment_params.py | 8 +- src/gitpod/types/project_create_params.py | 6 - src/gitpod/types/project_retrieve_params.py | 8 +- ...er_check_authentication_for_host_params.py | 8 +- .../runner_configuration_validate_params.py | 14 +- .../configuration_schema_create_params.py | 8 +- .../configuration_schema_retrieve_params.py | 8 +- .../environment_class_list_params.py | 8 +- .../environment_class_update_params.py | 20 +- ...host_authentication_token_create_params.py | 10 +- ...host_authentication_token_delete_params.py | 10 +- .../host_authentication_token_list_params.py | 8 +- ...st_authentication_token_retrieve_params.py | 10 +- ...host_authentication_token_update_params.py | 20 +- .../scm_integration_create_params.py | 14 +- src/gitpod/types/runner_create_params.py | 8 +- .../runner_create_runner_token_params.py | 8 +- .../types/runner_delete_runner_params.py | 8 +- src/gitpod/types/runner_get_runner_params.py | 8 +- src/gitpod/types/runner_list_params.py | 8 +- .../types/runner_parse_context_url_params.py | 8 +- src/gitpod/types/runner_retrieve_params.py | 8 +- .../types/runner_update_runner_params.py | 12 - .../types/runners/policy_list_params.py | 8 +- .../environments/automations/test_services.py | 140 ++------- .../automations/test_task_executions.py | 136 ++------ .../environments/automations/test_tasks.py | 168 +++------- .../environments/test_automations.py | 28 +- .../organizations/invite/test_summary.py | 28 +- .../organizations/test_invite.py | 56 +--- .../test_configuration_schema.py | 56 +--- .../test_environment_classes.py | 100 +----- .../test_host_authentication_tokens.py | 184 ++--------- .../test_scm_integration.py | 48 --- tests/api_resources/runners/test_policies.py | 28 +- .../api_resources/test_environment_classes.py | 28 +- tests/api_resources/test_environments.py | 140 ++------- tests/api_resources/test_identity.py | 80 +---- tests/api_resources/test_organizations.py | 84 ++--- .../test_personal_access_tokens.py | 56 +--- tests/api_resources/test_projects.py | 66 +--- .../test_runner_configurations.py | 20 -- tests/api_resources/test_runners.py | 272 +++------------- tests/conftest.py | 18 +- tests/test_client.py | 278 ++++++++++++++--- 99 files changed, 682 insertions(+), 3885 deletions(-) diff --git a/README.md b/README.md index dc9f51db..151820ac 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,12 @@ The full API of this library can be found in [api.md](api.md). ```python from gitpod import Gitpod -client = Gitpod() - -runner = client.runners.create( - connect_protocol_version=1, +client = Gitpod( + connect_protocol_version=True, + connect_timeout_header=0, ) + +runner = client.runners.create() print(runner.access_token) ``` @@ -50,13 +51,14 @@ Simply import `AsyncGitpod` instead of `Gitpod` and use `await` with each API ca import asyncio from gitpod import AsyncGitpod -client = AsyncGitpod() +client = AsyncGitpod( + connect_protocol_version=True, + connect_timeout_header=0, +) async def main() -> None: - runner = await client.runners.create( - connect_protocol_version=1, - ) + runner = await client.runners.create() print(runner.access_token) @@ -87,12 +89,13 @@ All errors inherit from `gitpod.APIError`. import gitpod from gitpod import Gitpod -client = Gitpod() +client = Gitpod( + connect_protocol_version=True, + connect_timeout_header=0, +) try: - client.runners.create( - connect_protocol_version=1, - ) + client.runners.create() except gitpod.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. @@ -132,12 +135,12 @@ from gitpod import Gitpod client = Gitpod( # default is 2 max_retries=0, + connect_protocol_version=True, + connect_timeout_header=0, ) # Or, configure per-request: -client.with_options(max_retries=5).runners.create( - connect_protocol_version=1, -) +client.with_options(max_retries=5).runners.create() ``` ### Timeouts @@ -152,17 +155,19 @@ from gitpod import Gitpod client = Gitpod( # 20 seconds (default is 1 minute) timeout=20.0, + connect_protocol_version=True, + connect_timeout_header=0, ) # More granular control: client = Gitpod( timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), + connect_protocol_version=True, + connect_timeout_header=0, ) # Override per-request: -client.with_options(timeout=5.0).runners.create( - connect_protocol_version=1, -) +client.with_options(timeout=5.0).runners.create() ``` On timeout, an `APITimeoutError` is thrown. @@ -202,10 +207,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to ```py from gitpod import Gitpod -client = Gitpod() -response = client.runners.with_raw_response.create( - connect_protocol_version=1, +client = Gitpod( + connect_protocol_version=True, + connect_timeout_header=0, ) +response = client.runners.with_raw_response.create() print(response.headers.get('X-My-Header')) runner = response.parse() # get the object that `runners.create()` would have returned @@ -223,9 +229,7 @@ The above interface eagerly reads the full response body when you make the reque To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. ```python -with client.runners.with_streaming_response.create( - connect_protocol_version=1, -) as response: +with client.runners.with_streaming_response.create() as response: print(response.headers.get("X-My-Header")) for line in response.iter_lines(): @@ -287,6 +291,8 @@ client = Gitpod( proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), + connect_protocol_version=True, + connect_timeout_header=0, ) ``` @@ -303,7 +309,10 @@ By default the library closes underlying HTTP connections whenever the client is ```py from gitpod import Gitpod -with Gitpod() as client: +with Gitpod( + connect_protocol_version=True, + connect_timeout_header=0, +) as client: # make requests here ... diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 6501485a..7b80453a 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -54,11 +54,15 @@ class Gitpod(SyncAPIClient): # client options bearer_token: str + connect_protocol_version: bool + connect_timeout_header: float def __init__( self, *, bearer_token: str | None = None, + connect_protocol_version: bool | None = 1, + connect_timeout_header: float, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -90,6 +94,12 @@ def __init__( ) self.bearer_token = bearer_token + if connect_protocol_version is None: + connect_protocol_version = 1 + self.connect_protocol_version = connect_protocol_version + + self.connect_timeout_header = connect_timeout_header + if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -134,6 +144,8 @@ def default_headers(self) -> dict[str, str | Omit]: return { **super().default_headers, "X-Stainless-Async": "false", + "Connect-Protocol-Version": str(self.connect_protocol_version), + "Connect-Timeout-Ms": str(self.connect_timeout_header), **self._custom_headers, } @@ -141,6 +153,8 @@ def copy( self, *, bearer_token: str | None = None, + connect_protocol_version: bool | None = None, + connect_timeout_header: float | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.Client | None = None, @@ -175,6 +189,8 @@ def copy( http_client = http_client or self._client return self.__class__( bearer_token=bearer_token or self.bearer_token, + connect_protocol_version=connect_protocol_version or self.connect_protocol_version, + connect_timeout_header=connect_timeout_header or self.connect_timeout_header, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, @@ -236,11 +252,15 @@ class AsyncGitpod(AsyncAPIClient): # client options bearer_token: str + connect_protocol_version: bool + connect_timeout_header: float def __init__( self, *, bearer_token: str | None = None, + connect_protocol_version: bool | None = 1, + connect_timeout_header: float, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -272,6 +292,12 @@ def __init__( ) self.bearer_token = bearer_token + if connect_protocol_version is None: + connect_protocol_version = 1 + self.connect_protocol_version = connect_protocol_version + + self.connect_timeout_header = connect_timeout_header + if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -316,6 +342,8 @@ def default_headers(self) -> dict[str, str | Omit]: return { **super().default_headers, "X-Stainless-Async": f"async:{get_async_library()}", + "Connect-Protocol-Version": str(self.connect_protocol_version), + "Connect-Timeout-Ms": str(self.connect_timeout_header), **self._custom_headers, } @@ -323,6 +351,8 @@ def copy( self, *, bearer_token: str | None = None, + connect_protocol_version: bool | None = None, + connect_timeout_header: float | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.AsyncClient | None = None, @@ -357,6 +387,8 @@ def copy( http_client = http_client or self._client return self.__class__( bearer_token=bearer_token or self.bearer_token, + connect_protocol_version=connect_protocol_version or self.connect_protocol_version, + connect_timeout_header=connect_timeout_header or self.connect_timeout_header, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, diff --git a/src/gitpod/resources/environment_classes.py b/src/gitpod/resources/environment_classes.py index 54e7fffc..4dd9e00f 100644 --- a/src/gitpod/resources/environment_classes.py +++ b/src/gitpod/resources/environment_classes.py @@ -2,16 +2,12 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..types import environment_class_list_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -51,10 +47,8 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp def list( self, *, - connect_protocol_version: Literal[1], filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -69,12 +63,8 @@ def list( query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: - connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environment classes - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -83,15 +73,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", body=maybe_transform( @@ -131,10 +112,8 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin async def list( self, *, - connect_protocol_version: Literal[1], filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -149,12 +128,8 @@ async def list( query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: - connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environment classes - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -163,15 +138,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", body=await async_maybe_transform( diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index 8d618ab1..1e125a29 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from .tasks import ( @@ -24,9 +22,7 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -87,10 +83,8 @@ def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: def upsert( self, *, - connect_protocol_version: Literal[1], automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -102,8 +96,6 @@ def upsert( UpsertAutomationsFile upserts the automations file for the given environment. Args: - connect_protocol_version: Define the version of the Connect protocol - automations_file: WARN: Do not remove any field here, as it will break reading automation yaml files. We error if there are any @@ -111,8 +103,6 @@ def upsert( we removed any fields. This includes marking a field as "reserved" in the proto file, this will also break reading the yaml. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -121,15 +111,6 @@ def upsert( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", body=maybe_transform( @@ -181,10 +162,8 @@ def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingRespon async def upsert( self, *, - connect_protocol_version: Literal[1], automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -196,8 +175,6 @@ async def upsert( UpsertAutomationsFile upserts the automations file for the given environment. Args: - connect_protocol_version: Define the version of the Connect protocol - automations_file: WARN: Do not remove any field here, as it will break reading automation yaml files. We error if there are any @@ -205,8 +182,6 @@ async def upsert( we removed any fields. This includes marking a field as "reserved" in the proto file, this will also break reading the yaml. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -215,15 +190,6 @@ async def upsert( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", body=await async_maybe_transform( diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index 67694136..926f671f 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -2,15 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -57,12 +53,10 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: def update( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, spec: service_update_params.Spec | NotGiven = NOT_GIVEN, status: service_update_params.Status | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -74,8 +68,6 @@ def update( UpdateService Args: - connect_protocol_version: Define the version of the Connect protocol - spec: Changing the spec of a service is a complex operation. The spec of a service can only be updated if the service is in a stopped state. If the service is @@ -87,8 +79,6 @@ def update( of this API you are not expected to provide this field. Updating this field requires the `environmentservice:update_status` permission. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -97,15 +87,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateService", body=maybe_transform( @@ -126,10 +107,8 @@ def update( def list( self, *, - connect_protocol_version: Literal[1], filter: service_list_params.Filter | NotGiven = NOT_GIVEN, pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -141,14 +120,10 @@ def list( ListServices Args: - connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing services pagination: pagination contains the pagination options for listing services - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -157,15 +132,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/ListServices", body=maybe_transform( @@ -184,10 +150,8 @@ def list( def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, force: bool | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -203,10 +167,6 @@ def delete( If the service is not stopped it will be stopped before deletion. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -215,15 +175,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteService", body=maybe_transform( @@ -242,9 +193,7 @@ def delete( def start( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -260,10 +209,6 @@ def start( This call will not error if the service is already running or has been started. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -272,15 +217,6 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/StartService", body=maybe_transform({"id": id}, service_start_params.ServiceStartParams), @@ -293,9 +229,7 @@ def start( def stop( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -311,10 +245,6 @@ def stop( This call will not error if the service is already stopped or has been stopped. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -323,15 +253,6 @@ def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/StopService", body=maybe_transform({"id": id}, service_stop_params.ServiceStopParams), @@ -365,12 +286,10 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: async def update( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, spec: service_update_params.Spec | NotGiven = NOT_GIVEN, status: service_update_params.Status | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -382,8 +301,6 @@ async def update( UpdateService Args: - connect_protocol_version: Define the version of the Connect protocol - spec: Changing the spec of a service is a complex operation. The spec of a service can only be updated if the service is in a stopped state. If the service is @@ -395,8 +312,6 @@ async def update( of this API you are not expected to provide this field. Updating this field requires the `environmentservice:update_status` permission. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -405,15 +320,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateService", body=await async_maybe_transform( @@ -434,10 +340,8 @@ async def update( async def list( self, *, - connect_protocol_version: Literal[1], filter: service_list_params.Filter | NotGiven = NOT_GIVEN, pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -449,14 +353,10 @@ async def list( ListServices Args: - connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing services pagination: pagination contains the pagination options for listing services - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -465,15 +365,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/ListServices", body=await async_maybe_transform( @@ -492,10 +383,8 @@ async def list( async def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, force: bool | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -511,10 +400,6 @@ async def delete( If the service is not stopped it will be stopped before deletion. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -523,15 +408,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteService", body=await async_maybe_transform( @@ -550,9 +426,7 @@ async def delete( async def start( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -568,10 +442,6 @@ async def start( This call will not error if the service is already running or has been started. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -580,15 +450,6 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StartService", body=await async_maybe_transform({"id": id}, service_start_params.ServiceStartParams), @@ -601,9 +462,7 @@ async def start( async def stop( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -619,10 +478,6 @@ async def stop( This call will not error if the service is already stopped or has been stopped. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -631,15 +486,6 @@ async def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StopService", body=await async_maybe_transform({"id": id}, service_stop_params.ServiceStopParams), diff --git a/src/gitpod/resources/environments/automations/task_executions.py b/src/gitpod/resources/environments/automations/task_executions.py index f8c0c3c4..9da36039 100644 --- a/src/gitpod/resources/environments/automations/task_executions.py +++ b/src/gitpod/resources/environments/automations/task_executions.py @@ -2,16 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -58,9 +56,7 @@ def with_streaming_response(self) -> TaskExecutionsResourceWithStreamingResponse def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,10 +68,6 @@ def retrieve( GetTaskExecution Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -84,15 +76,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", body=maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), @@ -105,10 +88,8 @@ def retrieve( def list( self, *, - connect_protocol_version: Literal[1], filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -120,14 +101,10 @@ def list( ListTaskExecutions Args: - connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing task runs pagination: pagination contains the pagination options for listing task runs - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -136,15 +113,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", body=maybe_transform( @@ -163,9 +131,7 @@ def list( def stop( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -177,10 +143,6 @@ def stop( StopTaskExecution Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -189,15 +151,6 @@ def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", body=maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), @@ -212,8 +165,6 @@ def update_task_execution_status( self, *, failure_message: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -233,10 +184,6 @@ def update_task_execution_status( If an individual step has failed, callers are NOT expected to set this message; only if the task execution as a whole has failed/cannot be started. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -252,8 +199,6 @@ def update_task_execution_status( self, *, log_url: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -270,10 +215,6 @@ def update_task_execution_status( log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task either has no logs or has not yet started. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -284,13 +225,11 @@ def update_task_execution_status( """ ... - @required_args(["failure_message", "connect_protocol_version"], ["log_url", "connect_protocol_version"]) + @required_args(["failure_message"], ["log_url"]) def update_task_execution_status( self, *, failure_message: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, log_url: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -299,15 +238,6 @@ def update_task_execution_status( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", body=maybe_transform( @@ -347,9 +277,7 @@ def with_streaming_response(self) -> AsyncTaskExecutionsResourceWithStreamingRes async def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -361,10 +289,6 @@ async def retrieve( GetTaskExecution Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -373,15 +297,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", body=await async_maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), @@ -394,10 +309,8 @@ async def retrieve( async def list( self, *, - connect_protocol_version: Literal[1], filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -409,14 +322,10 @@ async def list( ListTaskExecutions Args: - connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing task runs pagination: pagination contains the pagination options for listing task runs - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -425,15 +334,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", body=await async_maybe_transform( @@ -452,9 +352,7 @@ async def list( async def stop( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -466,10 +364,6 @@ async def stop( StopTaskExecution Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -478,15 +372,6 @@ async def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", body=await async_maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), @@ -501,8 +386,6 @@ async def update_task_execution_status( self, *, failure_message: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -522,10 +405,6 @@ async def update_task_execution_status( If an individual step has failed, callers are NOT expected to set this message; only if the task execution as a whole has failed/cannot be started. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -541,8 +420,6 @@ async def update_task_execution_status( self, *, log_url: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -559,10 +436,6 @@ async def update_task_execution_status( log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task either has no logs or has not yet started. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -573,13 +446,11 @@ async def update_task_execution_status( """ ... - @required_args(["failure_message", "connect_protocol_version"], ["log_url", "connect_protocol_version"]) + @required_args(["failure_message"], ["log_url"]) async def update_task_execution_status( self, *, failure_message: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, log_url: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -588,15 +459,6 @@ async def update_task_execution_status( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", body=await async_maybe_transform( diff --git a/src/gitpod/resources/environments/automations/tasks.py b/src/gitpod/resources/environments/automations/tasks.py index 13345d51..594d5f9b 100644 --- a/src/gitpod/resources/environments/automations/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks.py @@ -3,15 +3,12 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -62,12 +59,10 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, spec: task_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -79,10 +74,6 @@ def create( CreateTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -91,15 +82,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/CreateTask", body=maybe_transform( @@ -120,9 +102,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -134,10 +114,6 @@ def retrieve( GetTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -146,15 +122,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/GetTask", body=maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), @@ -167,12 +134,10 @@ def retrieve( def update( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, depends_on: List[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, spec: task_update_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -184,12 +149,8 @@ def update( UpdateTask Args: - connect_protocol_version: Define the version of the Connect protocol - depends_on: dependencies specifies the IDs of the automations this task depends on. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -198,15 +159,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTask", body=maybe_transform( @@ -227,10 +179,8 @@ def update( def list( self, *, - connect_protocol_version: Literal[1], filter: task_list_params.Filter | NotGiven = NOT_GIVEN, pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -242,14 +192,10 @@ def list( ListTasks Args: - connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing tasks pagination: pagination contains the pagination options for listing tasks - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -258,15 +204,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/ListTasks", body=maybe_transform( @@ -285,9 +222,7 @@ def list( def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -299,10 +234,6 @@ def delete( DeleteTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -311,15 +242,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteTask", body=maybe_transform({"id": id}, task_delete_params.TaskDeleteParams), @@ -332,9 +254,7 @@ def delete( def start( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -348,10 +268,6 @@ def start( until the task is started; the task will be started asynchronously. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -360,15 +276,6 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/StartTask", body=maybe_transform({"id": id}, task_start_params.TaskStartParams), @@ -402,12 +309,10 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: async def create( self, *, - connect_protocol_version: Literal[1], depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, spec: task_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -419,10 +324,6 @@ async def create( CreateTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -431,15 +332,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/CreateTask", body=await async_maybe_transform( @@ -460,9 +352,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -474,10 +364,6 @@ async def retrieve( GetTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -486,15 +372,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetTask", body=await async_maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), @@ -507,12 +384,10 @@ async def retrieve( async def update( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, depends_on: List[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, spec: task_update_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -524,12 +399,8 @@ async def update( UpdateTask Args: - connect_protocol_version: Define the version of the Connect protocol - depends_on: dependencies specifies the IDs of the automations this task depends on. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -538,15 +409,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTask", body=await async_maybe_transform( @@ -567,10 +429,8 @@ async def update( async def list( self, *, - connect_protocol_version: Literal[1], filter: task_list_params.Filter | NotGiven = NOT_GIVEN, pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -582,14 +442,10 @@ async def list( ListTasks Args: - connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing tasks pagination: pagination contains the pagination options for listing tasks - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -598,15 +454,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/ListTasks", body=await async_maybe_transform( @@ -625,9 +472,7 @@ async def list( async def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -639,10 +484,6 @@ async def delete( DeleteTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -651,15 +492,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteTask", body=await async_maybe_transform({"id": id}, task_delete_params.TaskDeleteParams), @@ -672,9 +504,7 @@ async def delete( async def start( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -688,10 +518,6 @@ async def start( until the task is started; the task will be started asynchronously. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -700,15 +526,6 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StartTask", body=await async_maybe_transform({"id": id}, task_start_params.TaskStartParams), diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 0bf75063..734419df 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ...types import ( @@ -15,9 +13,7 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -72,9 +68,7 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -86,14 +80,10 @@ def create( CreateEnvironment creates a new environment and starts it. Args: - connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment start - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -102,15 +92,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/CreateEnvironment", body=maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), @@ -123,9 +104,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -140,12 +119,8 @@ def retrieve( +return NOT_FOUND Environment does not exist Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment to get - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -154,15 +129,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/GetEnvironment", body=maybe_transform( @@ -177,11 +143,9 @@ def retrieve( def list( self, *, - connect_protocol_version: Literal[1], filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -193,14 +157,10 @@ def list( ListEnvironments returns a list of environments that match the query. Args: - connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization that contains the environments pagination: pagination contains the pagination options for listing environments - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -209,15 +169,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/ListEnvironments", body=maybe_transform( @@ -237,10 +188,8 @@ def list( def create_from_project( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -253,14 +202,10 @@ def create_from_project( and starts it. Args: - connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment start - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -269,15 +214,6 @@ def create_from_project( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", body=maybe_transform( @@ -296,9 +232,7 @@ def create_from_project( def start( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -313,12 +247,8 @@ def start( the environment is already running no error is returned. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies which environment should be started. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -327,15 +257,6 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", body=maybe_transform({"environment_id": environment_id}, environment_start_params.EnvironmentStartParams), @@ -373,9 +294,7 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo async def create( self, *, - connect_protocol_version: Literal[1], spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -387,14 +306,10 @@ async def create( CreateEnvironment creates a new environment and starts it. Args: - connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment start - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -403,15 +318,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/CreateEnvironment", body=await async_maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), @@ -424,9 +330,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -441,12 +345,8 @@ async def retrieve( +return NOT_FOUND Environment does not exist Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment to get - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -455,15 +355,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/GetEnvironment", body=await async_maybe_transform( @@ -478,11 +369,9 @@ async def retrieve( async def list( self, *, - connect_protocol_version: Literal[1], filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -494,14 +383,10 @@ async def list( ListEnvironments returns a list of environments that match the query. Args: - connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization that contains the environments pagination: pagination contains the pagination options for listing environments - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -510,15 +395,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/ListEnvironments", body=await async_maybe_transform( @@ -538,10 +414,8 @@ async def list( async def create_from_project( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -554,14 +428,10 @@ async def create_from_project( and starts it. Args: - connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment start - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -570,15 +440,6 @@ async def create_from_project( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", body=await async_maybe_transform( @@ -597,9 +458,7 @@ async def create_from_project( async def start( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -614,12 +473,8 @@ async def start( the environment is already running no error is returned. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies which environment should be started. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -628,15 +483,6 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", body=await async_maybe_transform( diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 1dd95ed9..893f759b 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal import httpx @@ -14,9 +13,7 @@ ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -58,9 +55,7 @@ def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: def exchange_token( self, *, - connect_protocol_version: Literal[1], exchange_token: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,12 +67,8 @@ def exchange_token( ExchangeToken trades an exchange token for a new access token. Args: - connect_protocol_version: Define the version of the Connect protocol - exchange_token: exchange_token is the token to exchange - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -86,15 +77,6 @@ def exchange_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.IdentityService/ExchangeToken", body=maybe_transform( @@ -110,8 +92,6 @@ def get_authenticated_identity( self, *, body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -123,10 +103,6 @@ def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -135,15 +111,6 @@ def get_authenticated_identity( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=maybe_transform( @@ -158,9 +125,7 @@ def get_authenticated_identity( def get_id_token( self, *, - connect_protocol_version: Literal[1], audience: List[str] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -173,10 +138,6 @@ def get_id_token( other services. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -185,15 +146,6 @@ def get_id_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.IdentityService/GetIDToken", body=maybe_transform({"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams), @@ -227,9 +179,7 @@ def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: async def exchange_token( self, *, - connect_protocol_version: Literal[1], exchange_token: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -241,12 +191,8 @@ async def exchange_token( ExchangeToken trades an exchange token for a new access token. Args: - connect_protocol_version: Define the version of the Connect protocol - exchange_token: exchange_token is the token to exchange - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -255,15 +201,6 @@ async def exchange_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.IdentityService/ExchangeToken", body=await async_maybe_transform( @@ -279,8 +216,6 @@ async def get_authenticated_identity( self, *, body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -292,10 +227,6 @@ async def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -304,15 +235,6 @@ async def get_authenticated_identity( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=await async_maybe_transform( @@ -327,9 +249,7 @@ async def get_authenticated_identity( async def get_id_token( self, *, - connect_protocol_version: Literal[1], audience: List[str] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -342,10 +262,6 @@ async def get_id_token( other services. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -354,15 +270,6 @@ async def get_id_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.IdentityService/GetIDToken", body=await async_maybe_transform( diff --git a/src/gitpod/resources/organizations/invite/invite.py b/src/gitpod/resources/organizations/invite/invite.py index aa334caf..d8a6b16f 100644 --- a/src/gitpod/resources/organizations/invite/invite.py +++ b/src/gitpod/resources/organizations/invite/invite.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from .summary import ( @@ -16,9 +14,7 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -64,9 +60,7 @@ def with_streaming_response(self) -> InviteResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -80,10 +74,6 @@ def create( OrganizationInvites are invalidated and can no longer be used. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -92,15 +82,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/CreateOrganizationInvite", body=maybe_transform({"organization_id": organization_id}, invite_create_params.InviteCreateParams), @@ -113,9 +94,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -129,10 +108,6 @@ def retrieve( exists, a new one is created. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -141,15 +116,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/GetOrganizationInvite", body=maybe_transform({"organization_id": organization_id}, invite_retrieve_params.InviteRetrieveParams), @@ -187,9 +153,7 @@ def with_streaming_response(self) -> AsyncInviteResourceWithStreamingResponse: async def create( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -203,10 +167,6 @@ async def create( OrganizationInvites are invalidated and can no longer be used. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -215,15 +175,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/CreateOrganizationInvite", body=await async_maybe_transform( @@ -238,9 +189,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -254,10 +203,6 @@ async def retrieve( exists, a new one is created. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -266,15 +211,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/GetOrganizationInvite", body=await async_maybe_transform( diff --git a/src/gitpod/resources/organizations/invite/summary.py b/src/gitpod/resources/organizations/invite/summary.py index d2f030a9..29433add 100644 --- a/src/gitpod/resources/organizations/invite/summary.py +++ b/src/gitpod/resources/organizations/invite/summary.py @@ -2,15 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -51,9 +47,7 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: def retrieve( self, *, - connect_protocol_version: Literal[1], invite_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -68,10 +62,6 @@ def retrieve( Used to discover which organization an invite is for. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -80,15 +70,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", body=maybe_transform({"invite_id": invite_id}, summary_retrieve_params.SummaryRetrieveParams), @@ -122,9 +103,7 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: async def retrieve( self, *, - connect_protocol_version: Literal[1], invite_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -139,10 +118,6 @@ async def retrieve( Used to discover which organization an invite is for. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -151,15 +126,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", body=await async_maybe_transform({"invite_id": invite_id}, summary_retrieve_params.SummaryRetrieveParams), diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index c081923a..af2717bd 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -13,9 +13,7 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -67,9 +65,7 @@ def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: def leave( self, *, - connect_protocol_version: Literal[1], user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -81,10 +77,6 @@ def leave( LeaveOrganization lets the passed user leave an Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -93,15 +85,6 @@ def leave( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/LeaveOrganization", body=maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), @@ -114,10 +97,8 @@ def leave( def list_members( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -129,14 +110,10 @@ def list_members( ListMembers lists all members of the specified organization. Args: - connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization to list members for pagination: pagination contains the pagination options for listing members - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -145,15 +122,6 @@ def list_members( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/ListMembers", body=maybe_transform( @@ -172,12 +140,10 @@ def list_members( def set_role( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -189,10 +155,6 @@ def set_role( SetRole Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -201,15 +163,6 @@ def set_role( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/SetRole", body=maybe_transform( @@ -254,9 +207,7 @@ def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResp async def leave( self, *, - connect_protocol_version: Literal[1], user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -268,10 +219,6 @@ async def leave( LeaveOrganization lets the passed user leave an Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -280,15 +227,6 @@ async def leave( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/LeaveOrganization", body=await async_maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), @@ -301,10 +239,8 @@ async def leave( async def list_members( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -316,14 +252,10 @@ async def list_members( ListMembers lists all members of the specified organization. Args: - connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization to list members for pagination: pagination contains the pagination options for listing members - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -332,15 +264,6 @@ async def list_members( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/ListMembers", body=await async_maybe_transform( @@ -359,12 +282,10 @@ async def list_members( async def set_role( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -376,10 +297,6 @@ async def set_role( SetRole Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -388,15 +305,6 @@ async def set_role( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/SetRole", body=await async_maybe_transform( diff --git a/src/gitpod/resources/personal_access_tokens.py b/src/gitpod/resources/personal_access_tokens.py index 4c13f958..dcd2f3a1 100644 --- a/src/gitpod/resources/personal_access_tokens.py +++ b/src/gitpod/resources/personal_access_tokens.py @@ -2,16 +2,12 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..types import personal_access_token_list_params, personal_access_token_delete_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -51,10 +47,8 @@ def with_streaming_response(self) -> PersonalAccessTokensResourceWithStreamingRe def list( self, *, - connect_protocol_version: Literal[1], filter: personal_access_token_list_params.Filter | NotGiven = NOT_GIVEN, pagination: personal_access_token_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -66,10 +60,6 @@ def list( ListPersonalAccessTokens Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -78,15 +68,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.UserService/ListPersonalAccessTokens", body=maybe_transform( @@ -105,9 +86,7 @@ def list( def delete( self, *, - connect_protocol_version: Literal[1], personal_access_token_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -119,10 +98,6 @@ def delete( DeletePersonalAccessToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -131,15 +106,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.UserService/DeletePersonalAccessToken", body=maybe_transform( @@ -176,10 +142,8 @@ def with_streaming_response(self) -> AsyncPersonalAccessTokensResourceWithStream async def list( self, *, - connect_protocol_version: Literal[1], filter: personal_access_token_list_params.Filter | NotGiven = NOT_GIVEN, pagination: personal_access_token_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -191,10 +155,6 @@ async def list( ListPersonalAccessTokens Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -203,15 +163,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.UserService/ListPersonalAccessTokens", body=await async_maybe_transform( @@ -230,9 +181,7 @@ async def list( async def delete( self, *, - connect_protocol_version: Literal[1], personal_access_token_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -244,10 +193,6 @@ async def delete( DeletePersonalAccessToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -256,15 +201,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.UserService/DeletePersonalAccessToken", body=await async_maybe_transform( diff --git a/src/gitpod/resources/projects.py b/src/gitpod/resources/projects.py index cb1195af..07e928f4 100644 --- a/src/gitpod/resources/projects.py +++ b/src/gitpod/resources/projects.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..types import ( @@ -13,9 +11,7 @@ ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -59,11 +55,9 @@ def create( *, environment_class: project_create_params.EnvironmentClass, initializer: project_create_params.Initializer, - connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,8 +71,6 @@ def create( Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized - connect_protocol_version: Define the version of the Connect protocol - automations_file_path: automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): @@ -93,8 +85,6 @@ def create( this.matches("^$|^[^/].*") ``` - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -103,15 +93,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/CreateProject", body=maybe_transform( @@ -133,9 +114,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -147,12 +126,8 @@ def retrieve( GetProject retrieves a single Project. Args: - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -161,15 +136,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/GetProject", body=maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), @@ -182,10 +148,8 @@ def retrieve( def create_from_environment( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -197,12 +161,8 @@ def create_from_environment( CreateProject creates a new Project using an environment as template. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -211,15 +171,6 @@ def create_from_environment( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", body=maybe_transform( @@ -261,11 +212,9 @@ async def create( *, environment_class: project_create_params.EnvironmentClass, initializer: project_create_params.Initializer, - connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -279,8 +228,6 @@ async def create( Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized - connect_protocol_version: Define the version of the Connect protocol - automations_file_path: automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): @@ -295,8 +242,6 @@ async def create( this.matches("^$|^[^/].*") ``` - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -305,15 +250,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/CreateProject", body=await async_maybe_transform( @@ -335,9 +271,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -349,12 +283,8 @@ async def retrieve( GetProject retrieves a single Project. Args: - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -363,15 +293,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/GetProject", body=await async_maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), @@ -384,10 +305,8 @@ async def retrieve( async def create_from_environment( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -399,12 +318,8 @@ async def create_from_environment( CreateProject creates a new Project using an environment as template. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -413,15 +328,6 @@ async def create_from_environment( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runner_configurations/configuration_schema.py b/src/gitpod/resources/runner_configurations/configuration_schema.py index 102168b8..bf56b710 100644 --- a/src/gitpod/resources/runner_configurations/configuration_schema.py +++ b/src/gitpod/resources/runner_configurations/configuration_schema.py @@ -2,15 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -52,9 +48,7 @@ def with_streaming_response(self) -> ConfigurationSchemaResourceWithStreamingRes def create( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -66,10 +60,6 @@ def create( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -78,15 +68,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=maybe_transform( @@ -101,9 +82,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -115,10 +94,6 @@ def retrieve( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -127,15 +102,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=maybe_transform( @@ -171,9 +137,7 @@ def with_streaming_response(self) -> AsyncConfigurationSchemaResourceWithStreami async def create( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -185,10 +149,6 @@ async def create( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -197,15 +157,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=await async_maybe_transform( @@ -220,9 +171,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -234,10 +183,6 @@ async def retrieve( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -246,15 +191,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runner_configurations/environment_classes.py b/src/gitpod/resources/runner_configurations/environment_classes.py index a5a67325..83d86e3a 100644 --- a/src/gitpod/resources/runner_configurations/environment_classes.py +++ b/src/gitpod/resources/runner_configurations/environment_classes.py @@ -2,16 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -54,8 +52,6 @@ def update( self, *, description: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -67,10 +63,6 @@ def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -86,8 +78,6 @@ def update( self, *, display_name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -99,10 +89,6 @@ def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -118,8 +104,6 @@ def update( self, *, enabled: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -131,10 +115,6 @@ def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -145,17 +125,11 @@ def update( """ ... - @required_args( - ["description", "connect_protocol_version"], - ["display_name", "connect_protocol_version"], - ["enabled", "connect_protocol_version"], - ) + @required_args(["description"], ["display_name"], ["enabled"]) def update( self, *, description: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -165,15 +139,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", body=maybe_transform( @@ -193,10 +158,8 @@ def update( def list( self, *, - connect_protocol_version: Literal[1], filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -210,12 +173,8 @@ def list( buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: - connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environment classes - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -224,15 +183,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", body=maybe_transform( @@ -274,8 +224,6 @@ async def update( self, *, description: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -287,10 +235,6 @@ async def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -306,8 +250,6 @@ async def update( self, *, display_name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -319,10 +261,6 @@ async def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -338,8 +276,6 @@ async def update( self, *, enabled: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -351,10 +287,6 @@ async def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -365,17 +297,11 @@ async def update( """ ... - @required_args( - ["description", "connect_protocol_version"], - ["display_name", "connect_protocol_version"], - ["enabled", "connect_protocol_version"], - ) + @required_args(["description"], ["display_name"], ["enabled"]) async def update( self, *, description: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -385,15 +311,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", body=await async_maybe_transform( @@ -413,10 +330,8 @@ async def update( async def list( self, *, - connect_protocol_version: Literal[1], filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -430,12 +345,8 @@ async def list( buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: - connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environment classes - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -444,15 +355,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py index 09b54440..79ad9656 100644 --- a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py @@ -4,16 +4,14 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -66,9 +64,7 @@ def with_streaming_response(self) -> HostAuthenticationTokensResourceWithStreami def create( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -80,10 +76,6 @@ def create( GetHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -92,15 +84,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=maybe_transform( @@ -115,9 +98,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -129,10 +110,6 @@ def retrieve( GetHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -141,15 +118,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=maybe_transform( @@ -166,8 +134,6 @@ def update( self, *, expires_at: Union[str, datetime], - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -269,10 +235,6 @@ def update( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -288,8 +250,6 @@ def update( self, *, refresh_token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -301,10 +261,6 @@ def update( UpdateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -320,8 +276,6 @@ def update( self, *, token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -333,10 +287,6 @@ def update( UpdateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -347,17 +297,11 @@ def update( """ ... - @required_args( - ["expires_at", "connect_protocol_version"], - ["refresh_token", "connect_protocol_version"], - ["token", "connect_protocol_version"], - ) + @required_args(["expires_at"], ["refresh_token"], ["token"]) def update( self, *, expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, refresh_token: str | NotGiven = NOT_GIVEN, token: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -367,15 +311,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=maybe_transform( @@ -395,10 +330,8 @@ def update( def list( self, *, - connect_protocol_version: Literal[1], filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -410,10 +343,6 @@ def list( ListHostAuthenticationTokens Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -422,15 +351,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", body=maybe_transform( @@ -449,9 +369,7 @@ def list( def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -463,10 +381,6 @@ def delete( DeleteHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -475,15 +389,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/DeleteHostAuthenticationToken", body=maybe_transform( @@ -519,9 +424,7 @@ def with_streaming_response(self) -> AsyncHostAuthenticationTokensResourceWithSt async def create( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -533,10 +436,6 @@ async def create( GetHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -545,15 +444,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=await async_maybe_transform( @@ -568,9 +458,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -582,10 +470,6 @@ async def retrieve( GetHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -594,15 +478,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=await async_maybe_transform( @@ -619,8 +494,6 @@ async def update( self, *, expires_at: Union[str, datetime], - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -722,10 +595,6 @@ async def update( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -741,8 +610,6 @@ async def update( self, *, refresh_token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -754,10 +621,6 @@ async def update( UpdateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -773,8 +636,6 @@ async def update( self, *, token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -786,10 +647,6 @@ async def update( UpdateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -800,17 +657,11 @@ async def update( """ ... - @required_args( - ["expires_at", "connect_protocol_version"], - ["refresh_token", "connect_protocol_version"], - ["token", "connect_protocol_version"], - ) + @required_args(["expires_at"], ["refresh_token"], ["token"]) async def update( self, *, expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, refresh_token: str | NotGiven = NOT_GIVEN, token: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -820,15 +671,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=await async_maybe_transform( @@ -848,10 +690,8 @@ async def update( async def list( self, *, - connect_protocol_version: Literal[1], filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -863,10 +703,6 @@ async def list( ListHostAuthenticationTokens Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -875,15 +711,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", body=await async_maybe_transform( @@ -902,9 +729,7 @@ async def list( async def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -916,10 +741,6 @@ async def delete( DeleteHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -928,15 +749,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/DeleteHostAuthenticationToken", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runner_configurations/runner_configurations.py b/src/gitpod/resources/runner_configurations/runner_configurations.py index 1b3a2871..5a272cc2 100644 --- a/src/gitpod/resources/runner_configurations/runner_configurations.py +++ b/src/gitpod/resources/runner_configurations/runner_configurations.py @@ -3,17 +3,15 @@ from __future__ import annotations from typing import Any, cast -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx from ...types import runner_configuration_validate_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -103,9 +101,7 @@ def validate( self, *, environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -121,10 +117,6 @@ def validate( with the runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -140,9 +132,7 @@ def validate( self, *, scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -158,10 +148,6 @@ def validate( with the runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -172,14 +158,12 @@ def validate( """ ... - @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) + @required_args(["environment_class"], ["scm_integration"]) def validate( self, *, environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -188,15 +172,6 @@ def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerConfigurationValidateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return cast( RunnerConfigurationValidateResponse, self._post( @@ -260,9 +235,7 @@ async def validate( self, *, environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -278,10 +251,6 @@ async def validate( with the runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -297,9 +266,7 @@ async def validate( self, *, scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -315,10 +282,6 @@ async def validate( with the runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -329,14 +292,12 @@ async def validate( """ ... - @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) + @required_args(["environment_class"], ["scm_integration"]) async def validate( self, *, environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -345,15 +306,6 @@ async def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerConfigurationValidateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return cast( RunnerConfigurationValidateResponse, await self._post( diff --git a/src/gitpod/resources/runner_configurations/scm_integration.py b/src/gitpod/resources/runner_configurations/scm_integration.py index 3a801fa9..db9262f9 100644 --- a/src/gitpod/resources/runner_configurations/scm_integration.py +++ b/src/gitpod/resources/runner_configurations/scm_integration.py @@ -2,16 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -54,8 +52,6 @@ def create( self, *, oauth_client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -71,10 +67,6 @@ def create( If configured, oauth_plaintext_client_secret must also be set. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -90,8 +82,6 @@ def create( self, *, oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -107,10 +97,6 @@ def create( This will first be encrypted with the runner's public key before being stored. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -121,15 +107,11 @@ def create( """ ... - @required_args( - ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] - ) + @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"]) def create( self, *, oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,15 +120,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", body=maybe_transform( @@ -188,8 +161,6 @@ async def create( self, *, oauth_client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -205,10 +176,6 @@ async def create( If configured, oauth_plaintext_client_secret must also be set. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -224,8 +191,6 @@ async def create( self, *, oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -241,10 +206,6 @@ async def create( This will first be encrypted with the runner's public key before being stored. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -255,15 +216,11 @@ async def create( """ ... - @required_args( - ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] - ) + @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"]) async def create( self, *, oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -272,15 +229,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 057d92ac..e299e148 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -2,15 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -51,10 +47,8 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def list( self, *, - connect_protocol_version: Literal[1], pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -66,14 +60,10 @@ def list( ListRunnerPolicies lists runner policies. Args: - connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing project policies runner_id: runner_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -82,15 +72,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/ListRunnerPolicies", body=maybe_transform( @@ -130,10 +111,8 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def list( self, *, - connect_protocol_version: Literal[1], pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -145,14 +124,10 @@ async def list( ListRunnerPolicies lists runner policies. Args: - connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing project policies runner_id: runner_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -161,15 +136,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/ListRunnerPolicies", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index c0042ba4..76a1b1c9 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -19,10 +19,8 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from .policies import ( @@ -80,14 +78,12 @@ def with_streaming_response(self) -> RunnersResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], kind: Literal[ "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" ] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -103,14 +99,10 @@ def create( an entire organisation or a single user. Args: - connect_protocol_version: Define the version of the Connect protocol - kind: RunnerKind represents the kind of a runner name: The runner name for humans - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -119,15 +111,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/CreateRunner", body=maybe_transform( @@ -147,9 +130,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -161,10 +142,6 @@ def retrieve( GetRunner returns a single runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -173,15 +150,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/GetRunner", body=maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), @@ -194,10 +162,8 @@ def retrieve( def list( self, *, - connect_protocol_version: Literal[1], filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -209,12 +175,8 @@ def list( ListRunners returns all runners registered in the scope. Args: - connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing runners - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -223,15 +185,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/ListRunners", body=maybe_transform( @@ -250,10 +203,8 @@ def list( def check_authentication_for_host( self, *, - connect_protocol_version: Literal[1], host: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -269,10 +220,6 @@ def check_authentication_for_host( authenticate, or indicate that Personal Access Tokens are supported. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -281,15 +228,6 @@ def check_authentication_for_host( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/CheckAuthenticationForHost", body=maybe_transform( @@ -308,9 +246,7 @@ def check_authentication_for_host( def create_runner_token( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -325,10 +261,6 @@ def create_runner_token( previouly issued tokens. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -337,15 +269,6 @@ def create_runner_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/CreateRunnerToken", body=maybe_transform( @@ -360,10 +283,8 @@ def create_runner_token( def delete_runner( self, *, - connect_protocol_version: Literal[1], force: bool | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -375,15 +296,11 @@ def delete_runner( DeleteRunner deletes an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol - force: force indicates whether the runner should be deleted forcefully. When force deleting a Runner, all Environments on the runner are also force deleted and regular Runner lifecycle is not respected. Force deleting can result in data loss. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -392,15 +309,6 @@ def delete_runner( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/DeleteRunner", body=maybe_transform( @@ -419,9 +327,7 @@ def delete_runner( def get_runner( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -433,10 +339,6 @@ def get_runner( GetRunner returns a single runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -445,15 +347,6 @@ def get_runner( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/GetRunner", body=maybe_transform({"runner_id": runner_id}, runner_get_runner_params.RunnerGetRunnerParams), @@ -466,10 +359,8 @@ def get_runner( def parse_context_url( self, *, - connect_protocol_version: Literal[1], context_url: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -492,10 +383,6 @@ def parse_context_url( exist Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -504,15 +391,6 @@ def parse_context_url( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/ParseContextURL", body=maybe_transform( @@ -533,8 +411,6 @@ def update_runner( self, *, name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -548,10 +424,6 @@ def update_runner( Args: name: The runner's name which is shown to users - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -567,8 +439,6 @@ def update_runner( self, *, spec: runner_update_runner_params.SpecSpec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -580,10 +450,6 @@ def update_runner( UpdateRunner updates an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -594,13 +460,11 @@ def update_runner( """ ... - @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + @required_args(["name"], ["spec"]) def update_runner( self, *, name: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, spec: runner_update_runner_params.SpecSpec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -609,15 +473,6 @@ def update_runner( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/UpdateRunner", body=maybe_transform( @@ -661,14 +516,12 @@ def with_streaming_response(self) -> AsyncRunnersResourceWithStreamingResponse: async def create( self, *, - connect_protocol_version: Literal[1], kind: Literal[ "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" ] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -684,14 +537,10 @@ async def create( an entire organisation or a single user. Args: - connect_protocol_version: Define the version of the Connect protocol - kind: RunnerKind represents the kind of a runner name: The runner name for humans - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -700,15 +549,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/CreateRunner", body=await async_maybe_transform( @@ -728,9 +568,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -742,10 +580,6 @@ async def retrieve( GetRunner returns a single runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -754,15 +588,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/GetRunner", body=await async_maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), @@ -775,10 +600,8 @@ async def retrieve( async def list( self, *, - connect_protocol_version: Literal[1], filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -790,12 +613,8 @@ async def list( ListRunners returns all runners registered in the scope. Args: - connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing runners - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -804,15 +623,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/ListRunners", body=await async_maybe_transform( @@ -831,10 +641,8 @@ async def list( async def check_authentication_for_host( self, *, - connect_protocol_version: Literal[1], host: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -850,10 +658,6 @@ async def check_authentication_for_host( authenticate, or indicate that Personal Access Tokens are supported. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -862,15 +666,6 @@ async def check_authentication_for_host( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/CheckAuthenticationForHost", body=await async_maybe_transform( @@ -889,9 +684,7 @@ async def check_authentication_for_host( async def create_runner_token( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -906,10 +699,6 @@ async def create_runner_token( previouly issued tokens. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -918,15 +707,6 @@ async def create_runner_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/CreateRunnerToken", body=await async_maybe_transform( @@ -941,10 +721,8 @@ async def create_runner_token( async def delete_runner( self, *, - connect_protocol_version: Literal[1], force: bool | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -956,15 +734,11 @@ async def delete_runner( DeleteRunner deletes an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol - force: force indicates whether the runner should be deleted forcefully. When force deleting a Runner, all Environments on the runner are also force deleted and regular Runner lifecycle is not respected. Force deleting can result in data loss. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -973,15 +747,6 @@ async def delete_runner( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/DeleteRunner", body=await async_maybe_transform( @@ -1000,9 +765,7 @@ async def delete_runner( async def get_runner( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1014,10 +777,6 @@ async def get_runner( GetRunner returns a single runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1026,15 +785,6 @@ async def get_runner( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/GetRunner", body=await async_maybe_transform({"runner_id": runner_id}, runner_get_runner_params.RunnerGetRunnerParams), @@ -1047,10 +797,8 @@ async def get_runner( async def parse_context_url( self, *, - connect_protocol_version: Literal[1], context_url: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1073,10 +821,6 @@ async def parse_context_url( exist Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1085,15 +829,6 @@ async def parse_context_url( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/ParseContextURL", body=await async_maybe_transform( @@ -1114,8 +849,6 @@ async def update_runner( self, *, name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1129,10 +862,6 @@ async def update_runner( Args: name: The runner's name which is shown to users - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1148,8 +877,6 @@ async def update_runner( self, *, spec: runner_update_runner_params.SpecSpec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1161,10 +888,6 @@ async def update_runner( UpdateRunner updates an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1175,13 +898,11 @@ async def update_runner( """ ... - @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + @required_args(["name"], ["spec"]) async def update_runner( self, *, name: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, spec: runner_update_runner_params.SpecSpec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1190,15 +911,6 @@ async def update_runner( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/UpdateRunner", body=await async_maybe_transform( diff --git a/src/gitpod/types/environment_class_list_params.py b/src/gitpod/types/environment_class_list_params.py index 82acdd22..b12968e4 100644 --- a/src/gitpod/types/environment_class_list_params.py +++ b/src/gitpod/types/environment_class_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,17 +10,11 @@ class EnvironmentClassListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - filter: Filter pagination: Pagination """pagination contains the pagination options for listing environment classes""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Filter(TypedDict, total=False): enabled: Required[bool] diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index 3886c64d..4750f3b3 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -31,9 +31,6 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - project_id: Annotated[str, PropertyInfo(alias="projectId")] spec: Spec @@ -42,9 +39,6 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False): start """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index e45f4aa9..34eff02e 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -31,18 +31,12 @@ class EnvironmentCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - spec: Spec """EnvironmentSpec specifies the configuration of an environment for an environment start """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index 69fc3b4d..a9dfe22f 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo @@ -11,9 +11,6 @@ class EnvironmentListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - filter: Filter organization_id: Annotated[str, PropertyInfo(alias="organizationId")] @@ -22,9 +19,6 @@ class EnvironmentListParams(TypedDict, total=False): pagination: Pagination """pagination contains the pagination options for listing environments""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Filter(TypedDict, total=False): creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] diff --git a/src/gitpod/types/environment_retrieve_params.py b/src/gitpod/types/environment_retrieve_params.py index a06329ae..7be510e5 100644 --- a/src/gitpod/types/environment_retrieve_params.py +++ b/src/gitpod/types/environment_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class EnvironmentRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies the environment to get""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_start_params.py b/src/gitpod/types/environment_start_params.py index 7827114d..83fe0a45 100644 --- a/src/gitpod/types/environment_start_params.py +++ b/src/gitpod/types/environment_start_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class EnvironmentStartParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies which environment should be started.""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automation_upsert_params.py b/src/gitpod/types/environments/automation_upsert_params.py index 3285979c..7810ea2e 100644 --- a/src/gitpod/types/environments/automation_upsert_params.py +++ b/src/gitpod/types/environments/automation_upsert_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -21,9 +21,6 @@ class AutomationUpsertParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - automations_file: Annotated[AutomationsFile, PropertyInfo(alias="automationsFile")] """ WARN: Do not remove any field here, as it will break reading automation yaml @@ -36,9 +33,6 @@ class AutomationUpsertParams(TypedDict, total=False): environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class AutomationsFileServicesCommands(TypedDict, total=False): ready: str diff --git a/src/gitpod/types/environments/automations/service_delete_params.py b/src/gitpod/types/environments/automations/service_delete_params.py index 11a2198a..2fc5f3d7 100644 --- a/src/gitpod/types/environments/automations/service_delete_params.py +++ b/src/gitpod/types/environments/automations/service_delete_params.py @@ -2,20 +2,12 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ServiceDeleteParams"] class ServiceDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str force: bool - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py index 2866c3f6..5ef181d4 100644 --- a/src/gitpod/types/environments/automations/service_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo @@ -11,18 +11,12 @@ class ServiceListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - filter: Filter """filter contains the filter options for listing services""" pagination: Pagination """pagination contains the pagination options for listing services""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Filter(TypedDict, total=False): environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] diff --git a/src/gitpod/types/environments/automations/service_start_params.py b/src/gitpod/types/environments/automations/service_start_params.py index 69eee8a0..237ab1e7 100644 --- a/src/gitpod/types/environments/automations/service_start_params.py +++ b/src/gitpod/types/environments/automations/service_start_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ServiceStartParams"] class ServiceStartParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_stop_params.py b/src/gitpod/types/environments/automations/service_stop_params.py index a86b4148..fcb5e253 100644 --- a/src/gitpod/types/environments/automations/service_stop_params.py +++ b/src/gitpod/types/environments/automations/service_stop_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ServiceStopParams"] class ServiceStopParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index e31fb35d..7e31293f 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -36,9 +36,6 @@ class ServiceUpdateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str metadata: Metadata @@ -59,9 +56,6 @@ class ServiceUpdateParams(TypedDict, total=False): requires the `environmentservice:update_status` permission. """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class MetadataDescription(TypedDict, total=False): description: Required[str] diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index a1d9bf64..976165ea 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -23,9 +23,6 @@ class TaskCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] environment_id: Annotated[str, PropertyInfo(alias="environmentId")] @@ -34,9 +31,6 @@ class TaskCreateParams(TypedDict, total=False): spec: Spec - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class MetadataCreator(TypedDict, total=False): id: str diff --git a/src/gitpod/types/environments/automations/task_delete_params.py b/src/gitpod/types/environments/automations/task_delete_params.py index 2c11ff0c..d1e4073d 100644 --- a/src/gitpod/types/environments/automations/task_delete_params.py +++ b/src/gitpod/types/environments/automations/task_delete_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TaskDeleteParams"] class TaskDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_list_params.py b/src/gitpod/types/environments/automations/task_execution_list_params.py index 78c3e7ba..47c79826 100644 --- a/src/gitpod/types/environments/automations/task_execution_list_params.py +++ b/src/gitpod/types/environments/automations/task_execution_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ...._utils import PropertyInfo @@ -11,18 +11,12 @@ class TaskExecutionListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - filter: Filter """filter contains the filter options for listing task runs""" pagination: Pagination """pagination contains the pagination options for listing task runs""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Filter(TypedDict, total=False): environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] diff --git a/src/gitpod/types/environments/automations/task_execution_retrieve_params.py b/src/gitpod/types/environments/automations/task_execution_retrieve_params.py index b13b311d..356e9b27 100644 --- a/src/gitpod/types/environments/automations/task_execution_retrieve_params.py +++ b/src/gitpod/types/environments/automations/task_execution_retrieve_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TaskExecutionRetrieveParams"] class TaskExecutionRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_stop_params.py b/src/gitpod/types/environments/automations/task_execution_stop_params.py index eeb7a922..3bb29994 100644 --- a/src/gitpod/types/environments/automations/task_execution_stop_params.py +++ b/src/gitpod/types/environments/automations/task_execution_stop_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TaskExecutionStopParams"] class TaskExecutionStopParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py b/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py index 6b28601f..428719ac 100644 --- a/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py +++ b/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -20,12 +20,6 @@ class FailureMessage(TypedDict, total=False): only if the task execution as a whole has failed/cannot be started. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class LogURL(TypedDict, total=False): log_url: Required[Annotated[str, PropertyInfo(alias="logUrl")]] @@ -34,11 +28,5 @@ class LogURL(TypedDict, total=False): If this is empty, the task either has no logs or has not yet started. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - TaskExecutionUpdateTaskExecutionStatusParams: TypeAlias = Union[FailureMessage, LogURL] diff --git a/src/gitpod/types/environments/automations/task_list_params.py b/src/gitpod/types/environments/automations/task_list_params.py index 763a6dfd..af1afb5a 100644 --- a/src/gitpod/types/environments/automations/task_list_params.py +++ b/src/gitpod/types/environments/automations/task_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo @@ -11,18 +11,12 @@ class TaskListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - filter: Filter """filter contains the filter options for listing tasks""" pagination: Pagination """pagination contains the pagination options for listing tasks""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Filter(TypedDict, total=False): environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] diff --git a/src/gitpod/types/environments/automations/task_retrieve_params.py b/src/gitpod/types/environments/automations/task_retrieve_params.py index b0d4d35b..acd7ec7a 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_params.py +++ b/src/gitpod/types/environments/automations/task_retrieve_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TaskRetrieveParams"] class TaskRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_start_params.py b/src/gitpod/types/environments/automations/task_start_params.py index 222ca23f..e9b47035 100644 --- a/src/gitpod/types/environments/automations/task_start_params.py +++ b/src/gitpod/types/environments/automations/task_start_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TaskStartParams"] class TaskStartParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index adb1ba2e..8ac5aae1 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -27,9 +27,6 @@ class TaskUpdateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] @@ -39,9 +36,6 @@ class TaskUpdateParams(TypedDict, total=False): spec: Spec - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class MetadataDescription(TypedDict, total=False): description: Required[str] diff --git a/src/gitpod/types/identity_exchange_token_params.py b/src/gitpod/types/identity_exchange_token_params.py index bb8becb3..e9114bd6 100644 --- a/src/gitpod/types/identity_exchange_token_params.py +++ b/src/gitpod/types/identity_exchange_token_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class IdentityExchangeTokenParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - exchange_token: Annotated[str, PropertyInfo(alias="exchangeToken")] """exchange_token is the token to exchange""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_authenticated_identity_params.py b/src/gitpod/types/identity_get_authenticated_identity_params.py index 457fe1f9..43dd9519 100644 --- a/src/gitpod/types/identity_get_authenticated_identity_params.py +++ b/src/gitpod/types/identity_get_authenticated_identity_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo +from typing_extensions import Required, TypedDict __all__ = ["IdentityGetAuthenticatedIdentityParams"] class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False): body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_id_token_params.py b/src/gitpod/types/identity_get_id_token_params.py index 7291a3b6..e1d4c821 100644 --- a/src/gitpod/types/identity_get_id_token_params.py +++ b/src/gitpod/types/identity_get_id_token_params.py @@ -3,18 +3,10 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["IdentityGetIDTokenParams"] class IdentityGetIDTokenParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - audience: List[str] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_leave_params.py b/src/gitpod/types/organization_leave_params.py index 4fe19ee5..c2c29933 100644 --- a/src/gitpod/types/organization_leave_params.py +++ b/src/gitpod/types/organization_leave_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class OrganizationLeaveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - user_id: Annotated[str, PropertyInfo(alias="userId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 77441c33..8ce2f9f3 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,18 +10,12 @@ class OrganizationListMembersParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] """organization_id is the ID of the organization to list members for""" pagination: Pagination """pagination contains the pagination options for listing members""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/organization_set_role_params.py b/src/gitpod/types/organization_set_role_params.py index fbd10649..1a81fb4a 100644 --- a/src/gitpod/types/organization_set_role_params.py +++ b/src/gitpod/types/organization_set_role_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,14 +10,8 @@ class OrganizationSetRoleParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] user_id: Annotated[str, PropertyInfo(alias="userId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite/summary_retrieve_params.py b/src/gitpod/types/organizations/invite/summary_retrieve_params.py index 86f4793d..6a17886c 100644 --- a/src/gitpod/types/organizations/invite/summary_retrieve_params.py +++ b/src/gitpod/types/organizations/invite/summary_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo @@ -10,10 +10,4 @@ class SummaryRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - invite_id: Annotated[str, PropertyInfo(alias="inviteId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_create_params.py b/src/gitpod/types/organizations/invite_create_params.py index 1cd14a51..7caa9f48 100644 --- a/src/gitpod/types/organizations/invite_create_params.py +++ b/src/gitpod/types/organizations/invite_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class InviteCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_retrieve_params.py b/src/gitpod/types/organizations/invite_retrieve_params.py index fbbeaa6d..3a6a5fd4 100644 --- a/src/gitpod/types/organizations/invite_retrieve_params.py +++ b/src/gitpod/types/organizations/invite_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class InviteRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/personal_access_token_delete_params.py b/src/gitpod/types/personal_access_token_delete_params.py index 39d64414..bcd3775c 100644 --- a/src/gitpod/types/personal_access_token_delete_params.py +++ b/src/gitpod/types/personal_access_token_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class PersonalAccessTokenDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - personal_access_token_id: Annotated[str, PropertyInfo(alias="personalAccessTokenId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/personal_access_token_list_params.py b/src/gitpod/types/personal_access_token_list_params.py index 2cca5162..301968bb 100644 --- a/src/gitpod/types/personal_access_token_list_params.py +++ b/src/gitpod/types/personal_access_token_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -11,16 +11,10 @@ class PersonalAccessTokenListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - filter: Filter pagination: Pagination - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Filter(TypedDict, total=False): user_ids: Annotated[List[str], PropertyInfo(alias="userIds")] diff --git a/src/gitpod/types/project_create_from_environment_params.py b/src/gitpod/types/project_create_from_environment_params.py index 477cbbdc..17da3e40 100644 --- a/src/gitpod/types/project_create_from_environment_params.py +++ b/src/gitpod/types/project_create_from_environment_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,13 +10,7 @@ class ProjectCreateFromEnvironmentParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies the environment identifier""" name: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index 0e9a1c4d..0f4dcfe2 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -27,9 +27,6 @@ class ProjectCreateParams(TypedDict, total=False): initializer: Required[Initializer] """EnvironmentInitializer specifies how an environment is to be initialized""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file relative to the repo @@ -52,9 +49,6 @@ class ProjectCreateParams(TypedDict, total=False): name: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class EnvironmentClassEnvironmentClassID(TypedDict, total=False): environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] diff --git a/src/gitpod/types/project_retrieve_params.py b/src/gitpod/types/project_retrieve_params.py index 42abf44b..0160fa6f 100644 --- a/src/gitpod/types/project_retrieve_params.py +++ b/src/gitpod/types/project_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class ProjectRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_check_authentication_for_host_params.py b/src/gitpod/types/runner_check_authentication_for_host_params.py index 67322e17..c3a5db48 100644 --- a/src/gitpod/types/runner_check_authentication_for_host_params.py +++ b/src/gitpod/types/runner_check_authentication_for_host_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,12 +10,6 @@ class RunnerCheckAuthenticationForHostParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - host: str runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configuration_validate_params.py b/src/gitpod/types/runner_configuration_validate_params.py index 830bdab2..21266e5f 100644 --- a/src/gitpod/types/runner_configuration_validate_params.py +++ b/src/gitpod/types/runner_configuration_validate_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from .._types import Base64FileInput from .._utils import PropertyInfo @@ -25,14 +25,8 @@ class EnvironmentClass(TypedDict, total=False): environment_class: Required[Annotated[EnvironmentClassEnvironmentClass, PropertyInfo(alias="environmentClass")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class EnvironmentClassEnvironmentClassConfiguration(TypedDict, total=False): key: str @@ -69,14 +63,8 @@ class EnvironmentClassEnvironmentClass(TypedDict, total=False): class ScmIntegration(TypedDict, total=False): scm_integration: Required[Annotated[ScmIntegrationScmIntegration, PropertyInfo(alias="scmIntegration")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class ScmIntegrationScmIntegrationOAuthClientID(TypedDict, total=False): oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] diff --git a/src/gitpod/types/runner_configurations/configuration_schema_create_params.py b/src/gitpod/types/runner_configurations/configuration_schema_create_params.py index b8cb816d..e7e60ee7 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_create_params.py +++ b/src/gitpod/types/runner_configurations/configuration_schema_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class ConfigurationSchemaCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py index d8ca6699..4425ceca 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py +++ b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class ConfigurationSchemaRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/environment_class_list_params.py b/src/gitpod/types/runner_configurations/environment_class_list_params.py index 9cbaf8f3..62a00f0f 100644 --- a/src/gitpod/types/runner_configurations/environment_class_list_params.py +++ b/src/gitpod/types/runner_configurations/environment_class_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,17 +10,11 @@ class EnvironmentClassListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - filter: Filter pagination: Pagination """pagination contains the pagination options for listing environment classes""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Filter(TypedDict, total=False): enabled: Required[bool] diff --git a/src/gitpod/types/runner_configurations/environment_class_update_params.py b/src/gitpod/types/runner_configurations/environment_class_update_params.py index f26ca514..e5df2848 100644 --- a/src/gitpod/types/runner_configurations/environment_class_update_params.py +++ b/src/gitpod/types/runner_configurations/environment_class_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo @@ -13,31 +13,13 @@ class Description(TypedDict, total=False): description: Required[str] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class DisplayName(TypedDict, total=False): display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Enabled(TypedDict, total=False): enabled: Required[bool] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - EnvironmentClassUpdateParams: TypeAlias = Union[Description, DisplayName, Enabled] diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py index fb34ff72..f3c7a10b 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["HostAuthenticationTokenCreateParams"] class HostAuthenticationTokenCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py index 05eaa723..f7de02b2 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["HostAuthenticationTokenDeleteParams"] class HostAuthenticationTokenDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py index 7d1cb306..718524bb 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo @@ -11,16 +11,10 @@ class HostAuthenticationTokenListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - filter: Filter pagination: Pagination - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class FilterRunnerID(TypedDict, total=False): runner_id: Required[Annotated[str, PropertyInfo(alias="runnerId")]] diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py index 82d07586..c544285c 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["HostAuthenticationTokenRetrieveParams"] class HostAuthenticationTokenRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py index eb360a36..b352d955 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo @@ -104,31 +104,13 @@ class ExpiresAt(TypedDict, total=False): to obtain a formatter capable of generating timestamps in this format. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class RefreshToken(TypedDict, total=False): refresh_token: Required[Annotated[str, PropertyInfo(alias="refreshToken")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Token(TypedDict, total=False): token: Required[str] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - HostAuthenticationTokenUpdateParams: TypeAlias = Union[ExpiresAt, RefreshToken, Token] diff --git a/src/gitpod/types/runner_configurations/scm_integration_create_params.py b/src/gitpod/types/runner_configurations/scm_integration_create_params.py index d32fee9d..4e8e6ff1 100644 --- a/src/gitpod/types/runner_configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runner_configurations/scm_integration_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo @@ -17,12 +17,6 @@ class OAuthClientID(TypedDict, total=False): If configured, oauth_plaintext_client_secret must also be set. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class OAuthPlaintextClientSecret(TypedDict, total=False): oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] @@ -31,11 +25,5 @@ class OAuthPlaintextClientSecret(TypedDict, total=False): This will first be encrypted with the runner's public key before being stored. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - ScmIntegrationCreateParams: TypeAlias = Union[OAuthClientID, OAuthPlaintextClientSecret] diff --git a/src/gitpod/types/runner_create_params.py b/src/gitpod/types/runner_create_params.py index 4e37b01e..7c10ca8c 100644 --- a/src/gitpod/types/runner_create_params.py +++ b/src/gitpod/types/runner_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,9 +10,6 @@ class RunnerCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - kind: Literal[ "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" ] @@ -23,9 +20,6 @@ class RunnerCreateParams(TypedDict, total=False): spec: Spec - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class SpecConfiguration(TypedDict, total=False): auto_update: Annotated[bool, PropertyInfo(alias="autoUpdate")] diff --git a/src/gitpod/types/runner_create_runner_token_params.py b/src/gitpod/types/runner_create_runner_token_params.py index da185a2c..8bf7b700 100644 --- a/src/gitpod/types/runner_create_runner_token_params.py +++ b/src/gitpod/types/runner_create_runner_token_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class RunnerCreateRunnerTokenParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_delete_runner_params.py b/src/gitpod/types/runner_delete_runner_params.py index 005bf36e..0d1668ad 100644 --- a/src/gitpod/types/runner_delete_runner_params.py +++ b/src/gitpod/types/runner_delete_runner_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,9 +10,6 @@ class RunnerDeleteRunnerParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - force: bool """ force indicates whether the runner should be deleted forcefully. When force @@ -22,6 +19,3 @@ class RunnerDeleteRunnerParams(TypedDict, total=False): """ runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_get_runner_params.py b/src/gitpod/types/runner_get_runner_params.py index 3079471c..b7a1cb12 100644 --- a/src/gitpod/types/runner_get_runner_params.py +++ b/src/gitpod/types/runner_get_runner_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class RunnerGetRunnerParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py index 4155c49d..cfeff679 100644 --- a/src/gitpod/types/runner_list_params.py +++ b/src/gitpod/types/runner_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo @@ -11,17 +11,11 @@ class RunnerListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - filter: Filter pagination: Pagination """pagination contains the pagination options for listing runners""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Filter(TypedDict, total=False): creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] diff --git a/src/gitpod/types/runner_parse_context_url_params.py b/src/gitpod/types/runner_parse_context_url_params.py index c131a243..986d37b1 100644 --- a/src/gitpod/types/runner_parse_context_url_params.py +++ b/src/gitpod/types/runner_parse_context_url_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,12 +10,6 @@ class RunnerParseContextURLParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - context_url: Annotated[str, PropertyInfo(alias="contextUrl")] runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_retrieve_params.py b/src/gitpod/types/runner_retrieve_params.py index 786b07dd..409766f2 100644 --- a/src/gitpod/types/runner_retrieve_params.py +++ b/src/gitpod/types/runner_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class RunnerRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_update_runner_params.py b/src/gitpod/types/runner_update_runner_params.py index c8750543..d7562f62 100644 --- a/src/gitpod/types/runner_update_runner_params.py +++ b/src/gitpod/types/runner_update_runner_params.py @@ -24,22 +24,10 @@ class Name(TypedDict, total=False): name: Required[str] """The runner's name which is shown to users""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Spec(TypedDict, total=False): spec: Required[SpecSpec] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class SpecSpecConfigurationConfigurationAutoUpdate(TypedDict, total=False): auto_update: Required[Annotated[bool, PropertyInfo(alias="autoUpdate")]] diff --git a/src/gitpod/types/runners/policy_list_params.py b/src/gitpod/types/runners/policy_list_params.py index af0ca922..69b8c0b7 100644 --- a/src/gitpod/types/runners/policy_list_params.py +++ b/src/gitpod/types/runners/policy_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,18 +10,12 @@ class PolicyListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - pagination: Pagination """pagination contains the pagination options for listing project policies""" runner_id: Annotated[str, PropertyInfo(alias="runnerId")] """runner_id specifies the project identifier""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Pagination(TypedDict, total=False): token: str diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 338ad174..a1135676 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -21,28 +21,22 @@ class TestServices: @parametrize def test_method_update(self, client: Gitpod) -> None: - service = client.environments.automations.services.update( - connect_protocol_version=1, - ) + service = client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={"description": "description"}, spec={"commands": {"ready": "ready"}}, status={"failure_message": "failureMessage"}, - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.update( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,9 +45,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -64,15 +56,12 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - service = client.environments.automations.services.list( - connect_protocol_version=1, - ) + service = client.environments.automations.services.list() assert_matches_type(ServiceListResponse, service, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.list( - connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["x"], @@ -82,15 +71,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(ServiceListResponse, service, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -99,9 +85,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -112,26 +96,20 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - service = client.environments.automations.services.delete( - connect_protocol_version=1, - ) + service = client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -140,9 +118,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -153,25 +129,19 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - service = client.environments.automations.services.start( - connect_protocol_version=1, - ) + service = client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.start( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.start( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -180,9 +150,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -193,25 +161,19 @@ def test_streaming_response_start(self, client: Gitpod) -> None: @parametrize def test_method_stop(self, client: Gitpod) -> None: - service = client.environments.automations.services.stop( - connect_protocol_version=1, - ) + service = client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.stop( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.stop( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -220,9 +182,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -237,28 +197,22 @@ class TestAsyncServices: @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.update( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={"description": "description"}, spec={"commands": {"ready": "ready"}}, status={"failure_message": "failureMessage"}, - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.update( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -267,9 +221,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -280,15 +232,12 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.list( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.list() assert_matches_type(ServiceListResponse, service, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( - connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["x"], @@ -298,15 +247,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(ServiceListResponse, service, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -315,9 +261,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -328,26 +272,20 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.delete( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -356,9 +294,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -369,25 +305,19 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.start( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.start( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -396,9 +326,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -409,25 +337,19 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.stop( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.stop( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -436,9 +358,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/automations/test_task_executions.py b/tests/api_resources/environments/automations/test_task_executions.py index f7d63563..9875b72c 100644 --- a/tests/api_resources/environments/automations/test_task_executions.py +++ b/tests/api_resources/environments/automations/test_task_executions.py @@ -22,25 +22,19 @@ class TestTaskExecutions: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.retrieve( - connect_protocol_version=1, - ) + task_execution = client.environments.automations.task_executions.retrieve() assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.environments.automations.task_executions.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -49,9 +43,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.environments.automations.task_executions.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,15 +54,12 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.list( - connect_protocol_version=1, - ) + task_execution = client.environments.automations.task_executions.list() assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.list( - connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], @@ -81,15 +70,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.environments.automations.task_executions.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,9 +84,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.environments.automations.task_executions.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -111,25 +95,19 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_stop(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.stop( - connect_protocol_version=1, - ) + task_execution = client.environments.automations.task_executions.stop() assert_matches_type(object, task_execution, path=["response"]) @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.stop( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.stop( - connect_protocol_version=1, - ) + response = client.environments.automations.task_executions.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -138,9 +116,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + with client.environments.automations.task_executions.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -153,16 +129,6 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: def test_method_update_task_execution_status_overload_1(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.update_task_execution_status( failure_message="failureMessage", - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_method_update_task_execution_status_with_all_params_overload_1(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @@ -170,7 +136,6 @@ def test_method_update_task_execution_status_with_all_params_overload_1(self, cl def test_raw_response_update_task_execution_status_overload_1(self, client: Gitpod) -> None: response = client.environments.automations.task_executions.with_raw_response.update_task_execution_status( failure_message="failureMessage", - connect_protocol_version=1, ) assert response.is_closed is True @@ -182,7 +147,6 @@ def test_raw_response_update_task_execution_status_overload_1(self, client: Gitp def test_streaming_response_update_task_execution_status_overload_1(self, client: Gitpod) -> None: with client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( failure_message="failureMessage", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -196,16 +160,6 @@ def test_streaming_response_update_task_execution_status_overload_1(self, client def test_method_update_task_execution_status_overload_2(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.update_task_execution_status( log_url="logUrl", - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_method_update_task_execution_status_with_all_params_overload_2(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @@ -213,7 +167,6 @@ def test_method_update_task_execution_status_with_all_params_overload_2(self, cl def test_raw_response_update_task_execution_status_overload_2(self, client: Gitpod) -> None: response = client.environments.automations.task_executions.with_raw_response.update_task_execution_status( log_url="logUrl", - connect_protocol_version=1, ) assert response.is_closed is True @@ -225,7 +178,6 @@ def test_raw_response_update_task_execution_status_overload_2(self, client: Gitp def test_streaming_response_update_task_execution_status_overload_2(self, client: Gitpod) -> None: with client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( log_url="logUrl", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -241,25 +193,19 @@ class TestAsyncTaskExecutions: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.retrieve( - connect_protocol_version=1, - ) + task_execution = await async_client.environments.automations.task_executions.retrieve() assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.task_executions.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.task_executions.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -268,9 +214,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.task_executions.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -281,15 +225,12 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.list( - connect_protocol_version=1, - ) + task_execution = await async_client.environments.automations.task_executions.list() assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.list( - connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], @@ -300,15 +241,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.task_executions.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.task_executions.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -317,9 +255,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.task_executions.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -330,25 +266,19 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.stop( - connect_protocol_version=1, - ) + task_execution = await async_client.environments.automations.task_executions.stop() assert_matches_type(object, task_execution, path=["response"]) @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.stop( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.task_executions.with_raw_response.stop( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.task_executions.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -357,9 +287,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.task_executions.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -372,18 +300,6 @@ async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async def test_method_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( failure_message="failureMessage", - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_method_update_task_execution_status_with_all_params_overload_1( - self, async_client: AsyncGitpod - ) -> None: - task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @@ -392,7 +308,6 @@ async def test_raw_response_update_task_execution_status_overload_1(self, async_ response = ( await async_client.environments.automations.task_executions.with_raw_response.update_task_execution_status( failure_message="failureMessage", - connect_protocol_version=1, ) ) @@ -405,7 +320,6 @@ async def test_raw_response_update_task_execution_status_overload_1(self, async_ async def test_streaming_response_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( failure_message="failureMessage", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -419,18 +333,6 @@ async def test_streaming_response_update_task_execution_status_overload_1(self, async def test_method_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( log_url="logUrl", - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_method_update_task_execution_status_with_all_params_overload_2( - self, async_client: AsyncGitpod - ) -> None: - task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @@ -439,7 +341,6 @@ async def test_raw_response_update_task_execution_status_overload_2(self, async_ response = ( await async_client.environments.automations.task_executions.with_raw_response.update_task_execution_status( log_url="logUrl", - connect_protocol_version=1, ) ) @@ -452,7 +353,6 @@ async def test_raw_response_update_task_execution_status_overload_2(self, async_ async def test_streaming_response_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( log_url="logUrl", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index febb4ef9..e73825ec 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -25,15 +25,12 @@ class TestTasks: @parametrize def test_method_create(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.create( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create( - connect_protocol_version=1, depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ @@ -56,15 +53,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: } }, }, - connect_timeout_ms=0, ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -73,9 +67,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -86,25 +78,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.retrieve( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -113,9 +99,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -126,28 +110,22 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_update(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.update( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={"description": "description"}, spec={"command": "command"}, - connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.update( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -156,9 +134,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -169,15 +145,12 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.list( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.list() assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( - connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["x"], @@ -187,15 +160,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -204,9 +174,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -217,25 +185,19 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.delete( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -244,9 +206,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -257,25 +217,19 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.start( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.start( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -284,9 +238,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -301,15 +253,12 @@ class TestAsyncTasks: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.create( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create( - connect_protocol_version=1, depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ @@ -332,15 +281,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> } }, }, - connect_timeout_ms=0, ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -349,9 +295,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -362,25 +306,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.retrieve( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -389,9 +327,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -402,28 +338,22 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.update( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={"description": "description"}, spec={"command": "command"}, - connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.update( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -432,9 +362,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -445,15 +373,12 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.list( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.list() assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( - connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["x"], @@ -463,15 +388,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -480,9 +402,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -493,25 +413,19 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.delete( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -520,9 +434,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -533,25 +445,19 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.start( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.start( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -560,9 +466,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index cf302b07..6a61c299 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -19,15 +19,12 @@ class TestAutomations: @parametrize def test_method_upsert(self, client: Gitpod) -> None: - automation = client.environments.automations.upsert( - connect_protocol_version=1, - ) + automation = client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize def test_method_upsert_with_all_params(self, client: Gitpod) -> None: automation = client.environments.automations.upsert( - connect_protocol_version=1, automations_file={ "services": { "foo": { @@ -64,15 +61,12 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: }, }, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize def test_raw_response_upsert(self, client: Gitpod) -> None: - response = client.environments.automations.with_raw_response.upsert( - connect_protocol_version=1, - ) + response = client.environments.automations.with_raw_response.upsert() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -81,9 +75,7 @@ def test_raw_response_upsert(self, client: Gitpod) -> None: @parametrize def test_streaming_response_upsert(self, client: Gitpod) -> None: - with client.environments.automations.with_streaming_response.upsert( - connect_protocol_version=1, - ) as response: + with client.environments.automations.with_streaming_response.upsert() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,15 +90,12 @@ class TestAsyncAutomations: @parametrize async def test_method_upsert(self, async_client: AsyncGitpod) -> None: - automation = await async_client.environments.automations.upsert( - connect_protocol_version=1, - ) + automation = await async_client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert( - connect_protocol_version=1, automations_file={ "services": { "foo": { @@ -143,15 +132,12 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> }, }, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.with_raw_response.upsert( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.with_raw_response.upsert() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -160,9 +146,7 @@ async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.with_streaming_response.upsert( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.with_streaming_response.upsert() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/organizations/invite/test_summary.py b/tests/api_resources/organizations/invite/test_summary.py index efed9ad1..d364307a 100644 --- a/tests/api_resources/organizations/invite/test_summary.py +++ b/tests/api_resources/organizations/invite/test_summary.py @@ -19,25 +19,19 @@ class TestSummary: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - summary = client.organizations.invite.summary.retrieve( - connect_protocol_version=1, - ) + summary = client.organizations.invite.summary.retrieve() assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: summary = client.organizations.invite.summary.retrieve( - connect_protocol_version=1, invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.invite.summary.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.organizations.invite.summary.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -46,9 +40,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.invite.summary.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.organizations.invite.summary.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,25 +55,19 @@ class TestAsyncSummary: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - summary = await async_client.organizations.invite.summary.retrieve( - connect_protocol_version=1, - ) + summary = await async_client.organizations.invite.summary.retrieve() assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: summary = await async_client.organizations.invite.summary.retrieve( - connect_protocol_version=1, invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invite.summary.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.organizations.invite.summary.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,9 +76,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invite.summary.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.invite.summary.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/organizations/test_invite.py b/tests/api_resources/organizations/test_invite.py index 52a7e802..9adf95c7 100644 --- a/tests/api_resources/organizations/test_invite.py +++ b/tests/api_resources/organizations/test_invite.py @@ -22,25 +22,19 @@ class TestInvite: @parametrize def test_method_create(self, client: Gitpod) -> None: - invite = client.organizations.invite.create( - connect_protocol_version=1, - ) + invite = client.organizations.invite.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invite.create( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.invite.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.organizations.invite.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -49,9 +43,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.invite.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.organizations.invite.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,25 +54,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - invite = client.organizations.invite.retrieve( - connect_protocol_version=1, - ) + invite = client.organizations.invite.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invite.retrieve( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.invite.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.organizations.invite.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -89,9 +75,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.invite.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.organizations.invite.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,25 +90,19 @@ class TestAsyncInvite: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invite.create( - connect_protocol_version=1, - ) + invite = await async_client.organizations.invite.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invite.create( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invite.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.organizations.invite.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -133,9 +111,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invite.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.invite.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -146,25 +122,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invite.retrieve( - connect_protocol_version=1, - ) + invite = await async_client.organizations.invite.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invite.retrieve( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invite.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.organizations.invite.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,9 +143,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invite.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.invite.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runner_configurations/test_configuration_schema.py b/tests/api_resources/runner_configurations/test_configuration_schema.py index c3ec0956..5d6a4ff5 100644 --- a/tests/api_resources/runner_configurations/test_configuration_schema.py +++ b/tests/api_resources/runner_configurations/test_configuration_schema.py @@ -22,25 +22,19 @@ class TestConfigurationSchema: @parametrize def test_method_create(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.create( - connect_protocol_version=1, - ) + configuration_schema = client.runner_configurations.configuration_schema.create() assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: configuration_schema = client.runner_configurations.configuration_schema.create( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runner_configurations.configuration_schema.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.runner_configurations.configuration_schema.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -49,9 +43,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runner_configurations.configuration_schema.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.runner_configurations.configuration_schema.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,25 +54,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - ) + configuration_schema = client.runner_configurations.configuration_schema.retrieve() assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: configuration_schema = client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_configurations.configuration_schema.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.runner_configurations.configuration_schema.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -89,9 +75,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_configurations.configuration_schema.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.runner_configurations.configuration_schema.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,25 +90,19 @@ class TestAsyncConfigurationSchema: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.create( - connect_protocol_version=1, - ) + configuration_schema = await async_client.runner_configurations.configuration_schema.create() assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: configuration_schema = await async_client.runner_configurations.configuration_schema.create( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.configuration_schema.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.runner_configurations.configuration_schema.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -133,9 +111,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.configuration_schema.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.runner_configurations.configuration_schema.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -146,25 +122,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - ) + configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve() assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.configuration_schema.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.runner_configurations.configuration_schema.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,9 +143,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.configuration_schema.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.runner_configurations.configuration_schema.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runner_configurations/test_environment_classes.py b/tests/api_resources/runner_configurations/test_environment_classes.py index 14f6251e..c082c59e 100644 --- a/tests/api_resources/runner_configurations/test_environment_classes.py +++ b/tests/api_resources/runner_configurations/test_environment_classes.py @@ -23,16 +23,6 @@ class TestEnvironmentClasses: def test_method_update_overload_1(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( description="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.update( - description="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -40,7 +30,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.environment_classes.with_raw_response.update( description="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -52,7 +41,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.environment_classes.with_streaming_response.update( description="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -66,16 +54,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( display_name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.update( - display_name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -83,7 +61,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runner_configurations.environment_classes.with_raw_response.update( display_name="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -95,7 +72,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runner_configurations.environment_classes.with_streaming_response.update( display_name="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -109,16 +85,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: def test_method_update_overload_3(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( enabled=True, - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.update( - enabled=True, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -126,7 +92,6 @@ def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runner_configurations.environment_classes.with_raw_response.update( enabled=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -138,7 +103,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runner_configurations.environment_classes.with_streaming_response.update( enabled=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,29 +114,23 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.list( - connect_protocol_version=1, - ) + environment_class = client.runner_configurations.environment_classes.list() assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.list( - connect_protocol_version=1, filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runner_configurations.environment_classes.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.runner_configurations.environment_classes.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -181,9 +139,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runner_configurations.environment_classes.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.runner_configurations.environment_classes.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -200,16 +156,6 @@ class TestAsyncEnvironmentClasses: async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.update( description="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.update( - description="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -217,7 +163,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.environment_classes.with_raw_response.update( description="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -229,7 +174,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.environment_classes.with_streaming_response.update( description="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -243,16 +187,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.update( display_name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.update( - display_name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -260,7 +194,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.environment_classes.with_raw_response.update( display_name="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -272,7 +205,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.environment_classes.with_streaming_response.update( display_name="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -286,16 +218,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.update( enabled=True, - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.update( - enabled=True, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -303,7 +225,6 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.environment_classes.with_raw_response.update( enabled=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -315,7 +236,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.environment_classes.with_streaming_response.update( enabled=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -327,29 +247,23 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.list( - connect_protocol_version=1, - ) + environment_class = await async_client.runner_configurations.environment_classes.list() assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.list( - connect_protocol_version=1, filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.environment_classes.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.runner_configurations.environment_classes.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -358,9 +272,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.environment_classes.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.runner_configurations.environment_classes.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py index baff3306..904c020e 100644 --- a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py @@ -24,25 +24,19 @@ class TestHostAuthenticationTokens: @parametrize def test_method_create(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.create( - connect_protocol_version=1, - ) + host_authentication_token = client.runner_configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.create( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.runner_configurations.host_authentication_tokens.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,9 +45,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -64,25 +56,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, - ) + host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -91,9 +77,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,16 +90,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -123,7 +97,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, ) assert response.is_closed is True @@ -135,7 +108,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -149,16 +121,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( refresh_token="refreshToken", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( - refresh_token="refreshToken", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -166,7 +128,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( refresh_token="refreshToken", - connect_protocol_version=1, ) assert response.is_closed is True @@ -178,7 +139,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( refresh_token="refreshToken", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -192,16 +152,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: def test_method_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( token="x", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( - token="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -209,7 +159,6 @@ def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( token="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -221,7 +170,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( token="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -233,29 +181,23 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.list( - connect_protocol_version=1, - ) + host_authentication_token = client.runner_configurations.host_authentication_tokens.list() assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.list( - connect_protocol_version=1, filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.runner_configurations.host_authentication_tokens.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -264,9 +206,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -277,25 +217,19 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.delete( - connect_protocol_version=1, - ) + host_authentication_token = client.runner_configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.runner_configurations.host_authentication_tokens.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -304,9 +238,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -321,25 +253,19 @@ class TestAsyncHostAuthenticationTokens: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create( - connect_protocol_version=1, - ) + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -348,9 +274,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -361,25 +285,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, - ) + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -388,9 +306,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -403,16 +319,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -420,7 +326,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, ) assert response.is_closed is True @@ -432,7 +337,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -446,16 +350,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( refresh_token="refreshToken", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( - refresh_token="refreshToken", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -463,7 +357,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( refresh_token="refreshToken", - connect_protocol_version=1, ) assert response.is_closed is True @@ -475,7 +368,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( refresh_token="refreshToken", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -489,16 +381,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( token="x", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( - token="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -506,7 +388,6 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( token="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -518,7 +399,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( token="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -530,29 +410,23 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list( - connect_protocol_version=1, - ) + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list() assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list( - connect_protocol_version=1, filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -561,9 +435,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -574,25 +446,19 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete( - connect_protocol_version=1, - ) + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -601,9 +467,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runner_configurations/test_scm_integration.py b/tests/api_resources/runner_configurations/test_scm_integration.py index e83be4b1..17180f31 100644 --- a/tests/api_resources/runner_configurations/test_scm_integration.py +++ b/tests/api_resources/runner_configurations/test_scm_integration.py @@ -21,16 +21,6 @@ class TestScmIntegration: def test_method_create_overload_1(self, client: Gitpod) -> None: scm_integration = client.runner_configurations.scm_integration.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: - scm_integration = client.runner_configurations.scm_integration.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -38,7 +28,6 @@ def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.scm_integration.with_raw_response.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) assert response.is_closed is True @@ -50,7 +39,6 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.scm_integration.with_streaming_response.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -64,16 +52,6 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: def test_method_create_overload_2(self, client: Gitpod) -> None: scm_integration = client.runner_configurations.scm_integration.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: - scm_integration = client.runner_configurations.scm_integration.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -81,7 +59,6 @@ def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.runner_configurations.scm_integration.with_raw_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) assert response.is_closed is True @@ -93,7 +70,6 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.runner_configurations.scm_integration.with_streaming_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -111,16 +87,6 @@ class TestAsyncScmIntegration: async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runner_configurations.scm_integration.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runner_configurations.scm_integration.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -128,7 +94,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.scm_integration.with_raw_response.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) assert response.is_closed is True @@ -140,7 +105,6 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.scm_integration.with_streaming_response.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -154,16 +118,6 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runner_configurations.scm_integration.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runner_configurations.scm_integration.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -171,7 +125,6 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.scm_integration.with_raw_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) assert response.is_closed is True @@ -183,7 +136,6 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.scm_integration.with_streaming_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index 410b9adb..59d1efdc 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -19,29 +19,23 @@ class TestPolicies: @parametrize def test_method_list(self, client: Gitpod) -> None: - policy = client.runners.policies.list( - connect_protocol_version=1, - ) + policy = client.runners.policies.list() assert_matches_type(PolicyListResponse, policy, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.list( - connect_protocol_version=1, pagination={ "token": "token", "page_size": 100, }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.policies.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.runners.policies.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -50,9 +44,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.policies.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.runners.policies.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -67,29 +59,23 @@ class TestAsyncPolicies: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - policy = await async_client.runners.policies.list( - connect_protocol_version=1, - ) + policy = await async_client.runners.policies.list() assert_matches_type(PolicyListResponse, policy, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( - connect_protocol_version=1, pagination={ "token": "token", "page_size": 100, }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.policies.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.runners.policies.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,9 +84,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.policies.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.runners.policies.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_environment_classes.py b/tests/api_resources/test_environment_classes.py index 8ee23ac0..fd172171 100644 --- a/tests/api_resources/test_environment_classes.py +++ b/tests/api_resources/test_environment_classes.py @@ -19,29 +19,23 @@ class TestEnvironmentClasses: @parametrize def test_method_list(self, client: Gitpod) -> None: - environment_class = client.environment_classes.list( - connect_protocol_version=1, - ) + environment_class = client.environment_classes.list() assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.environment_classes.list( - connect_protocol_version=1, filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environment_classes.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.environment_classes.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -50,9 +44,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environment_classes.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.environment_classes.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -67,29 +59,23 @@ class TestAsyncEnvironmentClasses: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.environment_classes.list( - connect_protocol_version=1, - ) + environment_class = await async_client.environment_classes.list() assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.environment_classes.list( - connect_protocol_version=1, filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_classes.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.environment_classes.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,9 +84,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_classes.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.environment_classes.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index a949657b..0ece6d79 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -24,15 +24,12 @@ class TestEnvironments: @parametrize def test_method_create(self, client: Gitpod) -> None: - environment = client.environments.create( - connect_protocol_version=1, - ) + environment = client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( - connect_protocol_version=1, spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -79,15 +76,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "timeout": {"disconnected": "+9125115.360s"}, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -96,9 +90,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -109,25 +101,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - environment = client.environments.retrieve( - connect_protocol_version=1, - ) + environment = client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment = client.environments.retrieve( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -136,9 +122,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -149,15 +133,12 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - environment = client.environments.list( - connect_protocol_version=1, - ) + environment = client.environments.list() assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( - connect_protocol_version=1, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -170,15 +151,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -187,9 +165,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -200,15 +176,12 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: - environment = client.environments.create_from_project( - connect_protocol_version=1, - ) + environment = client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", @@ -256,15 +229,12 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "timeout": {"disconnected": "+9125115.360s"}, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize def test_raw_response_create_from_project(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.create_from_project( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.create_from_project() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -273,9 +243,7 @@ def test_raw_response_create_from_project(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_from_project(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.create_from_project( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.create_from_project() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -286,25 +254,19 @@ def test_streaming_response_create_from_project(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - environment = client.environments.start( - connect_protocol_version=1, - ) + environment = client.environments.start() assert_matches_type(object, environment, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.start( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -313,9 +275,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -330,15 +290,12 @@ class TestAsyncEnvironments: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.create( - connect_protocol_version=1, - ) + environment = await async_client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( - connect_protocol_version=1, spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -385,15 +342,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "timeout": {"disconnected": "+9125115.360s"}, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -402,9 +356,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -415,25 +367,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.retrieve( - connect_protocol_version=1, - ) + environment = await async_client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -442,9 +388,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -455,15 +399,12 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.list( - connect_protocol_version=1, - ) + environment = await async_client.environments.list() assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( - connect_protocol_version=1, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -476,15 +417,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -493,9 +431,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -506,15 +442,12 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.create_from_project( - connect_protocol_version=1, - ) + environment = await async_client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", @@ -562,15 +495,12 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "timeout": {"disconnected": "+9125115.360s"}, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.create_from_project( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.create_from_project() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -579,9 +509,7 @@ async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) @parametrize async def test_streaming_response_create_from_project(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.create_from_project( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.create_from_project() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -592,25 +520,19 @@ async def test_streaming_response_create_from_project(self, async_client: AsyncG @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.start( - connect_protocol_version=1, - ) + environment = await async_client.environments.start() assert_matches_type(object, environment, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.start( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -619,9 +541,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index ae92d5e8..bdd08d3e 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -23,25 +23,19 @@ class TestIdentity: @parametrize def test_method_exchange_token(self, client: Gitpod) -> None: - identity = client.identity.exchange_token( - connect_protocol_version=1, - ) + identity = client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.exchange_token( - connect_protocol_version=1, exchange_token="exchangeToken", - connect_timeout_ms=0, ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize def test_raw_response_exchange_token(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.exchange_token( - connect_protocol_version=1, - ) + response = client.identity.with_raw_response.exchange_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -50,9 +44,7 @@ def test_raw_response_exchange_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_exchange_token(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.exchange_token( - connect_protocol_version=1, - ) as response: + with client.identity.with_streaming_response.exchange_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -65,16 +57,6 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: def test_method_get_authenticated_identity(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( body={}, - connect_protocol_version=1, - ) - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: - identity = client.identity.get_authenticated_identity( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -82,7 +64,6 @@ def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_authenticated_identity( body={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -94,7 +75,6 @@ def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_authenticated_identity( body={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,25 +86,19 @@ def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> @parametrize def test_method_get_id_token(self, client: Gitpod) -> None: - identity = client.identity.get_id_token( - connect_protocol_version=1, - ) + identity = client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( - connect_protocol_version=1, audience=["string"], - connect_timeout_ms=0, ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize def test_raw_response_get_id_token(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.get_id_token( - connect_protocol_version=1, - ) + response = client.identity.with_raw_response.get_id_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -133,9 +107,7 @@ def test_raw_response_get_id_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_id_token(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.get_id_token( - connect_protocol_version=1, - ) as response: + with client.identity.with_streaming_response.get_id_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,25 +122,19 @@ class TestAsyncIdentity: @parametrize async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.exchange_token( - connect_protocol_version=1, - ) + identity = await async_client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token( - connect_protocol_version=1, exchange_token="exchangeToken", - connect_timeout_ms=0, ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.exchange_token( - connect_protocol_version=1, - ) + response = await async_client.identity.with_raw_response.exchange_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -177,9 +143,7 @@ async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> N @parametrize async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.exchange_token( - connect_protocol_version=1, - ) as response: + async with async_client.identity.with_streaming_response.exchange_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -192,16 +156,6 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( body={}, - connect_protocol_version=1, - ) - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.get_authenticated_identity( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -209,7 +163,6 @@ async def test_method_get_authenticated_identity_with_all_params(self, async_cli async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_authenticated_identity( body={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -221,7 +174,6 @@ async def test_raw_response_get_authenticated_identity(self, async_client: Async async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_authenticated_identity( body={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -233,25 +185,19 @@ async def test_streaming_response_get_authenticated_identity(self, async_client: @parametrize async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.get_id_token( - connect_protocol_version=1, - ) + identity = await async_client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( - connect_protocol_version=1, audience=["string"], - connect_timeout_ms=0, ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.get_id_token( - connect_protocol_version=1, - ) + response = await async_client.identity.with_raw_response.get_id_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -260,9 +206,7 @@ async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> Non @parametrize async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.get_id_token( - connect_protocol_version=1, - ) as response: + async with async_client.identity.with_streaming_response.get_id_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 58d19c5f..457813ba 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -21,25 +21,19 @@ class TestOrganizations: @parametrize def test_method_leave(self, client: Gitpod) -> None: - organization = client.organizations.leave( - connect_protocol_version=1, - ) + organization = client.organizations.leave() assert_matches_type(object, organization, path=["response"]) @parametrize def test_method_leave_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.leave( - connect_protocol_version=1, user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.leave( - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.leave() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -48,9 +42,7 @@ def test_raw_response_leave(self, client: Gitpod) -> None: @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.leave( - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.leave() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -61,29 +53,23 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: @parametrize def test_method_list_members(self, client: Gitpod) -> None: - organization = client.organizations.list_members( - connect_protocol_version=1, - ) + organization = client.organizations.list_members() assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.list_members( - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.list_members() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -92,9 +78,7 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.list_members( - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.list_members() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -105,27 +89,21 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: @parametrize def test_method_set_role(self, client: Gitpod) -> None: - organization = client.organizations.set_role( - connect_protocol_version=1, - ) + organization = client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) @parametrize def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="ORGANIZATION_ROLE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.set_role( - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.set_role() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -134,9 +112,7 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.set_role( - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.set_role() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -151,25 +127,19 @@ class TestAsyncOrganizations: @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.leave( - connect_protocol_version=1, - ) + organization = await async_client.organizations.leave() assert_matches_type(object, organization, path=["response"]) @parametrize async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( - connect_protocol_version=1, user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.leave( - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.leave() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -178,9 +148,7 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.leave( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.leave() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -191,29 +159,23 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.list_members( - connect_protocol_version=1, - ) + organization = await async_client.organizations.list_members() assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.list_members( - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.list_members() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -222,9 +184,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.list_members( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.list_members() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -235,27 +195,21 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.set_role( - connect_protocol_version=1, - ) + organization = await async_client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) @parametrize async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="ORGANIZATION_ROLE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.set_role( - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.set_role() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -264,9 +218,7 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.set_role( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.set_role() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_personal_access_tokens.py b/tests/api_resources/test_personal_access_tokens.py index 734793be..4dfef7c3 100644 --- a/tests/api_resources/test_personal_access_tokens.py +++ b/tests/api_resources/test_personal_access_tokens.py @@ -21,29 +21,23 @@ class TestPersonalAccessTokens: @parametrize def test_method_list(self, client: Gitpod) -> None: - personal_access_token = client.personal_access_tokens.list( - connect_protocol_version=1, - ) + personal_access_token = client.personal_access_tokens.list() assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: personal_access_token = client.personal_access_tokens.list( - connect_protocol_version=1, filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.personal_access_tokens.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.personal_access_tokens.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -52,9 +46,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.personal_access_tokens.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.personal_access_tokens.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -65,25 +57,19 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - personal_access_token = client.personal_access_tokens.delete( - connect_protocol_version=1, - ) + personal_access_token = client.personal_access_tokens.delete() assert_matches_type(object, personal_access_token, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: personal_access_token = client.personal_access_tokens.delete( - connect_protocol_version=1, personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, personal_access_token, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.personal_access_tokens.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.personal_access_tokens.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -92,9 +78,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.personal_access_tokens.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.personal_access_tokens.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -109,29 +93,23 @@ class TestAsyncPersonalAccessTokens: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - personal_access_token = await async_client.personal_access_tokens.list( - connect_protocol_version=1, - ) + personal_access_token = await async_client.personal_access_tokens.list() assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: personal_access_token = await async_client.personal_access_tokens.list( - connect_protocol_version=1, filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.personal_access_tokens.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.personal_access_tokens.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -140,9 +118,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.personal_access_tokens.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.personal_access_tokens.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -153,25 +129,19 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - personal_access_token = await async_client.personal_access_tokens.delete( - connect_protocol_version=1, - ) + personal_access_token = await async_client.personal_access_tokens.delete() assert_matches_type(object, personal_access_token, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: personal_access_token = await async_client.personal_access_tokens.delete( - connect_protocol_version=1, personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, personal_access_token, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.personal_access_tokens.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.personal_access_tokens.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -180,9 +150,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.personal_access_tokens.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.personal_access_tokens.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 5529ac09..3e675593 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -26,7 +26,6 @@ def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -35,11 +34,9 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="x", - connect_timeout_ms=0, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -48,7 +45,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -61,7 +57,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -73,25 +68,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - project = client.projects.retrieve( - connect_protocol_version=1, - ) + project = client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.projects.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -100,9 +89,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.projects.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -113,26 +100,20 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: - project = client.projects.create_from_environment( - connect_protocol_version=1, - ) + project = client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name="x", - connect_timeout_ms=0, ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize def test_raw_response_create_from_environment(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.create_from_environment( - connect_protocol_version=1, - ) + response = client.projects.with_raw_response.create_from_environment() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -141,9 +122,7 @@ def test_raw_response_create_from_environment(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_from_environment(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.create_from_environment( - connect_protocol_version=1, - ) as response: + with client.projects.with_streaming_response.create_from_environment() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -161,7 +140,6 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -170,11 +148,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> project = await async_client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="x", - connect_timeout_ms=0, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -183,7 +159,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -196,7 +171,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non async with async_client.projects.with_streaming_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -208,25 +182,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.retrieve( - connect_protocol_version=1, - ) + project = await async_client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.projects.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -235,9 +203,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.projects.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -248,26 +214,20 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.create_from_environment( - connect_protocol_version=1, - ) + project = await async_client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name="x", - connect_timeout_ms=0, ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize async def test_raw_response_create_from_environment(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.create_from_environment( - connect_protocol_version=1, - ) + response = await async_client.projects.with_raw_response.create_from_environment() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -276,9 +236,7 @@ async def test_raw_response_create_from_environment(self, async_client: AsyncGit @parametrize async def test_streaming_response_create_from_environment(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.create_from_environment( - connect_protocol_version=1, - ) as response: + async with async_client.projects.with_streaming_response.create_from_environment() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_runner_configurations.py b/tests/api_resources/test_runner_configurations.py index 34570373..acc9cedf 100644 --- a/tests/api_resources/test_runner_configurations.py +++ b/tests/api_resources/test_runner_configurations.py @@ -21,7 +21,6 @@ class TestRunnerConfigurations: def test_method_validate_overload_1(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( environment_class={}, - connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -41,9 +40,7 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non "enabled": True, "runner_id": "runnerId", }, - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -51,7 +48,6 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.with_raw_response.validate( environment_class={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -63,7 +59,6 @@ def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.with_streaming_response.validate( environment_class={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -77,7 +72,6 @@ def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: def test_method_validate_overload_2(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -85,9 +79,7 @@ def test_method_validate_overload_2(self, client: Gitpod) -> None: def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -95,7 +87,6 @@ def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> Non def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: response = client.runner_configurations.with_raw_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -107,7 +98,6 @@ def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: with client.runner_configurations.with_streaming_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -125,7 +115,6 @@ class TestAsyncRunnerConfigurations: async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( environment_class={}, - connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -145,9 +134,7 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As "enabled": True, "runner_id": "runnerId", }, - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -155,7 +142,6 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.with_raw_response.validate( environment_class={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -167,7 +153,6 @@ async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.with_streaming_response.validate( environment_class={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -181,7 +166,6 @@ async def test_streaming_response_validate_overload_1(self, async_client: AsyncG async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -189,9 +173,7 @@ async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> No async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -199,7 +181,6 @@ async def test_method_validate_with_all_params_overload_2(self, async_client: As async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.with_raw_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -211,7 +192,6 @@ async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.with_streaming_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index ffb4d2b6..3df6d526 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -27,15 +27,12 @@ class TestRunners: @parametrize def test_method_create(self, client: Gitpod) -> None: - runner = client.runners.create( - connect_protocol_version=1, - ) + runner = client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( - connect_protocol_version=1, kind="RUNNER_KIND_UNSPECIFIED", name="xxx", spec={ @@ -46,15 +43,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, - connect_timeout_ms=0, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,9 +57,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -76,25 +68,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - runner = client.runners.retrieve( - connect_protocol_version=1, - ) + runner = client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -103,9 +89,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -116,15 +100,12 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - runner = client.runners.list( - connect_protocol_version=1, - ) + runner = client.runners.list() assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list( - connect_protocol_version=1, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "kinds": ["RUNNER_KIND_UNSPECIFIED"], @@ -133,15 +114,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.list( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,9 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -163,26 +139,20 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_check_authentication_for_host(self, client: Gitpod) -> None: - runner = client.runners.check_authentication_for_host( - connect_protocol_version=1, - ) + runner = client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( - connect_protocol_version=1, host="host", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.check_authentication_for_host( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.check_authentication_for_host() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -191,9 +161,7 @@ def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> Non @parametrize def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.check_authentication_for_host( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.check_authentication_for_host() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -204,25 +172,19 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: - runner = client.runners.create_runner_token( - connect_protocol_version=1, - ) + runner = client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize def test_raw_response_create_runner_token(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.create_runner_token( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.create_runner_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -231,9 +193,7 @@ def test_raw_response_create_runner_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.create_runner_token( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.create_runner_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -244,26 +204,20 @@ def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: @parametrize def test_method_delete_runner(self, client: Gitpod) -> None: - runner = client.runners.delete_runner( - connect_protocol_version=1, - ) + runner = client.runners.delete_runner() assert_matches_type(object, runner, path=["response"]) @parametrize def test_method_delete_runner_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete_runner( - connect_protocol_version=1, force=True, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize def test_raw_response_delete_runner(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.delete_runner( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.delete_runner() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -272,9 +226,7 @@ def test_raw_response_delete_runner(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete_runner(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.delete_runner( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.delete_runner() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -285,25 +237,19 @@ def test_streaming_response_delete_runner(self, client: Gitpod) -> None: @parametrize def test_method_get_runner(self, client: Gitpod) -> None: - runner = client.runners.get_runner( - connect_protocol_version=1, - ) + runner = client.runners.get_runner() assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) @parametrize def test_method_get_runner_with_all_params(self, client: Gitpod) -> None: runner = client.runners.get_runner( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) @parametrize def test_raw_response_get_runner(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.get_runner( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.get_runner() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -312,9 +258,7 @@ def test_raw_response_get_runner(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_runner(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.get_runner( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.get_runner() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -325,26 +269,20 @@ def test_streaming_response_get_runner(self, client: Gitpod) -> None: @parametrize def test_method_parse_context_url(self, client: Gitpod) -> None: - runner = client.runners.parse_context_url( - connect_protocol_version=1, - ) + runner = client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( - connect_protocol_version=1, context_url="https://example.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize def test_raw_response_parse_context_url(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.parse_context_url( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.parse_context_url() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -353,9 +291,7 @@ def test_raw_response_parse_context_url(self, client: Gitpod) -> None: @parametrize def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.parse_context_url( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.parse_context_url() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -368,16 +304,6 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: def test_method_update_runner_overload_1(self, client: Gitpod) -> None: runner = client.runners.update_runner( name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - def test_method_update_runner_with_all_params_overload_1(self, client: Gitpod) -> None: - runner = client.runners.update_runner( - name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -385,7 +311,6 @@ def test_method_update_runner_with_all_params_overload_1(self, client: Gitpod) - def test_raw_response_update_runner_overload_1(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update_runner( name="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -397,7 +322,6 @@ def test_raw_response_update_runner_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_runner_overload_1(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update_runner( name="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -411,16 +335,6 @@ def test_streaming_response_update_runner_overload_1(self, client: Gitpod) -> No def test_method_update_runner_overload_2(self, client: Gitpod) -> None: runner = client.runners.update_runner( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - def test_method_update_runner_with_all_params_overload_2(self, client: Gitpod) -> None: - runner = client.runners.update_runner( - spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -428,7 +342,6 @@ def test_method_update_runner_with_all_params_overload_2(self, client: Gitpod) - def test_raw_response_update_runner_overload_2(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update_runner( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -440,7 +353,6 @@ def test_raw_response_update_runner_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_runner_overload_2(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update_runner( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -456,15 +368,12 @@ class TestAsyncRunners: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.create( - connect_protocol_version=1, - ) + runner = await async_client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( - connect_protocol_version=1, kind="RUNNER_KIND_UNSPECIFIED", name="xxx", spec={ @@ -475,15 +384,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, - connect_timeout_ms=0, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -492,9 +398,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -505,25 +409,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.retrieve( - connect_protocol_version=1, - ) + runner = await async_client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -532,9 +430,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -545,15 +441,12 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.list( - connect_protocol_version=1, - ) + runner = await async_client.runners.list() assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( - connect_protocol_version=1, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "kinds": ["RUNNER_KIND_UNSPECIFIED"], @@ -562,15 +455,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, - connect_timeout_ms=0, ) assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.list( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -579,9 +469,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.list( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -592,26 +480,20 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.check_authentication_for_host( - connect_protocol_version=1, - ) + runner = await async_client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( - connect_protocol_version=1, host="host", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.check_authentication_for_host( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.check_authentication_for_host() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -620,9 +502,7 @@ async def test_raw_response_check_authentication_for_host(self, async_client: As @parametrize async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.check_authentication_for_host( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.check_authentication_for_host() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -633,25 +513,19 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.create_runner_token( - connect_protocol_version=1, - ) + runner = await async_client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.create_runner_token( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.create_runner_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -660,9 +534,7 @@ async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) @parametrize async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.create_runner_token( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.create_runner_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -673,26 +545,20 @@ async def test_streaming_response_create_runner_token(self, async_client: AsyncG @parametrize async def test_method_delete_runner(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.delete_runner( - connect_protocol_version=1, - ) + runner = await async_client.runners.delete_runner() assert_matches_type(object, runner, path=["response"]) @parametrize async def test_method_delete_runner_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete_runner( - connect_protocol_version=1, force=True, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize async def test_raw_response_delete_runner(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.delete_runner( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.delete_runner() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -701,9 +567,7 @@ async def test_raw_response_delete_runner(self, async_client: AsyncGitpod) -> No @parametrize async def test_streaming_response_delete_runner(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.delete_runner( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.delete_runner() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -714,25 +578,19 @@ async def test_streaming_response_delete_runner(self, async_client: AsyncGitpod) @parametrize async def test_method_get_runner(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.get_runner( - connect_protocol_version=1, - ) + runner = await async_client.runners.get_runner() assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) @parametrize async def test_method_get_runner_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.get_runner( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) @parametrize async def test_raw_response_get_runner(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.get_runner( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.get_runner() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -741,9 +599,7 @@ async def test_raw_response_get_runner(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_get_runner(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.get_runner( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.get_runner() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -754,26 +610,20 @@ async def test_streaming_response_get_runner(self, async_client: AsyncGitpod) -> @parametrize async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.parse_context_url( - connect_protocol_version=1, - ) + runner = await async_client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( - connect_protocol_version=1, context_url="https://example.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.parse_context_url( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.parse_context_url() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -782,9 +632,7 @@ async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.parse_context_url( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.parse_context_url() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -797,16 +645,6 @@ async def test_streaming_response_parse_context_url(self, async_client: AsyncGit async def test_method_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update_runner( name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - async def test_method_update_runner_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update_runner( - name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -814,7 +652,6 @@ async def test_method_update_runner_with_all_params_overload_1(self, async_clien async def test_raw_response_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update_runner( name="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -826,7 +663,6 @@ async def test_raw_response_update_runner_overload_1(self, async_client: AsyncGi async def test_streaming_response_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update_runner( name="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -840,16 +676,6 @@ async def test_streaming_response_update_runner_overload_1(self, async_client: A async def test_method_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update_runner( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - async def test_method_update_runner_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update_runner( - spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -857,7 +683,6 @@ async def test_method_update_runner_with_all_params_overload_2(self, async_clien async def test_raw_response_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update_runner( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -869,7 +694,6 @@ async def test_raw_response_update_runner_overload_2(self, async_client: AsyncGi async def test_streaming_response_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update_runner( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/conftest.py b/tests/conftest.py index d7bb7fa8..b061ad5b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,6 +29,8 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") bearer_token = "My Bearer Token" +connect_protocol_version = True +connect_timeout_header = 0 @pytest.fixture(scope="session") @@ -37,7 +39,13 @@ def client(request: FixtureRequest) -> Iterator[Gitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - with Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: + with Gitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=strict, + ) as client: yield client @@ -47,5 +55,11 @@ async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncGitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - async with AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: + async with AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=strict, + ) as client: yield client diff --git a/tests/test_client.py b/tests/test_client.py index 289b035c..97b1fffb 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -32,6 +32,8 @@ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") bearer_token = "My Bearer Token" +connect_protocol_version = True +connect_timeout_header = 0 def _get_params(client: BaseClient[Any, Any]) -> dict[str, str]: @@ -53,7 +55,13 @@ def _get_open_connections(client: Gitpod | AsyncGitpod) -> int: class TestGitpod: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + client = Gitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) @pytest.mark.respx(base_url=base_url) def test_raw_response(self, respx_mock: MockRouter) -> None: @@ -83,6 +91,14 @@ def test_copy(self) -> None: assert copied.bearer_token == "another My Bearer Token" assert self.client.bearer_token == "My Bearer Token" + copied = self.client.copy(connect_protocol_version=True) + assert copied.connect_protocol_version == True + assert self.client.connect_protocol_version == True + + copied = self.client.copy(connect_timeout_header=0) + assert copied.connect_timeout_header == 0 + assert self.client.connect_timeout_header == 0 + def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -103,6 +119,8 @@ def test_copy_default_headers(self) -> None: client = Gitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) @@ -138,7 +156,12 @@ def test_copy_default_headers(self) -> None: def test_copy_default_query(self) -> None: client = Gitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + default_query={"foo": "bar"}, ) assert _get_params(client)["foo"] == "bar" @@ -263,7 +286,12 @@ def test_request_timeout(self) -> None: def test_client_timeout_option(self) -> None: client = Gitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, timeout=httpx.Timeout(0) + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + timeout=httpx.Timeout(0), ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -274,7 +302,12 @@ def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: client = Gitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + http_client=http_client, ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -284,7 +317,12 @@ def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: client = Gitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + http_client=http_client, ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -294,7 +332,12 @@ def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = Gitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + http_client=http_client, ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -307,6 +350,8 @@ async def test_invalid_http_client(self) -> None: Gitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=cast(Any, http_client), ) @@ -315,6 +360,8 @@ def test_default_headers_option(self) -> None: client = Gitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) @@ -325,6 +372,8 @@ def test_default_headers_option(self) -> None: client2 = Gitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -339,6 +388,8 @@ def test_default_query_option(self) -> None: client = Gitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_query={"query_param": "bar"}, ) @@ -541,7 +592,11 @@ class Model(BaseModel): def test_base_url_setter(self) -> None: client = Gitpod( - base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True + base_url="https://example.com/from_init", + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, ) assert client.base_url == "https://example.com/from_init/" @@ -551,7 +606,12 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = Gitpod(bearer_token=bearer_token, _strict_response_validation=True) + client = Gitpod( + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( @@ -560,11 +620,15 @@ def test_base_url_env(self) -> None: Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -587,11 +651,15 @@ def test_base_url_trailing_slash(self, client: Gitpod) -> None: Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -614,11 +682,15 @@ def test_base_url_no_trailing_slash(self, client: Gitpod) -> None: Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -636,7 +708,13 @@ def test_absolute_request_url(self, client: Gitpod) -> None: assert request.url == "https://myapi.com/foo" def test_copied_client_does_not_close_http(self) -> None: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + client = Gitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) assert not client.is_closed() copied = client.copy() @@ -647,7 +725,13 @@ def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() def test_client_context_manager(self) -> None: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + client = Gitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) with client as c2: assert c2 is client assert not c2.is_closed() @@ -671,6 +755,8 @@ def test_client_max_retries_validation(self) -> None: Gitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, max_retries=cast(Any, None), ) @@ -682,12 +768,24 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + strict_client = Gitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) + client = Gitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=False, + ) response = client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -715,7 +813,13 @@ class Model(BaseModel): ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + client = Gitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) @@ -780,7 +884,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create(connect_protocol_version=1) + response = client.runners.with_raw_response.create() assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -804,9 +908,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create( - connect_protocol_version=1, extra_headers={"x-stainless-retry-count": Omit()} - ) + response = client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -829,15 +931,19 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create( - connect_protocol_version=1, extra_headers={"x-stainless-retry-count": "42"} - ) + response = client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) assert response.http_request.headers.get("x-stainless-retry-count") == "42" class TestAsyncGitpod: - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + client = AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio @@ -869,6 +975,14 @@ def test_copy(self) -> None: assert copied.bearer_token == "another My Bearer Token" assert self.client.bearer_token == "My Bearer Token" + copied = self.client.copy(connect_protocol_version=True) + assert copied.connect_protocol_version == True + assert self.client.connect_protocol_version == True + + copied = self.client.copy(connect_timeout_header=0) + assert copied.connect_timeout_header == 0 + assert self.client.connect_timeout_header == 0 + def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -889,6 +1003,8 @@ def test_copy_default_headers(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) @@ -924,7 +1040,12 @@ def test_copy_default_headers(self) -> None: def test_copy_default_query(self) -> None: client = AsyncGitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + default_query={"foo": "bar"}, ) assert _get_params(client)["foo"] == "bar" @@ -1049,7 +1170,12 @@ async def test_request_timeout(self) -> None: async def test_client_timeout_option(self) -> None: client = AsyncGitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, timeout=httpx.Timeout(0) + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + timeout=httpx.Timeout(0), ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1060,7 +1186,12 @@ async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: client = AsyncGitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + http_client=http_client, ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1070,7 +1201,12 @@ async def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: client = AsyncGitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + http_client=http_client, ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1080,7 +1216,12 @@ async def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = AsyncGitpod( - base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + http_client=http_client, ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1093,6 +1234,8 @@ def test_invalid_http_client(self) -> None: AsyncGitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=cast(Any, http_client), ) @@ -1101,6 +1244,8 @@ def test_default_headers_option(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) @@ -1111,6 +1256,8 @@ def test_default_headers_option(self) -> None: client2 = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -1125,6 +1272,8 @@ def test_default_query_option(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_query={"query_param": "bar"}, ) @@ -1327,7 +1476,11 @@ class Model(BaseModel): def test_base_url_setter(self) -> None: client = AsyncGitpod( - base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True + base_url="https://example.com/from_init", + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, ) assert client.base_url == "https://example.com/from_init/" @@ -1337,7 +1490,12 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = AsyncGitpod(bearer_token=bearer_token, _strict_response_validation=True) + client = AsyncGitpod( + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( @@ -1346,11 +1504,15 @@ def test_base_url_env(self) -> None: AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1373,11 +1535,15 @@ def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1400,11 +1566,15 @@ def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1422,7 +1592,13 @@ def test_absolute_request_url(self, client: AsyncGitpod) -> None: assert request.url == "https://myapi.com/foo" async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + client = AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) assert not client.is_closed() copied = client.copy() @@ -1434,7 +1610,13 @@ async def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() async def test_client_context_manager(self) -> None: - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + client = AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) async with client as c2: assert c2 is client assert not c2.is_closed() @@ -1459,6 +1641,8 @@ async def test_client_max_retries_validation(self) -> None: AsyncGitpod( base_url=base_url, bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, _strict_response_validation=True, max_retries=cast(Any, None), ) @@ -1471,12 +1655,24 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + strict_client = AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) + client = AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=False, + ) response = await client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -1505,7 +1701,13 @@ class Model(BaseModel): @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @pytest.mark.asyncio async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + client = AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + connect_protocol_version=connect_protocol_version, + connect_timeout_header=connect_timeout_header, + _strict_response_validation=True, + ) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) @@ -1571,7 +1773,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create(connect_protocol_version=1) + response = await client.runners.with_raw_response.create() assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -1596,9 +1798,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create( - connect_protocol_version=1, extra_headers={"x-stainless-retry-count": Omit()} - ) + response = await client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -1622,9 +1822,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create( - connect_protocol_version=1, extra_headers={"x-stainless-retry-count": "42"} - ) + response = await client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) assert response.http_request.headers.get("x-stainless-retry-count") == "42" From 0bd536bfe1533cdf16cfb9bcf8b2105e2050124d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 14:12:12 +0000 Subject: [PATCH 053/505] feat(api): update via SDK Studio --- README.md | 18 +++++++++--------- src/gitpod/_client.py | 12 ++++++------ tests/conftest.py | 2 +- tests/test_client.py | 14 +++++++------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 151820ac..9d64ee9e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The full API of this library can be found in [api.md](api.md). from gitpod import Gitpod client = Gitpod( - connect_protocol_version=True, + connect_protocol_version=0, connect_timeout_header=0, ) @@ -52,7 +52,7 @@ import asyncio from gitpod import AsyncGitpod client = AsyncGitpod( - connect_protocol_version=True, + connect_protocol_version=0, connect_timeout_header=0, ) @@ -90,7 +90,7 @@ import gitpod from gitpod import Gitpod client = Gitpod( - connect_protocol_version=True, + connect_protocol_version=0, connect_timeout_header=0, ) @@ -135,7 +135,7 @@ from gitpod import Gitpod client = Gitpod( # default is 2 max_retries=0, - connect_protocol_version=True, + connect_protocol_version=0, connect_timeout_header=0, ) @@ -155,14 +155,14 @@ from gitpod import Gitpod client = Gitpod( # 20 seconds (default is 1 minute) timeout=20.0, - connect_protocol_version=True, + connect_protocol_version=0, connect_timeout_header=0, ) # More granular control: client = Gitpod( timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), - connect_protocol_version=True, + connect_protocol_version=0, connect_timeout_header=0, ) @@ -208,7 +208,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to from gitpod import Gitpod client = Gitpod( - connect_protocol_version=True, + connect_protocol_version=0, connect_timeout_header=0, ) response = client.runners.with_raw_response.create() @@ -291,7 +291,7 @@ client = Gitpod( proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), - connect_protocol_version=True, + connect_protocol_version=0, connect_timeout_header=0, ) ``` @@ -310,7 +310,7 @@ By default the library closes underlying HTTP connections whenever the client is from gitpod import Gitpod with Gitpod( - connect_protocol_version=True, + connect_protocol_version=0, connect_timeout_header=0, ) as client: # make requests here diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 7b80453a..56365ac5 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -54,14 +54,14 @@ class Gitpod(SyncAPIClient): # client options bearer_token: str - connect_protocol_version: bool + connect_protocol_version: float connect_timeout_header: float def __init__( self, *, bearer_token: str | None = None, - connect_protocol_version: bool | None = 1, + connect_protocol_version: float | None = 1, connect_timeout_header: float, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, @@ -153,7 +153,7 @@ def copy( self, *, bearer_token: str | None = None, - connect_protocol_version: bool | None = None, + connect_protocol_version: float | None = None, connect_timeout_header: float | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, @@ -252,14 +252,14 @@ class AsyncGitpod(AsyncAPIClient): # client options bearer_token: str - connect_protocol_version: bool + connect_protocol_version: float connect_timeout_header: float def __init__( self, *, bearer_token: str | None = None, - connect_protocol_version: bool | None = 1, + connect_protocol_version: float | None = 1, connect_timeout_header: float, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, @@ -351,7 +351,7 @@ def copy( self, *, bearer_token: str | None = None, - connect_protocol_version: bool | None = None, + connect_protocol_version: float | None = None, connect_timeout_header: float | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, diff --git a/tests/conftest.py b/tests/conftest.py index b061ad5b..51e50906 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,7 +29,7 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") bearer_token = "My Bearer Token" -connect_protocol_version = True +connect_protocol_version = 0 connect_timeout_header = 0 diff --git a/tests/test_client.py b/tests/test_client.py index 97b1fffb..f49ffc40 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -32,7 +32,7 @@ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") bearer_token = "My Bearer Token" -connect_protocol_version = True +connect_protocol_version = 0 connect_timeout_header = 0 @@ -91,9 +91,9 @@ def test_copy(self) -> None: assert copied.bearer_token == "another My Bearer Token" assert self.client.bearer_token == "My Bearer Token" - copied = self.client.copy(connect_protocol_version=True) - assert copied.connect_protocol_version == True - assert self.client.connect_protocol_version == True + copied = self.client.copy(connect_protocol_version=0) + assert copied.connect_protocol_version == 0 + assert self.client.connect_protocol_version == 0 copied = self.client.copy(connect_timeout_header=0) assert copied.connect_timeout_header == 0 @@ -975,9 +975,9 @@ def test_copy(self) -> None: assert copied.bearer_token == "another My Bearer Token" assert self.client.bearer_token == "My Bearer Token" - copied = self.client.copy(connect_protocol_version=True) - assert copied.connect_protocol_version == True - assert self.client.connect_protocol_version == True + copied = self.client.copy(connect_protocol_version=0) + assert copied.connect_protocol_version == 0 + assert self.client.connect_protocol_version == 0 copied = self.client.copy(connect_timeout_header=0) assert copied.connect_timeout_header == 0 From 76833eda046df13d82745f6a1a0ab3a8290a055c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 14:48:49 +0000 Subject: [PATCH 054/505] feat(api): update via SDK Studio --- README.md | 59 ++- src/gitpod/_client.py | 32 -- src/gitpod/pagination.py | 349 ++++++++++++++++++ src/gitpod/resources/environment_classes.py | 34 ++ .../environments/automations/automations.py | 34 ++ .../environments/automations/services.py | 154 ++++++++ .../automations/task_executions.py | 144 +++++++- .../environments/automations/tasks.py | 183 +++++++++ .../resources/environments/environments.py | 154 ++++++++ src/gitpod/resources/identity.py | 93 +++++ .../resources/organizations/invite/invite.py | 64 ++++ .../resources/organizations/invite/summary.py | 34 ++ .../resources/organizations/organizations.py | 92 +++++ .../resources/personal_access_tokens.py | 64 ++++ src/gitpod/resources/projects.py | 94 +++++ .../configuration_schema.py | 64 ++++ .../environment_classes.py | 104 +++++- .../host_authentication_tokens.py | 194 +++++++++- .../runner_configurations.py | 54 ++- .../runner_configurations/scm_integration.py | 58 ++- src/gitpod/resources/runners/policies.py | 34 ++ src/gitpod/resources/runners/runners.py | 292 ++++++++++++++- .../types/environment_class_list_params.py | 8 +- .../environment_create_from_project_params.py | 6 + src/gitpod/types/environment_create_params.py | 6 + src/gitpod/types/environment_list_params.py | 8 +- .../types/environment_retrieve_params.py | 8 +- src/gitpod/types/environment_start_params.py | 8 +- .../environments/automation_upsert_params.py | 8 +- .../automations/service_delete_params.py | 10 +- .../automations/service_list_params.py | 8 +- .../automations/service_start_params.py | 10 +- .../automations/service_stop_params.py | 10 +- .../automations/service_update_params.py | 6 + .../automations/task_create_params.py | 6 + .../automations/task_delete_params.py | 10 +- .../automations/task_execution_list_params.py | 8 +- .../task_execution_retrieve_params.py | 10 +- .../automations/task_execution_stop_params.py | 10 +- ...ion_update_task_execution_status_params.py | 14 +- .../automations/task_list_params.py | 8 +- .../automations/task_retrieve_params.py | 10 +- .../automations/task_start_params.py | 10 +- .../automations/task_update_params.py | 8 +- .../types/identity_exchange_token_params.py | 8 +- ...ntity_get_authenticated_identity_params.py | 10 +- .../types/identity_get_id_token_params.py | 10 +- src/gitpod/types/organization_leave_params.py | 8 +- .../types/organization_list_members_params.py | 8 +- .../types/organization_set_role_params.py | 8 +- .../invite/summary_retrieve_params.py | 8 +- .../organizations/invite_create_params.py | 8 +- .../organizations/invite_retrieve_params.py | 8 +- .../personal_access_token_delete_params.py | 8 +- .../personal_access_token_list_params.py | 8 +- .../project_create_from_environment_params.py | 8 +- src/gitpod/types/project_create_params.py | 6 + src/gitpod/types/project_retrieve_params.py | 8 +- ...er_check_authentication_for_host_params.py | 8 +- .../runner_configuration_validate_params.py | 14 +- .../configuration_schema_create_params.py | 8 +- .../configuration_schema_retrieve_params.py | 8 +- .../environment_class_list_params.py | 8 +- .../environment_class_update_params.py | 20 +- ...host_authentication_token_create_params.py | 10 +- ...host_authentication_token_delete_params.py | 10 +- .../host_authentication_token_list_params.py | 8 +- ...st_authentication_token_retrieve_params.py | 10 +- ...host_authentication_token_update_params.py | 20 +- .../scm_integration_create_params.py | 14 +- src/gitpod/types/runner_create_params.py | 8 +- .../runner_create_runner_token_params.py | 8 +- .../types/runner_delete_runner_params.py | 8 +- src/gitpod/types/runner_get_runner_params.py | 8 +- src/gitpod/types/runner_list_params.py | 8 +- .../types/runner_parse_context_url_params.py | 8 +- src/gitpod/types/runner_retrieve_params.py | 8 +- .../types/runner_update_runner_params.py | 12 + .../types/runners/policy_list_params.py | 8 +- .../environments/automations/test_services.py | 140 +++++-- .../automations/test_task_executions.py | 136 ++++++- .../environments/automations/test_tasks.py | 168 +++++++-- .../environments/test_automations.py | 28 +- .../organizations/invite/test_summary.py | 28 +- .../organizations/test_invite.py | 56 ++- .../test_configuration_schema.py | 56 ++- .../test_environment_classes.py | 100 ++++- .../test_host_authentication_tokens.py | 184 +++++++-- .../test_scm_integration.py | 48 +++ tests/api_resources/runners/test_policies.py | 28 +- .../api_resources/test_environment_classes.py | 28 +- tests/api_resources/test_environments.py | 140 +++++-- tests/api_resources/test_identity.py | 80 +++- tests/api_resources/test_organizations.py | 84 ++++- .../test_personal_access_tokens.py | 56 ++- tests/api_resources/test_projects.py | 66 +++- .../test_runner_configurations.py | 20 + tests/api_resources/test_runners.py | 272 +++++++++++--- tests/conftest.py | 18 +- tests/test_client.py | 278 ++------------ 100 files changed, 4234 insertions(+), 682 deletions(-) create mode 100644 src/gitpod/pagination.py diff --git a/README.md b/README.md index 9d64ee9e..dc9f51db 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,11 @@ The full API of this library can be found in [api.md](api.md). ```python from gitpod import Gitpod -client = Gitpod( - connect_protocol_version=0, - connect_timeout_header=0, -) +client = Gitpod() -runner = client.runners.create() +runner = client.runners.create( + connect_protocol_version=1, +) print(runner.access_token) ``` @@ -51,14 +50,13 @@ Simply import `AsyncGitpod` instead of `Gitpod` and use `await` with each API ca import asyncio from gitpod import AsyncGitpod -client = AsyncGitpod( - connect_protocol_version=0, - connect_timeout_header=0, -) +client = AsyncGitpod() async def main() -> None: - runner = await client.runners.create() + runner = await client.runners.create( + connect_protocol_version=1, + ) print(runner.access_token) @@ -89,13 +87,12 @@ All errors inherit from `gitpod.APIError`. import gitpod from gitpod import Gitpod -client = Gitpod( - connect_protocol_version=0, - connect_timeout_header=0, -) +client = Gitpod() try: - client.runners.create() + client.runners.create( + connect_protocol_version=1, + ) except gitpod.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. @@ -135,12 +132,12 @@ from gitpod import Gitpod client = Gitpod( # default is 2 max_retries=0, - connect_protocol_version=0, - connect_timeout_header=0, ) # Or, configure per-request: -client.with_options(max_retries=5).runners.create() +client.with_options(max_retries=5).runners.create( + connect_protocol_version=1, +) ``` ### Timeouts @@ -155,19 +152,17 @@ from gitpod import Gitpod client = Gitpod( # 20 seconds (default is 1 minute) timeout=20.0, - connect_protocol_version=0, - connect_timeout_header=0, ) # More granular control: client = Gitpod( timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), - connect_protocol_version=0, - connect_timeout_header=0, ) # Override per-request: -client.with_options(timeout=5.0).runners.create() +client.with_options(timeout=5.0).runners.create( + connect_protocol_version=1, +) ``` On timeout, an `APITimeoutError` is thrown. @@ -207,11 +202,10 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to ```py from gitpod import Gitpod -client = Gitpod( - connect_protocol_version=0, - connect_timeout_header=0, +client = Gitpod() +response = client.runners.with_raw_response.create( + connect_protocol_version=1, ) -response = client.runners.with_raw_response.create() print(response.headers.get('X-My-Header')) runner = response.parse() # get the object that `runners.create()` would have returned @@ -229,7 +223,9 @@ The above interface eagerly reads the full response body when you make the reque To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. ```python -with client.runners.with_streaming_response.create() as response: +with client.runners.with_streaming_response.create( + connect_protocol_version=1, +) as response: print(response.headers.get("X-My-Header")) for line in response.iter_lines(): @@ -291,8 +287,6 @@ client = Gitpod( proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), - connect_protocol_version=0, - connect_timeout_header=0, ) ``` @@ -309,10 +303,7 @@ By default the library closes underlying HTTP connections whenever the client is ```py from gitpod import Gitpod -with Gitpod( - connect_protocol_version=0, - connect_timeout_header=0, -) as client: +with Gitpod() as client: # make requests here ... diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 56365ac5..6501485a 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -54,15 +54,11 @@ class Gitpod(SyncAPIClient): # client options bearer_token: str - connect_protocol_version: float - connect_timeout_header: float def __init__( self, *, bearer_token: str | None = None, - connect_protocol_version: float | None = 1, - connect_timeout_header: float, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -94,12 +90,6 @@ def __init__( ) self.bearer_token = bearer_token - if connect_protocol_version is None: - connect_protocol_version = 1 - self.connect_protocol_version = connect_protocol_version - - self.connect_timeout_header = connect_timeout_header - if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -144,8 +134,6 @@ def default_headers(self) -> dict[str, str | Omit]: return { **super().default_headers, "X-Stainless-Async": "false", - "Connect-Protocol-Version": str(self.connect_protocol_version), - "Connect-Timeout-Ms": str(self.connect_timeout_header), **self._custom_headers, } @@ -153,8 +141,6 @@ def copy( self, *, bearer_token: str | None = None, - connect_protocol_version: float | None = None, - connect_timeout_header: float | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.Client | None = None, @@ -189,8 +175,6 @@ def copy( http_client = http_client or self._client return self.__class__( bearer_token=bearer_token or self.bearer_token, - connect_protocol_version=connect_protocol_version or self.connect_protocol_version, - connect_timeout_header=connect_timeout_header or self.connect_timeout_header, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, @@ -252,15 +236,11 @@ class AsyncGitpod(AsyncAPIClient): # client options bearer_token: str - connect_protocol_version: float - connect_timeout_header: float def __init__( self, *, bearer_token: str | None = None, - connect_protocol_version: float | None = 1, - connect_timeout_header: float, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, @@ -292,12 +272,6 @@ def __init__( ) self.bearer_token = bearer_token - if connect_protocol_version is None: - connect_protocol_version = 1 - self.connect_protocol_version = connect_protocol_version - - self.connect_timeout_header = connect_timeout_header - if base_url is None: base_url = os.environ.get("GITPOD_BASE_URL") if base_url is None: @@ -342,8 +316,6 @@ def default_headers(self) -> dict[str, str | Omit]: return { **super().default_headers, "X-Stainless-Async": f"async:{get_async_library()}", - "Connect-Protocol-Version": str(self.connect_protocol_version), - "Connect-Timeout-Ms": str(self.connect_timeout_header), **self._custom_headers, } @@ -351,8 +323,6 @@ def copy( self, *, bearer_token: str | None = None, - connect_protocol_version: float | None = None, - connect_timeout_header: float | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.AsyncClient | None = None, @@ -387,8 +357,6 @@ def copy( http_client = http_client or self._client return self.__class__( bearer_token=bearer_token or self.bearer_token, - connect_protocol_version=connect_protocol_version or self.connect_protocol_version, - connect_timeout_header=connect_timeout_header or self.connect_timeout_header, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py new file mode 100644 index 00000000..f3baede5 --- /dev/null +++ b/src/gitpod/pagination.py @@ -0,0 +1,349 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Generic, TypeVar, Optional +from typing_extensions import override + +from pydantic import Field as FieldInfo + +from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage + +__all__ = [ + "SyncServicesPage", + "AsyncServicesPage", + "SyncTasksPage", + "AsyncTasksPage", + "SyncTaskExecutionsPage", + "AsyncTaskExecutionsPage", + "SyncEnvironnmentClassesPage", + "AsyncEnvironnmentClassesPage", + "SyncEnvironmentsPage", + "AsyncEnvironmentsPage", + "SyncEntriesPage", + "AsyncEntriesPage", + "SyncGroupsPage", + "AsyncGroupsPage", + "SyncMembersPage", + "AsyncMembersPage", +] + +_T = TypeVar("_T") + + +class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + services: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + services = self.services + if not services: + return [] + return services + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + services: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + services = self.services + if not services: + return [] + return services + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + tasks: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + tasks = self.tasks + if not tasks: + return [] + return tasks + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + tasks: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + tasks = self.tasks + if not tasks: + return [] + return tasks + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + task_executions: List[_T] = FieldInfo(alias="taskExecutions") + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + task_executions = self.task_executions + if not task_executions: + return [] + return task_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + task_executions: List[_T] = FieldInfo(alias="taskExecutions") + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + task_executions = self.task_executions + if not task_executions: + return [] + return task_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncEnvironnmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environment_classes = self.environment_classes + if not environment_classes: + return [] + return environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEnvironnmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environment_classes = self.environment_classes + if not environment_classes: + return [] + return environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + environments: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environments = self.environments + if not environments: + return [] + return environments + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEnvironmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + environments: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environments = self.environments + if not environments: + return [] + return environments + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + entries: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + entries = self.entries + if not entries: + return [] + return entries + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEntriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + entries: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + entries = self.entries + if not entries: + return [] + return entries + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + groups: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + groups = self.groups + if not groups: + return [] + return groups + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncGroupsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + groups: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + groups = self.groups + if not groups: + return [] + return groups + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + members: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + members = self.members + if not members: + return [] + return members + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + members: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + members = self.members + if not members: + return [] + return members + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) diff --git a/src/gitpod/resources/environment_classes.py b/src/gitpod/resources/environment_classes.py index 4dd9e00f..54e7fffc 100644 --- a/src/gitpod/resources/environment_classes.py +++ b/src/gitpod/resources/environment_classes.py @@ -2,12 +2,16 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ..types import environment_class_list_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -47,8 +51,10 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp def list( self, *, + connect_protocol_version: Literal[1], filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -63,8 +69,12 @@ def list( query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: + connect_protocol_version: Define the version of the Connect protocol + pagination: pagination contains the pagination options for listing environment classes + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -73,6 +83,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", body=maybe_transform( @@ -112,8 +131,10 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin async def list( self, *, + connect_protocol_version: Literal[1], filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -128,8 +149,12 @@ async def list( query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: + connect_protocol_version: Define the version of the Connect protocol + pagination: pagination contains the pagination options for listing environment classes + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -138,6 +163,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", body=await async_maybe_transform( diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index 1e125a29..8d618ab1 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from .tasks import ( @@ -22,7 +24,9 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -83,8 +87,10 @@ def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: def upsert( self, *, + connect_protocol_version: Literal[1], automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -96,6 +102,8 @@ def upsert( UpsertAutomationsFile upserts the automations file for the given environment. Args: + connect_protocol_version: Define the version of the Connect protocol + automations_file: WARN: Do not remove any field here, as it will break reading automation yaml files. We error if there are any @@ -103,6 +111,8 @@ def upsert( we removed any fields. This includes marking a field as "reserved" in the proto file, this will also break reading the yaml. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -111,6 +121,15 @@ def upsert( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", body=maybe_transform( @@ -162,8 +181,10 @@ def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingRespon async def upsert( self, *, + connect_protocol_version: Literal[1], automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -175,6 +196,8 @@ async def upsert( UpsertAutomationsFile upserts the automations file for the given environment. Args: + connect_protocol_version: Define the version of the Connect protocol + automations_file: WARN: Do not remove any field here, as it will break reading automation yaml files. We error if there are any @@ -182,6 +205,8 @@ async def upsert( we removed any fields. This includes marking a field as "reserved" in the proto file, this will also break reading the yaml. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -190,6 +215,15 @@ async def upsert( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", body=await async_maybe_transform( diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index 926f671f..67694136 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -2,11 +2,15 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -53,10 +57,12 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: def update( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, spec: service_update_params.Spec | NotGiven = NOT_GIVEN, status: service_update_params.Status | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -68,6 +74,8 @@ def update( UpdateService Args: + connect_protocol_version: Define the version of the Connect protocol + spec: Changing the spec of a service is a complex operation. The spec of a service can only be updated if the service is in a stopped state. If the service is @@ -79,6 +87,8 @@ def update( of this API you are not expected to provide this field. Updating this field requires the `environmentservice:update_status` permission. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -87,6 +97,15 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateService", body=maybe_transform( @@ -107,8 +126,10 @@ def update( def list( self, *, + connect_protocol_version: Literal[1], filter: service_list_params.Filter | NotGiven = NOT_GIVEN, pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -120,10 +141,14 @@ def list( ListServices Args: + connect_protocol_version: Define the version of the Connect protocol + filter: filter contains the filter options for listing services pagination: pagination contains the pagination options for listing services + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -132,6 +157,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/ListServices", body=maybe_transform( @@ -150,8 +184,10 @@ def list( def delete( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, force: bool | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -167,6 +203,10 @@ def delete( If the service is not stopped it will be stopped before deletion. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -175,6 +215,15 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteService", body=maybe_transform( @@ -193,7 +242,9 @@ def delete( def start( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -209,6 +260,10 @@ def start( This call will not error if the service is already running or has been started. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -217,6 +272,15 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/StartService", body=maybe_transform({"id": id}, service_start_params.ServiceStartParams), @@ -229,7 +293,9 @@ def start( def stop( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -245,6 +311,10 @@ def stop( This call will not error if the service is already stopped or has been stopped. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -253,6 +323,15 @@ def stop( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/StopService", body=maybe_transform({"id": id}, service_stop_params.ServiceStopParams), @@ -286,10 +365,12 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: async def update( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, spec: service_update_params.Spec | NotGiven = NOT_GIVEN, status: service_update_params.Status | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -301,6 +382,8 @@ async def update( UpdateService Args: + connect_protocol_version: Define the version of the Connect protocol + spec: Changing the spec of a service is a complex operation. The spec of a service can only be updated if the service is in a stopped state. If the service is @@ -312,6 +395,8 @@ async def update( of this API you are not expected to provide this field. Updating this field requires the `environmentservice:update_status` permission. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -320,6 +405,15 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateService", body=await async_maybe_transform( @@ -340,8 +434,10 @@ async def update( async def list( self, *, + connect_protocol_version: Literal[1], filter: service_list_params.Filter | NotGiven = NOT_GIVEN, pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -353,10 +449,14 @@ async def list( ListServices Args: + connect_protocol_version: Define the version of the Connect protocol + filter: filter contains the filter options for listing services pagination: pagination contains the pagination options for listing services + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -365,6 +465,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/ListServices", body=await async_maybe_transform( @@ -383,8 +492,10 @@ async def list( async def delete( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, force: bool | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -400,6 +511,10 @@ async def delete( If the service is not stopped it will be stopped before deletion. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -408,6 +523,15 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteService", body=await async_maybe_transform( @@ -426,7 +550,9 @@ async def delete( async def start( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -442,6 +568,10 @@ async def start( This call will not error if the service is already running or has been started. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -450,6 +580,15 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StartService", body=await async_maybe_transform({"id": id}, service_start_params.ServiceStartParams), @@ -462,7 +601,9 @@ async def start( async def stop( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -478,6 +619,10 @@ async def stop( This call will not error if the service is already stopped or has been stopped. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -486,6 +631,15 @@ async def stop( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StopService", body=await async_maybe_transform({"id": id}, service_stop_params.ServiceStopParams), diff --git a/src/gitpod/resources/environments/automations/task_executions.py b/src/gitpod/resources/environments/automations/task_executions.py index 9da36039..f8c0c3c4 100644 --- a/src/gitpod/resources/environments/automations/task_executions.py +++ b/src/gitpod/resources/environments/automations/task_executions.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing_extensions import overload +from typing_extensions import Literal, overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( + is_given, required_args, maybe_transform, + strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -56,7 +58,9 @@ def with_streaming_response(self) -> TaskExecutionsResourceWithStreamingResponse def retrieve( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -68,6 +72,10 @@ def retrieve( GetTaskExecution Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -76,6 +84,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", body=maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), @@ -88,8 +105,10 @@ def retrieve( def list( self, *, + connect_protocol_version: Literal[1], filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -101,10 +120,14 @@ def list( ListTaskExecutions Args: + connect_protocol_version: Define the version of the Connect protocol + filter: filter contains the filter options for listing task runs pagination: pagination contains the pagination options for listing task runs + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -113,6 +136,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", body=maybe_transform( @@ -131,7 +163,9 @@ def list( def stop( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -143,6 +177,10 @@ def stop( StopTaskExecution Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -151,6 +189,15 @@ def stop( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", body=maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), @@ -165,6 +212,8 @@ def update_task_execution_status( self, *, failure_message: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -184,6 +233,10 @@ def update_task_execution_status( If an individual step has failed, callers are NOT expected to set this message; only if the task execution as a whole has failed/cannot be started. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -199,6 +252,8 @@ def update_task_execution_status( self, *, log_url: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -215,6 +270,10 @@ def update_task_execution_status( log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task either has no logs or has not yet started. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -225,11 +284,13 @@ def update_task_execution_status( """ ... - @required_args(["failure_message"], ["log_url"]) + @required_args(["failure_message", "connect_protocol_version"], ["log_url", "connect_protocol_version"]) def update_task_execution_status( self, *, failure_message: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, log_url: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -238,6 +299,15 @@ def update_task_execution_status( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", body=maybe_transform( @@ -277,7 +347,9 @@ def with_streaming_response(self) -> AsyncTaskExecutionsResourceWithStreamingRes async def retrieve( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -289,6 +361,10 @@ async def retrieve( GetTaskExecution Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -297,6 +373,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", body=await async_maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), @@ -309,8 +394,10 @@ async def retrieve( async def list( self, *, + connect_protocol_version: Literal[1], filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -322,10 +409,14 @@ async def list( ListTaskExecutions Args: + connect_protocol_version: Define the version of the Connect protocol + filter: filter contains the filter options for listing task runs pagination: pagination contains the pagination options for listing task runs + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -334,6 +425,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", body=await async_maybe_transform( @@ -352,7 +452,9 @@ async def list( async def stop( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -364,6 +466,10 @@ async def stop( StopTaskExecution Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -372,6 +478,15 @@ async def stop( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", body=await async_maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), @@ -386,6 +501,8 @@ async def update_task_execution_status( self, *, failure_message: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -405,6 +522,10 @@ async def update_task_execution_status( If an individual step has failed, callers are NOT expected to set this message; only if the task execution as a whole has failed/cannot be started. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -420,6 +541,8 @@ async def update_task_execution_status( self, *, log_url: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -436,6 +559,10 @@ async def update_task_execution_status( log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task either has no logs or has not yet started. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -446,11 +573,13 @@ async def update_task_execution_status( """ ... - @required_args(["failure_message"], ["log_url"]) + @required_args(["failure_message", "connect_protocol_version"], ["log_url", "connect_protocol_version"]) async def update_task_execution_status( self, *, failure_message: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, log_url: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -459,6 +588,15 @@ async def update_task_execution_status( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", body=await async_maybe_transform( diff --git a/src/gitpod/resources/environments/automations/tasks.py b/src/gitpod/resources/environments/automations/tasks.py index 594d5f9b..13345d51 100644 --- a/src/gitpod/resources/environments/automations/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks.py @@ -3,12 +3,15 @@ from __future__ import annotations from typing import List +from typing_extensions import Literal import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -59,10 +62,12 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse: def create( self, *, + connect_protocol_version: Literal[1], depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, spec: task_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -74,6 +79,10 @@ def create( CreateTask Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -82,6 +91,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/CreateTask", body=maybe_transform( @@ -102,7 +120,9 @@ def create( def retrieve( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -114,6 +134,10 @@ def retrieve( GetTask Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -122,6 +146,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/GetTask", body=maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), @@ -134,10 +167,12 @@ def retrieve( def update( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, depends_on: List[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, spec: task_update_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -149,8 +184,12 @@ def update( UpdateTask Args: + connect_protocol_version: Define the version of the Connect protocol + depends_on: dependencies specifies the IDs of the automations this task depends on. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -159,6 +198,15 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTask", body=maybe_transform( @@ -179,8 +227,10 @@ def update( def list( self, *, + connect_protocol_version: Literal[1], filter: task_list_params.Filter | NotGiven = NOT_GIVEN, pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -192,10 +242,14 @@ def list( ListTasks Args: + connect_protocol_version: Define the version of the Connect protocol + filter: filter contains the filter options for listing tasks pagination: pagination contains the pagination options for listing tasks + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -204,6 +258,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/ListTasks", body=maybe_transform( @@ -222,7 +285,9 @@ def list( def delete( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -234,6 +299,10 @@ def delete( DeleteTask Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -242,6 +311,15 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteTask", body=maybe_transform({"id": id}, task_delete_params.TaskDeleteParams), @@ -254,7 +332,9 @@ def delete( def start( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -268,6 +348,10 @@ def start( until the task is started; the task will be started asynchronously. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -276,6 +360,15 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentAutomationService/StartTask", body=maybe_transform({"id": id}, task_start_params.TaskStartParams), @@ -309,10 +402,12 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: async def create( self, *, + connect_protocol_version: Literal[1], depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, spec: task_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -324,6 +419,10 @@ async def create( CreateTask Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -332,6 +431,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/CreateTask", body=await async_maybe_transform( @@ -352,7 +460,9 @@ async def create( async def retrieve( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -364,6 +474,10 @@ async def retrieve( GetTask Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -372,6 +486,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetTask", body=await async_maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), @@ -384,10 +507,12 @@ async def retrieve( async def update( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, depends_on: List[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, spec: task_update_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -399,8 +524,12 @@ async def update( UpdateTask Args: + connect_protocol_version: Define the version of the Connect protocol + depends_on: dependencies specifies the IDs of the automations this task depends on. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -409,6 +538,15 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTask", body=await async_maybe_transform( @@ -429,8 +567,10 @@ async def update( async def list( self, *, + connect_protocol_version: Literal[1], filter: task_list_params.Filter | NotGiven = NOT_GIVEN, pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -442,10 +582,14 @@ async def list( ListTasks Args: + connect_protocol_version: Define the version of the Connect protocol + filter: filter contains the filter options for listing tasks pagination: pagination contains the pagination options for listing tasks + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -454,6 +598,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/ListTasks", body=await async_maybe_transform( @@ -472,7 +625,9 @@ async def list( async def delete( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -484,6 +639,10 @@ async def delete( DeleteTask Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -492,6 +651,15 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteTask", body=await async_maybe_transform({"id": id}, task_delete_params.TaskDeleteParams), @@ -504,7 +672,9 @@ async def delete( async def start( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -518,6 +688,10 @@ async def start( until the task is started; the task will be started asynchronously. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -526,6 +700,15 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StartTask", body=await async_maybe_transform({"id": id}, task_start_params.TaskStartParams), diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 734419df..0bf75063 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ...types import ( @@ -13,7 +15,9 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -68,7 +72,9 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: def create( self, *, + connect_protocol_version: Literal[1], spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -80,10 +86,14 @@ def create( CreateEnvironment creates a new environment and starts it. Args: + connect_protocol_version: Define the version of the Connect protocol + spec: EnvironmentSpec specifies the configuration of an environment for an environment start + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -92,6 +102,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentService/CreateEnvironment", body=maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), @@ -104,7 +123,9 @@ def create( def retrieve( self, *, + connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -119,8 +140,12 @@ def retrieve( +return NOT_FOUND Environment does not exist Args: + connect_protocol_version: Define the version of the Connect protocol + environment_id: environment_id specifies the environment to get + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -129,6 +154,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentService/GetEnvironment", body=maybe_transform( @@ -143,9 +177,11 @@ def retrieve( def list( self, *, + connect_protocol_version: Literal[1], filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -157,10 +193,14 @@ def list( ListEnvironments returns a list of environments that match the query. Args: + connect_protocol_version: Define the version of the Connect protocol + organization_id: organization_id is the ID of the organization that contains the environments pagination: pagination contains the pagination options for listing environments + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -169,6 +209,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentService/ListEnvironments", body=maybe_transform( @@ -188,8 +237,10 @@ def list( def create_from_project( self, *, + connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -202,10 +253,14 @@ def create_from_project( and starts it. Args: + connect_protocol_version: Define the version of the Connect protocol + spec: EnvironmentSpec specifies the configuration of an environment for an environment start + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -214,6 +269,15 @@ def create_from_project( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", body=maybe_transform( @@ -232,7 +296,9 @@ def create_from_project( def start( self, *, + connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -247,8 +313,12 @@ def start( the environment is already running no error is returned. Args: + connect_protocol_version: Define the version of the Connect protocol + environment_id: environment_id specifies which environment should be started. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -257,6 +327,15 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", body=maybe_transform({"environment_id": environment_id}, environment_start_params.EnvironmentStartParams), @@ -294,7 +373,9 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo async def create( self, *, + connect_protocol_version: Literal[1], spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -306,10 +387,14 @@ async def create( CreateEnvironment creates a new environment and starts it. Args: + connect_protocol_version: Define the version of the Connect protocol + spec: EnvironmentSpec specifies the configuration of an environment for an environment start + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -318,6 +403,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentService/CreateEnvironment", body=await async_maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), @@ -330,7 +424,9 @@ async def create( async def retrieve( self, *, + connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -345,8 +441,12 @@ async def retrieve( +return NOT_FOUND Environment does not exist Args: + connect_protocol_version: Define the version of the Connect protocol + environment_id: environment_id specifies the environment to get + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -355,6 +455,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentService/GetEnvironment", body=await async_maybe_transform( @@ -369,9 +478,11 @@ async def retrieve( async def list( self, *, + connect_protocol_version: Literal[1], filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -383,10 +494,14 @@ async def list( ListEnvironments returns a list of environments that match the query. Args: + connect_protocol_version: Define the version of the Connect protocol + organization_id: organization_id is the ID of the organization that contains the environments pagination: pagination contains the pagination options for listing environments + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -395,6 +510,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentService/ListEnvironments", body=await async_maybe_transform( @@ -414,8 +538,10 @@ async def list( async def create_from_project( self, *, + connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -428,10 +554,14 @@ async def create_from_project( and starts it. Args: + connect_protocol_version: Define the version of the Connect protocol + spec: EnvironmentSpec specifies the configuration of an environment for an environment start + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -440,6 +570,15 @@ async def create_from_project( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", body=await async_maybe_transform( @@ -458,7 +597,9 @@ async def create_from_project( async def start( self, *, + connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -473,8 +614,12 @@ async def start( the environment is already running no error is returned. Args: + connect_protocol_version: Define the version of the Connect protocol + environment_id: environment_id specifies which environment should be started. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -483,6 +628,15 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", body=await async_maybe_transform( diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 893f759b..1dd95ed9 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import List +from typing_extensions import Literal import httpx @@ -13,7 +14,9 @@ ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -55,7 +58,9 @@ def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: def exchange_token( self, *, + connect_protocol_version: Literal[1], exchange_token: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -67,8 +72,12 @@ def exchange_token( ExchangeToken trades an exchange token for a new access token. Args: + connect_protocol_version: Define the version of the Connect protocol + exchange_token: exchange_token is the token to exchange + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -77,6 +86,15 @@ def exchange_token( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.IdentityService/ExchangeToken", body=maybe_transform( @@ -92,6 +110,8 @@ def get_authenticated_identity( self, *, body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -103,6 +123,10 @@ def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -111,6 +135,15 @@ def get_authenticated_identity( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=maybe_transform( @@ -125,7 +158,9 @@ def get_authenticated_identity( def get_id_token( self, *, + connect_protocol_version: Literal[1], audience: List[str] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -138,6 +173,10 @@ def get_id_token( other services. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -146,6 +185,15 @@ def get_id_token( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.IdentityService/GetIDToken", body=maybe_transform({"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams), @@ -179,7 +227,9 @@ def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: async def exchange_token( self, *, + connect_protocol_version: Literal[1], exchange_token: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -191,8 +241,12 @@ async def exchange_token( ExchangeToken trades an exchange token for a new access token. Args: + connect_protocol_version: Define the version of the Connect protocol + exchange_token: exchange_token is the token to exchange + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -201,6 +255,15 @@ async def exchange_token( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.IdentityService/ExchangeToken", body=await async_maybe_transform( @@ -216,6 +279,8 @@ async def get_authenticated_identity( self, *, body: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -227,6 +292,10 @@ async def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -235,6 +304,15 @@ async def get_authenticated_identity( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=await async_maybe_transform( @@ -249,7 +327,9 @@ async def get_authenticated_identity( async def get_id_token( self, *, + connect_protocol_version: Literal[1], audience: List[str] | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -262,6 +342,10 @@ async def get_id_token( other services. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -270,6 +354,15 @@ async def get_id_token( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.IdentityService/GetIDToken", body=await async_maybe_transform( diff --git a/src/gitpod/resources/organizations/invite/invite.py b/src/gitpod/resources/organizations/invite/invite.py index d8a6b16f..aa334caf 100644 --- a/src/gitpod/resources/organizations/invite/invite.py +++ b/src/gitpod/resources/organizations/invite/invite.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from .summary import ( @@ -14,7 +16,9 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -60,7 +64,9 @@ def with_streaming_response(self) -> InviteResourceWithStreamingResponse: def create( self, *, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -74,6 +80,10 @@ def create( OrganizationInvites are invalidated and can no longer be used. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -82,6 +92,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.OrganizationService/CreateOrganizationInvite", body=maybe_transform({"organization_id": organization_id}, invite_create_params.InviteCreateParams), @@ -94,7 +113,9 @@ def create( def retrieve( self, *, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -108,6 +129,10 @@ def retrieve( exists, a new one is created. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -116,6 +141,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.OrganizationService/GetOrganizationInvite", body=maybe_transform({"organization_id": organization_id}, invite_retrieve_params.InviteRetrieveParams), @@ -153,7 +187,9 @@ def with_streaming_response(self) -> AsyncInviteResourceWithStreamingResponse: async def create( self, *, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -167,6 +203,10 @@ async def create( OrganizationInvites are invalidated and can no longer be used. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -175,6 +215,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.OrganizationService/CreateOrganizationInvite", body=await async_maybe_transform( @@ -189,7 +238,9 @@ async def create( async def retrieve( self, *, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -203,6 +254,10 @@ async def retrieve( exists, a new one is created. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -211,6 +266,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.OrganizationService/GetOrganizationInvite", body=await async_maybe_transform( diff --git a/src/gitpod/resources/organizations/invite/summary.py b/src/gitpod/resources/organizations/invite/summary.py index 29433add..d2f030a9 100644 --- a/src/gitpod/resources/organizations/invite/summary.py +++ b/src/gitpod/resources/organizations/invite/summary.py @@ -2,11 +2,15 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -47,7 +51,9 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: def retrieve( self, *, + connect_protocol_version: Literal[1], invite_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -62,6 +68,10 @@ def retrieve( Used to discover which organization an invite is for. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -70,6 +80,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", body=maybe_transform({"invite_id": invite_id}, summary_retrieve_params.SummaryRetrieveParams), @@ -103,7 +122,9 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: async def retrieve( self, *, + connect_protocol_version: Literal[1], invite_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -118,6 +139,10 @@ async def retrieve( Used to discover which organization an invite is for. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -126,6 +151,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", body=await async_maybe_transform({"invite_id": invite_id}, summary_retrieve_params.SummaryRetrieveParams), diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index af2717bd..c081923a 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -13,7 +13,9 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -65,7 +67,9 @@ def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: def leave( self, *, + connect_protocol_version: Literal[1], user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,6 +81,10 @@ def leave( LeaveOrganization lets the passed user leave an Organization. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -85,6 +93,15 @@ def leave( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.OrganizationService/LeaveOrganization", body=maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), @@ -97,8 +114,10 @@ def leave( def list_members( self, *, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -110,10 +129,14 @@ def list_members( ListMembers lists all members of the specified organization. Args: + connect_protocol_version: Define the version of the Connect protocol + organization_id: organization_id is the ID of the organization to list members for pagination: pagination contains the pagination options for listing members + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -122,6 +145,15 @@ def list_members( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.OrganizationService/ListMembers", body=maybe_transform( @@ -140,10 +172,12 @@ def list_members( def set_role( self, *, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -155,6 +189,10 @@ def set_role( SetRole Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -163,6 +201,15 @@ def set_role( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.OrganizationService/SetRole", body=maybe_transform( @@ -207,7 +254,9 @@ def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResp async def leave( self, *, + connect_protocol_version: Literal[1], user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -219,6 +268,10 @@ async def leave( LeaveOrganization lets the passed user leave an Organization. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -227,6 +280,15 @@ async def leave( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.OrganizationService/LeaveOrganization", body=await async_maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), @@ -239,8 +301,10 @@ async def leave( async def list_members( self, *, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -252,10 +316,14 @@ async def list_members( ListMembers lists all members of the specified organization. Args: + connect_protocol_version: Define the version of the Connect protocol + organization_id: organization_id is the ID of the organization to list members for pagination: pagination contains the pagination options for listing members + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -264,6 +332,15 @@ async def list_members( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.OrganizationService/ListMembers", body=await async_maybe_transform( @@ -282,10 +359,12 @@ async def list_members( async def set_role( self, *, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -297,6 +376,10 @@ async def set_role( SetRole Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -305,6 +388,15 @@ async def set_role( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.OrganizationService/SetRole", body=await async_maybe_transform( diff --git a/src/gitpod/resources/personal_access_tokens.py b/src/gitpod/resources/personal_access_tokens.py index dcd2f3a1..4c13f958 100644 --- a/src/gitpod/resources/personal_access_tokens.py +++ b/src/gitpod/resources/personal_access_tokens.py @@ -2,12 +2,16 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ..types import personal_access_token_list_params, personal_access_token_delete_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -47,8 +51,10 @@ def with_streaming_response(self) -> PersonalAccessTokensResourceWithStreamingRe def list( self, *, + connect_protocol_version: Literal[1], filter: personal_access_token_list_params.Filter | NotGiven = NOT_GIVEN, pagination: personal_access_token_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -60,6 +66,10 @@ def list( ListPersonalAccessTokens Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -68,6 +78,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.UserService/ListPersonalAccessTokens", body=maybe_transform( @@ -86,7 +105,9 @@ def list( def delete( self, *, + connect_protocol_version: Literal[1], personal_access_token_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -98,6 +119,10 @@ def delete( DeletePersonalAccessToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -106,6 +131,15 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.UserService/DeletePersonalAccessToken", body=maybe_transform( @@ -142,8 +176,10 @@ def with_streaming_response(self) -> AsyncPersonalAccessTokensResourceWithStream async def list( self, *, + connect_protocol_version: Literal[1], filter: personal_access_token_list_params.Filter | NotGiven = NOT_GIVEN, pagination: personal_access_token_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -155,6 +191,10 @@ async def list( ListPersonalAccessTokens Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -163,6 +203,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.UserService/ListPersonalAccessTokens", body=await async_maybe_transform( @@ -181,7 +230,9 @@ async def list( async def delete( self, *, + connect_protocol_version: Literal[1], personal_access_token_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -193,6 +244,10 @@ async def delete( DeletePersonalAccessToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -201,6 +256,15 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.UserService/DeletePersonalAccessToken", body=await async_maybe_transform( diff --git a/src/gitpod/resources/projects.py b/src/gitpod/resources/projects.py index 07e928f4..cb1195af 100644 --- a/src/gitpod/resources/projects.py +++ b/src/gitpod/resources/projects.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ..types import ( @@ -11,7 +13,9 @@ ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -55,9 +59,11 @@ def create( *, environment_class: project_create_params.EnvironmentClass, initializer: project_create_params.Initializer, + connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -71,6 +77,8 @@ def create( Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized + connect_protocol_version: Define the version of the Connect protocol + automations_file_path: automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): @@ -85,6 +93,8 @@ def create( this.matches("^$|^[^/].*") ``` + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -93,6 +103,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.ProjectService/CreateProject", body=maybe_transform( @@ -114,7 +133,9 @@ def create( def retrieve( self, *, + connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -126,8 +147,12 @@ def retrieve( GetProject retrieves a single Project. Args: + connect_protocol_version: Define the version of the Connect protocol + project_id: project_id specifies the project identifier + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -136,6 +161,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.ProjectService/GetProject", body=maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), @@ -148,8 +182,10 @@ def retrieve( def create_from_environment( self, *, + connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -161,8 +197,12 @@ def create_from_environment( CreateProject creates a new Project using an environment as template. Args: + connect_protocol_version: Define the version of the Connect protocol + environment_id: environment_id specifies the environment identifier + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -171,6 +211,15 @@ def create_from_environment( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", body=maybe_transform( @@ -212,9 +261,11 @@ async def create( *, environment_class: project_create_params.EnvironmentClass, initializer: project_create_params.Initializer, + connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -228,6 +279,8 @@ async def create( Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized + connect_protocol_version: Define the version of the Connect protocol + automations_file_path: automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): @@ -242,6 +295,8 @@ async def create( this.matches("^$|^[^/].*") ``` + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -250,6 +305,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.ProjectService/CreateProject", body=await async_maybe_transform( @@ -271,7 +335,9 @@ async def create( async def retrieve( self, *, + connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -283,8 +349,12 @@ async def retrieve( GetProject retrieves a single Project. Args: + connect_protocol_version: Define the version of the Connect protocol + project_id: project_id specifies the project identifier + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -293,6 +363,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.ProjectService/GetProject", body=await async_maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), @@ -305,8 +384,10 @@ async def retrieve( async def create_from_environment( self, *, + connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -318,8 +399,12 @@ async def create_from_environment( CreateProject creates a new Project using an environment as template. Args: + connect_protocol_version: Define the version of the Connect protocol + environment_id: environment_id specifies the environment identifier + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -328,6 +413,15 @@ async def create_from_environment( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runner_configurations/configuration_schema.py b/src/gitpod/resources/runner_configurations/configuration_schema.py index bf56b710..102168b8 100644 --- a/src/gitpod/resources/runner_configurations/configuration_schema.py +++ b/src/gitpod/resources/runner_configurations/configuration_schema.py @@ -2,11 +2,15 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -48,7 +52,9 @@ def with_streaming_response(self) -> ConfigurationSchemaResourceWithStreamingRes def create( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -60,6 +66,10 @@ def create( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -68,6 +78,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=maybe_transform( @@ -82,7 +101,9 @@ def create( def retrieve( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -94,6 +115,10 @@ def retrieve( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -102,6 +127,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=maybe_transform( @@ -137,7 +171,9 @@ def with_streaming_response(self) -> AsyncConfigurationSchemaResourceWithStreami async def create( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -149,6 +185,10 @@ async def create( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -157,6 +197,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=await async_maybe_transform( @@ -171,7 +220,9 @@ async def create( async def retrieve( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -183,6 +234,10 @@ async def retrieve( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -191,6 +246,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runner_configurations/environment_classes.py b/src/gitpod/resources/runner_configurations/environment_classes.py index 83d86e3a..a5a67325 100644 --- a/src/gitpod/resources/runner_configurations/environment_classes.py +++ b/src/gitpod/resources/runner_configurations/environment_classes.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing_extensions import overload +from typing_extensions import Literal, overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + is_given, required_args, maybe_transform, + strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -52,6 +54,8 @@ def update( self, *, description: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -63,6 +67,10 @@ def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -78,6 +86,8 @@ def update( self, *, display_name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -89,6 +99,10 @@ def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -104,6 +118,8 @@ def update( self, *, enabled: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -115,6 +131,10 @@ def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -125,11 +145,17 @@ def update( """ ... - @required_args(["description"], ["display_name"], ["enabled"]) + @required_args( + ["description", "connect_protocol_version"], + ["display_name", "connect_protocol_version"], + ["enabled", "connect_protocol_version"], + ) def update( self, *, description: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -139,6 +165,15 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", body=maybe_transform( @@ -158,8 +193,10 @@ def update( def list( self, *, + connect_protocol_version: Literal[1], filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -173,8 +210,12 @@ def list( buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: + connect_protocol_version: Define the version of the Connect protocol + pagination: pagination contains the pagination options for listing environment classes + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -183,6 +224,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", body=maybe_transform( @@ -224,6 +274,8 @@ async def update( self, *, description: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -235,6 +287,10 @@ async def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -250,6 +306,8 @@ async def update( self, *, display_name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -261,6 +319,10 @@ async def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -276,6 +338,8 @@ async def update( self, *, enabled: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -287,6 +351,10 @@ async def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -297,11 +365,17 @@ async def update( """ ... - @required_args(["description"], ["display_name"], ["enabled"]) + @required_args( + ["description", "connect_protocol_version"], + ["display_name", "connect_protocol_version"], + ["enabled", "connect_protocol_version"], + ) async def update( self, *, description: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -311,6 +385,15 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", body=await async_maybe_transform( @@ -330,8 +413,10 @@ async def update( async def list( self, *, + connect_protocol_version: Literal[1], filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -345,8 +430,12 @@ async def list( buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: + connect_protocol_version: Define the version of the Connect protocol + pagination: pagination contains the pagination options for listing environment classes + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -355,6 +444,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py index 79ad9656..09b54440 100644 --- a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runner_configurations/host_authentication_tokens.py @@ -4,14 +4,16 @@ from typing import Union from datetime import datetime -from typing_extensions import overload +from typing_extensions import Literal, overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + is_given, required_args, maybe_transform, + strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -64,7 +66,9 @@ def with_streaming_response(self) -> HostAuthenticationTokensResourceWithStreami def create( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -76,6 +80,10 @@ def create( GetHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -84,6 +92,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=maybe_transform( @@ -98,7 +115,9 @@ def create( def retrieve( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -110,6 +129,10 @@ def retrieve( GetHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -118,6 +141,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=maybe_transform( @@ -134,6 +166,8 @@ def update( self, *, expires_at: Union[str, datetime], + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -235,6 +269,10 @@ def update( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -250,6 +288,8 @@ def update( self, *, refresh_token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -261,6 +301,10 @@ def update( UpdateHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -276,6 +320,8 @@ def update( self, *, token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -287,6 +333,10 @@ def update( UpdateHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -297,11 +347,17 @@ def update( """ ... - @required_args(["expires_at"], ["refresh_token"], ["token"]) + @required_args( + ["expires_at", "connect_protocol_version"], + ["refresh_token", "connect_protocol_version"], + ["token", "connect_protocol_version"], + ) def update( self, *, expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, refresh_token: str | NotGiven = NOT_GIVEN, token: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -311,6 +367,15 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=maybe_transform( @@ -330,8 +395,10 @@ def update( def list( self, *, + connect_protocol_version: Literal[1], filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -343,6 +410,10 @@ def list( ListHostAuthenticationTokens Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -351,6 +422,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", body=maybe_transform( @@ -369,7 +449,9 @@ def list( def delete( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -381,6 +463,10 @@ def delete( DeleteHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -389,6 +475,15 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/DeleteHostAuthenticationToken", body=maybe_transform( @@ -424,7 +519,9 @@ def with_streaming_response(self) -> AsyncHostAuthenticationTokensResourceWithSt async def create( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -436,6 +533,10 @@ async def create( GetHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -444,6 +545,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=await async_maybe_transform( @@ -458,7 +568,9 @@ async def create( async def retrieve( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -470,6 +582,10 @@ async def retrieve( GetHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -478,6 +594,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=await async_maybe_transform( @@ -494,6 +619,8 @@ async def update( self, *, expires_at: Union[str, datetime], + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -595,6 +722,10 @@ async def update( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -610,6 +741,8 @@ async def update( self, *, refresh_token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -621,6 +754,10 @@ async def update( UpdateHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -636,6 +773,8 @@ async def update( self, *, token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -647,6 +786,10 @@ async def update( UpdateHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -657,11 +800,17 @@ async def update( """ ... - @required_args(["expires_at"], ["refresh_token"], ["token"]) + @required_args( + ["expires_at", "connect_protocol_version"], + ["refresh_token", "connect_protocol_version"], + ["token", "connect_protocol_version"], + ) async def update( self, *, expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, refresh_token: str | NotGiven = NOT_GIVEN, token: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -671,6 +820,15 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=await async_maybe_transform( @@ -690,8 +848,10 @@ async def update( async def list( self, *, + connect_protocol_version: Literal[1], filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -703,6 +863,10 @@ async def list( ListHostAuthenticationTokens Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -711,6 +875,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", body=await async_maybe_transform( @@ -729,7 +902,9 @@ async def list( async def delete( self, *, + connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -741,6 +916,10 @@ async def delete( DeleteHostAuthenticationToken Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -749,6 +928,15 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/DeleteHostAuthenticationToken", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runner_configurations/runner_configurations.py b/src/gitpod/resources/runner_configurations/runner_configurations.py index 5a272cc2..1b3a2871 100644 --- a/src/gitpod/resources/runner_configurations/runner_configurations.py +++ b/src/gitpod/resources/runner_configurations/runner_configurations.py @@ -3,15 +3,17 @@ from __future__ import annotations from typing import Any, cast -from typing_extensions import overload +from typing_extensions import Literal, overload import httpx from ...types import runner_configuration_validate_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + is_given, required_args, maybe_transform, + strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -101,7 +103,9 @@ def validate( self, *, environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -117,6 +121,10 @@ def validate( with the runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -132,7 +140,9 @@ def validate( self, *, scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -148,6 +158,10 @@ def validate( with the runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -158,12 +172,14 @@ def validate( """ ... - @required_args(["environment_class"], ["scm_integration"]) + @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) def validate( self, *, environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -172,6 +188,15 @@ def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerConfigurationValidateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return cast( RunnerConfigurationValidateResponse, self._post( @@ -235,7 +260,9 @@ async def validate( self, *, environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -251,6 +278,10 @@ async def validate( with the runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -266,7 +297,9 @@ async def validate( self, *, scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -282,6 +315,10 @@ async def validate( with the runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -292,12 +329,14 @@ async def validate( """ ... - @required_args(["environment_class"], ["scm_integration"]) + @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) async def validate( self, *, environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -306,6 +345,15 @@ async def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerConfigurationValidateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return cast( RunnerConfigurationValidateResponse, await self._post( diff --git a/src/gitpod/resources/runner_configurations/scm_integration.py b/src/gitpod/resources/runner_configurations/scm_integration.py index db9262f9..3a801fa9 100644 --- a/src/gitpod/resources/runner_configurations/scm_integration.py +++ b/src/gitpod/resources/runner_configurations/scm_integration.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing_extensions import overload +from typing_extensions import Literal, overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + is_given, required_args, maybe_transform, + strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -52,6 +54,8 @@ def create( self, *, oauth_client_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -67,6 +71,10 @@ def create( If configured, oauth_plaintext_client_secret must also be set. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -82,6 +90,8 @@ def create( self, *, oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -97,6 +107,10 @@ def create( This will first be encrypted with the runner's public key before being stored. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -107,11 +121,15 @@ def create( """ ... - @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"]) + @required_args( + ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] + ) def create( self, *, oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -120,6 +138,15 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", body=maybe_transform( @@ -161,6 +188,8 @@ async def create( self, *, oauth_client_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -176,6 +205,10 @@ async def create( If configured, oauth_plaintext_client_secret must also be set. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -191,6 +224,8 @@ async def create( self, *, oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -206,6 +241,10 @@ async def create( This will first be encrypted with the runner's public key before being stored. + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -216,11 +255,15 @@ async def create( """ ... - @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"]) + @required_args( + ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] + ) async def create( self, *, oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -229,6 +272,15 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index e299e148..057d92ac 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -2,11 +2,15 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + is_given, maybe_transform, + strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -47,8 +51,10 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def list( self, *, + connect_protocol_version: Literal[1], pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -60,10 +66,14 @@ def list( ListRunnerPolicies lists runner policies. Args: + connect_protocol_version: Define the version of the Connect protocol + pagination: pagination contains the pagination options for listing project policies runner_id: runner_id specifies the project identifier + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -72,6 +82,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/ListRunnerPolicies", body=maybe_transform( @@ -111,8 +130,10 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def list( self, *, + connect_protocol_version: Literal[1], pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -124,10 +145,14 @@ async def list( ListRunnerPolicies lists runner policies. Args: + connect_protocol_version: Define the version of the Connect protocol + pagination: pagination contains the pagination options for listing project policies runner_id: runner_id specifies the project identifier + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -136,6 +161,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/ListRunnerPolicies", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 76a1b1c9..c0042ba4 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -19,8 +19,10 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + is_given, required_args, maybe_transform, + strip_not_given, async_maybe_transform, ) from .policies import ( @@ -78,12 +80,14 @@ def with_streaming_response(self) -> RunnersResourceWithStreamingResponse: def create( self, *, + connect_protocol_version: Literal[1], kind: Literal[ "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" ] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -99,10 +103,14 @@ def create( an entire organisation or a single user. Args: + connect_protocol_version: Define the version of the Connect protocol + kind: RunnerKind represents the kind of a runner name: The runner name for humans + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -111,6 +119,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/CreateRunner", body=maybe_transform( @@ -130,7 +147,9 @@ def create( def retrieve( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -142,6 +161,10 @@ def retrieve( GetRunner returns a single runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -150,6 +173,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/GetRunner", body=maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), @@ -162,8 +194,10 @@ def retrieve( def list( self, *, + connect_protocol_version: Literal[1], filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -175,8 +209,12 @@ def list( ListRunners returns all runners registered in the scope. Args: + connect_protocol_version: Define the version of the Connect protocol + pagination: pagination contains the pagination options for listing runners + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -185,6 +223,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/ListRunners", body=maybe_transform( @@ -203,8 +250,10 @@ def list( def check_authentication_for_host( self, *, + connect_protocol_version: Literal[1], host: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -220,6 +269,10 @@ def check_authentication_for_host( authenticate, or indicate that Personal Access Tokens are supported. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -228,6 +281,15 @@ def check_authentication_for_host( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/CheckAuthenticationForHost", body=maybe_transform( @@ -246,7 +308,9 @@ def check_authentication_for_host( def create_runner_token( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -261,6 +325,10 @@ def create_runner_token( previouly issued tokens. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -269,6 +337,15 @@ def create_runner_token( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/CreateRunnerToken", body=maybe_transform( @@ -283,8 +360,10 @@ def create_runner_token( def delete_runner( self, *, + connect_protocol_version: Literal[1], force: bool | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -296,11 +375,15 @@ def delete_runner( DeleteRunner deletes an environment runner. Args: + connect_protocol_version: Define the version of the Connect protocol + force: force indicates whether the runner should be deleted forcefully. When force deleting a Runner, all Environments on the runner are also force deleted and regular Runner lifecycle is not respected. Force deleting can result in data loss. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -309,6 +392,15 @@ def delete_runner( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/DeleteRunner", body=maybe_transform( @@ -327,7 +419,9 @@ def delete_runner( def get_runner( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -339,6 +433,10 @@ def get_runner( GetRunner returns a single runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -347,6 +445,15 @@ def get_runner( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/GetRunner", body=maybe_transform({"runner_id": runner_id}, runner_get_runner_params.RunnerGetRunnerParams), @@ -359,8 +466,10 @@ def get_runner( def parse_context_url( self, *, + connect_protocol_version: Literal[1], context_url: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -383,6 +492,10 @@ def parse_context_url( exist Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -391,6 +504,15 @@ def parse_context_url( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/ParseContextURL", body=maybe_transform( @@ -411,6 +533,8 @@ def update_runner( self, *, name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -424,6 +548,10 @@ def update_runner( Args: name: The runner's name which is shown to users + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -439,6 +567,8 @@ def update_runner( self, *, spec: runner_update_runner_params.SpecSpec, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -450,6 +580,10 @@ def update_runner( UpdateRunner updates an environment runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -460,11 +594,13 @@ def update_runner( """ ... - @required_args(["name"], ["spec"]) + @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) def update_runner( self, *, name: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, spec: runner_update_runner_params.SpecSpec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -473,6 +609,15 @@ def update_runner( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return self._post( "/gitpod.v1.RunnerService/UpdateRunner", body=maybe_transform( @@ -516,12 +661,14 @@ def with_streaming_response(self) -> AsyncRunnersResourceWithStreamingResponse: async def create( self, *, + connect_protocol_version: Literal[1], kind: Literal[ "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" ] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -537,10 +684,14 @@ async def create( an entire organisation or a single user. Args: + connect_protocol_version: Define the version of the Connect protocol + kind: RunnerKind represents the kind of a runner name: The runner name for humans + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -549,6 +700,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/CreateRunner", body=await async_maybe_transform( @@ -568,7 +728,9 @@ async def create( async def retrieve( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -580,6 +742,10 @@ async def retrieve( GetRunner returns a single runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -588,6 +754,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/GetRunner", body=await async_maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), @@ -600,8 +775,10 @@ async def retrieve( async def list( self, *, + connect_protocol_version: Literal[1], filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -613,8 +790,12 @@ async def list( ListRunners returns all runners registered in the scope. Args: + connect_protocol_version: Define the version of the Connect protocol + pagination: pagination contains the pagination options for listing runners + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -623,6 +804,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/ListRunners", body=await async_maybe_transform( @@ -641,8 +831,10 @@ async def list( async def check_authentication_for_host( self, *, + connect_protocol_version: Literal[1], host: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -658,6 +850,10 @@ async def check_authentication_for_host( authenticate, or indicate that Personal Access Tokens are supported. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -666,6 +862,15 @@ async def check_authentication_for_host( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/CheckAuthenticationForHost", body=await async_maybe_transform( @@ -684,7 +889,9 @@ async def check_authentication_for_host( async def create_runner_token( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -699,6 +906,10 @@ async def create_runner_token( previouly issued tokens. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -707,6 +918,15 @@ async def create_runner_token( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/CreateRunnerToken", body=await async_maybe_transform( @@ -721,8 +941,10 @@ async def create_runner_token( async def delete_runner( self, *, + connect_protocol_version: Literal[1], force: bool | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -734,11 +956,15 @@ async def delete_runner( DeleteRunner deletes an environment runner. Args: + connect_protocol_version: Define the version of the Connect protocol + force: force indicates whether the runner should be deleted forcefully. When force deleting a Runner, all Environments on the runner are also force deleted and regular Runner lifecycle is not respected. Force deleting can result in data loss. + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -747,6 +973,15 @@ async def delete_runner( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/DeleteRunner", body=await async_maybe_transform( @@ -765,7 +1000,9 @@ async def delete_runner( async def get_runner( self, *, + connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -777,6 +1014,10 @@ async def get_runner( GetRunner returns a single runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -785,6 +1026,15 @@ async def get_runner( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/GetRunner", body=await async_maybe_transform({"runner_id": runner_id}, runner_get_runner_params.RunnerGetRunnerParams), @@ -797,8 +1047,10 @@ async def get_runner( async def parse_context_url( self, *, + connect_protocol_version: Literal[1], context_url: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -821,6 +1073,10 @@ async def parse_context_url( exist Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -829,6 +1085,15 @@ async def parse_context_url( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/ParseContextURL", body=await async_maybe_transform( @@ -849,6 +1114,8 @@ async def update_runner( self, *, name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -862,6 +1129,10 @@ async def update_runner( Args: name: The runner's name which is shown to users + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -877,6 +1148,8 @@ async def update_runner( self, *, spec: runner_update_runner_params.SpecSpec, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -888,6 +1161,10 @@ async def update_runner( UpdateRunner updates an environment runner. Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -898,11 +1175,13 @@ async def update_runner( """ ... - @required_args(["name"], ["spec"]) + @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) async def update_runner( self, *, name: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, spec: runner_update_runner_params.SpecSpec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -911,6 +1190,15 @@ async def update_runner( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } return await self._post( "/gitpod.v1.RunnerService/UpdateRunner", body=await async_maybe_transform( diff --git a/src/gitpod/types/environment_class_list_params.py b/src/gitpod/types/environment_class_list_params.py index b12968e4..82acdd22 100644 --- a/src/gitpod/types/environment_class_list_params.py +++ b/src/gitpod/types/environment_class_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,17 @@ class EnvironmentClassListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + filter: Filter pagination: Pagination """pagination contains the pagination options for listing environment classes""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Filter(TypedDict, total=False): enabled: Required[bool] diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index 4750f3b3..3886c64d 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -31,6 +31,9 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + project_id: Annotated[str, PropertyInfo(alias="projectId")] spec: Spec @@ -39,6 +42,9 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False): start """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index 34eff02e..e45f4aa9 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -31,12 +31,18 @@ class EnvironmentCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + spec: Spec """EnvironmentSpec specifies the configuration of an environment for an environment start """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index a9dfe22f..69fc3b4d 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -11,6 +11,9 @@ class EnvironmentListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + filter: Filter organization_id: Annotated[str, PropertyInfo(alias="organizationId")] @@ -19,6 +22,9 @@ class EnvironmentListParams(TypedDict, total=False): pagination: Pagination """pagination contains the pagination options for listing environments""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Filter(TypedDict, total=False): creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] diff --git a/src/gitpod/types/environment_retrieve_params.py b/src/gitpod/types/environment_retrieve_params.py index 7be510e5..a06329ae 100644 --- a/src/gitpod/types/environment_retrieve_params.py +++ b/src/gitpod/types/environment_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,5 +10,11 @@ class EnvironmentRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies the environment to get""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_start_params.py b/src/gitpod/types/environment_start_params.py index 83fe0a45..7827114d 100644 --- a/src/gitpod/types/environment_start_params.py +++ b/src/gitpod/types/environment_start_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,5 +10,11 @@ class EnvironmentStartParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies which environment should be started.""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automation_upsert_params.py b/src/gitpod/types/environments/automation_upsert_params.py index 7810ea2e..3285979c 100644 --- a/src/gitpod/types/environments/automation_upsert_params.py +++ b/src/gitpod/types/environments/automation_upsert_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -21,6 +21,9 @@ class AutomationUpsertParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + automations_file: Annotated[AutomationsFile, PropertyInfo(alias="automationsFile")] """ WARN: Do not remove any field here, as it will break reading automation yaml @@ -33,6 +36,9 @@ class AutomationUpsertParams(TypedDict, total=False): environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class AutomationsFileServicesCommands(TypedDict, total=False): ready: str diff --git a/src/gitpod/types/environments/automations/service_delete_params.py b/src/gitpod/types/environments/automations/service_delete_params.py index 2fc5f3d7..11a2198a 100644 --- a/src/gitpod/types/environments/automations/service_delete_params.py +++ b/src/gitpod/types/environments/automations/service_delete_params.py @@ -2,12 +2,20 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["ServiceDeleteParams"] class ServiceDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str force: bool + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py index 5ef181d4..2866c3f6 100644 --- a/src/gitpod/types/environments/automations/service_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -11,12 +11,18 @@ class ServiceListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + filter: Filter """filter contains the filter options for listing services""" pagination: Pagination """pagination contains the pagination options for listing services""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Filter(TypedDict, total=False): environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] diff --git a/src/gitpod/types/environments/automations/service_start_params.py b/src/gitpod/types/environments/automations/service_start_params.py index 237ab1e7..69eee8a0 100644 --- a/src/gitpod/types/environments/automations/service_start_params.py +++ b/src/gitpod/types/environments/automations/service_start_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["ServiceStartParams"] class ServiceStartParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_stop_params.py b/src/gitpod/types/environments/automations/service_stop_params.py index fcb5e253..a86b4148 100644 --- a/src/gitpod/types/environments/automations/service_stop_params.py +++ b/src/gitpod/types/environments/automations/service_stop_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["ServiceStopParams"] class ServiceStopParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index 7e31293f..e31fb35d 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -36,6 +36,9 @@ class ServiceUpdateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str metadata: Metadata @@ -56,6 +59,9 @@ class ServiceUpdateParams(TypedDict, total=False): requires the `environmentservice:update_status` permission. """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class MetadataDescription(TypedDict, total=False): description: Required[str] diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index 976165ea..a1d9bf64 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -23,6 +23,9 @@ class TaskCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] environment_id: Annotated[str, PropertyInfo(alias="environmentId")] @@ -31,6 +34,9 @@ class TaskCreateParams(TypedDict, total=False): spec: Spec + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class MetadataCreator(TypedDict, total=False): id: str diff --git a/src/gitpod/types/environments/automations/task_delete_params.py b/src/gitpod/types/environments/automations/task_delete_params.py index d1e4073d..2c11ff0c 100644 --- a/src/gitpod/types/environments/automations/task_delete_params.py +++ b/src/gitpod/types/environments/automations/task_delete_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["TaskDeleteParams"] class TaskDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_list_params.py b/src/gitpod/types/environments/automations/task_execution_list_params.py index 47c79826..78c3e7ba 100644 --- a/src/gitpod/types/environments/automations/task_execution_list_params.py +++ b/src/gitpod/types/environments/automations/task_execution_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -11,12 +11,18 @@ class TaskExecutionListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + filter: Filter """filter contains the filter options for listing task runs""" pagination: Pagination """pagination contains the pagination options for listing task runs""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Filter(TypedDict, total=False): environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] diff --git a/src/gitpod/types/environments/automations/task_execution_retrieve_params.py b/src/gitpod/types/environments/automations/task_execution_retrieve_params.py index 356e9b27..b13b311d 100644 --- a/src/gitpod/types/environments/automations/task_execution_retrieve_params.py +++ b/src/gitpod/types/environments/automations/task_execution_retrieve_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["TaskExecutionRetrieveParams"] class TaskExecutionRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_stop_params.py b/src/gitpod/types/environments/automations/task_execution_stop_params.py index 3bb29994..eeb7a922 100644 --- a/src/gitpod/types/environments/automations/task_execution_stop_params.py +++ b/src/gitpod/types/environments/automations/task_execution_stop_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["TaskExecutionStopParams"] class TaskExecutionStopParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py b/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py index 428719ac..6b28601f 100644 --- a/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py +++ b/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -20,6 +20,12 @@ class FailureMessage(TypedDict, total=False): only if the task execution as a whole has failed/cannot be started. """ + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class LogURL(TypedDict, total=False): log_url: Required[Annotated[str, PropertyInfo(alias="logUrl")]] @@ -28,5 +34,11 @@ class LogURL(TypedDict, total=False): If this is empty, the task either has no logs or has not yet started. """ + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + TaskExecutionUpdateTaskExecutionStatusParams: TypeAlias = Union[FailureMessage, LogURL] diff --git a/src/gitpod/types/environments/automations/task_list_params.py b/src/gitpod/types/environments/automations/task_list_params.py index af1afb5a..763a6dfd 100644 --- a/src/gitpod/types/environments/automations/task_list_params.py +++ b/src/gitpod/types/environments/automations/task_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -11,12 +11,18 @@ class TaskListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + filter: Filter """filter contains the filter options for listing tasks""" pagination: Pagination """pagination contains the pagination options for listing tasks""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Filter(TypedDict, total=False): environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] diff --git a/src/gitpod/types/environments/automations/task_retrieve_params.py b/src/gitpod/types/environments/automations/task_retrieve_params.py index acd7ec7a..b0d4d35b 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_params.py +++ b/src/gitpod/types/environments/automations/task_retrieve_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["TaskRetrieveParams"] class TaskRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_start_params.py b/src/gitpod/types/environments/automations/task_start_params.py index e9b47035..222ca23f 100644 --- a/src/gitpod/types/environments/automations/task_start_params.py +++ b/src/gitpod/types/environments/automations/task_start_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["TaskStartParams"] class TaskStartParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index 8ac5aae1..adb1ba2e 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Union, Iterable -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -27,6 +27,9 @@ class TaskUpdateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] @@ -36,6 +39,9 @@ class TaskUpdateParams(TypedDict, total=False): spec: Spec + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class MetadataDescription(TypedDict, total=False): description: Required[str] diff --git a/src/gitpod/types/identity_exchange_token_params.py b/src/gitpod/types/identity_exchange_token_params.py index e9114bd6..bb8becb3 100644 --- a/src/gitpod/types/identity_exchange_token_params.py +++ b/src/gitpod/types/identity_exchange_token_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,5 +10,11 @@ class IdentityExchangeTokenParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + exchange_token: Annotated[str, PropertyInfo(alias="exchangeToken")] """exchange_token is the token to exchange""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_authenticated_identity_params.py b/src/gitpod/types/identity_get_authenticated_identity_params.py index 43dd9519..457fe1f9 100644 --- a/src/gitpod/types/identity_get_authenticated_identity_params.py +++ b/src/gitpod/types/identity_get_authenticated_identity_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["IdentityGetAuthenticatedIdentityParams"] class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False): body: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_id_token_params.py b/src/gitpod/types/identity_get_id_token_params.py index e1d4c821..7291a3b6 100644 --- a/src/gitpod/types/identity_get_id_token_params.py +++ b/src/gitpod/types/identity_get_id_token_params.py @@ -3,10 +3,18 @@ from __future__ import annotations from typing import List -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["IdentityGetIDTokenParams"] class IdentityGetIDTokenParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + audience: List[str] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_leave_params.py b/src/gitpod/types/organization_leave_params.py index c2c29933..4fe19ee5 100644 --- a/src/gitpod/types/organization_leave_params.py +++ b/src/gitpod/types/organization_leave_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,4 +10,10 @@ class OrganizationLeaveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + user_id: Annotated[str, PropertyInfo(alias="userId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 8ce2f9f3..77441c33 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,12 +10,18 @@ class OrganizationListMembersParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] """organization_id is the ID of the organization to list members for""" pagination: Pagination """pagination contains the pagination options for listing members""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/organization_set_role_params.py b/src/gitpod/types/organization_set_role_params.py index 1a81fb4a..fbd10649 100644 --- a/src/gitpod/types/organization_set_role_params.py +++ b/src/gitpod/types/organization_set_role_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,8 +10,14 @@ class OrganizationSetRoleParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] user_id: Annotated[str, PropertyInfo(alias="userId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite/summary_retrieve_params.py b/src/gitpod/types/organizations/invite/summary_retrieve_params.py index 6a17886c..86f4793d 100644 --- a/src/gitpod/types/organizations/invite/summary_retrieve_params.py +++ b/src/gitpod/types/organizations/invite/summary_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -10,4 +10,10 @@ class SummaryRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + invite_id: Annotated[str, PropertyInfo(alias="inviteId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_create_params.py b/src/gitpod/types/organizations/invite_create_params.py index 7caa9f48..1cd14a51 100644 --- a/src/gitpod/types/organizations/invite_create_params.py +++ b/src/gitpod/types/organizations/invite_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,10 @@ class InviteCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_retrieve_params.py b/src/gitpod/types/organizations/invite_retrieve_params.py index 3a6a5fd4..fbbeaa6d 100644 --- a/src/gitpod/types/organizations/invite_retrieve_params.py +++ b/src/gitpod/types/organizations/invite_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,10 @@ class InviteRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/personal_access_token_delete_params.py b/src/gitpod/types/personal_access_token_delete_params.py index bcd3775c..39d64414 100644 --- a/src/gitpod/types/personal_access_token_delete_params.py +++ b/src/gitpod/types/personal_access_token_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,4 +10,10 @@ class PersonalAccessTokenDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + personal_access_token_id: Annotated[str, PropertyInfo(alias="personalAccessTokenId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/personal_access_token_list_params.py b/src/gitpod/types/personal_access_token_list_params.py index 301968bb..2cca5162 100644 --- a/src/gitpod/types/personal_access_token_list_params.py +++ b/src/gitpod/types/personal_access_token_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -11,10 +11,16 @@ class PersonalAccessTokenListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + filter: Filter pagination: Pagination + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Filter(TypedDict, total=False): user_ids: Annotated[List[str], PropertyInfo(alias="userIds")] diff --git a/src/gitpod/types/project_create_from_environment_params.py b/src/gitpod/types/project_create_from_environment_params.py index 17da3e40..477cbbdc 100644 --- a/src/gitpod/types/project_create_from_environment_params.py +++ b/src/gitpod/types/project_create_from_environment_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,7 +10,13 @@ class ProjectCreateFromEnvironmentParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies the environment identifier""" name: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index 0f4dcfe2..0e9a1c4d 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -27,6 +27,9 @@ class ProjectCreateParams(TypedDict, total=False): initializer: Required[Initializer] """EnvironmentInitializer specifies how an environment is to be initialized""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file relative to the repo @@ -49,6 +52,9 @@ class ProjectCreateParams(TypedDict, total=False): name: str + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class EnvironmentClassEnvironmentClassID(TypedDict, total=False): environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] diff --git a/src/gitpod/types/project_retrieve_params.py b/src/gitpod/types/project_retrieve_params.py index 0160fa6f..42abf44b 100644 --- a/src/gitpod/types/project_retrieve_params.py +++ b/src/gitpod/types/project_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,5 +10,11 @@ class ProjectRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_check_authentication_for_host_params.py b/src/gitpod/types/runner_check_authentication_for_host_params.py index c3a5db48..67322e17 100644 --- a/src/gitpod/types/runner_check_authentication_for_host_params.py +++ b/src/gitpod/types/runner_check_authentication_for_host_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,6 +10,12 @@ class RunnerCheckAuthenticationForHostParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + host: str runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configuration_validate_params.py b/src/gitpod/types/runner_configuration_validate_params.py index 21266e5f..830bdab2 100644 --- a/src/gitpod/types/runner_configuration_validate_params.py +++ b/src/gitpod/types/runner_configuration_validate_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._types import Base64FileInput from .._utils import PropertyInfo @@ -25,8 +25,14 @@ class EnvironmentClass(TypedDict, total=False): environment_class: Required[Annotated[EnvironmentClassEnvironmentClass, PropertyInfo(alias="environmentClass")]] + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class EnvironmentClassEnvironmentClassConfiguration(TypedDict, total=False): key: str @@ -63,8 +69,14 @@ class EnvironmentClassEnvironmentClass(TypedDict, total=False): class ScmIntegration(TypedDict, total=False): scm_integration: Required[Annotated[ScmIntegrationScmIntegration, PropertyInfo(alias="scmIntegration")]] + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class ScmIntegrationScmIntegrationOAuthClientID(TypedDict, total=False): oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] diff --git a/src/gitpod/types/runner_configurations/configuration_schema_create_params.py b/src/gitpod/types/runner_configurations/configuration_schema_create_params.py index e7e60ee7..b8cb816d 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_create_params.py +++ b/src/gitpod/types/runner_configurations/configuration_schema_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,10 @@ class ConfigurationSchemaCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py index 4425ceca..d8ca6699 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py +++ b/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,10 @@ class ConfigurationSchemaRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/environment_class_list_params.py b/src/gitpod/types/runner_configurations/environment_class_list_params.py index 62a00f0f..9cbaf8f3 100644 --- a/src/gitpod/types/runner_configurations/environment_class_list_params.py +++ b/src/gitpod/types/runner_configurations/environment_class_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,11 +10,17 @@ class EnvironmentClassListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + filter: Filter pagination: Pagination """pagination contains the pagination options for listing environment classes""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Filter(TypedDict, total=False): enabled: Required[bool] diff --git a/src/gitpod/types/runner_configurations/environment_class_update_params.py b/src/gitpod/types/runner_configurations/environment_class_update_params.py index e5df2848..f26ca514 100644 --- a/src/gitpod/types/runner_configurations/environment_class_update_params.py +++ b/src/gitpod/types/runner_configurations/environment_class_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo @@ -13,13 +13,31 @@ class Description(TypedDict, total=False): description: Required[str] + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class DisplayName(TypedDict, total=False): display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Enabled(TypedDict, total=False): enabled: Required[bool] + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + EnvironmentClassUpdateParams: TypeAlias = Union[Description, DisplayName, Enabled] diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py index f3c7a10b..fb34ff72 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["HostAuthenticationTokenCreateParams"] class HostAuthenticationTokenCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py index f7de02b2..05eaa723 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["HostAuthenticationTokenDeleteParams"] class HostAuthenticationTokenDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py index 718524bb..7d1cb306 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo @@ -11,10 +11,16 @@ class HostAuthenticationTokenListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + filter: Filter pagination: Pagination + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class FilterRunnerID(TypedDict, total=False): runner_id: Required[Annotated[str, PropertyInfo(alias="runnerId")]] diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py index c544285c..82d07586 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py @@ -2,10 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["HostAuthenticationTokenRetrieveParams"] class HostAuthenticationTokenRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + id: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py index b352d955..eb360a36 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo @@ -104,13 +104,31 @@ class ExpiresAt(TypedDict, total=False): to obtain a formatter capable of generating timestamps in this format. """ + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class RefreshToken(TypedDict, total=False): refresh_token: Required[Annotated[str, PropertyInfo(alias="refreshToken")]] + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Token(TypedDict, total=False): token: Required[str] + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + HostAuthenticationTokenUpdateParams: TypeAlias = Union[ExpiresAt, RefreshToken, Token] diff --git a/src/gitpod/types/runner_configurations/scm_integration_create_params.py b/src/gitpod/types/runner_configurations/scm_integration_create_params.py index 4e8e6ff1..d32fee9d 100644 --- a/src/gitpod/types/runner_configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runner_configurations/scm_integration_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo @@ -17,6 +17,12 @@ class OAuthClientID(TypedDict, total=False): If configured, oauth_plaintext_client_secret must also be set. """ + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class OAuthPlaintextClientSecret(TypedDict, total=False): oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] @@ -25,5 +31,11 @@ class OAuthPlaintextClientSecret(TypedDict, total=False): This will first be encrypted with the runner's public key before being stored. """ + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + ScmIntegrationCreateParams: TypeAlias = Union[OAuthClientID, OAuthPlaintextClientSecret] diff --git a/src/gitpod/types/runner_create_params.py b/src/gitpod/types/runner_create_params.py index 7c10ca8c..4e37b01e 100644 --- a/src/gitpod/types/runner_create_params.py +++ b/src/gitpod/types/runner_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,6 +10,9 @@ class RunnerCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + kind: Literal[ "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" ] @@ -20,6 +23,9 @@ class RunnerCreateParams(TypedDict, total=False): spec: Spec + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class SpecConfiguration(TypedDict, total=False): auto_update: Annotated[bool, PropertyInfo(alias="autoUpdate")] diff --git a/src/gitpod/types/runner_create_runner_token_params.py b/src/gitpod/types/runner_create_runner_token_params.py index 8bf7b700..da185a2c 100644 --- a/src/gitpod/types/runner_create_runner_token_params.py +++ b/src/gitpod/types/runner_create_runner_token_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,4 +10,10 @@ class RunnerCreateRunnerTokenParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_delete_runner_params.py b/src/gitpod/types/runner_delete_runner_params.py index 0d1668ad..005bf36e 100644 --- a/src/gitpod/types/runner_delete_runner_params.py +++ b/src/gitpod/types/runner_delete_runner_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,6 +10,9 @@ class RunnerDeleteRunnerParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + force: bool """ force indicates whether the runner should be deleted forcefully. When force @@ -19,3 +22,6 @@ class RunnerDeleteRunnerParams(TypedDict, total=False): """ runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_get_runner_params.py b/src/gitpod/types/runner_get_runner_params.py index b7a1cb12..3079471c 100644 --- a/src/gitpod/types/runner_get_runner_params.py +++ b/src/gitpod/types/runner_get_runner_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,4 +10,10 @@ class RunnerGetRunnerParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py index cfeff679..4155c49d 100644 --- a/src/gitpod/types/runner_list_params.py +++ b/src/gitpod/types/runner_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -11,11 +11,17 @@ class RunnerListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + filter: Filter pagination: Pagination """pagination contains the pagination options for listing runners""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Filter(TypedDict, total=False): creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] diff --git a/src/gitpod/types/runner_parse_context_url_params.py b/src/gitpod/types/runner_parse_context_url_params.py index 986d37b1..c131a243 100644 --- a/src/gitpod/types/runner_parse_context_url_params.py +++ b/src/gitpod/types/runner_parse_context_url_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,6 +10,12 @@ class RunnerParseContextURLParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + context_url: Annotated[str, PropertyInfo(alias="contextUrl")] runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_retrieve_params.py b/src/gitpod/types/runner_retrieve_params.py index 409766f2..786b07dd 100644 --- a/src/gitpod/types/runner_retrieve_params.py +++ b/src/gitpod/types/runner_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,4 +10,10 @@ class RunnerRetrieveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_update_runner_params.py b/src/gitpod/types/runner_update_runner_params.py index d7562f62..c8750543 100644 --- a/src/gitpod/types/runner_update_runner_params.py +++ b/src/gitpod/types/runner_update_runner_params.py @@ -24,10 +24,22 @@ class Name(TypedDict, total=False): name: Required[str] """The runner's name which is shown to users""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Spec(TypedDict, total=False): spec: Required[SpecSpec] + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class SpecSpecConfigurationConfigurationAutoUpdate(TypedDict, total=False): auto_update: Required[Annotated[bool, PropertyInfo(alias="autoUpdate")]] diff --git a/src/gitpod/types/runners/policy_list_params.py b/src/gitpod/types/runners/policy_list_params.py index 69b8c0b7..af0ca922 100644 --- a/src/gitpod/types/runners/policy_list_params.py +++ b/src/gitpod/types/runners/policy_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,12 +10,18 @@ class PolicyListParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + pagination: Pagination """pagination contains the pagination options for listing project policies""" runner_id: Annotated[str, PropertyInfo(alias="runnerId")] """runner_id specifies the project identifier""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + class Pagination(TypedDict, total=False): token: str diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index a1135676..338ad174 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -21,22 +21,28 @@ class TestServices: @parametrize def test_method_update(self, client: Gitpod) -> None: - service = client.environments.automations.services.update() + service = client.environments.automations.services.update( + connect_protocol_version=1, + ) assert_matches_type(object, service, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={"description": "description"}, spec={"commands": {"ready": "ready"}}, status={"failure_message": "failureMessage"}, + connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.update() + response = client.environments.automations.services.with_raw_response.update( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -45,7 +51,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.update() as response: + with client.environments.automations.services.with_streaming_response.update( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -56,12 +64,15 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - service = client.environments.automations.services.list() + service = client.environments.automations.services.list( + connect_protocol_version=1, + ) assert_matches_type(ServiceListResponse, service, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.list( + connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["x"], @@ -71,12 +82,15 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(ServiceListResponse, service, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.list() + response = client.environments.automations.services.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -85,7 +99,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.list() as response: + with client.environments.automations.services.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -96,20 +112,26 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - service = client.environments.automations.services.delete() + service = client.environments.automations.services.delete( + connect_protocol_version=1, + ) assert_matches_type(object, service, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.delete( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, + connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.delete() + response = client.environments.automations.services.with_raw_response.delete( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -118,7 +140,9 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.delete() as response: + with client.environments.automations.services.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -129,19 +153,25 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - service = client.environments.automations.services.start() + service = client.environments.automations.services.start( + connect_protocol_version=1, + ) assert_matches_type(object, service, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.start( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.start() + response = client.environments.automations.services.with_raw_response.start( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,7 +180,9 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.start() as response: + with client.environments.automations.services.with_streaming_response.start( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -161,19 +193,25 @@ def test_streaming_response_start(self, client: Gitpod) -> None: @parametrize def test_method_stop(self, client: Gitpod) -> None: - service = client.environments.automations.services.stop() + service = client.environments.automations.services.stop( + connect_protocol_version=1, + ) assert_matches_type(object, service, path=["response"]) @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.stop( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.stop() + response = client.environments.automations.services.with_raw_response.stop( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -182,7 +220,9 @@ def test_raw_response_stop(self, client: Gitpod) -> None: @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.stop() as response: + with client.environments.automations.services.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -197,22 +237,28 @@ class TestAsyncServices: @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.update() + service = await async_client.environments.automations.services.update( + connect_protocol_version=1, + ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={"description": "description"}, spec={"commands": {"ready": "ready"}}, status={"failure_message": "failureMessage"}, + connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.update() + response = await async_client.environments.automations.services.with_raw_response.update( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -221,7 +267,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.update() as response: + async with async_client.environments.automations.services.with_streaming_response.update( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -232,12 +280,15 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.list() + service = await async_client.environments.automations.services.list( + connect_protocol_version=1, + ) assert_matches_type(ServiceListResponse, service, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( + connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["x"], @@ -247,12 +298,15 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(ServiceListResponse, service, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.list() + response = await async_client.environments.automations.services.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -261,7 +315,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.list() as response: + async with async_client.environments.automations.services.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -272,20 +328,26 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.delete() + service = await async_client.environments.automations.services.delete( + connect_protocol_version=1, + ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, + connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.delete() + response = await async_client.environments.automations.services.with_raw_response.delete( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -294,7 +356,9 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.delete() as response: + async with async_client.environments.automations.services.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -305,19 +369,25 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.start() + service = await async_client.environments.automations.services.start( + connect_protocol_version=1, + ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.start() + response = await async_client.environments.automations.services.with_raw_response.start( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -326,7 +396,9 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.start() as response: + async with async_client.environments.automations.services.with_streaming_response.start( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -337,19 +409,25 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.stop() + service = await async_client.environments.automations.services.stop( + connect_protocol_version=1, + ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.stop() + response = await async_client.environments.automations.services.with_raw_response.stop( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -358,7 +436,9 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.stop() as response: + async with async_client.environments.automations.services.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/automations/test_task_executions.py b/tests/api_resources/environments/automations/test_task_executions.py index 9875b72c..f7d63563 100644 --- a/tests/api_resources/environments/automations/test_task_executions.py +++ b/tests/api_resources/environments/automations/test_task_executions.py @@ -22,19 +22,25 @@ class TestTaskExecutions: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.retrieve() + task_execution = client.environments.automations.task_executions.retrieve( + connect_protocol_version=1, + ) assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.retrieve( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.retrieve() + response = client.environments.automations.task_executions.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -43,7 +49,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.retrieve() as response: + with client.environments.automations.task_executions.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,12 +62,15 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.list() + task_execution = client.environments.automations.task_executions.list( + connect_protocol_version=1, + ) assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.list( + connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], @@ -70,12 +81,15 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.list() + response = client.environments.automations.task_executions.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -84,7 +98,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.list() as response: + with client.environments.automations.task_executions.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -95,19 +111,25 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_stop(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.stop() + task_execution = client.environments.automations.task_executions.stop( + connect_protocol_version=1, + ) assert_matches_type(object, task_execution, path=["response"]) @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.stop( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.stop() + response = client.environments.automations.task_executions.with_raw_response.stop( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -116,7 +138,9 @@ def test_raw_response_stop(self, client: Gitpod) -> None: @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.stop() as response: + with client.environments.automations.task_executions.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -129,6 +153,16 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: def test_method_update_task_execution_status_overload_1(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.update_task_execution_status( failure_message="failureMessage", + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_method_update_task_execution_status_with_all_params_overload_1(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.update_task_execution_status( + failure_message="failureMessage", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @@ -136,6 +170,7 @@ def test_method_update_task_execution_status_overload_1(self, client: Gitpod) -> def test_raw_response_update_task_execution_status_overload_1(self, client: Gitpod) -> None: response = client.environments.automations.task_executions.with_raw_response.update_task_execution_status( failure_message="failureMessage", + connect_protocol_version=1, ) assert response.is_closed is True @@ -147,6 +182,7 @@ def test_raw_response_update_task_execution_status_overload_1(self, client: Gitp def test_streaming_response_update_task_execution_status_overload_1(self, client: Gitpod) -> None: with client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( failure_message="failureMessage", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -160,6 +196,16 @@ def test_streaming_response_update_task_execution_status_overload_1(self, client def test_method_update_task_execution_status_overload_2(self, client: Gitpod) -> None: task_execution = client.environments.automations.task_executions.update_task_execution_status( log_url="logUrl", + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + def test_method_update_task_execution_status_with_all_params_overload_2(self, client: Gitpod) -> None: + task_execution = client.environments.automations.task_executions.update_task_execution_status( + log_url="logUrl", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @@ -167,6 +213,7 @@ def test_method_update_task_execution_status_overload_2(self, client: Gitpod) -> def test_raw_response_update_task_execution_status_overload_2(self, client: Gitpod) -> None: response = client.environments.automations.task_executions.with_raw_response.update_task_execution_status( log_url="logUrl", + connect_protocol_version=1, ) assert response.is_closed is True @@ -178,6 +225,7 @@ def test_raw_response_update_task_execution_status_overload_2(self, client: Gitp def test_streaming_response_update_task_execution_status_overload_2(self, client: Gitpod) -> None: with client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( log_url="logUrl", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -193,19 +241,25 @@ class TestAsyncTaskExecutions: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.retrieve() + task_execution = await async_client.environments.automations.task_executions.retrieve( + connect_protocol_version=1, + ) assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.retrieve( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.task_executions.with_raw_response.retrieve() + response = await async_client.environments.automations.task_executions.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -214,7 +268,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.retrieve() as response: + async with async_client.environments.automations.task_executions.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -225,12 +281,15 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.list() + task_execution = await async_client.environments.automations.task_executions.list( + connect_protocol_version=1, + ) assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.list( + connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], @@ -241,12 +300,15 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.task_executions.with_raw_response.list() + response = await async_client.environments.automations.task_executions.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -255,7 +317,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.list() as response: + async with async_client.environments.automations.task_executions.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -266,19 +330,25 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.stop() + task_execution = await async_client.environments.automations.task_executions.stop( + connect_protocol_version=1, + ) assert_matches_type(object, task_execution, path=["response"]) @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.stop( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.task_executions.with_raw_response.stop() + response = await async_client.environments.automations.task_executions.with_raw_response.stop( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -287,7 +357,9 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.stop() as response: + async with async_client.environments.automations.task_executions.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -300,6 +372,18 @@ async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async def test_method_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( failure_message="failureMessage", + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_method_update_task_execution_status_with_all_params_overload_1( + self, async_client: AsyncGitpod + ) -> None: + task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( + failure_message="failureMessage", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @@ -308,6 +392,7 @@ async def test_raw_response_update_task_execution_status_overload_1(self, async_ response = ( await async_client.environments.automations.task_executions.with_raw_response.update_task_execution_status( failure_message="failureMessage", + connect_protocol_version=1, ) ) @@ -320,6 +405,7 @@ async def test_raw_response_update_task_execution_status_overload_1(self, async_ async def test_streaming_response_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( failure_message="failureMessage", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -333,6 +419,18 @@ async def test_streaming_response_update_task_execution_status_overload_1(self, async def test_method_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( log_url="logUrl", + connect_protocol_version=1, + ) + assert_matches_type(object, task_execution, path=["response"]) + + @parametrize + async def test_method_update_task_execution_status_with_all_params_overload_2( + self, async_client: AsyncGitpod + ) -> None: + task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( + log_url="logUrl", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, task_execution, path=["response"]) @@ -341,6 +439,7 @@ async def test_raw_response_update_task_execution_status_overload_2(self, async_ response = ( await async_client.environments.automations.task_executions.with_raw_response.update_task_execution_status( log_url="logUrl", + connect_protocol_version=1, ) ) @@ -353,6 +452,7 @@ async def test_raw_response_update_task_execution_status_overload_2(self, async_ async def test_streaming_response_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( log_url="logUrl", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index e73825ec..febb4ef9 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -25,12 +25,15 @@ class TestTasks: @parametrize def test_method_create(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.create() + task = client.environments.automations.tasks.create( + connect_protocol_version=1, + ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create( + connect_protocol_version=1, depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ @@ -53,12 +56,15 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: } }, }, + connect_timeout_ms=0, ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.create() + response = client.environments.automations.tasks.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -67,7 +73,9 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.create() as response: + with client.environments.automations.tasks.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -78,19 +86,25 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.retrieve() + task = client.environments.automations.tasks.retrieve( + connect_protocol_version=1, + ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.retrieve() + response = client.environments.automations.tasks.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -99,7 +113,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.retrieve() as response: + with client.environments.automations.tasks.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -110,22 +126,28 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_update(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.update() + task = client.environments.automations.tasks.update( + connect_protocol_version=1, + ) assert_matches_type(object, task, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={"description": "description"}, spec={"command": "command"}, + connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.update() + response = client.environments.automations.tasks.with_raw_response.update( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -134,7 +156,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.update() as response: + with client.environments.automations.tasks.with_streaming_response.update( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -145,12 +169,15 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.list() + task = client.environments.automations.tasks.list( + connect_protocol_version=1, + ) assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( + connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["x"], @@ -160,12 +187,15 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.list() + response = client.environments.automations.tasks.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -174,7 +204,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.list() as response: + with client.environments.automations.tasks.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -185,19 +217,25 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.delete() + task = client.environments.automations.tasks.delete( + connect_protocol_version=1, + ) assert_matches_type(object, task, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.delete() + response = client.environments.automations.tasks.with_raw_response.delete( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -206,7 +244,9 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.delete() as response: + with client.environments.automations.tasks.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -217,19 +257,25 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.start() + task = client.environments.automations.tasks.start( + connect_protocol_version=1, + ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.start() + response = client.environments.automations.tasks.with_raw_response.start( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -238,7 +284,9 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.start() as response: + with client.environments.automations.tasks.with_streaming_response.start( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -253,12 +301,15 @@ class TestAsyncTasks: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.create() + task = await async_client.environments.automations.tasks.create( + connect_protocol_version=1, + ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create( + connect_protocol_version=1, depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ @@ -281,12 +332,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> } }, }, + connect_timeout_ms=0, ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.create() + response = await async_client.environments.automations.tasks.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -295,7 +349,9 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.create() as response: + async with async_client.environments.automations.tasks.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -306,19 +362,25 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.retrieve() + task = await async_client.environments.automations.tasks.retrieve( + connect_protocol_version=1, + ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.retrieve() + response = await async_client.environments.automations.tasks.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -327,7 +389,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.retrieve() as response: + async with async_client.environments.automations.tasks.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -338,22 +402,28 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.update() + task = await async_client.environments.automations.tasks.update( + connect_protocol_version=1, + ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={"description": "description"}, spec={"command": "command"}, + connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.update() + response = await async_client.environments.automations.tasks.with_raw_response.update( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -362,7 +432,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.update() as response: + async with async_client.environments.automations.tasks.with_streaming_response.update( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -373,12 +445,15 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.list() + task = await async_client.environments.automations.tasks.list( + connect_protocol_version=1, + ) assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( + connect_protocol_version=1, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["x"], @@ -388,12 +463,15 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(TaskListResponse, task, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.list() + response = await async_client.environments.automations.tasks.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -402,7 +480,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.list() as response: + async with async_client.environments.automations.tasks.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -413,19 +493,25 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.delete() + task = await async_client.environments.automations.tasks.delete( + connect_protocol_version=1, + ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.delete() + response = await async_client.environments.automations.tasks.with_raw_response.delete( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -434,7 +520,9 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.delete() as response: + async with async_client.environments.automations.tasks.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -445,19 +533,25 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.start() + task = await async_client.environments.automations.tasks.start( + connect_protocol_version=1, + ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.start() + response = await async_client.environments.automations.tasks.with_raw_response.start( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -466,7 +560,9 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.start() as response: + async with async_client.environments.automations.tasks.with_streaming_response.start( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 6a61c299..cf302b07 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -19,12 +19,15 @@ class TestAutomations: @parametrize def test_method_upsert(self, client: Gitpod) -> None: - automation = client.environments.automations.upsert() + automation = client.environments.automations.upsert( + connect_protocol_version=1, + ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize def test_method_upsert_with_all_params(self, client: Gitpod) -> None: automation = client.environments.automations.upsert( + connect_protocol_version=1, automations_file={ "services": { "foo": { @@ -61,12 +64,15 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: }, }, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize def test_raw_response_upsert(self, client: Gitpod) -> None: - response = client.environments.automations.with_raw_response.upsert() + response = client.environments.automations.with_raw_response.upsert( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -75,7 +81,9 @@ def test_raw_response_upsert(self, client: Gitpod) -> None: @parametrize def test_streaming_response_upsert(self, client: Gitpod) -> None: - with client.environments.automations.with_streaming_response.upsert() as response: + with client.environments.automations.with_streaming_response.upsert( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,12 +98,15 @@ class TestAsyncAutomations: @parametrize async def test_method_upsert(self, async_client: AsyncGitpod) -> None: - automation = await async_client.environments.automations.upsert() + automation = await async_client.environments.automations.upsert( + connect_protocol_version=1, + ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert( + connect_protocol_version=1, automations_file={ "services": { "foo": { @@ -132,12 +143,15 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> }, }, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.with_raw_response.upsert() + response = await async_client.environments.automations.with_raw_response.upsert( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -146,7 +160,9 @@ async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.with_streaming_response.upsert() as response: + async with async_client.environments.automations.with_streaming_response.upsert( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/organizations/invite/test_summary.py b/tests/api_resources/organizations/invite/test_summary.py index d364307a..efed9ad1 100644 --- a/tests/api_resources/organizations/invite/test_summary.py +++ b/tests/api_resources/organizations/invite/test_summary.py @@ -19,19 +19,25 @@ class TestSummary: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - summary = client.organizations.invite.summary.retrieve() + summary = client.organizations.invite.summary.retrieve( + connect_protocol_version=1, + ) assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: summary = client.organizations.invite.summary.retrieve( + connect_protocol_version=1, invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.invite.summary.with_raw_response.retrieve() + response = client.organizations.invite.summary.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -40,7 +46,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.invite.summary.with_streaming_response.retrieve() as response: + with client.organizations.invite.summary.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -55,19 +63,25 @@ class TestAsyncSummary: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - summary = await async_client.organizations.invite.summary.retrieve() + summary = await async_client.organizations.invite.summary.retrieve( + connect_protocol_version=1, + ) assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: summary = await async_client.organizations.invite.summary.retrieve( + connect_protocol_version=1, invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invite.summary.with_raw_response.retrieve() + response = await async_client.organizations.invite.summary.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -76,7 +90,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invite.summary.with_streaming_response.retrieve() as response: + async with async_client.organizations.invite.summary.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/organizations/test_invite.py b/tests/api_resources/organizations/test_invite.py index 9adf95c7..52a7e802 100644 --- a/tests/api_resources/organizations/test_invite.py +++ b/tests/api_resources/organizations/test_invite.py @@ -22,19 +22,25 @@ class TestInvite: @parametrize def test_method_create(self, client: Gitpod) -> None: - invite = client.organizations.invite.create() + invite = client.organizations.invite.create( + connect_protocol_version=1, + ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invite.create( + connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.invite.with_raw_response.create() + response = client.organizations.invite.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -43,7 +49,9 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.invite.with_streaming_response.create() as response: + with client.organizations.invite.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,19 +62,25 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - invite = client.organizations.invite.retrieve() + invite = client.organizations.invite.retrieve( + connect_protocol_version=1, + ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invite.retrieve( + connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.invite.with_raw_response.retrieve() + response = client.organizations.invite.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -75,7 +89,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.invite.with_streaming_response.retrieve() as response: + with client.organizations.invite.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,19 +106,25 @@ class TestAsyncInvite: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invite.create() + invite = await async_client.organizations.invite.create( + connect_protocol_version=1, + ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invite.create( + connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invite.with_raw_response.create() + response = await async_client.organizations.invite.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -111,7 +133,9 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invite.with_streaming_response.create() as response: + async with async_client.organizations.invite.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -122,19 +146,25 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invite.retrieve() + invite = await async_client.organizations.invite.retrieve( + connect_protocol_version=1, + ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invite.retrieve( + connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invite.with_raw_response.retrieve() + response = await async_client.organizations.invite.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -143,7 +173,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invite.with_streaming_response.retrieve() as response: + async with async_client.organizations.invite.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runner_configurations/test_configuration_schema.py b/tests/api_resources/runner_configurations/test_configuration_schema.py index 5d6a4ff5..c3ec0956 100644 --- a/tests/api_resources/runner_configurations/test_configuration_schema.py +++ b/tests/api_resources/runner_configurations/test_configuration_schema.py @@ -22,19 +22,25 @@ class TestConfigurationSchema: @parametrize def test_method_create(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.create() + configuration_schema = client.runner_configurations.configuration_schema.create( + connect_protocol_version=1, + ) assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: configuration_schema = client.runner_configurations.configuration_schema.create( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runner_configurations.configuration_schema.with_raw_response.create() + response = client.runner_configurations.configuration_schema.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -43,7 +49,9 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runner_configurations.configuration_schema.with_streaming_response.create() as response: + with client.runner_configurations.configuration_schema.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,19 +62,25 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.retrieve() + configuration_schema = client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + ) assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: configuration_schema = client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_configurations.configuration_schema.with_raw_response.retrieve() + response = client.runner_configurations.configuration_schema.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -75,7 +89,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_configurations.configuration_schema.with_streaming_response.retrieve() as response: + with client.runner_configurations.configuration_schema.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,19 +106,25 @@ class TestAsyncConfigurationSchema: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.create() + configuration_schema = await async_client.runner_configurations.configuration_schema.create( + connect_protocol_version=1, + ) assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: configuration_schema = await async_client.runner_configurations.configuration_schema.create( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.configuration_schema.with_raw_response.create() + response = await async_client.runner_configurations.configuration_schema.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -111,7 +133,9 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.configuration_schema.with_streaming_response.create() as response: + async with async_client.runner_configurations.configuration_schema.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -122,19 +146,25 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve() + configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, + ) assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.configuration_schema.with_raw_response.retrieve() + response = await async_client.runner_configurations.configuration_schema.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -143,7 +173,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.configuration_schema.with_streaming_response.retrieve() as response: + async with async_client.runner_configurations.configuration_schema.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runner_configurations/test_environment_classes.py b/tests/api_resources/runner_configurations/test_environment_classes.py index c082c59e..14f6251e 100644 --- a/tests/api_resources/runner_configurations/test_environment_classes.py +++ b/tests/api_resources/runner_configurations/test_environment_classes.py @@ -23,6 +23,16 @@ class TestEnvironmentClasses: def test_method_update_overload_1(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( description="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.update( + description="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -30,6 +40,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.environment_classes.with_raw_response.update( description="xxx", + connect_protocol_version=1, ) assert response.is_closed is True @@ -41,6 +52,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.environment_classes.with_streaming_response.update( description="xxx", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,6 +66,16 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( display_name="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -61,6 +83,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runner_configurations.environment_classes.with_raw_response.update( display_name="xxx", + connect_protocol_version=1, ) assert response.is_closed is True @@ -72,6 +95,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runner_configurations.environment_classes.with_streaming_response.update( display_name="xxx", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -85,6 +109,16 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: def test_method_update_overload_3(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.update( enabled=True, + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + environment_class = client.runner_configurations.environment_classes.update( + enabled=True, + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -92,6 +126,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runner_configurations.environment_classes.with_raw_response.update( enabled=True, + connect_protocol_version=1, ) assert response.is_closed is True @@ -103,6 +138,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runner_configurations.environment_classes.with_streaming_response.update( enabled=True, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -114,23 +150,29 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.list() + environment_class = client.runner_configurations.environment_classes.list( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runner_configurations.environment_classes.list( + connect_protocol_version=1, filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runner_configurations.environment_classes.with_raw_response.list() + response = client.runner_configurations.environment_classes.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -139,7 +181,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runner_configurations.environment_classes.with_streaming_response.list() as response: + with client.runner_configurations.environment_classes.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -156,6 +200,16 @@ class TestAsyncEnvironmentClasses: async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.update( description="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.update( + description="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -163,6 +217,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.environment_classes.with_raw_response.update( description="xxx", + connect_protocol_version=1, ) assert response.is_closed is True @@ -174,6 +229,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.environment_classes.with_streaming_response.update( description="xxx", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -187,6 +243,16 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.update( display_name="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -194,6 +260,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.environment_classes.with_raw_response.update( display_name="xxx", + connect_protocol_version=1, ) assert response.is_closed is True @@ -205,6 +272,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.environment_classes.with_streaming_response.update( display_name="xxx", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -218,6 +286,16 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.update( enabled=True, + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runner_configurations.environment_classes.update( + enabled=True, + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -225,6 +303,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.environment_classes.with_raw_response.update( enabled=True, + connect_protocol_version=1, ) assert response.is_closed is True @@ -236,6 +315,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.environment_classes.with_streaming_response.update( enabled=True, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -247,23 +327,29 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.list() + environment_class = await async_client.runner_configurations.environment_classes.list( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runner_configurations.environment_classes.list( + connect_protocol_version=1, filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.environment_classes.with_raw_response.list() + response = await async_client.runner_configurations.environment_classes.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -272,7 +358,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.environment_classes.with_streaming_response.list() as response: + async with async_client.runner_configurations.environment_classes.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py index 904c020e..baff3306 100644 --- a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runner_configurations/test_host_authentication_tokens.py @@ -24,19 +24,25 @@ class TestHostAuthenticationTokens: @parametrize def test_method_create(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.create() + host_authentication_token = client.runner_configurations.host_authentication_tokens.create( + connect_protocol_version=1, + ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.create( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.create() + response = client.runner_configurations.host_authentication_tokens.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -45,7 +51,9 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.create() as response: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -56,19 +64,25 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve() + host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve() + response = client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -77,7 +91,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,6 +106,16 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -97,6 +123,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, ) assert response.is_closed is True @@ -108,6 +135,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -121,6 +149,16 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( refresh_token="refreshToken", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + refresh_token="refreshToken", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -128,6 +166,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( refresh_token="refreshToken", + connect_protocol_version=1, ) assert response.is_closed is True @@ -139,6 +178,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( refresh_token="refreshToken", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -152,6 +192,16 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: def test_method_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.update( token="x", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + token="x", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -159,6 +209,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( token="x", + connect_protocol_version=1, ) assert response.is_closed is True @@ -170,6 +221,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( token="x", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -181,23 +233,29 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.list() + host_authentication_token = client.runner_configurations.host_authentication_tokens.list( + connect_protocol_version=1, + ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.list( + connect_protocol_version=1, filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.list() + response = client.runner_configurations.host_authentication_tokens.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -206,7 +264,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.list() as response: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -217,19 +277,25 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.delete() + host_authentication_token = client.runner_configurations.host_authentication_tokens.delete( + connect_protocol_version=1, + ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runner_configurations.host_authentication_tokens.delete( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.delete() + response = client.runner_configurations.host_authentication_tokens.with_raw_response.delete( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -238,7 +304,9 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.delete() as response: + with client.runner_configurations.host_authentication_tokens.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -253,19 +321,25 @@ class TestAsyncHostAuthenticationTokens: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create() + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create( + connect_protocol_version=1, + ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.create() + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -274,7 +348,9 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.create() as response: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -285,19 +361,25 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve() + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, + ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve() + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -306,7 +388,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -319,6 +403,16 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -326,6 +420,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, ) assert response.is_closed is True @@ -337,6 +432,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -350,6 +446,16 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( refresh_token="refreshToken", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + refresh_token="refreshToken", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -357,6 +463,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( refresh_token="refreshToken", + connect_protocol_version=1, ) assert response.is_closed is True @@ -368,6 +475,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( refresh_token="refreshToken", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -381,6 +489,16 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( token="x", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + token="x", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -388,6 +506,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( token="x", + connect_protocol_version=1, ) assert response.is_closed is True @@ -399,6 +518,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( token="x", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -410,23 +530,29 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list() + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list( + connect_protocol_version=1, + ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list( + connect_protocol_version=1, filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.list() + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -435,7 +561,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.list() as response: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -446,19 +574,25 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete() + host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete( + connect_protocol_version=1, + ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete( + connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.delete() + response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.delete( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -467,7 +601,9 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.delete() as response: + async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runner_configurations/test_scm_integration.py b/tests/api_resources/runner_configurations/test_scm_integration.py index 17180f31..e83be4b1 100644 --- a/tests/api_resources/runner_configurations/test_scm_integration.py +++ b/tests/api_resources/runner_configurations/test_scm_integration.py @@ -21,6 +21,16 @@ class TestScmIntegration: def test_method_create_overload_1(self, client: Gitpod) -> None: scm_integration = client.runner_configurations.scm_integration.create( oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: + scm_integration = client.runner_configurations.scm_integration.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -28,6 +38,7 @@ def test_method_create_overload_1(self, client: Gitpod) -> None: def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.scm_integration.with_raw_response.create( oauth_client_id="oauthClientId", + connect_protocol_version=1, ) assert response.is_closed is True @@ -39,6 +50,7 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.scm_integration.with_streaming_response.create( oauth_client_id="oauthClientId", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -52,6 +64,16 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: def test_method_create_overload_2(self, client: Gitpod) -> None: scm_integration = client.runner_configurations.scm_integration.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runner_configurations.scm_integration.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -59,6 +81,7 @@ def test_method_create_overload_2(self, client: Gitpod) -> None: def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.runner_configurations.scm_integration.with_raw_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, ) assert response.is_closed is True @@ -70,6 +93,7 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.runner_configurations.scm_integration.with_streaming_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -87,6 +111,16 @@ class TestAsyncScmIntegration: async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runner_configurations.scm_integration.create( oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runner_configurations.scm_integration.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -94,6 +128,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.scm_integration.with_raw_response.create( oauth_client_id="oauthClientId", + connect_protocol_version=1, ) assert response.is_closed is True @@ -105,6 +140,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.scm_integration.with_streaming_response.create( oauth_client_id="oauthClientId", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -118,6 +154,16 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runner_configurations.scm_integration.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runner_configurations.scm_integration.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -125,6 +171,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.scm_integration.with_raw_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, ) assert response.is_closed is True @@ -136,6 +183,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.scm_integration.with_streaming_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index 59d1efdc..410b9adb 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -19,23 +19,29 @@ class TestPolicies: @parametrize def test_method_list(self, client: Gitpod) -> None: - policy = client.runners.policies.list() + policy = client.runners.policies.list( + connect_protocol_version=1, + ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.list( + connect_protocol_version=1, pagination={ "token": "token", "page_size": 100, }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.policies.with_raw_response.list() + response = client.runners.policies.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -44,7 +50,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.policies.with_streaming_response.list() as response: + with client.runners.policies.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -59,23 +67,29 @@ class TestAsyncPolicies: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - policy = await async_client.runners.policies.list() + policy = await async_client.runners.policies.list( + connect_protocol_version=1, + ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( + connect_protocol_version=1, pagination={ "token": "token", "page_size": 100, }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.policies.with_raw_response.list() + response = await async_client.runners.policies.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -84,7 +98,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.policies.with_streaming_response.list() as response: + async with async_client.runners.policies.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_environment_classes.py b/tests/api_resources/test_environment_classes.py index fd172171..8ee23ac0 100644 --- a/tests/api_resources/test_environment_classes.py +++ b/tests/api_resources/test_environment_classes.py @@ -19,23 +19,29 @@ class TestEnvironmentClasses: @parametrize def test_method_list(self, client: Gitpod) -> None: - environment_class = client.environment_classes.list() + environment_class = client.environment_classes.list( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.environment_classes.list( + connect_protocol_version=1, filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environment_classes.with_raw_response.list() + response = client.environment_classes.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -44,7 +50,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environment_classes.with_streaming_response.list() as response: + with client.environment_classes.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -59,23 +67,29 @@ class TestAsyncEnvironmentClasses: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.environment_classes.list() + environment_class = await async_client.environment_classes.list( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.environment_classes.list( + connect_protocol_version=1, filter={"enabled": True}, pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_classes.with_raw_response.list() + response = await async_client.environment_classes.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -84,7 +98,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_classes.with_streaming_response.list() as response: + async with async_client.environment_classes.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 0ece6d79..a949657b 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -24,12 +24,15 @@ class TestEnvironments: @parametrize def test_method_create(self, client: Gitpod) -> None: - environment = client.environments.create() + environment = client.environments.create( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( + connect_protocol_version=1, spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -76,12 +79,15 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "timeout": {"disconnected": "+9125115.360s"}, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.create() + response = client.environments.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,7 +96,9 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.create() as response: + with client.environments.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -101,19 +109,25 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - environment = client.environments.retrieve() + environment = client.environments.retrieve( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment = client.environments.retrieve( + connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.retrieve() + response = client.environments.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -122,7 +136,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.retrieve() as response: + with client.environments.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -133,12 +149,15 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - environment = client.environments.list() + environment = client.environments.list( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( + connect_protocol_version=1, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -151,12 +170,15 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.list() + response = client.environments.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -165,7 +187,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.list() as response: + with client.environments.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -176,12 +200,15 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: - environment = client.environments.create_from_project() + environment = client.environments.create_from_project( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( + connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", @@ -229,12 +256,15 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "timeout": {"disconnected": "+9125115.360s"}, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize def test_raw_response_create_from_project(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.create_from_project() + response = client.environments.with_raw_response.create_from_project( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -243,7 +273,9 @@ def test_raw_response_create_from_project(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_from_project(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.create_from_project() as response: + with client.environments.with_streaming_response.create_from_project( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -254,19 +286,25 @@ def test_streaming_response_create_from_project(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - environment = client.environments.start() + environment = client.environments.start( + connect_protocol_version=1, + ) assert_matches_type(object, environment, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( + connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.start() + response = client.environments.with_raw_response.start( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -275,7 +313,9 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.start() as response: + with client.environments.with_streaming_response.start( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -290,12 +330,15 @@ class TestAsyncEnvironments: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.create() + environment = await async_client.environments.create( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( + connect_protocol_version=1, spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -342,12 +385,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "timeout": {"disconnected": "+9125115.360s"}, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.create() + response = await async_client.environments.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -356,7 +402,9 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.create() as response: + async with async_client.environments.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -367,19 +415,25 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.retrieve() + environment = await async_client.environments.retrieve( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( + connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.retrieve() + response = await async_client.environments.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -388,7 +442,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.retrieve() as response: + async with async_client.environments.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -399,12 +455,15 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.list() + environment = await async_client.environments.list( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( + connect_protocol_version=1, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -417,12 +476,15 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.list() + response = await async_client.environments.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -431,7 +493,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.list() as response: + async with async_client.environments.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -442,12 +506,15 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.create_from_project() + environment = await async_client.environments.create_from_project( + connect_protocol_version=1, + ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( + connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", @@ -495,12 +562,15 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "timeout": {"disconnected": "+9125115.360s"}, }, + connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.create_from_project() + response = await async_client.environments.with_raw_response.create_from_project( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -509,7 +579,9 @@ async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) @parametrize async def test_streaming_response_create_from_project(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.create_from_project() as response: + async with async_client.environments.with_streaming_response.create_from_project( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -520,19 +592,25 @@ async def test_streaming_response_create_from_project(self, async_client: AsyncG @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.start() + environment = await async_client.environments.start( + connect_protocol_version=1, + ) assert_matches_type(object, environment, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( + connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.start() + response = await async_client.environments.with_raw_response.start( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -541,7 +619,9 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.start() as response: + async with async_client.environments.with_streaming_response.start( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index bdd08d3e..ae92d5e8 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -23,19 +23,25 @@ class TestIdentity: @parametrize def test_method_exchange_token(self, client: Gitpod) -> None: - identity = client.identity.exchange_token() + identity = client.identity.exchange_token( + connect_protocol_version=1, + ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.exchange_token( + connect_protocol_version=1, exchange_token="exchangeToken", + connect_timeout_ms=0, ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize def test_raw_response_exchange_token(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.exchange_token() + response = client.identity.with_raw_response.exchange_token( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -44,7 +50,9 @@ def test_raw_response_exchange_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_exchange_token(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.exchange_token() as response: + with client.identity.with_streaming_response.exchange_token( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,6 +65,16 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: def test_method_get_authenticated_identity(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( body={}, + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: + identity = client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -64,6 +82,7 @@ def test_method_get_authenticated_identity(self, client: Gitpod) -> None: def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_authenticated_identity( body={}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -75,6 +94,7 @@ def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_authenticated_identity( body={}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -86,19 +106,25 @@ def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> @parametrize def test_method_get_id_token(self, client: Gitpod) -> None: - identity = client.identity.get_id_token() + identity = client.identity.get_id_token( + connect_protocol_version=1, + ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( + connect_protocol_version=1, audience=["string"], + connect_timeout_ms=0, ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize def test_raw_response_get_id_token(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.get_id_token() + response = client.identity.with_raw_response.get_id_token( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -107,7 +133,9 @@ def test_raw_response_get_id_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_id_token(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.get_id_token() as response: + with client.identity.with_streaming_response.get_id_token( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -122,19 +150,25 @@ class TestAsyncIdentity: @parametrize async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.exchange_token() + identity = await async_client.identity.exchange_token( + connect_protocol_version=1, + ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token( + connect_protocol_version=1, exchange_token="exchangeToken", + connect_timeout_ms=0, ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.exchange_token() + response = await async_client.identity.with_raw_response.exchange_token( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -143,7 +177,9 @@ async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> N @parametrize async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.exchange_token() as response: + async with async_client.identity.with_streaming_response.exchange_token( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -156,6 +192,16 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( body={}, + connect_protocol_version=1, + ) + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_authenticated_identity( + body={}, + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -163,6 +209,7 @@ async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_authenticated_identity( body={}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -174,6 +221,7 @@ async def test_raw_response_get_authenticated_identity(self, async_client: Async async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_authenticated_identity( body={}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -185,19 +233,25 @@ async def test_streaming_response_get_authenticated_identity(self, async_client: @parametrize async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.get_id_token() + identity = await async_client.identity.get_id_token( + connect_protocol_version=1, + ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( + connect_protocol_version=1, audience=["string"], + connect_timeout_ms=0, ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.get_id_token() + response = await async_client.identity.with_raw_response.get_id_token( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -206,7 +260,9 @@ async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> Non @parametrize async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.get_id_token() as response: + async with async_client.identity.with_streaming_response.get_id_token( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 457813ba..58d19c5f 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -21,19 +21,25 @@ class TestOrganizations: @parametrize def test_method_leave(self, client: Gitpod) -> None: - organization = client.organizations.leave() + organization = client.organizations.leave( + connect_protocol_version=1, + ) assert_matches_type(object, organization, path=["response"]) @parametrize def test_method_leave_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.leave( + connect_protocol_version=1, user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.leave() + response = client.organizations.with_raw_response.leave( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -42,7 +48,9 @@ def test_raw_response_leave(self, client: Gitpod) -> None: @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.leave() as response: + with client.organizations.with_streaming_response.leave( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -53,23 +61,29 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: @parametrize def test_method_list_members(self, client: Gitpod) -> None: - organization = client.organizations.list_members() + organization = client.organizations.list_members( + connect_protocol_version=1, + ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( + connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.list_members() + response = client.organizations.with_raw_response.list_members( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -78,7 +92,9 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.list_members() as response: + with client.organizations.with_streaming_response.list_members( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -89,21 +105,27 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: @parametrize def test_method_set_role(self, client: Gitpod) -> None: - organization = client.organizations.set_role() + organization = client.organizations.set_role( + connect_protocol_version=1, + ) assert_matches_type(object, organization, path=["response"]) @parametrize def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( + connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="ORGANIZATION_ROLE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.set_role() + response = client.organizations.with_raw_response.set_role( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -112,7 +134,9 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.set_role() as response: + with client.organizations.with_streaming_response.set_role( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -127,19 +151,25 @@ class TestAsyncOrganizations: @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.leave() + organization = await async_client.organizations.leave( + connect_protocol_version=1, + ) assert_matches_type(object, organization, path=["response"]) @parametrize async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( + connect_protocol_version=1, user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.leave() + response = await async_client.organizations.with_raw_response.leave( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -148,7 +178,9 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.leave() as response: + async with async_client.organizations.with_streaming_response.leave( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -159,23 +191,29 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.list_members() + organization = await async_client.organizations.list_members( + connect_protocol_version=1, + ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( + connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.list_members() + response = await async_client.organizations.with_raw_response.list_members( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -184,7 +222,9 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.list_members() as response: + async with async_client.organizations.with_streaming_response.list_members( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -195,21 +235,27 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.set_role() + organization = await async_client.organizations.set_role( + connect_protocol_version=1, + ) assert_matches_type(object, organization, path=["response"]) @parametrize async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( + connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="ORGANIZATION_ROLE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.set_role() + response = await async_client.organizations.with_raw_response.set_role( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -218,7 +264,9 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.set_role() as response: + async with async_client.organizations.with_streaming_response.set_role( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_personal_access_tokens.py b/tests/api_resources/test_personal_access_tokens.py index 4dfef7c3..734793be 100644 --- a/tests/api_resources/test_personal_access_tokens.py +++ b/tests/api_resources/test_personal_access_tokens.py @@ -21,23 +21,29 @@ class TestPersonalAccessTokens: @parametrize def test_method_list(self, client: Gitpod) -> None: - personal_access_token = client.personal_access_tokens.list() + personal_access_token = client.personal_access_tokens.list( + connect_protocol_version=1, + ) assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: personal_access_token = client.personal_access_tokens.list( + connect_protocol_version=1, filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.personal_access_tokens.with_raw_response.list() + response = client.personal_access_tokens.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -46,7 +52,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.personal_access_tokens.with_streaming_response.list() as response: + with client.personal_access_tokens.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,19 +65,25 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - personal_access_token = client.personal_access_tokens.delete() + personal_access_token = client.personal_access_tokens.delete( + connect_protocol_version=1, + ) assert_matches_type(object, personal_access_token, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: personal_access_token = client.personal_access_tokens.delete( + connect_protocol_version=1, personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, personal_access_token, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.personal_access_tokens.with_raw_response.delete() + response = client.personal_access_tokens.with_raw_response.delete( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -78,7 +92,9 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.personal_access_tokens.with_streaming_response.delete() as response: + with client.personal_access_tokens.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -93,23 +109,29 @@ class TestAsyncPersonalAccessTokens: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - personal_access_token = await async_client.personal_access_tokens.list() + personal_access_token = await async_client.personal_access_tokens.list( + connect_protocol_version=1, + ) assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: personal_access_token = await async_client.personal_access_tokens.list( + connect_protocol_version=1, filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.personal_access_tokens.with_raw_response.list() + response = await async_client.personal_access_tokens.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -118,7 +140,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.personal_access_tokens.with_streaming_response.list() as response: + async with async_client.personal_access_tokens.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -129,19 +153,25 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - personal_access_token = await async_client.personal_access_tokens.delete() + personal_access_token = await async_client.personal_access_tokens.delete( + connect_protocol_version=1, + ) assert_matches_type(object, personal_access_token, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: personal_access_token = await async_client.personal_access_tokens.delete( + connect_protocol_version=1, personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, personal_access_token, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.personal_access_tokens.with_raw_response.delete() + response = await async_client.personal_access_tokens.with_raw_response.delete( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,7 +180,9 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.personal_access_tokens.with_streaming_response.delete() as response: + async with async_client.personal_access_tokens.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 3e675593..5529ac09 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -26,6 +26,7 @@ def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, + connect_protocol_version=1, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -34,9 +35,11 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="x", + connect_timeout_ms=0, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -45,6 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -57,6 +61,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -68,19 +73,25 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - project = client.projects.retrieve() + project = client.projects.retrieve( + connect_protocol_version=1, + ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( + connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.retrieve() + response = client.projects.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -89,7 +100,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.retrieve() as response: + with client.projects.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -100,20 +113,26 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: - project = client.projects.create_from_environment() + project = client.projects.create_from_environment( + connect_protocol_version=1, + ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( + connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name="x", + connect_timeout_ms=0, ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize def test_raw_response_create_from_environment(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.create_from_environment() + response = client.projects.with_raw_response.create_from_environment( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -122,7 +141,9 @@ def test_raw_response_create_from_environment(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_from_environment(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.create_from_environment() as response: + with client.projects.with_streaming_response.create_from_environment( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -140,6 +161,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, + connect_protocol_version=1, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -148,9 +170,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> project = await async_client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="x", + connect_timeout_ms=0, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -159,6 +183,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -171,6 +196,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non async with async_client.projects.with_streaming_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -182,19 +208,25 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.retrieve() + project = await async_client.projects.retrieve( + connect_protocol_version=1, + ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( + connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.retrieve() + response = await async_client.projects.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -203,7 +235,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.retrieve() as response: + async with async_client.projects.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -214,20 +248,26 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.create_from_environment() + project = await async_client.projects.create_from_environment( + connect_protocol_version=1, + ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( + connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name="x", + connect_timeout_ms=0, ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize async def test_raw_response_create_from_environment(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.create_from_environment() + response = await async_client.projects.with_raw_response.create_from_environment( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -236,7 +276,9 @@ async def test_raw_response_create_from_environment(self, async_client: AsyncGit @parametrize async def test_streaming_response_create_from_environment(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.create_from_environment() as response: + async with async_client.projects.with_streaming_response.create_from_environment( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_runner_configurations.py b/tests/api_resources/test_runner_configurations.py index acc9cedf..34570373 100644 --- a/tests/api_resources/test_runner_configurations.py +++ b/tests/api_resources/test_runner_configurations.py @@ -21,6 +21,7 @@ class TestRunnerConfigurations: def test_method_validate_overload_1(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( environment_class={}, + connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -40,7 +41,9 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non "enabled": True, "runner_id": "runnerId", }, + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -48,6 +51,7 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: response = client.runner_configurations.with_raw_response.validate( environment_class={}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -59,6 +63,7 @@ def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: with client.runner_configurations.with_streaming_response.validate( environment_class={}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -72,6 +77,7 @@ def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: def test_method_validate_overload_2(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -79,7 +85,9 @@ def test_method_validate_overload_2(self, client: Gitpod) -> None: def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: runner_configuration = client.runner_configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -87,6 +95,7 @@ def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> Non def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: response = client.runner_configurations.with_raw_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -98,6 +107,7 @@ def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: with client.runner_configurations.with_streaming_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -115,6 +125,7 @@ class TestAsyncRunnerConfigurations: async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( environment_class={}, + connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -134,7 +145,9 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As "enabled": True, "runner_id": "runnerId", }, + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -142,6 +155,7 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.with_raw_response.validate( environment_class={}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -153,6 +167,7 @@ async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.with_streaming_response.validate( environment_class={}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -166,6 +181,7 @@ async def test_streaming_response_validate_overload_1(self, async_client: AsyncG async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -173,7 +189,9 @@ async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> No async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: runner_configuration = await async_client.runner_configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) @@ -181,6 +199,7 @@ async def test_method_validate_with_all_params_overload_2(self, async_client: As async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runner_configurations.with_raw_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -192,6 +211,7 @@ async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runner_configurations.with_streaming_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 3df6d526..ffb4d2b6 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -27,12 +27,15 @@ class TestRunners: @parametrize def test_method_create(self, client: Gitpod) -> None: - runner = client.runners.create() + runner = client.runners.create( + connect_protocol_version=1, + ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( + connect_protocol_version=1, kind="RUNNER_KIND_UNSPECIFIED", name="xxx", spec={ @@ -43,12 +46,15 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, + connect_timeout_ms=0, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.create() + response = client.runners.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,7 +63,9 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.create() as response: + with client.runners.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -68,19 +76,25 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - runner = client.runners.retrieve() + runner = client.runners.retrieve( + connect_protocol_version=1, + ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.retrieve() + response = client.runners.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -89,7 +103,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.retrieve() as response: + with client.runners.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -100,12 +116,15 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - runner = client.runners.list() + runner = client.runners.list( + connect_protocol_version=1, + ) assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list( + connect_protocol_version=1, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "kinds": ["RUNNER_KIND_UNSPECIFIED"], @@ -114,12 +133,15 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.list() + response = client.runners.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -128,7 +150,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.list() as response: + with client.runners.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -139,20 +163,26 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_check_authentication_for_host(self, client: Gitpod) -> None: - runner = client.runners.check_authentication_for_host() + runner = client.runners.check_authentication_for_host( + connect_protocol_version=1, + ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( + connect_protocol_version=1, host="host", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.check_authentication_for_host() + response = client.runners.with_raw_response.check_authentication_for_host( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -161,7 +191,9 @@ def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> Non @parametrize def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.check_authentication_for_host() as response: + with client.runners.with_streaming_response.check_authentication_for_host( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -172,19 +204,25 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: - runner = client.runners.create_runner_token() + runner = client.runners.create_runner_token( + connect_protocol_version=1, + ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize def test_raw_response_create_runner_token(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.create_runner_token() + response = client.runners.with_raw_response.create_runner_token( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -193,7 +231,9 @@ def test_raw_response_create_runner_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.create_runner_token() as response: + with client.runners.with_streaming_response.create_runner_token( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -204,20 +244,26 @@ def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: @parametrize def test_method_delete_runner(self, client: Gitpod) -> None: - runner = client.runners.delete_runner() + runner = client.runners.delete_runner( + connect_protocol_version=1, + ) assert_matches_type(object, runner, path=["response"]) @parametrize def test_method_delete_runner_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete_runner( + connect_protocol_version=1, force=True, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize def test_raw_response_delete_runner(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.delete_runner() + response = client.runners.with_raw_response.delete_runner( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -226,7 +272,9 @@ def test_raw_response_delete_runner(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete_runner(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.delete_runner() as response: + with client.runners.with_streaming_response.delete_runner( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -237,19 +285,25 @@ def test_streaming_response_delete_runner(self, client: Gitpod) -> None: @parametrize def test_method_get_runner(self, client: Gitpod) -> None: - runner = client.runners.get_runner() + runner = client.runners.get_runner( + connect_protocol_version=1, + ) assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) @parametrize def test_method_get_runner_with_all_params(self, client: Gitpod) -> None: runner = client.runners.get_runner( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) @parametrize def test_raw_response_get_runner(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.get_runner() + response = client.runners.with_raw_response.get_runner( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -258,7 +312,9 @@ def test_raw_response_get_runner(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_runner(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.get_runner() as response: + with client.runners.with_streaming_response.get_runner( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -269,20 +325,26 @@ def test_streaming_response_get_runner(self, client: Gitpod) -> None: @parametrize def test_method_parse_context_url(self, client: Gitpod) -> None: - runner = client.runners.parse_context_url() + runner = client.runners.parse_context_url( + connect_protocol_version=1, + ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( + connect_protocol_version=1, context_url="https://example.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize def test_raw_response_parse_context_url(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.parse_context_url() + response = client.runners.with_raw_response.parse_context_url( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -291,7 +353,9 @@ def test_raw_response_parse_context_url(self, client: Gitpod) -> None: @parametrize def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.parse_context_url() as response: + with client.runners.with_streaming_response.parse_context_url( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -304,6 +368,16 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: def test_method_update_runner_overload_1(self, client: Gitpod) -> None: runner = client.runners.update_runner( name="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_method_update_runner_with_all_params_overload_1(self, client: Gitpod) -> None: + runner = client.runners.update_runner( + name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -311,6 +385,7 @@ def test_method_update_runner_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_runner_overload_1(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update_runner( name="xxx", + connect_protocol_version=1, ) assert response.is_closed is True @@ -322,6 +397,7 @@ def test_raw_response_update_runner_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_runner_overload_1(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update_runner( name="xxx", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -335,6 +411,16 @@ def test_streaming_response_update_runner_overload_1(self, client: Gitpod) -> No def test_method_update_runner_overload_2(self, client: Gitpod) -> None: runner = client.runners.update_runner( spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_method_update_runner_with_all_params_overload_2(self, client: Gitpod) -> None: + runner = client.runners.update_runner( + spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -342,6 +428,7 @@ def test_method_update_runner_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_runner_overload_2(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update_runner( spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -353,6 +440,7 @@ def test_raw_response_update_runner_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_runner_overload_2(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update_runner( spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -368,12 +456,15 @@ class TestAsyncRunners: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.create() + runner = await async_client.runners.create( + connect_protocol_version=1, + ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( + connect_protocol_version=1, kind="RUNNER_KIND_UNSPECIFIED", name="xxx", spec={ @@ -384,12 +475,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, + connect_timeout_ms=0, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.create() + response = await async_client.runners.with_raw_response.create( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -398,7 +492,9 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.create() as response: + async with async_client.runners.with_streaming_response.create( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -409,19 +505,25 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.retrieve() + runner = await async_client.runners.retrieve( + connect_protocol_version=1, + ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.retrieve() + response = await async_client.runners.with_raw_response.retrieve( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -430,7 +532,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.retrieve() as response: + async with async_client.runners.with_streaming_response.retrieve( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -441,12 +545,15 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.list() + runner = await async_client.runners.list( + connect_protocol_version=1, + ) assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( + connect_protocol_version=1, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "kinds": ["RUNNER_KIND_UNSPECIFIED"], @@ -455,12 +562,15 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, + connect_timeout_ms=0, ) assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.list() + response = await async_client.runners.with_raw_response.list( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -469,7 +579,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.list() as response: + async with async_client.runners.with_streaming_response.list( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -480,20 +592,26 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.check_authentication_for_host() + runner = await async_client.runners.check_authentication_for_host( + connect_protocol_version=1, + ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( + connect_protocol_version=1, host="host", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.check_authentication_for_host() + response = await async_client.runners.with_raw_response.check_authentication_for_host( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -502,7 +620,9 @@ async def test_raw_response_check_authentication_for_host(self, async_client: As @parametrize async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.check_authentication_for_host() as response: + async with async_client.runners.with_streaming_response.check_authentication_for_host( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -513,19 +633,25 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.create_runner_token() + runner = await async_client.runners.create_runner_token( + connect_protocol_version=1, + ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.create_runner_token() + response = await async_client.runners.with_raw_response.create_runner_token( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -534,7 +660,9 @@ async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) @parametrize async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.create_runner_token() as response: + async with async_client.runners.with_streaming_response.create_runner_token( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -545,20 +673,26 @@ async def test_streaming_response_create_runner_token(self, async_client: AsyncG @parametrize async def test_method_delete_runner(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.delete_runner() + runner = await async_client.runners.delete_runner( + connect_protocol_version=1, + ) assert_matches_type(object, runner, path=["response"]) @parametrize async def test_method_delete_runner_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete_runner( + connect_protocol_version=1, force=True, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize async def test_raw_response_delete_runner(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.delete_runner() + response = await async_client.runners.with_raw_response.delete_runner( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -567,7 +701,9 @@ async def test_raw_response_delete_runner(self, async_client: AsyncGitpod) -> No @parametrize async def test_streaming_response_delete_runner(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.delete_runner() as response: + async with async_client.runners.with_streaming_response.delete_runner( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -578,19 +714,25 @@ async def test_streaming_response_delete_runner(self, async_client: AsyncGitpod) @parametrize async def test_method_get_runner(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.get_runner() + runner = await async_client.runners.get_runner( + connect_protocol_version=1, + ) assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) @parametrize async def test_method_get_runner_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.get_runner( + connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) @parametrize async def test_raw_response_get_runner(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.get_runner() + response = await async_client.runners.with_raw_response.get_runner( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -599,7 +741,9 @@ async def test_raw_response_get_runner(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_get_runner(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.get_runner() as response: + async with async_client.runners.with_streaming_response.get_runner( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -610,20 +754,26 @@ async def test_streaming_response_get_runner(self, async_client: AsyncGitpod) -> @parametrize async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.parse_context_url() + runner = await async_client.runners.parse_context_url( + connect_protocol_version=1, + ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( + connect_protocol_version=1, context_url="https://example.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.parse_context_url() + response = await async_client.runners.with_raw_response.parse_context_url( + connect_protocol_version=1, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -632,7 +782,9 @@ async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.parse_context_url() as response: + async with async_client.runners.with_streaming_response.parse_context_url( + connect_protocol_version=1, + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -645,6 +797,16 @@ async def test_streaming_response_parse_context_url(self, async_client: AsyncGit async def test_method_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update_runner( name="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_method_update_runner_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update_runner( + name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -652,6 +814,7 @@ async def test_method_update_runner_overload_1(self, async_client: AsyncGitpod) async def test_raw_response_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update_runner( name="xxx", + connect_protocol_version=1, ) assert response.is_closed is True @@ -663,6 +826,7 @@ async def test_raw_response_update_runner_overload_1(self, async_client: AsyncGi async def test_streaming_response_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update_runner( name="xxx", + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -676,6 +840,16 @@ async def test_streaming_response_update_runner_overload_1(self, async_client: A async def test_method_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update_runner( spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_method_update_runner_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update_runner( + spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -683,6 +857,7 @@ async def test_method_update_runner_overload_2(self, async_client: AsyncGitpod) async def test_raw_response_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update_runner( spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, ) assert response.is_closed is True @@ -694,6 +869,7 @@ async def test_raw_response_update_runner_overload_2(self, async_client: AsyncGi async def test_streaming_response_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update_runner( spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/conftest.py b/tests/conftest.py index 51e50906..d7bb7fa8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,8 +29,6 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") bearer_token = "My Bearer Token" -connect_protocol_version = 0 -connect_timeout_header = 0 @pytest.fixture(scope="session") @@ -39,13 +37,7 @@ def client(request: FixtureRequest) -> Iterator[Gitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - with Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=strict, - ) as client: + with Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: yield client @@ -55,11 +47,5 @@ async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncGitpod]: if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - async with AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=strict, - ) as client: + async with AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: yield client diff --git a/tests/test_client.py b/tests/test_client.py index f49ffc40..289b035c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -32,8 +32,6 @@ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") bearer_token = "My Bearer Token" -connect_protocol_version = 0 -connect_timeout_header = 0 def _get_params(client: BaseClient[Any, Any]) -> dict[str, str]: @@ -55,13 +53,7 @@ def _get_open_connections(client: Gitpod | AsyncGitpod) -> int: class TestGitpod: - client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) @pytest.mark.respx(base_url=base_url) def test_raw_response(self, respx_mock: MockRouter) -> None: @@ -91,14 +83,6 @@ def test_copy(self) -> None: assert copied.bearer_token == "another My Bearer Token" assert self.client.bearer_token == "My Bearer Token" - copied = self.client.copy(connect_protocol_version=0) - assert copied.connect_protocol_version == 0 - assert self.client.connect_protocol_version == 0 - - copied = self.client.copy(connect_timeout_header=0) - assert copied.connect_timeout_header == 0 - assert self.client.connect_timeout_header == 0 - def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -119,8 +103,6 @@ def test_copy_default_headers(self) -> None: client = Gitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) @@ -156,12 +138,7 @@ def test_copy_default_headers(self) -> None: def test_copy_default_query(self) -> None: client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - default_query={"foo": "bar"}, + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} ) assert _get_params(client)["foo"] == "bar" @@ -286,12 +263,7 @@ def test_request_timeout(self) -> None: def test_client_timeout_option(self) -> None: client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - timeout=httpx.Timeout(0), + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, timeout=httpx.Timeout(0) ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -302,12 +274,7 @@ def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - http_client=http_client, + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -317,12 +284,7 @@ def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - http_client=http_client, + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -332,12 +294,7 @@ def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - http_client=http_client, + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -350,8 +307,6 @@ async def test_invalid_http_client(self) -> None: Gitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=cast(Any, http_client), ) @@ -360,8 +315,6 @@ def test_default_headers_option(self) -> None: client = Gitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) @@ -372,8 +325,6 @@ def test_default_headers_option(self) -> None: client2 = Gitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -388,8 +339,6 @@ def test_default_query_option(self) -> None: client = Gitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_query={"query_param": "bar"}, ) @@ -592,11 +541,7 @@ class Model(BaseModel): def test_base_url_setter(self) -> None: client = Gitpod( - base_url="https://example.com/from_init", - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, + base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True ) assert client.base_url == "https://example.com/from_init/" @@ -606,12 +551,7 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = Gitpod( - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = Gitpod(bearer_token=bearer_token, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( @@ -620,15 +560,11 @@ def test_base_url_env(self) -> None: Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -651,15 +587,11 @@ def test_base_url_trailing_slash(self, client: Gitpod) -> None: Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -682,15 +614,11 @@ def test_base_url_no_trailing_slash(self, client: Gitpod) -> None: Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), Gitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.Client(), ), @@ -708,13 +636,7 @@ def test_absolute_request_url(self, client: Gitpod) -> None: assert request.url == "https://myapi.com/foo" def test_copied_client_does_not_close_http(self) -> None: - client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) assert not client.is_closed() copied = client.copy() @@ -725,13 +647,7 @@ def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() def test_client_context_manager(self) -> None: - client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) with client as c2: assert c2 is client assert not c2.is_closed() @@ -755,8 +671,6 @@ def test_client_max_retries_validation(self) -> None: Gitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, max_retries=cast(Any, None), ) @@ -768,24 +682,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + strict_client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=False, - ) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) response = client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -813,13 +715,7 @@ class Model(BaseModel): ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = Gitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) @@ -884,7 +780,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create() + response = client.runners.with_raw_response.create(connect_protocol_version=1) assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -908,7 +804,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) + response = client.runners.with_raw_response.create( + connect_protocol_version=1, extra_headers={"x-stainless-retry-count": Omit()} + ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -931,19 +829,15 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) + response = client.runners.with_raw_response.create( + connect_protocol_version=1, extra_headers={"x-stainless-retry-count": "42"} + ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" class TestAsyncGitpod: - client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio @@ -975,14 +869,6 @@ def test_copy(self) -> None: assert copied.bearer_token == "another My Bearer Token" assert self.client.bearer_token == "My Bearer Token" - copied = self.client.copy(connect_protocol_version=0) - assert copied.connect_protocol_version == 0 - assert self.client.connect_protocol_version == 0 - - copied = self.client.copy(connect_timeout_header=0) - assert copied.connect_timeout_header == 0 - assert self.client.connect_timeout_header == 0 - def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) @@ -1003,8 +889,6 @@ def test_copy_default_headers(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) @@ -1040,12 +924,7 @@ def test_copy_default_headers(self) -> None: def test_copy_default_query(self) -> None: client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - default_query={"foo": "bar"}, + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} ) assert _get_params(client)["foo"] == "bar" @@ -1170,12 +1049,7 @@ async def test_request_timeout(self) -> None: async def test_client_timeout_option(self) -> None: client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - timeout=httpx.Timeout(0), + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, timeout=httpx.Timeout(0) ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1186,12 +1060,7 @@ async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - http_client=http_client, + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1201,12 +1070,7 @@ async def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - http_client=http_client, + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1216,12 +1080,7 @@ async def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - http_client=http_client, + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1234,8 +1093,6 @@ def test_invalid_http_client(self) -> None: AsyncGitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=cast(Any, http_client), ) @@ -1244,8 +1101,6 @@ def test_default_headers_option(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) @@ -1256,8 +1111,6 @@ def test_default_headers_option(self) -> None: client2 = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_headers={ "X-Foo": "stainless", @@ -1272,8 +1125,6 @@ def test_default_query_option(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, default_query={"query_param": "bar"}, ) @@ -1476,11 +1327,7 @@ class Model(BaseModel): def test_base_url_setter(self) -> None: client = AsyncGitpod( - base_url="https://example.com/from_init", - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, + base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True ) assert client.base_url == "https://example.com/from_init/" @@ -1490,12 +1337,7 @@ def test_base_url_setter(self) -> None: def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): - client = AsyncGitpod( - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = AsyncGitpod(bearer_token=bearer_token, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( @@ -1504,15 +1346,11 @@ def test_base_url_env(self) -> None: AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1535,15 +1373,11 @@ def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1566,15 +1400,11 @@ def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, ), AsyncGitpod( base_url="http://localhost:5000/custom/path/", bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, http_client=httpx.AsyncClient(), ), @@ -1592,13 +1422,7 @@ def test_absolute_request_url(self, client: AsyncGitpod) -> None: assert request.url == "https://myapi.com/foo" async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) assert not client.is_closed() copied = client.copy() @@ -1610,13 +1434,7 @@ async def test_copied_client_does_not_close_http(self) -> None: assert not client.is_closed() async def test_client_context_manager(self) -> None: - client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) async with client as c2: assert c2 is client assert not c2.is_closed() @@ -1641,8 +1459,6 @@ async def test_client_max_retries_validation(self) -> None: AsyncGitpod( base_url=base_url, bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, _strict_response_validation=True, max_retries=cast(Any, None), ) @@ -1655,24 +1471,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + strict_client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=False, - ) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) response = await client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -1701,13 +1505,7 @@ class Model(BaseModel): @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @pytest.mark.asyncio async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = AsyncGitpod( - base_url=base_url, - bearer_token=bearer_token, - connect_protocol_version=connect_protocol_version, - connect_timeout_header=connect_timeout_header, - _strict_response_validation=True, - ) + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) @@ -1773,7 +1571,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create() + response = await client.runners.with_raw_response.create(connect_protocol_version=1) assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -1798,7 +1596,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) + response = await client.runners.with_raw_response.create( + connect_protocol_version=1, extra_headers={"x-stainless-retry-count": Omit()} + ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -1822,7 +1622,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) + response = await client.runners.with_raw_response.create( + connect_protocol_version=1, extra_headers={"x-stainless-retry-count": "42"} + ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" From f4b46fdcda1bd8876f92b312e0ac461e289d03b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:11:15 +0000 Subject: [PATCH 055/505] feat(api): update via SDK Studio --- .stats.yml | 4 +- api.md | 384 +++-- src/gitpod/_client.py | 117 +- src/gitpod/pagination.py | 349 ----- src/gitpod/resources/__init__.py | 138 +- src/gitpod/resources/accounts.py | 681 +++++++++ src/gitpod/resources/editors.py | 544 +++++++ src/gitpod/resources/environments/__init__.py | 14 + .../environments/automations/__init__.py | 26 +- .../environments/automations/automations.py | 96 +- .../environments/automations/services.py | 364 ++++- .../automations/tasks/__init__.py | 33 + .../automations/tasks/executions.py | 517 +++++++ .../automations/{ => tasks}/tasks.py | 200 ++- .../classes.py} | 158 +- .../resources/environments/environments.py | 1125 ++++++++++++-- src/gitpod/resources/events.py | 494 +++++++ src/gitpod/resources/groups.py | 250 ++++ src/gitpod/resources/identity.py | 70 +- .../resources/organizations/__init__.py | 40 +- .../organizations/invite/__init__.py | 33 - .../resources/organizations/invite/invite.py | 351 ----- .../{projects.py => organizations/invites.py} | 334 ++--- .../resources/organizations/organizations.py | 1298 ++++++++++++++-- .../organizations/sso_configurations.py | 1135 ++++++++++++++ .../resources/personal_access_tokens.py | 326 ---- src/gitpod/resources/projects/__init__.py | 33 + .../policies.py} | 489 +++--- src/gitpod/resources/projects/projects.py | 1314 +++++++++++++++++ .../runner_configurations/__init__.py | 75 - .../runner_configurations/scm_integration.py | 333 ----- src/gitpod/resources/runners/__init__.py | 14 + .../runners/configurations/__init__.py | 75 + .../configurations/configurations.py} | 242 ++- .../configurations}/environment_classes.py | 388 ++++- .../host_authentication_tokens.py | 406 ++++- .../configurations/schema.py} | 146 +- .../configurations/scm_integrations.py | 1095 ++++++++++++++ src/gitpod/resources/runners/policies.py | 452 +++++- src/gitpod/resources/runners/runners.py | 686 ++++----- src/gitpod/resources/secrets.py | 925 ++++++++++++ src/gitpod/resources/users/__init__.py | 33 + src/gitpod/resources/users/pats.py | 517 +++++++ .../users.py} | 243 ++- src/gitpod/types/__init__.py | 71 +- ...ner_params.py => account_delete_params.py} | 6 +- .../types/account_get_sso_login_url_params.py | 34 + .../account_get_sso_login_url_response.py | 14 + .../account_list_login_providers_params.py | 34 + .../account_list_login_providers_response.py | 34 + src/gitpod/types/account_retrieve_params.py | 34 + src/gitpod/types/account_retrieve_response.py | 21 + src/gitpod/types/editor_list_params.py | 34 + src/gitpod/types/editor_list_response.py | 45 + src/gitpod/types/editor_resolve_url_params.py | 26 + .../types/editor_resolve_url_response.py | 12 + src/gitpod/types/editor_retrieve_params.py | 34 + src/gitpod/types/editor_retrieve_response.py | 28 + .../types/environment_class_list_params.py | 44 - .../environment_create_from_project_params.py | 18 +- ...nvironment_create_from_project_response.py | 16 +- .../environment_create_logs_token_params.py | 25 + .../environment_create_logs_token_response.py | 16 + src/gitpod/types/environment_create_params.py | 18 +- .../types/environment_create_response.py | 16 +- src/gitpod/types/environment_delete_params.py | 31 + src/gitpod/types/environment_list_params.py | 87 +- src/gitpod/types/environment_list_response.py | 16 +- .../types/environment_mark_active_params.py | 126 ++ .../types/environment_retrieve_params.py | 18 +- .../types/environment_retrieve_response.py | 16 +- src/gitpod/types/environment_stop_params.py | 23 + src/gitpod/types/environment_update_params.py | 301 ++++ src/gitpod/types/environments/__init__.py | 2 + .../environments/automations/__init__.py | 12 +- .../automations/service_create_params.py | 280 ++++ .../automations/service_create_response.py | 325 ++++ .../automations/service_list_params.py | 47 +- .../automations/service_retrieve_params.py | 34 + .../automations/service_retrieve_response.py | 325 ++++ .../automations/task_execution_list_params.py | 61 - ...ion_update_task_execution_status_params.py | 44 - .../automations/task_list_params.py | 47 +- .../automations/task_retrieve_params.py | 17 +- .../automations/task_start_response.py | 36 +- .../automations/tasks/__init__.py | 9 + .../tasks/execution_list_params.py | 34 + .../execution_list_response.py} | 42 +- .../tasks/execution_retrieve_params.py | 34 + .../execution_retrieve_response.py} | 42 +- .../execution_stop_params.py} | 6 +- .../types/environments/class_list_params.py | 34 + .../class_list_response.py} | 4 +- src/gitpod/types/event_list_params.py | 34 + src/gitpod/types/event_list_response.py | 162 ++ src/gitpod/types/event_watch_params.py | 55 + src/gitpod/types/event_watch_response.py | 47 + src/gitpod/types/group_list_params.py | 34 + src/gitpod/types/group_list_response.py | 219 +++ ...ntity_get_authenticated_identity_params.py | 17 +- .../types/organization_create_params.py | 32 + .../types/organization_create_response.py | 332 +++++ .../types/organization_delete_params.py | 20 + src/gitpod/types/organization_join_params.py | 42 + .../types/organization_join_response.py | 129 ++ .../types/organization_list_members_params.py | 35 +- src/gitpod/types/organization_list_params.py | 34 + .../types/organization_list_response.py | 223 +++ .../types/organization_retrieve_params.py | 34 + .../types/organization_retrieve_response.py | 212 +++ .../types/organization_update_params.py | 49 + .../types/organization_update_response.py | 212 +++ src/gitpod/types/organizations/__init__.py | 10 + .../types/organizations/invite/__init__.py | 6 - .../invite_get_summary_params.py | 34 + ...onse.py => invite_get_summary_response.py} | 6 +- .../sso_configuration_create_params.py | 31 + .../sso_configuration_create_response.py | 45 + .../sso_configuration_delete_params.py} | 6 +- .../sso_configuration_list_params.py | 34 + .../sso_configuration_list_response.py | 55 + .../sso_configuration_retrieve_params.py | 34 + .../sso_configuration_retrieve_response.py | 45 + .../sso_configuration_update_params.py | 84 ++ .../personal_access_token_list_params.py | 44 - ...roject_create_from_environment_response.py | 13 +- src/gitpod/types/project_create_params.py | 15 +- src/gitpod/types/project_create_response.py | 13 +- src/gitpod/types/project_delete_params.py | 20 + src/gitpod/types/project_list_params.py | 34 + src/gitpod/types/project_list_response.py | 378 +++++ src/gitpod/types/project_retrieve_params.py | 18 +- src/gitpod/types/project_retrieve_response.py | 13 +- src/gitpod/types/project_update_params.py | 178 +++ src/gitpod/types/project_update_response.py | 366 +++++ src/gitpod/types/projects/__init__.py | 11 + .../types/projects/policy_create_params.py | 25 + .../types/projects/policy_create_response.py | 21 + .../policy_delete_params.py} | 10 +- .../types/projects/policy_list_params.py | 34 + .../types/projects/policy_list_response.py | 31 + .../types/projects/policy_update_params.py | 25 + .../types/projects/policy_update_response.py | 21 + .../runner_configuration_validate_params.py | 123 -- .../configuration_schema_create_response.py | 299 ---- .../environment_class_list_params.py | 44 - .../host_authentication_token_list_params.py | 47 - ...nner_params.py => runner_delete_params.py} | 4 +- src/gitpod/types/runner_list_params.py | 45 +- src/gitpod/types/runner_retrieve_params.py | 17 +- src/gitpod/types/runner_update_params.py | 98 ++ .../types/runner_update_runner_params.py | 90 -- src/gitpod/types/runners/__init__.py | 7 + .../runners/configuration_validate_params.py | 132 ++ .../configuration_validate_response.py} | 6 +- .../configurations}/__init__.py | 18 +- .../environment_class_create_params.py | 32 + .../environment_class_create_response.py | 11 + .../environment_class_list_params.py | 34 + .../environment_class_list_response.py | 2 +- .../environment_class_retrieve_params.py | 34 + .../environment_class_retrieve_response.py | 45 + .../environment_class_update_params.py | 12 +- ...host_authentication_token_create_params.py | 127 ++ ...st_authentication_token_create_response.py | 2 +- ...host_authentication_token_delete_params.py | 2 +- .../host_authentication_token_list_params.py | 34 + ...host_authentication_token_list_response.py | 2 +- ...st_authentication_token_retrieve_params.py | 34 + ..._authentication_token_retrieve_response.py | 2 +- ...host_authentication_token_update_params.py | 12 +- .../configurations/schema_retrieve_params.py | 34 + .../schema_retrieve_response.py} | 126 +- .../scm_integration_create_params.py | 21 +- .../scm_integration_create_response.py | 2 +- .../scm_integration_delete_params.py} | 4 +- .../scm_integration_list_params.py | 34 + .../scm_integration_list_response.py | 54 + .../scm_integration_retrieve_params.py | 34 + .../scm_integration_retrieve_response.py | 28 + .../scm_integration_update_params.py | 80 + .../types/runners/policy_create_params.py | 25 + .../types/runners/policy_create_response.py | 21 + .../policy_delete_params.py} | 8 +- .../types/runners/policy_list_params.py | 35 +- .../types/runners/policy_update_params.py | 25 + .../types/runners/policy_update_response.py | 21 + src/gitpod/types/secret_create_params.py | 67 + src/gitpod/types/secret_create_response.py | 38 + ...eate_params.py => secret_delete_params.py} | 8 +- src/gitpod/types/secret_get_value_params.py | 34 + src/gitpod/types/secret_get_value_response.py | 11 + src/gitpod/types/secret_list_params.py | 34 + src/gitpod/types/secret_list_response.py | 477 ++++++ .../types/secret_update_value_params.py | 22 + .../user_get_authenticated_user_params.py | 34 + .../user_get_authenticated_user_response.py | 129 ++ ...params.py => user_set_suspended_params.py} | 10 +- src/gitpod/types/users/__init__.py | 9 + .../pat_delete_params.py} | 6 +- src/gitpod/types/users/pat_get_params.py | 34 + .../pat_get_response.py} | 131 +- src/gitpod/types/users/pat_list_params.py | 34 + .../pat_list_response.py} | 6 +- .../automations/tasks}/__init__.py | 0 .../automations/tasks/test_executions.py | 293 ++++ .../environments/automations/test_services.py | 265 +++- .../automations/test_task_executions.py | 463 ------ .../environments/automations/test_tasks.py | 52 +- .../test_classes.py} | 72 +- .../{test_invite.py => test_invites.py} | 131 +- .../organizations/test_sso_configurations.py | 812 ++++++++++ .../__init__.py | 0 tests/api_resources/projects/test_policies.py | 370 +++++ .../test_configuration_schema.py | 185 --- .../test_scm_integration.py | 194 --- .../runners/configurations/__init__.py | 1 + .../test_environment_classes.py | 284 +++- .../test_host_authentication_tokens.py | 174 ++- .../configurations/test_schema.py} | 64 +- .../configurations/test_scm_integrations.py | 724 +++++++++ .../test_configurations.py} | 86 +- tests/api_resources/runners/test_policies.py | 282 +++- tests/api_resources/test_accounts.py | 388 +++++ tests/api_resources/test_editors.py | 298 ++++ tests/api_resources/test_environments.py | 562 ++++++- tests/api_resources/test_events.py | 288 ++++ tests/api_resources/test_groups.py | 116 ++ tests/api_resources/test_identity.py | 24 +- tests/api_resources/test_organizations.py | 727 ++++++++- .../test_personal_access_tokens.py | 192 --- tests/api_resources/test_projects.py | 624 +++++++- tests/api_resources/test_runners.py | 495 +++---- tests/api_resources/test_secrets.py | 560 +++++++ tests/api_resources/test_users.py | 198 +++ tests/api_resources/users/__init__.py | 1 + tests/api_resources/users/test_pats.py | 290 ++++ 237 files changed, 28584 insertions(+), 6344 deletions(-) delete mode 100644 src/gitpod/pagination.py create mode 100644 src/gitpod/resources/accounts.py create mode 100644 src/gitpod/resources/editors.py create mode 100644 src/gitpod/resources/environments/automations/tasks/__init__.py create mode 100644 src/gitpod/resources/environments/automations/tasks/executions.py rename src/gitpod/resources/environments/automations/{ => tasks}/tasks.py (81%) rename src/gitpod/resources/{environment_classes.py => environments/classes.py} (55%) create mode 100644 src/gitpod/resources/events.py create mode 100644 src/gitpod/resources/groups.py delete mode 100644 src/gitpod/resources/organizations/invite/__init__.py delete mode 100644 src/gitpod/resources/organizations/invite/invite.py rename src/gitpod/resources/{projects.py => organizations/invites.py} (58%) create mode 100644 src/gitpod/resources/organizations/sso_configurations.py delete mode 100644 src/gitpod/resources/personal_access_tokens.py create mode 100644 src/gitpod/resources/projects/__init__.py rename src/gitpod/resources/{environments/automations/task_executions.py => projects/policies.py} (53%) create mode 100644 src/gitpod/resources/projects/projects.py delete mode 100644 src/gitpod/resources/runner_configurations/__init__.py delete mode 100644 src/gitpod/resources/runner_configurations/scm_integration.py create mode 100644 src/gitpod/resources/runners/configurations/__init__.py rename src/gitpod/resources/{runner_configurations/runner_configurations.py => runners/configurations/configurations.py} (66%) rename src/gitpod/resources/{runner_configurations => runners/configurations}/environment_classes.py (56%) rename src/gitpod/resources/{runner_configurations => runners/configurations}/host_authentication_tokens.py (70%) rename src/gitpod/resources/{organizations/invite/summary.py => runners/configurations/schema.py} (53%) create mode 100644 src/gitpod/resources/runners/configurations/scm_integrations.py create mode 100644 src/gitpod/resources/secrets.py create mode 100644 src/gitpod/resources/users/__init__.py create mode 100644 src/gitpod/resources/users/pats.py rename src/gitpod/resources/{runner_configurations/configuration_schema.py => users/users.py} (53%) rename src/gitpod/types/{runner_get_runner_params.py => account_delete_params.py} (77%) create mode 100644 src/gitpod/types/account_get_sso_login_url_params.py create mode 100644 src/gitpod/types/account_get_sso_login_url_response.py create mode 100644 src/gitpod/types/account_list_login_providers_params.py create mode 100644 src/gitpod/types/account_list_login_providers_response.py create mode 100644 src/gitpod/types/account_retrieve_params.py create mode 100644 src/gitpod/types/account_retrieve_response.py create mode 100644 src/gitpod/types/editor_list_params.py create mode 100644 src/gitpod/types/editor_list_response.py create mode 100644 src/gitpod/types/editor_resolve_url_params.py create mode 100644 src/gitpod/types/editor_resolve_url_response.py create mode 100644 src/gitpod/types/editor_retrieve_params.py create mode 100644 src/gitpod/types/editor_retrieve_response.py delete mode 100644 src/gitpod/types/environment_class_list_params.py create mode 100644 src/gitpod/types/environment_create_logs_token_params.py create mode 100644 src/gitpod/types/environment_create_logs_token_response.py create mode 100644 src/gitpod/types/environment_delete_params.py create mode 100644 src/gitpod/types/environment_mark_active_params.py create mode 100644 src/gitpod/types/environment_stop_params.py create mode 100644 src/gitpod/types/environment_update_params.py create mode 100644 src/gitpod/types/environments/automations/service_create_params.py create mode 100644 src/gitpod/types/environments/automations/service_create_response.py create mode 100644 src/gitpod/types/environments/automations/service_retrieve_params.py create mode 100644 src/gitpod/types/environments/automations/service_retrieve_response.py delete mode 100644 src/gitpod/types/environments/automations/task_execution_list_params.py delete mode 100644 src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py create mode 100644 src/gitpod/types/environments/automations/tasks/__init__.py create mode 100644 src/gitpod/types/environments/automations/tasks/execution_list_params.py rename src/gitpod/types/environments/automations/{task_execution_list_response.py => tasks/execution_list_response.py} (93%) create mode 100644 src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py rename src/gitpod/types/environments/automations/{task_execution_retrieve_response.py => tasks/execution_retrieve_response.py} (93%) rename src/gitpod/types/environments/automations/{task_execution_retrieve_params.py => tasks/execution_stop_params.py} (78%) create mode 100644 src/gitpod/types/environments/class_list_params.py rename src/gitpod/types/{runner_configurations/environment_class_list_response.py => environments/class_list_response.py} (91%) create mode 100644 src/gitpod/types/event_list_params.py create mode 100644 src/gitpod/types/event_list_response.py create mode 100644 src/gitpod/types/event_watch_params.py create mode 100644 src/gitpod/types/event_watch_response.py create mode 100644 src/gitpod/types/group_list_params.py create mode 100644 src/gitpod/types/group_list_response.py create mode 100644 src/gitpod/types/organization_create_params.py create mode 100644 src/gitpod/types/organization_create_response.py create mode 100644 src/gitpod/types/organization_delete_params.py create mode 100644 src/gitpod/types/organization_join_params.py create mode 100644 src/gitpod/types/organization_join_response.py create mode 100644 src/gitpod/types/organization_list_params.py create mode 100644 src/gitpod/types/organization_list_response.py create mode 100644 src/gitpod/types/organization_retrieve_params.py create mode 100644 src/gitpod/types/organization_retrieve_response.py create mode 100644 src/gitpod/types/organization_update_params.py create mode 100644 src/gitpod/types/organization_update_response.py delete mode 100644 src/gitpod/types/organizations/invite/__init__.py create mode 100644 src/gitpod/types/organizations/invite_get_summary_params.py rename src/gitpod/types/organizations/{invite/summary_retrieve_response.py => invite_get_summary_response.py} (79%) create mode 100644 src/gitpod/types/organizations/sso_configuration_create_params.py create mode 100644 src/gitpod/types/organizations/sso_configuration_create_response.py rename src/gitpod/types/{runner_configurations/configuration_schema_create_params.py => organizations/sso_configuration_delete_params.py} (73%) create mode 100644 src/gitpod/types/organizations/sso_configuration_list_params.py create mode 100644 src/gitpod/types/organizations/sso_configuration_list_response.py create mode 100644 src/gitpod/types/organizations/sso_configuration_retrieve_params.py create mode 100644 src/gitpod/types/organizations/sso_configuration_retrieve_response.py create mode 100644 src/gitpod/types/organizations/sso_configuration_update_params.py delete mode 100644 src/gitpod/types/personal_access_token_list_params.py create mode 100644 src/gitpod/types/project_delete_params.py create mode 100644 src/gitpod/types/project_list_params.py create mode 100644 src/gitpod/types/project_list_response.py create mode 100644 src/gitpod/types/project_update_params.py create mode 100644 src/gitpod/types/project_update_response.py create mode 100644 src/gitpod/types/projects/__init__.py create mode 100644 src/gitpod/types/projects/policy_create_params.py create mode 100644 src/gitpod/types/projects/policy_create_response.py rename src/gitpod/types/{runner_configurations/host_authentication_token_retrieve_params.py => projects/policy_delete_params.py} (62%) create mode 100644 src/gitpod/types/projects/policy_list_params.py create mode 100644 src/gitpod/types/projects/policy_list_response.py create mode 100644 src/gitpod/types/projects/policy_update_params.py create mode 100644 src/gitpod/types/projects/policy_update_response.py delete mode 100644 src/gitpod/types/runner_configuration_validate_params.py delete mode 100644 src/gitpod/types/runner_configurations/configuration_schema_create_response.py delete mode 100644 src/gitpod/types/runner_configurations/environment_class_list_params.py delete mode 100644 src/gitpod/types/runner_configurations/host_authentication_token_list_params.py rename src/gitpod/types/{runner_delete_runner_params.py => runner_delete_params.py} (90%) create mode 100644 src/gitpod/types/runner_update_params.py delete mode 100644 src/gitpod/types/runner_update_runner_params.py create mode 100644 src/gitpod/types/runners/configuration_validate_params.py rename src/gitpod/types/{runner_configuration_validate_response.py => runners/configuration_validate_response.py} (92%) rename src/gitpod/types/{runner_configurations => runners/configurations}/__init__.py (58%) create mode 100644 src/gitpod/types/runners/configurations/environment_class_create_params.py create mode 100644 src/gitpod/types/runners/configurations/environment_class_create_response.py create mode 100644 src/gitpod/types/runners/configurations/environment_class_list_params.py rename src/gitpod/types/{ => runners/configurations}/environment_class_list_response.py (98%) create mode 100644 src/gitpod/types/runners/configurations/environment_class_retrieve_params.py create mode 100644 src/gitpod/types/runners/configurations/environment_class_retrieve_response.py rename src/gitpod/types/{runner_configurations => runners/configurations}/environment_class_update_params.py (78%) create mode 100644 src/gitpod/types/runners/configurations/host_authentication_token_create_params.py rename src/gitpod/types/{runner_configurations => runners/configurations}/host_authentication_token_create_response.py (99%) rename src/gitpod/types/{runner_configurations => runners/configurations}/host_authentication_token_delete_params.py (94%) create mode 100644 src/gitpod/types/runners/configurations/host_authentication_token_list_params.py rename src/gitpod/types/{runner_configurations => runners/configurations}/host_authentication_token_list_response.py (99%) create mode 100644 src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py rename src/gitpod/types/{runner_configurations => runners/configurations}/host_authentication_token_retrieve_response.py (99%) rename src/gitpod/types/{runner_configurations => runners/configurations}/host_authentication_token_update_params.py (94%) create mode 100644 src/gitpod/types/runners/configurations/schema_retrieve_params.py rename src/gitpod/types/{runner_configurations/configuration_schema_retrieve_response.py => runners/configurations/schema_retrieve_response.py} (59%) rename src/gitpod/types/{runner_configurations => runners/configurations}/scm_integration_create_params.py (58%) rename src/gitpod/types/{runner_configurations => runners/configurations}/scm_integration_create_response.py (90%) rename src/gitpod/types/{environments/automations/task_execution_stop_params.py => runners/configurations/scm_integration_delete_params.py} (84%) create mode 100644 src/gitpod/types/runners/configurations/scm_integration_list_params.py create mode 100644 src/gitpod/types/runners/configurations/scm_integration_list_response.py create mode 100644 src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py create mode 100644 src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py create mode 100644 src/gitpod/types/runners/configurations/scm_integration_update_params.py create mode 100644 src/gitpod/types/runners/policy_create_params.py create mode 100644 src/gitpod/types/runners/policy_create_response.py rename src/gitpod/types/{runner_configurations/configuration_schema_retrieve_params.py => runners/policy_delete_params.py} (69%) create mode 100644 src/gitpod/types/runners/policy_update_params.py create mode 100644 src/gitpod/types/runners/policy_update_response.py create mode 100644 src/gitpod/types/secret_create_params.py create mode 100644 src/gitpod/types/secret_create_response.py rename src/gitpod/types/{runner_configurations/host_authentication_token_create_params.py => secret_delete_params.py} (72%) create mode 100644 src/gitpod/types/secret_get_value_params.py create mode 100644 src/gitpod/types/secret_get_value_response.py create mode 100644 src/gitpod/types/secret_list_params.py create mode 100644 src/gitpod/types/secret_list_response.py create mode 100644 src/gitpod/types/secret_update_value_params.py create mode 100644 src/gitpod/types/user_get_authenticated_user_params.py create mode 100644 src/gitpod/types/user_get_authenticated_user_response.py rename src/gitpod/types/{organizations/invite/summary_retrieve_params.py => user_set_suspended_params.py} (70%) create mode 100644 src/gitpod/types/users/__init__.py rename src/gitpod/types/{personal_access_token_delete_params.py => users/pat_delete_params.py} (79%) create mode 100644 src/gitpod/types/users/pat_get_params.py rename src/gitpod/types/{runner_get_runner_response.py => users/pat_get_response.py} (76%) create mode 100644 src/gitpod/types/users/pat_list_params.py rename src/gitpod/types/{personal_access_token_list_response.py => users/pat_list_response.py} (98%) rename tests/api_resources/{organizations/invite => environments/automations/tasks}/__init__.py (100%) create mode 100644 tests/api_resources/environments/automations/tasks/test_executions.py delete mode 100644 tests/api_resources/environments/automations/test_task_executions.py rename tests/api_resources/{test_environment_classes.py => environments/test_classes.py} (54%) rename tests/api_resources/organizations/{test_invite.py => test_invites.py} (55%) create mode 100644 tests/api_resources/organizations/test_sso_configurations.py rename tests/api_resources/{runner_configurations => projects}/__init__.py (100%) create mode 100644 tests/api_resources/projects/test_policies.py delete mode 100644 tests/api_resources/runner_configurations/test_configuration_schema.py delete mode 100644 tests/api_resources/runner_configurations/test_scm_integration.py create mode 100644 tests/api_resources/runners/configurations/__init__.py rename tests/api_resources/{runner_configurations => runners/configurations}/test_environment_classes.py (50%) rename tests/api_resources/{runner_configurations => runners/configurations}/test_host_authentication_tokens.py (74%) rename tests/api_resources/{organizations/invite/test_summary.py => runners/configurations/test_schema.py} (54%) create mode 100644 tests/api_resources/runners/configurations/test_scm_integrations.py rename tests/api_resources/{test_runner_configurations.py => runners/test_configurations.py} (63%) create mode 100644 tests/api_resources/test_accounts.py create mode 100644 tests/api_resources/test_editors.py create mode 100644 tests/api_resources/test_events.py create mode 100644 tests/api_resources/test_groups.py delete mode 100644 tests/api_resources/test_personal_access_tokens.py create mode 100644 tests/api_resources/test_secrets.py create mode 100644 tests/api_resources/test_users.py create mode 100644 tests/api_resources/users/__init__.py create mode 100644 tests/api_resources/users/test_pats.py diff --git a/.stats.yml b/.stats.yml index c91205c9..ef35b8b8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 54 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7e374f66c50c3d639f586ea9e146d57787b1b72a9edf1c552ba67ddd5bd4b190.yml +configured_endpoints: 106 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fc48decca7519160b9146df6a972d3a28e692fc1d555d9085e03feb88c196711.yml diff --git a/api.md b/api.md index 17d10f0c..c5d60f2b 100644 --- a/api.md +++ b/api.md @@ -1,20 +1,36 @@ -# Identity +# Accounts Types: ```python from gitpod.types import ( - IdentityExchangeTokenResponse, - IdentityGetAuthenticatedIdentityResponse, - IdentityGetIDTokenResponse, + AccountRetrieveResponse, + AccountDeleteResponse, + AccountGetSSOLoginURLResponse, + AccountListLoginProvidersResponse, ) ``` Methods: -- client.identity.exchange_token(\*\*params) -> IdentityExchangeTokenResponse -- client.identity.get_authenticated_identity(\*\*params) -> IdentityGetAuthenticatedIdentityResponse -- client.identity.get_id_token(\*\*params) -> IdentityGetIDTokenResponse +- client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse +- client.accounts.delete(\*\*params) -> object +- client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse +- client.accounts.list_login_providers(\*\*params) -> AccountListLoginProvidersResponse + +# Editors + +Types: + +```python +from gitpod.types import EditorRetrieveResponse, EditorListResponse, EditorResolveURLResponse +``` + +Methods: + +- client.editors.retrieve(\*\*params) -> EditorRetrieveResponse +- client.editors.list(\*\*params) -> EditorListResponse +- client.editors.resolve_url(\*\*params) -> EditorResolveURLResponse # Environments @@ -24,19 +40,29 @@ Types: from gitpod.types import ( EnvironmentCreateResponse, EnvironmentRetrieveResponse, + EnvironmentUpdateResponse, EnvironmentListResponse, + EnvironmentDeleteResponse, EnvironmentCreateFromProjectResponse, + EnvironmentCreateLogsTokenResponse, + EnvironmentMarkActiveResponse, EnvironmentStartResponse, + EnvironmentStopResponse, ) ``` Methods: - client.environments.create(\*\*params) -> EnvironmentCreateResponse -- client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse -- client.environments.list(\*\*params) -> EnvironmentListResponse +- client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse +- client.environments.update(\*\*params) -> object +- client.environments.list(\*\*params) -> EnvironmentListResponse +- client.environments.delete(\*\*params) -> object - client.environments.create_from_project(\*\*params) -> EnvironmentCreateFromProjectResponse +- client.environments.create_logs_token(\*\*params) -> EnvironmentCreateLogsTokenResponse +- client.environments.mark_active(\*\*params) -> object - client.environments.start(\*\*params) -> object +- client.environments.stop(\*\*params) -> object ## Automations @@ -50,6 +76,32 @@ Methods: - client.environments.automations.upsert(\*\*params) -> AutomationUpsertResponse +### Services + +Types: + +```python +from gitpod.types.environments.automations import ( + ServiceCreateResponse, + ServiceRetrieveResponse, + ServiceUpdateResponse, + ServiceListResponse, + ServiceDeleteResponse, + ServiceStartResponse, + ServiceStopResponse, +) +``` + +Methods: + +- client.environments.automations.services.create(\*\*params) -> ServiceCreateResponse +- client.environments.automations.services.retrieve(\*\*params) -> ServiceRetrieveResponse +- client.environments.automations.services.update(\*\*params) -> object +- client.environments.automations.services.list(\*\*params) -> ServiceListResponse +- client.environments.automations.services.delete(\*\*params) -> object +- client.environments.automations.services.start(\*\*params) -> object +- client.environments.automations.services.stop(\*\*params) -> object + ### Tasks Types: @@ -67,66 +119,85 @@ from gitpod.types.environments.automations import ( Methods: -- client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse -- client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse -- client.environments.automations.tasks.update(\*\*params) -> object -- client.environments.automations.tasks.list(\*\*params) -> TaskListResponse -- client.environments.automations.tasks.delete(\*\*params) -> object -- client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse +- client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse +- client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse +- client.environments.automations.tasks.update(\*\*params) -> object +- client.environments.automations.tasks.list(\*\*params) -> TaskListResponse +- client.environments.automations.tasks.delete(\*\*params) -> object +- client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse -### TaskExecutions +#### Executions Types: ```python -from gitpod.types.environments.automations import ( - TaskExecutionRetrieveResponse, - TaskExecutionListResponse, - TaskExecutionStopResponse, - TaskExecutionUpdateTaskExecutionStatusResponse, +from gitpod.types.environments.automations.tasks import ( + ExecutionRetrieveResponse, + ExecutionListResponse, + ExecutionStopResponse, ) ``` Methods: -- client.environments.automations.task_executions.retrieve(\*\*params) -> TaskExecutionRetrieveResponse -- client.environments.automations.task_executions.list(\*\*params) -> TaskExecutionListResponse -- client.environments.automations.task_executions.stop(\*\*params) -> object -- client.environments.automations.task_executions.update_task_execution_status(\*\*params) -> object +- client.environments.automations.tasks.executions.retrieve(\*\*params) -> ExecutionRetrieveResponse +- client.environments.automations.tasks.executions.list(\*\*params) -> ExecutionListResponse +- client.environments.automations.tasks.executions.stop(\*\*params) -> object -### Services +## Classes Types: ```python -from gitpod.types.environments.automations import ( - ServiceUpdateResponse, - ServiceListResponse, - ServiceDeleteResponse, - ServiceStartResponse, - ServiceStopResponse, -) +from gitpod.types.environments import ClassListResponse ``` Methods: -- client.environments.automations.services.update(\*\*params) -> object -- client.environments.automations.services.list(\*\*params) -> ServiceListResponse -- client.environments.automations.services.delete(\*\*params) -> object -- client.environments.automations.services.start(\*\*params) -> object -- client.environments.automations.services.stop(\*\*params) -> object +- client.environments.classes.list(\*\*params) -> ClassListResponse -# EnvironmentClasses +# Events Types: ```python -from gitpod.types import EnvironmentClassListResponse +from gitpod.types import EventListResponse, EventWatchResponse ``` Methods: -- client.environment_classes.list(\*\*params) -> EnvironmentClassListResponse +- client.events.list(\*\*params) -> EventListResponse +- client.events.watch(\*\*params) -> EventWatchResponse + +# Groups + +Types: + +```python +from gitpod.types import GroupListResponse +``` + +Methods: + +- client.groups.list(\*\*params) -> GroupListResponse + +# Identity + +Types: + +```python +from gitpod.types import ( + IdentityExchangeTokenResponse, + IdentityGetAuthenticatedIdentityResponse, + IdentityGetIDTokenResponse, +) +``` + +Methods: + +- client.identity.exchange_token(\*\*params) -> IdentityExchangeTokenResponse +- client.identity.get_authenticated_identity(\*\*params) -> IdentityGetAuthenticatedIdentityResponse +- client.identity.get_id_token(\*\*params) -> IdentityGetIDTokenResponse # Organizations @@ -134,6 +205,12 @@ Types: ```python from gitpod.types import ( + OrganizationCreateResponse, + OrganizationRetrieveResponse, + OrganizationUpdateResponse, + OrganizationListResponse, + OrganizationDeleteResponse, + OrganizationJoinResponse, OrganizationLeaveResponse, OrganizationListMembersResponse, OrganizationSetRoleResponse, @@ -142,34 +219,55 @@ from gitpod.types import ( Methods: +- client.organizations.create(\*\*params) -> OrganizationCreateResponse +- client.organizations.retrieve(\*\*params) -> OrganizationRetrieveResponse +- client.organizations.update(\*\*params) -> OrganizationUpdateResponse +- client.organizations.list(\*\*params) -> OrganizationListResponse +- client.organizations.delete(\*\*params) -> object +- client.organizations.join(\*\*params) -> OrganizationJoinResponse - client.organizations.leave(\*\*params) -> object -- client.organizations.list_members(\*\*params) -> OrganizationListMembersResponse +- client.organizations.list_members(\*\*params) -> OrganizationListMembersResponse - client.organizations.set_role(\*\*params) -> object -## Invite +## Invites Types: ```python -from gitpod.types.organizations import InviteCreateResponse, InviteRetrieveResponse +from gitpod.types.organizations import ( + InviteCreateResponse, + InviteRetrieveResponse, + InviteGetSummaryResponse, +) ``` Methods: -- client.organizations.invite.create(\*\*params) -> InviteCreateResponse -- client.organizations.invite.retrieve(\*\*params) -> InviteRetrieveResponse +- client.organizations.invites.create(\*\*params) -> InviteCreateResponse +- client.organizations.invites.retrieve(\*\*params) -> InviteRetrieveResponse +- client.organizations.invites.get_summary(\*\*params) -> InviteGetSummaryResponse -### Summary +## SSOConfigurations Types: ```python -from gitpod.types.organizations.invite import SummaryRetrieveResponse +from gitpod.types.organizations import ( + SSOConfigurationCreateResponse, + SSOConfigurationRetrieveResponse, + SSOConfigurationUpdateResponse, + SSOConfigurationListResponse, + SSOConfigurationDeleteResponse, +) ``` Methods: -- client.organizations.invite.summary.retrieve(\*\*params) -> SummaryRetrieveResponse +- client.organizations.sso_configurations.create(\*\*params) -> SSOConfigurationCreateResponse +- client.organizations.sso_configurations.retrieve(\*\*params) -> SSOConfigurationRetrieveResponse +- client.organizations.sso_configurations.update(\*\*params) -> object +- client.organizations.sso_configurations.list(\*\*params) -> SSOConfigurationListResponse +- client.organizations.sso_configurations.delete(\*\*params) -> object # Projects @@ -179,34 +277,108 @@ Types: from gitpod.types import ( ProjectCreateResponse, ProjectRetrieveResponse, + ProjectUpdateResponse, + ProjectListResponse, + ProjectDeleteResponse, ProjectCreateFromEnvironmentResponse, ) ``` Methods: -- client.projects.create(\*\*params) -> ProjectCreateResponse -- client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse -- client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse +- client.projects.create(\*\*params) -> ProjectCreateResponse +- client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse +- client.projects.update(\*\*params) -> ProjectUpdateResponse +- client.projects.list(\*\*params) -> ProjectListResponse +- client.projects.delete(\*\*params) -> object +- client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse -# RunnerConfigurations +## Policies Types: ```python -from gitpod.types import RunnerConfigurationValidateResponse +from gitpod.types.projects import ( + PolicyCreateResponse, + PolicyUpdateResponse, + PolicyListResponse, + PolicyDeleteResponse, +) ``` Methods: -- client.runner_configurations.validate(\*\*params) -> RunnerConfigurationValidateResponse +- client.projects.policies.create(\*\*params) -> PolicyCreateResponse +- client.projects.policies.update(\*\*params) -> PolicyUpdateResponse +- client.projects.policies.list(\*\*params) -> PolicyListResponse +- client.projects.policies.delete(\*\*params) -> object -## HostAuthenticationTokens +# Runners Types: ```python -from gitpod.types.runner_configurations import ( +from gitpod.types import ( + RunnerCreateResponse, + RunnerRetrieveResponse, + RunnerUpdateResponse, + RunnerListResponse, + RunnerDeleteResponse, + RunnerCheckAuthenticationForHostResponse, + RunnerCreateRunnerTokenResponse, + RunnerParseContextURLResponse, +) +``` + +Methods: + +- client.runners.create(\*\*params) -> RunnerCreateResponse +- client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse +- client.runners.update(\*\*params) -> object +- client.runners.list(\*\*params) -> RunnerListResponse +- client.runners.delete(\*\*params) -> object +- client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse +- client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse +- client.runners.parse_context_url(\*\*params) -> RunnerParseContextURLResponse + +## Configurations + +Types: + +```python +from gitpod.types.runners import ConfigurationValidateResponse +``` + +Methods: + +- client.runners.configurations.validate(\*\*params) -> ConfigurationValidateResponse + +### EnvironmentClasses + +Types: + +```python +from gitpod.types.runners.configurations import ( + EnvironmentClassCreateResponse, + EnvironmentClassRetrieveResponse, + EnvironmentClassUpdateResponse, + EnvironmentClassListResponse, +) +``` + +Methods: + +- client.runners.configurations.environment_classes.create(\*\*params) -> EnvironmentClassCreateResponse +- client.runners.configurations.environment_classes.retrieve(\*\*params) -> EnvironmentClassRetrieveResponse +- client.runners.configurations.environment_classes.update(\*\*params) -> object +- client.runners.configurations.environment_classes.list(\*\*params) -> EnvironmentClassListResponse + +### HostAuthenticationTokens + +Types: + +```python +from gitpod.types.runners.configurations import ( HostAuthenticationTokenCreateResponse, HostAuthenticationTokenRetrieveResponse, HostAuthenticationTokenUpdateResponse, @@ -217,107 +389,111 @@ from gitpod.types.runner_configurations import ( Methods: -- client.runner_configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse -- client.runner_configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse -- client.runner_configurations.host_authentication_tokens.update(\*\*params) -> object -- client.runner_configurations.host_authentication_tokens.list(\*\*params) -> HostAuthenticationTokenListResponse -- client.runner_configurations.host_authentication_tokens.delete(\*\*params) -> object +- client.runners.configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse +- client.runners.configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse +- client.runners.configurations.host_authentication_tokens.update(\*\*params) -> object +- client.runners.configurations.host_authentication_tokens.list(\*\*params) -> HostAuthenticationTokenListResponse +- client.runners.configurations.host_authentication_tokens.delete(\*\*params) -> object -## ConfigurationSchema +### Schema Types: ```python -from gitpod.types.runner_configurations import ( - ConfigurationSchemaCreateResponse, - ConfigurationSchemaRetrieveResponse, -) +from gitpod.types.runners.configurations import SchemaRetrieveResponse ``` Methods: -- client.runner_configurations.configuration_schema.create(\*\*params) -> ConfigurationSchemaCreateResponse -- client.runner_configurations.configuration_schema.retrieve(\*\*params) -> ConfigurationSchemaRetrieveResponse +- client.runners.configurations.schema.retrieve(\*\*params) -> SchemaRetrieveResponse -## ScmIntegration +### ScmIntegrations Types: ```python -from gitpod.types.runner_configurations import ScmIntegrationCreateResponse +from gitpod.types.runners.configurations import ( + ScmIntegrationCreateResponse, + ScmIntegrationRetrieveResponse, + ScmIntegrationUpdateResponse, + ScmIntegrationListResponse, + ScmIntegrationDeleteResponse, +) ``` Methods: -- client.runner_configurations.scm_integration.create(\*\*params) -> ScmIntegrationCreateResponse +- client.runners.configurations.scm_integrations.create(\*\*params) -> ScmIntegrationCreateResponse +- client.runners.configurations.scm_integrations.retrieve(\*\*params) -> ScmIntegrationRetrieveResponse +- client.runners.configurations.scm_integrations.update(\*\*params) -> object +- client.runners.configurations.scm_integrations.list(\*\*params) -> ScmIntegrationListResponse +- client.runners.configurations.scm_integrations.delete(\*\*params) -> object -## EnvironmentClasses +## Policies Types: ```python -from gitpod.types.runner_configurations import ( - EnvironmentClassUpdateResponse, - EnvironmentClassListResponse, +from gitpod.types.runners import ( + PolicyCreateResponse, + PolicyUpdateResponse, + PolicyListResponse, + PolicyDeleteResponse, ) ``` Methods: -- client.runner_configurations.environment_classes.update(\*\*params) -> object -- client.runner_configurations.environment_classes.list(\*\*params) -> EnvironmentClassListResponse +- client.runners.policies.create(\*\*params) -> PolicyCreateResponse +- client.runners.policies.update(\*\*params) -> PolicyUpdateResponse +- client.runners.policies.list(\*\*params) -> PolicyListResponse +- client.runners.policies.delete(\*\*params) -> object -# Runners +# Secrets Types: ```python from gitpod.types import ( - RunnerCreateResponse, - RunnerRetrieveResponse, - RunnerListResponse, - RunnerCheckAuthenticationForHostResponse, - RunnerCreateRunnerTokenResponse, - RunnerDeleteRunnerResponse, - RunnerGetRunnerResponse, - RunnerParseContextURLResponse, - RunnerUpdateRunnerResponse, + SecretCreateResponse, + SecretListResponse, + SecretDeleteResponse, + SecretGetValueResponse, + SecretUpdateValueResponse, ) ``` Methods: -- client.runners.create(\*\*params) -> RunnerCreateResponse -- client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse -- client.runners.list(\*\*params) -> RunnerListResponse -- client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse -- client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse -- client.runners.delete_runner(\*\*params) -> object -- client.runners.get_runner(\*\*params) -> RunnerGetRunnerResponse -- client.runners.parse_context_url(\*\*params) -> RunnerParseContextURLResponse -- client.runners.update_runner(\*\*params) -> object +- client.secrets.create(\*\*params) -> SecretCreateResponse +- client.secrets.list(\*\*params) -> SecretListResponse +- client.secrets.delete(\*\*params) -> object +- client.secrets.get_value(\*\*params) -> SecretGetValueResponse +- client.secrets.update_value(\*\*params) -> object -## Policies +# Users Types: ```python -from gitpod.types.runners import PolicyListResponse +from gitpod.types import UserGetAuthenticatedUserResponse, UserSetSuspendedResponse ``` Methods: -- client.runners.policies.list(\*\*params) -> PolicyListResponse +- client.users.get_authenticated_user(\*\*params) -> UserGetAuthenticatedUserResponse +- client.users.set_suspended(\*\*params) -> object -# PersonalAccessTokens +## Pats Types: ```python -from gitpod.types import PersonalAccessTokenListResponse, PersonalAccessTokenDeleteResponse +from gitpod.types.users import PatListResponse, PatDeleteResponse, PatGetResponse ``` Methods: -- client.personal_access_tokens.list(\*\*params) -> PersonalAccessTokenListResponse -- client.personal_access_tokens.delete(\*\*params) -> object +- client.users.pats.list(\*\*params) -> PatListResponse +- client.users.pats.delete(\*\*params) -> object +- client.users.pats.get(\*\*params) -> PatGetResponse diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 6501485a..3fad133c 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -24,7 +24,7 @@ get_async_library, ) from ._version import __version__ -from .resources import identity, projects, environment_classes, personal_access_tokens +from .resources import events, groups, editors, secrets, accounts, identity from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import GitpodError, APIStatusError from ._base_client import ( @@ -32,23 +32,27 @@ SyncAPIClient, AsyncAPIClient, ) +from .resources.users import users from .resources.runners import runners +from .resources.projects import projects from .resources.environments import environments from .resources.organizations import organizations -from .resources.runner_configurations import runner_configurations __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gitpod", "AsyncGitpod", "Client", "AsyncClient"] class Gitpod(SyncAPIClient): - identity: identity.IdentityResource + accounts: accounts.AccountsResource + editors: editors.EditorsResource environments: environments.EnvironmentsResource - environment_classes: environment_classes.EnvironmentClassesResource + events: events.EventsResource + groups: groups.GroupsResource + identity: identity.IdentityResource organizations: organizations.OrganizationsResource projects: projects.ProjectsResource - runner_configurations: runner_configurations.RunnerConfigurationsResource runners: runners.RunnersResource - personal_access_tokens: personal_access_tokens.PersonalAccessTokensResource + secrets: secrets.SecretsResource + users: users.UsersResource with_raw_response: GitpodWithRawResponse with_streaming_response: GitpodWithStreamedResponse @@ -106,14 +110,17 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.identity = identity.IdentityResource(self) + self.accounts = accounts.AccountsResource(self) + self.editors = editors.EditorsResource(self) self.environments = environments.EnvironmentsResource(self) - self.environment_classes = environment_classes.EnvironmentClassesResource(self) + self.events = events.EventsResource(self) + self.groups = groups.GroupsResource(self) + self.identity = identity.IdentityResource(self) self.organizations = organizations.OrganizationsResource(self) self.projects = projects.ProjectsResource(self) - self.runner_configurations = runner_configurations.RunnerConfigurationsResource(self) self.runners = runners.RunnersResource(self) - self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResource(self) + self.secrets = secrets.SecretsResource(self) + self.users = users.UsersResource(self) self.with_raw_response = GitpodWithRawResponse(self) self.with_streaming_response = GitpodWithStreamedResponse(self) @@ -223,14 +230,17 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): - identity: identity.AsyncIdentityResource + accounts: accounts.AsyncAccountsResource + editors: editors.AsyncEditorsResource environments: environments.AsyncEnvironmentsResource - environment_classes: environment_classes.AsyncEnvironmentClassesResource + events: events.AsyncEventsResource + groups: groups.AsyncGroupsResource + identity: identity.AsyncIdentityResource organizations: organizations.AsyncOrganizationsResource projects: projects.AsyncProjectsResource - runner_configurations: runner_configurations.AsyncRunnerConfigurationsResource runners: runners.AsyncRunnersResource - personal_access_tokens: personal_access_tokens.AsyncPersonalAccessTokensResource + secrets: secrets.AsyncSecretsResource + users: users.AsyncUsersResource with_raw_response: AsyncGitpodWithRawResponse with_streaming_response: AsyncGitpodWithStreamedResponse @@ -288,14 +298,17 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.identity = identity.AsyncIdentityResource(self) + self.accounts = accounts.AsyncAccountsResource(self) + self.editors = editors.AsyncEditorsResource(self) self.environments = environments.AsyncEnvironmentsResource(self) - self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self) + self.events = events.AsyncEventsResource(self) + self.groups = groups.AsyncGroupsResource(self) + self.identity = identity.AsyncIdentityResource(self) self.organizations = organizations.AsyncOrganizationsResource(self) self.projects = projects.AsyncProjectsResource(self) - self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResource(self) self.runners = runners.AsyncRunnersResource(self) - self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResource(self) + self.secrets = secrets.AsyncSecretsResource(self) + self.users = users.AsyncUsersResource(self) self.with_raw_response = AsyncGitpodWithRawResponse(self) self.with_streaming_response = AsyncGitpodWithStreamedResponse(self) @@ -406,74 +419,62 @@ def _make_status_error( class GitpodWithRawResponse: def __init__(self, client: Gitpod) -> None: - self.identity = identity.IdentityResourceWithRawResponse(client.identity) + self.accounts = accounts.AccountsResourceWithRawResponse(client.accounts) + self.editors = editors.EditorsResourceWithRawResponse(client.editors) self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) - self.environment_classes = environment_classes.EnvironmentClassesResourceWithRawResponse( - client.environment_classes - ) + self.events = events.EventsResourceWithRawResponse(client.events) + self.groups = groups.GroupsResourceWithRawResponse(client.groups) + self.identity = identity.IdentityResourceWithRawResponse(client.identity) self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations) self.projects = projects.ProjectsResourceWithRawResponse(client.projects) - self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithRawResponse( - client.runner_configurations - ) self.runners = runners.RunnersResourceWithRawResponse(client.runners) - self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithRawResponse( - client.personal_access_tokens - ) + self.secrets = secrets.SecretsResourceWithRawResponse(client.secrets) + self.users = users.UsersResourceWithRawResponse(client.users) class AsyncGitpodWithRawResponse: def __init__(self, client: AsyncGitpod) -> None: - self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity) + self.accounts = accounts.AsyncAccountsResourceWithRawResponse(client.accounts) + self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) - self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithRawResponse( - client.environment_classes - ) + self.events = events.AsyncEventsResourceWithRawResponse(client.events) + self.groups = groups.AsyncGroupsResourceWithRawResponse(client.groups) + self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity) self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations) self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) - self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithRawResponse( - client.runner_configurations - ) self.runners = runners.AsyncRunnersResourceWithRawResponse(client.runners) - self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithRawResponse( - client.personal_access_tokens - ) + self.secrets = secrets.AsyncSecretsResourceWithRawResponse(client.secrets) + self.users = users.AsyncUsersResourceWithRawResponse(client.users) class GitpodWithStreamedResponse: def __init__(self, client: Gitpod) -> None: - self.identity = identity.IdentityResourceWithStreamingResponse(client.identity) + self.accounts = accounts.AccountsResourceWithStreamingResponse(client.accounts) + self.editors = editors.EditorsResourceWithStreamingResponse(client.editors) self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) - self.environment_classes = environment_classes.EnvironmentClassesResourceWithStreamingResponse( - client.environment_classes - ) + self.events = events.EventsResourceWithStreamingResponse(client.events) + self.groups = groups.GroupsResourceWithStreamingResponse(client.groups) + self.identity = identity.IdentityResourceWithStreamingResponse(client.identity) self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations) self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) - self.runner_configurations = runner_configurations.RunnerConfigurationsResourceWithStreamingResponse( - client.runner_configurations - ) self.runners = runners.RunnersResourceWithStreamingResponse(client.runners) - self.personal_access_tokens = personal_access_tokens.PersonalAccessTokensResourceWithStreamingResponse( - client.personal_access_tokens - ) + self.secrets = secrets.SecretsResourceWithStreamingResponse(client.secrets) + self.users = users.UsersResourceWithStreamingResponse(client.users) class AsyncGitpodWithStreamedResponse: def __init__(self, client: AsyncGitpod) -> None: - self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity) + self.accounts = accounts.AsyncAccountsResourceWithStreamingResponse(client.accounts) + self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) - self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithStreamingResponse( - client.environment_classes - ) + self.events = events.AsyncEventsResourceWithStreamingResponse(client.events) + self.groups = groups.AsyncGroupsResourceWithStreamingResponse(client.groups) + self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity) self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) - self.runner_configurations = runner_configurations.AsyncRunnerConfigurationsResourceWithStreamingResponse( - client.runner_configurations - ) self.runners = runners.AsyncRunnersResourceWithStreamingResponse(client.runners) - self.personal_access_tokens = personal_access_tokens.AsyncPersonalAccessTokensResourceWithStreamingResponse( - client.personal_access_tokens - ) + self.secrets = secrets.AsyncSecretsResourceWithStreamingResponse(client.secrets) + self.users = users.AsyncUsersResourceWithStreamingResponse(client.users) Client = Gitpod diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py deleted file mode 100644 index f3baede5..00000000 --- a/src/gitpod/pagination.py +++ /dev/null @@ -1,349 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Generic, TypeVar, Optional -from typing_extensions import override - -from pydantic import Field as FieldInfo - -from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage - -__all__ = [ - "SyncServicesPage", - "AsyncServicesPage", - "SyncTasksPage", - "AsyncTasksPage", - "SyncTaskExecutionsPage", - "AsyncTaskExecutionsPage", - "SyncEnvironnmentClassesPage", - "AsyncEnvironnmentClassesPage", - "SyncEnvironmentsPage", - "AsyncEnvironmentsPage", - "SyncEntriesPage", - "AsyncEntriesPage", - "SyncGroupsPage", - "AsyncGroupsPage", - "SyncMembersPage", - "AsyncMembersPage", -] - -_T = TypeVar("_T") - - -class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - services = self.services - if not services: - return [] - return services - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - services = self.services - if not services: - return [] - return services - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - tasks = self.tasks - if not tasks: - return [] - return tasks - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - tasks = self.tasks - if not tasks: - return [] - return tasks - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] = FieldInfo(alias="taskExecutions") - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions - if not task_executions: - return [] - return task_executions - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] = FieldInfo(alias="taskExecutions") - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions - if not task_executions: - return [] - return task_executions - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class SyncEnvironnmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] = FieldInfo(alias="environmentClasses") - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes - if not environment_classes: - return [] - return environment_classes - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncEnvironnmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] = FieldInfo(alias="environmentClasses") - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes - if not environment_classes: - return [] - return environment_classes - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environments: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - environments = self.environments - if not environments: - return [] - return environments - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncEnvironmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environments: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - environments = self.environments - if not environments: - return [] - return environments - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - entries: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - entries = self.entries - if not entries: - return [] - return entries - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncEntriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - entries: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - entries = self.entries - if not entries: - return [] - return entries - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - groups: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - groups = self.groups - if not groups: - return [] - return groups - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncGroupsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - groups: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - groups = self.groups - if not groups: - return [] - return groups - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - members = self.members - if not members: - return [] - return members - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - members = self.members - if not members: - return [] - return members - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index a132d983..1e169c21 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -1,5 +1,37 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .users import ( + UsersResource, + AsyncUsersResource, + UsersResourceWithRawResponse, + AsyncUsersResourceWithRawResponse, + UsersResourceWithStreamingResponse, + AsyncUsersResourceWithStreamingResponse, +) +from .events import ( + EventsResource, + AsyncEventsResource, + EventsResourceWithRawResponse, + AsyncEventsResourceWithRawResponse, + EventsResourceWithStreamingResponse, + AsyncEventsResourceWithStreamingResponse, +) +from .groups import ( + GroupsResource, + AsyncGroupsResource, + GroupsResourceWithRawResponse, + AsyncGroupsResourceWithRawResponse, + GroupsResourceWithStreamingResponse, + AsyncGroupsResourceWithStreamingResponse, +) +from .editors import ( + EditorsResource, + AsyncEditorsResource, + EditorsResourceWithRawResponse, + AsyncEditorsResourceWithRawResponse, + EditorsResourceWithStreamingResponse, + AsyncEditorsResourceWithStreamingResponse, +) from .runners import ( RunnersResource, AsyncRunnersResource, @@ -8,6 +40,22 @@ RunnersResourceWithStreamingResponse, AsyncRunnersResourceWithStreamingResponse, ) +from .secrets import ( + SecretsResource, + AsyncSecretsResource, + SecretsResourceWithRawResponse, + AsyncSecretsResourceWithRawResponse, + SecretsResourceWithStreamingResponse, + AsyncSecretsResourceWithStreamingResponse, +) +from .accounts import ( + AccountsResource, + AsyncAccountsResource, + AccountsResourceWithRawResponse, + AsyncAccountsResourceWithRawResponse, + AccountsResourceWithStreamingResponse, + AsyncAccountsResourceWithStreamingResponse, +) from .identity import ( IdentityResource, AsyncIdentityResource, @@ -40,50 +88,44 @@ OrganizationsResourceWithStreamingResponse, AsyncOrganizationsResourceWithStreamingResponse, ) -from .environment_classes import ( - EnvironmentClassesResource, - AsyncEnvironmentClassesResource, - EnvironmentClassesResourceWithRawResponse, - AsyncEnvironmentClassesResourceWithRawResponse, - EnvironmentClassesResourceWithStreamingResponse, - AsyncEnvironmentClassesResourceWithStreamingResponse, -) -from .runner_configurations import ( - RunnerConfigurationsResource, - AsyncRunnerConfigurationsResource, - RunnerConfigurationsResourceWithRawResponse, - AsyncRunnerConfigurationsResourceWithRawResponse, - RunnerConfigurationsResourceWithStreamingResponse, - AsyncRunnerConfigurationsResourceWithStreamingResponse, -) -from .personal_access_tokens import ( - PersonalAccessTokensResource, - AsyncPersonalAccessTokensResource, - PersonalAccessTokensResourceWithRawResponse, - AsyncPersonalAccessTokensResourceWithRawResponse, - PersonalAccessTokensResourceWithStreamingResponse, - AsyncPersonalAccessTokensResourceWithStreamingResponse, -) __all__ = [ - "IdentityResource", - "AsyncIdentityResource", - "IdentityResourceWithRawResponse", - "AsyncIdentityResourceWithRawResponse", - "IdentityResourceWithStreamingResponse", - "AsyncIdentityResourceWithStreamingResponse", + "AccountsResource", + "AsyncAccountsResource", + "AccountsResourceWithRawResponse", + "AsyncAccountsResourceWithRawResponse", + "AccountsResourceWithStreamingResponse", + "AsyncAccountsResourceWithStreamingResponse", + "EditorsResource", + "AsyncEditorsResource", + "EditorsResourceWithRawResponse", + "AsyncEditorsResourceWithRawResponse", + "EditorsResourceWithStreamingResponse", + "AsyncEditorsResourceWithStreamingResponse", "EnvironmentsResource", "AsyncEnvironmentsResource", "EnvironmentsResourceWithRawResponse", "AsyncEnvironmentsResourceWithRawResponse", "EnvironmentsResourceWithStreamingResponse", "AsyncEnvironmentsResourceWithStreamingResponse", - "EnvironmentClassesResource", - "AsyncEnvironmentClassesResource", - "EnvironmentClassesResourceWithRawResponse", - "AsyncEnvironmentClassesResourceWithRawResponse", - "EnvironmentClassesResourceWithStreamingResponse", - "AsyncEnvironmentClassesResourceWithStreamingResponse", + "EventsResource", + "AsyncEventsResource", + "EventsResourceWithRawResponse", + "AsyncEventsResourceWithRawResponse", + "EventsResourceWithStreamingResponse", + "AsyncEventsResourceWithStreamingResponse", + "GroupsResource", + "AsyncGroupsResource", + "GroupsResourceWithRawResponse", + "AsyncGroupsResourceWithRawResponse", + "GroupsResourceWithStreamingResponse", + "AsyncGroupsResourceWithStreamingResponse", + "IdentityResource", + "AsyncIdentityResource", + "IdentityResourceWithRawResponse", + "AsyncIdentityResourceWithRawResponse", + "IdentityResourceWithStreamingResponse", + "AsyncIdentityResourceWithStreamingResponse", "OrganizationsResource", "AsyncOrganizationsResource", "OrganizationsResourceWithRawResponse", @@ -96,22 +138,22 @@ "AsyncProjectsResourceWithRawResponse", "ProjectsResourceWithStreamingResponse", "AsyncProjectsResourceWithStreamingResponse", - "RunnerConfigurationsResource", - "AsyncRunnerConfigurationsResource", - "RunnerConfigurationsResourceWithRawResponse", - "AsyncRunnerConfigurationsResourceWithRawResponse", - "RunnerConfigurationsResourceWithStreamingResponse", - "AsyncRunnerConfigurationsResourceWithStreamingResponse", "RunnersResource", "AsyncRunnersResource", "RunnersResourceWithRawResponse", "AsyncRunnersResourceWithRawResponse", "RunnersResourceWithStreamingResponse", "AsyncRunnersResourceWithStreamingResponse", - "PersonalAccessTokensResource", - "AsyncPersonalAccessTokensResource", - "PersonalAccessTokensResourceWithRawResponse", - "AsyncPersonalAccessTokensResourceWithRawResponse", - "PersonalAccessTokensResourceWithStreamingResponse", - "AsyncPersonalAccessTokensResourceWithStreamingResponse", + "SecretsResource", + "AsyncSecretsResource", + "SecretsResourceWithRawResponse", + "AsyncSecretsResourceWithRawResponse", + "SecretsResourceWithStreamingResponse", + "AsyncSecretsResourceWithStreamingResponse", + "UsersResource", + "AsyncUsersResource", + "UsersResourceWithRawResponse", + "AsyncUsersResourceWithRawResponse", + "UsersResourceWithStreamingResponse", + "AsyncUsersResourceWithStreamingResponse", ] diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py new file mode 100644 index 00000000..a81cb701 --- /dev/null +++ b/src/gitpod/resources/accounts.py @@ -0,0 +1,681 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..types import ( + account_delete_params, + account_retrieve_params, + account_get_sso_login_url_params, + account_list_login_providers_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.account_retrieve_response import AccountRetrieveResponse +from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse +from ..types.account_list_login_providers_response import AccountListLoginProvidersResponse + +__all__ = ["AccountsResource", "AsyncAccountsResource"] + + +class AccountsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AccountsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AccountsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AccountsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AccountsResourceWithStreamingResponse(self) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccountRetrieveResponse: + """ + GetAccount retrieves a single Account. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.AccountService/GetAccount", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + account_retrieve_params.AccountRetrieveParams, + ), + ), + cast_to=AccountRetrieveResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + account_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """DeleteAccount deletes an Account. + + To Delete an Account, the Account must not be + an active member of any Organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.AccountService/DeleteAccount", + body=maybe_transform({"account_id": account_id}, account_delete_params.AccountDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_sso_login_url( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccountGetSSOLoginURLResponse: + """ + GetSSOLoginURL returns the URL to redirect the user to for SSO login. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.AccountService/GetSSOLoginURL", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + account_get_sso_login_url_params.AccountGetSSOLoginURLParams, + ), + ), + cast_to=AccountGetSSOLoginURLResponse, + ) + + def list_login_providers( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccountListLoginProvidersResponse: + """ + ListLoginProviders returns the list of login providers matching the provided + filters. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.AccountService/ListLoginProviders", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + account_list_login_providers_params.AccountListLoginProvidersParams, + ), + ), + cast_to=AccountListLoginProvidersResponse, + ) + + +class AsyncAccountsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncAccountsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncAccountsResourceWithStreamingResponse(self) + + async def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccountRetrieveResponse: + """ + GetAccount retrieves a single Account. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.AccountService/GetAccount", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + account_retrieve_params.AccountRetrieveParams, + ), + ), + cast_to=AccountRetrieveResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + account_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """DeleteAccount deletes an Account. + + To Delete an Account, the Account must not be + an active member of any Organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.AccountService/DeleteAccount", + body=await async_maybe_transform({"account_id": account_id}, account_delete_params.AccountDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_sso_login_url( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccountGetSSOLoginURLResponse: + """ + GetSSOLoginURL returns the URL to redirect the user to for SSO login. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.AccountService/GetSSOLoginURL", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + account_get_sso_login_url_params.AccountGetSSOLoginURLParams, + ), + ), + cast_to=AccountGetSSOLoginURLResponse, + ) + + async def list_login_providers( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccountListLoginProvidersResponse: + """ + ListLoginProviders returns the list of login providers matching the provided + filters. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.AccountService/ListLoginProviders", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + account_list_login_providers_params.AccountListLoginProvidersParams, + ), + ), + cast_to=AccountListLoginProvidersResponse, + ) + + +class AccountsResourceWithRawResponse: + def __init__(self, accounts: AccountsResource) -> None: + self._accounts = accounts + + self.retrieve = to_raw_response_wrapper( + accounts.retrieve, + ) + self.delete = to_raw_response_wrapper( + accounts.delete, + ) + self.get_sso_login_url = to_raw_response_wrapper( + accounts.get_sso_login_url, + ) + self.list_login_providers = to_raw_response_wrapper( + accounts.list_login_providers, + ) + + +class AsyncAccountsResourceWithRawResponse: + def __init__(self, accounts: AsyncAccountsResource) -> None: + self._accounts = accounts + + self.retrieve = async_to_raw_response_wrapper( + accounts.retrieve, + ) + self.delete = async_to_raw_response_wrapper( + accounts.delete, + ) + self.get_sso_login_url = async_to_raw_response_wrapper( + accounts.get_sso_login_url, + ) + self.list_login_providers = async_to_raw_response_wrapper( + accounts.list_login_providers, + ) + + +class AccountsResourceWithStreamingResponse: + def __init__(self, accounts: AccountsResource) -> None: + self._accounts = accounts + + self.retrieve = to_streamed_response_wrapper( + accounts.retrieve, + ) + self.delete = to_streamed_response_wrapper( + accounts.delete, + ) + self.get_sso_login_url = to_streamed_response_wrapper( + accounts.get_sso_login_url, + ) + self.list_login_providers = to_streamed_response_wrapper( + accounts.list_login_providers, + ) + + +class AsyncAccountsResourceWithStreamingResponse: + def __init__(self, accounts: AsyncAccountsResource) -> None: + self._accounts = accounts + + self.retrieve = async_to_streamed_response_wrapper( + accounts.retrieve, + ) + self.delete = async_to_streamed_response_wrapper( + accounts.delete, + ) + self.get_sso_login_url = async_to_streamed_response_wrapper( + accounts.get_sso_login_url, + ) + self.list_login_providers = async_to_streamed_response_wrapper( + accounts.list_login_providers, + ) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py new file mode 100644 index 00000000..1b4779a9 --- /dev/null +++ b/src/gitpod/resources/editors.py @@ -0,0 +1,544 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..types import editor_list_params, editor_retrieve_params, editor_resolve_url_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.editor_list_response import EditorListResponse +from ..types.editor_retrieve_response import EditorRetrieveResponse +from ..types.editor_resolve_url_response import EditorResolveURLResponse + +__all__ = ["EditorsResource", "AsyncEditorsResource"] + + +class EditorsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EditorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EditorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EditorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EditorsResourceWithStreamingResponse(self) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorRetrieveResponse: + """ + GetEditor returns the editor with the given ID + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EditorService/GetEditor", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + editor_retrieve_params.EditorRetrieveParams, + ), + ), + cast_to=EditorRetrieveResponse, + ) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorListResponse: + """ + ListEditors lists all editors available to the caller + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EditorService/ListEditors", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + editor_list_params.EditorListParams, + ), + ), + cast_to=EditorListResponse, + ) + + def resolve_url( + self, + *, + connect_protocol_version: Literal[1], + editor_id: str | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorResolveURLResponse: + """ + ResolveEditorURL resolves the editor's URL for an environment + + Args: + connect_protocol_version: Define the version of the Connect protocol + + editor_id: editorId is the ID of the editor to resolve the URL for + + environment_id: environmentId is the ID of the environment to resolve the URL for + + organization_id: organizationId is the ID of the organization to resolve the URL for + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EditorService/ResolveEditorURL", + body=maybe_transform( + { + "editor_id": editor_id, + "environment_id": environment_id, + "organization_id": organization_id, + }, + editor_resolve_url_params.EditorResolveURLParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EditorResolveURLResponse, + ) + + +class AsyncEditorsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEditorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEditorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEditorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEditorsResourceWithStreamingResponse(self) + + async def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorRetrieveResponse: + """ + GetEditor returns the editor with the given ID + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EditorService/GetEditor", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + editor_retrieve_params.EditorRetrieveParams, + ), + ), + cast_to=EditorRetrieveResponse, + ) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorListResponse: + """ + ListEditors lists all editors available to the caller + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EditorService/ListEditors", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + editor_list_params.EditorListParams, + ), + ), + cast_to=EditorListResponse, + ) + + async def resolve_url( + self, + *, + connect_protocol_version: Literal[1], + editor_id: str | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EditorResolveURLResponse: + """ + ResolveEditorURL resolves the editor's URL for an environment + + Args: + connect_protocol_version: Define the version of the Connect protocol + + editor_id: editorId is the ID of the editor to resolve the URL for + + environment_id: environmentId is the ID of the environment to resolve the URL for + + organization_id: organizationId is the ID of the organization to resolve the URL for + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EditorService/ResolveEditorURL", + body=await async_maybe_transform( + { + "editor_id": editor_id, + "environment_id": environment_id, + "organization_id": organization_id, + }, + editor_resolve_url_params.EditorResolveURLParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EditorResolveURLResponse, + ) + + +class EditorsResourceWithRawResponse: + def __init__(self, editors: EditorsResource) -> None: + self._editors = editors + + self.retrieve = to_raw_response_wrapper( + editors.retrieve, + ) + self.list = to_raw_response_wrapper( + editors.list, + ) + self.resolve_url = to_raw_response_wrapper( + editors.resolve_url, + ) + + +class AsyncEditorsResourceWithRawResponse: + def __init__(self, editors: AsyncEditorsResource) -> None: + self._editors = editors + + self.retrieve = async_to_raw_response_wrapper( + editors.retrieve, + ) + self.list = async_to_raw_response_wrapper( + editors.list, + ) + self.resolve_url = async_to_raw_response_wrapper( + editors.resolve_url, + ) + + +class EditorsResourceWithStreamingResponse: + def __init__(self, editors: EditorsResource) -> None: + self._editors = editors + + self.retrieve = to_streamed_response_wrapper( + editors.retrieve, + ) + self.list = to_streamed_response_wrapper( + editors.list, + ) + self.resolve_url = to_streamed_response_wrapper( + editors.resolve_url, + ) + + +class AsyncEditorsResourceWithStreamingResponse: + def __init__(self, editors: AsyncEditorsResource) -> None: + self._editors = editors + + self.retrieve = async_to_streamed_response_wrapper( + editors.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + editors.list, + ) + self.resolve_url = async_to_streamed_response_wrapper( + editors.resolve_url, + ) diff --git a/src/gitpod/resources/environments/__init__.py b/src/gitpod/resources/environments/__init__.py index 8390b0a9..854ce71d 100644 --- a/src/gitpod/resources/environments/__init__.py +++ b/src/gitpod/resources/environments/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .classes import ( + ClassesResource, + AsyncClassesResource, + ClassesResourceWithRawResponse, + AsyncClassesResourceWithRawResponse, + ClassesResourceWithStreamingResponse, + AsyncClassesResourceWithStreamingResponse, +) from .automations import ( AutomationsResource, AsyncAutomationsResource, @@ -24,6 +32,12 @@ "AsyncAutomationsResourceWithRawResponse", "AutomationsResourceWithStreamingResponse", "AsyncAutomationsResourceWithStreamingResponse", + "ClassesResource", + "AsyncClassesResource", + "ClassesResourceWithRawResponse", + "AsyncClassesResourceWithRawResponse", + "ClassesResourceWithStreamingResponse", + "AsyncClassesResourceWithStreamingResponse", "EnvironmentsResource", "AsyncEnvironmentsResource", "EnvironmentsResourceWithRawResponse", diff --git a/src/gitpod/resources/environments/automations/__init__.py b/src/gitpod/resources/environments/automations/__init__.py index c761c0b5..a9f609da 100644 --- a/src/gitpod/resources/environments/automations/__init__.py +++ b/src/gitpod/resources/environments/automations/__init__.py @@ -24,34 +24,20 @@ AutomationsResourceWithStreamingResponse, AsyncAutomationsResourceWithStreamingResponse, ) -from .task_executions import ( - TaskExecutionsResource, - AsyncTaskExecutionsResource, - TaskExecutionsResourceWithRawResponse, - AsyncTaskExecutionsResourceWithRawResponse, - TaskExecutionsResourceWithStreamingResponse, - AsyncTaskExecutionsResourceWithStreamingResponse, -) __all__ = [ - "TasksResource", - "AsyncTasksResource", - "TasksResourceWithRawResponse", - "AsyncTasksResourceWithRawResponse", - "TasksResourceWithStreamingResponse", - "AsyncTasksResourceWithStreamingResponse", - "TaskExecutionsResource", - "AsyncTaskExecutionsResource", - "TaskExecutionsResourceWithRawResponse", - "AsyncTaskExecutionsResourceWithRawResponse", - "TaskExecutionsResourceWithStreamingResponse", - "AsyncTaskExecutionsResourceWithStreamingResponse", "ServicesResource", "AsyncServicesResource", "ServicesResourceWithRawResponse", "AsyncServicesResourceWithRawResponse", "ServicesResourceWithStreamingResponse", "AsyncServicesResourceWithStreamingResponse", + "TasksResource", + "AsyncTasksResource", + "TasksResourceWithRawResponse", + "AsyncTasksResourceWithRawResponse", + "TasksResourceWithStreamingResponse", + "AsyncTasksResourceWithStreamingResponse", "AutomationsResource", "AsyncAutomationsResource", "AutomationsResourceWithRawResponse", diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index 8d618ab1..0fe73d8e 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -6,14 +6,6 @@ import httpx -from .tasks import ( - TasksResource, - AsyncTasksResource, - TasksResourceWithRawResponse, - AsyncTasksResourceWithRawResponse, - TasksResourceWithStreamingResponse, - AsyncTasksResourceWithStreamingResponse, -) from .services import ( ServicesResource, AsyncServicesResource, @@ -30,6 +22,14 @@ async_maybe_transform, ) from ...._compat import cached_property +from .tasks.tasks import ( + TasksResource, + AsyncTasksResource, + TasksResourceWithRawResponse, + AsyncTasksResourceWithRawResponse, + TasksResourceWithStreamingResponse, + AsyncTasksResourceWithStreamingResponse, +) from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( to_raw_response_wrapper, @@ -38,14 +38,6 @@ async_to_streamed_response_wrapper, ) from ...._base_client import make_request_options -from .task_executions import ( - TaskExecutionsResource, - AsyncTaskExecutionsResource, - TaskExecutionsResourceWithRawResponse, - AsyncTaskExecutionsResourceWithRawResponse, - TaskExecutionsResourceWithStreamingResponse, - AsyncTaskExecutionsResourceWithStreamingResponse, -) from ....types.environments import automation_upsert_params from ....types.environments.automation_upsert_response import AutomationUpsertResponse @@ -53,18 +45,14 @@ class AutomationsResource(SyncAPIResource): - @cached_property - def tasks(self) -> TasksResource: - return TasksResource(self._client) - - @cached_property - def task_executions(self) -> TaskExecutionsResource: - return TaskExecutionsResource(self._client) - @cached_property def services(self) -> ServicesResource: return ServicesResource(self._client) + @cached_property + def tasks(self) -> TasksResource: + return TasksResource(self._client) + @cached_property def with_raw_response(self) -> AutomationsResourceWithRawResponse: """ @@ -147,18 +135,14 @@ def upsert( class AsyncAutomationsResource(AsyncAPIResource): - @cached_property - def tasks(self) -> AsyncTasksResource: - return AsyncTasksResource(self._client) - - @cached_property - def task_executions(self) -> AsyncTaskExecutionsResource: - return AsyncTaskExecutionsResource(self._client) - @cached_property def services(self) -> AsyncServicesResource: return AsyncServicesResource(self._client) + @cached_property + def tasks(self) -> AsyncTasksResource: + return AsyncTasksResource(self._client) + @cached_property def with_raw_response(self) -> AsyncAutomationsResourceWithRawResponse: """ @@ -248,18 +232,14 @@ def __init__(self, automations: AutomationsResource) -> None: automations.upsert, ) - @cached_property - def tasks(self) -> TasksResourceWithRawResponse: - return TasksResourceWithRawResponse(self._automations.tasks) - - @cached_property - def task_executions(self) -> TaskExecutionsResourceWithRawResponse: - return TaskExecutionsResourceWithRawResponse(self._automations.task_executions) - @cached_property def services(self) -> ServicesResourceWithRawResponse: return ServicesResourceWithRawResponse(self._automations.services) + @cached_property + def tasks(self) -> TasksResourceWithRawResponse: + return TasksResourceWithRawResponse(self._automations.tasks) + class AsyncAutomationsResourceWithRawResponse: def __init__(self, automations: AsyncAutomationsResource) -> None: @@ -269,18 +249,14 @@ def __init__(self, automations: AsyncAutomationsResource) -> None: automations.upsert, ) - @cached_property - def tasks(self) -> AsyncTasksResourceWithRawResponse: - return AsyncTasksResourceWithRawResponse(self._automations.tasks) - - @cached_property - def task_executions(self) -> AsyncTaskExecutionsResourceWithRawResponse: - return AsyncTaskExecutionsResourceWithRawResponse(self._automations.task_executions) - @cached_property def services(self) -> AsyncServicesResourceWithRawResponse: return AsyncServicesResourceWithRawResponse(self._automations.services) + @cached_property + def tasks(self) -> AsyncTasksResourceWithRawResponse: + return AsyncTasksResourceWithRawResponse(self._automations.tasks) + class AutomationsResourceWithStreamingResponse: def __init__(self, automations: AutomationsResource) -> None: @@ -290,18 +266,14 @@ def __init__(self, automations: AutomationsResource) -> None: automations.upsert, ) - @cached_property - def tasks(self) -> TasksResourceWithStreamingResponse: - return TasksResourceWithStreamingResponse(self._automations.tasks) - - @cached_property - def task_executions(self) -> TaskExecutionsResourceWithStreamingResponse: - return TaskExecutionsResourceWithStreamingResponse(self._automations.task_executions) - @cached_property def services(self) -> ServicesResourceWithStreamingResponse: return ServicesResourceWithStreamingResponse(self._automations.services) + @cached_property + def tasks(self) -> TasksResourceWithStreamingResponse: + return TasksResourceWithStreamingResponse(self._automations.tasks) + class AsyncAutomationsResourceWithStreamingResponse: def __init__(self, automations: AsyncAutomationsResource) -> None: @@ -311,14 +283,10 @@ def __init__(self, automations: AsyncAutomationsResource) -> None: automations.upsert, ) - @cached_property - def tasks(self) -> AsyncTasksResourceWithStreamingResponse: - return AsyncTasksResourceWithStreamingResponse(self._automations.tasks) - - @cached_property - def task_executions(self) -> AsyncTaskExecutionsResourceWithStreamingResponse: - return AsyncTaskExecutionsResourceWithStreamingResponse(self._automations.task_executions) - @cached_property def services(self) -> AsyncServicesResourceWithStreamingResponse: return AsyncServicesResourceWithStreamingResponse(self._automations.services) + + @cached_property + def tasks(self) -> AsyncTasksResourceWithStreamingResponse: + return AsyncTasksResourceWithStreamingResponse(self._automations.tasks) diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index 67694136..dec0277c 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -26,10 +26,14 @@ service_list_params, service_stop_params, service_start_params, + service_create_params, service_delete_params, service_update_params, + service_retrieve_params, ) from ....types.environments.automations.service_list_response import ServiceListResponse +from ....types.environments.automations.service_create_response import ServiceCreateResponse +from ....types.environments.automations.service_retrieve_response import ServiceRetrieveResponse __all__ = ["ServicesResource", "AsyncServicesResource"] @@ -54,6 +58,134 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: """ return ServicesResourceWithStreamingResponse(self) + def create( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + metadata: service_create_params.Metadata | NotGiven = NOT_GIVEN, + spec: service_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceCreateResponse: + """ + CreateService + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/CreateService", + body=maybe_transform( + { + "environment_id": environment_id, + "metadata": metadata, + "spec": spec, + }, + service_create_params.ServiceCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ServiceCreateResponse, + ) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceRetrieveResponse: + """ + GetService + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentAutomationService/GetService", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + service_retrieve_params.ServiceRetrieveParams, + ), + ), + cast_to=ServiceRetrieveResponse, + ) + def update( self, *, @@ -126,9 +258,12 @@ def update( def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: service_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -141,11 +276,16 @@ def list( ListServices Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing services + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request - pagination: pagination contains the pagination options for listing services + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -166,17 +306,23 @@ def list( ), **(extra_headers or {}), } - return self._post( + return self._get( "/gitpod.v1.EnvironmentAutomationService/ListServices", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - service_list_params.ServiceListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + service_list_params.ServiceListParams, + ), ), cast_to=ServiceListResponse, ) @@ -362,6 +508,134 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: """ return AsyncServicesResourceWithStreamingResponse(self) + async def create( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + metadata: service_create_params.Metadata | NotGiven = NOT_GIVEN, + spec: service_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceCreateResponse: + """ + CreateService + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/CreateService", + body=await async_maybe_transform( + { + "environment_id": environment_id, + "metadata": metadata, + "spec": spec, + }, + service_create_params.ServiceCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ServiceCreateResponse, + ) + + async def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ServiceRetrieveResponse: + """ + GetService + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EnvironmentAutomationService/GetService", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + service_retrieve_params.ServiceRetrieveParams, + ), + ), + cast_to=ServiceRetrieveResponse, + ) + async def update( self, *, @@ -434,9 +708,12 @@ async def update( async def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: service_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -449,11 +726,16 @@ async def list( ListServices Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing services + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data - pagination: pagination contains the pagination options for listing services + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -474,17 +756,23 @@ async def list( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.EnvironmentAutomationService/ListServices", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - service_list_params.ServiceListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + service_list_params.ServiceListParams, + ), ), cast_to=ServiceListResponse, ) @@ -654,6 +942,12 @@ class ServicesResourceWithRawResponse: def __init__(self, services: ServicesResource) -> None: self._services = services + self.create = to_raw_response_wrapper( + services.create, + ) + self.retrieve = to_raw_response_wrapper( + services.retrieve, + ) self.update = to_raw_response_wrapper( services.update, ) @@ -675,6 +969,12 @@ class AsyncServicesResourceWithRawResponse: def __init__(self, services: AsyncServicesResource) -> None: self._services = services + self.create = async_to_raw_response_wrapper( + services.create, + ) + self.retrieve = async_to_raw_response_wrapper( + services.retrieve, + ) self.update = async_to_raw_response_wrapper( services.update, ) @@ -696,6 +996,12 @@ class ServicesResourceWithStreamingResponse: def __init__(self, services: ServicesResource) -> None: self._services = services + self.create = to_streamed_response_wrapper( + services.create, + ) + self.retrieve = to_streamed_response_wrapper( + services.retrieve, + ) self.update = to_streamed_response_wrapper( services.update, ) @@ -717,6 +1023,12 @@ class AsyncServicesResourceWithStreamingResponse: def __init__(self, services: AsyncServicesResource) -> None: self._services = services + self.create = async_to_streamed_response_wrapper( + services.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + services.retrieve, + ) self.update = async_to_streamed_response_wrapper( services.update, ) diff --git a/src/gitpod/resources/environments/automations/tasks/__init__.py b/src/gitpod/resources/environments/automations/tasks/__init__.py new file mode 100644 index 00000000..5c1a0497 --- /dev/null +++ b/src/gitpod/resources/environments/automations/tasks/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .tasks import ( + TasksResource, + AsyncTasksResource, + TasksResourceWithRawResponse, + AsyncTasksResourceWithRawResponse, + TasksResourceWithStreamingResponse, + AsyncTasksResourceWithStreamingResponse, +) +from .executions import ( + ExecutionsResource, + AsyncExecutionsResource, + ExecutionsResourceWithRawResponse, + AsyncExecutionsResourceWithRawResponse, + ExecutionsResourceWithStreamingResponse, + AsyncExecutionsResourceWithStreamingResponse, +) + +__all__ = [ + "ExecutionsResource", + "AsyncExecutionsResource", + "ExecutionsResourceWithRawResponse", + "AsyncExecutionsResourceWithRawResponse", + "ExecutionsResourceWithStreamingResponse", + "AsyncExecutionsResourceWithStreamingResponse", + "TasksResource", + "AsyncTasksResource", + "TasksResourceWithRawResponse", + "AsyncTasksResourceWithRawResponse", + "TasksResourceWithStreamingResponse", + "AsyncTasksResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py new file mode 100644 index 00000000..a6206e0f --- /dev/null +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -0,0 +1,517 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._base_client import make_request_options +from .....types.environments.automations.tasks import ( + execution_list_params, + execution_stop_params, + execution_retrieve_params, +) +from .....types.environments.automations.tasks.execution_list_response import ExecutionListResponse +from .....types.environments.automations.tasks.execution_retrieve_response import ExecutionRetrieveResponse + +__all__ = ["ExecutionsResource", "AsyncExecutionsResource"] + + +class ExecutionsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ExecutionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return ExecutionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return ExecutionsResourceWithStreamingResponse(self) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ExecutionRetrieveResponse: + """ + GetTaskExecution + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + execution_retrieve_params.ExecutionRetrieveParams, + ), + ), + cast_to=ExecutionRetrieveResponse, + ) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ExecutionListResponse: + """ + ListTaskExecutions + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + execution_list_params.ExecutionListParams, + ), + ), + cast_to=ExecutionListResponse, + ) + + def stop( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + StopTaskExecution + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", + body=maybe_transform({"id": id}, execution_stop_params.ExecutionStopParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncExecutionsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncExecutionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncExecutionsResourceWithStreamingResponse(self) + + async def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ExecutionRetrieveResponse: + """ + GetTaskExecution + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + execution_retrieve_params.ExecutionRetrieveParams, + ), + ), + cast_to=ExecutionRetrieveResponse, + ) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ExecutionListResponse: + """ + ListTaskExecutions + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + execution_list_params.ExecutionListParams, + ), + ), + cast_to=ExecutionListResponse, + ) + + async def stop( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + StopTaskExecution + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", + body=await async_maybe_transform({"id": id}, execution_stop_params.ExecutionStopParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class ExecutionsResourceWithRawResponse: + def __init__(self, executions: ExecutionsResource) -> None: + self._executions = executions + + self.retrieve = to_raw_response_wrapper( + executions.retrieve, + ) + self.list = to_raw_response_wrapper( + executions.list, + ) + self.stop = to_raw_response_wrapper( + executions.stop, + ) + + +class AsyncExecutionsResourceWithRawResponse: + def __init__(self, executions: AsyncExecutionsResource) -> None: + self._executions = executions + + self.retrieve = async_to_raw_response_wrapper( + executions.retrieve, + ) + self.list = async_to_raw_response_wrapper( + executions.list, + ) + self.stop = async_to_raw_response_wrapper( + executions.stop, + ) + + +class ExecutionsResourceWithStreamingResponse: + def __init__(self, executions: ExecutionsResource) -> None: + self._executions = executions + + self.retrieve = to_streamed_response_wrapper( + executions.retrieve, + ) + self.list = to_streamed_response_wrapper( + executions.list, + ) + self.stop = to_streamed_response_wrapper( + executions.stop, + ) + + +class AsyncExecutionsResourceWithStreamingResponse: + def __init__(self, executions: AsyncExecutionsResource) -> None: + self._executions = executions + + self.retrieve = async_to_streamed_response_wrapper( + executions.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + executions.list, + ) + self.stop = async_to_streamed_response_wrapper( + executions.stop, + ) diff --git a/src/gitpod/resources/environments/automations/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py similarity index 81% rename from src/gitpod/resources/environments/automations/tasks.py rename to src/gitpod/resources/environments/automations/tasks/tasks.py index 13345d51..40e8a3d8 100644 --- a/src/gitpod/resources/environments/automations/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -7,23 +7,31 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( is_given, maybe_transform, strip_not_given, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from .executions import ( + ExecutionsResource, + AsyncExecutionsResource, + ExecutionsResourceWithRawResponse, + AsyncExecutionsResourceWithRawResponse, + ExecutionsResourceWithStreamingResponse, + AsyncExecutionsResourceWithStreamingResponse, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._base_client import make_request_options -from ....types.environments.automations import ( +from ....._base_client import make_request_options +from .....types.environments.automations import ( task_list_params, task_start_params, task_create_params, @@ -31,15 +39,19 @@ task_update_params, task_retrieve_params, ) -from ....types.environments.automations.task_list_response import TaskListResponse -from ....types.environments.automations.task_start_response import TaskStartResponse -from ....types.environments.automations.task_create_response import TaskCreateResponse -from ....types.environments.automations.task_retrieve_response import TaskRetrieveResponse +from .....types.environments.automations.task_list_response import TaskListResponse +from .....types.environments.automations.task_start_response import TaskStartResponse +from .....types.environments.automations.task_create_response import TaskCreateResponse +from .....types.environments.automations.task_retrieve_response import TaskRetrieveResponse __all__ = ["TasksResource", "AsyncTasksResource"] class TasksResource(SyncAPIResource): + @cached_property + def executions(self) -> ExecutionsResource: + return ExecutionsResource(self._client) + @cached_property def with_raw_response(self) -> TasksResourceWithRawResponse: """ @@ -120,8 +132,12 @@ def create( def retrieve( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -134,8 +150,17 @@ def retrieve( GetTask Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -155,11 +180,23 @@ def retrieve( ), **(extra_headers or {}), } - return self._post( + return self._get( "/gitpod.v1.EnvironmentAutomationService/GetTask", - body=maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + task_retrieve_params.TaskRetrieveParams, + ), ), cast_to=TaskRetrieveResponse, ) @@ -227,9 +264,12 @@ def update( def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: task_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -242,11 +282,16 @@ def list( ListTasks Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing tasks + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data - pagination: pagination contains the pagination options for listing tasks + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -267,17 +312,23 @@ def list( ), **(extra_headers or {}), } - return self._post( + return self._get( "/gitpod.v1.EnvironmentAutomationService/ListTasks", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - task_list_params.TaskListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + task_list_params.TaskListParams, + ), ), cast_to=TaskListResponse, ) @@ -380,6 +431,10 @@ def start( class AsyncTasksResource(AsyncAPIResource): + @cached_property + def executions(self) -> AsyncExecutionsResource: + return AsyncExecutionsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: """ @@ -460,8 +515,12 @@ async def create( async def retrieve( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -474,8 +533,17 @@ async def retrieve( GetTask Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -495,11 +563,23 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.EnvironmentAutomationService/GetTask", - body=await async_maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + task_retrieve_params.TaskRetrieveParams, + ), ), cast_to=TaskRetrieveResponse, ) @@ -567,9 +647,12 @@ async def update( async def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: task_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -582,11 +665,16 @@ async def list( ListTasks Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing tasks + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data - pagination: pagination contains the pagination options for listing tasks + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -607,17 +695,23 @@ async def list( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.EnvironmentAutomationService/ListTasks", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - task_list_params.TaskListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + task_list_params.TaskListParams, + ), ), cast_to=TaskListResponse, ) @@ -742,6 +836,10 @@ def __init__(self, tasks: TasksResource) -> None: tasks.start, ) + @cached_property + def executions(self) -> ExecutionsResourceWithRawResponse: + return ExecutionsResourceWithRawResponse(self._tasks.executions) + class AsyncTasksResourceWithRawResponse: def __init__(self, tasks: AsyncTasksResource) -> None: @@ -766,6 +864,10 @@ def __init__(self, tasks: AsyncTasksResource) -> None: tasks.start, ) + @cached_property + def executions(self) -> AsyncExecutionsResourceWithRawResponse: + return AsyncExecutionsResourceWithRawResponse(self._tasks.executions) + class TasksResourceWithStreamingResponse: def __init__(self, tasks: TasksResource) -> None: @@ -790,6 +892,10 @@ def __init__(self, tasks: TasksResource) -> None: tasks.start, ) + @cached_property + def executions(self) -> ExecutionsResourceWithStreamingResponse: + return ExecutionsResourceWithStreamingResponse(self._tasks.executions) + class AsyncTasksResourceWithStreamingResponse: def __init__(self, tasks: AsyncTasksResource) -> None: @@ -813,3 +919,7 @@ def __init__(self, tasks: AsyncTasksResource) -> None: self.start = async_to_streamed_response_wrapper( tasks.start, ) + + @cached_property + def executions(self) -> AsyncExecutionsResourceWithStreamingResponse: + return AsyncExecutionsResourceWithStreamingResponse(self._tasks.executions) diff --git a/src/gitpod/resources/environment_classes.py b/src/gitpod/resources/environments/classes.py similarity index 55% rename from src/gitpod/resources/environment_classes.py rename to src/gitpod/resources/environments/classes.py index 54e7fffc..b272a36e 100644 --- a/src/gitpod/resources/environment_classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -6,54 +6,57 @@ import httpx -from ..types import environment_class_list_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( is_given, maybe_transform, strip_not_given, async_maybe_transform, ) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options -from ..types.environment_class_list_response import EnvironmentClassListResponse +from ..._base_client import make_request_options +from ...types.environments import class_list_params +from ...types.environments.class_list_response import ClassListResponse -__all__ = ["EnvironmentClassesResource", "AsyncEnvironmentClassesResource"] +__all__ = ["ClassesResource", "AsyncClassesResource"] -class EnvironmentClassesResource(SyncAPIResource): +class ClassesResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> EnvironmentClassesResourceWithRawResponse: + def with_raw_response(self) -> ClassesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return EnvironmentClassesResourceWithRawResponse(self) + return ClassesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResponse: + def with_streaming_response(self) -> ClassesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return EnvironmentClassesResourceWithStreamingResponse(self) + return ClassesResourceWithStreamingResponse(self) def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -61,7 +64,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentClassListResponse: + ) -> ClassListResponse: """ ListEnvironmentClasses returns the list of environment classes with runner details a user is able to use based on the @@ -69,9 +72,16 @@ def list( query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environment classes + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -92,48 +102,57 @@ def list( ), **(extra_headers or {}), } - return self._post( + return self._get( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - environment_class_list_params.EnvironmentClassListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + class_list_params.ClassListParams, + ), ), - cast_to=EnvironmentClassListResponse, + cast_to=ClassListResponse, ) -class AsyncEnvironmentClassesResource(AsyncAPIResource): +class AsyncClassesResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncEnvironmentClassesResourceWithRawResponse: + def with_raw_response(self) -> AsyncClassesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return AsyncEnvironmentClassesResourceWithRawResponse(self) + return AsyncClassesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncClassesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return AsyncEnvironmentClassesResourceWithStreamingResponse(self) + return AsyncClassesResourceWithStreamingResponse(self) async def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -141,7 +160,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentClassListResponse: + ) -> ClassListResponse: """ ListEnvironmentClasses returns the list of environment classes with runner details a user is able to use based on the @@ -149,9 +168,16 @@ async def list( query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environment classes + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -172,53 +198,59 @@ async def list( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - environment_class_list_params.EnvironmentClassListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + class_list_params.ClassListParams, + ), ), - cast_to=EnvironmentClassListResponse, + cast_to=ClassListResponse, ) -class EnvironmentClassesResourceWithRawResponse: - def __init__(self, environment_classes: EnvironmentClassesResource) -> None: - self._environment_classes = environment_classes +class ClassesResourceWithRawResponse: + def __init__(self, classes: ClassesResource) -> None: + self._classes = classes self.list = to_raw_response_wrapper( - environment_classes.list, + classes.list, ) -class AsyncEnvironmentClassesResourceWithRawResponse: - def __init__(self, environment_classes: AsyncEnvironmentClassesResource) -> None: - self._environment_classes = environment_classes +class AsyncClassesResourceWithRawResponse: + def __init__(self, classes: AsyncClassesResource) -> None: + self._classes = classes self.list = async_to_raw_response_wrapper( - environment_classes.list, + classes.list, ) -class EnvironmentClassesResourceWithStreamingResponse: - def __init__(self, environment_classes: EnvironmentClassesResource) -> None: - self._environment_classes = environment_classes +class ClassesResourceWithStreamingResponse: + def __init__(self, classes: ClassesResource) -> None: + self._classes = classes self.list = to_streamed_response_wrapper( - environment_classes.list, + classes.list, ) -class AsyncEnvironmentClassesResourceWithStreamingResponse: - def __init__(self, environment_classes: AsyncEnvironmentClassesResource) -> None: - self._environment_classes = environment_classes +class AsyncClassesResourceWithStreamingResponse: + def __init__(self, classes: AsyncClassesResource) -> None: + self._classes = classes self.list = async_to_streamed_response_wrapper( - environment_classes.list, + classes.list, ) diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 0bf75063..edba88c0 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -2,20 +2,34 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ...types import ( environment_list_params, + environment_stop_params, environment_start_params, environment_create_params, + environment_delete_params, + environment_update_params, environment_retrieve_params, + environment_mark_active_params, + environment_create_logs_token_params, environment_create_from_project_params, ) +from .classes import ( + ClassesResource, + AsyncClassesResource, + ClassesResourceWithRawResponse, + AsyncClassesResourceWithRawResponse, + ClassesResourceWithStreamingResponse, + AsyncClassesResourceWithStreamingResponse, +) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -40,36 +54,712 @@ from ...types.environment_list_response import EnvironmentListResponse from ...types.environment_create_response import EnvironmentCreateResponse from ...types.environment_retrieve_response import EnvironmentRetrieveResponse +from ...types.environment_create_logs_token_response import EnvironmentCreateLogsTokenResponse from ...types.environment_create_from_project_response import EnvironmentCreateFromProjectResponse -__all__ = ["EnvironmentsResource", "AsyncEnvironmentsResource"] +__all__ = ["EnvironmentsResource", "AsyncEnvironmentsResource"] + + +class EnvironmentsResource(SyncAPIResource): + @cached_property + def automations(self) -> AutomationsResource: + return AutomationsResource(self._client) + + @cached_property + def classes(self) -> ClassesResource: + return ClassesResource(self._client) + + @cached_property + def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EnvironmentsResourceWithStreamingResponse(self) + + def create( + self, + *, + connect_protocol_version: Literal[1], + spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentCreateResponse: + """ + CreateEnvironment creates a new environment and starts it. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + spec: EnvironmentSpec specifies the configuration of an environment for an environment + + start + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/CreateEnvironment", + body=maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentCreateResponse, + ) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentRetrieveResponse: + """ + GetEnvironment returns a single environment. + + +return NOT_FOUND User does not have access to an environment with the given ID + +return NOT_FOUND Environment does not exist + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentService/GetEnvironment", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + environment_retrieve_params.EnvironmentRetrieveParams, + ), + ), + cast_to=EnvironmentRetrieveResponse, + ) + + @overload + def update( + self, + *, + metadata: object, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironment updates the environment partially. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + spec: environment_update_params.Variant1Spec, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironment updates the environment partially. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["metadata", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + def update( + self, + *, + metadata: object | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/UpdateEnvironment", + body=maybe_transform( + { + "metadata": metadata, + "spec": spec, + }, + environment_update_params.EnvironmentUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentListResponse: + """ + ListEnvironments returns a list of environments that match the query. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EnvironmentService/ListEnvironments", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + environment_list_params.EnvironmentListParams, + ), + ), + cast_to=EnvironmentListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + force: bool | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """DeleteEnvironment deletes an environment. + + When the environment is running, it + will be stopped as well. Deleted environments cannot be started again. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies the environment that is going to delete. + + +required + + force: force indicates whether the environment should be deleted forcefully When force + deleting an Environment, the Environment is removed immediately and environment + lifecycle is not respected. Force deleting can result in data loss on the + environment. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/DeleteEnvironment", + body=maybe_transform( + { + "environment_id": environment_id, + "force": force, + }, + environment_delete_params.EnvironmentDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def create_from_project( + self, + *, + connect_protocol_version: Literal[1], + project_id: str | NotGiven = NOT_GIVEN, + spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentCreateFromProjectResponse: + """ + CreateAbdStartEnvironmentFromProject creates a new environment from a project + and starts it. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + spec: EnvironmentSpec specifies the configuration of an environment for an environment + + start + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", + body=maybe_transform( + { + "project_id": project_id, + "spec": spec, + }, + environment_create_from_project_params.EnvironmentCreateFromProjectParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentCreateFromProjectResponse, + ) + + def create_logs_token( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentCreateLogsTokenResponse: + """ + CreateEnvironmentLogsToken creates a token that can be used to access the logs + of an environment. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies the environment for which the logs token should be + created. + + +required + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken", + body=maybe_transform( + {"environment_id": environment_id}, + environment_create_logs_token_params.EnvironmentCreateLogsTokenParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentCreateLogsTokenResponse, + ) + + def mark_active( + self, + *, + connect_protocol_version: Literal[1], + activity_signal: environment_mark_active_params.ActivitySignal | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + MarkEnvironmentActive allows tools to signal activity for an environment. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + activity_signal: EnvironmentActivitySignal used to signal activity for an environment. + + environment_id: The ID of the environment to update activity for. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/MarkEnvironmentActive", + body=maybe_transform( + { + "activity_signal": activity_signal, + "environment_id": environment_id, + }, + environment_mark_active_params.EnvironmentMarkActiveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def start( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """StartEnvironment starts an environment. + + This function is idempotent, i.e. if + + the environment is already running no error is returned. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies which environment should be started. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/StartEnvironment", + body=maybe_transform({"environment_id": environment_id}, environment_start_params.EnvironmentStartParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def stop( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + StopEnvironment stops a running environment. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies which environment should be stopped. + + +required + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EnvironmentService/StopEnvironment", + body=maybe_transform({"environment_id": environment_id}, environment_stop_params.EnvironmentStopParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + +class AsyncEnvironmentsResource(AsyncAPIResource): + @cached_property + def automations(self) -> AsyncAutomationsResource: + return AsyncAutomationsResource(self._client) -class EnvironmentsResource(SyncAPIResource): @cached_property - def automations(self) -> AutomationsResource: - return AutomationsResource(self._client) + def classes(self) -> AsyncClassesResource: + return AsyncClassesResource(self._client) @cached_property - def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: + def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return EnvironmentsResourceWithRawResponse(self) + return AsyncEnvironmentsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return EnvironmentsResourceWithStreamingResponse(self) + return AsyncEnvironmentsResourceWithStreamingResponse(self) - def create( + async def create( self, *, connect_protocol_version: Literal[1], @@ -111,20 +801,24 @@ def create( ), **(extra_headers or {}), } - return self._post( + return await self._post( "/gitpod.v1.EnvironmentService/CreateEnvironment", - body=maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), + body=await async_maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=EnvironmentCreateResponse, ) - def retrieve( + async def retrieve( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -140,9 +834,16 @@ def retrieve( +return NOT_FOUND Environment does not exist Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment to get + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -163,24 +864,33 @@ def retrieve( ), **(extra_headers or {}), } - return self._post( + return await self._get( "/gitpod.v1.EnvironmentService/GetEnvironment", - body=maybe_transform( - {"environment_id": environment_id}, environment_retrieve_params.EnvironmentRetrieveParams - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + environment_retrieve_params.EnvironmentRetrieveParams, + ), ), cast_to=EnvironmentRetrieveResponse, ) - def list( + @overload + async def update( self, *, + metadata: object, connect_protocol_version: Literal[1], - filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, - pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -188,16 +898,44 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentListResponse: + ) -> object: """ - ListEnvironments returns a list of environments that match the query. + UpdateEnvironment updates the environment partially. Args: connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization that contains the environments + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + spec: environment_update_params.Variant1Spec, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironment updates the environment partially. - pagination: pagination contains the pagination options for listing environments + Args: + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -209,6 +947,23 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["metadata", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + async def update( + self, + *, + metadata: object | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -218,28 +973,30 @@ def list( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.EnvironmentService/ListEnvironments", - body=maybe_transform( + return await self._post( + "/gitpod.v1.EnvironmentService/UpdateEnvironment", + body=await async_maybe_transform( { - "filter": filter, - "organization_id": organization_id, - "pagination": pagination, + "metadata": metadata, + "spec": spec, }, - environment_list_params.EnvironmentListParams, + environment_update_params.EnvironmentUpdateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EnvironmentListResponse, + cast_to=object, ) - def create_from_project( + async def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - project_id: str | NotGiven = NOT_GIVEN, - spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -247,17 +1004,21 @@ def create_from_project( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentCreateFromProjectResponse: + ) -> EnvironmentListResponse: """ - CreateAbdStartEnvironmentFromProject creates a new environment from a project - and starts it. + ListEnvironments returns a list of environments that match the query. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data - start + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -278,26 +1039,33 @@ def create_from_project( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", - body=maybe_transform( - { - "project_id": project_id, - "spec": spec, - }, - environment_create_from_project_params.EnvironmentCreateFromProjectParams, - ), + return await self._get( + "/gitpod.v1.EnvironmentService/ListEnvironments", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + environment_list_params.EnvironmentListParams, + ), ), - cast_to=EnvironmentCreateFromProjectResponse, + cast_to=EnvironmentListResponse, ) - def start( + async def delete( self, *, connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, + force: bool | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -306,16 +1074,22 @@ def start( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """StartEnvironment starts an environment. - - This function is idempotent, i.e. if + """DeleteEnvironment deletes an environment. - the environment is already running no error is returned. + When the environment is running, it + will be stopped as well. Deleted environments cannot be started again. Args: connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies which environment should be started. + environment_id: environment_id specifies the environment that is going to delete. + + +required + + force: force indicates whether the environment should be deleted forcefully When force + deleting an Environment, the Environment is removed immediately and environment + lifecycle is not respected. Force deleting can result in data loss on the + environment. connect_timeout_ms: Define the timeout, in ms @@ -336,45 +1110,27 @@ def start( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.EnvironmentService/StartEnvironment", - body=maybe_transform({"environment_id": environment_id}, environment_start_params.EnvironmentStartParams), + return await self._post( + "/gitpod.v1.EnvironmentService/DeleteEnvironment", + body=await async_maybe_transform( + { + "environment_id": environment_id, + "force": force, + }, + environment_delete_params.EnvironmentDeleteParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=object, ) - -class AsyncEnvironmentsResource(AsyncAPIResource): - @cached_property - def automations(self) -> AsyncAutomationsResource: - return AsyncAutomationsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncEnvironmentsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncEnvironmentsResourceWithStreamingResponse(self) - - async def create( + async def create_from_project( self, *, connect_protocol_version: Literal[1], - spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -382,9 +1138,10 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentCreateResponse: + ) -> EnvironmentCreateFromProjectResponse: """ - CreateEnvironment creates a new environment and starts it. + CreateAbdStartEnvironmentFromProject creates a new environment from a project + and starts it. Args: connect_protocol_version: Define the version of the Connect protocol @@ -413,15 +1170,21 @@ async def create( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EnvironmentService/CreateEnvironment", - body=await async_maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), + "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", + body=await async_maybe_transform( + { + "project_id": project_id, + "spec": spec, + }, + environment_create_from_project_params.EnvironmentCreateFromProjectParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EnvironmentCreateResponse, + cast_to=EnvironmentCreateFromProjectResponse, ) - async def retrieve( + async def create_logs_token( self, *, connect_protocol_version: Literal[1], @@ -433,17 +1196,18 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentRetrieveResponse: + ) -> EnvironmentCreateLogsTokenResponse: """ - GetEnvironment returns a single environment. - - +return NOT_FOUND User does not have access to an environment with the given ID - +return NOT_FOUND Environment does not exist + CreateEnvironmentLogsToken creates a token that can be used to access the logs + of an environment. Args: connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment to get + environment_id: environment_id specifies the environment for which the logs token should be + created. + + +required connect_timeout_ms: Define the timeout, in ms @@ -465,23 +1229,23 @@ async def retrieve( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EnvironmentService/GetEnvironment", + "/gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken", body=await async_maybe_transform( - {"environment_id": environment_id}, environment_retrieve_params.EnvironmentRetrieveParams + {"environment_id": environment_id}, + environment_create_logs_token_params.EnvironmentCreateLogsTokenParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EnvironmentRetrieveResponse, + cast_to=EnvironmentCreateLogsTokenResponse, ) - async def list( + async def mark_active( self, *, connect_protocol_version: Literal[1], - filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, - pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + activity_signal: environment_mark_active_params.ActivitySignal | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -489,16 +1253,16 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentListResponse: + ) -> object: """ - ListEnvironments returns a list of environments that match the query. + MarkEnvironmentActive allows tools to signal activity for an environment. Args: connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization that contains the environments + activity_signal: EnvironmentActivitySignal used to signal activity for an environment. - pagination: pagination contains the pagination options for listing environments + environment_id: The ID of the environment to update activity for. connect_timeout_ms: Define the timeout, in ms @@ -520,27 +1284,25 @@ async def list( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EnvironmentService/ListEnvironments", + "/gitpod.v1.EnvironmentService/MarkEnvironmentActive", body=await async_maybe_transform( { - "filter": filter, - "organization_id": organization_id, - "pagination": pagination, + "activity_signal": activity_signal, + "environment_id": environment_id, }, - environment_list_params.EnvironmentListParams, + environment_mark_active_params.EnvironmentMarkActiveParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EnvironmentListResponse, + cast_to=object, ) - async def create_from_project( + async def start( self, *, connect_protocol_version: Literal[1], - project_id: str | NotGiven = NOT_GIVEN, - spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -548,17 +1310,17 @@ async def create_from_project( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentCreateFromProjectResponse: - """ - CreateAbdStartEnvironmentFromProject creates a new environment from a project - and starts it. + ) -> object: + """StartEnvironment starts an environment. + + This function is idempotent, i.e. if + + the environment is already running no error is returned. Args: connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment - - start + environment_id: environment_id specifies which environment should be started. connect_timeout_ms: Define the timeout, in ms @@ -580,21 +1342,17 @@ async def create_from_project( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", + "/gitpod.v1.EnvironmentService/StartEnvironment", body=await async_maybe_transform( - { - "project_id": project_id, - "spec": spec, - }, - environment_create_from_project_params.EnvironmentCreateFromProjectParams, + {"environment_id": environment_id}, environment_start_params.EnvironmentStartParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EnvironmentCreateFromProjectResponse, + cast_to=object, ) - async def start( + async def stop( self, *, connect_protocol_version: Literal[1], @@ -607,16 +1365,15 @@ async def start( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """StartEnvironment starts an environment. - - This function is idempotent, i.e. if - - the environment is already running no error is returned. + """ + StopEnvironment stops a running environment. Args: connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies which environment should be started. + environment_id: environment_id specifies which environment should be stopped. + + +required connect_timeout_ms: Define the timeout, in ms @@ -638,9 +1395,9 @@ async def start( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EnvironmentService/StartEnvironment", + "/gitpod.v1.EnvironmentService/StopEnvironment", body=await async_maybe_transform( - {"environment_id": environment_id}, environment_start_params.EnvironmentStartParams + {"environment_id": environment_id}, environment_stop_params.EnvironmentStopParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -659,20 +1416,39 @@ def __init__(self, environments: EnvironmentsResource) -> None: self.retrieve = to_raw_response_wrapper( environments.retrieve, ) + self.update = to_raw_response_wrapper( + environments.update, + ) self.list = to_raw_response_wrapper( environments.list, ) + self.delete = to_raw_response_wrapper( + environments.delete, + ) self.create_from_project = to_raw_response_wrapper( environments.create_from_project, ) + self.create_logs_token = to_raw_response_wrapper( + environments.create_logs_token, + ) + self.mark_active = to_raw_response_wrapper( + environments.mark_active, + ) self.start = to_raw_response_wrapper( environments.start, ) + self.stop = to_raw_response_wrapper( + environments.stop, + ) @cached_property def automations(self) -> AutomationsResourceWithRawResponse: return AutomationsResourceWithRawResponse(self._environments.automations) + @cached_property + def classes(self) -> ClassesResourceWithRawResponse: + return ClassesResourceWithRawResponse(self._environments.classes) + class AsyncEnvironmentsResourceWithRawResponse: def __init__(self, environments: AsyncEnvironmentsResource) -> None: @@ -684,20 +1460,39 @@ def __init__(self, environments: AsyncEnvironmentsResource) -> None: self.retrieve = async_to_raw_response_wrapper( environments.retrieve, ) + self.update = async_to_raw_response_wrapper( + environments.update, + ) self.list = async_to_raw_response_wrapper( environments.list, ) + self.delete = async_to_raw_response_wrapper( + environments.delete, + ) self.create_from_project = async_to_raw_response_wrapper( environments.create_from_project, ) + self.create_logs_token = async_to_raw_response_wrapper( + environments.create_logs_token, + ) + self.mark_active = async_to_raw_response_wrapper( + environments.mark_active, + ) self.start = async_to_raw_response_wrapper( environments.start, ) + self.stop = async_to_raw_response_wrapper( + environments.stop, + ) @cached_property def automations(self) -> AsyncAutomationsResourceWithRawResponse: return AsyncAutomationsResourceWithRawResponse(self._environments.automations) + @cached_property + def classes(self) -> AsyncClassesResourceWithRawResponse: + return AsyncClassesResourceWithRawResponse(self._environments.classes) + class EnvironmentsResourceWithStreamingResponse: def __init__(self, environments: EnvironmentsResource) -> None: @@ -709,20 +1504,39 @@ def __init__(self, environments: EnvironmentsResource) -> None: self.retrieve = to_streamed_response_wrapper( environments.retrieve, ) + self.update = to_streamed_response_wrapper( + environments.update, + ) self.list = to_streamed_response_wrapper( environments.list, ) + self.delete = to_streamed_response_wrapper( + environments.delete, + ) self.create_from_project = to_streamed_response_wrapper( environments.create_from_project, ) + self.create_logs_token = to_streamed_response_wrapper( + environments.create_logs_token, + ) + self.mark_active = to_streamed_response_wrapper( + environments.mark_active, + ) self.start = to_streamed_response_wrapper( environments.start, ) + self.stop = to_streamed_response_wrapper( + environments.stop, + ) @cached_property def automations(self) -> AutomationsResourceWithStreamingResponse: return AutomationsResourceWithStreamingResponse(self._environments.automations) + @cached_property + def classes(self) -> ClassesResourceWithStreamingResponse: + return ClassesResourceWithStreamingResponse(self._environments.classes) + class AsyncEnvironmentsResourceWithStreamingResponse: def __init__(self, environments: AsyncEnvironmentsResource) -> None: @@ -734,16 +1548,35 @@ def __init__(self, environments: AsyncEnvironmentsResource) -> None: self.retrieve = async_to_streamed_response_wrapper( environments.retrieve, ) + self.update = async_to_streamed_response_wrapper( + environments.update, + ) self.list = async_to_streamed_response_wrapper( environments.list, ) + self.delete = async_to_streamed_response_wrapper( + environments.delete, + ) self.create_from_project = async_to_streamed_response_wrapper( environments.create_from_project, ) + self.create_logs_token = async_to_streamed_response_wrapper( + environments.create_logs_token, + ) + self.mark_active = async_to_streamed_response_wrapper( + environments.mark_active, + ) self.start = async_to_streamed_response_wrapper( environments.start, ) + self.stop = async_to_streamed_response_wrapper( + environments.stop, + ) @cached_property def automations(self) -> AsyncAutomationsResourceWithStreamingResponse: return AsyncAutomationsResourceWithStreamingResponse(self._environments.automations) + + @cached_property + def classes(self) -> AsyncClassesResourceWithStreamingResponse: + return AsyncClassesResourceWithStreamingResponse(self._environments.classes) diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py new file mode 100644 index 00000000..4dc3ff5a --- /dev/null +++ b/src/gitpod/resources/events.py @@ -0,0 +1,494 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, overload + +import httpx + +from ..types import event_list_params, event_watch_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + required_args, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.event_list_response import EventListResponse +from ..types.event_watch_response import EventWatchResponse + +__all__ = ["EventsResource", "AsyncEventsResource"] + + +class EventsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EventsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return EventsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EventsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return EventsResourceWithStreamingResponse(self) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventListResponse: + """ + ListAuditLogs retrieves a paginated list of audit logs for the specified + organization + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.EventService/ListAuditLogs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + event_list_params.EventListParams, + ), + ), + cast_to=EventListResponse, + ) + + @overload + def watch( + self, + *, + environment_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventWatchResponse: + """ + WatchEvents streams all requests events to the client + + Args: + environment_id: Environment scope produces events for the environment itself, all tasks, task + executions, + + and services associated with that environment. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def watch( + self, + *, + organization: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventWatchResponse: + """ + WatchEvents streams all requests events to the client + + Args: + organization: Organization scope produces events for all projects, runners and environments + + the caller can see within their organization. No task, task execution or service + events are produed. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["environment_id", "connect_protocol_version"], ["organization", "connect_protocol_version"]) + def watch( + self, + *, + environment_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + organization: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventWatchResponse: + extra_headers = {"Accept": "application/connect+json", **(extra_headers or {})} + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.EventService/WatchEvents", + body=maybe_transform( + { + "environment_id": environment_id, + "organization": organization, + }, + event_watch_params.EventWatchParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EventWatchResponse, + ) + + +class AsyncEventsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEventsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncEventsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEventsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncEventsResourceWithStreamingResponse(self) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventListResponse: + """ + ListAuditLogs retrieves a paginated list of audit logs for the specified + organization + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.EventService/ListAuditLogs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + event_list_params.EventListParams, + ), + ), + cast_to=EventListResponse, + ) + + @overload + async def watch( + self, + *, + environment_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventWatchResponse: + """ + WatchEvents streams all requests events to the client + + Args: + environment_id: Environment scope produces events for the environment itself, all tasks, task + executions, + + and services associated with that environment. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def watch( + self, + *, + organization: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventWatchResponse: + """ + WatchEvents streams all requests events to the client + + Args: + organization: Organization scope produces events for all projects, runners and environments + + the caller can see within their organization. No task, task execution or service + events are produed. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["environment_id", "connect_protocol_version"], ["organization", "connect_protocol_version"]) + async def watch( + self, + *, + environment_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + organization: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventWatchResponse: + extra_headers = {"Accept": "application/connect+json", **(extra_headers or {})} + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.EventService/WatchEvents", + body=await async_maybe_transform( + { + "environment_id": environment_id, + "organization": organization, + }, + event_watch_params.EventWatchParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EventWatchResponse, + ) + + +class EventsResourceWithRawResponse: + def __init__(self, events: EventsResource) -> None: + self._events = events + + self.list = to_raw_response_wrapper( + events.list, + ) + self.watch = to_raw_response_wrapper( + events.watch, + ) + + +class AsyncEventsResourceWithRawResponse: + def __init__(self, events: AsyncEventsResource) -> None: + self._events = events + + self.list = async_to_raw_response_wrapper( + events.list, + ) + self.watch = async_to_raw_response_wrapper( + events.watch, + ) + + +class EventsResourceWithStreamingResponse: + def __init__(self, events: EventsResource) -> None: + self._events = events + + self.list = to_streamed_response_wrapper( + events.list, + ) + self.watch = to_streamed_response_wrapper( + events.watch, + ) + + +class AsyncEventsResourceWithStreamingResponse: + def __init__(self, events: AsyncEventsResource) -> None: + self._events = events + + self.list = async_to_streamed_response_wrapper( + events.list, + ) + self.watch = async_to_streamed_response_wrapper( + events.watch, + ) diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py new file mode 100644 index 00000000..8bfb6a68 --- /dev/null +++ b/src/gitpod/resources/groups.py @@ -0,0 +1,250 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..types import group_list_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.group_list_response import GroupListResponse + +__all__ = ["GroupsResource", "AsyncGroupsResource"] + + +class GroupsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> GroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return GroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return GroupsResourceWithStreamingResponse(self) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> GroupListResponse: + """ + ListGroups lists groups + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.GroupService/ListGroups", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + group_list_params.GroupListParams, + ), + ), + cast_to=GroupListResponse, + ) + + +class AsyncGroupsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncGroupsResourceWithStreamingResponse(self) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> GroupListResponse: + """ + ListGroups lists groups + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.GroupService/ListGroups", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + group_list_params.GroupListParams, + ), + ), + cast_to=GroupListResponse, + ) + + +class GroupsResourceWithRawResponse: + def __init__(self, groups: GroupsResource) -> None: + self._groups = groups + + self.list = to_raw_response_wrapper( + groups.list, + ) + + +class AsyncGroupsResourceWithRawResponse: + def __init__(self, groups: AsyncGroupsResource) -> None: + self._groups = groups + + self.list = async_to_raw_response_wrapper( + groups.list, + ) + + +class GroupsResourceWithStreamingResponse: + def __init__(self, groups: GroupsResource) -> None: + self._groups = groups + + self.list = to_streamed_response_wrapper( + groups.list, + ) + + +class AsyncGroupsResourceWithStreamingResponse: + def __init__(self, groups: AsyncGroupsResource) -> None: + self._groups = groups + + self.list = async_to_streamed_response_wrapper( + groups.list, + ) diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 1dd95ed9..66ece2e6 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -109,8 +109,12 @@ def exchange_token( def get_authenticated_identity( self, *, - body: object, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -123,8 +127,17 @@ def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -144,13 +157,23 @@ def get_authenticated_identity( ), **(extra_headers or {}), } - return self._post( + return self._get( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=maybe_transform( - body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams, + ), ), cast_to=IdentityGetAuthenticatedIdentityResponse, ) @@ -278,8 +301,12 @@ async def exchange_token( async def get_authenticated_identity( self, *, - body: object, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -292,8 +319,17 @@ async def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -313,13 +349,23 @@ async def get_authenticated_identity( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=await async_maybe_transform( - body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams, + ), ), cast_to=IdentityGetAuthenticatedIdentityResponse, ) diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py index aa07d9ba..164bee21 100644 --- a/src/gitpod/resources/organizations/__init__.py +++ b/src/gitpod/resources/organizations/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .invite import ( - InviteResource, - AsyncInviteResource, - InviteResourceWithRawResponse, - AsyncInviteResourceWithRawResponse, - InviteResourceWithStreamingResponse, - AsyncInviteResourceWithStreamingResponse, +from .invites import ( + InvitesResource, + AsyncInvitesResource, + InvitesResourceWithRawResponse, + AsyncInvitesResourceWithRawResponse, + InvitesResourceWithStreamingResponse, + AsyncInvitesResourceWithStreamingResponse, ) from .organizations import ( OrganizationsResource, @@ -16,14 +16,28 @@ OrganizationsResourceWithStreamingResponse, AsyncOrganizationsResourceWithStreamingResponse, ) +from .sso_configurations import ( + SSOConfigurationsResource, + AsyncSSOConfigurationsResource, + SSOConfigurationsResourceWithRawResponse, + AsyncSSOConfigurationsResourceWithRawResponse, + SSOConfigurationsResourceWithStreamingResponse, + AsyncSSOConfigurationsResourceWithStreamingResponse, +) __all__ = [ - "InviteResource", - "AsyncInviteResource", - "InviteResourceWithRawResponse", - "AsyncInviteResourceWithRawResponse", - "InviteResourceWithStreamingResponse", - "AsyncInviteResourceWithStreamingResponse", + "InvitesResource", + "AsyncInvitesResource", + "InvitesResourceWithRawResponse", + "AsyncInvitesResourceWithRawResponse", + "InvitesResourceWithStreamingResponse", + "AsyncInvitesResourceWithStreamingResponse", + "SSOConfigurationsResource", + "AsyncSSOConfigurationsResource", + "SSOConfigurationsResourceWithRawResponse", + "AsyncSSOConfigurationsResourceWithRawResponse", + "SSOConfigurationsResourceWithStreamingResponse", + "AsyncSSOConfigurationsResourceWithStreamingResponse", "OrganizationsResource", "AsyncOrganizationsResource", "OrganizationsResourceWithRawResponse", diff --git a/src/gitpod/resources/organizations/invite/__init__.py b/src/gitpod/resources/organizations/invite/__init__.py deleted file mode 100644 index 439e89d5..00000000 --- a/src/gitpod/resources/organizations/invite/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .invite import ( - InviteResource, - AsyncInviteResource, - InviteResourceWithRawResponse, - AsyncInviteResourceWithRawResponse, - InviteResourceWithStreamingResponse, - AsyncInviteResourceWithStreamingResponse, -) -from .summary import ( - SummaryResource, - AsyncSummaryResource, - SummaryResourceWithRawResponse, - AsyncSummaryResourceWithRawResponse, - SummaryResourceWithStreamingResponse, - AsyncSummaryResourceWithStreamingResponse, -) - -__all__ = [ - "SummaryResource", - "AsyncSummaryResource", - "SummaryResourceWithRawResponse", - "AsyncSummaryResourceWithRawResponse", - "SummaryResourceWithStreamingResponse", - "AsyncSummaryResourceWithStreamingResponse", - "InviteResource", - "AsyncInviteResource", - "InviteResourceWithRawResponse", - "AsyncInviteResourceWithRawResponse", - "InviteResourceWithStreamingResponse", - "AsyncInviteResourceWithStreamingResponse", -] diff --git a/src/gitpod/resources/organizations/invite/invite.py b/src/gitpod/resources/organizations/invite/invite.py deleted file mode 100644 index aa334caf..00000000 --- a/src/gitpod/resources/organizations/invite/invite.py +++ /dev/null @@ -1,351 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from .summary import ( - SummaryResource, - AsyncSummaryResource, - SummaryResourceWithRawResponse, - AsyncSummaryResourceWithRawResponse, - SummaryResourceWithStreamingResponse, - AsyncSummaryResourceWithStreamingResponse, -) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._base_client import make_request_options -from ....types.organizations import invite_create_params, invite_retrieve_params -from ....types.organizations.invite_create_response import InviteCreateResponse -from ....types.organizations.invite_retrieve_response import InviteRetrieveResponse - -__all__ = ["InviteResource", "AsyncInviteResource"] - - -class InviteResource(SyncAPIResource): - @cached_property - def summary(self) -> SummaryResource: - return SummaryResource(self._client) - - @cached_property - def with_raw_response(self) -> InviteResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return InviteResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> InviteResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return InviteResourceWithStreamingResponse(self) - - def create( - self, - *, - connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InviteCreateResponse: - """CreateOrganizationInvite creates an invite for the organization. - - Any existing - OrganizationInvites are invalidated and can no longer be used. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.OrganizationService/CreateOrganizationInvite", - body=maybe_transform({"organization_id": organization_id}, invite_create_params.InviteCreateParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InviteCreateResponse, - ) - - def retrieve( - self, - *, - connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InviteRetrieveResponse: - """GetOrganizationInvite retrieves invite for the organization. - - If no invite - exists, a new one is created. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.OrganizationService/GetOrganizationInvite", - body=maybe_transform({"organization_id": organization_id}, invite_retrieve_params.InviteRetrieveParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InviteRetrieveResponse, - ) - - -class AsyncInviteResource(AsyncAPIResource): - @cached_property - def summary(self) -> AsyncSummaryResource: - return AsyncSummaryResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncInviteResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncInviteResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncInviteResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncInviteResourceWithStreamingResponse(self) - - async def create( - self, - *, - connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InviteCreateResponse: - """CreateOrganizationInvite creates an invite for the organization. - - Any existing - OrganizationInvites are invalidated and can no longer be used. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.OrganizationService/CreateOrganizationInvite", - body=await async_maybe_transform( - {"organization_id": organization_id}, invite_create_params.InviteCreateParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InviteCreateResponse, - ) - - async def retrieve( - self, - *, - connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InviteRetrieveResponse: - """GetOrganizationInvite retrieves invite for the organization. - - If no invite - exists, a new one is created. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.OrganizationService/GetOrganizationInvite", - body=await async_maybe_transform( - {"organization_id": organization_id}, invite_retrieve_params.InviteRetrieveParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InviteRetrieveResponse, - ) - - -class InviteResourceWithRawResponse: - def __init__(self, invite: InviteResource) -> None: - self._invite = invite - - self.create = to_raw_response_wrapper( - invite.create, - ) - self.retrieve = to_raw_response_wrapper( - invite.retrieve, - ) - - @cached_property - def summary(self) -> SummaryResourceWithRawResponse: - return SummaryResourceWithRawResponse(self._invite.summary) - - -class AsyncInviteResourceWithRawResponse: - def __init__(self, invite: AsyncInviteResource) -> None: - self._invite = invite - - self.create = async_to_raw_response_wrapper( - invite.create, - ) - self.retrieve = async_to_raw_response_wrapper( - invite.retrieve, - ) - - @cached_property - def summary(self) -> AsyncSummaryResourceWithRawResponse: - return AsyncSummaryResourceWithRawResponse(self._invite.summary) - - -class InviteResourceWithStreamingResponse: - def __init__(self, invite: InviteResource) -> None: - self._invite = invite - - self.create = to_streamed_response_wrapper( - invite.create, - ) - self.retrieve = to_streamed_response_wrapper( - invite.retrieve, - ) - - @cached_property - def summary(self) -> SummaryResourceWithStreamingResponse: - return SummaryResourceWithStreamingResponse(self._invite.summary) - - -class AsyncInviteResourceWithStreamingResponse: - def __init__(self, invite: AsyncInviteResource) -> None: - self._invite = invite - - self.create = async_to_streamed_response_wrapper( - invite.create, - ) - self.retrieve = async_to_streamed_response_wrapper( - invite.retrieve, - ) - - @cached_property - def summary(self) -> AsyncSummaryResourceWithStreamingResponse: - return AsyncSummaryResourceWithStreamingResponse(self._invite.summary) diff --git a/src/gitpod/resources/projects.py b/src/gitpod/resources/organizations/invites.py similarity index 58% rename from src/gitpod/resources/projects.py rename to src/gitpod/resources/organizations/invites.py index cb1195af..81e26e80 100644 --- a/src/gitpod/resources/projects.py +++ b/src/gitpod/resources/organizations/invites.py @@ -6,63 +6,55 @@ import httpx -from ..types import ( - project_create_params, - project_retrieve_params, - project_create_from_environment_params, -) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( is_given, maybe_transform, strip_not_given, async_maybe_transform, ) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options -from ..types.project_create_response import ProjectCreateResponse -from ..types.project_retrieve_response import ProjectRetrieveResponse -from ..types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse +from ..._base_client import make_request_options +from ...types.organizations import invite_create_params, invite_retrieve_params, invite_get_summary_params +from ...types.organizations.invite_create_response import InviteCreateResponse +from ...types.organizations.invite_retrieve_response import InviteRetrieveResponse +from ...types.organizations.invite_get_summary_response import InviteGetSummaryResponse -__all__ = ["ProjectsResource", "AsyncProjectsResource"] +__all__ = ["InvitesResource", "AsyncInvitesResource"] -class ProjectsResource(SyncAPIResource): +class InvitesResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> ProjectsResourceWithRawResponse: + def with_raw_response(self) -> InvitesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return ProjectsResourceWithRawResponse(self) + return InvitesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: + def with_streaming_response(self) -> InvitesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return ProjectsResourceWithStreamingResponse(self) + return InvitesResourceWithStreamingResponse(self) def create( self, *, - environment_class: project_create_params.EnvironmentClass, - initializer: project_create_params.Initializer, connect_protocol_version: Literal[1], - automations_file_path: str | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,29 +62,15 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectCreateResponse: - """ - CreateProject creates a new Project. + ) -> InviteCreateResponse: + """CreateOrganizationInvite creates an invite for the organization. - Args: - initializer: EnvironmentInitializer specifies how an environment is to be initialized + Any existing + OrganizationInvites are invalidated and can no longer be used. + Args: connect_protocol_version: Define the version of the Connect protocol - automations_file_path: automations_file_path is the path to the automations file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches("^$|^[^/].*") - ``` - - devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches("^$|^[^/].*") - ``` - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -113,28 +91,19 @@ def create( **(extra_headers or {}), } return self._post( - "/gitpod.v1.ProjectService/CreateProject", - body=maybe_transform( - { - "environment_class": environment_class, - "initializer": initializer, - "automations_file_path": automations_file_path, - "devcontainer_file_path": devcontainer_file_path, - "name": name, - }, - project_create_params.ProjectCreateParams, - ), + "/gitpod.v1.OrganizationService/CreateOrganizationInvite", + body=maybe_transform({"organization_id": organization_id}, invite_create_params.InviteCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ProjectCreateResponse, + cast_to=InviteCreateResponse, ) def retrieve( self, *, connect_protocol_version: Literal[1], - project_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -142,15 +111,15 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectRetrieveResponse: - """ - GetProject retrieves a single Project. + ) -> InviteRetrieveResponse: + """GetOrganizationInvite retrieves invite for the organization. + + If no invite + exists, a new one is created. Args: connect_protocol_version: Define the version of the Connect protocol - project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -171,20 +140,23 @@ def retrieve( **(extra_headers or {}), } return self._post( - "/gitpod.v1.ProjectService/GetProject", - body=maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), + "/gitpod.v1.OrganizationService/GetOrganizationInvite", + body=maybe_transform({"organization_id": organization_id}, invite_retrieve_params.InviteRetrieveParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ProjectRetrieveResponse, + cast_to=InviteRetrieveResponse, ) - def create_from_environment( + def get_summary( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -192,14 +164,24 @@ def create_from_environment( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectCreateFromEnvironmentResponse: + ) -> InviteGetSummaryResponse: """ - CreateProject creates a new Project using an environment as template. + GetOrganizationInviteSummary retrieves a summary of the organization based on an + Invite ID. + + Used to discover which organization an invite is for. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment identifier + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -220,51 +202,53 @@ def create_from_environment( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", - body=maybe_transform( - { - "environment_id": environment_id, - "name": name, - }, - project_create_from_environment_params.ProjectCreateFromEnvironmentParams, - ), + return self._get( + "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + invite_get_summary_params.InviteGetSummaryParams, + ), ), - cast_to=ProjectCreateFromEnvironmentResponse, + cast_to=InviteGetSummaryResponse, ) -class AsyncProjectsResource(AsyncAPIResource): +class AsyncInvitesResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: + def with_raw_response(self) -> AsyncInvitesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return AsyncProjectsResourceWithRawResponse(self) + return AsyncInvitesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncInvitesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return AsyncProjectsResourceWithStreamingResponse(self) + return AsyncInvitesResourceWithStreamingResponse(self) async def create( self, *, - environment_class: project_create_params.EnvironmentClass, - initializer: project_create_params.Initializer, connect_protocol_version: Literal[1], - automations_file_path: str | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -272,29 +256,15 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectCreateResponse: - """ - CreateProject creates a new Project. + ) -> InviteCreateResponse: + """CreateOrganizationInvite creates an invite for the organization. - Args: - initializer: EnvironmentInitializer specifies how an environment is to be initialized + Any existing + OrganizationInvites are invalidated and can no longer be used. + Args: connect_protocol_version: Define the version of the Connect protocol - automations_file_path: automations_file_path is the path to the automations file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches("^$|^[^/].*") - ``` - - devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches("^$|^[^/].*") - ``` - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -315,28 +285,21 @@ async def create( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.ProjectService/CreateProject", + "/gitpod.v1.OrganizationService/CreateOrganizationInvite", body=await async_maybe_transform( - { - "environment_class": environment_class, - "initializer": initializer, - "automations_file_path": automations_file_path, - "devcontainer_file_path": devcontainer_file_path, - "name": name, - }, - project_create_params.ProjectCreateParams, + {"organization_id": organization_id}, invite_create_params.InviteCreateParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ProjectCreateResponse, + cast_to=InviteCreateResponse, ) async def retrieve( self, *, connect_protocol_version: Literal[1], - project_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -344,15 +307,15 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectRetrieveResponse: - """ - GetProject retrieves a single Project. + ) -> InviteRetrieveResponse: + """GetOrganizationInvite retrieves invite for the organization. + + If no invite + exists, a new one is created. Args: connect_protocol_version: Define the version of the Connect protocol - project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -373,20 +336,25 @@ async def retrieve( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.ProjectService/GetProject", - body=await async_maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), + "/gitpod.v1.OrganizationService/GetOrganizationInvite", + body=await async_maybe_transform( + {"organization_id": organization_id}, invite_retrieve_params.InviteRetrieveParams + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ProjectRetrieveResponse, + cast_to=InviteRetrieveResponse, ) - async def create_from_environment( + async def get_summary( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -394,14 +362,24 @@ async def create_from_environment( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectCreateFromEnvironmentResponse: + ) -> InviteGetSummaryResponse: """ - CreateProject creates a new Project using an environment as template. + GetOrganizationInviteSummary retrieves a summary of the organization based on an + Invite ID. + + Used to discover which organization an invite is for. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment identifier + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -422,77 +400,83 @@ async def create_from_environment( ), **(extra_headers or {}), } - return await self._post( - "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", - body=await async_maybe_transform( - { - "environment_id": environment_id, - "name": name, - }, - project_create_from_environment_params.ProjectCreateFromEnvironmentParams, - ), + return await self._get( + "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + invite_get_summary_params.InviteGetSummaryParams, + ), ), - cast_to=ProjectCreateFromEnvironmentResponse, + cast_to=InviteGetSummaryResponse, ) -class ProjectsResourceWithRawResponse: - def __init__(self, projects: ProjectsResource) -> None: - self._projects = projects +class InvitesResourceWithRawResponse: + def __init__(self, invites: InvitesResource) -> None: + self._invites = invites self.create = to_raw_response_wrapper( - projects.create, + invites.create, ) self.retrieve = to_raw_response_wrapper( - projects.retrieve, + invites.retrieve, ) - self.create_from_environment = to_raw_response_wrapper( - projects.create_from_environment, + self.get_summary = to_raw_response_wrapper( + invites.get_summary, ) -class AsyncProjectsResourceWithRawResponse: - def __init__(self, projects: AsyncProjectsResource) -> None: - self._projects = projects +class AsyncInvitesResourceWithRawResponse: + def __init__(self, invites: AsyncInvitesResource) -> None: + self._invites = invites self.create = async_to_raw_response_wrapper( - projects.create, + invites.create, ) self.retrieve = async_to_raw_response_wrapper( - projects.retrieve, + invites.retrieve, ) - self.create_from_environment = async_to_raw_response_wrapper( - projects.create_from_environment, + self.get_summary = async_to_raw_response_wrapper( + invites.get_summary, ) -class ProjectsResourceWithStreamingResponse: - def __init__(self, projects: ProjectsResource) -> None: - self._projects = projects +class InvitesResourceWithStreamingResponse: + def __init__(self, invites: InvitesResource) -> None: + self._invites = invites self.create = to_streamed_response_wrapper( - projects.create, + invites.create, ) self.retrieve = to_streamed_response_wrapper( - projects.retrieve, + invites.retrieve, ) - self.create_from_environment = to_streamed_response_wrapper( - projects.create_from_environment, + self.get_summary = to_streamed_response_wrapper( + invites.get_summary, ) -class AsyncProjectsResourceWithStreamingResponse: - def __init__(self, projects: AsyncProjectsResource) -> None: - self._projects = projects +class AsyncInvitesResourceWithStreamingResponse: + def __init__(self, invites: AsyncInvitesResource) -> None: + self._invites = invites self.create = async_to_streamed_response_wrapper( - projects.create, + invites.create, ) self.retrieve = async_to_streamed_response_wrapper( - projects.retrieve, + invites.retrieve, ) - self.create_from_environment = async_to_streamed_response_wrapper( - projects.create_from_environment, + self.get_summary = async_to_streamed_response_wrapper( + invites.get_summary, ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index c081923a..04dddd1a 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -2,18 +2,33 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ...types import ( + organization_join_params, + organization_list_params, organization_leave_params, + organization_create_params, + organization_delete_params, + organization_update_params, + organization_retrieve_params, organization_set_role_params, organization_list_members_params, ) +from .invites import ( + InvitesResource, + AsyncInvitesResource, + InvitesResourceWithRawResponse, + AsyncInvitesResourceWithRawResponse, + InvitesResourceWithStreamingResponse, + AsyncInvitesResourceWithStreamingResponse, +) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -26,49 +41,908 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .invite.invite import ( - InviteResource, - AsyncInviteResource, - InviteResourceWithRawResponse, - AsyncInviteResourceWithRawResponse, - InviteResourceWithStreamingResponse, - AsyncInviteResourceWithStreamingResponse, -) from ..._base_client import make_request_options +from .sso_configurations import ( + SSOConfigurationsResource, + AsyncSSOConfigurationsResource, + SSOConfigurationsResourceWithRawResponse, + AsyncSSOConfigurationsResourceWithRawResponse, + SSOConfigurationsResourceWithStreamingResponse, + AsyncSSOConfigurationsResourceWithStreamingResponse, +) +from ...types.organization_join_response import OrganizationJoinResponse +from ...types.organization_list_response import OrganizationListResponse +from ...types.organization_create_response import OrganizationCreateResponse +from ...types.organization_update_response import OrganizationUpdateResponse +from ...types.organization_retrieve_response import OrganizationRetrieveResponse from ...types.organization_list_members_response import OrganizationListMembersResponse -__all__ = ["OrganizationsResource", "AsyncOrganizationsResource"] +__all__ = ["OrganizationsResource", "AsyncOrganizationsResource"] + + +class OrganizationsResource(SyncAPIResource): + @cached_property + def invites(self) -> InvitesResource: + return InvitesResource(self._client) + + @cached_property + def sso_configurations(self) -> SSOConfigurationsResource: + return SSOConfigurationsResource(self._client) + + @cached_property + def with_raw_response(self) -> OrganizationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return OrganizationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return OrganizationsResourceWithStreamingResponse(self) + + def create( + self, + *, + connect_protocol_version: Literal[1], + invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, + join_organization: bool | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationCreateResponse: + """ + CreateOrganization creates a new Organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + invite_accounts_with_matching_domain: Should other Accounts with the same domain be automatically invited to the + organization? + + join_organization: join_organization decides whether the Identity issuing this request joins the + org on creation + + name: name is the organization name + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/CreateOrganization", + body=maybe_transform( + { + "invite_accounts_with_matching_domain": invite_accounts_with_matching_domain, + "join_organization": join_organization, + "name": name, + }, + organization_create_params.OrganizationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=OrganizationCreateResponse, + ) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationRetrieveResponse: + """ + GetOrganization retrieves a single Organization. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.OrganizationService/GetOrganization", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + organization_retrieve_params.OrganizationRetrieveParams, + ), + ), + cast_to=OrganizationRetrieveResponse, + ) + + @overload + def update( + self, + *, + invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationUpdateResponse: + """ + UpdateOrganization updates the properties of an Organization. + + Args: + invite_domains: invite_domains is the domain allowlist of the organization + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationUpdateResponse: + """ + UpdateOrganization updates the properties of an Organization. + + Args: + name: name is the new name of the organization + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["invite_domains", "connect_protocol_version"], ["name", "connect_protocol_version"]) + def update( + self, + *, + invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains + | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationUpdateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/UpdateOrganization", + body=maybe_transform( + { + "invite_domains": invite_domains, + "name": name, + }, + organization_update_params.OrganizationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=OrganizationUpdateResponse, + ) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationListResponse: + """ + ListOrganizations lists all organization the caller has access to. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.OrganizationService/ListOrganizations", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + organization_list_params.OrganizationListParams, + ), + ), + cast_to=OrganizationListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteOrganization deletes the specified organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + organization_id: organization_id is the ID of the organization to delete + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/DeleteOrganization", + body=maybe_transform( + {"organization_id": organization_id}, organization_delete_params.OrganizationDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + @overload + def join( + self, + *, + invite_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationJoinResponse: + """ + JoinOrganization lets accounts join an Organization. + + Args: + invite_id: invite_id is the unique identifier of the invite to join the organization. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def join( + self, + *, + organization_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationJoinResponse: + """ + JoinOrganization lets accounts join an Organization. + + Args: + organization_id: organization_id is the unique identifier of the Organization to join. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["invite_id", "connect_protocol_version"], ["organization_id", "connect_protocol_version"]) + def join( + self, + *, + invite_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationJoinResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/JoinOrganization", + body=maybe_transform( + { + "invite_id": invite_id, + "organization_id": organization_id, + }, + organization_join_params.OrganizationJoinParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=OrganizationJoinResponse, + ) + + def leave( + self, + *, + connect_protocol_version: Literal[1], + user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + LeaveOrganization lets the passed user leave an Organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/LeaveOrganization", + body=maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_members( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationListMembersResponse: + """ + ListMembers lists all members of the specified organization. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.OrganizationService/ListMembers", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + organization_list_members_params.OrganizationListMembersParams, + ), + ), + cast_to=OrganizationListMembersResponse, + ) + + def set_role( + self, + *, + connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, + role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] + | NotGiven = NOT_GIVEN, + user_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + SetRole + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/SetRole", + body=maybe_transform( + { + "organization_id": organization_id, + "role": role, + "user_id": user_id, + }, + organization_set_role_params.OrganizationSetRoleParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncOrganizationsResource(AsyncAPIResource): + @cached_property + def invites(self) -> AsyncInvitesResource: + return AsyncInvitesResource(self._client) + + @cached_property + def sso_configurations(self) -> AsyncSSOConfigurationsResource: + return AsyncSSOConfigurationsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncOrganizationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncOrganizationsResourceWithStreamingResponse(self) + + async def create( + self, + *, + connect_protocol_version: Literal[1], + invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, + join_organization: bool | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationCreateResponse: + """ + CreateOrganization creates a new Organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + invite_accounts_with_matching_domain: Should other Accounts with the same domain be automatically invited to the + organization? + + join_organization: join_organization decides whether the Identity issuing this request joins the + org on creation + + name: name is the organization name + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/CreateOrganization", + body=await async_maybe_transform( + { + "invite_accounts_with_matching_domain": invite_accounts_with_matching_domain, + "join_organization": join_organization, + "name": name, + }, + organization_create_params.OrganizationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=OrganizationCreateResponse, + ) + + async def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationRetrieveResponse: + """ + GetOrganization retrieves a single Organization. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol -class OrganizationsResource(SyncAPIResource): - @cached_property - def invite(self) -> InviteResource: - return InviteResource(self._client) + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data - @cached_property - def with_raw_response(self) -> OrganizationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. + compression: Which compression algorithm to use for this request - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ - return OrganizationsResourceWithRawResponse(self) + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.OrganizationService/GetOrganization", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + organization_retrieve_params.OrganizationRetrieveParams, + ), + ), + cast_to=OrganizationRetrieveResponse, + ) - @cached_property - def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: + @overload + async def update( + self, + *, + invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationUpdateResponse: """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. + UpdateOrganization updates the properties of an Organization. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + Args: + invite_domains: invite_domains is the domain allowlist of the organization + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ - return OrganizationsResourceWithStreamingResponse(self) + ... - def leave( + @overload + async def update( self, *, + name: str, connect_protocol_version: Literal[1], - user_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,11 +950,13 @@ def leave( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> OrganizationUpdateResponse: """ - LeaveOrganization lets the passed user leave an Organization. + UpdateOrganization updates the properties of an Organization. Args: + name: name is the new name of the organization + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -93,6 +969,24 @@ def leave( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["invite_domains", "connect_protocol_version"], ["name", "connect_protocol_version"]) + async def update( + self, + *, + invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains + | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationUpdateResponse: extra_headers = { **strip_not_given( { @@ -102,21 +996,30 @@ def leave( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.OrganizationService/LeaveOrganization", - body=maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), + return await self._post( + "/gitpod.v1.OrganizationService/UpdateOrganization", + body=await async_maybe_transform( + { + "invite_domains": invite_domains, + "name": name, + }, + organization_update_params.OrganizationUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=object, + cast_to=OrganizationUpdateResponse, ) - def list_members( + async def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, - pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -124,16 +1027,21 @@ def list_members( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationListMembersResponse: + ) -> OrganizationListResponse: """ - ListMembers lists all members of the specified organization. + ListOrganizations lists all organization the caller has access to. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization to list members for + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request - pagination: pagination contains the pagination options for listing members + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -154,29 +1062,32 @@ def list_members( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.OrganizationService/ListMembers", - body=maybe_transform( - { - "organization_id": organization_id, - "pagination": pagination, - }, - organization_list_members_params.OrganizationListMembersParams, - ), + return await self._get( + "/gitpod.v1.OrganizationService/ListOrganizations", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + organization_list_params.OrganizationListParams, + ), ), - cast_to=OrganizationListMembersResponse, + cast_to=OrganizationListResponse, ) - def set_role( + async def delete( self, *, connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] - | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -186,11 +1097,13 @@ def set_role( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - SetRole + DeleteOrganization deletes the specified organization. Args: connect_protocol_version: Define the version of the Connect protocol + organization_id: organization_id is the ID of the organization to delete + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -210,15 +1123,10 @@ def set_role( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.OrganizationService/SetRole", - body=maybe_transform( - { - "organization_id": organization_id, - "role": role, - "user_id": user_id, - }, - organization_set_role_params.OrganizationSetRoleParams, + return await self._post( + "/gitpod.v1.OrganizationService/DeleteOrganization", + body=await async_maybe_transform( + {"organization_id": organization_id}, organization_delete_params.OrganizationDeleteParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -226,30 +1134,112 @@ def set_role( cast_to=object, ) + @overload + async def join( + self, + *, + invite_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationJoinResponse: + """ + JoinOrganization lets accounts join an Organization. + + Args: + invite_id: invite_id is the unique identifier of the invite to join the organization. -class AsyncOrganizationsResource(AsyncAPIResource): - @cached_property - def invite(self) -> AsyncInviteResource: - return AsyncInviteResource(self._client) + connect_protocol_version: Define the version of the Connect protocol - @cached_property - def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. + connect_timeout_ms: Define the timeout, in ms - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ - return AsyncOrganizationsResourceWithRawResponse(self) + ... - @cached_property - def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResponse: + @overload + async def join( + self, + *, + organization_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationJoinResponse: """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. + JoinOrganization lets accounts join an Organization. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + Args: + organization_id: organization_id is the unique identifier of the Organization to join. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ - return AsyncOrganizationsResourceWithStreamingResponse(self) + ... + + @required_args(["invite_id", "connect_protocol_version"], ["organization_id", "connect_protocol_version"]) + async def join( + self, + *, + invite_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationJoinResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/JoinOrganization", + body=await async_maybe_transform( + { + "invite_id": invite_id, + "organization_id": organization_id, + }, + organization_join_params.OrganizationJoinParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=OrganizationJoinResponse, + ) async def leave( self, @@ -301,9 +1291,12 @@ async def leave( async def list_members( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, - pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -316,11 +1309,16 @@ async def list_members( ListMembers lists all members of the specified organization. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization to list members for + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data - pagination: pagination contains the pagination options for listing members + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -341,17 +1339,23 @@ async def list_members( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.OrganizationService/ListMembers", - body=await async_maybe_transform( - { - "organization_id": organization_id, - "pagination": pagination, - }, - organization_list_members_params.OrganizationListMembersParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + organization_list_members_params.OrganizationListMembersParams, + ), ), cast_to=OrganizationListMembersResponse, ) @@ -418,6 +1422,24 @@ class OrganizationsResourceWithRawResponse: def __init__(self, organizations: OrganizationsResource) -> None: self._organizations = organizations + self.create = to_raw_response_wrapper( + organizations.create, + ) + self.retrieve = to_raw_response_wrapper( + organizations.retrieve, + ) + self.update = to_raw_response_wrapper( + organizations.update, + ) + self.list = to_raw_response_wrapper( + organizations.list, + ) + self.delete = to_raw_response_wrapper( + organizations.delete, + ) + self.join = to_raw_response_wrapper( + organizations.join, + ) self.leave = to_raw_response_wrapper( organizations.leave, ) @@ -429,14 +1451,36 @@ def __init__(self, organizations: OrganizationsResource) -> None: ) @cached_property - def invite(self) -> InviteResourceWithRawResponse: - return InviteResourceWithRawResponse(self._organizations.invite) + def invites(self) -> InvitesResourceWithRawResponse: + return InvitesResourceWithRawResponse(self._organizations.invites) + + @cached_property + def sso_configurations(self) -> SSOConfigurationsResourceWithRawResponse: + return SSOConfigurationsResourceWithRawResponse(self._organizations.sso_configurations) class AsyncOrganizationsResourceWithRawResponse: def __init__(self, organizations: AsyncOrganizationsResource) -> None: self._organizations = organizations + self.create = async_to_raw_response_wrapper( + organizations.create, + ) + self.retrieve = async_to_raw_response_wrapper( + organizations.retrieve, + ) + self.update = async_to_raw_response_wrapper( + organizations.update, + ) + self.list = async_to_raw_response_wrapper( + organizations.list, + ) + self.delete = async_to_raw_response_wrapper( + organizations.delete, + ) + self.join = async_to_raw_response_wrapper( + organizations.join, + ) self.leave = async_to_raw_response_wrapper( organizations.leave, ) @@ -448,14 +1492,36 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: ) @cached_property - def invite(self) -> AsyncInviteResourceWithRawResponse: - return AsyncInviteResourceWithRawResponse(self._organizations.invite) + def invites(self) -> AsyncInvitesResourceWithRawResponse: + return AsyncInvitesResourceWithRawResponse(self._organizations.invites) + + @cached_property + def sso_configurations(self) -> AsyncSSOConfigurationsResourceWithRawResponse: + return AsyncSSOConfigurationsResourceWithRawResponse(self._organizations.sso_configurations) class OrganizationsResourceWithStreamingResponse: def __init__(self, organizations: OrganizationsResource) -> None: self._organizations = organizations + self.create = to_streamed_response_wrapper( + organizations.create, + ) + self.retrieve = to_streamed_response_wrapper( + organizations.retrieve, + ) + self.update = to_streamed_response_wrapper( + organizations.update, + ) + self.list = to_streamed_response_wrapper( + organizations.list, + ) + self.delete = to_streamed_response_wrapper( + organizations.delete, + ) + self.join = to_streamed_response_wrapper( + organizations.join, + ) self.leave = to_streamed_response_wrapper( organizations.leave, ) @@ -467,14 +1533,36 @@ def __init__(self, organizations: OrganizationsResource) -> None: ) @cached_property - def invite(self) -> InviteResourceWithStreamingResponse: - return InviteResourceWithStreamingResponse(self._organizations.invite) + def invites(self) -> InvitesResourceWithStreamingResponse: + return InvitesResourceWithStreamingResponse(self._organizations.invites) + + @cached_property + def sso_configurations(self) -> SSOConfigurationsResourceWithStreamingResponse: + return SSOConfigurationsResourceWithStreamingResponse(self._organizations.sso_configurations) class AsyncOrganizationsResourceWithStreamingResponse: def __init__(self, organizations: AsyncOrganizationsResource) -> None: self._organizations = organizations + self.create = async_to_streamed_response_wrapper( + organizations.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + organizations.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + organizations.update, + ) + self.list = async_to_streamed_response_wrapper( + organizations.list, + ) + self.delete = async_to_streamed_response_wrapper( + organizations.delete, + ) + self.join = async_to_streamed_response_wrapper( + organizations.join, + ) self.leave = async_to_streamed_response_wrapper( organizations.leave, ) @@ -486,5 +1574,9 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: ) @cached_property - def invite(self) -> AsyncInviteResourceWithStreamingResponse: - return AsyncInviteResourceWithStreamingResponse(self._organizations.invite) + def invites(self) -> AsyncInvitesResourceWithStreamingResponse: + return AsyncInvitesResourceWithStreamingResponse(self._organizations.invites) + + @cached_property + def sso_configurations(self) -> AsyncSSOConfigurationsResourceWithStreamingResponse: + return AsyncSSOConfigurationsResourceWithStreamingResponse(self._organizations.sso_configurations) diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py new file mode 100644 index 00000000..986668af --- /dev/null +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -0,0 +1,1135 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, overload + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + required_args, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.organizations import ( + sso_configuration_list_params, + sso_configuration_create_params, + sso_configuration_delete_params, + sso_configuration_update_params, + sso_configuration_retrieve_params, +) +from ...types.organizations.sso_configuration_list_response import SSOConfigurationListResponse +from ...types.organizations.sso_configuration_create_response import SSOConfigurationCreateResponse +from ...types.organizations.sso_configuration_retrieve_response import SSOConfigurationRetrieveResponse + +__all__ = ["SSOConfigurationsResource", "AsyncSSOConfigurationsResource"] + + +class SSOConfigurationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SSOConfigurationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return SSOConfigurationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SSOConfigurationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return SSOConfigurationsResourceWithStreamingResponse(self) + + def create( + self, + *, + connect_protocol_version: Literal[1], + client_id: str | NotGiven = NOT_GIVEN, + client_secret: str | NotGiven = NOT_GIVEN, + email_domain: str | NotGiven = NOT_GIVEN, + issuer_url: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SSOConfigurationCreateResponse: + """ + CreateSSOConfiguration creates a new SSO configuration for the organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + client_id: client_id is the client ID of the OIDC application set on the IdP + + client_secret: client_secret is the client secret of the OIDC application set on the IdP + + email_domain: email_domain is the domain that is allowed to sign in to the organization + + issuer_url: issuer_url is the URL of the IdP issuer + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/CreateSSOConfiguration", + body=maybe_transform( + { + "client_id": client_id, + "client_secret": client_secret, + "email_domain": email_domain, + "issuer_url": issuer_url, + "organization_id": organization_id, + }, + sso_configuration_create_params.SSOConfigurationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SSOConfigurationCreateResponse, + ) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SSOConfigurationRetrieveResponse: + """ + GetSSOConfiguration returns an SSO configuration. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.OrganizationService/GetSSOConfiguration", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + sso_configuration_retrieve_params.SSOConfigurationRetrieveParams, + ), + ), + cast_to=SSOConfigurationRetrieveResponse, + ) + + @overload + def update( + self, + *, + client_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + client_id: client_id is the client ID of the SSO provider + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + client_secret: client_secret is the client secret of the SSO provider + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + email_domain: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + issuer_url: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + issuer_url: issuer_url is the URL of the IdP issuer + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + state: Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ], + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + state: state is the state of the SSO configuration + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["client_id", "connect_protocol_version"], + ["client_secret", "connect_protocol_version"], + ["email_domain", "connect_protocol_version"], + ["issuer_url", "connect_protocol_version"], + ["state", "connect_protocol_version"], + ) + def update( + self, + *, + client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + client_secret: str | NotGiven = NOT_GIVEN, + email_domain: str | NotGiven = NOT_GIVEN, + issuer_url: str | NotGiven = NOT_GIVEN, + state: Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ] + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", + body=maybe_transform( + { + "client_id": client_id, + "client_secret": client_secret, + "email_domain": email_domain, + "issuer_url": issuer_url, + "state": state, + }, + sso_configuration_update_params.SSOConfigurationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SSOConfigurationListResponse: + """ + ListSSOConfigurations lists all SSO configurations matching provided filters. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.OrganizationService/ListSSOConfigurations", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + sso_configuration_list_params.SSOConfigurationListParams, + ), + ), + cast_to=SSOConfigurationListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + sso_configuration_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteSSOConfiguration deletes an SSO configuration. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.OrganizationService/DeleteSSOConfiguration", + body=maybe_transform( + {"sso_configuration_id": sso_configuration_id}, + sso_configuration_delete_params.SSOConfigurationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncSSOConfigurationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSSOConfigurationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncSSOConfigurationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSSOConfigurationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncSSOConfigurationsResourceWithStreamingResponse(self) + + async def create( + self, + *, + connect_protocol_version: Literal[1], + client_id: str | NotGiven = NOT_GIVEN, + client_secret: str | NotGiven = NOT_GIVEN, + email_domain: str | NotGiven = NOT_GIVEN, + issuer_url: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SSOConfigurationCreateResponse: + """ + CreateSSOConfiguration creates a new SSO configuration for the organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + client_id: client_id is the client ID of the OIDC application set on the IdP + + client_secret: client_secret is the client secret of the OIDC application set on the IdP + + email_domain: email_domain is the domain that is allowed to sign in to the organization + + issuer_url: issuer_url is the URL of the IdP issuer + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/CreateSSOConfiguration", + body=await async_maybe_transform( + { + "client_id": client_id, + "client_secret": client_secret, + "email_domain": email_domain, + "issuer_url": issuer_url, + "organization_id": organization_id, + }, + sso_configuration_create_params.SSOConfigurationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SSOConfigurationCreateResponse, + ) + + async def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SSOConfigurationRetrieveResponse: + """ + GetSSOConfiguration returns an SSO configuration. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.OrganizationService/GetSSOConfiguration", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + sso_configuration_retrieve_params.SSOConfigurationRetrieveParams, + ), + ), + cast_to=SSOConfigurationRetrieveResponse, + ) + + @overload + async def update( + self, + *, + client_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + client_id: client_id is the client ID of the SSO provider + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + client_secret: client_secret is the client secret of the SSO provider + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + email_domain: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + issuer_url: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + issuer_url: issuer_url is the URL of the IdP issuer + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + state: Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ], + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + state: state is the state of the SSO configuration + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["client_id", "connect_protocol_version"], + ["client_secret", "connect_protocol_version"], + ["email_domain", "connect_protocol_version"], + ["issuer_url", "connect_protocol_version"], + ["state", "connect_protocol_version"], + ) + async def update( + self, + *, + client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + client_secret: str | NotGiven = NOT_GIVEN, + email_domain: str | NotGiven = NOT_GIVEN, + issuer_url: str | NotGiven = NOT_GIVEN, + state: Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ] + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", + body=await async_maybe_transform( + { + "client_id": client_id, + "client_secret": client_secret, + "email_domain": email_domain, + "issuer_url": issuer_url, + "state": state, + }, + sso_configuration_update_params.SSOConfigurationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SSOConfigurationListResponse: + """ + ListSSOConfigurations lists all SSO configurations matching provided filters. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.OrganizationService/ListSSOConfigurations", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + sso_configuration_list_params.SSOConfigurationListParams, + ), + ), + cast_to=SSOConfigurationListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + sso_configuration_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteSSOConfiguration deletes an SSO configuration. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.OrganizationService/DeleteSSOConfiguration", + body=await async_maybe_transform( + {"sso_configuration_id": sso_configuration_id}, + sso_configuration_delete_params.SSOConfigurationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class SSOConfigurationsResourceWithRawResponse: + def __init__(self, sso_configurations: SSOConfigurationsResource) -> None: + self._sso_configurations = sso_configurations + + self.create = to_raw_response_wrapper( + sso_configurations.create, + ) + self.retrieve = to_raw_response_wrapper( + sso_configurations.retrieve, + ) + self.update = to_raw_response_wrapper( + sso_configurations.update, + ) + self.list = to_raw_response_wrapper( + sso_configurations.list, + ) + self.delete = to_raw_response_wrapper( + sso_configurations.delete, + ) + + +class AsyncSSOConfigurationsResourceWithRawResponse: + def __init__(self, sso_configurations: AsyncSSOConfigurationsResource) -> None: + self._sso_configurations = sso_configurations + + self.create = async_to_raw_response_wrapper( + sso_configurations.create, + ) + self.retrieve = async_to_raw_response_wrapper( + sso_configurations.retrieve, + ) + self.update = async_to_raw_response_wrapper( + sso_configurations.update, + ) + self.list = async_to_raw_response_wrapper( + sso_configurations.list, + ) + self.delete = async_to_raw_response_wrapper( + sso_configurations.delete, + ) + + +class SSOConfigurationsResourceWithStreamingResponse: + def __init__(self, sso_configurations: SSOConfigurationsResource) -> None: + self._sso_configurations = sso_configurations + + self.create = to_streamed_response_wrapper( + sso_configurations.create, + ) + self.retrieve = to_streamed_response_wrapper( + sso_configurations.retrieve, + ) + self.update = to_streamed_response_wrapper( + sso_configurations.update, + ) + self.list = to_streamed_response_wrapper( + sso_configurations.list, + ) + self.delete = to_streamed_response_wrapper( + sso_configurations.delete, + ) + + +class AsyncSSOConfigurationsResourceWithStreamingResponse: + def __init__(self, sso_configurations: AsyncSSOConfigurationsResource) -> None: + self._sso_configurations = sso_configurations + + self.create = async_to_streamed_response_wrapper( + sso_configurations.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + sso_configurations.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + sso_configurations.update, + ) + self.list = async_to_streamed_response_wrapper( + sso_configurations.list, + ) + self.delete = async_to_streamed_response_wrapper( + sso_configurations.delete, + ) diff --git a/src/gitpod/resources/personal_access_tokens.py b/src/gitpod/resources/personal_access_tokens.py deleted file mode 100644 index 4c13f958..00000000 --- a/src/gitpod/resources/personal_access_tokens.py +++ /dev/null @@ -1,326 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from ..types import personal_access_token_list_params, personal_access_token_delete_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options -from ..types.personal_access_token_list_response import PersonalAccessTokenListResponse - -__all__ = ["PersonalAccessTokensResource", "AsyncPersonalAccessTokensResource"] - - -class PersonalAccessTokensResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> PersonalAccessTokensResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return PersonalAccessTokensResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> PersonalAccessTokensResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return PersonalAccessTokensResourceWithStreamingResponse(self) - - def list( - self, - *, - connect_protocol_version: Literal[1], - filter: personal_access_token_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: personal_access_token_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PersonalAccessTokenListResponse: - """ - ListPersonalAccessTokens - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.UserService/ListPersonalAccessTokens", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - personal_access_token_list_params.PersonalAccessTokenListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=PersonalAccessTokenListResponse, - ) - - def delete( - self, - *, - connect_protocol_version: Literal[1], - personal_access_token_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - DeletePersonalAccessToken - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.UserService/DeletePersonalAccessToken", - body=maybe_transform( - {"personal_access_token_id": personal_access_token_id}, - personal_access_token_delete_params.PersonalAccessTokenDeleteParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncPersonalAccessTokensResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncPersonalAccessTokensResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncPersonalAccessTokensResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncPersonalAccessTokensResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncPersonalAccessTokensResourceWithStreamingResponse(self) - - async def list( - self, - *, - connect_protocol_version: Literal[1], - filter: personal_access_token_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: personal_access_token_list_params.Pagination | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PersonalAccessTokenListResponse: - """ - ListPersonalAccessTokens - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.UserService/ListPersonalAccessTokens", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - personal_access_token_list_params.PersonalAccessTokenListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=PersonalAccessTokenListResponse, - ) - - async def delete( - self, - *, - connect_protocol_version: Literal[1], - personal_access_token_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - DeletePersonalAccessToken - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.UserService/DeletePersonalAccessToken", - body=await async_maybe_transform( - {"personal_access_token_id": personal_access_token_id}, - personal_access_token_delete_params.PersonalAccessTokenDeleteParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class PersonalAccessTokensResourceWithRawResponse: - def __init__(self, personal_access_tokens: PersonalAccessTokensResource) -> None: - self._personal_access_tokens = personal_access_tokens - - self.list = to_raw_response_wrapper( - personal_access_tokens.list, - ) - self.delete = to_raw_response_wrapper( - personal_access_tokens.delete, - ) - - -class AsyncPersonalAccessTokensResourceWithRawResponse: - def __init__(self, personal_access_tokens: AsyncPersonalAccessTokensResource) -> None: - self._personal_access_tokens = personal_access_tokens - - self.list = async_to_raw_response_wrapper( - personal_access_tokens.list, - ) - self.delete = async_to_raw_response_wrapper( - personal_access_tokens.delete, - ) - - -class PersonalAccessTokensResourceWithStreamingResponse: - def __init__(self, personal_access_tokens: PersonalAccessTokensResource) -> None: - self._personal_access_tokens = personal_access_tokens - - self.list = to_streamed_response_wrapper( - personal_access_tokens.list, - ) - self.delete = to_streamed_response_wrapper( - personal_access_tokens.delete, - ) - - -class AsyncPersonalAccessTokensResourceWithStreamingResponse: - def __init__(self, personal_access_tokens: AsyncPersonalAccessTokensResource) -> None: - self._personal_access_tokens = personal_access_tokens - - self.list = async_to_streamed_response_wrapper( - personal_access_tokens.list, - ) - self.delete = async_to_streamed_response_wrapper( - personal_access_tokens.delete, - ) diff --git a/src/gitpod/resources/projects/__init__.py b/src/gitpod/resources/projects/__init__.py new file mode 100644 index 00000000..da8b9644 --- /dev/null +++ b/src/gitpod/resources/projects/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .policies import ( + PoliciesResource, + AsyncPoliciesResource, + PoliciesResourceWithRawResponse, + AsyncPoliciesResourceWithRawResponse, + PoliciesResourceWithStreamingResponse, + AsyncPoliciesResourceWithStreamingResponse, +) +from .projects import ( + ProjectsResource, + AsyncProjectsResource, + ProjectsResourceWithRawResponse, + AsyncProjectsResourceWithRawResponse, + ProjectsResourceWithStreamingResponse, + AsyncProjectsResourceWithStreamingResponse, +) + +__all__ = [ + "PoliciesResource", + "AsyncPoliciesResource", + "PoliciesResourceWithRawResponse", + "AsyncPoliciesResourceWithRawResponse", + "PoliciesResourceWithStreamingResponse", + "AsyncPoliciesResourceWithStreamingResponse", + "ProjectsResource", + "AsyncProjectsResource", + "ProjectsResourceWithRawResponse", + "AsyncProjectsResourceWithRawResponse", + "ProjectsResourceWithStreamingResponse", + "AsyncProjectsResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/environments/automations/task_executions.py b/src/gitpod/resources/projects/policies.py similarity index 53% rename from src/gitpod/resources/environments/automations/task_executions.py rename to src/gitpod/resources/projects/policies.py index f8c0c3c4..ee4a4825 100644 --- a/src/gitpod/resources/environments/automations/task_executions.py +++ b/src/gitpod/resources/projects/policies.py @@ -2,64 +2,61 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._base_client import make_request_options -from ....types.environments.automations import ( - task_execution_list_params, - task_execution_stop_params, - task_execution_retrieve_params, - task_execution_update_task_execution_status_params, -) -from ....types.environments.automations.task_execution_list_response import TaskExecutionListResponse -from ....types.environments.automations.task_execution_retrieve_response import TaskExecutionRetrieveResponse +from ..._base_client import make_request_options +from ...types.projects import policy_list_params, policy_create_params, policy_delete_params, policy_update_params +from ...types.projects.policy_list_response import PolicyListResponse +from ...types.projects.policy_create_response import PolicyCreateResponse +from ...types.projects.policy_update_response import PolicyUpdateResponse -__all__ = ["TaskExecutionsResource", "AsyncTaskExecutionsResource"] +__all__ = ["PoliciesResource", "AsyncPoliciesResource"] -class TaskExecutionsResource(SyncAPIResource): +class PoliciesResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> TaskExecutionsResourceWithRawResponse: + def with_raw_response(self) -> PoliciesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return TaskExecutionsResourceWithRawResponse(self) + return PoliciesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> TaskExecutionsResourceWithStreamingResponse: + def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return TaskExecutionsResourceWithStreamingResponse(self) + return PoliciesResourceWithStreamingResponse(self) - def retrieve( + def create( self, *, connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + group_id: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -67,13 +64,17 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionRetrieveResponse: + ) -> PolicyCreateResponse: """ - GetTaskExecution + CreateProjectPolicy creates a Project Policy. Args: connect_protocol_version: Define the version of the Connect protocol + group_id: group_id specifies the group_id identifier + + project_id: project_id specifies the project identifier + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -94,20 +95,28 @@ def retrieve( **(extra_headers or {}), } return self._post( - "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", - body=maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), + "/gitpod.v1.ProjectService/CreateProjectPolicy", + body=maybe_transform( + { + "group_id": group_id, + "project_id": project_id, + "role": role, + }, + policy_create_params.PolicyCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=TaskExecutionRetrieveResponse, + cast_to=PolicyCreateResponse, ) - def list( + def update( self, *, connect_protocol_version: Literal[1], - filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, + group_id: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -115,16 +124,16 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionListResponse: + ) -> PolicyUpdateResponse: """ - ListTaskExecutions + UpdateProjectPolicy updates a Project Policy. Args: connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing task runs + group_id: group_id specifies the group_id identifier - pagination: pagination contains the pagination options for listing task runs + project_id: project_id specifies the project identifier connect_timeout_ms: Define the timeout, in ms @@ -146,25 +155,30 @@ def list( **(extra_headers or {}), } return self._post( - "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + "/gitpod.v1.ProjectService/UpdateProjectPolicy", body=maybe_transform( { - "filter": filter, - "pagination": pagination, + "group_id": group_id, + "project_id": project_id, + "role": role, }, - task_execution_list_params.TaskExecutionListParams, + policy_update_params.PolicyUpdateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=TaskExecutionListResponse, + cast_to=PolicyUpdateResponse, ) - def stop( + def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -172,13 +186,22 @@ def stop( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> PolicyListResponse: """ - StopTaskExecution + ListProjectPolicies lists policies for a project. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -198,21 +221,33 @@ def stop( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", - body=maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), + return self._get( + "/gitpod.v1.ProjectService/ListProjectPolicies", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + policy_list_params.PolicyListParams, + ), ), - cast_to=object, + cast_to=PolicyListResponse, ) - @overload - def update_task_execution_status( + def delete( self, *, - failure_message: str, connect_protocol_version: Literal[1], + group_id: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -221,56 +256,15 @@ def update_task_execution_status( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """UpdateTaskExecutionStatus updates the status of a task execution. - - Only the - environment executing a task execution is expected to call this function. + """ + DeleteProjectPolicy deletes a Project Policy. Args: - failure_message: failure_message marks the task execution as failed and provides a message - explaining the failure. - - If an individual step has failed, callers are NOT expected to set this message; - only if the task execution as a whole has failed/cannot be started. - connect_protocol_version: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request + group_id: group_id specifies the group_id identifier - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update_task_execution_status( - self, - *, - log_url: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """UpdateTaskExecutionStatus updates the status of a task execution. - - Only the - environment executing a task execution is expected to call this function. - - Args: - log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task - either has no logs or has not yet started. - - connect_protocol_version: Define the version of the Connect protocol + project_id: project_id specifies the project identifier connect_timeout_ms: Define the timeout, in ms @@ -282,23 +276,6 @@ def update_task_execution_status( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["failure_message", "connect_protocol_version"], ["log_url", "connect_protocol_version"]) - def update_task_execution_status( - self, - *, - failure_message: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - log_url: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -309,13 +286,13 @@ def update_task_execution_status( **(extra_headers or {}), } return self._post( - "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", + "/gitpod.v1.ProjectService/DeleteProjectPolicy", body=maybe_transform( { - "failure_message": failure_message, - "log_url": log_url, + "group_id": group_id, + "project_id": project_id, }, - task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams, + policy_delete_params.PolicyDeleteParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -324,31 +301,33 @@ def update_task_execution_status( ) -class AsyncTaskExecutionsResource(AsyncAPIResource): +class AsyncPoliciesResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncTaskExecutionsResourceWithRawResponse: + def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return AsyncTaskExecutionsResourceWithRawResponse(self) + return AsyncPoliciesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncTaskExecutionsResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return AsyncTaskExecutionsResourceWithStreamingResponse(self) + return AsyncPoliciesResourceWithStreamingResponse(self) - async def retrieve( + async def create( self, *, connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + group_id: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -356,13 +335,17 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionRetrieveResponse: + ) -> PolicyCreateResponse: """ - GetTaskExecution + CreateProjectPolicy creates a Project Policy. Args: connect_protocol_version: Define the version of the Connect protocol + group_id: group_id specifies the group_id identifier + + project_id: project_id specifies the project identifier + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -383,20 +366,28 @@ async def retrieve( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", - body=await async_maybe_transform({"id": id}, task_execution_retrieve_params.TaskExecutionRetrieveParams), + "/gitpod.v1.ProjectService/CreateProjectPolicy", + body=await async_maybe_transform( + { + "group_id": group_id, + "project_id": project_id, + "role": role, + }, + policy_create_params.PolicyCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=TaskExecutionRetrieveResponse, + cast_to=PolicyCreateResponse, ) - async def list( + async def update( self, *, connect_protocol_version: Literal[1], - filter: task_execution_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_execution_list_params.Pagination | NotGiven = NOT_GIVEN, + group_id: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -404,16 +395,16 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskExecutionListResponse: + ) -> PolicyUpdateResponse: """ - ListTaskExecutions + UpdateProjectPolicy updates a Project Policy. Args: connect_protocol_version: Define the version of the Connect protocol - filter: filter contains the filter options for listing task runs + group_id: group_id specifies the group_id identifier - pagination: pagination contains the pagination options for listing task runs + project_id: project_id specifies the project identifier connect_timeout_ms: Define the timeout, in ms @@ -435,25 +426,30 @@ async def list( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + "/gitpod.v1.ProjectService/UpdateProjectPolicy", body=await async_maybe_transform( { - "filter": filter, - "pagination": pagination, + "group_id": group_id, + "project_id": project_id, + "role": role, }, - task_execution_list_params.TaskExecutionListParams, + policy_update_params.PolicyUpdateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=TaskExecutionListResponse, + cast_to=PolicyUpdateResponse, ) - async def stop( + async def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -461,13 +457,22 @@ async def stop( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> PolicyListResponse: """ - StopTaskExecution + ListProjectPolicies lists policies for a project. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -487,21 +492,33 @@ async def stop( ), **(extra_headers or {}), } - return await self._post( - "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", - body=await async_maybe_transform({"id": id}, task_execution_stop_params.TaskExecutionStopParams), + return await self._get( + "/gitpod.v1.ProjectService/ListProjectPolicies", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + policy_list_params.PolicyListParams, + ), ), - cast_to=object, + cast_to=PolicyListResponse, ) - @overload - async def update_task_execution_status( + async def delete( self, *, - failure_message: str, connect_protocol_version: Literal[1], + group_id: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -510,56 +527,15 @@ async def update_task_execution_status( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """UpdateTaskExecutionStatus updates the status of a task execution. - - Only the - environment executing a task execution is expected to call this function. + """ + DeleteProjectPolicy deletes a Project Policy. Args: - failure_message: failure_message marks the task execution as failed and provides a message - explaining the failure. - - If an individual step has failed, callers are NOT expected to set this message; - only if the task execution as a whole has failed/cannot be started. - connect_protocol_version: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update_task_execution_status( - self, - *, - log_url: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """UpdateTaskExecutionStatus updates the status of a task execution. - - Only the - environment executing a task execution is expected to call this function. + group_id: group_id specifies the group_id identifier - Args: - log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task - either has no logs or has not yet started. - - connect_protocol_version: Define the version of the Connect protocol + project_id: project_id specifies the project identifier connect_timeout_ms: Define the timeout, in ms @@ -571,23 +547,6 @@ async def update_task_execution_status( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["failure_message", "connect_protocol_version"], ["log_url", "connect_protocol_version"]) - async def update_task_execution_status( - self, - *, - failure_message: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - log_url: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -598,13 +557,13 @@ async def update_task_execution_status( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus", + "/gitpod.v1.ProjectService/DeleteProjectPolicy", body=await async_maybe_transform( { - "failure_message": failure_message, - "log_url": log_url, + "group_id": group_id, + "project_id": project_id, }, - task_execution_update_task_execution_status_params.TaskExecutionUpdateTaskExecutionStatusParams, + policy_delete_params.PolicyDeleteParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -613,73 +572,73 @@ async def update_task_execution_status( ) -class TaskExecutionsResourceWithRawResponse: - def __init__(self, task_executions: TaskExecutionsResource) -> None: - self._task_executions = task_executions +class PoliciesResourceWithRawResponse: + def __init__(self, policies: PoliciesResource) -> None: + self._policies = policies - self.retrieve = to_raw_response_wrapper( - task_executions.retrieve, + self.create = to_raw_response_wrapper( + policies.create, ) - self.list = to_raw_response_wrapper( - task_executions.list, + self.update = to_raw_response_wrapper( + policies.update, ) - self.stop = to_raw_response_wrapper( - task_executions.stop, + self.list = to_raw_response_wrapper( + policies.list, ) - self.update_task_execution_status = to_raw_response_wrapper( - task_executions.update_task_execution_status, + self.delete = to_raw_response_wrapper( + policies.delete, ) -class AsyncTaskExecutionsResourceWithRawResponse: - def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: - self._task_executions = task_executions +class AsyncPoliciesResourceWithRawResponse: + def __init__(self, policies: AsyncPoliciesResource) -> None: + self._policies = policies - self.retrieve = async_to_raw_response_wrapper( - task_executions.retrieve, + self.create = async_to_raw_response_wrapper( + policies.create, ) - self.list = async_to_raw_response_wrapper( - task_executions.list, + self.update = async_to_raw_response_wrapper( + policies.update, ) - self.stop = async_to_raw_response_wrapper( - task_executions.stop, + self.list = async_to_raw_response_wrapper( + policies.list, ) - self.update_task_execution_status = async_to_raw_response_wrapper( - task_executions.update_task_execution_status, + self.delete = async_to_raw_response_wrapper( + policies.delete, ) -class TaskExecutionsResourceWithStreamingResponse: - def __init__(self, task_executions: TaskExecutionsResource) -> None: - self._task_executions = task_executions +class PoliciesResourceWithStreamingResponse: + def __init__(self, policies: PoliciesResource) -> None: + self._policies = policies - self.retrieve = to_streamed_response_wrapper( - task_executions.retrieve, + self.create = to_streamed_response_wrapper( + policies.create, ) - self.list = to_streamed_response_wrapper( - task_executions.list, + self.update = to_streamed_response_wrapper( + policies.update, ) - self.stop = to_streamed_response_wrapper( - task_executions.stop, + self.list = to_streamed_response_wrapper( + policies.list, ) - self.update_task_execution_status = to_streamed_response_wrapper( - task_executions.update_task_execution_status, + self.delete = to_streamed_response_wrapper( + policies.delete, ) -class AsyncTaskExecutionsResourceWithStreamingResponse: - def __init__(self, task_executions: AsyncTaskExecutionsResource) -> None: - self._task_executions = task_executions +class AsyncPoliciesResourceWithStreamingResponse: + def __init__(self, policies: AsyncPoliciesResource) -> None: + self._policies = policies - self.retrieve = async_to_streamed_response_wrapper( - task_executions.retrieve, + self.create = async_to_streamed_response_wrapper( + policies.create, ) - self.list = async_to_streamed_response_wrapper( - task_executions.list, + self.update = async_to_streamed_response_wrapper( + policies.update, ) - self.stop = async_to_streamed_response_wrapper( - task_executions.stop, + self.list = async_to_streamed_response_wrapper( + policies.list, ) - self.update_task_execution_status = async_to_streamed_response_wrapper( - task_executions.update_task_execution_status, + self.delete = async_to_streamed_response_wrapper( + policies.delete, ) diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py new file mode 100644 index 00000000..b9a75132 --- /dev/null +++ b/src/gitpod/resources/projects/projects.py @@ -0,0 +1,1314 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, overload + +import httpx + +from ...types import ( + project_list_params, + project_create_params, + project_delete_params, + project_update_params, + project_retrieve_params, + project_create_from_environment_params, +) +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + required_args, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .policies import ( + PoliciesResource, + AsyncPoliciesResource, + PoliciesResourceWithRawResponse, + AsyncPoliciesResourceWithRawResponse, + PoliciesResourceWithStreamingResponse, + AsyncPoliciesResourceWithStreamingResponse, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.project_list_response import ProjectListResponse +from ...types.project_create_response import ProjectCreateResponse +from ...types.project_update_response import ProjectUpdateResponse +from ...types.project_retrieve_response import ProjectRetrieveResponse +from ...types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse + +__all__ = ["ProjectsResource", "AsyncProjectsResource"] + + +class ProjectsResource(SyncAPIResource): + @cached_property + def policies(self) -> PoliciesResource: + return PoliciesResource(self._client) + + @cached_property + def with_raw_response(self) -> ProjectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return ProjectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return ProjectsResourceWithStreamingResponse(self) + + def create( + self, + *, + environment_class: project_create_params.EnvironmentClass, + initializer: project_create_params.Initializer, + connect_protocol_version: Literal[1], + automations_file_path: str | NotGiven = NOT_GIVEN, + devcontainer_file_path: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectCreateResponse: + """ + CreateProject creates a new Project. + + Args: + initializer: EnvironmentInitializer specifies how an environment is to be initialized + + connect_protocol_version: Define the version of the Connect protocol + + automations_file_path: automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.ProjectService/CreateProject", + body=maybe_transform( + { + "environment_class": environment_class, + "initializer": initializer, + "automations_file_path": automations_file_path, + "devcontainer_file_path": devcontainer_file_path, + "name": name, + }, + project_create_params.ProjectCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectCreateResponse, + ) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectRetrieveResponse: + """ + GetProject retrieves a single Project. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.ProjectService/GetProject", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + project_retrieve_params.ProjectRetrieveParams, + ), + ), + cast_to=ProjectRetrieveResponse, + ) + + @overload + def update( + self, + *, + automations_file_path: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + automations_file_path: automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + devcontainer_file_path: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + environment_class: project_update_params.Variant2EnvironmentClass, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + initializer: project_update_params.InitializerIsTheContentInitializerInitializer, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + initializer: EnvironmentInitializer specifies how an environment is to be initialized + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["automations_file_path", "connect_protocol_version"], + ["devcontainer_file_path", "connect_protocol_version"], + ["environment_class", "connect_protocol_version"], + ["initializer", "connect_protocol_version"], + ["name", "connect_protocol_version"], + ) + def update( + self, + *, + automations_file_path: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + devcontainer_file_path: str | NotGiven = NOT_GIVEN, + environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, + initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.ProjectService/UpdateProject", + body=maybe_transform( + { + "automations_file_path": automations_file_path, + "devcontainer_file_path": devcontainer_file_path, + "environment_class": environment_class, + "initializer": initializer, + "name": name, + }, + project_update_params.ProjectUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectUpdateResponse, + ) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectListResponse: + """ + ListProjects lists all projects the caller has access to. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.ProjectService/ListProjects", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + project_list_params.ProjectListParams, + ), + ), + cast_to=ProjectListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + project_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteProject deletes the specified project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + project_id: project_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.ProjectService/DeleteProject", + body=maybe_transform({"project_id": project_id}, project_delete_params.ProjectDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def create_from_environment( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectCreateFromEnvironmentResponse: + """ + CreateProject creates a new Project using an environment as template. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies the environment identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", + body=maybe_transform( + { + "environment_id": environment_id, + "name": name, + }, + project_create_from_environment_params.ProjectCreateFromEnvironmentParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectCreateFromEnvironmentResponse, + ) + + +class AsyncProjectsResource(AsyncAPIResource): + @cached_property + def policies(self) -> AsyncPoliciesResource: + return AsyncPoliciesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncProjectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncProjectsResourceWithStreamingResponse(self) + + async def create( + self, + *, + environment_class: project_create_params.EnvironmentClass, + initializer: project_create_params.Initializer, + connect_protocol_version: Literal[1], + automations_file_path: str | NotGiven = NOT_GIVEN, + devcontainer_file_path: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectCreateResponse: + """ + CreateProject creates a new Project. + + Args: + initializer: EnvironmentInitializer specifies how an environment is to be initialized + + connect_protocol_version: Define the version of the Connect protocol + + automations_file_path: automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.ProjectService/CreateProject", + body=await async_maybe_transform( + { + "environment_class": environment_class, + "initializer": initializer, + "automations_file_path": automations_file_path, + "devcontainer_file_path": devcontainer_file_path, + "name": name, + }, + project_create_params.ProjectCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectCreateResponse, + ) + + async def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectRetrieveResponse: + """ + GetProject retrieves a single Project. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.ProjectService/GetProject", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + project_retrieve_params.ProjectRetrieveParams, + ), + ), + cast_to=ProjectRetrieveResponse, + ) + + @overload + async def update( + self, + *, + automations_file_path: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + automations_file_path: automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + devcontainer_file_path: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + environment_class: project_update_params.Variant2EnvironmentClass, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + initializer: project_update_params.InitializerIsTheContentInitializerInitializer, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + initializer: EnvironmentInitializer specifies how an environment is to be initialized + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["automations_file_path", "connect_protocol_version"], + ["devcontainer_file_path", "connect_protocol_version"], + ["environment_class", "connect_protocol_version"], + ["initializer", "connect_protocol_version"], + ["name", "connect_protocol_version"], + ) + async def update( + self, + *, + automations_file_path: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + devcontainer_file_path: str | NotGiven = NOT_GIVEN, + environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, + initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.ProjectService/UpdateProject", + body=await async_maybe_transform( + { + "automations_file_path": automations_file_path, + "devcontainer_file_path": devcontainer_file_path, + "environment_class": environment_class, + "initializer": initializer, + "name": name, + }, + project_update_params.ProjectUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectUpdateResponse, + ) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectListResponse: + """ + ListProjects lists all projects the caller has access to. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.ProjectService/ListProjects", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + project_list_params.ProjectListParams, + ), + ), + cast_to=ProjectListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + project_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteProject deletes the specified project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + project_id: project_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.ProjectService/DeleteProject", + body=await async_maybe_transform({"project_id": project_id}, project_delete_params.ProjectDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def create_from_environment( + self, + *, + connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectCreateFromEnvironmentResponse: + """ + CreateProject creates a new Project using an environment as template. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: environment_id specifies the environment identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", + body=await async_maybe_transform( + { + "environment_id": environment_id, + "name": name, + }, + project_create_from_environment_params.ProjectCreateFromEnvironmentParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectCreateFromEnvironmentResponse, + ) + + +class ProjectsResourceWithRawResponse: + def __init__(self, projects: ProjectsResource) -> None: + self._projects = projects + + self.create = to_raw_response_wrapper( + projects.create, + ) + self.retrieve = to_raw_response_wrapper( + projects.retrieve, + ) + self.update = to_raw_response_wrapper( + projects.update, + ) + self.list = to_raw_response_wrapper( + projects.list, + ) + self.delete = to_raw_response_wrapper( + projects.delete, + ) + self.create_from_environment = to_raw_response_wrapper( + projects.create_from_environment, + ) + + @cached_property + def policies(self) -> PoliciesResourceWithRawResponse: + return PoliciesResourceWithRawResponse(self._projects.policies) + + +class AsyncProjectsResourceWithRawResponse: + def __init__(self, projects: AsyncProjectsResource) -> None: + self._projects = projects + + self.create = async_to_raw_response_wrapper( + projects.create, + ) + self.retrieve = async_to_raw_response_wrapper( + projects.retrieve, + ) + self.update = async_to_raw_response_wrapper( + projects.update, + ) + self.list = async_to_raw_response_wrapper( + projects.list, + ) + self.delete = async_to_raw_response_wrapper( + projects.delete, + ) + self.create_from_environment = async_to_raw_response_wrapper( + projects.create_from_environment, + ) + + @cached_property + def policies(self) -> AsyncPoliciesResourceWithRawResponse: + return AsyncPoliciesResourceWithRawResponse(self._projects.policies) + + +class ProjectsResourceWithStreamingResponse: + def __init__(self, projects: ProjectsResource) -> None: + self._projects = projects + + self.create = to_streamed_response_wrapper( + projects.create, + ) + self.retrieve = to_streamed_response_wrapper( + projects.retrieve, + ) + self.update = to_streamed_response_wrapper( + projects.update, + ) + self.list = to_streamed_response_wrapper( + projects.list, + ) + self.delete = to_streamed_response_wrapper( + projects.delete, + ) + self.create_from_environment = to_streamed_response_wrapper( + projects.create_from_environment, + ) + + @cached_property + def policies(self) -> PoliciesResourceWithStreamingResponse: + return PoliciesResourceWithStreamingResponse(self._projects.policies) + + +class AsyncProjectsResourceWithStreamingResponse: + def __init__(self, projects: AsyncProjectsResource) -> None: + self._projects = projects + + self.create = async_to_streamed_response_wrapper( + projects.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + projects.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + projects.update, + ) + self.list = async_to_streamed_response_wrapper( + projects.list, + ) + self.delete = async_to_streamed_response_wrapper( + projects.delete, + ) + self.create_from_environment = async_to_streamed_response_wrapper( + projects.create_from_environment, + ) + + @cached_property + def policies(self) -> AsyncPoliciesResourceWithStreamingResponse: + return AsyncPoliciesResourceWithStreamingResponse(self._projects.policies) diff --git a/src/gitpod/resources/runner_configurations/__init__.py b/src/gitpod/resources/runner_configurations/__init__.py deleted file mode 100644 index 3ee6024c..00000000 --- a/src/gitpod/resources/runner_configurations/__init__.py +++ /dev/null @@ -1,75 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .scm_integration import ( - ScmIntegrationResource, - AsyncScmIntegrationResource, - ScmIntegrationResourceWithRawResponse, - AsyncScmIntegrationResourceWithRawResponse, - ScmIntegrationResourceWithStreamingResponse, - AsyncScmIntegrationResourceWithStreamingResponse, -) -from .environment_classes import ( - EnvironmentClassesResource, - AsyncEnvironmentClassesResource, - EnvironmentClassesResourceWithRawResponse, - AsyncEnvironmentClassesResourceWithRawResponse, - EnvironmentClassesResourceWithStreamingResponse, - AsyncEnvironmentClassesResourceWithStreamingResponse, -) -from .configuration_schema import ( - ConfigurationSchemaResource, - AsyncConfigurationSchemaResource, - ConfigurationSchemaResourceWithRawResponse, - AsyncConfigurationSchemaResourceWithRawResponse, - ConfigurationSchemaResourceWithStreamingResponse, - AsyncConfigurationSchemaResourceWithStreamingResponse, -) -from .runner_configurations import ( - RunnerConfigurationsResource, - AsyncRunnerConfigurationsResource, - RunnerConfigurationsResourceWithRawResponse, - AsyncRunnerConfigurationsResourceWithRawResponse, - RunnerConfigurationsResourceWithStreamingResponse, - AsyncRunnerConfigurationsResourceWithStreamingResponse, -) -from .host_authentication_tokens import ( - HostAuthenticationTokensResource, - AsyncHostAuthenticationTokensResource, - HostAuthenticationTokensResourceWithRawResponse, - AsyncHostAuthenticationTokensResourceWithRawResponse, - HostAuthenticationTokensResourceWithStreamingResponse, - AsyncHostAuthenticationTokensResourceWithStreamingResponse, -) - -__all__ = [ - "HostAuthenticationTokensResource", - "AsyncHostAuthenticationTokensResource", - "HostAuthenticationTokensResourceWithRawResponse", - "AsyncHostAuthenticationTokensResourceWithRawResponse", - "HostAuthenticationTokensResourceWithStreamingResponse", - "AsyncHostAuthenticationTokensResourceWithStreamingResponse", - "ConfigurationSchemaResource", - "AsyncConfigurationSchemaResource", - "ConfigurationSchemaResourceWithRawResponse", - "AsyncConfigurationSchemaResourceWithRawResponse", - "ConfigurationSchemaResourceWithStreamingResponse", - "AsyncConfigurationSchemaResourceWithStreamingResponse", - "ScmIntegrationResource", - "AsyncScmIntegrationResource", - "ScmIntegrationResourceWithRawResponse", - "AsyncScmIntegrationResourceWithRawResponse", - "ScmIntegrationResourceWithStreamingResponse", - "AsyncScmIntegrationResourceWithStreamingResponse", - "EnvironmentClassesResource", - "AsyncEnvironmentClassesResource", - "EnvironmentClassesResourceWithRawResponse", - "AsyncEnvironmentClassesResourceWithRawResponse", - "EnvironmentClassesResourceWithStreamingResponse", - "AsyncEnvironmentClassesResourceWithStreamingResponse", - "RunnerConfigurationsResource", - "AsyncRunnerConfigurationsResource", - "RunnerConfigurationsResourceWithRawResponse", - "AsyncRunnerConfigurationsResourceWithRawResponse", - "RunnerConfigurationsResourceWithStreamingResponse", - "AsyncRunnerConfigurationsResourceWithStreamingResponse", -] diff --git a/src/gitpod/resources/runner_configurations/scm_integration.py b/src/gitpod/resources/runner_configurations/scm_integration.py deleted file mode 100644 index 3a801fa9..00000000 --- a/src/gitpod/resources/runner_configurations/scm_integration.py +++ /dev/null @@ -1,333 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, overload - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - is_given, - required_args, - maybe_transform, - strip_not_given, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.runner_configurations import scm_integration_create_params -from ...types.runner_configurations.scm_integration_create_response import ScmIntegrationCreateResponse - -__all__ = ["ScmIntegrationResource", "AsyncScmIntegrationResource"] - - -class ScmIntegrationResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> ScmIntegrationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return ScmIntegrationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ScmIntegrationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return ScmIntegrationResourceWithStreamingResponse(self) - - @overload - def create( - self, - *, - oauth_client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - """ - CreateSCMIntegration creates a new SCM integration on a runner. - - Args: - oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_plaintext_client_secret must also be set. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def create( - self, - *, - oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - """ - CreateSCMIntegration creates a new SCM integration on a runner. - - Args: - oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. - - This will first be encrypted with the runner's public key before being stored. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] - ) - def create( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", - body=maybe_transform( - { - "oauth_client_id": oauth_client_id, - "oauth_plaintext_client_secret": oauth_plaintext_client_secret, - }, - scm_integration_create_params.ScmIntegrationCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ScmIntegrationCreateResponse, - ) - - -class AsyncScmIntegrationResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncScmIntegrationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers - """ - return AsyncScmIntegrationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncScmIntegrationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response - """ - return AsyncScmIntegrationResourceWithStreamingResponse(self) - - @overload - async def create( - self, - *, - oauth_client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - """ - CreateSCMIntegration creates a new SCM integration on a runner. - - Args: - oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_plaintext_client_secret must also be set. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def create( - self, - *, - oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - """ - CreateSCMIntegration creates a new SCM integration on a runner. - - Args: - oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. - - This will first be encrypted with the runner's public key before being stored. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] - ) - async def create( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", - body=await async_maybe_transform( - { - "oauth_client_id": oauth_client_id, - "oauth_plaintext_client_secret": oauth_plaintext_client_secret, - }, - scm_integration_create_params.ScmIntegrationCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ScmIntegrationCreateResponse, - ) - - -class ScmIntegrationResourceWithRawResponse: - def __init__(self, scm_integration: ScmIntegrationResource) -> None: - self._scm_integration = scm_integration - - self.create = to_raw_response_wrapper( - scm_integration.create, - ) - - -class AsyncScmIntegrationResourceWithRawResponse: - def __init__(self, scm_integration: AsyncScmIntegrationResource) -> None: - self._scm_integration = scm_integration - - self.create = async_to_raw_response_wrapper( - scm_integration.create, - ) - - -class ScmIntegrationResourceWithStreamingResponse: - def __init__(self, scm_integration: ScmIntegrationResource) -> None: - self._scm_integration = scm_integration - - self.create = to_streamed_response_wrapper( - scm_integration.create, - ) - - -class AsyncScmIntegrationResourceWithStreamingResponse: - def __init__(self, scm_integration: AsyncScmIntegrationResource) -> None: - self._scm_integration = scm_integration - - self.create = async_to_streamed_response_wrapper( - scm_integration.create, - ) diff --git a/src/gitpod/resources/runners/__init__.py b/src/gitpod/resources/runners/__init__.py index 03ac96d2..27ce34c0 100644 --- a/src/gitpod/resources/runners/__init__.py +++ b/src/gitpod/resources/runners/__init__.py @@ -16,8 +16,22 @@ PoliciesResourceWithStreamingResponse, AsyncPoliciesResourceWithStreamingResponse, ) +from .configurations import ( + ConfigurationsResource, + AsyncConfigurationsResource, + ConfigurationsResourceWithRawResponse, + AsyncConfigurationsResourceWithRawResponse, + ConfigurationsResourceWithStreamingResponse, + AsyncConfigurationsResourceWithStreamingResponse, +) __all__ = [ + "ConfigurationsResource", + "AsyncConfigurationsResource", + "ConfigurationsResourceWithRawResponse", + "AsyncConfigurationsResourceWithRawResponse", + "ConfigurationsResourceWithStreamingResponse", + "AsyncConfigurationsResourceWithStreamingResponse", "PoliciesResource", "AsyncPoliciesResource", "PoliciesResourceWithRawResponse", diff --git a/src/gitpod/resources/runners/configurations/__init__.py b/src/gitpod/resources/runners/configurations/__init__.py new file mode 100644 index 00000000..848f99c0 --- /dev/null +++ b/src/gitpod/resources/runners/configurations/__init__.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .schema import ( + SchemaResource, + AsyncSchemaResource, + SchemaResourceWithRawResponse, + AsyncSchemaResourceWithRawResponse, + SchemaResourceWithStreamingResponse, + AsyncSchemaResourceWithStreamingResponse, +) +from .configurations import ( + ConfigurationsResource, + AsyncConfigurationsResource, + ConfigurationsResourceWithRawResponse, + AsyncConfigurationsResourceWithRawResponse, + ConfigurationsResourceWithStreamingResponse, + AsyncConfigurationsResourceWithStreamingResponse, +) +from .scm_integrations import ( + ScmIntegrationsResource, + AsyncScmIntegrationsResource, + ScmIntegrationsResourceWithRawResponse, + AsyncScmIntegrationsResourceWithRawResponse, + ScmIntegrationsResourceWithStreamingResponse, + AsyncScmIntegrationsResourceWithStreamingResponse, +) +from .environment_classes import ( + EnvironmentClassesResource, + AsyncEnvironmentClassesResource, + EnvironmentClassesResourceWithRawResponse, + AsyncEnvironmentClassesResourceWithRawResponse, + EnvironmentClassesResourceWithStreamingResponse, + AsyncEnvironmentClassesResourceWithStreamingResponse, +) +from .host_authentication_tokens import ( + HostAuthenticationTokensResource, + AsyncHostAuthenticationTokensResource, + HostAuthenticationTokensResourceWithRawResponse, + AsyncHostAuthenticationTokensResourceWithRawResponse, + HostAuthenticationTokensResourceWithStreamingResponse, + AsyncHostAuthenticationTokensResourceWithStreamingResponse, +) + +__all__ = [ + "EnvironmentClassesResource", + "AsyncEnvironmentClassesResource", + "EnvironmentClassesResourceWithRawResponse", + "AsyncEnvironmentClassesResourceWithRawResponse", + "EnvironmentClassesResourceWithStreamingResponse", + "AsyncEnvironmentClassesResourceWithStreamingResponse", + "HostAuthenticationTokensResource", + "AsyncHostAuthenticationTokensResource", + "HostAuthenticationTokensResourceWithRawResponse", + "AsyncHostAuthenticationTokensResourceWithRawResponse", + "HostAuthenticationTokensResourceWithStreamingResponse", + "AsyncHostAuthenticationTokensResourceWithStreamingResponse", + "SchemaResource", + "AsyncSchemaResource", + "SchemaResourceWithRawResponse", + "AsyncSchemaResourceWithRawResponse", + "SchemaResourceWithStreamingResponse", + "AsyncSchemaResourceWithStreamingResponse", + "ScmIntegrationsResource", + "AsyncScmIntegrationsResource", + "ScmIntegrationsResourceWithRawResponse", + "AsyncScmIntegrationsResourceWithRawResponse", + "ScmIntegrationsResourceWithStreamingResponse", + "AsyncScmIntegrationsResourceWithStreamingResponse", + "ConfigurationsResource", + "AsyncConfigurationsResource", + "ConfigurationsResourceWithRawResponse", + "AsyncConfigurationsResourceWithRawResponse", + "ConfigurationsResourceWithStreamingResponse", + "AsyncConfigurationsResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/runner_configurations/runner_configurations.py b/src/gitpod/resources/runners/configurations/configurations.py similarity index 66% rename from src/gitpod/resources/runner_configurations/runner_configurations.py rename to src/gitpod/resources/runners/configurations/configurations.py index 1b3a2871..0e6273c8 100644 --- a/src/gitpod/resources/runner_configurations/runner_configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -7,31 +7,39 @@ import httpx -from ...types import runner_configuration_validate_params -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( +from .schema import ( + SchemaResource, + AsyncSchemaResource, + SchemaResourceWithRawResponse, + AsyncSchemaResourceWithRawResponse, + SchemaResourceWithStreamingResponse, + AsyncSchemaResourceWithStreamingResponse, +) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( is_given, required_args, maybe_transform, strip_not_given, async_maybe_transform, ) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options -from .scm_integration import ( - ScmIntegrationResource, - AsyncScmIntegrationResource, - ScmIntegrationResourceWithRawResponse, - AsyncScmIntegrationResourceWithRawResponse, - ScmIntegrationResourceWithStreamingResponse, - AsyncScmIntegrationResourceWithStreamingResponse, +from ...._base_client import make_request_options +from ....types.runners import configuration_validate_params +from .scm_integrations import ( + ScmIntegrationsResource, + AsyncScmIntegrationsResource, + ScmIntegrationsResourceWithRawResponse, + AsyncScmIntegrationsResourceWithRawResponse, + ScmIntegrationsResourceWithStreamingResponse, + AsyncScmIntegrationsResourceWithStreamingResponse, ) from .environment_classes import ( EnvironmentClassesResource, @@ -41,14 +49,6 @@ EnvironmentClassesResourceWithStreamingResponse, AsyncEnvironmentClassesResourceWithStreamingResponse, ) -from .configuration_schema import ( - ConfigurationSchemaResource, - AsyncConfigurationSchemaResource, - ConfigurationSchemaResourceWithRawResponse, - AsyncConfigurationSchemaResourceWithRawResponse, - ConfigurationSchemaResourceWithStreamingResponse, - AsyncConfigurationSchemaResourceWithStreamingResponse, -) from .host_authentication_tokens import ( HostAuthenticationTokensResource, AsyncHostAuthenticationTokensResource, @@ -57,52 +57,52 @@ HostAuthenticationTokensResourceWithStreamingResponse, AsyncHostAuthenticationTokensResourceWithStreamingResponse, ) -from ...types.runner_configuration_validate_response import RunnerConfigurationValidateResponse +from ....types.runners.configuration_validate_response import ConfigurationValidateResponse -__all__ = ["RunnerConfigurationsResource", "AsyncRunnerConfigurationsResource"] +__all__ = ["ConfigurationsResource", "AsyncConfigurationsResource"] -class RunnerConfigurationsResource(SyncAPIResource): +class ConfigurationsResource(SyncAPIResource): @cached_property - def host_authentication_tokens(self) -> HostAuthenticationTokensResource: - return HostAuthenticationTokensResource(self._client) + def environment_classes(self) -> EnvironmentClassesResource: + return EnvironmentClassesResource(self._client) @cached_property - def configuration_schema(self) -> ConfigurationSchemaResource: - return ConfigurationSchemaResource(self._client) + def host_authentication_tokens(self) -> HostAuthenticationTokensResource: + return HostAuthenticationTokensResource(self._client) @cached_property - def scm_integration(self) -> ScmIntegrationResource: - return ScmIntegrationResource(self._client) + def schema(self) -> SchemaResource: + return SchemaResource(self._client) @cached_property - def environment_classes(self) -> EnvironmentClassesResource: - return EnvironmentClassesResource(self._client) + def scm_integrations(self) -> ScmIntegrationsResource: + return ScmIntegrationsResource(self._client) @cached_property - def with_raw_response(self) -> RunnerConfigurationsResourceWithRawResponse: + def with_raw_response(self) -> ConfigurationsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return RunnerConfigurationsResourceWithRawResponse(self) + return ConfigurationsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> RunnerConfigurationsResourceWithStreamingResponse: + def with_streaming_response(self) -> ConfigurationsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return RunnerConfigurationsResourceWithStreamingResponse(self) + return ConfigurationsResourceWithStreamingResponse(self) @overload def validate( self, *, - environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass, + environment_class: configuration_validate_params.Variant0EnvironmentClass, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, @@ -112,7 +112,7 @@ def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: + ) -> ConfigurationValidateResponse: """ValidateRunnerConfiguration validates a runner configuration (e.g. environment @@ -139,7 +139,7 @@ def validate( def validate( self, *, - scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration, + scm_integration: configuration_validate_params.Variant1ScmIntegration, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, @@ -149,7 +149,7 @@ def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: + ) -> ConfigurationValidateResponse: """ValidateRunnerConfiguration validates a runner configuration (e.g. environment @@ -176,18 +176,18 @@ def validate( def validate( self, *, - environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass | NotGiven = NOT_GIVEN, + environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, - scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: + ) -> ConfigurationValidateResponse: extra_headers = { **strip_not_given( { @@ -198,7 +198,7 @@ def validate( **(extra_headers or {}), } return cast( - RunnerConfigurationValidateResponse, + ConfigurationValidateResponse, self._post( "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", body=maybe_transform( @@ -207,59 +207,59 @@ def validate( "runner_id": runner_id, "scm_integration": scm_integration, }, - runner_configuration_validate_params.RunnerConfigurationValidateParams, + configuration_validate_params.ConfigurationValidateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=cast( - Any, RunnerConfigurationValidateResponse + Any, ConfigurationValidateResponse ), # Union types cannot be passed in as arguments in the type system ), ) -class AsyncRunnerConfigurationsResource(AsyncAPIResource): +class AsyncConfigurationsResource(AsyncAPIResource): @cached_property - def host_authentication_tokens(self) -> AsyncHostAuthenticationTokensResource: - return AsyncHostAuthenticationTokensResource(self._client) + def environment_classes(self) -> AsyncEnvironmentClassesResource: + return AsyncEnvironmentClassesResource(self._client) @cached_property - def configuration_schema(self) -> AsyncConfigurationSchemaResource: - return AsyncConfigurationSchemaResource(self._client) + def host_authentication_tokens(self) -> AsyncHostAuthenticationTokensResource: + return AsyncHostAuthenticationTokensResource(self._client) @cached_property - def scm_integration(self) -> AsyncScmIntegrationResource: - return AsyncScmIntegrationResource(self._client) + def schema(self) -> AsyncSchemaResource: + return AsyncSchemaResource(self._client) @cached_property - def environment_classes(self) -> AsyncEnvironmentClassesResource: - return AsyncEnvironmentClassesResource(self._client) + def scm_integrations(self) -> AsyncScmIntegrationsResource: + return AsyncScmIntegrationsResource(self._client) @cached_property - def with_raw_response(self) -> AsyncRunnerConfigurationsResourceWithRawResponse: + def with_raw_response(self) -> AsyncConfigurationsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return AsyncRunnerConfigurationsResourceWithRawResponse(self) + return AsyncConfigurationsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncRunnerConfigurationsResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncConfigurationsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return AsyncRunnerConfigurationsResourceWithStreamingResponse(self) + return AsyncConfigurationsResourceWithStreamingResponse(self) @overload async def validate( self, *, - environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass, + environment_class: configuration_validate_params.Variant0EnvironmentClass, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, @@ -269,7 +269,7 @@ async def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: + ) -> ConfigurationValidateResponse: """ValidateRunnerConfiguration validates a runner configuration (e.g. environment @@ -296,7 +296,7 @@ async def validate( async def validate( self, *, - scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration, + scm_integration: configuration_validate_params.Variant1ScmIntegration, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, @@ -306,7 +306,7 @@ async def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: + ) -> ConfigurationValidateResponse: """ValidateRunnerConfiguration validates a runner configuration (e.g. environment @@ -333,18 +333,18 @@ async def validate( async def validate( self, *, - environment_class: runner_configuration_validate_params.EnvironmentClassEnvironmentClass | NotGiven = NOT_GIVEN, + environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, - scm_integration: runner_configuration_validate_params.ScmIntegrationScmIntegration | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerConfigurationValidateResponse: + ) -> ConfigurationValidateResponse: extra_headers = { **strip_not_given( { @@ -355,7 +355,7 @@ async def validate( **(extra_headers or {}), } return cast( - RunnerConfigurationValidateResponse, + ConfigurationValidateResponse, await self._post( "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", body=await async_maybe_transform( @@ -364,119 +364,115 @@ async def validate( "runner_id": runner_id, "scm_integration": scm_integration, }, - runner_configuration_validate_params.RunnerConfigurationValidateParams, + configuration_validate_params.ConfigurationValidateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=cast( - Any, RunnerConfigurationValidateResponse + Any, ConfigurationValidateResponse ), # Union types cannot be passed in as arguments in the type system ), ) -class RunnerConfigurationsResourceWithRawResponse: - def __init__(self, runner_configurations: RunnerConfigurationsResource) -> None: - self._runner_configurations = runner_configurations +class ConfigurationsResourceWithRawResponse: + def __init__(self, configurations: ConfigurationsResource) -> None: + self._configurations = configurations self.validate = to_raw_response_wrapper( - runner_configurations.validate, + configurations.validate, ) @cached_property - def host_authentication_tokens(self) -> HostAuthenticationTokensResourceWithRawResponse: - return HostAuthenticationTokensResourceWithRawResponse(self._runner_configurations.host_authentication_tokens) + def environment_classes(self) -> EnvironmentClassesResourceWithRawResponse: + return EnvironmentClassesResourceWithRawResponse(self._configurations.environment_classes) @cached_property - def configuration_schema(self) -> ConfigurationSchemaResourceWithRawResponse: - return ConfigurationSchemaResourceWithRawResponse(self._runner_configurations.configuration_schema) + def host_authentication_tokens(self) -> HostAuthenticationTokensResourceWithRawResponse: + return HostAuthenticationTokensResourceWithRawResponse(self._configurations.host_authentication_tokens) @cached_property - def scm_integration(self) -> ScmIntegrationResourceWithRawResponse: - return ScmIntegrationResourceWithRawResponse(self._runner_configurations.scm_integration) + def schema(self) -> SchemaResourceWithRawResponse: + return SchemaResourceWithRawResponse(self._configurations.schema) @cached_property - def environment_classes(self) -> EnvironmentClassesResourceWithRawResponse: - return EnvironmentClassesResourceWithRawResponse(self._runner_configurations.environment_classes) + def scm_integrations(self) -> ScmIntegrationsResourceWithRawResponse: + return ScmIntegrationsResourceWithRawResponse(self._configurations.scm_integrations) -class AsyncRunnerConfigurationsResourceWithRawResponse: - def __init__(self, runner_configurations: AsyncRunnerConfigurationsResource) -> None: - self._runner_configurations = runner_configurations +class AsyncConfigurationsResourceWithRawResponse: + def __init__(self, configurations: AsyncConfigurationsResource) -> None: + self._configurations = configurations self.validate = async_to_raw_response_wrapper( - runner_configurations.validate, + configurations.validate, ) @cached_property - def host_authentication_tokens(self) -> AsyncHostAuthenticationTokensResourceWithRawResponse: - return AsyncHostAuthenticationTokensResourceWithRawResponse( - self._runner_configurations.host_authentication_tokens - ) + def environment_classes(self) -> AsyncEnvironmentClassesResourceWithRawResponse: + return AsyncEnvironmentClassesResourceWithRawResponse(self._configurations.environment_classes) @cached_property - def configuration_schema(self) -> AsyncConfigurationSchemaResourceWithRawResponse: - return AsyncConfigurationSchemaResourceWithRawResponse(self._runner_configurations.configuration_schema) + def host_authentication_tokens(self) -> AsyncHostAuthenticationTokensResourceWithRawResponse: + return AsyncHostAuthenticationTokensResourceWithRawResponse(self._configurations.host_authentication_tokens) @cached_property - def scm_integration(self) -> AsyncScmIntegrationResourceWithRawResponse: - return AsyncScmIntegrationResourceWithRawResponse(self._runner_configurations.scm_integration) + def schema(self) -> AsyncSchemaResourceWithRawResponse: + return AsyncSchemaResourceWithRawResponse(self._configurations.schema) @cached_property - def environment_classes(self) -> AsyncEnvironmentClassesResourceWithRawResponse: - return AsyncEnvironmentClassesResourceWithRawResponse(self._runner_configurations.environment_classes) + def scm_integrations(self) -> AsyncScmIntegrationsResourceWithRawResponse: + return AsyncScmIntegrationsResourceWithRawResponse(self._configurations.scm_integrations) -class RunnerConfigurationsResourceWithStreamingResponse: - def __init__(self, runner_configurations: RunnerConfigurationsResource) -> None: - self._runner_configurations = runner_configurations +class ConfigurationsResourceWithStreamingResponse: + def __init__(self, configurations: ConfigurationsResource) -> None: + self._configurations = configurations self.validate = to_streamed_response_wrapper( - runner_configurations.validate, + configurations.validate, ) @cached_property - def host_authentication_tokens(self) -> HostAuthenticationTokensResourceWithStreamingResponse: - return HostAuthenticationTokensResourceWithStreamingResponse( - self._runner_configurations.host_authentication_tokens - ) + def environment_classes(self) -> EnvironmentClassesResourceWithStreamingResponse: + return EnvironmentClassesResourceWithStreamingResponse(self._configurations.environment_classes) @cached_property - def configuration_schema(self) -> ConfigurationSchemaResourceWithStreamingResponse: - return ConfigurationSchemaResourceWithStreamingResponse(self._runner_configurations.configuration_schema) + def host_authentication_tokens(self) -> HostAuthenticationTokensResourceWithStreamingResponse: + return HostAuthenticationTokensResourceWithStreamingResponse(self._configurations.host_authentication_tokens) @cached_property - def scm_integration(self) -> ScmIntegrationResourceWithStreamingResponse: - return ScmIntegrationResourceWithStreamingResponse(self._runner_configurations.scm_integration) + def schema(self) -> SchemaResourceWithStreamingResponse: + return SchemaResourceWithStreamingResponse(self._configurations.schema) @cached_property - def environment_classes(self) -> EnvironmentClassesResourceWithStreamingResponse: - return EnvironmentClassesResourceWithStreamingResponse(self._runner_configurations.environment_classes) + def scm_integrations(self) -> ScmIntegrationsResourceWithStreamingResponse: + return ScmIntegrationsResourceWithStreamingResponse(self._configurations.scm_integrations) -class AsyncRunnerConfigurationsResourceWithStreamingResponse: - def __init__(self, runner_configurations: AsyncRunnerConfigurationsResource) -> None: - self._runner_configurations = runner_configurations +class AsyncConfigurationsResourceWithStreamingResponse: + def __init__(self, configurations: AsyncConfigurationsResource) -> None: + self._configurations = configurations self.validate = async_to_streamed_response_wrapper( - runner_configurations.validate, + configurations.validate, ) + @cached_property + def environment_classes(self) -> AsyncEnvironmentClassesResourceWithStreamingResponse: + return AsyncEnvironmentClassesResourceWithStreamingResponse(self._configurations.environment_classes) + @cached_property def host_authentication_tokens(self) -> AsyncHostAuthenticationTokensResourceWithStreamingResponse: return AsyncHostAuthenticationTokensResourceWithStreamingResponse( - self._runner_configurations.host_authentication_tokens + self._configurations.host_authentication_tokens ) @cached_property - def configuration_schema(self) -> AsyncConfigurationSchemaResourceWithStreamingResponse: - return AsyncConfigurationSchemaResourceWithStreamingResponse(self._runner_configurations.configuration_schema) - - @cached_property - def scm_integration(self) -> AsyncScmIntegrationResourceWithStreamingResponse: - return AsyncScmIntegrationResourceWithStreamingResponse(self._runner_configurations.scm_integration) + def schema(self) -> AsyncSchemaResourceWithStreamingResponse: + return AsyncSchemaResourceWithStreamingResponse(self._configurations.schema) @cached_property - def environment_classes(self) -> AsyncEnvironmentClassesResourceWithStreamingResponse: - return AsyncEnvironmentClassesResourceWithStreamingResponse(self._runner_configurations.environment_classes) + def scm_integrations(self) -> AsyncScmIntegrationsResourceWithStreamingResponse: + return AsyncScmIntegrationsResourceWithStreamingResponse(self._configurations.scm_integrations) diff --git a/src/gitpod/resources/runner_configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py similarity index 56% rename from src/gitpod/resources/runner_configurations/environment_classes.py rename to src/gitpod/resources/runners/configurations/environment_classes.py index a5a67325..e7a3e500 100644 --- a/src/gitpod/resources/runner_configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -2,29 +2,37 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Literal, overload import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( is_given, required_args, maybe_transform, strip_not_given, async_maybe_transform, ) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options -from ...types.runner_configurations import environment_class_list_params, environment_class_update_params -from ...types.runner_configurations.environment_class_list_response import EnvironmentClassListResponse +from ...._base_client import make_request_options +from ....types.runners.configurations import ( + environment_class_list_params, + environment_class_create_params, + environment_class_update_params, + environment_class_retrieve_params, +) +from ....types.runners.configurations.environment_class_list_response import EnvironmentClassListResponse +from ....types.runners.configurations.environment_class_create_response import EnvironmentClassCreateResponse +from ....types.runners.configurations.environment_class_retrieve_response import EnvironmentClassRetrieveResponse __all__ = ["EnvironmentClassesResource", "AsyncEnvironmentClassesResource"] @@ -49,6 +57,136 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp """ return EnvironmentClassesResourceWithStreamingResponse(self) + def create( + self, + *, + connect_protocol_version: Literal[1], + configuration: Iterable[environment_class_create_params.Configuration] | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + display_name: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentClassCreateResponse: + """ + CreateEnvironmentClass creates a new environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/CreateEnvironmentClass", + body=maybe_transform( + { + "configuration": configuration, + "description": description, + "display_name": display_name, + "runner_id": runner_id, + }, + environment_class_create_params.EnvironmentClassCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentClassCreateResponse, + ) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentClassRetrieveResponse: + """ + GetEnvironmentClass returns a single environment class configured for a runner. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.RunnerConfigurationService/GetEnvironmentClass", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + environment_class_retrieve_params.EnvironmentClassRetrieveParams, + ), + ), + cast_to=EnvironmentClassRetrieveResponse, + ) + @overload def update( self, @@ -193,9 +331,12 @@ def update( def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -210,9 +351,16 @@ def list( buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environment classes + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -233,17 +381,23 @@ def list( ), **(extra_headers or {}), } - return self._post( + return self._get( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - environment_class_list_params.EnvironmentClassListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + environment_class_list_params.EnvironmentClassListParams, + ), ), cast_to=EnvironmentClassListResponse, ) @@ -269,6 +423,136 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin """ return AsyncEnvironmentClassesResourceWithStreamingResponse(self) + async def create( + self, + *, + connect_protocol_version: Literal[1], + configuration: Iterable[environment_class_create_params.Configuration] | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + display_name: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentClassCreateResponse: + """ + CreateEnvironmentClass creates a new environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/CreateEnvironmentClass", + body=await async_maybe_transform( + { + "configuration": configuration, + "description": description, + "display_name": display_name, + "runner_id": runner_id, + }, + environment_class_create_params.EnvironmentClassCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentClassCreateResponse, + ) + + async def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentClassRetrieveResponse: + """ + GetEnvironmentClass returns a single environment class configured for a runner. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.RunnerConfigurationService/GetEnvironmentClass", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + environment_class_retrieve_params.EnvironmentClassRetrieveParams, + ), + ), + cast_to=EnvironmentClassRetrieveResponse, + ) + @overload async def update( self, @@ -413,9 +697,12 @@ async def update( async def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -430,9 +717,16 @@ async def list( buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing environment classes + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -453,17 +747,23 @@ async def list( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - environment_class_list_params.EnvironmentClassListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + environment_class_list_params.EnvironmentClassListParams, + ), ), cast_to=EnvironmentClassListResponse, ) @@ -473,6 +773,12 @@ class EnvironmentClassesResourceWithRawResponse: def __init__(self, environment_classes: EnvironmentClassesResource) -> None: self._environment_classes = environment_classes + self.create = to_raw_response_wrapper( + environment_classes.create, + ) + self.retrieve = to_raw_response_wrapper( + environment_classes.retrieve, + ) self.update = to_raw_response_wrapper( environment_classes.update, ) @@ -485,6 +791,12 @@ class AsyncEnvironmentClassesResourceWithRawResponse: def __init__(self, environment_classes: AsyncEnvironmentClassesResource) -> None: self._environment_classes = environment_classes + self.create = async_to_raw_response_wrapper( + environment_classes.create, + ) + self.retrieve = async_to_raw_response_wrapper( + environment_classes.retrieve, + ) self.update = async_to_raw_response_wrapper( environment_classes.update, ) @@ -497,6 +809,12 @@ class EnvironmentClassesResourceWithStreamingResponse: def __init__(self, environment_classes: EnvironmentClassesResource) -> None: self._environment_classes = environment_classes + self.create = to_streamed_response_wrapper( + environment_classes.create, + ) + self.retrieve = to_streamed_response_wrapper( + environment_classes.retrieve, + ) self.update = to_streamed_response_wrapper( environment_classes.update, ) @@ -509,6 +827,12 @@ class AsyncEnvironmentClassesResourceWithStreamingResponse: def __init__(self, environment_classes: AsyncEnvironmentClassesResource) -> None: self._environment_classes = environment_classes + self.create = async_to_streamed_response_wrapper( + environment_classes.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + environment_classes.retrieve, + ) self.update = async_to_streamed_response_wrapper( environment_classes.update, ) diff --git a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py similarity index 70% rename from src/gitpod/resources/runner_configurations/host_authentication_tokens.py rename to src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 09b54440..13ed925f 100644 --- a/src/gitpod/resources/runner_configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -8,35 +8,35 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( is_given, required_args, maybe_transform, strip_not_given, async_maybe_transform, ) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options -from ...types.runner_configurations import ( +from ...._base_client import make_request_options +from ....types.runners.configurations import ( host_authentication_token_list_params, host_authentication_token_create_params, host_authentication_token_delete_params, host_authentication_token_update_params, host_authentication_token_retrieve_params, ) -from ...types.runner_configurations.host_authentication_token_list_response import HostAuthenticationTokenListResponse -from ...types.runner_configurations.host_authentication_token_create_response import ( +from ....types.runners.configurations.host_authentication_token_list_response import HostAuthenticationTokenListResponse +from ....types.runners.configurations.host_authentication_token_create_response import ( HostAuthenticationTokenCreateResponse, ) -from ...types.runner_configurations.host_authentication_token_retrieve_response import ( +from ....types.runners.configurations.host_authentication_token_retrieve_response import ( HostAuthenticationTokenRetrieveResponse, ) @@ -67,7 +67,18 @@ def create( self, *, connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + host: str | NotGiven = NOT_GIVEN, + refresh_token: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + source: Literal[ + "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", + ] + | NotGiven = NOT_GIVEN, + user_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -77,11 +88,101 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenCreateResponse: """ - GetHostAuthenticationToken + CreateHostAuthenticationToken Args: connect_protocol_version: Define the version of the Connect protocol + expires_at: A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -102,9 +203,18 @@ def create( **(extra_headers or {}), } return self._post( - "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + "/gitpod.v1.RunnerConfigurationService/CreateHostAuthenticationToken", body=maybe_transform( - {"id": id}, host_authentication_token_create_params.HostAuthenticationTokenCreateParams + { + "token": token, + "expires_at": expires_at, + "host": host, + "refresh_token": refresh_token, + "runner_id": runner_id, + "source": source, + "user_id": user_id, + }, + host_authentication_token_create_params.HostAuthenticationTokenCreateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -115,8 +225,12 @@ def create( def retrieve( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -129,8 +243,17 @@ def retrieve( GetHostAuthenticationToken Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -150,13 +273,23 @@ def retrieve( ), **(extra_headers or {}), } - return self._post( + return self._get( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", - body=maybe_transform( - {"id": id}, host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams, + ), ), cast_to=HostAuthenticationTokenRetrieveResponse, ) @@ -395,9 +528,12 @@ def update( def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -410,8 +546,17 @@ def list( ListHostAuthenticationTokens Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -431,17 +576,23 @@ def list( ), **(extra_headers or {}), } - return self._post( + return self._get( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - host_authentication_token_list_params.HostAuthenticationTokenListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + host_authentication_token_list_params.HostAuthenticationTokenListParams, + ), ), cast_to=HostAuthenticationTokenListResponse, ) @@ -520,7 +671,18 @@ async def create( self, *, connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + host: str | NotGiven = NOT_GIVEN, + refresh_token: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + source: Literal[ + "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", + ] + | NotGiven = NOT_GIVEN, + user_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -530,11 +692,101 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenCreateResponse: """ - GetHostAuthenticationToken + CreateHostAuthenticationToken Args: connect_protocol_version: Define the version of the Connect protocol + expires_at: A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -555,9 +807,18 @@ async def create( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + "/gitpod.v1.RunnerConfigurationService/CreateHostAuthenticationToken", body=await async_maybe_transform( - {"id": id}, host_authentication_token_create_params.HostAuthenticationTokenCreateParams + { + "token": token, + "expires_at": expires_at, + "host": host, + "refresh_token": refresh_token, + "runner_id": runner_id, + "source": source, + "user_id": user_id, + }, + host_authentication_token_create_params.HostAuthenticationTokenCreateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -568,8 +829,12 @@ async def create( async def retrieve( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -582,8 +847,17 @@ async def retrieve( GetHostAuthenticationToken Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -603,13 +877,23 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", - body=await async_maybe_transform( - {"id": id}, host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams, + ), ), cast_to=HostAuthenticationTokenRetrieveResponse, ) @@ -848,9 +1132,12 @@ async def update( async def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -863,8 +1150,17 @@ async def list( ListHostAuthenticationTokens Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -884,17 +1180,23 @@ async def list( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - host_authentication_token_list_params.HostAuthenticationTokenListParams, - ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + host_authentication_token_list_params.HostAuthenticationTokenListParams, + ), ), cast_to=HostAuthenticationTokenListResponse, ) diff --git a/src/gitpod/resources/organizations/invite/summary.py b/src/gitpod/resources/runners/configurations/schema.py similarity index 53% rename from src/gitpod/resources/organizations/invite/summary.py rename to src/gitpod/resources/runners/configurations/schema.py index d2f030a9..347bf5db 100644 --- a/src/gitpod/resources/organizations/invite/summary.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -22,37 +22,41 @@ async_to_streamed_response_wrapper, ) from ...._base_client import make_request_options -from ....types.organizations.invite import summary_retrieve_params -from ....types.organizations.invite.summary_retrieve_response import SummaryRetrieveResponse +from ....types.runners.configurations import schema_retrieve_params +from ....types.runners.configurations.schema_retrieve_response import SchemaRetrieveResponse -__all__ = ["SummaryResource", "AsyncSummaryResource"] +__all__ = ["SchemaResource", "AsyncSchemaResource"] -class SummaryResource(SyncAPIResource): +class SchemaResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> SummaryResourceWithRawResponse: + def with_raw_response(self) -> SchemaResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return SummaryResourceWithRawResponse(self) + return SchemaResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: + def with_streaming_response(self) -> SchemaResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return SummaryResourceWithStreamingResponse(self) + return SchemaResourceWithStreamingResponse(self) def retrieve( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - invite_id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -60,16 +64,22 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SummaryRetrieveResponse: + ) -> SchemaRetrieveResponse: """ - GetOrganizationInviteSummary retrieves a summary of the organization based on an - Invite ID. - - Used to discover which organization an invite is for. + GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -89,41 +99,57 @@ def retrieve( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", - body=maybe_transform({"invite_id": invite_id}, summary_retrieve_params.SummaryRetrieveParams), + return self._get( + "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + schema_retrieve_params.SchemaRetrieveParams, + ), ), - cast_to=SummaryRetrieveResponse, + cast_to=SchemaRetrieveResponse, ) -class AsyncSummaryResource(AsyncAPIResource): +class AsyncSchemaResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: + def with_raw_response(self) -> AsyncSchemaResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return AsyncSummaryResourceWithRawResponse(self) + return AsyncSchemaResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return AsyncSummaryResourceWithStreamingResponse(self) + return AsyncSchemaResourceWithStreamingResponse(self) async def retrieve( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - invite_id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -131,16 +157,22 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SummaryRetrieveResponse: + ) -> SchemaRetrieveResponse: """ - GetOrganizationInviteSummary retrieves a summary of the organization based on an - Invite ID. - - Used to discover which organization an invite is for. + GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -160,47 +192,59 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._post( - "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", - body=await async_maybe_transform({"invite_id": invite_id}, summary_retrieve_params.SummaryRetrieveParams), + return await self._get( + "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + schema_retrieve_params.SchemaRetrieveParams, + ), ), - cast_to=SummaryRetrieveResponse, + cast_to=SchemaRetrieveResponse, ) -class SummaryResourceWithRawResponse: - def __init__(self, summary: SummaryResource) -> None: - self._summary = summary +class SchemaResourceWithRawResponse: + def __init__(self, schema: SchemaResource) -> None: + self._schema = schema self.retrieve = to_raw_response_wrapper( - summary.retrieve, + schema.retrieve, ) -class AsyncSummaryResourceWithRawResponse: - def __init__(self, summary: AsyncSummaryResource) -> None: - self._summary = summary +class AsyncSchemaResourceWithRawResponse: + def __init__(self, schema: AsyncSchemaResource) -> None: + self._schema = schema self.retrieve = async_to_raw_response_wrapper( - summary.retrieve, + schema.retrieve, ) -class SummaryResourceWithStreamingResponse: - def __init__(self, summary: SummaryResource) -> None: - self._summary = summary +class SchemaResourceWithStreamingResponse: + def __init__(self, schema: SchemaResource) -> None: + self._schema = schema self.retrieve = to_streamed_response_wrapper( - summary.retrieve, + schema.retrieve, ) -class AsyncSummaryResourceWithStreamingResponse: - def __init__(self, summary: AsyncSummaryResource) -> None: - self._summary = summary +class AsyncSchemaResourceWithStreamingResponse: + def __init__(self, schema: AsyncSchemaResource) -> None: + self._schema = schema self.retrieve = async_to_streamed_response_wrapper( - summary.retrieve, + schema.retrieve, ) diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py new file mode 100644 index 00000000..8c002740 --- /dev/null +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -0,0 +1,1095 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, overload + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + is_given, + required_args, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import make_request_options +from ....types.runners.configurations import ( + scm_integration_list_params, + scm_integration_create_params, + scm_integration_delete_params, + scm_integration_update_params, + scm_integration_retrieve_params, +) +from ....types.runners.configurations.scm_integration_list_response import ScmIntegrationListResponse +from ....types.runners.configurations.scm_integration_create_response import ScmIntegrationCreateResponse +from ....types.runners.configurations.scm_integration_retrieve_response import ScmIntegrationRetrieveResponse + +__all__ = ["ScmIntegrationsResource", "AsyncScmIntegrationsResource"] + + +class ScmIntegrationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ScmIntegrationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return ScmIntegrationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ScmIntegrationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return ScmIntegrationsResourceWithStreamingResponse(self) + + @overload + def create( + self, + *, + oauth_client_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_plaintext_client_secret must also be set. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. + + This will first be encrypted with the runner's public key before being stored. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] + ) + def create( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", + body=maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + }, + scm_integration_create_params.ScmIntegrationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScmIntegrationCreateResponse, + ) + + def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationRetrieveResponse: + """ + GetSCMIntegration returns a single SCM integration configured for a runner. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.RunnerConfigurationService/GetSCMIntegration", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + scm_integration_retrieve_params.ScmIntegrationRetrieveParams, + ), + ), + cast_to=ScmIntegrationRetrieveResponse, + ) + + @overload + def update( + self, + *, + oauth_client_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. + + If an empty string is set, the OAuth configuration will be removed (regardless + of whether a client secret is set), and any existing Host Authentication Tokens + for the SCM integration's runner and host that were created using the OAuth app + will be deleted. This might lead to users being unable to access their + repositories until they re-authenticate. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client + secret. + + The cleartext secret will be encrypted with the runner's public key before being + stored. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + pat: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + pat: pat can be set to enable or disable Personal Access Tokens support. + + When disabling PATs, any existing Host Authentication Tokens for the SCM + integration's runner and host that were created using a PAT will be deleted. + This might lead to users being unable to access their repositories until they + re-authenticate. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], + ["oauth_plaintext_client_secret", "connect_protocol_version"], + ["pat", "connect_protocol_version"], + ) + def update( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + pat: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", + body=maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + "pat": pat, + }, + scm_integration_update_params.ScmIntegrationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationListResponse: + """ + ListSCMIntegrations returns all SCM integrations configured for a runner. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + scm_integration_list_params.ScmIntegrationListParams, + ), + ), + cast_to=ScmIntegrationListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteSCMIntegration deletes an existing SCM integration on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerConfigurationService/DeleteSCMIntegration", + body=maybe_transform({"id": id}, scm_integration_delete_params.ScmIntegrationDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncScmIntegrationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncScmIntegrationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncScmIntegrationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncScmIntegrationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncScmIntegrationsResourceWithStreamingResponse(self) + + @overload + async def create( + self, + *, + oauth_client_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_plaintext_client_secret must also be set. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. + + This will first be encrypted with the runner's public key before being stored. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] + ) + async def create( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", + body=await async_maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + }, + scm_integration_create_params.ScmIntegrationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScmIntegrationCreateResponse, + ) + + async def retrieve( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationRetrieveResponse: + """ + GetSCMIntegration returns a single SCM integration configured for a runner. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.RunnerConfigurationService/GetSCMIntegration", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + scm_integration_retrieve_params.ScmIntegrationRetrieveParams, + ), + ), + cast_to=ScmIntegrationRetrieveResponse, + ) + + @overload + async def update( + self, + *, + oauth_client_id: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. + + If an empty string is set, the OAuth configuration will be removed (regardless + of whether a client secret is set), and any existing Host Authentication Tokens + for the SCM integration's runner and host that were created using the OAuth app + will be deleted. This might lead to users being unable to access their + repositories until they re-authenticate. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client + secret. + + The cleartext secret will be encrypted with the runner's public key before being + stored. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + pat: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + pat: pat can be set to enable or disable Personal Access Tokens support. + + When disabling PATs, any existing Host Authentication Tokens for the SCM + integration's runner and host that were created using a PAT will be deleted. + This might lead to users being unable to access their repositories until they + re-authenticate. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], + ["oauth_plaintext_client_secret", "connect_protocol_version"], + ["pat", "connect_protocol_version"], + ) + async def update( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + pat: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", + body=await async_maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + "pat": pat, + }, + scm_integration_update_params.ScmIntegrationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationListResponse: + """ + ListSCMIntegrations returns all SCM integrations configured for a runner. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + scm_integration_list_params.ScmIntegrationListParams, + ), + ), + cast_to=ScmIntegrationListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteSCMIntegration deletes an existing SCM integration on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerConfigurationService/DeleteSCMIntegration", + body=await async_maybe_transform({"id": id}, scm_integration_delete_params.ScmIntegrationDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class ScmIntegrationsResourceWithRawResponse: + def __init__(self, scm_integrations: ScmIntegrationsResource) -> None: + self._scm_integrations = scm_integrations + + self.create = to_raw_response_wrapper( + scm_integrations.create, + ) + self.retrieve = to_raw_response_wrapper( + scm_integrations.retrieve, + ) + self.update = to_raw_response_wrapper( + scm_integrations.update, + ) + self.list = to_raw_response_wrapper( + scm_integrations.list, + ) + self.delete = to_raw_response_wrapper( + scm_integrations.delete, + ) + + +class AsyncScmIntegrationsResourceWithRawResponse: + def __init__(self, scm_integrations: AsyncScmIntegrationsResource) -> None: + self._scm_integrations = scm_integrations + + self.create = async_to_raw_response_wrapper( + scm_integrations.create, + ) + self.retrieve = async_to_raw_response_wrapper( + scm_integrations.retrieve, + ) + self.update = async_to_raw_response_wrapper( + scm_integrations.update, + ) + self.list = async_to_raw_response_wrapper( + scm_integrations.list, + ) + self.delete = async_to_raw_response_wrapper( + scm_integrations.delete, + ) + + +class ScmIntegrationsResourceWithStreamingResponse: + def __init__(self, scm_integrations: ScmIntegrationsResource) -> None: + self._scm_integrations = scm_integrations + + self.create = to_streamed_response_wrapper( + scm_integrations.create, + ) + self.retrieve = to_streamed_response_wrapper( + scm_integrations.retrieve, + ) + self.update = to_streamed_response_wrapper( + scm_integrations.update, + ) + self.list = to_streamed_response_wrapper( + scm_integrations.list, + ) + self.delete = to_streamed_response_wrapper( + scm_integrations.delete, + ) + + +class AsyncScmIntegrationsResourceWithStreamingResponse: + def __init__(self, scm_integrations: AsyncScmIntegrationsResource) -> None: + self._scm_integrations = scm_integrations + + self.create = async_to_streamed_response_wrapper( + scm_integrations.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + scm_integrations.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + scm_integrations.update, + ) + self.list = async_to_streamed_response_wrapper( + scm_integrations.list, + ) + self.delete = async_to_streamed_response_wrapper( + scm_integrations.delete, + ) diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 057d92ac..582d4f9e 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -22,8 +22,10 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.runners import policy_list_params +from ...types.runners import policy_list_params, policy_create_params, policy_delete_params, policy_update_params from ...types.runners.policy_list_response import PolicyListResponse +from ...types.runners.policy_create_response import PolicyCreateResponse +from ...types.runners.policy_update_response import PolicyUpdateResponse __all__ = ["PoliciesResource", "AsyncPoliciesResource"] @@ -48,11 +50,72 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: """ return PoliciesResourceWithStreamingResponse(self) - def list( + def create( + self, + *, + connect_protocol_version: Literal[1], + group_id: str | NotGiven = NOT_GIVEN, + role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PolicyCreateResponse: + """ + CreateRunnerPolicy creates a new runner policy. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + group_id: group_id specifies the group_id identifier + + runner_id: runner_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/CreateRunnerPolicy", + body=maybe_transform( + { + "group_id": group_id, + "role": role, + "runner_id": runner_id, + }, + policy_create_params.PolicyCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PolicyCreateResponse, + ) + + def update( self, *, connect_protocol_version: Literal[1], - pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, + group_id: str | NotGiven = NOT_GIVEN, + role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -61,14 +124,145 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PolicyUpdateResponse: + """ + UpdateRunnerPolicy an existing runner policy. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + group_id: group_id specifies the group_id identifier + + runner_id: runner_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.RunnerService/UpdateRunnerPolicy", + body=maybe_transform( + { + "group_id": group_id, + "role": role, + "runner_id": runner_id, + }, + policy_update_params.PolicyUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PolicyUpdateResponse, + ) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyListResponse: """ ListRunnerPolicies lists runner policies. + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.RunnerService/ListRunnerPolicies", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + policy_list_params.PolicyListParams, + ), + ), + cast_to=PolicyListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + group_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteRunnerPolicy deletes a runner policy. + Args: connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing project policies + group_id: group_id specifies the group_id identifier runner_id: runner_id specifies the project identifier @@ -92,18 +286,18 @@ def list( **(extra_headers or {}), } return self._post( - "/gitpod.v1.RunnerService/ListRunnerPolicies", + "/gitpod.v1.RunnerService/DeleteRunnerPolicy", body=maybe_transform( { - "pagination": pagination, + "group_id": group_id, "runner_id": runner_id, }, - policy_list_params.PolicyListParams, + policy_delete_params.PolicyDeleteParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PolicyListResponse, + cast_to=object, ) @@ -127,11 +321,72 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: """ return AsyncPoliciesResourceWithStreamingResponse(self) - async def list( + async def create( + self, + *, + connect_protocol_version: Literal[1], + group_id: str | NotGiven = NOT_GIVEN, + role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PolicyCreateResponse: + """ + CreateRunnerPolicy creates a new runner policy. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + group_id: group_id specifies the group_id identifier + + runner_id: runner_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/CreateRunnerPolicy", + body=await async_maybe_transform( + { + "group_id": group_id, + "role": role, + "runner_id": runner_id, + }, + policy_create_params.PolicyCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PolicyCreateResponse, + ) + + async def update( self, *, connect_protocol_version: Literal[1], - pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, + group_id: str | NotGiven = NOT_GIVEN, + role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -140,14 +395,145 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PolicyUpdateResponse: + """ + UpdateRunnerPolicy an existing runner policy. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + group_id: group_id specifies the group_id identifier + + runner_id: runner_id specifies the project identifier + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.RunnerService/UpdateRunnerPolicy", + body=await async_maybe_transform( + { + "group_id": group_id, + "role": role, + "runner_id": runner_id, + }, + policy_update_params.PolicyUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PolicyUpdateResponse, + ) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyListResponse: """ ListRunnerPolicies lists runner policies. + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.RunnerService/ListRunnerPolicies", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + policy_list_params.PolicyListParams, + ), + ), + cast_to=PolicyListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + group_id: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteRunnerPolicy deletes a runner policy. + Args: connect_protocol_version: Define the version of the Connect protocol - pagination: pagination contains the pagination options for listing project policies + group_id: group_id specifies the group_id identifier runner_id: runner_id specifies the project identifier @@ -171,18 +557,18 @@ async def list( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.RunnerService/ListRunnerPolicies", + "/gitpod.v1.RunnerService/DeleteRunnerPolicy", body=await async_maybe_transform( { - "pagination": pagination, + "group_id": group_id, "runner_id": runner_id, }, - policy_list_params.PolicyListParams, + policy_delete_params.PolicyDeleteParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PolicyListResponse, + cast_to=object, ) @@ -190,33 +576,69 @@ class PoliciesResourceWithRawResponse: def __init__(self, policies: PoliciesResource) -> None: self._policies = policies + self.create = to_raw_response_wrapper( + policies.create, + ) + self.update = to_raw_response_wrapper( + policies.update, + ) self.list = to_raw_response_wrapper( policies.list, ) + self.delete = to_raw_response_wrapper( + policies.delete, + ) class AsyncPoliciesResourceWithRawResponse: def __init__(self, policies: AsyncPoliciesResource) -> None: self._policies = policies + self.create = async_to_raw_response_wrapper( + policies.create, + ) + self.update = async_to_raw_response_wrapper( + policies.update, + ) self.list = async_to_raw_response_wrapper( policies.list, ) + self.delete = async_to_raw_response_wrapper( + policies.delete, + ) class PoliciesResourceWithStreamingResponse: def __init__(self, policies: PoliciesResource) -> None: self._policies = policies + self.create = to_streamed_response_wrapper( + policies.create, + ) + self.update = to_streamed_response_wrapper( + policies.update, + ) self.list = to_streamed_response_wrapper( policies.list, ) + self.delete = to_streamed_response_wrapper( + policies.delete, + ) class AsyncPoliciesResourceWithStreamingResponse: def __init__(self, policies: AsyncPoliciesResource) -> None: self._policies = policies + self.create = async_to_streamed_response_wrapper( + policies.create, + ) + self.update = async_to_streamed_response_wrapper( + policies.update, + ) self.list = async_to_streamed_response_wrapper( policies.list, ) + self.delete = async_to_streamed_response_wrapper( + policies.delete, + ) diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index c0042ba4..f06bc67d 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -9,10 +9,9 @@ from ...types import ( runner_list_params, runner_create_params, + runner_delete_params, + runner_update_params, runner_retrieve_params, - runner_get_runner_params, - runner_delete_runner_params, - runner_update_runner_params, runner_parse_context_url_params, runner_create_runner_token_params, runner_check_authentication_for_host_params, @@ -43,9 +42,16 @@ ) from ..._base_client import make_request_options from ...types.runner_list_response import RunnerListResponse +from .configurations.configurations import ( + ConfigurationsResource, + AsyncConfigurationsResource, + ConfigurationsResourceWithRawResponse, + AsyncConfigurationsResourceWithRawResponse, + ConfigurationsResourceWithStreamingResponse, + AsyncConfigurationsResourceWithStreamingResponse, +) from ...types.runner_create_response import RunnerCreateResponse from ...types.runner_retrieve_response import RunnerRetrieveResponse -from ...types.runner_get_runner_response import RunnerGetRunnerResponse from ...types.runner_parse_context_url_response import RunnerParseContextURLResponse from ...types.runner_create_runner_token_response import RunnerCreateRunnerTokenResponse from ...types.runner_check_authentication_for_host_response import RunnerCheckAuthenticationForHostResponse @@ -54,6 +60,10 @@ class RunnersResource(SyncAPIResource): + @cached_property + def configurations(self) -> ConfigurationsResource: + return ConfigurationsResource(self._client) + @cached_property def policies(self) -> PoliciesResource: return PoliciesResource(self._client) @@ -147,8 +157,12 @@ def create( def retrieve( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -161,8 +175,17 @@ def retrieve( GetRunner returns a single runner. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -182,21 +205,33 @@ def retrieve( ), **(extra_headers or {}), } - return self._post( + return self._get( "/gitpod.v1.RunnerService/GetRunner", - body=maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + runner_retrieve_params.RunnerRetrieveParams, + ), ), cast_to=RunnerRetrieveResponse, ) - def list( + @overload + def update( self, *, + name: str, connect_protocol_version: Literal[1], - filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -204,14 +239,14 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerListResponse: + ) -> object: """ - ListRunners returns all runners registered in the scope. + UpdateRunner updates an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol + name: The runner's name which is shown to users - pagination: pagination contains the pagination options for listing runners + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -223,36 +258,14 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._post( - "/gitpod.v1.RunnerService/ListRunners", - body=maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - runner_list_params.RunnerListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerListResponse, - ) + ... - def check_authentication_for_host( + @overload + def update( self, *, + spec: runner_update_params.Variant1Spec, connect_protocol_version: Literal[1], - host: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -260,13 +273,9 @@ def check_authentication_for_host( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerCheckAuthenticationForHostResponse: + ) -> object: """ - CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. - - If not, this function will return a URL that the user should visit to - authenticate, or indicate that Personal Access Tokens are supported. + UpdateRunner updates an environment runner. Args: connect_protocol_version: Define the version of the Connect protocol @@ -281,6 +290,23 @@ def check_authentication_for_host( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + def update( + self, + *, + name: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -291,25 +317,29 @@ def check_authentication_for_host( **(extra_headers or {}), } return self._post( - "/gitpod.v1.RunnerService/CheckAuthenticationForHost", + "/gitpod.v1.RunnerService/UpdateRunner", body=maybe_transform( { - "host": host, - "runner_id": runner_id, + "name": name, + "spec": spec, }, - runner_check_authentication_for_host_params.RunnerCheckAuthenticationForHostParams, + runner_update_params.RunnerUpdateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RunnerCheckAuthenticationForHostResponse, + cast_to=object, ) - def create_runner_token( + def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -317,16 +347,22 @@ def create_runner_token( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerCreateRunnerTokenResponse: + ) -> RunnerListResponse: """ - CreateRunnerToken returns a token that can be used to authenticate as the - - runner. Use this call to renew an outdated token - this does not expire any - previouly issued tokens. + ListRunners returns all runners registered in the scope. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -346,18 +382,28 @@ def create_runner_token( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.RunnerService/CreateRunnerToken", - body=maybe_transform( - {"runner_id": runner_id}, runner_create_runner_token_params.RunnerCreateRunnerTokenParams - ), + return self._get( + "/gitpod.v1.RunnerService/ListRunners", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + runner_list_params.RunnerListParams, + ), ), - cast_to=RunnerCreateRunnerTokenResponse, + cast_to=RunnerListResponse, ) - def delete_runner( + def delete( self, *, connect_protocol_version: Literal[1], @@ -408,7 +454,7 @@ def delete_runner( "force": force, "runner_id": runner_id, }, - runner_delete_runner_params.RunnerDeleteRunnerParams, + runner_delete_params.RunnerDeleteParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -416,10 +462,11 @@ def delete_runner( cast_to=object, ) - def get_runner( + def check_authentication_for_host( self, *, connect_protocol_version: Literal[1], + host: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -428,9 +475,13 @@ def get_runner( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerGetRunnerResponse: + ) -> RunnerCheckAuthenticationForHostResponse: """ - GetRunner returns a single runner. + CheckAuthenticationForHost asks a runner if the user is authenticated against a + particular host, e.g. an SCM system. + + If not, this function will return a URL that the user should visit to + authenticate, or indicate that Personal Access Tokens are supported. Args: connect_protocol_version: Define the version of the Connect protocol @@ -455,19 +506,24 @@ def get_runner( **(extra_headers or {}), } return self._post( - "/gitpod.v1.RunnerService/GetRunner", - body=maybe_transform({"runner_id": runner_id}, runner_get_runner_params.RunnerGetRunnerParams), + "/gitpod.v1.RunnerService/CheckAuthenticationForHost", + body=maybe_transform( + { + "host": host, + "runner_id": runner_id, + }, + runner_check_authentication_for_host_params.RunnerCheckAuthenticationForHostParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RunnerGetRunnerResponse, + cast_to=RunnerCheckAuthenticationForHostResponse, ) - def parse_context_url( + def create_runner_token( self, *, connect_protocol_version: Literal[1], - context_url: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -476,20 +532,12 @@ def parse_context_url( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerParseContextURLResponse: + ) -> RunnerCreateRunnerTokenResponse: """ - ParseContextURL asks a runner to parse a context URL, and return the parsed - result. - - This call returns + CreateRunnerToken returns a token that can be used to authenticate as the - - FAILED_PRECONDITION if the user requires authentication on the runner to - access the context URL - - PERMISSION_DENIED if the user is not allowed to access the context URL using - the credentials they have - - INVALID_ARGUMENT if the context URL is invalid - - NOT_FOUND if the repository or branch indicated by the context URL does not - exist + runner. Use this call to renew an outdated token - this does not expire any + previouly issued tokens. Args: connect_protocol_version: Define the version of the Connect protocol @@ -514,26 +562,22 @@ def parse_context_url( **(extra_headers or {}), } return self._post( - "/gitpod.v1.RunnerService/ParseContextURL", + "/gitpod.v1.RunnerService/CreateRunnerToken", body=maybe_transform( - { - "context_url": context_url, - "runner_id": runner_id, - }, - runner_parse_context_url_params.RunnerParseContextURLParams, + {"runner_id": runner_id}, runner_create_runner_token_params.RunnerCreateRunnerTokenParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RunnerParseContextURLResponse, + cast_to=RunnerCreateRunnerTokenResponse, ) - @overload - def update_runner( + def parse_context_url( self, *, - name: str, connect_protocol_version: Literal[1], + context_url: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -541,43 +585,20 @@ def update_runner( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> RunnerParseContextURLResponse: """ - UpdateRunner updates an environment runner. - - Args: - name: The runner's name which is shown to users - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request + ParseContextURL asks a runner to parse a context URL, and return the parsed + result. - timeout: Override the client-level default timeout for this request, in seconds - """ - ... + This call returns - @overload - def update_runner( - self, - *, - spec: runner_update_runner_params.SpecSpec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunner updates an environment runner. + - FAILED_PRECONDITION if the user requires authentication on the runner to + access the context URL + - PERMISSION_DENIED if the user is not allowed to access the context URL using + the credentials they have + - INVALID_ARGUMENT if the context URL is invalid + - NOT_FOUND if the repository or branch indicated by the context URL does not + exist Args: connect_protocol_version: Define the version of the Connect protocol @@ -592,23 +613,6 @@ def update_runner( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) - def update_runner( - self, - *, - name: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - spec: runner_update_runner_params.SpecSpec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -619,22 +623,26 @@ def update_runner( **(extra_headers or {}), } return self._post( - "/gitpod.v1.RunnerService/UpdateRunner", + "/gitpod.v1.RunnerService/ParseContextURL", body=maybe_transform( { - "name": name, - "spec": spec, + "context_url": context_url, + "runner_id": runner_id, }, - runner_update_runner_params.RunnerUpdateRunnerParams, + runner_parse_context_url_params.RunnerParseContextURLParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=object, + cast_to=RunnerParseContextURLResponse, ) class AsyncRunnersResource(AsyncAPIResource): + @cached_property + def configurations(self) -> AsyncConfigurationsResource: + return AsyncConfigurationsResource(self._client) + @cached_property def policies(self) -> AsyncPoliciesResource: return AsyncPoliciesResource(self._client) @@ -728,8 +736,12 @@ async def create( async def retrieve( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -742,8 +754,17 @@ async def retrieve( GetRunner returns a single runner. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -763,21 +784,33 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._post( + return await self._get( "/gitpod.v1.RunnerService/GetRunner", - body=await async_maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + runner_retrieve_params.RunnerRetrieveParams, + ), ), cast_to=RunnerRetrieveResponse, ) - async def list( + @overload + async def update( self, *, + name: str, connect_protocol_version: Literal[1], - filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -785,14 +818,14 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerListResponse: + ) -> object: """ - ListRunners returns all runners registered in the scope. + UpdateRunner updates an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol + name: The runner's name which is shown to users - pagination: pagination contains the pagination options for listing runners + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -804,36 +837,14 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._post( - "/gitpod.v1.RunnerService/ListRunners", - body=await async_maybe_transform( - { - "filter": filter, - "pagination": pagination, - }, - runner_list_params.RunnerListParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RunnerListResponse, - ) + ... - async def check_authentication_for_host( + @overload + async def update( self, *, + spec: runner_update_params.Variant1Spec, connect_protocol_version: Literal[1], - host: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -841,13 +852,9 @@ async def check_authentication_for_host( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerCheckAuthenticationForHostResponse: + ) -> object: """ - CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. - - If not, this function will return a URL that the user should visit to - authenticate, or indicate that Personal Access Tokens are supported. + UpdateRunner updates an environment runner. Args: connect_protocol_version: Define the version of the Connect protocol @@ -862,6 +869,23 @@ async def check_authentication_for_host( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + async def update( + self, + *, + name: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -872,25 +896,29 @@ async def check_authentication_for_host( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.RunnerService/CheckAuthenticationForHost", + "/gitpod.v1.RunnerService/UpdateRunner", body=await async_maybe_transform( { - "host": host, - "runner_id": runner_id, + "name": name, + "spec": spec, }, - runner_check_authentication_for_host_params.RunnerCheckAuthenticationForHostParams, + runner_update_params.RunnerUpdateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RunnerCheckAuthenticationForHostResponse, + cast_to=object, ) - async def create_runner_token( + async def list( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -898,16 +926,22 @@ async def create_runner_token( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerCreateRunnerTokenResponse: + ) -> RunnerListResponse: """ - CreateRunnerToken returns a token that can be used to authenticate as the - - runner. Use this call to renew an outdated token - this does not expire any - previouly issued tokens. + ListRunners returns all runners registered in the scope. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -927,18 +961,28 @@ async def create_runner_token( ), **(extra_headers or {}), } - return await self._post( - "/gitpod.v1.RunnerService/CreateRunnerToken", - body=await async_maybe_transform( - {"runner_id": runner_id}, runner_create_runner_token_params.RunnerCreateRunnerTokenParams - ), + return await self._get( + "/gitpod.v1.RunnerService/ListRunners", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + runner_list_params.RunnerListParams, + ), ), - cast_to=RunnerCreateRunnerTokenResponse, + cast_to=RunnerListResponse, ) - async def delete_runner( + async def delete( self, *, connect_protocol_version: Literal[1], @@ -989,7 +1033,7 @@ async def delete_runner( "force": force, "runner_id": runner_id, }, - runner_delete_runner_params.RunnerDeleteRunnerParams, + runner_delete_params.RunnerDeleteParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -997,10 +1041,11 @@ async def delete_runner( cast_to=object, ) - async def get_runner( + async def check_authentication_for_host( self, *, connect_protocol_version: Literal[1], + host: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1009,9 +1054,13 @@ async def get_runner( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerGetRunnerResponse: + ) -> RunnerCheckAuthenticationForHostResponse: """ - GetRunner returns a single runner. + CheckAuthenticationForHost asks a runner if the user is authenticated against a + particular host, e.g. an SCM system. + + If not, this function will return a URL that the user should visit to + authenticate, or indicate that Personal Access Tokens are supported. Args: connect_protocol_version: Define the version of the Connect protocol @@ -1036,19 +1085,24 @@ async def get_runner( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.RunnerService/GetRunner", - body=await async_maybe_transform({"runner_id": runner_id}, runner_get_runner_params.RunnerGetRunnerParams), + "/gitpod.v1.RunnerService/CheckAuthenticationForHost", + body=await async_maybe_transform( + { + "host": host, + "runner_id": runner_id, + }, + runner_check_authentication_for_host_params.RunnerCheckAuthenticationForHostParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RunnerGetRunnerResponse, + cast_to=RunnerCheckAuthenticationForHostResponse, ) - async def parse_context_url( + async def create_runner_token( self, *, connect_protocol_version: Literal[1], - context_url: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1057,20 +1111,12 @@ async def parse_context_url( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerParseContextURLResponse: + ) -> RunnerCreateRunnerTokenResponse: """ - ParseContextURL asks a runner to parse a context URL, and return the parsed - result. - - This call returns + CreateRunnerToken returns a token that can be used to authenticate as the - - FAILED_PRECONDITION if the user requires authentication on the runner to - access the context URL - - PERMISSION_DENIED if the user is not allowed to access the context URL using - the credentials they have - - INVALID_ARGUMENT if the context URL is invalid - - NOT_FOUND if the repository or branch indicated by the context URL does not - exist + runner. Use this call to renew an outdated token - this does not expire any + previouly issued tokens. Args: connect_protocol_version: Define the version of the Connect protocol @@ -1095,26 +1141,22 @@ async def parse_context_url( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.RunnerService/ParseContextURL", + "/gitpod.v1.RunnerService/CreateRunnerToken", body=await async_maybe_transform( - { - "context_url": context_url, - "runner_id": runner_id, - }, - runner_parse_context_url_params.RunnerParseContextURLParams, + {"runner_id": runner_id}, runner_create_runner_token_params.RunnerCreateRunnerTokenParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RunnerParseContextURLResponse, + cast_to=RunnerCreateRunnerTokenResponse, ) - @overload - async def update_runner( + async def parse_context_url( self, *, - name: str, connect_protocol_version: Literal[1], + context_url: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1122,43 +1164,20 @@ async def update_runner( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> RunnerParseContextURLResponse: """ - UpdateRunner updates an environment runner. - - Args: - name: The runner's name which is shown to users - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request + ParseContextURL asks a runner to parse a context URL, and return the parsed + result. - timeout: Override the client-level default timeout for this request, in seconds - """ - ... + This call returns - @overload - async def update_runner( - self, - *, - spec: runner_update_runner_params.SpecSpec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunner updates an environment runner. + - FAILED_PRECONDITION if the user requires authentication on the runner to + access the context URL + - PERMISSION_DENIED if the user is not allowed to access the context URL using + the credentials they have + - INVALID_ARGUMENT if the context URL is invalid + - NOT_FOUND if the repository or branch indicated by the context URL does not + exist Args: connect_protocol_version: Define the version of the Connect protocol @@ -1173,23 +1192,6 @@ async def update_runner( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) - async def update_runner( - self, - *, - name: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - spec: runner_update_runner_params.SpecSpec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -1200,18 +1202,18 @@ async def update_runner( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.RunnerService/UpdateRunner", + "/gitpod.v1.RunnerService/ParseContextURL", body=await async_maybe_transform( { - "name": name, - "spec": spec, + "context_url": context_url, + "runner_id": runner_id, }, - runner_update_runner_params.RunnerUpdateRunnerParams, + runner_parse_context_url_params.RunnerParseContextURLParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=object, + cast_to=RunnerParseContextURLResponse, ) @@ -1225,27 +1227,28 @@ def __init__(self, runners: RunnersResource) -> None: self.retrieve = to_raw_response_wrapper( runners.retrieve, ) + self.update = to_raw_response_wrapper( + runners.update, + ) self.list = to_raw_response_wrapper( runners.list, ) + self.delete = to_raw_response_wrapper( + runners.delete, + ) self.check_authentication_for_host = to_raw_response_wrapper( runners.check_authentication_for_host, ) self.create_runner_token = to_raw_response_wrapper( runners.create_runner_token, ) - self.delete_runner = to_raw_response_wrapper( - runners.delete_runner, - ) - self.get_runner = to_raw_response_wrapper( - runners.get_runner, - ) self.parse_context_url = to_raw_response_wrapper( runners.parse_context_url, ) - self.update_runner = to_raw_response_wrapper( - runners.update_runner, - ) + + @cached_property + def configurations(self) -> ConfigurationsResourceWithRawResponse: + return ConfigurationsResourceWithRawResponse(self._runners.configurations) @cached_property def policies(self) -> PoliciesResourceWithRawResponse: @@ -1262,27 +1265,28 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.retrieve = async_to_raw_response_wrapper( runners.retrieve, ) + self.update = async_to_raw_response_wrapper( + runners.update, + ) self.list = async_to_raw_response_wrapper( runners.list, ) + self.delete = async_to_raw_response_wrapper( + runners.delete, + ) self.check_authentication_for_host = async_to_raw_response_wrapper( runners.check_authentication_for_host, ) self.create_runner_token = async_to_raw_response_wrapper( runners.create_runner_token, ) - self.delete_runner = async_to_raw_response_wrapper( - runners.delete_runner, - ) - self.get_runner = async_to_raw_response_wrapper( - runners.get_runner, - ) self.parse_context_url = async_to_raw_response_wrapper( runners.parse_context_url, ) - self.update_runner = async_to_raw_response_wrapper( - runners.update_runner, - ) + + @cached_property + def configurations(self) -> AsyncConfigurationsResourceWithRawResponse: + return AsyncConfigurationsResourceWithRawResponse(self._runners.configurations) @cached_property def policies(self) -> AsyncPoliciesResourceWithRawResponse: @@ -1299,27 +1303,28 @@ def __init__(self, runners: RunnersResource) -> None: self.retrieve = to_streamed_response_wrapper( runners.retrieve, ) + self.update = to_streamed_response_wrapper( + runners.update, + ) self.list = to_streamed_response_wrapper( runners.list, ) + self.delete = to_streamed_response_wrapper( + runners.delete, + ) self.check_authentication_for_host = to_streamed_response_wrapper( runners.check_authentication_for_host, ) self.create_runner_token = to_streamed_response_wrapper( runners.create_runner_token, ) - self.delete_runner = to_streamed_response_wrapper( - runners.delete_runner, - ) - self.get_runner = to_streamed_response_wrapper( - runners.get_runner, - ) self.parse_context_url = to_streamed_response_wrapper( runners.parse_context_url, ) - self.update_runner = to_streamed_response_wrapper( - runners.update_runner, - ) + + @cached_property + def configurations(self) -> ConfigurationsResourceWithStreamingResponse: + return ConfigurationsResourceWithStreamingResponse(self._runners.configurations) @cached_property def policies(self) -> PoliciesResourceWithStreamingResponse: @@ -1336,27 +1341,28 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.retrieve = async_to_streamed_response_wrapper( runners.retrieve, ) + self.update = async_to_streamed_response_wrapper( + runners.update, + ) self.list = async_to_streamed_response_wrapper( runners.list, ) + self.delete = async_to_streamed_response_wrapper( + runners.delete, + ) self.check_authentication_for_host = async_to_streamed_response_wrapper( runners.check_authentication_for_host, ) self.create_runner_token = async_to_streamed_response_wrapper( runners.create_runner_token, ) - self.delete_runner = async_to_streamed_response_wrapper( - runners.delete_runner, - ) - self.get_runner = async_to_streamed_response_wrapper( - runners.get_runner, - ) self.parse_context_url = async_to_streamed_response_wrapper( runners.parse_context_url, ) - self.update_runner = async_to_streamed_response_wrapper( - runners.update_runner, - ) + + @cached_property + def configurations(self) -> AsyncConfigurationsResourceWithStreamingResponse: + return AsyncConfigurationsResourceWithStreamingResponse(self._runners.configurations) @cached_property def policies(self) -> AsyncPoliciesResourceWithStreamingResponse: diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py new file mode 100644 index 00000000..8e50019b --- /dev/null +++ b/src/gitpod/resources/secrets.py @@ -0,0 +1,925 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, overload + +import httpx + +from ..types import ( + secret_list_params, + secret_create_params, + secret_delete_params, + secret_get_value_params, + secret_update_value_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + is_given, + required_args, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.secret_list_response import SecretListResponse +from ..types.secret_create_response import SecretCreateResponse +from ..types.secret_get_value_response import SecretGetValueResponse + +__all__ = ["SecretsResource", "AsyncSecretsResource"] + + +class SecretsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SecretsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return SecretsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return SecretsResourceWithStreamingResponse(self) + + @overload + def create( + self, + *, + environment_variable: bool, + connect_protocol_version: Literal[1], + name: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretCreateResponse: + """ + CreateSecret creates a new secret. + + Args: + environment_variable: secret will be created as an Environment Variable with the same name as the + secret + + connect_protocol_version: Define the version of the Connect protocol + + project_id: project_id is the ProjectID this Secret belongs to + + value: value is the plaintext value of the secret + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + file_path: str, + connect_protocol_version: Literal[1], + name: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretCreateResponse: + """ + CreateSecret creates a new secret. + + Args: + file_path: absolute path to the file where the secret is mounted value must be an absolute + path (start with a /): + + ``` + this.matches("^/(?:[^/]*/)*.*$") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + project_id: project_id is the ProjectID this Secret belongs to + + value: value is the plaintext value of the secret + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["environment_variable", "connect_protocol_version"], ["file_path", "connect_protocol_version"]) + def create( + self, + *, + environment_variable: bool | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + name: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretCreateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.SecretService/CreateSecret", + body=maybe_transform( + { + "environment_variable": environment_variable, + "name": name, + "project_id": project_id, + "value": value, + "file_path": file_path, + }, + secret_create_params.SecretCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SecretCreateResponse, + ) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretListResponse: + """ + ListSecrets lists secrets. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.SecretService/ListSecrets", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + secret_list_params.SecretListParams, + ), + ), + cast_to=SecretListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + secret_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteSecret deletes a secret. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.SecretService/DeleteSecret", + body=maybe_transform({"secret_id": secret_id}, secret_delete_params.SecretDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_value( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretGetValueResponse: + """ + GetSecretValue retrieves the value of a secret Only Environments can perform + this operation, and only for secrets specified on the EnvironmentSpec. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.SecretService/GetSecretValue", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + secret_get_value_params.SecretGetValueParams, + ), + ), + cast_to=SecretGetValueResponse, + ) + + def update_value( + self, + *, + connect_protocol_version: Literal[1], + secret_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSecretValue updates the value of a secret. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + value: value is the plaintext value of the secret + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.SecretService/UpdateSecretValue", + body=maybe_transform( + { + "secret_id": secret_id, + "value": value, + }, + secret_update_value_params.SecretUpdateValueParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncSecretsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSecretsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncSecretsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncSecretsResourceWithStreamingResponse(self) + + @overload + async def create( + self, + *, + environment_variable: bool, + connect_protocol_version: Literal[1], + name: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretCreateResponse: + """ + CreateSecret creates a new secret. + + Args: + environment_variable: secret will be created as an Environment Variable with the same name as the + secret + + connect_protocol_version: Define the version of the Connect protocol + + project_id: project_id is the ProjectID this Secret belongs to + + value: value is the plaintext value of the secret + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + file_path: str, + connect_protocol_version: Literal[1], + name: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretCreateResponse: + """ + CreateSecret creates a new secret. + + Args: + file_path: absolute path to the file where the secret is mounted value must be an absolute + path (start with a /): + + ``` + this.matches("^/(?:[^/]*/)*.*$") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + project_id: project_id is the ProjectID this Secret belongs to + + value: value is the plaintext value of the secret + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["environment_variable", "connect_protocol_version"], ["file_path", "connect_protocol_version"]) + async def create( + self, + *, + environment_variable: bool | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + name: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretCreateResponse: + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.SecretService/CreateSecret", + body=await async_maybe_transform( + { + "environment_variable": environment_variable, + "name": name, + "project_id": project_id, + "value": value, + "file_path": file_path, + }, + secret_create_params.SecretCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SecretCreateResponse, + ) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretListResponse: + """ + ListSecrets lists secrets. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.SecretService/ListSecrets", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + secret_list_params.SecretListParams, + ), + ), + cast_to=SecretListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + secret_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteSecret deletes a secret. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.SecretService/DeleteSecret", + body=await async_maybe_transform({"secret_id": secret_id}, secret_delete_params.SecretDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_value( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretGetValueResponse: + """ + GetSecretValue retrieves the value of a secret Only Environments can perform + this operation, and only for secrets specified on the EnvironmentSpec. + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.SecretService/GetSecretValue", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + secret_get_value_params.SecretGetValueParams, + ), + ), + cast_to=SecretGetValueResponse, + ) + + async def update_value( + self, + *, + connect_protocol_version: Literal[1], + secret_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSecretValue updates the value of a secret. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + value: value is the plaintext value of the secret + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.SecretService/UpdateSecretValue", + body=await async_maybe_transform( + { + "secret_id": secret_id, + "value": value, + }, + secret_update_value_params.SecretUpdateValueParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class SecretsResourceWithRawResponse: + def __init__(self, secrets: SecretsResource) -> None: + self._secrets = secrets + + self.create = to_raw_response_wrapper( + secrets.create, + ) + self.list = to_raw_response_wrapper( + secrets.list, + ) + self.delete = to_raw_response_wrapper( + secrets.delete, + ) + self.get_value = to_raw_response_wrapper( + secrets.get_value, + ) + self.update_value = to_raw_response_wrapper( + secrets.update_value, + ) + + +class AsyncSecretsResourceWithRawResponse: + def __init__(self, secrets: AsyncSecretsResource) -> None: + self._secrets = secrets + + self.create = async_to_raw_response_wrapper( + secrets.create, + ) + self.list = async_to_raw_response_wrapper( + secrets.list, + ) + self.delete = async_to_raw_response_wrapper( + secrets.delete, + ) + self.get_value = async_to_raw_response_wrapper( + secrets.get_value, + ) + self.update_value = async_to_raw_response_wrapper( + secrets.update_value, + ) + + +class SecretsResourceWithStreamingResponse: + def __init__(self, secrets: SecretsResource) -> None: + self._secrets = secrets + + self.create = to_streamed_response_wrapper( + secrets.create, + ) + self.list = to_streamed_response_wrapper( + secrets.list, + ) + self.delete = to_streamed_response_wrapper( + secrets.delete, + ) + self.get_value = to_streamed_response_wrapper( + secrets.get_value, + ) + self.update_value = to_streamed_response_wrapper( + secrets.update_value, + ) + + +class AsyncSecretsResourceWithStreamingResponse: + def __init__(self, secrets: AsyncSecretsResource) -> None: + self._secrets = secrets + + self.create = async_to_streamed_response_wrapper( + secrets.create, + ) + self.list = async_to_streamed_response_wrapper( + secrets.list, + ) + self.delete = async_to_streamed_response_wrapper( + secrets.delete, + ) + self.get_value = async_to_streamed_response_wrapper( + secrets.get_value, + ) + self.update_value = async_to_streamed_response_wrapper( + secrets.update_value, + ) diff --git a/src/gitpod/resources/users/__init__.py b/src/gitpod/resources/users/__init__.py new file mode 100644 index 00000000..c138e0bf --- /dev/null +++ b/src/gitpod/resources/users/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .pats import ( + PatsResource, + AsyncPatsResource, + PatsResourceWithRawResponse, + AsyncPatsResourceWithRawResponse, + PatsResourceWithStreamingResponse, + AsyncPatsResourceWithStreamingResponse, +) +from .users import ( + UsersResource, + AsyncUsersResource, + UsersResourceWithRawResponse, + AsyncUsersResourceWithRawResponse, + UsersResourceWithStreamingResponse, + AsyncUsersResourceWithStreamingResponse, +) + +__all__ = [ + "PatsResource", + "AsyncPatsResource", + "PatsResourceWithRawResponse", + "AsyncPatsResourceWithRawResponse", + "PatsResourceWithStreamingResponse", + "AsyncPatsResourceWithStreamingResponse", + "UsersResource", + "AsyncUsersResource", + "UsersResourceWithRawResponse", + "AsyncUsersResourceWithRawResponse", + "UsersResourceWithStreamingResponse", + "AsyncUsersResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py new file mode 100644 index 00000000..3edadb79 --- /dev/null +++ b/src/gitpod/resources/users/pats.py @@ -0,0 +1,517 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...types.users import pat_get_params, pat_list_params, pat_delete_params +from ..._base_client import make_request_options +from ...types.users.pat_get_response import PatGetResponse +from ...types.users.pat_list_response import PatListResponse + +__all__ = ["PatsResource", "AsyncPatsResource"] + + +class PatsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PatsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return PatsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PatsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return PatsResourceWithStreamingResponse(self) + + def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PatListResponse: + """ + ListPersonalAccessTokens + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.UserService/ListPersonalAccessTokens", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + pat_list_params.PatListParams, + ), + ), + cast_to=PatListResponse, + ) + + def delete( + self, + *, + connect_protocol_version: Literal[1], + personal_access_token_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeletePersonalAccessToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._post( + "/gitpod.v1.UserService/DeletePersonalAccessToken", + body=maybe_transform( + {"personal_access_token_id": personal_access_token_id}, pat_delete_params.PatDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PatGetResponse: + """ + GetPersonalAccessToken + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return self._get( + "/gitpod.v1.UserService/GetPersonalAccessToken", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + pat_get_params.PatGetParams, + ), + ), + cast_to=PatGetResponse, + ) + + +class AsyncPatsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPatsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + """ + return AsyncPatsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPatsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + """ + return AsyncPatsResourceWithStreamingResponse(self) + + async def list( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PatListResponse: + """ + ListPersonalAccessTokens + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.UserService/ListPersonalAccessTokens", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + pat_list_params.PatListParams, + ), + ), + cast_to=PatListResponse, + ) + + async def delete( + self, + *, + connect_protocol_version: Literal[1], + personal_access_token_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeletePersonalAccessToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._post( + "/gitpod.v1.UserService/DeletePersonalAccessToken", + body=await async_maybe_transform( + {"personal_access_token_id": personal_access_token_id}, pat_delete_params.PatDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get( + self, + *, + encoding: Literal["proto", "json"], + connect_protocol_version: Literal[1], + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PatGetResponse: + """ + GetPersonalAccessToken + + Args: + encoding: Define which encoding or 'Message-Codec' to use + + connect_protocol_version: Define the version of the Connect protocol + + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + extra_headers = { + **strip_not_given( + { + "Connect-Protocol-Version": str(connect_protocol_version), + "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, + } + ), + **(extra_headers or {}), + } + return await self._get( + "/gitpod.v1.UserService/GetPersonalAccessToken", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + pat_get_params.PatGetParams, + ), + ), + cast_to=PatGetResponse, + ) + + +class PatsResourceWithRawResponse: + def __init__(self, pats: PatsResource) -> None: + self._pats = pats + + self.list = to_raw_response_wrapper( + pats.list, + ) + self.delete = to_raw_response_wrapper( + pats.delete, + ) + self.get = to_raw_response_wrapper( + pats.get, + ) + + +class AsyncPatsResourceWithRawResponse: + def __init__(self, pats: AsyncPatsResource) -> None: + self._pats = pats + + self.list = async_to_raw_response_wrapper( + pats.list, + ) + self.delete = async_to_raw_response_wrapper( + pats.delete, + ) + self.get = async_to_raw_response_wrapper( + pats.get, + ) + + +class PatsResourceWithStreamingResponse: + def __init__(self, pats: PatsResource) -> None: + self._pats = pats + + self.list = to_streamed_response_wrapper( + pats.list, + ) + self.delete = to_streamed_response_wrapper( + pats.delete, + ) + self.get = to_streamed_response_wrapper( + pats.get, + ) + + +class AsyncPatsResourceWithStreamingResponse: + def __init__(self, pats: AsyncPatsResource) -> None: + self._pats = pats + + self.list = async_to_streamed_response_wrapper( + pats.list, + ) + self.delete = async_to_streamed_response_wrapper( + pats.delete, + ) + self.get = async_to_streamed_response_wrapper( + pats.get, + ) diff --git a/src/gitpod/resources/runner_configurations/configuration_schema.py b/src/gitpod/resources/users/users.py similarity index 53% rename from src/gitpod/resources/runner_configurations/configuration_schema.py rename to src/gitpod/resources/users/users.py index 102168b8..e016457c 100644 --- a/src/gitpod/resources/runner_configurations/configuration_schema.py +++ b/src/gitpod/resources/users/users.py @@ -6,6 +6,15 @@ import httpx +from .pats import ( + PatsResource, + AsyncPatsResource, + PatsResourceWithRawResponse, + AsyncPatsResourceWithRawResponse, + PatsResourceWithStreamingResponse, + AsyncPatsResourceWithStreamingResponse, +) +from ...types import user_set_suspended_params, user_get_authenticated_user_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, @@ -22,38 +31,44 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.runner_configurations import configuration_schema_create_params, configuration_schema_retrieve_params -from ...types.runner_configurations.configuration_schema_create_response import ConfigurationSchemaCreateResponse -from ...types.runner_configurations.configuration_schema_retrieve_response import ConfigurationSchemaRetrieveResponse +from ...types.user_get_authenticated_user_response import UserGetAuthenticatedUserResponse + +__all__ = ["UsersResource", "AsyncUsersResource"] -__all__ = ["ConfigurationSchemaResource", "AsyncConfigurationSchemaResource"] +class UsersResource(SyncAPIResource): + @cached_property + def pats(self) -> PatsResource: + return PatsResource(self._client) -class ConfigurationSchemaResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> ConfigurationSchemaResourceWithRawResponse: + def with_raw_response(self) -> UsersResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return ConfigurationSchemaResourceWithRawResponse(self) + return UsersResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> ConfigurationSchemaResourceWithStreamingResponse: + def with_streaming_response(self) -> UsersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return ConfigurationSchemaResourceWithStreamingResponse(self) + return UsersResourceWithStreamingResponse(self) - def create( + def get_authenticated_user( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -61,13 +76,22 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationSchemaCreateResponse: + ) -> UserGetAuthenticatedUserResponse: """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + GetAuthenticatedUser allows to retrieve the current user. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -87,22 +111,33 @@ def create( ), **(extra_headers or {}), } - return self._post( - "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", - body=maybe_transform( - {"runner_id": runner_id}, configuration_schema_create_params.ConfigurationSchemaCreateParams - ), + return self._get( + "/gitpod.v1.UserService/GetAuthenticatedUser", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + user_get_authenticated_user_params.UserGetAuthenticatedUserParams, + ), ), - cast_to=ConfigurationSchemaCreateResponse, + cast_to=UserGetAuthenticatedUserResponse, ) - def retrieve( + def set_suspended( self, *, connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, + suspended: bool | NotGiven = NOT_GIVEN, + user_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -110,9 +145,9 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationSchemaRetrieveResponse: + ) -> object: """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + SetSuspended sets the suspended state of the user. Args: connect_protocol_version: Define the version of the Connect protocol @@ -137,42 +172,54 @@ def retrieve( **(extra_headers or {}), } return self._post( - "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + "/gitpod.v1.UserService/SetSuspended", body=maybe_transform( - {"runner_id": runner_id}, configuration_schema_retrieve_params.ConfigurationSchemaRetrieveParams + { + "suspended": suspended, + "user_id": user_id, + }, + user_set_suspended_params.UserSetSuspendedParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ConfigurationSchemaRetrieveResponse, + cast_to=object, ) -class AsyncConfigurationSchemaResource(AsyncAPIResource): +class AsyncUsersResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncConfigurationSchemaResourceWithRawResponse: + def pats(self) -> AsyncPatsResource: + return AsyncPatsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncUsersResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers """ - return AsyncConfigurationSchemaResourceWithRawResponse(self) + return AsyncUsersResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncConfigurationSchemaResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response """ - return AsyncConfigurationSchemaResourceWithStreamingResponse(self) + return AsyncUsersResourceWithStreamingResponse(self) - async def create( + async def get_authenticated_user( self, *, + encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, + base64: bool | NotGiven = NOT_GIVEN, + compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, + connect: Literal["v1"] | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -180,13 +227,22 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationSchemaCreateResponse: + ) -> UserGetAuthenticatedUserResponse: """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + GetAuthenticatedUser allows to retrieve the current user. Args: + encoding: Define which encoding or 'Message-Codec' to use + connect_protocol_version: Define the version of the Connect protocol + base64: Specifies if the message query param is base64 encoded, which may be required + for binary data + + compression: Which compression algorithm to use for this request + + connect: Define the version of the Connect protocol + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -206,22 +262,33 @@ async def create( ), **(extra_headers or {}), } - return await self._post( - "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", - body=await async_maybe_transform( - {"runner_id": runner_id}, configuration_schema_create_params.ConfigurationSchemaCreateParams - ), + return await self._get( + "/gitpod.v1.UserService/GetAuthenticatedUser", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "encoding": encoding, + "base64": base64, + "compression": compression, + "connect": connect, + "message": message, + }, + user_get_authenticated_user_params.UserGetAuthenticatedUserParams, + ), ), - cast_to=ConfigurationSchemaCreateResponse, + cast_to=UserGetAuthenticatedUserResponse, ) - async def retrieve( + async def set_suspended( self, *, connect_protocol_version: Literal[1], - runner_id: str | NotGiven = NOT_GIVEN, + suspended: bool | NotGiven = NOT_GIVEN, + user_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -229,9 +296,9 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationSchemaRetrieveResponse: + ) -> object: """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + SetSuspended sets the suspended state of the user. Args: connect_protocol_version: Define the version of the Connect protocol @@ -256,60 +323,80 @@ async def retrieve( **(extra_headers or {}), } return await self._post( - "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + "/gitpod.v1.UserService/SetSuspended", body=await async_maybe_transform( - {"runner_id": runner_id}, configuration_schema_retrieve_params.ConfigurationSchemaRetrieveParams + { + "suspended": suspended, + "user_id": user_id, + }, + user_set_suspended_params.UserSetSuspendedParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ConfigurationSchemaRetrieveResponse, + cast_to=object, ) -class ConfigurationSchemaResourceWithRawResponse: - def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: - self._configuration_schema = configuration_schema +class UsersResourceWithRawResponse: + def __init__(self, users: UsersResource) -> None: + self._users = users - self.create = to_raw_response_wrapper( - configuration_schema.create, + self.get_authenticated_user = to_raw_response_wrapper( + users.get_authenticated_user, ) - self.retrieve = to_raw_response_wrapper( - configuration_schema.retrieve, + self.set_suspended = to_raw_response_wrapper( + users.set_suspended, ) + @cached_property + def pats(self) -> PatsResourceWithRawResponse: + return PatsResourceWithRawResponse(self._users.pats) -class AsyncConfigurationSchemaResourceWithRawResponse: - def __init__(self, configuration_schema: AsyncConfigurationSchemaResource) -> None: - self._configuration_schema = configuration_schema - self.create = async_to_raw_response_wrapper( - configuration_schema.create, +class AsyncUsersResourceWithRawResponse: + def __init__(self, users: AsyncUsersResource) -> None: + self._users = users + + self.get_authenticated_user = async_to_raw_response_wrapper( + users.get_authenticated_user, ) - self.retrieve = async_to_raw_response_wrapper( - configuration_schema.retrieve, + self.set_suspended = async_to_raw_response_wrapper( + users.set_suspended, ) + @cached_property + def pats(self) -> AsyncPatsResourceWithRawResponse: + return AsyncPatsResourceWithRawResponse(self._users.pats) + -class ConfigurationSchemaResourceWithStreamingResponse: - def __init__(self, configuration_schema: ConfigurationSchemaResource) -> None: - self._configuration_schema = configuration_schema +class UsersResourceWithStreamingResponse: + def __init__(self, users: UsersResource) -> None: + self._users = users - self.create = to_streamed_response_wrapper( - configuration_schema.create, + self.get_authenticated_user = to_streamed_response_wrapper( + users.get_authenticated_user, ) - self.retrieve = to_streamed_response_wrapper( - configuration_schema.retrieve, + self.set_suspended = to_streamed_response_wrapper( + users.set_suspended, ) + @cached_property + def pats(self) -> PatsResourceWithStreamingResponse: + return PatsResourceWithStreamingResponse(self._users.pats) -class AsyncConfigurationSchemaResourceWithStreamingResponse: - def __init__(self, configuration_schema: AsyncConfigurationSchemaResource) -> None: - self._configuration_schema = configuration_schema - self.create = async_to_streamed_response_wrapper( - configuration_schema.create, +class AsyncUsersResourceWithStreamingResponse: + def __init__(self, users: AsyncUsersResource) -> None: + self._users = users + + self.get_authenticated_user = async_to_streamed_response_wrapper( + users.get_authenticated_user, ) - self.retrieve = async_to_streamed_response_wrapper( - configuration_schema.retrieve, + self.set_suspended = async_to_streamed_response_wrapper( + users.set_suspended, ) + + @cached_property + def pats(self) -> AsyncPatsResourceWithStreamingResponse: + return AsyncPatsResourceWithStreamingResponse(self._users.pats) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 449a944e..9644e1c4 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -2,54 +2,99 @@ from __future__ import annotations +from .event_list_params import EventListParams as EventListParams +from .group_list_params import GroupListParams as GroupListParams +from .editor_list_params import EditorListParams as EditorListParams +from .event_watch_params import EventWatchParams as EventWatchParams from .runner_list_params import RunnerListParams as RunnerListParams +from .secret_list_params import SecretListParams as SecretListParams +from .event_list_response import EventListResponse as EventListResponse +from .group_list_response import GroupListResponse as GroupListResponse +from .project_list_params import ProjectListParams as ProjectListParams +from .editor_list_response import EditorListResponse as EditorListResponse +from .event_watch_response import EventWatchResponse as EventWatchResponse from .runner_create_params import RunnerCreateParams as RunnerCreateParams +from .runner_delete_params import RunnerDeleteParams as RunnerDeleteParams from .runner_list_response import RunnerListResponse as RunnerListResponse +from .runner_update_params import RunnerUpdateParams as RunnerUpdateParams +from .secret_create_params import SecretCreateParams as SecretCreateParams +from .secret_delete_params import SecretDeleteParams as SecretDeleteParams +from .secret_list_response import SecretListResponse as SecretListResponse +from .account_delete_params import AccountDeleteParams as AccountDeleteParams from .project_create_params import ProjectCreateParams as ProjectCreateParams +from .project_delete_params import ProjectDeleteParams as ProjectDeleteParams +from .project_list_response import ProjectListResponse as ProjectListResponse +from .project_update_params import ProjectUpdateParams as ProjectUpdateParams +from .editor_retrieve_params import EditorRetrieveParams as EditorRetrieveParams from .runner_create_response import RunnerCreateResponse as RunnerCreateResponse from .runner_retrieve_params import RunnerRetrieveParams as RunnerRetrieveParams +from .secret_create_response import SecretCreateResponse as SecretCreateResponse +from .account_retrieve_params import AccountRetrieveParams as AccountRetrieveParams from .environment_list_params import EnvironmentListParams as EnvironmentListParams +from .environment_stop_params import EnvironmentStopParams as EnvironmentStopParams from .project_create_response import ProjectCreateResponse as ProjectCreateResponse from .project_retrieve_params import ProjectRetrieveParams as ProjectRetrieveParams +from .project_update_response import ProjectUpdateResponse as ProjectUpdateResponse +from .secret_get_value_params import SecretGetValueParams as SecretGetValueParams +from .editor_retrieve_response import EditorRetrieveResponse as EditorRetrieveResponse from .environment_start_params import EnvironmentStartParams as EnvironmentStartParams -from .runner_get_runner_params import RunnerGetRunnerParams as RunnerGetRunnerParams +from .organization_join_params import OrganizationJoinParams as OrganizationJoinParams +from .organization_list_params import OrganizationListParams as OrganizationListParams from .runner_retrieve_response import RunnerRetrieveResponse as RunnerRetrieveResponse +from .account_retrieve_response import AccountRetrieveResponse as AccountRetrieveResponse +from .editor_resolve_url_params import EditorResolveURLParams as EditorResolveURLParams from .environment_create_params import EnvironmentCreateParams as EnvironmentCreateParams +from .environment_delete_params import EnvironmentDeleteParams as EnvironmentDeleteParams from .environment_list_response import EnvironmentListResponse as EnvironmentListResponse +from .environment_update_params import EnvironmentUpdateParams as EnvironmentUpdateParams from .organization_leave_params import OrganizationLeaveParams as OrganizationLeaveParams from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse -from .runner_get_runner_response import RunnerGetRunnerResponse as RunnerGetRunnerResponse +from .secret_get_value_response import SecretGetValueResponse as SecretGetValueResponse +from .user_set_suspended_params import UserSetSuspendedParams as UserSetSuspendedParams +from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams +from .organization_delete_params import OrganizationDeleteParams as OrganizationDeleteParams +from .organization_join_response import OrganizationJoinResponse as OrganizationJoinResponse +from .organization_list_response import OrganizationListResponse as OrganizationListResponse +from .organization_update_params import OrganizationUpdateParams as OrganizationUpdateParams +from .secret_update_value_params import SecretUpdateValueParams as SecretUpdateValueParams +from .editor_resolve_url_response import EditorResolveURLResponse as EditorResolveURLResponse from .environment_create_response import EnvironmentCreateResponse as EnvironmentCreateResponse from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams -from .runner_delete_runner_params import RunnerDeleteRunnerParams as RunnerDeleteRunnerParams -from .runner_update_runner_params import RunnerUpdateRunnerParams as RunnerUpdateRunnerParams from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams +from .organization_create_response import OrganizationCreateResponse as OrganizationCreateResponse +from .organization_retrieve_params import OrganizationRetrieveParams as OrganizationRetrieveParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams -from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams +from .organization_update_response import OrganizationUpdateResponse as OrganizationUpdateResponse from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse +from .environment_mark_active_params import EnvironmentMarkActiveParams as EnvironmentMarkActiveParams from .identity_exchange_token_params import IdentityExchangeTokenParams as IdentityExchangeTokenParams from .identity_get_id_token_response import IdentityGetIDTokenResponse as IdentityGetIDTokenResponse -from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse +from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams +from .account_get_sso_login_url_params import AccountGetSSOLoginURLParams as AccountGetSSOLoginURLParams from .identity_exchange_token_response import IdentityExchangeTokenResponse as IdentityExchangeTokenResponse from .organization_list_members_params import OrganizationListMembersParams as OrganizationListMembersParams -from .personal_access_token_list_params import PersonalAccessTokenListParams as PersonalAccessTokenListParams from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse +from .account_get_sso_login_url_response import AccountGetSSOLoginURLResponse as AccountGetSSOLoginURLResponse from .organization_list_members_response import OrganizationListMembersResponse as OrganizationListMembersResponse -from .personal_access_token_delete_params import PersonalAccessTokenDeleteParams as PersonalAccessTokenDeleteParams -from .personal_access_token_list_response import PersonalAccessTokenListResponse as PersonalAccessTokenListResponse +from .user_get_authenticated_user_params import UserGetAuthenticatedUserParams as UserGetAuthenticatedUserParams +from .account_list_login_providers_params import AccountListLoginProvidersParams as AccountListLoginProvidersParams from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse -from .runner_configuration_validate_params import RunnerConfigurationValidateParams as RunnerConfigurationValidateParams +from .environment_create_logs_token_params import EnvironmentCreateLogsTokenParams as EnvironmentCreateLogsTokenParams +from .user_get_authenticated_user_response import UserGetAuthenticatedUserResponse as UserGetAuthenticatedUserResponse +from .account_list_login_providers_response import ( + AccountListLoginProvidersResponse as AccountListLoginProvidersResponse, +) from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, ) +from .environment_create_logs_token_response import ( + EnvironmentCreateLogsTokenResponse as EnvironmentCreateLogsTokenResponse, +) from .project_create_from_environment_params import ( ProjectCreateFromEnvironmentParams as ProjectCreateFromEnvironmentParams, ) -from .runner_configuration_validate_response import ( - RunnerConfigurationValidateResponse as RunnerConfigurationValidateResponse, -) from .environment_create_from_project_response import ( EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, ) diff --git a/src/gitpod/types/runner_get_runner_params.py b/src/gitpod/types/account_delete_params.py similarity index 77% rename from src/gitpod/types/runner_get_runner_params.py rename to src/gitpod/types/account_delete_params.py index 3079471c..753b0f36 100644 --- a/src/gitpod/types/runner_get_runner_params.py +++ b/src/gitpod/types/account_delete_params.py @@ -6,14 +6,14 @@ from .._utils import PropertyInfo -__all__ = ["RunnerGetRunnerParams"] +__all__ = ["AccountDeleteParams"] -class RunnerGetRunnerParams(TypedDict, total=False): +class AccountDeleteParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + account_id: Annotated[str, PropertyInfo(alias="accountId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/account_get_sso_login_url_params.py b/src/gitpod/types/account_get_sso_login_url_params.py new file mode 100644 index 00000000..0c39c77c --- /dev/null +++ b/src/gitpod/types/account_get_sso_login_url_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AccountGetSSOLoginURLParams"] + + +class AccountGetSSOLoginURLParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/account_get_sso_login_url_response.py b/src/gitpod/types/account_get_sso_login_url_response.py new file mode 100644 index 00000000..e0cb6133 --- /dev/null +++ b/src/gitpod/types/account_get_sso_login_url_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AccountGetSSOLoginURLResponse"] + + +class AccountGetSSOLoginURLResponse(BaseModel): + login_url: Optional[str] = FieldInfo(alias="loginUrl", default=None) + """login_url is the URL to redirect the user to for SSO login""" diff --git a/src/gitpod/types/account_list_login_providers_params.py b/src/gitpod/types/account_list_login_providers_params.py new file mode 100644 index 00000000..6d2dc4dd --- /dev/null +++ b/src/gitpod/types/account_list_login_providers_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AccountListLoginProvidersParams"] + + +class AccountListLoginProvidersParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/account_list_login_providers_response.py b/src/gitpod/types/account_list_login_providers_response.py new file mode 100644 index 00000000..987cfecd --- /dev/null +++ b/src/gitpod/types/account_list_login_providers_response.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AccountListLoginProvidersResponse", "LoginProvider", "Pagination"] + + +class LoginProvider(BaseModel): + login_url: Optional[str] = FieldInfo(alias="loginUrl", default=None) + """login_url is the URL to redirect the browser agent to for login""" + + provider: Optional[str] = None + """provider is the provider used by this login method, e.g. + + "github", "google", "custom" + """ + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class AccountListLoginProvidersResponse(BaseModel): + login_providers: Optional[List[LoginProvider]] = FieldInfo(alias="loginProviders", default=None) + + pagination: Optional[Pagination] = None diff --git a/src/gitpod/types/account_retrieve_params.py b/src/gitpod/types/account_retrieve_params.py new file mode 100644 index 00000000..9330e5a0 --- /dev/null +++ b/src/gitpod/types/account_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AccountRetrieveParams"] + + +class AccountRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/account_retrieve_response.py b/src/gitpod/types/account_retrieve_response.py new file mode 100644 index 00000000..d0dffe2e --- /dev/null +++ b/src/gitpod/types/account_retrieve_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AccountRetrieveResponse", "Account"] + + +class Account(BaseModel): + organization_id: str = FieldInfo(alias="organizationId") + """ + organization_id is the ID of the organization the account is owned by if it's + created through custom SSO + """ + + +class AccountRetrieveResponse(BaseModel): + account: Optional[Account] = None diff --git a/src/gitpod/types/editor_list_params.py b/src/gitpod/types/editor_list_params.py new file mode 100644 index 00000000..b241f1b3 --- /dev/null +++ b/src/gitpod/types/editor_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EditorListParams"] + + +class EditorListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/editor_list_response.py b/src/gitpod/types/editor_list_response.py new file mode 100644 index 00000000..a4355f0b --- /dev/null +++ b/src/gitpod/types/editor_list_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EditorListResponse", "Editor", "Pagination"] + + +class Editor(BaseModel): + id: Optional[str] = None + + icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) + + installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) + + name: Optional[str] = None + + short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) + + url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) + + +class Pagination(BaseModel): + token: Optional[str] = None + """Token for the next set of results that was returned as next_token of a + + PaginationResponse + """ + + page_size: Optional[int] = FieldInfo(alias="pageSize", default=None) + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ + + +class EditorListResponse(BaseModel): + editors: Optional[List[Editor]] = None + """editors contains the list of editors""" + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/editor_resolve_url_params.py b/src/gitpod/types/editor_resolve_url_params.py new file mode 100644 index 00000000..9338071a --- /dev/null +++ b/src/gitpod/types/editor_resolve_url_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EditorResolveURLParams"] + + +class EditorResolveURLParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + editor_id: Annotated[str, PropertyInfo(alias="editorId")] + """editorId is the ID of the editor to resolve the URL for""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environmentId is the ID of the environment to resolve the URL for""" + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organizationId is the ID of the organization to resolve the URL for""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/editor_resolve_url_response.py b/src/gitpod/types/editor_resolve_url_response.py new file mode 100644 index 00000000..b0ee8eb0 --- /dev/null +++ b/src/gitpod/types/editor_resolve_url_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["EditorResolveURLResponse"] + + +class EditorResolveURLResponse(BaseModel): + url: Optional[str] = None + """url is the resolved editor URL""" diff --git a/src/gitpod/types/editor_retrieve_params.py b/src/gitpod/types/editor_retrieve_params.py new file mode 100644 index 00000000..68bde29c --- /dev/null +++ b/src/gitpod/types/editor_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EditorRetrieveParams"] + + +class EditorRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/editor_retrieve_response.py b/src/gitpod/types/editor_retrieve_response.py new file mode 100644 index 00000000..774b3d09 --- /dev/null +++ b/src/gitpod/types/editor_retrieve_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EditorRetrieveResponse", "Editor"] + + +class Editor(BaseModel): + id: Optional[str] = None + + icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) + + installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) + + name: Optional[str] = None + + short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) + + url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) + + +class EditorRetrieveResponse(BaseModel): + editor: Optional[Editor] = None + """editor contains the editor""" diff --git a/src/gitpod/types/environment_class_list_params.py b/src/gitpod/types/environment_class_list_params.py deleted file mode 100644 index 82acdd22..00000000 --- a/src/gitpod/types/environment_class_list_params.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["EnvironmentClassListParams", "Filter", "Pagination"] - - -class EnvironmentClassListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - - pagination: Pagination - """pagination contains the pagination options for listing environment classes""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - enabled: Required[bool] - """enabled filters the response to only enabled or disabled environment classes. - - If not set, all environment classes are returned. - """ - - -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a - - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index 3886c64d..4413cb62 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -22,9 +22,9 @@ "SpecMachine", "SpecPort", "SpecSecret", - "SpecSecretEnvironmentVariable", - "SpecSecretFilePath", - "SpecSecretGitCredentialHost", + "SpecSecretUnionMember0", + "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "SpecSecretUnionMember2", "SpecSSHPublicKey", "SpecTimeout", ] @@ -162,7 +162,7 @@ class SpecPort(TypedDict, total=False): """port number""" -class SpecSecretEnvironmentVariable(TypedDict, total=False): +class SpecSecretUnionMember0(TypedDict, total=False): environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] name: str @@ -181,7 +181,7 @@ class SpecSecretEnvironmentVariable(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class SpecSecretFilePath(TypedDict, total=False): +class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(TypedDict, total=False): file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] """file_path is the path inside the devcontainer where the secret is mounted""" @@ -201,7 +201,7 @@ class SpecSecretFilePath(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class SpecSecretGitCredentialHost(TypedDict, total=False): +class SpecSecretUnionMember2(TypedDict, total=False): git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] name: str @@ -220,7 +220,11 @@ class SpecSecretGitCredentialHost(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -SpecSecret: TypeAlias = Union[SpecSecretEnvironmentVariable, SpecSecretFilePath, SpecSecretGitCredentialHost] +SpecSecret: TypeAlias = Union[ + SpecSecretUnionMember0, + SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + SpecSecretUnionMember2, +] class SpecSSHPublicKey(TypedDict, total=False): diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index d047640b..fac2dc9e 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -26,9 +26,9 @@ "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", - "EnvironmentSpecSecretEnvironmentVariable", - "EnvironmentSpecSecretFilePath", - "EnvironmentSpecSecretGitCredentialHost", + "EnvironmentSpecSecretUnionMember0", + "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "EnvironmentSpecSecretUnionMember2", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -395,7 +395,7 @@ class EnvironmentSpecPort(BaseModel): """port number""" -class EnvironmentSpecSecretEnvironmentVariable(BaseModel): +class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") name: Optional[str] = None @@ -414,7 +414,7 @@ class EnvironmentSpecSecretEnvironmentVariable(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretFilePath(BaseModel): +class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" @@ -434,7 +434,7 @@ class EnvironmentSpecSecretFilePath(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretGitCredentialHost(BaseModel): +class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") name: Optional[str] = None @@ -454,7 +454,9 @@ class EnvironmentSpecSecretGitCredentialHost(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ - EnvironmentSpecSecretEnvironmentVariable, EnvironmentSpecSecretFilePath, EnvironmentSpecSecretGitCredentialHost + EnvironmentSpecSecretUnionMember0, + EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + EnvironmentSpecSecretUnionMember2, ] diff --git a/src/gitpod/types/environment_create_logs_token_params.py b/src/gitpod/types/environment_create_logs_token_params.py new file mode 100644 index 00000000..9933a9b4 --- /dev/null +++ b/src/gitpod/types/environment_create_logs_token_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentCreateLogsTokenParams"] + + +class EnvironmentCreateLogsTokenParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """ + environment_id specifies the environment for which the logs token should be + created. + + +required + """ + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_create_logs_token_response.py b/src/gitpod/types/environment_create_logs_token_response.py new file mode 100644 index 00000000..fb1aca3b --- /dev/null +++ b/src/gitpod/types/environment_create_logs_token_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EnvironmentCreateLogsTokenResponse"] + + +class EnvironmentCreateLogsTokenResponse(BaseModel): + access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) + """ + access_token is the token that can be used to access the logs of the environment + """ diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index e45f4aa9..7b8da702 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -22,9 +22,9 @@ "SpecMachine", "SpecPort", "SpecSecret", - "SpecSecretEnvironmentVariable", - "SpecSecretFilePath", - "SpecSecretGitCredentialHost", + "SpecSecretUnionMember0", + "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "SpecSecretUnionMember2", "SpecSSHPublicKey", "SpecTimeout", ] @@ -160,7 +160,7 @@ class SpecPort(TypedDict, total=False): """port number""" -class SpecSecretEnvironmentVariable(TypedDict, total=False): +class SpecSecretUnionMember0(TypedDict, total=False): environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] name: str @@ -179,7 +179,7 @@ class SpecSecretEnvironmentVariable(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class SpecSecretFilePath(TypedDict, total=False): +class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(TypedDict, total=False): file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] """file_path is the path inside the devcontainer where the secret is mounted""" @@ -199,7 +199,7 @@ class SpecSecretFilePath(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class SpecSecretGitCredentialHost(TypedDict, total=False): +class SpecSecretUnionMember2(TypedDict, total=False): git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] name: str @@ -218,7 +218,11 @@ class SpecSecretGitCredentialHost(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -SpecSecret: TypeAlias = Union[SpecSecretEnvironmentVariable, SpecSecretFilePath, SpecSecretGitCredentialHost] +SpecSecret: TypeAlias = Union[ + SpecSecretUnionMember0, + SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + SpecSecretUnionMember2, +] class SpecSSHPublicKey(TypedDict, total=False): diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index d33eedeb..0573ca9e 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -26,9 +26,9 @@ "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", - "EnvironmentSpecSecretEnvironmentVariable", - "EnvironmentSpecSecretFilePath", - "EnvironmentSpecSecretGitCredentialHost", + "EnvironmentSpecSecretUnionMember0", + "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "EnvironmentSpecSecretUnionMember2", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -395,7 +395,7 @@ class EnvironmentSpecPort(BaseModel): """port number""" -class EnvironmentSpecSecretEnvironmentVariable(BaseModel): +class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") name: Optional[str] = None @@ -414,7 +414,7 @@ class EnvironmentSpecSecretEnvironmentVariable(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretFilePath(BaseModel): +class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" @@ -434,7 +434,7 @@ class EnvironmentSpecSecretFilePath(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretGitCredentialHost(BaseModel): +class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") name: Optional[str] = None @@ -454,7 +454,9 @@ class EnvironmentSpecSecretGitCredentialHost(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ - EnvironmentSpecSecretEnvironmentVariable, EnvironmentSpecSecretFilePath, EnvironmentSpecSecretGitCredentialHost + EnvironmentSpecSecretUnionMember0, + EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + EnvironmentSpecSecretUnionMember2, ] diff --git a/src/gitpod/types/environment_delete_params.py b/src/gitpod/types/environment_delete_params.py new file mode 100644 index 00000000..bc66b2bb --- /dev/null +++ b/src/gitpod/types/environment_delete_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentDeleteParams"] + + +class EnvironmentDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environment_id specifies the environment that is going to delete. + + +required + """ + + force: bool + """ + force indicates whether the environment should be deleted forcefully When force + deleting an Environment, the Environment is removed immediately and environment + lifecycle is not respected. Force deleting can result in data loss on the + environment. + """ + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index 69fc3b4d..a9449f03 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -2,92 +2,33 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["EnvironmentListParams", "Filter", "Pagination"] +__all__ = ["EnvironmentListParams"] class EnvironmentListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: Filter - - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the ID of the organization that contains the environments""" - - pagination: Pagination - """pagination contains the pagination options for listing environments""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] - """ - creator_ids filters the response to only Environments created by specified - members - """ - - project_ids: Annotated[List[str], PropertyInfo(alias="projectIds")] - """ - project_ids filters the response to only Environments associated with the - specified projects - """ - - runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] - """ - runner_ids filters the response to only Environments running on these Runner IDs - """ - - runner_kinds: Annotated[ - List[ - Literal[ - "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" - ] - ], - PropertyInfo(alias="runnerKinds"), - ] - """ - runner_kinds filters the response to only Environments running on these Runner - Kinds - """ - - status_phases: Annotated[ - List[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ], - PropertyInfo(alias="statusPhases"), - ] + base64: bool """ - actual_phases is a list of phases the environment must be in for it to be - returned in the API call + Specifies if the message query param is base64 encoded, which may be required + for binary data """ + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a - - PaginationResponse - """ + connect: Literal["v1"] + """Define the version of the Connect protocol""" - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. + message: str - Maximum 100. - """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py index f3e5bc14..16e8fa8a 100644 --- a/src/gitpod/types/environment_list_response.py +++ b/src/gitpod/types/environment_list_response.py @@ -26,9 +26,9 @@ "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", - "EnvironmentSpecSecretEnvironmentVariable", - "EnvironmentSpecSecretFilePath", - "EnvironmentSpecSecretGitCredentialHost", + "EnvironmentSpecSecretUnionMember0", + "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "EnvironmentSpecSecretUnionMember2", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -396,7 +396,7 @@ class EnvironmentSpecPort(BaseModel): """port number""" -class EnvironmentSpecSecretEnvironmentVariable(BaseModel): +class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") name: Optional[str] = None @@ -415,7 +415,7 @@ class EnvironmentSpecSecretEnvironmentVariable(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretFilePath(BaseModel): +class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" @@ -435,7 +435,7 @@ class EnvironmentSpecSecretFilePath(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretGitCredentialHost(BaseModel): +class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") name: Optional[str] = None @@ -455,7 +455,9 @@ class EnvironmentSpecSecretGitCredentialHost(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ - EnvironmentSpecSecretEnvironmentVariable, EnvironmentSpecSecretFilePath, EnvironmentSpecSecretGitCredentialHost + EnvironmentSpecSecretUnionMember0, + EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + EnvironmentSpecSecretUnionMember2, ] diff --git a/src/gitpod/types/environment_mark_active_params.py b/src/gitpod/types/environment_mark_active_params.py new file mode 100644 index 00000000..bbab16b5 --- /dev/null +++ b/src/gitpod/types/environment_mark_active_params.py @@ -0,0 +1,126 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentMarkActiveParams", "ActivitySignal"] + + +class EnvironmentMarkActiveParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + activity_signal: Annotated[ActivitySignal, PropertyInfo(alias="activitySignal")] + """EnvironmentActivitySignal used to signal activity for an environment.""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """The ID of the environment to update activity for.""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class ActivitySignal(TypedDict, total=False): + source: str + """source of the activity signal, such as "VS Code", "SSH", or "Automations". + + It should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ diff --git a/src/gitpod/types/environment_retrieve_params.py b/src/gitpod/types/environment_retrieve_params.py index a06329ae..8079b8a5 100644 --- a/src/gitpod/types/environment_retrieve_params.py +++ b/src/gitpod/types/environment_retrieve_params.py @@ -10,11 +10,25 @@ class EnvironmentRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - """environment_id specifies the environment to get""" + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index 8ec16fbc..f4b32ccb 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -26,9 +26,9 @@ "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", - "EnvironmentSpecSecretEnvironmentVariable", - "EnvironmentSpecSecretFilePath", - "EnvironmentSpecSecretGitCredentialHost", + "EnvironmentSpecSecretUnionMember0", + "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "EnvironmentSpecSecretUnionMember2", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -395,7 +395,7 @@ class EnvironmentSpecPort(BaseModel): """port number""" -class EnvironmentSpecSecretEnvironmentVariable(BaseModel): +class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") name: Optional[str] = None @@ -414,7 +414,7 @@ class EnvironmentSpecSecretEnvironmentVariable(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretFilePath(BaseModel): +class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" @@ -434,7 +434,7 @@ class EnvironmentSpecSecretFilePath(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretGitCredentialHost(BaseModel): +class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") name: Optional[str] = None @@ -454,7 +454,9 @@ class EnvironmentSpecSecretGitCredentialHost(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ - EnvironmentSpecSecretEnvironmentVariable, EnvironmentSpecSecretFilePath, EnvironmentSpecSecretGitCredentialHost + EnvironmentSpecSecretUnionMember0, + EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + EnvironmentSpecSecretUnionMember2, ] diff --git a/src/gitpod/types/environment_stop_params.py b/src/gitpod/types/environment_stop_params.py new file mode 100644 index 00000000..5f2b96a9 --- /dev/null +++ b/src/gitpod/types/environment_stop_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentStopParams"] + + +class EnvironmentStopParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environment_id specifies which environment should be stopped. + + +required + """ + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py new file mode 100644 index 00000000..be559eb5 --- /dev/null +++ b/src/gitpod/types/environment_update_params.py @@ -0,0 +1,301 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "EnvironmentUpdateParams", + "Variant0", + "Variant1", + "Variant1Spec", + "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment", + "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile", + "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot", + "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession", + "Variant1SpecContent", + "Variant1SpecContentContent", + "Variant1SpecContentContentTheGitEmailAddress", + "Variant1SpecContentContentTheGitUsername", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit", + "Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization", + "Variant1SpecDevcontainer", + "Variant1SpecDevcontainerDevcontainer", + "Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", + "Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild", + "Variant1SpecTimeoutConfiguresTheEnvironmentTimeout", + "Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout", +] + + +class Variant0(TypedDict, total=False): + metadata: Required[object] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1(TypedDict, total=False): + spec: Required[Variant1Spec] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot( + TypedDict, total=False +): + automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] + """ + automations_file_path is the path to the automations file that is applied in the + environment, + + relative to the repo root. path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + +class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession(TypedDict, total=False): + session: Required[str] + + +Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile: TypeAlias = Union[ + Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot, + Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession, +] + + +class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment(TypedDict, total=False): + automations_file: Required[ + Annotated[ + Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile, + PropertyInfo(alias="automationsFile"), + ] + ] + """automations_file is the automations file spec of the environment""" + + +class Variant1SpecContentContentTheGitEmailAddress(TypedDict, total=False): + git_email: Required[Annotated[str, PropertyInfo(alias="gitEmail")]] + """The Git email address""" + + +class Variant1SpecContentContentTheGitUsername(TypedDict, total=False): + git_username: Required[Annotated[str, PropertyInfo(alias="gitUsername")]] + """The Git username""" + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL( + TypedDict, total=False +): + url: str + """url is the URL from which the environment is created""" + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL( + TypedDict, total=False +): + context_url: Required[ + Annotated[ + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL, + PropertyInfo(alias="contextUrl"), + ] + ] + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit( + TypedDict, total=False +): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit( + TypedDict, total=False +): + git: Required[ + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit + ] + + +Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec: TypeAlias = Union[ + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL, + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit, +] + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer( + TypedDict, total=False +): + specs: Iterable[Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec] + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized(TypedDict, total=False): + initializer: Required[Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer] + """EnvironmentInitializer specifies how an environment is to be initialized""" + + +class Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization(TypedDict, total=False): + session: Required[str] + """session should be changed to trigger a content reinitialization""" + + +Variant1SpecContentContent: TypeAlias = Union[ + Variant1SpecContentContentTheGitEmailAddress, + Variant1SpecContentContentTheGitUsername, + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized, + Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization, +] + + +class Variant1SpecContent(TypedDict, total=False): + content: Required[Variant1SpecContentContent] + + +class Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot( + TypedDict, total=False +): + devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + +class Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild(TypedDict, total=False): + session: Required[str] + """session should be changed to trigger a devcontainer rebuild""" + + +Variant1SpecDevcontainerDevcontainer: TypeAlias = Union[ + Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, + Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild, +] + + +class Variant1SpecDevcontainer(TypedDict, total=False): + devcontainer: Required[Variant1SpecDevcontainerDevcontainer] + + +class Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout(TypedDict, total=False): + disconnected: Required[str] + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class Variant1SpecTimeoutConfiguresTheEnvironmentTimeout(TypedDict, total=False): + timeout: Required[Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout] + """Timeout configures the environment timeout""" + + +Variant1Spec: TypeAlias = Union[ + Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment, + Variant1SpecContent, + Variant1SpecDevcontainer, + Variant1SpecTimeoutConfiguresTheEnvironmentTimeout, +] + +EnvironmentUpdateParams: TypeAlias = Union[Variant0, Variant1] diff --git a/src/gitpod/types/environments/__init__.py b/src/gitpod/types/environments/__init__.py index ec2c91ca..240da5ec 100644 --- a/src/gitpod/types/environments/__init__.py +++ b/src/gitpod/types/environments/__init__.py @@ -2,5 +2,7 @@ from __future__ import annotations +from .class_list_params import ClassListParams as ClassListParams +from .class_list_response import ClassListResponse as ClassListResponse from .automation_upsert_params import AutomationUpsertParams as AutomationUpsertParams from .automation_upsert_response import AutomationUpsertResponse as AutomationUpsertResponse diff --git a/src/gitpod/types/environments/automations/__init__.py b/src/gitpod/types/environments/automations/__init__.py index b6f6483d..58ee02d6 100644 --- a/src/gitpod/types/environments/automations/__init__.py +++ b/src/gitpod/types/environments/automations/__init__.py @@ -14,15 +14,11 @@ from .service_start_params import ServiceStartParams as ServiceStartParams from .task_create_response import TaskCreateResponse as TaskCreateResponse from .task_retrieve_params import TaskRetrieveParams as TaskRetrieveParams +from .service_create_params import ServiceCreateParams as ServiceCreateParams from .service_delete_params import ServiceDeleteParams as ServiceDeleteParams from .service_list_response import ServiceListResponse as ServiceListResponse from .service_update_params import ServiceUpdateParams as ServiceUpdateParams from .task_retrieve_response import TaskRetrieveResponse as TaskRetrieveResponse -from .task_execution_list_params import TaskExecutionListParams as TaskExecutionListParams -from .task_execution_stop_params import TaskExecutionStopParams as TaskExecutionStopParams -from .task_execution_list_response import TaskExecutionListResponse as TaskExecutionListResponse -from .task_execution_retrieve_params import TaskExecutionRetrieveParams as TaskExecutionRetrieveParams -from .task_execution_retrieve_response import TaskExecutionRetrieveResponse as TaskExecutionRetrieveResponse -from .task_execution_update_task_execution_status_params import ( - TaskExecutionUpdateTaskExecutionStatusParams as TaskExecutionUpdateTaskExecutionStatusParams, -) +from .service_create_response import ServiceCreateResponse as ServiceCreateResponse +from .service_retrieve_params import ServiceRetrieveParams as ServiceRetrieveParams +from .service_retrieve_response import ServiceRetrieveResponse as ServiceRetrieveResponse diff --git a/src/gitpod/types/environments/automations/service_create_params.py b/src/gitpod/types/environments/automations/service_create_params.py new file mode 100644 index 00000000..386d562b --- /dev/null +++ b/src/gitpod/types/environments/automations/service_create_params.py @@ -0,0 +1,280 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Iterable +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ...._utils import PropertyInfo + +__all__ = [ + "ServiceCreateParams", + "Metadata", + "MetadataCreator", + "MetadataTriggeredBy", + "MetadataTriggeredByManual", + "MetadataTriggeredByPostDevcontainerStart", + "MetadataTriggeredByPostEnvironmentStart", + "Spec", + "SpecCommands", + "SpecRunsOn", + "SpecRunsOnDocker", +] + + +class ServiceCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + + metadata: Metadata + + spec: Spec + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class MetadataCreator(TypedDict, total=False): + id: str + """id is the UUID of the subject""" + + principal: Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + """Principal is the principal of the subject""" + + +class MetadataTriggeredByManual(TypedDict, total=False): + manual: Required[bool] + + +class MetadataTriggeredByPostDevcontainerStart(TypedDict, total=False): + post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] + + +class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): + post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] + + +MetadataTriggeredBy: TypeAlias = Union[ + MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart +] + + +class Metadata(TypedDict, total=False): + created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: MetadataCreator + """creator describes the principal who created the service.""" + + description: str + """description is a user-facing description for the service. + + It can be used to provide context and documentation for the service. + """ + + name: str + """name is a user-facing name for the service. + + Unlike the reference, this field is not unique, and not referenced by the + system. + + This is a short descriptive name for the service. + """ + + reference: str + """ + reference is a user-facing identifier for the service which must be unique on + the environment. + + It is used to express dependencies between services, and to identify the service + in user interactions (e.g. the CLI). + """ + + triggered_by: Annotated[Iterable[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] + """triggered_by is a list of trigger that start the service.""" + + +class SpecCommands(TypedDict, total=False): + ready: str + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. + + If set, the service will first go into a Starting phase, and then into a Running + phase once the ready command exits with a zero exit code. + """ + + start: str + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: str + """stop is an optional command that runs when the service is requested to stop. + + If set, instead of sending a SIGTERM signal to the start command, the stop + command will be run. Once the stop command exits, the start command will receive + a SIGKILL signal. If the stop command exits with a non-zero exit code, the + service will transition to the Failed phase. If the stop command does not exit + within 2 minutes, a SIGKILL signal will be sent to both the start and stop + commands. + """ + + +class SpecRunsOnDocker(TypedDict, total=False): + environment: List[str] + + image: str + + +class SpecRunsOn(TypedDict, total=False): + docker: Required[SpecRunsOnDocker] + + +class Spec(TypedDict, total=False): + commands: SpecCommands + """ + commands contains the commands to start, stop and check the readiness of the + service + """ + + desired_phase: Annotated[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ], + PropertyInfo(alias="desiredPhase"), + ] + """desired_phase is the phase the service should be in. + + Used to start or stop the service. + """ + + runs_on: Annotated[SpecRunsOn, PropertyInfo(alias="runsOn")] + """runs_on specifies the environment the service should run on.""" + + session: str + """session should be changed to trigger a restart of the service. + + If a service exits it will + + not be restarted until the session is changed. + """ + + spec_version: Annotated[str, PropertyInfo(alias="specVersion")] + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ diff --git a/src/gitpod/types/environments/automations/service_create_response.py b/src/gitpod/types/environments/automations/service_create_response.py new file mode 100644 index 00000000..2ae3f289 --- /dev/null +++ b/src/gitpod/types/environments/automations/service_create_response.py @@ -0,0 +1,325 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "ServiceCreateResponse", + "Service", + "ServiceMetadata", + "ServiceMetadataCreator", + "ServiceMetadataTriggeredBy", + "ServiceMetadataTriggeredByManual", + "ServiceMetadataTriggeredByPostDevcontainerStart", + "ServiceMetadataTriggeredByPostEnvironmentStart", + "ServiceSpec", + "ServiceSpecCommands", + "ServiceSpecRunsOn", + "ServiceSpecRunsOnDocker", + "ServiceStatus", +] + + +class ServiceMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ServiceMetadataTriggeredByManual(BaseModel): + manual: bool + + +class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + + +class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): + post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + + +ServiceMetadataTriggeredBy: TypeAlias = Union[ + ServiceMetadataTriggeredByManual, + ServiceMetadataTriggeredByPostDevcontainerStart, + ServiceMetadataTriggeredByPostEnvironmentStart, +] + + +class ServiceMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ServiceMetadataCreator] = None + """creator describes the principal who created the service.""" + + description: Optional[str] = None + """description is a user-facing description for the service. + + It can be used to provide context and documentation for the service. + """ + + name: Optional[str] = None + """name is a user-facing name for the service. + + Unlike the reference, this field is not unique, and not referenced by the + system. + + This is a short descriptive name for the service. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the service which must be unique on + the environment. + + It is used to express dependencies between services, and to identify the service + in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the service.""" + + +class ServiceSpecCommands(BaseModel): + ready: Optional[str] = None + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. + + If set, the service will first go into a Starting phase, and then into a Running + phase once the ready command exits with a zero exit code. + """ + + start: Optional[str] = None + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: Optional[str] = None + """stop is an optional command that runs when the service is requested to stop. + + If set, instead of sending a SIGTERM signal to the start command, the stop + command will be run. Once the stop command exits, the start command will receive + a SIGKILL signal. If the stop command exits with a non-zero exit code, the + service will transition to the Failed phase. If the stop command does not exit + within 2 minutes, a SIGKILL signal will be sent to both the start and stop + commands. + """ + + +class ServiceSpecRunsOnDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class ServiceSpecRunsOn(BaseModel): + docker: ServiceSpecRunsOnDocker + + +class ServiceSpec(BaseModel): + commands: Optional[ServiceSpecCommands] = None + """ + commands contains the commands to start, stop and check the readiness of the + service + """ + + desired_phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the service should be in. + + Used to start or stop the service. + """ + + runs_on: Optional[ServiceSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the service should run on.""" + + session: Optional[str] = None + """session should be changed to trigger a restart of the service. + + If a service exits it will + + not be restarted until the session is changed. + """ + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + +class ServiceStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the service failed to operate. + + If this is non-empty + + the service has failed to operate and will likely transition to a failed state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url contains the URL at which the service logs can be accessed.""" + + phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = None + """phase is the current phase of the service.""" + + session: Optional[str] = None + """session is the current session of the service.""" + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Service instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. + """ + + +class Service(BaseModel): + id: Optional[str] = None + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[ServiceMetadata] = None + + spec: Optional[ServiceSpec] = None + + status: Optional[ServiceStatus] = None + + +class ServiceCreateResponse(BaseModel): + service: Optional[Service] = None diff --git a/src/gitpod/types/environments/automations/service_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py index 2866c3f6..f368c316 100644 --- a/src/gitpod/types/environments/automations/service_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -2,48 +2,33 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["ServiceListParams", "Filter", "Pagination"] +__all__ = ["ServiceListParams"] class ServiceListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: Filter - """filter contains the filter options for listing services""" - - pagination: Pagination - """pagination contains the pagination options for listing services""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] - """environment_ids filters the response to only services of these environments""" - - references: List[str] - """references filters the response to only services with these references""" - - service_ids: Annotated[List[str], PropertyInfo(alias="serviceIds")] - """service_ids filters the response to only services with these IDs""" - + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" - PaginationResponse - """ + connect: Literal["v1"] + """Define the version of the Connect protocol""" - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. + message: str - Maximum 100. - """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_retrieve_params.py b/src/gitpod/types/environments/automations/service_retrieve_params.py new file mode 100644 index 00000000..37b1cc11 --- /dev/null +++ b/src/gitpod/types/environments/automations/service_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["ServiceRetrieveParams"] + + +class ServiceRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_retrieve_response.py b/src/gitpod/types/environments/automations/service_retrieve_response.py new file mode 100644 index 00000000..70832cbd --- /dev/null +++ b/src/gitpod/types/environments/automations/service_retrieve_response.py @@ -0,0 +1,325 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "ServiceRetrieveResponse", + "Service", + "ServiceMetadata", + "ServiceMetadataCreator", + "ServiceMetadataTriggeredBy", + "ServiceMetadataTriggeredByManual", + "ServiceMetadataTriggeredByPostDevcontainerStart", + "ServiceMetadataTriggeredByPostEnvironmentStart", + "ServiceSpec", + "ServiceSpecCommands", + "ServiceSpecRunsOn", + "ServiceSpecRunsOnDocker", + "ServiceStatus", +] + + +class ServiceMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ServiceMetadataTriggeredByManual(BaseModel): + manual: bool + + +class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + + +class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): + post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + + +ServiceMetadataTriggeredBy: TypeAlias = Union[ + ServiceMetadataTriggeredByManual, + ServiceMetadataTriggeredByPostDevcontainerStart, + ServiceMetadataTriggeredByPostEnvironmentStart, +] + + +class ServiceMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ServiceMetadataCreator] = None + """creator describes the principal who created the service.""" + + description: Optional[str] = None + """description is a user-facing description for the service. + + It can be used to provide context and documentation for the service. + """ + + name: Optional[str] = None + """name is a user-facing name for the service. + + Unlike the reference, this field is not unique, and not referenced by the + system. + + This is a short descriptive name for the service. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the service which must be unique on + the environment. + + It is used to express dependencies between services, and to identify the service + in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the service.""" + + +class ServiceSpecCommands(BaseModel): + ready: Optional[str] = None + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. + + If set, the service will first go into a Starting phase, and then into a Running + phase once the ready command exits with a zero exit code. + """ + + start: Optional[str] = None + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: Optional[str] = None + """stop is an optional command that runs when the service is requested to stop. + + If set, instead of sending a SIGTERM signal to the start command, the stop + command will be run. Once the stop command exits, the start command will receive + a SIGKILL signal. If the stop command exits with a non-zero exit code, the + service will transition to the Failed phase. If the stop command does not exit + within 2 minutes, a SIGKILL signal will be sent to both the start and stop + commands. + """ + + +class ServiceSpecRunsOnDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class ServiceSpecRunsOn(BaseModel): + docker: ServiceSpecRunsOnDocker + + +class ServiceSpec(BaseModel): + commands: Optional[ServiceSpecCommands] = None + """ + commands contains the commands to start, stop and check the readiness of the + service + """ + + desired_phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the service should be in. + + Used to start or stop the service. + """ + + runs_on: Optional[ServiceSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the service should run on.""" + + session: Optional[str] = None + """session should be changed to trigger a restart of the service. + + If a service exits it will + + not be restarted until the session is changed. + """ + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + +class ServiceStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the service failed to operate. + + If this is non-empty + + the service has failed to operate and will likely transition to a failed state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url contains the URL at which the service logs can be accessed.""" + + phase: Optional[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] = None + """phase is the current phase of the service.""" + + session: Optional[str] = None + """session is the current session of the service.""" + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Service instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. + """ + + +class Service(BaseModel): + id: Optional[str] = None + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[ServiceMetadata] = None + + spec: Optional[ServiceSpec] = None + + status: Optional[ServiceStatus] = None + + +class ServiceRetrieveResponse(BaseModel): + service: Optional[Service] = None diff --git a/src/gitpod/types/environments/automations/task_execution_list_params.py b/src/gitpod/types/environments/automations/task_execution_list_params.py deleted file mode 100644 index 78c3e7ba..00000000 --- a/src/gitpod/types/environments/automations/task_execution_list_params.py +++ /dev/null @@ -1,61 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo - -__all__ = ["TaskExecutionListParams", "Filter", "Pagination"] - - -class TaskExecutionListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - """filter contains the filter options for listing task runs""" - - pagination: Pagination - """pagination contains the pagination options for listing task runs""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] - """environment_ids filters the response to only task runs of these environments""" - - phases: List[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] - """phases filters the response to only task runs in these phases""" - - task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] - """task_ids filters the response to only task runs of these tasks""" - - task_references: Annotated[List[str], PropertyInfo(alias="taskReferences")] - """task_references filters the response to only task runs with this reference""" - - -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a - - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py b/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py deleted file mode 100644 index 6b28601f..00000000 --- a/src/gitpod/types/environments/automations/task_execution_update_task_execution_status_params.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict - -from ...._utils import PropertyInfo - -__all__ = ["TaskExecutionUpdateTaskExecutionStatusParams", "FailureMessage", "LogURL"] - - -class FailureMessage(TypedDict, total=False): - failure_message: Required[Annotated[str, PropertyInfo(alias="failureMessage")]] - """ - failure_message marks the task execution as failed and provides a message - explaining the failure. - - If an individual step has failed, callers are NOT expected to set this message; - only if the task execution as a whole has failed/cannot be started. - """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class LogURL(TypedDict, total=False): - log_url: Required[Annotated[str, PropertyInfo(alias="logUrl")]] - """log_url is the URL to the logs of the task's steps. - - If this is empty, the task either has no logs or has not yet started. - """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -TaskExecutionUpdateTaskExecutionStatusParams: TypeAlias = Union[FailureMessage, LogURL] diff --git a/src/gitpod/types/environments/automations/task_list_params.py b/src/gitpod/types/environments/automations/task_list_params.py index 763a6dfd..4a4900b8 100644 --- a/src/gitpod/types/environments/automations/task_list_params.py +++ b/src/gitpod/types/environments/automations/task_list_params.py @@ -2,48 +2,33 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["TaskListParams", "Filter", "Pagination"] +__all__ = ["TaskListParams"] class TaskListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: Filter - """filter contains the filter options for listing tasks""" - - pagination: Pagination - """pagination contains the pagination options for listing tasks""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] - """environment_ids filters the response to only tasks of these environments""" - - references: List[str] - """references filters the response to only services with these references""" - - task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] - """task_ids filters the response to only tasks with these IDs""" - + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" - PaginationResponse - """ + connect: Literal["v1"] + """Define the version of the Connect protocol""" - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. + message: str - Maximum 100. - """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_retrieve_params.py b/src/gitpod/types/environments/automations/task_retrieve_params.py index b0d4d35b..ea568b41 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_params.py +++ b/src/gitpod/types/environments/automations/task_retrieve_params.py @@ -10,10 +10,25 @@ class TaskRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - id: str + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py index ff5ebb41..35d969e0 100644 --- a/src/gitpod/types/environments/automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -16,12 +16,12 @@ "TaskExecutionSpec", "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", - "TaskExecutionSpecPlanStepServiceID", - "TaskExecutionSpecPlanStepTask", - "TaskExecutionSpecPlanStepTaskTask", - "TaskExecutionSpecPlanStepTaskTaskSpec", - "TaskExecutionSpecPlanStepTaskTaskSpecRunsOn", - "TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember0", + "TaskExecutionSpecPlanStepUnionMember1", + "TaskExecutionSpecPlanStepUnionMember1Task", + "TaskExecutionSpecPlanStepUnionMember1TaskSpec", + "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", + "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -334,7 +334,7 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStepServiceID(BaseModel): +class TaskExecutionSpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") id: Optional[str] = None @@ -345,32 +345,32 @@ class TaskExecutionSpecPlanStepServiceID(BaseModel): label: Optional[str] = None -class TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepTaskTaskSpecRunsOn(BaseModel): - docker: TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker -class TaskExecutionSpecPlanStepTaskTaskSpec(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Optional[TaskExecutionSpecPlanStepTaskTaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" -class TaskExecutionSpecPlanStepTaskTask(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1Task(BaseModel): id: Optional[str] = None - spec: Optional[TaskExecutionSpecPlanStepTaskTaskSpec] = None + spec: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpec] = None -class TaskExecutionSpecPlanStepTask(BaseModel): - task: TaskExecutionSpecPlanStepTaskTask +class TaskExecutionSpecPlanStepUnionMember1(BaseModel): + task: TaskExecutionSpecPlanStepUnionMember1Task id: Optional[str] = None """ID is the ID of the execution step""" @@ -380,7 +380,9 @@ class TaskExecutionSpecPlanStepTask(BaseModel): label: Optional[str] = None -TaskExecutionSpecPlanStep: TypeAlias = Union[TaskExecutionSpecPlanStepServiceID, TaskExecutionSpecPlanStepTask] +TaskExecutionSpecPlanStep: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 +] class TaskExecutionSpecPlan(BaseModel): diff --git a/src/gitpod/types/environments/automations/tasks/__init__.py b/src/gitpod/types/environments/automations/tasks/__init__.py new file mode 100644 index 00000000..fd373323 --- /dev/null +++ b/src/gitpod/types/environments/automations/tasks/__init__.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .execution_list_params import ExecutionListParams as ExecutionListParams +from .execution_stop_params import ExecutionStopParams as ExecutionStopParams +from .execution_list_response import ExecutionListResponse as ExecutionListResponse +from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .execution_retrieve_response import ExecutionRetrieveResponse as ExecutionRetrieveResponse diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_params.py b/src/gitpod/types/environments/automations/tasks/execution_list_params.py new file mode 100644 index 00000000..824e42ee --- /dev/null +++ b/src/gitpod/types/environments/automations/tasks/execution_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ....._utils import PropertyInfo + +__all__ = ["ExecutionListParams"] + + +class ExecutionListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_list_response.py b/src/gitpod/types/environments/automations/tasks/execution_list_response.py similarity index 93% rename from src/gitpod/types/environments/automations/task_execution_list_response.py rename to src/gitpod/types/environments/automations/tasks/execution_list_response.py index 192e7f72..8a862ecb 100644 --- a/src/gitpod/types/environments/automations/task_execution_list_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_list_response.py @@ -6,10 +6,10 @@ from pydantic import Field as FieldInfo -from ...._models import BaseModel +from ....._models import BaseModel __all__ = [ - "TaskExecutionListResponse", + "ExecutionListResponse", "Pagination", "TaskExecution", "TaskExecutionMetadata", @@ -17,12 +17,12 @@ "TaskExecutionSpec", "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", - "TaskExecutionSpecPlanStepServiceID", - "TaskExecutionSpecPlanStepTask", - "TaskExecutionSpecPlanStepTaskTask", - "TaskExecutionSpecPlanStepTaskTaskSpec", - "TaskExecutionSpecPlanStepTaskTaskSpecRunsOn", - "TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember0", + "TaskExecutionSpecPlanStepUnionMember1", + "TaskExecutionSpecPlanStepUnionMember1Task", + "TaskExecutionSpecPlanStepUnionMember1TaskSpec", + "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", + "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -343,7 +343,7 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStepServiceID(BaseModel): +class TaskExecutionSpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") id: Optional[str] = None @@ -354,32 +354,32 @@ class TaskExecutionSpecPlanStepServiceID(BaseModel): label: Optional[str] = None -class TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepTaskTaskSpecRunsOn(BaseModel): - docker: TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker -class TaskExecutionSpecPlanStepTaskTaskSpec(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Optional[TaskExecutionSpecPlanStepTaskTaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" -class TaskExecutionSpecPlanStepTaskTask(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1Task(BaseModel): id: Optional[str] = None - spec: Optional[TaskExecutionSpecPlanStepTaskTaskSpec] = None + spec: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpec] = None -class TaskExecutionSpecPlanStepTask(BaseModel): - task: TaskExecutionSpecPlanStepTaskTask +class TaskExecutionSpecPlanStepUnionMember1(BaseModel): + task: TaskExecutionSpecPlanStepUnionMember1Task id: Optional[str] = None """ID is the ID of the execution step""" @@ -389,7 +389,9 @@ class TaskExecutionSpecPlanStepTask(BaseModel): label: Optional[str] = None -TaskExecutionSpecPlanStep: TypeAlias = Union[TaskExecutionSpecPlanStepServiceID, TaskExecutionSpecPlanStepTask] +TaskExecutionSpecPlanStep: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 +] class TaskExecutionSpecPlan(BaseModel): @@ -503,7 +505,7 @@ class TaskExecution(BaseModel): status: Optional[TaskExecutionStatus] = None -class TaskExecutionListResponse(BaseModel): +class ExecutionListResponse(BaseModel): pagination: Optional[Pagination] = None task_executions: Optional[List[TaskExecution]] = FieldInfo(alias="taskExecutions", default=None) diff --git a/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py new file mode 100644 index 00000000..f10cdf36 --- /dev/null +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ....._utils import PropertyInfo + +__all__ = ["ExecutionRetrieveParams"] + + +class ExecutionRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_execution_retrieve_response.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py similarity index 93% rename from src/gitpod/types/environments/automations/task_execution_retrieve_response.py rename to src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py index dc0a5dc0..b42c9e35 100644 --- a/src/gitpod/types/environments/automations/task_execution_retrieve_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py @@ -6,22 +6,22 @@ from pydantic import Field as FieldInfo -from ...._models import BaseModel +from ....._models import BaseModel __all__ = [ - "TaskExecutionRetrieveResponse", + "ExecutionRetrieveResponse", "TaskExecution", "TaskExecutionMetadata", "TaskExecutionMetadataCreator", "TaskExecutionSpec", "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", - "TaskExecutionSpecPlanStepServiceID", - "TaskExecutionSpecPlanStepTask", - "TaskExecutionSpecPlanStepTaskTask", - "TaskExecutionSpecPlanStepTaskTaskSpec", - "TaskExecutionSpecPlanStepTaskTaskSpecRunsOn", - "TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember0", + "TaskExecutionSpecPlanStepUnionMember1", + "TaskExecutionSpecPlanStepUnionMember1Task", + "TaskExecutionSpecPlanStepUnionMember1TaskSpec", + "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", + "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -334,7 +334,7 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStepServiceID(BaseModel): +class TaskExecutionSpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") id: Optional[str] = None @@ -345,32 +345,32 @@ class TaskExecutionSpecPlanStepServiceID(BaseModel): label: Optional[str] = None -class TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepTaskTaskSpecRunsOn(BaseModel): - docker: TaskExecutionSpecPlanStepTaskTaskSpecRunsOnDocker +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker -class TaskExecutionSpecPlanStepTaskTaskSpec(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Optional[TaskExecutionSpecPlanStepTaskTaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" -class TaskExecutionSpecPlanStepTaskTask(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1Task(BaseModel): id: Optional[str] = None - spec: Optional[TaskExecutionSpecPlanStepTaskTaskSpec] = None + spec: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpec] = None -class TaskExecutionSpecPlanStepTask(BaseModel): - task: TaskExecutionSpecPlanStepTaskTask +class TaskExecutionSpecPlanStepUnionMember1(BaseModel): + task: TaskExecutionSpecPlanStepUnionMember1Task id: Optional[str] = None """ID is the ID of the execution step""" @@ -380,7 +380,9 @@ class TaskExecutionSpecPlanStepTask(BaseModel): label: Optional[str] = None -TaskExecutionSpecPlanStep: TypeAlias = Union[TaskExecutionSpecPlanStepServiceID, TaskExecutionSpecPlanStepTask] +TaskExecutionSpecPlanStep: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 +] class TaskExecutionSpecPlan(BaseModel): @@ -494,5 +496,5 @@ class TaskExecution(BaseModel): status: Optional[TaskExecutionStatus] = None -class TaskExecutionRetrieveResponse(BaseModel): +class ExecutionRetrieveResponse(BaseModel): task_execution: Optional[TaskExecution] = FieldInfo(alias="taskExecution", default=None) diff --git a/src/gitpod/types/environments/automations/task_execution_retrieve_params.py b/src/gitpod/types/environments/automations/tasks/execution_stop_params.py similarity index 78% rename from src/gitpod/types/environments/automations/task_execution_retrieve_params.py rename to src/gitpod/types/environments/automations/tasks/execution_stop_params.py index b13b311d..496a5e81 100644 --- a/src/gitpod/types/environments/automations/task_execution_retrieve_params.py +++ b/src/gitpod/types/environments/automations/tasks/execution_stop_params.py @@ -4,12 +4,12 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ...._utils import PropertyInfo +from ....._utils import PropertyInfo -__all__ = ["TaskExecutionRetrieveParams"] +__all__ = ["ExecutionStopParams"] -class TaskExecutionRetrieveParams(TypedDict, total=False): +class ExecutionStopParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" diff --git a/src/gitpod/types/environments/class_list_params.py b/src/gitpod/types/environments/class_list_params.py new file mode 100644 index 00000000..e7ee63fa --- /dev/null +++ b/src/gitpod/types/environments/class_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ClassListParams"] + + +class ClassListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/environment_class_list_response.py b/src/gitpod/types/environments/class_list_response.py similarity index 91% rename from src/gitpod/types/runner_configurations/environment_class_list_response.py rename to src/gitpod/types/environments/class_list_response.py index 43a1b685..b097e929 100644 --- a/src/gitpod/types/runner_configurations/environment_class_list_response.py +++ b/src/gitpod/types/environments/class_list_response.py @@ -6,7 +6,7 @@ from ..._models import BaseModel -__all__ = ["EnvironmentClassListResponse", "EnvironmentClass", "EnvironmentClassConfiguration", "Pagination"] +__all__ = ["ClassListResponse", "EnvironmentClass", "EnvironmentClassConfiguration", "Pagination"] class EnvironmentClassConfiguration(BaseModel): @@ -49,7 +49,7 @@ class Pagination(BaseModel): """ -class EnvironmentClassListResponse(BaseModel): +class ClassListResponse(BaseModel): environment_classes: Optional[List[EnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) pagination: Optional[Pagination] = None diff --git a/src/gitpod/types/event_list_params.py b/src/gitpod/types/event_list_params.py new file mode 100644 index 00000000..2a529ee2 --- /dev/null +++ b/src/gitpod/types/event_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EventListParams"] + + +class EventListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/event_list_response.py b/src/gitpod/types/event_list_response.py new file mode 100644 index 00000000..a47dd0af --- /dev/null +++ b/src/gitpod/types/event_list_response.py @@ -0,0 +1,162 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EventListResponse", "Entry", "Pagination"] + + +class Entry(BaseModel): + id: Optional[str] = None + + action: Optional[str] = None + + actor_id: Optional[str] = FieldInfo(alias="actorId", default=None) + + actor_principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = FieldInfo(alias="actorPrincipal", default=None) + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + subject_id: Optional[str] = FieldInfo(alias="subjectId", default=None) + + subject_type: Optional[ + Literal[ + "RESOURCE_TYPE_UNSPECIFIED", + "RESOURCE_TYPE_ENVIRONMENT", + "RESOURCE_TYPE_RUNNER", + "RESOURCE_TYPE_PROJECT", + "RESOURCE_TYPE_TASK", + "RESOURCE_TYPE_TASK_EXECUTION", + "RESOURCE_TYPE_SERVICE", + "RESOURCE_TYPE_ORGANIZATION", + "RESOURCE_TYPE_USER", + "RESOURCE_TYPE_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION", + "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN", + "RESOURCE_TYPE_GROUP", + "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN", + "RESOURCE_TYPE_USER_PREFERENCE", + "RESOURCE_TYPE_SERVICE_ACCOUNT", + "RESOURCE_TYPE_SECRET", + "RESOURCE_TYPE_SSO_CONFIG", + ] + ] = FieldInfo(alias="subjectType", default=None) + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class EventListResponse(BaseModel): + entries: Optional[List[Entry]] = None + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/event_watch_params.py b/src/gitpod/types/event_watch_params.py new file mode 100644 index 00000000..1303a6a3 --- /dev/null +++ b/src/gitpod/types/event_watch_params.py @@ -0,0 +1,55 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "EventWatchParams", + "EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment", + "OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued", +] + + +class EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment( + TypedDict, total=False +): + environment_id: Required[Annotated[str, PropertyInfo(alias="environmentId")]] + """ + Environment scope produces events for the environment itself, all tasks, task + executions, + + and services associated with that environment. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued( + TypedDict, total=False +): + organization: Required[bool] + """Organization scope produces events for all projects, runners and environments + + the caller can see within their organization. No task, task execution or service + events are produed. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +EventWatchParams: TypeAlias = Union[ + EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment, + OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued, +] diff --git a/src/gitpod/types/event_watch_response.py b/src/gitpod/types/event_watch_response.py new file mode 100644 index 00000000..ec289a8d --- /dev/null +++ b/src/gitpod/types/event_watch_response.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EventWatchResponse"] + + +class EventWatchResponse(BaseModel): + operation: Optional[ + Literal[ + "RESOURCE_OPERATION_UNSPECIFIED", + "RESOURCE_OPERATION_CREATE", + "RESOURCE_OPERATION_UPDATE", + "RESOURCE_OPERATION_DELETE", + "RESOURCE_OPERATION_UPDATE_STATUS", + ] + ] = None + + resource_id: Optional[str] = FieldInfo(alias="resourceId", default=None) + + resource_type: Optional[ + Literal[ + "RESOURCE_TYPE_UNSPECIFIED", + "RESOURCE_TYPE_ENVIRONMENT", + "RESOURCE_TYPE_RUNNER", + "RESOURCE_TYPE_PROJECT", + "RESOURCE_TYPE_TASK", + "RESOURCE_TYPE_TASK_EXECUTION", + "RESOURCE_TYPE_SERVICE", + "RESOURCE_TYPE_ORGANIZATION", + "RESOURCE_TYPE_USER", + "RESOURCE_TYPE_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION", + "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN", + "RESOURCE_TYPE_GROUP", + "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN", + "RESOURCE_TYPE_USER_PREFERENCE", + "RESOURCE_TYPE_SERVICE_ACCOUNT", + "RESOURCE_TYPE_SECRET", + "RESOURCE_TYPE_SSO_CONFIG", + ] + ] = FieldInfo(alias="resourceType", default=None) diff --git a/src/gitpod/types/group_list_params.py b/src/gitpod/types/group_list_params.py new file mode 100644 index 00000000..f10ea98e --- /dev/null +++ b/src/gitpod/types/group_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GroupListParams"] + + +class GroupListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/group_list_response.py b/src/gitpod/types/group_list_response.py new file mode 100644 index 00000000..c07f53d1 --- /dev/null +++ b/src/gitpod/types/group_list_response.py @@ -0,0 +1,219 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["GroupListResponse", "Group", "Pagination"] + + +class Group(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + name: Optional[str] = None + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + + system_managed: Optional[bool] = FieldInfo(alias="systemManaged", default=None) + """system_managed indicates that this group is created by the system automatically""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class GroupListResponse(BaseModel): + groups: Optional[List[Group]] = None + + pagination: Optional[Pagination] = None diff --git a/src/gitpod/types/identity_get_authenticated_identity_params.py b/src/gitpod/types/identity_get_authenticated_identity_params.py index 457fe1f9..1c9f8e40 100644 --- a/src/gitpod/types/identity_get_authenticated_identity_params.py +++ b/src/gitpod/types/identity_get_authenticated_identity_params.py @@ -10,10 +10,25 @@ class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False): - body: Required[object] + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_create_params.py b/src/gitpod/types/organization_create_params.py new file mode 100644 index 00000000..e21c4e11 --- /dev/null +++ b/src/gitpod/types/organization_create_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["OrganizationCreateParams"] + + +class OrganizationCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + invite_accounts_with_matching_domain: Annotated[bool, PropertyInfo(alias="inviteAccountsWithMatchingDomain")] + """ + Should other Accounts with the same domain be automatically invited to the + organization? + """ + + join_organization: Annotated[bool, PropertyInfo(alias="joinOrganization")] + """ + join_organization decides whether the Identity issuing this request joins the + org on creation + """ + + name: str + """name is the organization name""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_create_response.py b/src/gitpod/types/organization_create_response.py new file mode 100644 index 00000000..4d0e78c0 --- /dev/null +++ b/src/gitpod/types/organization_create_response.py @@ -0,0 +1,332 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["OrganizationCreateResponse", "Member", "Organization", "OrganizationInviteDomains"] + + +class Member(BaseModel): + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + + email: Optional[str] = None + + full_name: Optional[str] = FieldInfo(alias="fullName", default=None) + + login_provider: Optional[str] = FieldInfo(alias="loginProvider", default=None) + """login_provider is the login provider the user uses to sign in""" + + member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + role: Optional[Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"]] = ( + None + ) + + status: Optional[ + Literal["USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT"] + ] = None + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + + +class OrganizationInviteDomains(BaseModel): + domains: Optional[List[str]] = None + """domains is the list of domains that are allowed to join the organization""" + + +class Organization(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + invite_domains: Optional[OrganizationInviteDomains] = FieldInfo(alias="inviteDomains", default=None) + + name: Optional[str] = None + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class OrganizationCreateResponse(BaseModel): + member: Optional[Member] = None + """member is the member that joined the org on creation. + + Only set if specified "join_organization" is "true" in the request. + """ + + organization: Optional[Organization] = None + """organization is the created organization""" diff --git a/src/gitpod/types/organization_delete_params.py b/src/gitpod/types/organization_delete_params.py new file mode 100644 index 00000000..1c08ed30 --- /dev/null +++ b/src/gitpod/types/organization_delete_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["OrganizationDeleteParams"] + + +class OrganizationDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the ID of the organization to delete""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_join_params.py b/src/gitpod/types/organization_join_params.py new file mode 100644 index 00000000..40550797 --- /dev/null +++ b/src/gitpod/types/organization_join_params.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "OrganizationJoinParams", + "InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization", + "OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin", +] + + +class InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization(TypedDict, total=False): + invite_id: Required[Annotated[str, PropertyInfo(alias="inviteId")]] + """invite_id is the unique identifier of the invite to join the organization.""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the unique identifier of the Organization to join.""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +OrganizationJoinParams: TypeAlias = Union[ + InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization, + OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin, +] diff --git a/src/gitpod/types/organization_join_response.py b/src/gitpod/types/organization_join_response.py new file mode 100644 index 00000000..3ea1469d --- /dev/null +++ b/src/gitpod/types/organization_join_response.py @@ -0,0 +1,129 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["OrganizationJoinResponse", "Member"] + + +class Member(BaseModel): + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + + email: Optional[str] = None + + full_name: Optional[str] = FieldInfo(alias="fullName", default=None) + + login_provider: Optional[str] = FieldInfo(alias="loginProvider", default=None) + """login_provider is the login provider the user uses to sign in""" + + member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + role: Optional[Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"]] = ( + None + ) + + status: Optional[ + Literal["USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT"] + ] = None + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + + +class OrganizationJoinResponse(BaseModel): + member: Optional[Member] = None + """member is the member that was created by joining the organization.""" diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 77441c33..ab47dac1 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -6,32 +6,29 @@ from .._utils import PropertyInfo -__all__ = ["OrganizationListMembersParams", "Pagination"] +__all__ = ["OrganizationListMembersParams"] class OrganizationListMembersParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the ID of the organization to list members for""" - - pagination: Pagination - """pagination contains the pagination options for listing members""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" - PaginationResponse - """ + connect: Literal["v1"] + """Define the version of the Connect protocol""" - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. + message: str - Maximum 100. - """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_list_params.py b/src/gitpod/types/organization_list_params.py new file mode 100644 index 00000000..2daac43b --- /dev/null +++ b/src/gitpod/types/organization_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["OrganizationListParams"] + + +class OrganizationListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_list_response.py b/src/gitpod/types/organization_list_response.py new file mode 100644 index 00000000..8232fcc8 --- /dev/null +++ b/src/gitpod/types/organization_list_response.py @@ -0,0 +1,223 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["OrganizationListResponse", "Organization", "OrganizationInviteDomains", "Pagination"] + + +class OrganizationInviteDomains(BaseModel): + domains: Optional[List[str]] = None + """domains is the list of domains that are allowed to join the organization""" + + +class Organization(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + invite_domains: Optional[OrganizationInviteDomains] = FieldInfo(alias="inviteDomains", default=None) + + name: Optional[str] = None + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class OrganizationListResponse(BaseModel): + organizations: Optional[List[Organization]] = None + """organizations are the organizations that matched the query""" + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing organizations""" diff --git a/src/gitpod/types/organization_retrieve_params.py b/src/gitpod/types/organization_retrieve_params.py new file mode 100644 index 00000000..5fb3aea3 --- /dev/null +++ b/src/gitpod/types/organization_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["OrganizationRetrieveParams"] + + +class OrganizationRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_retrieve_response.py b/src/gitpod/types/organization_retrieve_response.py new file mode 100644 index 00000000..998839c3 --- /dev/null +++ b/src/gitpod/types/organization_retrieve_response.py @@ -0,0 +1,212 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["OrganizationRetrieveResponse", "Organization", "OrganizationInviteDomains"] + + +class OrganizationInviteDomains(BaseModel): + domains: Optional[List[str]] = None + """domains is the list of domains that are allowed to join the organization""" + + +class Organization(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + invite_domains: Optional[OrganizationInviteDomains] = FieldInfo(alias="inviteDomains", default=None) + + name: Optional[str] = None + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class OrganizationRetrieveResponse(BaseModel): + organization: Optional[Organization] = None + """organization is the requested organization""" diff --git a/src/gitpod/types/organization_update_params.py b/src/gitpod/types/organization_update_params.py new file mode 100644 index 00000000..51f2345f --- /dev/null +++ b/src/gitpod/types/organization_update_params.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "OrganizationUpdateParams", + "InviteDomainsIsTheDomainAllowlistOfTheOrganization", + "InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains", + "NameIsTheNewNameOfTheOrganization", +] + + +class InviteDomainsIsTheDomainAllowlistOfTheOrganization(TypedDict, total=False): + invite_domains: Required[ + Annotated[InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, PropertyInfo(alias="inviteDomains")] + ] + """invite_domains is the domain allowlist of the organization""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains(TypedDict, total=False): + domains: List[str] + """domains is the list of domains that are allowed to join the organization""" + + +class NameIsTheNewNameOfTheOrganization(TypedDict, total=False): + name: Required[str] + """name is the new name of the organization""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +OrganizationUpdateParams: TypeAlias = Union[ + InviteDomainsIsTheDomainAllowlistOfTheOrganization, NameIsTheNewNameOfTheOrganization +] diff --git a/src/gitpod/types/organization_update_response.py b/src/gitpod/types/organization_update_response.py new file mode 100644 index 00000000..314e1e8b --- /dev/null +++ b/src/gitpod/types/organization_update_response.py @@ -0,0 +1,212 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["OrganizationUpdateResponse", "Organization", "OrganizationInviteDomains"] + + +class OrganizationInviteDomains(BaseModel): + domains: Optional[List[str]] = None + """domains is the list of domains that are allowed to join the organization""" + + +class Organization(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + invite_domains: Optional[OrganizationInviteDomains] = FieldInfo(alias="inviteDomains", default=None) + + name: Optional[str] = None + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class OrganizationUpdateResponse(BaseModel): + organization: Optional[Organization] = None + """organization is the updated organization""" diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index 7230e49f..0cc2d0e9 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -6,3 +6,13 @@ from .invite_create_response import InviteCreateResponse as InviteCreateResponse from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams from .invite_retrieve_response import InviteRetrieveResponse as InviteRetrieveResponse +from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams +from .invite_get_summary_response import InviteGetSummaryResponse as InviteGetSummaryResponse +from .sso_configuration_list_params import SSOConfigurationListParams as SSOConfigurationListParams +from .sso_configuration_create_params import SSOConfigurationCreateParams as SSOConfigurationCreateParams +from .sso_configuration_delete_params import SSOConfigurationDeleteParams as SSOConfigurationDeleteParams +from .sso_configuration_list_response import SSOConfigurationListResponse as SSOConfigurationListResponse +from .sso_configuration_update_params import SSOConfigurationUpdateParams as SSOConfigurationUpdateParams +from .sso_configuration_create_response import SSOConfigurationCreateResponse as SSOConfigurationCreateResponse +from .sso_configuration_retrieve_params import SSOConfigurationRetrieveParams as SSOConfigurationRetrieveParams +from .sso_configuration_retrieve_response import SSOConfigurationRetrieveResponse as SSOConfigurationRetrieveResponse diff --git a/src/gitpod/types/organizations/invite/__init__.py b/src/gitpod/types/organizations/invite/__init__.py deleted file mode 100644 index 24698ae5..00000000 --- a/src/gitpod/types/organizations/invite/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .summary_retrieve_params import SummaryRetrieveParams as SummaryRetrieveParams -from .summary_retrieve_response import SummaryRetrieveResponse as SummaryRetrieveResponse diff --git a/src/gitpod/types/organizations/invite_get_summary_params.py b/src/gitpod/types/organizations/invite_get_summary_params.py new file mode 100644 index 00000000..38befbf2 --- /dev/null +++ b/src/gitpod/types/organizations/invite_get_summary_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["InviteGetSummaryParams"] + + +class InviteGetSummaryParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite/summary_retrieve_response.py b/src/gitpod/types/organizations/invite_get_summary_response.py similarity index 79% rename from src/gitpod/types/organizations/invite/summary_retrieve_response.py rename to src/gitpod/types/organizations/invite_get_summary_response.py index 38200c0e..16c355ad 100644 --- a/src/gitpod/types/organizations/invite/summary_retrieve_response.py +++ b/src/gitpod/types/organizations/invite_get_summary_response.py @@ -4,12 +4,12 @@ from pydantic import Field as FieldInfo -from ...._models import BaseModel +from ..._models import BaseModel -__all__ = ["SummaryRetrieveResponse"] +__all__ = ["InviteGetSummaryResponse"] -class SummaryRetrieveResponse(BaseModel): +class InviteGetSummaryResponse(BaseModel): organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) diff --git a/src/gitpod/types/organizations/sso_configuration_create_params.py b/src/gitpod/types/organizations/sso_configuration_create_params.py new file mode 100644 index 00000000..3056bf1a --- /dev/null +++ b/src/gitpod/types/organizations/sso_configuration_create_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["SSOConfigurationCreateParams"] + + +class SSOConfigurationCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + client_id: Annotated[str, PropertyInfo(alias="clientId")] + """client_id is the client ID of the OIDC application set on the IdP""" + + client_secret: Annotated[str, PropertyInfo(alias="clientSecret")] + """client_secret is the client secret of the OIDC application set on the IdP""" + + email_domain: Annotated[str, PropertyInfo(alias="emailDomain")] + """email_domain is the domain that is allowed to sign in to the organization""" + + issuer_url: Annotated[str, PropertyInfo(alias="issuerUrl")] + """issuer_url is the URL of the IdP issuer""" + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/sso_configuration_create_response.py b/src/gitpod/types/organizations/sso_configuration_create_response.py new file mode 100644 index 00000000..6909b0e4 --- /dev/null +++ b/src/gitpod/types/organizations/sso_configuration_create_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["SSOConfigurationCreateResponse", "SSOConfiguration"] + + +class SSOConfiguration(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the SSO configuration""" + + claims: Optional[Dict[str, str]] = None + """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" + + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + """client_id is the client ID of the OIDC application set on the IdP""" + + email_domain: Optional[str] = FieldInfo(alias="emailDomain", default=None) + + issuer_url: Optional[str] = FieldInfo(alias="issuerUrl", default=None) + """issuer_url is the URL of the IdP issuer""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + + provider_type: Optional[Literal["PROVIDER_TYPE_UNSPECIFIED", "PROVIDER_TYPE_BUILTIN", "PROVIDER_TYPE_CUSTOM"]] = ( + FieldInfo(alias="providerType", default=None) + ) + """provider_type defines the type of the SSO configuration""" + + state: Optional[ + Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ] + ] = None + """state is the state of the SSO configuration""" + + +class SSOConfigurationCreateResponse(BaseModel): + sso_configuration: Optional[SSOConfiguration] = FieldInfo(alias="ssoConfiguration", default=None) + """sso_configuration is the created SSO configuration""" diff --git a/src/gitpod/types/runner_configurations/configuration_schema_create_params.py b/src/gitpod/types/organizations/sso_configuration_delete_params.py similarity index 73% rename from src/gitpod/types/runner_configurations/configuration_schema_create_params.py rename to src/gitpod/types/organizations/sso_configuration_delete_params.py index b8cb816d..d7301f33 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_create_params.py +++ b/src/gitpod/types/organizations/sso_configuration_delete_params.py @@ -6,14 +6,14 @@ from ..._utils import PropertyInfo -__all__ = ["ConfigurationSchemaCreateParams"] +__all__ = ["SSOConfigurationDeleteParams"] -class ConfigurationSchemaCreateParams(TypedDict, total=False): +class SSOConfigurationDeleteParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + sso_configuration_id: Annotated[str, PropertyInfo(alias="ssoConfigurationId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/sso_configuration_list_params.py b/src/gitpod/types/organizations/sso_configuration_list_params.py new file mode 100644 index 00000000..16d4faa4 --- /dev/null +++ b/src/gitpod/types/organizations/sso_configuration_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["SSOConfigurationListParams"] + + +class SSOConfigurationListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/sso_configuration_list_response.py b/src/gitpod/types/organizations/sso_configuration_list_response.py new file mode 100644 index 00000000..f0e66afc --- /dev/null +++ b/src/gitpod/types/organizations/sso_configuration_list_response.py @@ -0,0 +1,55 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["SSOConfigurationListResponse", "Pagination", "SSOConfiguration"] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class SSOConfiguration(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the SSO configuration""" + + claims: Optional[Dict[str, str]] = None + """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" + + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + """client_id is the client ID of the OIDC application set on the IdP""" + + email_domain: Optional[str] = FieldInfo(alias="emailDomain", default=None) + + issuer_url: Optional[str] = FieldInfo(alias="issuerUrl", default=None) + """issuer_url is the URL of the IdP issuer""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + + provider_type: Optional[Literal["PROVIDER_TYPE_UNSPECIFIED", "PROVIDER_TYPE_BUILTIN", "PROVIDER_TYPE_CUSTOM"]] = ( + FieldInfo(alias="providerType", default=None) + ) + """provider_type defines the type of the SSO configuration""" + + state: Optional[ + Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ] + ] = None + """state is the state of the SSO configuration""" + + +class SSOConfigurationListResponse(BaseModel): + pagination: Optional[Pagination] = None + + sso_configurations: Optional[List[SSOConfiguration]] = FieldInfo(alias="ssoConfigurations", default=None) + """sso_configurations are the SSO configurations for the organization""" diff --git a/src/gitpod/types/organizations/sso_configuration_retrieve_params.py b/src/gitpod/types/organizations/sso_configuration_retrieve_params.py new file mode 100644 index 00000000..6f723393 --- /dev/null +++ b/src/gitpod/types/organizations/sso_configuration_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["SSOConfigurationRetrieveParams"] + + +class SSOConfigurationRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/sso_configuration_retrieve_response.py b/src/gitpod/types/organizations/sso_configuration_retrieve_response.py new file mode 100644 index 00000000..c5b31cfd --- /dev/null +++ b/src/gitpod/types/organizations/sso_configuration_retrieve_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["SSOConfigurationRetrieveResponse", "SSOConfiguration"] + + +class SSOConfiguration(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the SSO configuration""" + + claims: Optional[Dict[str, str]] = None + """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" + + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + """client_id is the client ID of the OIDC application set on the IdP""" + + email_domain: Optional[str] = FieldInfo(alias="emailDomain", default=None) + + issuer_url: Optional[str] = FieldInfo(alias="issuerUrl", default=None) + """issuer_url is the URL of the IdP issuer""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + + provider_type: Optional[Literal["PROVIDER_TYPE_UNSPECIFIED", "PROVIDER_TYPE_BUILTIN", "PROVIDER_TYPE_CUSTOM"]] = ( + FieldInfo(alias="providerType", default=None) + ) + """provider_type defines the type of the SSO configuration""" + + state: Optional[ + Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ] + ] = None + """state is the state of the SSO configuration""" + + +class SSOConfigurationRetrieveResponse(BaseModel): + sso_configuration: Optional[SSOConfiguration] = FieldInfo(alias="ssoConfiguration", default=None) + """sso_configuration is the SSO configuration identified by the ID""" diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py new file mode 100644 index 00000000..b550a136 --- /dev/null +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -0,0 +1,84 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ..._utils import PropertyInfo + +__all__ = [ + "SSOConfigurationUpdateParams", + "ClientIDIsTheClientIDOfTheSSOProvider", + "ClientSecretIsTheClientSecretOfTheSSOProvider", + "Variant2", + "IssuerURLIsTheURLOfTheIDPIssuer", + "StateIsTheStateOfTheSSOConfiguration", +] + + +class ClientIDIsTheClientIDOfTheSSOProvider(TypedDict, total=False): + client_id: Required[Annotated[str, PropertyInfo(alias="clientId")]] + """client_id is the client ID of the SSO provider""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class ClientSecretIsTheClientSecretOfTheSSOProvider(TypedDict, total=False): + client_secret: Required[Annotated[str, PropertyInfo(alias="clientSecret")]] + """client_secret is the client secret of the SSO provider""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + email_domain: Required[Annotated[str, PropertyInfo(alias="emailDomain")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class IssuerURLIsTheURLOfTheIDPIssuer(TypedDict, total=False): + issuer_url: Required[Annotated[str, PropertyInfo(alias="issuerUrl")]] + """issuer_url is the URL of the IdP issuer""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class StateIsTheStateOfTheSSOConfiguration(TypedDict, total=False): + state: Required[ + Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ] + ] + """state is the state of the SSO configuration""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +SSOConfigurationUpdateParams: TypeAlias = Union[ + ClientIDIsTheClientIDOfTheSSOProvider, + ClientSecretIsTheClientSecretOfTheSSOProvider, + Variant2, + IssuerURLIsTheURLOfTheIDPIssuer, + StateIsTheStateOfTheSSOConfiguration, +] diff --git a/src/gitpod/types/personal_access_token_list_params.py b/src/gitpod/types/personal_access_token_list_params.py deleted file mode 100644 index 2cca5162..00000000 --- a/src/gitpod/types/personal_access_token_list_params.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["PersonalAccessTokenListParams", "Filter", "Pagination"] - - -class PersonalAccessTokenListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - - pagination: Pagination - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - user_ids: Annotated[List[str], PropertyInfo(alias="userIds")] - """ - creator_ids filters the response to only Environments created by specified - members - """ - - -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a - - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py index 29299602..c9e9529f 100644 --- a/src/gitpod/types/project_create_from_environment_response.py +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -12,8 +12,8 @@ "ProjectCreateFromEnvironmentResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassEnvironmentClassID", - "ProjectEnvironmentClassLocalRunner", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", "ProjectInitializer", "ProjectInitializerSpec", "ProjectInitializerSpecContextURL", @@ -27,7 +27,9 @@ ] -class ProjectEnvironmentClassEnvironmentClassID(BaseModel): +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. @@ -35,13 +37,14 @@ class ProjectEnvironmentClassEnvironmentClassID(BaseModel): """ -class ProjectEnvironmentClassLocalRunner(BaseModel): +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassEnvironmentClassID, ProjectEnvironmentClassLocalRunner + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, ] diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index 0e9a1c4d..708cecd0 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -10,8 +10,8 @@ __all__ = [ "ProjectCreateParams", "EnvironmentClass", - "EnvironmentClassEnvironmentClassID", - "EnvironmentClassLocalRunner", + "EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "EnvironmentClassUseALocalRunnerForTheUser", "Initializer", "InitializerSpec", "InitializerSpecContextURL", @@ -56,7 +56,9 @@ class ProjectCreateParams(TypedDict, total=False): """Define the timeout, in ms""" -class EnvironmentClassEnvironmentClassID(TypedDict, total=False): +class EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + TypedDict, total=False +): environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] """Use a fixed environment class on a given Runner. @@ -64,12 +66,15 @@ class EnvironmentClassEnvironmentClassID(TypedDict, total=False): """ -class EnvironmentClassLocalRunner(TypedDict, total=False): +class EnvironmentClassUseALocalRunnerForTheUser(TypedDict, total=False): local_runner: Required[Annotated[bool, PropertyInfo(alias="localRunner")]] """Use a local runner for the user""" -EnvironmentClass: TypeAlias = Union[EnvironmentClassEnvironmentClassID, EnvironmentClassLocalRunner] +EnvironmentClass: TypeAlias = Union[ + EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + EnvironmentClassUseALocalRunnerForTheUser, +] class InitializerSpecContextURLContextURL(TypedDict, total=False): diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py index dfec43dc..96ecc716 100644 --- a/src/gitpod/types/project_create_response.py +++ b/src/gitpod/types/project_create_response.py @@ -12,8 +12,8 @@ "ProjectCreateResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassEnvironmentClassID", - "ProjectEnvironmentClassLocalRunner", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", "ProjectInitializer", "ProjectInitializerSpec", "ProjectInitializerSpecContextURL", @@ -27,7 +27,9 @@ ] -class ProjectEnvironmentClassEnvironmentClassID(BaseModel): +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. @@ -35,13 +37,14 @@ class ProjectEnvironmentClassEnvironmentClassID(BaseModel): """ -class ProjectEnvironmentClassLocalRunner(BaseModel): +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassEnvironmentClassID, ProjectEnvironmentClassLocalRunner + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, ] diff --git a/src/gitpod/types/project_delete_params.py b/src/gitpod/types/project_delete_params.py new file mode 100644 index 00000000..8004da17 --- /dev/null +++ b/src/gitpod/types/project_delete_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ProjectDeleteParams"] + + +class ProjectDeleteParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py new file mode 100644 index 00000000..df0843b2 --- /dev/null +++ b/src/gitpod/types/project_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ProjectListParams"] + + +class ProjectListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_list_response.py b/src/gitpod/types/project_list_response.py new file mode 100644 index 00000000..da32fdb4 --- /dev/null +++ b/src/gitpod/types/project_list_response.py @@ -0,0 +1,378 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ProjectListResponse", + "Pagination", + "Project", + "ProjectEnvironmentClass", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", + "ProjectInitializer", + "ProjectInitializerSpec", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", + "ProjectMetadata", + "ProjectMetadataCreator", + "ProjectUsedBy", + "ProjectUsedBySubject", +] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): + environment_class_id: str = FieldInfo(alias="environmentClassId") + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): + local_runner: bool = FieldInfo(alias="localRunner") + """Use a local runner for the user""" + + +ProjectEnvironmentClass: TypeAlias = Union[ + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, +] + + +class ProjectInitializerSpecContextURLContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") + + +class ProjectInitializerSpecGitGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit + + +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] + + +class ProjectInitializer(BaseModel): + specs: Optional[List[ProjectInitializerSpec]] = None + + +class ProjectMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ProjectMetadataCreator] = None + """creator is the identity of the project creator""" + + name: Optional[str] = None + """name is the human readable name of the project""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class ProjectUsedBySubject(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectUsedBy(BaseModel): + subjects: Optional[List[ProjectUsedBySubject]] = None + """ + Subjects are the 10 most recent subjects who have used the project to create an + environment + """ + + total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) + """Total number of unique subjects who have used the project""" + + +class Project(BaseModel): + environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") + + id: Optional[str] = None + """id is the unique identifier for the project""" + + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + initializer: Optional[ProjectInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + metadata: Optional[ProjectMetadata] = None + + used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) + + +class ProjectListResponse(BaseModel): + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing organizations""" + + projects: Optional[List[Project]] = None diff --git a/src/gitpod/types/project_retrieve_params.py b/src/gitpod/types/project_retrieve_params.py index 42abf44b..121cff2f 100644 --- a/src/gitpod/types/project_retrieve_params.py +++ b/src/gitpod/types/project_retrieve_params.py @@ -10,11 +10,25 @@ class ProjectRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - project_id: Annotated[str, PropertyInfo(alias="projectId")] - """project_id specifies the project identifier""" + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py index 5744cecd..b8c2c736 100644 --- a/src/gitpod/types/project_retrieve_response.py +++ b/src/gitpod/types/project_retrieve_response.py @@ -12,8 +12,8 @@ "ProjectRetrieveResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassEnvironmentClassID", - "ProjectEnvironmentClassLocalRunner", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", "ProjectInitializer", "ProjectInitializerSpec", "ProjectInitializerSpecContextURL", @@ -27,7 +27,9 @@ ] -class ProjectEnvironmentClassEnvironmentClassID(BaseModel): +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. @@ -35,13 +37,14 @@ class ProjectEnvironmentClassEnvironmentClassID(BaseModel): """ -class ProjectEnvironmentClassLocalRunner(BaseModel): +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassEnvironmentClassID, ProjectEnvironmentClassLocalRunner + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, ] diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py new file mode 100644 index 00000000..c8ac42c1 --- /dev/null +++ b/src/gitpod/types/project_update_params.py @@ -0,0 +1,178 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "ProjectUpdateParams", + "AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot", + "DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", + "Variant2", + "Variant2EnvironmentClass", + "Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "Variant2EnvironmentClassUseALocalRunnerForTheUser", + "InitializerIsTheContentInitializer", + "InitializerIsTheContentInitializerInitializer", + "InitializerIsTheContentInitializerInitializerSpec", + "InitializerIsTheContentInitializerInitializerSpecContextURL", + "InitializerIsTheContentInitializerInitializerSpecContextURLContextURL", + "InitializerIsTheContentInitializerInitializerSpecGit", + "InitializerIsTheContentInitializerInitializerSpecGitGit", + "Variant4", +] + + +class AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot(TypedDict, total=False): + automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] + """ + automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot(TypedDict, total=False): + devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + environment_class: Required[Annotated[Variant2EnvironmentClass, PropertyInfo(alias="environmentClass")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + TypedDict, total=False +): + environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class Variant2EnvironmentClassUseALocalRunnerForTheUser(TypedDict, total=False): + local_runner: Required[Annotated[bool, PropertyInfo(alias="localRunner")]] + """Use a local runner for the user""" + + +Variant2EnvironmentClass: TypeAlias = Union[ + Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + Variant2EnvironmentClassUseALocalRunnerForTheUser, +] + + +class InitializerIsTheContentInitializer(TypedDict, total=False): + initializer: Required[InitializerIsTheContentInitializerInitializer] + """EnvironmentInitializer specifies how an environment is to be initialized""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class InitializerIsTheContentInitializerInitializerSpecContextURLContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class InitializerIsTheContentInitializerInitializerSpecContextURL(TypedDict, total=False): + context_url: Required[ + Annotated[ + InitializerIsTheContentInitializerInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl") + ] + ] + + +class InitializerIsTheContentInitializerInitializerSpecGitGit(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class InitializerIsTheContentInitializerInitializerSpecGit(TypedDict, total=False): + git: Required[InitializerIsTheContentInitializerInitializerSpecGitGit] + + +InitializerIsTheContentInitializerInitializerSpec: TypeAlias = Union[ + InitializerIsTheContentInitializerInitializerSpecContextURL, InitializerIsTheContentInitializerInitializerSpecGit +] + + +class InitializerIsTheContentInitializerInitializer(TypedDict, total=False): + specs: Iterable[InitializerIsTheContentInitializerInitializerSpec] + + +class Variant4(TypedDict, total=False): + name: Required[str] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +ProjectUpdateParams: TypeAlias = Union[ + AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot, + DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, + Variant2, + InitializerIsTheContentInitializer, + Variant4, +] diff --git a/src/gitpod/types/project_update_response.py b/src/gitpod/types/project_update_response.py new file mode 100644 index 00000000..f90b85b6 --- /dev/null +++ b/src/gitpod/types/project_update_response.py @@ -0,0 +1,366 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ProjectUpdateResponse", + "Project", + "ProjectEnvironmentClass", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", + "ProjectInitializer", + "ProjectInitializerSpec", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", + "ProjectMetadata", + "ProjectMetadataCreator", + "ProjectUsedBy", + "ProjectUsedBySubject", +] + + +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): + environment_class_id: str = FieldInfo(alias="environmentClassId") + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): + local_runner: bool = FieldInfo(alias="localRunner") + """Use a local runner for the user""" + + +ProjectEnvironmentClass: TypeAlias = Union[ + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, +] + + +class ProjectInitializerSpecContextURLContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") + + +class ProjectInitializerSpecGitGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit + + +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] + + +class ProjectInitializer(BaseModel): + specs: Optional[List[ProjectInitializerSpec]] = None + + +class ProjectMetadataCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[ProjectMetadataCreator] = None + """creator is the identity of the project creator""" + + name: Optional[str] = None + """name is the human readable name of the project""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class ProjectUsedBySubject(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class ProjectUsedBy(BaseModel): + subjects: Optional[List[ProjectUsedBySubject]] = None + """ + Subjects are the 10 most recent subjects who have used the project to create an + environment + """ + + total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) + """Total number of unique subjects who have used the project""" + + +class Project(BaseModel): + environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") + + id: Optional[str] = None + """id is the unique identifier for the project""" + + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + initializer: Optional[ProjectInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + metadata: Optional[ProjectMetadata] = None + + used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) + + +class ProjectUpdateResponse(BaseModel): + project: Optional[Project] = None diff --git a/src/gitpod/types/projects/__init__.py b/src/gitpod/types/projects/__init__.py new file mode 100644 index 00000000..7bea3a68 --- /dev/null +++ b/src/gitpod/types/projects/__init__.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .policy_list_params import PolicyListParams as PolicyListParams +from .policy_create_params import PolicyCreateParams as PolicyCreateParams +from .policy_delete_params import PolicyDeleteParams as PolicyDeleteParams +from .policy_list_response import PolicyListResponse as PolicyListResponse +from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams +from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse +from .policy_update_response import PolicyUpdateResponse as PolicyUpdateResponse diff --git a/src/gitpod/types/projects/policy_create_params.py b/src/gitpod/types/projects/policy_create_params.py new file mode 100644 index 00000000..dcbee1c1 --- /dev/null +++ b/src/gitpod/types/projects/policy_create_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PolicyCreateParams"] + + +class PolicyCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + """group_id specifies the group_id identifier""" + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" + + role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/projects/policy_create_response.py b/src/gitpod/types/projects/policy_create_response.py new file mode 100644 index 00000000..217faeb4 --- /dev/null +++ b/src/gitpod/types/projects/policy_create_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["PolicyCreateResponse", "Policy"] + + +class Policy(BaseModel): + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + + role: Optional[Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"]] = None + """role is the role assigned to the group""" + + +class PolicyCreateResponse(BaseModel): + policy: Optional[Policy] = None diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py b/src/gitpod/types/projects/policy_delete_params.py similarity index 62% rename from src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py rename to src/gitpod/types/projects/policy_delete_params.py index 82d07586..28c08ec5 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_params.py +++ b/src/gitpod/types/projects/policy_delete_params.py @@ -6,14 +6,18 @@ from ..._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenRetrieveParams"] +__all__ = ["PolicyDeleteParams"] -class HostAuthenticationTokenRetrieveParams(TypedDict, total=False): +class PolicyDeleteParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - id: str + group_id: Annotated[str, PropertyInfo(alias="groupId")] + """group_id specifies the group_id identifier""" + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/projects/policy_list_params.py b/src/gitpod/types/projects/policy_list_params.py new file mode 100644 index 00000000..527570b7 --- /dev/null +++ b/src/gitpod/types/projects/policy_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PolicyListParams"] + + +class PolicyListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/projects/policy_list_response.py b/src/gitpod/types/projects/policy_list_response.py new file mode 100644 index 00000000..33a9facc --- /dev/null +++ b/src/gitpod/types/projects/policy_list_response.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["PolicyListResponse", "Pagination", "Policy"] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class Policy(BaseModel): + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + + role: Optional[Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"]] = None + """role is the role assigned to the group""" + + +class PolicyListResponse(BaseModel): + pagination: Optional[Pagination] = None + + policies: Optional[List[Policy]] = None diff --git a/src/gitpod/types/projects/policy_update_params.py b/src/gitpod/types/projects/policy_update_params.py new file mode 100644 index 00000000..fd763d67 --- /dev/null +++ b/src/gitpod/types/projects/policy_update_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PolicyUpdateParams"] + + +class PolicyUpdateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + """group_id specifies the group_id identifier""" + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" + + role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/projects/policy_update_response.py b/src/gitpod/types/projects/policy_update_response.py new file mode 100644 index 00000000..5a5a9c81 --- /dev/null +++ b/src/gitpod/types/projects/policy_update_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["PolicyUpdateResponse", "Policy"] + + +class Policy(BaseModel): + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + + role: Optional[Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"]] = None + """role is the role assigned to the group""" + + +class PolicyUpdateResponse(BaseModel): + policy: Optional[Policy] = None diff --git a/src/gitpod/types/runner_configuration_validate_params.py b/src/gitpod/types/runner_configuration_validate_params.py deleted file mode 100644 index 830bdab2..00000000 --- a/src/gitpod/types/runner_configuration_validate_params.py +++ /dev/null @@ -1,123 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict - -from .._types import Base64FileInput -from .._utils import PropertyInfo -from .._models import set_pydantic_config - -__all__ = [ - "RunnerConfigurationValidateParams", - "EnvironmentClass", - "EnvironmentClassEnvironmentClass", - "EnvironmentClassEnvironmentClassConfiguration", - "ScmIntegration", - "ScmIntegrationScmIntegration", - "ScmIntegrationScmIntegrationOAuthClientID", - "ScmIntegrationScmIntegrationOAuthEncryptedClientSecret", - "ScmIntegrationScmIntegrationOAuthPlaintextClientSecret", -] - - -class EnvironmentClass(TypedDict, total=False): - environment_class: Required[Annotated[EnvironmentClassEnvironmentClass, PropertyInfo(alias="environmentClass")]] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class EnvironmentClassEnvironmentClassConfiguration(TypedDict, total=False): - key: str - - value: str - - -class EnvironmentClassEnvironmentClass(TypedDict, total=False): - id: str - """id is the unique identifier of the environment class""" - - configuration: Iterable[EnvironmentClassEnvironmentClassConfiguration] - """configuration describes the configuration of the environment class""" - - description: str - """description is a human readable description of the environment class""" - - display_name: Annotated[str, PropertyInfo(alias="displayName")] - """display_name is the human readable name of the environment class""" - - enabled: bool - """enabled indicates whether the environment class can be used to create - - new environments. - """ - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """ - runner_id is the unique identifier of the runner the environment class belongs - to - """ - - -class ScmIntegration(TypedDict, total=False): - scm_integration: Required[Annotated[ScmIntegrationScmIntegration, PropertyInfo(alias="scmIntegration")]] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class ScmIntegrationScmIntegrationOAuthClientID(TypedDict, total=False): - oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] - """oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_client_secret must also be set. - """ - - -class ScmIntegrationScmIntegrationOAuthEncryptedClientSecret(TypedDict, total=False): - oauth_encrypted_client_secret: Required[ - Annotated[Union[str, Base64FileInput], PropertyInfo(alias="oauthEncryptedClientSecret", format="base64")] - ] - """ - oauth_encrypted_client_secret is the OAuth app's client secret encrypted with - the runner's public key, - - if OAuth is configured. This can be used to e.g. validate an already encrypted - client secret of an existing SCM integration. - """ - - -set_pydantic_config(ScmIntegrationScmIntegrationOAuthEncryptedClientSecret, {"arbitrary_types_allowed": True}) - - -class ScmIntegrationScmIntegrationOAuthPlaintextClientSecret(TypedDict, total=False): - oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] - """ - oauth_plaintext_client_secret is the OAuth app's client secret in clear text, if - OAuth is configured. - - This can be set to validate any new client secret before it is encrypted and - stored. This value will not be stored and get encrypted with the runner's public - key before passing it to the runner. - """ - - -ScmIntegrationScmIntegration: TypeAlias = Union[ - ScmIntegrationScmIntegrationOAuthClientID, - ScmIntegrationScmIntegrationOAuthEncryptedClientSecret, - ScmIntegrationScmIntegrationOAuthPlaintextClientSecret, -] - -RunnerConfigurationValidateParams: TypeAlias = Union[EnvironmentClass, ScmIntegration] diff --git a/src/gitpod/types/runner_configurations/configuration_schema_create_response.py b/src/gitpod/types/runner_configurations/configuration_schema_create_response.py deleted file mode 100644 index 0cee49c1..00000000 --- a/src/gitpod/types/runner_configurations/configuration_schema_create_response.py +++ /dev/null @@ -1,299 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import builtins -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = [ - "ConfigurationSchemaCreateResponse", - "Schema", - "SchemaEnvironmentClass", - "SchemaEnvironmentClassBool", - "SchemaEnvironmentClassBoolBool", - "SchemaEnvironmentClassDisplay", - "SchemaEnvironmentClassDisplayDisplay", - "SchemaEnvironmentClassEnum", - "SchemaEnvironmentClassEnumEnum", - "SchemaEnvironmentClassInt", - "SchemaEnvironmentClassIntInt", - "SchemaEnvironmentClassString", - "SchemaEnvironmentClassStringString", - "SchemaRunnerConfig", - "SchemaRunnerConfigBool", - "SchemaRunnerConfigBoolBool", - "SchemaRunnerConfigDisplay", - "SchemaRunnerConfigDisplayDisplay", - "SchemaRunnerConfigEnum", - "SchemaRunnerConfigEnumEnum", - "SchemaRunnerConfigInt", - "SchemaRunnerConfigIntInt", - "SchemaRunnerConfigString", - "SchemaRunnerConfigStringString", - "SchemaScm", - "SchemaScmOAuth", - "SchemaScmPat", -] - - -class SchemaEnvironmentClassBoolBool(BaseModel): - default: Optional[bool] = None - - -class SchemaEnvironmentClassBool(BaseModel): - bool: SchemaEnvironmentClassBoolBool - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None - - -class SchemaEnvironmentClassDisplayDisplay(BaseModel): - default: Optional[str] = None - - -class SchemaEnvironmentClassDisplay(BaseModel): - display: SchemaEnvironmentClassDisplayDisplay - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaEnvironmentClassEnumEnum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaEnvironmentClassEnum(BaseModel): - enum: SchemaEnvironmentClassEnumEnum - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaEnvironmentClassIntInt(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaEnvironmentClassInt(BaseModel): - int: SchemaEnvironmentClassIntInt - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaEnvironmentClassStringString(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - -class SchemaEnvironmentClassString(BaseModel): - string: SchemaEnvironmentClassStringString - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -SchemaEnvironmentClass: TypeAlias = Union[ - SchemaEnvironmentClassBool, - SchemaEnvironmentClassDisplay, - SchemaEnvironmentClassEnum, - SchemaEnvironmentClassInt, - SchemaEnvironmentClassString, -] - - -class SchemaRunnerConfigBoolBool(BaseModel): - default: Optional[bool] = None - - -class SchemaRunnerConfigBool(BaseModel): - bool: SchemaRunnerConfigBoolBool - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None - - -class SchemaRunnerConfigDisplayDisplay(BaseModel): - default: Optional[str] = None - - -class SchemaRunnerConfigDisplay(BaseModel): - display: SchemaRunnerConfigDisplayDisplay - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaRunnerConfigEnumEnum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaRunnerConfigEnum(BaseModel): - enum: SchemaRunnerConfigEnumEnum - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaRunnerConfigIntInt(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaRunnerConfigInt(BaseModel): - int: SchemaRunnerConfigIntInt - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaRunnerConfigStringString(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - -class SchemaRunnerConfigString(BaseModel): - string: SchemaRunnerConfigStringString - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -SchemaRunnerConfig: TypeAlias = Union[ - SchemaRunnerConfigBool, - SchemaRunnerConfigDisplay, - SchemaRunnerConfigEnum, - SchemaRunnerConfigInt, - SchemaRunnerConfigString, -] - - -class SchemaScmOAuth(BaseModel): - callback_url: Optional[str] = FieldInfo(alias="callbackUrl", default=None) - """ - callback_url is the URL the OAuth app will redirect to after the user has - authenticated. - """ - - -class SchemaScmPat(BaseModel): - description: Optional[str] = None - """description is a human-readable description of the PAT.""" - - docs_link: Optional[str] = FieldInfo(alias="docsLink", default=None) - """ - docs_link is a link to the documentation on how to create a PAT for this SCM - system. - """ - - -class SchemaScm(BaseModel): - default_hosts: Optional[List[str]] = FieldInfo(alias="defaultHosts", default=None) - - name: Optional[str] = None - - oauth: Optional[SchemaScmOAuth] = None - - pat: Optional[SchemaScmPat] = None - - scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) - - -class Schema(BaseModel): - environment_classes: Optional[List[SchemaEnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) - - runner_config: Optional[List[SchemaRunnerConfig]] = FieldInfo(alias="runnerConfig", default=None) - - scm: Optional[List[SchemaScm]] = None - - version: Optional[str] = None - """The schema version""" - - -class ConfigurationSchemaCreateResponse(BaseModel): - schema_: Optional[Schema] = FieldInfo(alias="schema", default=None) diff --git a/src/gitpod/types/runner_configurations/environment_class_list_params.py b/src/gitpod/types/runner_configurations/environment_class_list_params.py deleted file mode 100644 index 9cbaf8f3..00000000 --- a/src/gitpod/types/runner_configurations/environment_class_list_params.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["EnvironmentClassListParams", "Filter", "Pagination"] - - -class EnvironmentClassListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - - pagination: Pagination - """pagination contains the pagination options for listing environment classes""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - enabled: Required[bool] - """enabled filters the response to only enabled or disabled environment classes. - - If not set, all environment classes are returned. - """ - - -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a - - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py b/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py deleted file mode 100644 index 7d1cb306..00000000 --- a/src/gitpod/types/runner_configurations/host_authentication_token_list_params.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["HostAuthenticationTokenListParams", "Filter", "FilterRunnerID", "FilterUserID", "Pagination"] - - -class HostAuthenticationTokenListParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - filter: Filter - - pagination: Pagination - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class FilterRunnerID(TypedDict, total=False): - runner_id: Required[Annotated[str, PropertyInfo(alias="runnerId")]] - - -class FilterUserID(TypedDict, total=False): - user_id: Required[Annotated[str, PropertyInfo(alias="userId")]] - - -Filter: TypeAlias = Union[FilterRunnerID, FilterUserID] - - -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a - - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/runner_delete_runner_params.py b/src/gitpod/types/runner_delete_params.py similarity index 90% rename from src/gitpod/types/runner_delete_runner_params.py rename to src/gitpod/types/runner_delete_params.py index 005bf36e..a3e01014 100644 --- a/src/gitpod/types/runner_delete_runner_params.py +++ b/src/gitpod/types/runner_delete_params.py @@ -6,10 +6,10 @@ from .._utils import PropertyInfo -__all__ = ["RunnerDeleteRunnerParams"] +__all__ = ["RunnerDeleteParams"] -class RunnerDeleteRunnerParams(TypedDict, total=False): +class RunnerDeleteParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py index 4155c49d..a1f38218 100644 --- a/src/gitpod/types/runner_list_params.py +++ b/src/gitpod/types/runner_list_params.py @@ -2,46 +2,33 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["RunnerListParams", "Filter", "Pagination"] +__all__ = ["RunnerListParams"] class RunnerListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - filter: Filter - - pagination: Pagination - """pagination contains the pagination options for listing runners""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Filter(TypedDict, total=False): - creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] - """creator_ids filters the response to only runner created by specified users""" - - kinds: List[ - Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] - ] - """kinds filters the response to only runners of the specified kinds""" - + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" - PaginationResponse - """ + connect: Literal["v1"] + """Define the version of the Connect protocol""" - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. + message: str - Maximum 100. - """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_retrieve_params.py b/src/gitpod/types/runner_retrieve_params.py index 786b07dd..bff25582 100644 --- a/src/gitpod/types/runner_retrieve_params.py +++ b/src/gitpod/types/runner_retrieve_params.py @@ -10,10 +10,25 @@ class RunnerRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py new file mode 100644 index 00000000..28bcc60a --- /dev/null +++ b/src/gitpod/types/runner_update_params.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "RunnerUpdateParams", + "TheRunnerSNameWhichIsShownToUsers", + "Variant1", + "Variant1Spec", + "Variant1SpecConfiguration", + "Variant1SpecConfigurationConfiguration", + "Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself", + "Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn", + "Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners", +] + + +class TheRunnerSNameWhichIsShownToUsers(TypedDict, total=False): + name: Required[str] + """The runner's name which is shown to users""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1(TypedDict, total=False): + spec: Required[Variant1Spec] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself( + TypedDict, total=False +): + auto_update: Required[Annotated[bool, PropertyInfo(alias="autoUpdate")]] + """auto_update indicates whether the runner should automatically update itself.""" + + +class Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn(TypedDict, total=False): + release_channel: Required[ + Annotated[ + Literal[ + "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST" + ], + PropertyInfo(alias="releaseChannel"), + ] + ] + """The release channel the runner is on""" + + +Variant1SpecConfigurationConfiguration: TypeAlias = Union[ + Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself, + Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn, +] + + +class Variant1SpecConfiguration(TypedDict, total=False): + configuration: Required[Variant1SpecConfigurationConfiguration] + + +class Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners( + TypedDict, total=False +): + desired_phase: Required[ + Annotated[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ], + PropertyInfo(alias="desiredPhase"), + ] + ] + """RunnerPhase represents the phase a runner is in""" + + +Variant1Spec: TypeAlias = Union[ + Variant1SpecConfiguration, + Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners, +] + +RunnerUpdateParams: TypeAlias = Union[TheRunnerSNameWhichIsShownToUsers, Variant1] diff --git a/src/gitpod/types/runner_update_runner_params.py b/src/gitpod/types/runner_update_runner_params.py deleted file mode 100644 index c8750543..00000000 --- a/src/gitpod/types/runner_update_runner_params.py +++ /dev/null @@ -1,90 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict - -from .._utils import PropertyInfo - -__all__ = [ - "RunnerUpdateRunnerParams", - "Name", - "Spec", - "SpecSpec", - "SpecSpecConfiguration", - "SpecSpecConfigurationConfiguration", - "SpecSpecConfigurationConfigurationAutoUpdate", - "SpecSpecConfigurationConfigurationReleaseChannel", - "SpecSpecDesiredPhase", -] - - -class Name(TypedDict, total=False): - name: Required[str] - """The runner's name which is shown to users""" - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Spec(TypedDict, total=False): - spec: Required[SpecSpec] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class SpecSpecConfigurationConfigurationAutoUpdate(TypedDict, total=False): - auto_update: Required[Annotated[bool, PropertyInfo(alias="autoUpdate")]] - """auto_update indicates whether the runner should automatically update itself.""" - - -class SpecSpecConfigurationConfigurationReleaseChannel(TypedDict, total=False): - release_channel: Required[ - Annotated[ - Literal[ - "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST" - ], - PropertyInfo(alias="releaseChannel"), - ] - ] - """The release channel the runner is on""" - - -SpecSpecConfigurationConfiguration: TypeAlias = Union[ - SpecSpecConfigurationConfigurationAutoUpdate, SpecSpecConfigurationConfigurationReleaseChannel -] - - -class SpecSpecConfiguration(TypedDict, total=False): - configuration: Required[SpecSpecConfigurationConfiguration] - - -class SpecSpecDesiredPhase(TypedDict, total=False): - desired_phase: Required[ - Annotated[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ], - PropertyInfo(alias="desiredPhase"), - ] - ] - """RunnerPhase represents the phase a runner is in""" - - -SpecSpec: TypeAlias = Union[SpecSpecConfiguration, SpecSpecDesiredPhase] - -RunnerUpdateRunnerParams: TypeAlias = Union[Name, Spec] diff --git a/src/gitpod/types/runners/__init__.py b/src/gitpod/types/runners/__init__.py index 19b3cdb8..aa750983 100644 --- a/src/gitpod/types/runners/__init__.py +++ b/src/gitpod/types/runners/__init__.py @@ -3,4 +3,11 @@ from __future__ import annotations from .policy_list_params import PolicyListParams as PolicyListParams +from .policy_create_params import PolicyCreateParams as PolicyCreateParams +from .policy_delete_params import PolicyDeleteParams as PolicyDeleteParams from .policy_list_response import PolicyListResponse as PolicyListResponse +from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams +from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse +from .policy_update_response import PolicyUpdateResponse as PolicyUpdateResponse +from .configuration_validate_params import ConfigurationValidateParams as ConfigurationValidateParams +from .configuration_validate_response import ConfigurationValidateResponse as ConfigurationValidateResponse diff --git a/src/gitpod/types/runners/configuration_validate_params.py b/src/gitpod/types/runners/configuration_validate_params.py new file mode 100644 index 00000000..03cc3565 --- /dev/null +++ b/src/gitpod/types/runners/configuration_validate_params.py @@ -0,0 +1,132 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ..._types import Base64FileInput +from ..._utils import PropertyInfo +from ..._models import set_pydantic_config + +__all__ = [ + "ConfigurationValidateParams", + "Variant0", + "Variant0EnvironmentClass", + "Variant0EnvironmentClassConfiguration", + "Variant1", + "Variant1ScmIntegration", + "Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet", + "Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration", + "Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner", +] + + +class Variant0(TypedDict, total=False): + environment_class: Required[Annotated[Variant0EnvironmentClass, PropertyInfo(alias="environmentClass")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant0EnvironmentClassConfiguration(TypedDict, total=False): + key: str + + value: str + + +class Variant0EnvironmentClass(TypedDict, total=False): + id: str + """id is the unique identifier of the environment class""" + + configuration: Iterable[Variant0EnvironmentClassConfiguration] + """configuration describes the configuration of the environment class""" + + description: str + """description is a human readable description of the environment class""" + + display_name: Annotated[str, PropertyInfo(alias="displayName")] + """display_name is the human readable name of the environment class""" + + enabled: bool + """enabled indicates whether the environment class can be used to create + + new environments. + """ + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ + + +class Variant1(TypedDict, total=False): + scm_integration: Required[Annotated[Variant1ScmIntegration, PropertyInfo(alias="scmIntegration")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet( + TypedDict, total=False +): + oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] + """oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_client_secret must also be set. + """ + + +class Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration( + TypedDict, total=False +): + oauth_encrypted_client_secret: Required[ + Annotated[Union[str, Base64FileInput], PropertyInfo(alias="oauthEncryptedClientSecret", format="base64")] + ] + """ + oauth_encrypted_client_secret is the OAuth app's client secret encrypted with + the runner's public key, + + if OAuth is configured. This can be used to e.g. validate an already encrypted + client secret of an existing SCM integration. + """ + + +set_pydantic_config( + Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration, + {"arbitrary_types_allowed": True}, +) + + +class Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner( + TypedDict, total=False +): + oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + """ + oauth_plaintext_client_secret is the OAuth app's client secret in clear text, if + OAuth is configured. + + This can be set to validate any new client secret before it is encrypted and + stored. This value will not be stored and get encrypted with the runner's public + key before passing it to the runner. + """ + + +Variant1ScmIntegration: TypeAlias = Union[ + Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet, + Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration, + Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner, +] + +ConfigurationValidateParams: TypeAlias = Union[Variant0, Variant1] diff --git a/src/gitpod/types/runner_configuration_validate_response.py b/src/gitpod/types/runners/configuration_validate_response.py similarity index 92% rename from src/gitpod/types/runner_configuration_validate_response.py rename to src/gitpod/types/runners/configuration_validate_response.py index 6eb4fccc..a16f6873 100644 --- a/src/gitpod/types/runner_configuration_validate_response.py +++ b/src/gitpod/types/runners/configuration_validate_response.py @@ -5,10 +5,10 @@ from pydantic import Field as FieldInfo -from .._models import BaseModel +from ..._models import BaseModel __all__ = [ - "RunnerConfigurationValidateResponse", + "ConfigurationValidateResponse", "EnvironmentClass", "EnvironmentClassEnvironmentClass", "EnvironmentClassEnvironmentClassDescriptionError", @@ -67,4 +67,4 @@ class ScmIntegration(BaseModel): scm_integration: ScmIntegrationScmIntegration = FieldInfo(alias="scmIntegration") -RunnerConfigurationValidateResponse: TypeAlias = Union[EnvironmentClass, ScmIntegration] +ConfigurationValidateResponse: TypeAlias = Union[EnvironmentClass, ScmIntegration] diff --git a/src/gitpod/types/runner_configurations/__init__.py b/src/gitpod/types/runners/configurations/__init__.py similarity index 58% rename from src/gitpod/types/runner_configurations/__init__.py rename to src/gitpod/types/runners/configurations/__init__.py index bab7e5ce..d614bb27 100644 --- a/src/gitpod/types/runner_configurations/__init__.py +++ b/src/gitpod/types/runners/configurations/__init__.py @@ -2,20 +2,26 @@ from __future__ import annotations +from .schema_retrieve_params import SchemaRetrieveParams as SchemaRetrieveParams +from .schema_retrieve_response import SchemaRetrieveResponse as SchemaRetrieveResponse +from .scm_integration_list_params import ScmIntegrationListParams as ScmIntegrationListParams from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams from .scm_integration_create_params import ScmIntegrationCreateParams as ScmIntegrationCreateParams +from .scm_integration_delete_params import ScmIntegrationDeleteParams as ScmIntegrationDeleteParams +from .scm_integration_list_response import ScmIntegrationListResponse as ScmIntegrationListResponse +from .scm_integration_update_params import ScmIntegrationUpdateParams as ScmIntegrationUpdateParams +from .environment_class_create_params import EnvironmentClassCreateParams as EnvironmentClassCreateParams from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse from .environment_class_update_params import EnvironmentClassUpdateParams as EnvironmentClassUpdateParams from .scm_integration_create_response import ScmIntegrationCreateResponse as ScmIntegrationCreateResponse -from .configuration_schema_create_params import ConfigurationSchemaCreateParams as ConfigurationSchemaCreateParams -from .configuration_schema_create_response import ConfigurationSchemaCreateResponse as ConfigurationSchemaCreateResponse -from .configuration_schema_retrieve_params import ConfigurationSchemaRetrieveParams as ConfigurationSchemaRetrieveParams +from .scm_integration_retrieve_params import ScmIntegrationRetrieveParams as ScmIntegrationRetrieveParams +from .environment_class_create_response import EnvironmentClassCreateResponse as EnvironmentClassCreateResponse +from .environment_class_retrieve_params import EnvironmentClassRetrieveParams as EnvironmentClassRetrieveParams +from .scm_integration_retrieve_response import ScmIntegrationRetrieveResponse as ScmIntegrationRetrieveResponse +from .environment_class_retrieve_response import EnvironmentClassRetrieveResponse as EnvironmentClassRetrieveResponse from .host_authentication_token_list_params import ( HostAuthenticationTokenListParams as HostAuthenticationTokenListParams, ) -from .configuration_schema_retrieve_response import ( - ConfigurationSchemaRetrieveResponse as ConfigurationSchemaRetrieveResponse, -) from .host_authentication_token_create_params import ( HostAuthenticationTokenCreateParams as HostAuthenticationTokenCreateParams, ) diff --git a/src/gitpod/types/runners/configurations/environment_class_create_params.py b/src/gitpod/types/runners/configurations/environment_class_create_params.py new file mode 100644 index 00000000..28287cd2 --- /dev/null +++ b/src/gitpod/types/runners/configurations/environment_class_create_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["EnvironmentClassCreateParams", "Configuration"] + + +class EnvironmentClassCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + configuration: Iterable[Configuration] + + description: str + + display_name: Annotated[str, PropertyInfo(alias="displayName")] + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Configuration(TypedDict, total=False): + key: str + + value: str diff --git a/src/gitpod/types/runners/configurations/environment_class_create_response.py b/src/gitpod/types/runners/configurations/environment_class_create_response.py new file mode 100644 index 00000000..47198a0e --- /dev/null +++ b/src/gitpod/types/runners/configurations/environment_class_create_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["EnvironmentClassCreateResponse"] + + +class EnvironmentClassCreateResponse(BaseModel): + id: Optional[str] = None diff --git a/src/gitpod/types/runners/configurations/environment_class_list_params.py b/src/gitpod/types/runners/configurations/environment_class_list_params.py new file mode 100644 index 00000000..b8aa9293 --- /dev/null +++ b/src/gitpod/types/runners/configurations/environment_class_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["EnvironmentClassListParams"] + + +class EnvironmentClassListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_class_list_response.py b/src/gitpod/types/runners/configurations/environment_class_list_response.py similarity index 98% rename from src/gitpod/types/environment_class_list_response.py rename to src/gitpod/types/runners/configurations/environment_class_list_response.py index d90c6349..1a0b9507 100644 --- a/src/gitpod/types/environment_class_list_response.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from .._models import BaseModel +from ...._models import BaseModel __all__ = ["EnvironmentClassListResponse", "EnvironmentClass", "EnvironmentClassConfiguration", "Pagination"] diff --git a/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py b/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py new file mode 100644 index 00000000..56caf95c --- /dev/null +++ b/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["EnvironmentClassRetrieveParams"] + + +class EnvironmentClassRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py b/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py new file mode 100644 index 00000000..eafeed5c --- /dev/null +++ b/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["EnvironmentClassRetrieveResponse", "EnvironmentClass", "EnvironmentClassConfiguration"] + + +class EnvironmentClassConfiguration(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class EnvironmentClass(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the environment class""" + + configuration: Optional[List[EnvironmentClassConfiguration]] = None + """configuration describes the configuration of the environment class""" + + description: Optional[str] = None + """description is a human readable description of the environment class""" + + display_name: Optional[str] = FieldInfo(alias="displayName", default=None) + """display_name is the human readable name of the environment class""" + + enabled: Optional[bool] = None + """enabled indicates whether the environment class can be used to create + + new environments. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ + + +class EnvironmentClassRetrieveResponse(BaseModel): + environment_class: Optional[EnvironmentClass] = FieldInfo(alias="environmentClass", default=None) diff --git a/src/gitpod/types/runner_configurations/environment_class_update_params.py b/src/gitpod/types/runners/configurations/environment_class_update_params.py similarity index 78% rename from src/gitpod/types/runner_configurations/environment_class_update_params.py rename to src/gitpod/types/runners/configurations/environment_class_update_params.py index f26ca514..7bcfd5fb 100644 --- a/src/gitpod/types/runner_configurations/environment_class_update_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_update_params.py @@ -5,12 +5,12 @@ from typing import Union from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo -__all__ = ["EnvironmentClassUpdateParams", "Description", "DisplayName", "Enabled"] +__all__ = ["EnvironmentClassUpdateParams", "Variant0", "Variant1", "Variant2"] -class Description(TypedDict, total=False): +class Variant0(TypedDict, total=False): description: Required[str] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] @@ -20,7 +20,7 @@ class Description(TypedDict, total=False): """Define the timeout, in ms""" -class DisplayName(TypedDict, total=False): +class Variant1(TypedDict, total=False): display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] @@ -30,7 +30,7 @@ class DisplayName(TypedDict, total=False): """Define the timeout, in ms""" -class Enabled(TypedDict, total=False): +class Variant2(TypedDict, total=False): enabled: Required[bool] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] @@ -40,4 +40,4 @@ class Enabled(TypedDict, total=False): """Define the timeout, in ms""" -EnvironmentClassUpdateParams: TypeAlias = Union[Description, DisplayName, Enabled] +EnvironmentClassUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py new file mode 100644 index 00000000..feba4855 --- /dev/null +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py @@ -0,0 +1,127 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["HostAuthenticationTokenCreateParams"] + + +class HostAuthenticationTokenCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + token: str + + expires_at: Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")] + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + host: str + + refresh_token: Annotated[str, PropertyInfo(alias="refreshToken")] + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + source: Literal[ + "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", + ] + + user_id: Annotated[str, PropertyInfo(alias="userId")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py similarity index 99% rename from src/gitpod/types/runner_configurations/host_authentication_token_create_response.py rename to src/gitpod/types/runners/configurations/host_authentication_token_create_response.py index 490adf7a..f3c4aebd 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_create_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py @@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo -from ..._models import BaseModel +from ...._models import BaseModel __all__ = ["HostAuthenticationTokenCreateResponse", "Token"] diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_delete_params.py similarity index 94% rename from src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py rename to src/gitpod/types/runners/configurations/host_authentication_token_delete_params.py index 05eaa723..cc74f928 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_delete_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_delete_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo __all__ = ["HostAuthenticationTokenDeleteParams"] diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py new file mode 100644 index 00000000..4c46172f --- /dev/null +++ b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["HostAuthenticationTokenListParams"] + + +class HostAuthenticationTokenListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py similarity index 99% rename from src/gitpod/types/runner_configurations/host_authentication_token_list_response.py rename to src/gitpod/types/runners/configurations/host_authentication_token_list_response.py index 7be80fe0..63f9525d 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_list_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py @@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo -from ..._models import BaseModel +from ...._models import BaseModel __all__ = ["HostAuthenticationTokenListResponse", "Pagination", "Token"] diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py new file mode 100644 index 00000000..c0c1092e --- /dev/null +++ b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["HostAuthenticationTokenRetrieveParams"] + + +class HostAuthenticationTokenRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py similarity index 99% rename from src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py rename to src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py index b0f7be16..92fca925 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py @@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo -from ..._models import BaseModel +from ...._models import BaseModel __all__ = ["HostAuthenticationTokenRetrieveResponse", "Token"] diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py similarity index 94% rename from src/gitpod/types/runner_configurations/host_authentication_token_update_params.py rename to src/gitpod/types/runners/configurations/host_authentication_token_update_params.py index eb360a36..9979ef22 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py @@ -6,12 +6,12 @@ from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenUpdateParams", "ExpiresAt", "RefreshToken", "Token"] +__all__ = ["HostAuthenticationTokenUpdateParams", "Variant0", "Variant1", "Variant2"] -class ExpiresAt(TypedDict, total=False): +class Variant0(TypedDict, total=False): expires_at: Required[Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")]] """A Timestamp represents a point in time independent of any time zone or local @@ -111,7 +111,7 @@ class ExpiresAt(TypedDict, total=False): """Define the timeout, in ms""" -class RefreshToken(TypedDict, total=False): +class Variant1(TypedDict, total=False): refresh_token: Required[Annotated[str, PropertyInfo(alias="refreshToken")]] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] @@ -121,7 +121,7 @@ class RefreshToken(TypedDict, total=False): """Define the timeout, in ms""" -class Token(TypedDict, total=False): +class Variant2(TypedDict, total=False): token: Required[str] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] @@ -131,4 +131,4 @@ class Token(TypedDict, total=False): """Define the timeout, in ms""" -HostAuthenticationTokenUpdateParams: TypeAlias = Union[ExpiresAt, RefreshToken, Token] +HostAuthenticationTokenUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/runners/configurations/schema_retrieve_params.py b/src/gitpod/types/runners/configurations/schema_retrieve_params.py new file mode 100644 index 00000000..64bc845d --- /dev/null +++ b/src/gitpod/types/runners/configurations/schema_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["SchemaRetrieveParams"] + + +class SchemaRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py b/src/gitpod/types/runners/configurations/schema_retrieve_response.py similarity index 59% rename from src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py rename to src/gitpod/types/runners/configurations/schema_retrieve_response.py index 52e90527..8ebcad63 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/schema_retrieve_response.py @@ -6,45 +6,45 @@ from pydantic import Field as FieldInfo -from ..._models import BaseModel +from ...._models import BaseModel __all__ = [ - "ConfigurationSchemaRetrieveResponse", + "SchemaRetrieveResponse", "Schema", "SchemaEnvironmentClass", - "SchemaEnvironmentClassBool", - "SchemaEnvironmentClassBoolBool", - "SchemaEnvironmentClassDisplay", - "SchemaEnvironmentClassDisplayDisplay", - "SchemaEnvironmentClassEnum", - "SchemaEnvironmentClassEnumEnum", - "SchemaEnvironmentClassInt", - "SchemaEnvironmentClassIntInt", - "SchemaEnvironmentClassString", - "SchemaEnvironmentClassStringString", + "SchemaEnvironmentClassUnionMember0", + "SchemaEnvironmentClassUnionMember0Bool", + "SchemaEnvironmentClassUnionMember1", + "SchemaEnvironmentClassUnionMember1Display", + "SchemaEnvironmentClassUnionMember2", + "SchemaEnvironmentClassUnionMember2Enum", + "SchemaEnvironmentClassUnionMember3", + "SchemaEnvironmentClassUnionMember3Int", + "SchemaEnvironmentClassUnionMember4", + "SchemaEnvironmentClassUnionMember4String", "SchemaRunnerConfig", - "SchemaRunnerConfigBool", - "SchemaRunnerConfigBoolBool", - "SchemaRunnerConfigDisplay", - "SchemaRunnerConfigDisplayDisplay", - "SchemaRunnerConfigEnum", - "SchemaRunnerConfigEnumEnum", - "SchemaRunnerConfigInt", - "SchemaRunnerConfigIntInt", - "SchemaRunnerConfigString", - "SchemaRunnerConfigStringString", + "SchemaRunnerConfigUnionMember0", + "SchemaRunnerConfigUnionMember0Bool", + "SchemaRunnerConfigUnionMember1", + "SchemaRunnerConfigUnionMember1Display", + "SchemaRunnerConfigUnionMember2", + "SchemaRunnerConfigUnionMember2Enum", + "SchemaRunnerConfigUnionMember3", + "SchemaRunnerConfigUnionMember3Int", + "SchemaRunnerConfigUnionMember4", + "SchemaRunnerConfigUnionMember4String", "SchemaScm", "SchemaScmOAuth", "SchemaScmPat", ] -class SchemaEnvironmentClassBoolBool(BaseModel): +class SchemaEnvironmentClassUnionMember0Bool(BaseModel): default: Optional[bool] = None -class SchemaEnvironmentClassBool(BaseModel): - bool: SchemaEnvironmentClassBoolBool +class SchemaEnvironmentClassUnionMember0(BaseModel): + bool: SchemaEnvironmentClassUnionMember0Bool id: Optional[str] = None @@ -57,12 +57,12 @@ class SchemaEnvironmentClassBool(BaseModel): secret: Optional[builtins.bool] = None -class SchemaEnvironmentClassDisplayDisplay(BaseModel): +class SchemaEnvironmentClassUnionMember1Display(BaseModel): default: Optional[str] = None -class SchemaEnvironmentClassDisplay(BaseModel): - display: SchemaEnvironmentClassDisplayDisplay +class SchemaEnvironmentClassUnionMember1(BaseModel): + display: SchemaEnvironmentClassUnionMember1Display id: Optional[str] = None @@ -75,14 +75,14 @@ class SchemaEnvironmentClassDisplay(BaseModel): secret: Optional[bool] = None -class SchemaEnvironmentClassEnumEnum(BaseModel): +class SchemaEnvironmentClassUnionMember2Enum(BaseModel): default: Optional[str] = None values: Optional[List[str]] = None -class SchemaEnvironmentClassEnum(BaseModel): - enum: SchemaEnvironmentClassEnumEnum +class SchemaEnvironmentClassUnionMember2(BaseModel): + enum: SchemaEnvironmentClassUnionMember2Enum id: Optional[str] = None @@ -95,7 +95,7 @@ class SchemaEnvironmentClassEnum(BaseModel): secret: Optional[bool] = None -class SchemaEnvironmentClassIntInt(BaseModel): +class SchemaEnvironmentClassUnionMember3Int(BaseModel): default: Optional[int] = None max: Optional[int] = None @@ -103,8 +103,8 @@ class SchemaEnvironmentClassIntInt(BaseModel): min: Optional[int] = None -class SchemaEnvironmentClassInt(BaseModel): - int: SchemaEnvironmentClassIntInt +class SchemaEnvironmentClassUnionMember3(BaseModel): + int: SchemaEnvironmentClassUnionMember3Int id: Optional[str] = None @@ -117,14 +117,14 @@ class SchemaEnvironmentClassInt(BaseModel): secret: Optional[bool] = None -class SchemaEnvironmentClassStringString(BaseModel): +class SchemaEnvironmentClassUnionMember4String(BaseModel): default: Optional[str] = None pattern: Optional[str] = None -class SchemaEnvironmentClassString(BaseModel): - string: SchemaEnvironmentClassStringString +class SchemaEnvironmentClassUnionMember4(BaseModel): + string: SchemaEnvironmentClassUnionMember4String id: Optional[str] = None @@ -138,20 +138,20 @@ class SchemaEnvironmentClassString(BaseModel): SchemaEnvironmentClass: TypeAlias = Union[ - SchemaEnvironmentClassBool, - SchemaEnvironmentClassDisplay, - SchemaEnvironmentClassEnum, - SchemaEnvironmentClassInt, - SchemaEnvironmentClassString, + SchemaEnvironmentClassUnionMember0, + SchemaEnvironmentClassUnionMember1, + SchemaEnvironmentClassUnionMember2, + SchemaEnvironmentClassUnionMember3, + SchemaEnvironmentClassUnionMember4, ] -class SchemaRunnerConfigBoolBool(BaseModel): +class SchemaRunnerConfigUnionMember0Bool(BaseModel): default: Optional[bool] = None -class SchemaRunnerConfigBool(BaseModel): - bool: SchemaRunnerConfigBoolBool +class SchemaRunnerConfigUnionMember0(BaseModel): + bool: SchemaRunnerConfigUnionMember0Bool id: Optional[str] = None @@ -164,12 +164,12 @@ class SchemaRunnerConfigBool(BaseModel): secret: Optional[builtins.bool] = None -class SchemaRunnerConfigDisplayDisplay(BaseModel): +class SchemaRunnerConfigUnionMember1Display(BaseModel): default: Optional[str] = None -class SchemaRunnerConfigDisplay(BaseModel): - display: SchemaRunnerConfigDisplayDisplay +class SchemaRunnerConfigUnionMember1(BaseModel): + display: SchemaRunnerConfigUnionMember1Display id: Optional[str] = None @@ -182,14 +182,14 @@ class SchemaRunnerConfigDisplay(BaseModel): secret: Optional[bool] = None -class SchemaRunnerConfigEnumEnum(BaseModel): +class SchemaRunnerConfigUnionMember2Enum(BaseModel): default: Optional[str] = None values: Optional[List[str]] = None -class SchemaRunnerConfigEnum(BaseModel): - enum: SchemaRunnerConfigEnumEnum +class SchemaRunnerConfigUnionMember2(BaseModel): + enum: SchemaRunnerConfigUnionMember2Enum id: Optional[str] = None @@ -202,7 +202,7 @@ class SchemaRunnerConfigEnum(BaseModel): secret: Optional[bool] = None -class SchemaRunnerConfigIntInt(BaseModel): +class SchemaRunnerConfigUnionMember3Int(BaseModel): default: Optional[int] = None max: Optional[int] = None @@ -210,8 +210,8 @@ class SchemaRunnerConfigIntInt(BaseModel): min: Optional[int] = None -class SchemaRunnerConfigInt(BaseModel): - int: SchemaRunnerConfigIntInt +class SchemaRunnerConfigUnionMember3(BaseModel): + int: SchemaRunnerConfigUnionMember3Int id: Optional[str] = None @@ -224,14 +224,14 @@ class SchemaRunnerConfigInt(BaseModel): secret: Optional[bool] = None -class SchemaRunnerConfigStringString(BaseModel): +class SchemaRunnerConfigUnionMember4String(BaseModel): default: Optional[str] = None pattern: Optional[str] = None -class SchemaRunnerConfigString(BaseModel): - string: SchemaRunnerConfigStringString +class SchemaRunnerConfigUnionMember4(BaseModel): + string: SchemaRunnerConfigUnionMember4String id: Optional[str] = None @@ -245,11 +245,11 @@ class SchemaRunnerConfigString(BaseModel): SchemaRunnerConfig: TypeAlias = Union[ - SchemaRunnerConfigBool, - SchemaRunnerConfigDisplay, - SchemaRunnerConfigEnum, - SchemaRunnerConfigInt, - SchemaRunnerConfigString, + SchemaRunnerConfigUnionMember0, + SchemaRunnerConfigUnionMember1, + SchemaRunnerConfigUnionMember2, + SchemaRunnerConfigUnionMember3, + SchemaRunnerConfigUnionMember4, ] @@ -295,5 +295,5 @@ class Schema(BaseModel): """The schema version""" -class ConfigurationSchemaRetrieveResponse(BaseModel): +class SchemaRetrieveResponse(BaseModel): schema_: Optional[Schema] = FieldInfo(alias="schema", default=None) diff --git a/src/gitpod/types/runner_configurations/scm_integration_create_params.py b/src/gitpod/types/runners/configurations/scm_integration_create_params.py similarity index 58% rename from src/gitpod/types/runner_configurations/scm_integration_create_params.py rename to src/gitpod/types/runners/configurations/scm_integration_create_params.py index d32fee9d..fad0a6b8 100644 --- a/src/gitpod/types/runner_configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_create_params.py @@ -5,12 +5,18 @@ from typing import Union from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from ..._utils import PropertyInfo +from ...._utils import PropertyInfo -__all__ = ["ScmIntegrationCreateParams", "OAuthClientID", "OAuthPlaintextClientSecret"] +__all__ = [ + "ScmIntegrationCreateParams", + "OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet", + "OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored", +] -class OAuthClientID(TypedDict, total=False): +class OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet( + TypedDict, total=False +): oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] """oauth_client_id is the OAuth app's client ID, if OAuth is configured. @@ -24,7 +30,9 @@ class OAuthClientID(TypedDict, total=False): """Define the timeout, in ms""" -class OAuthPlaintextClientSecret(TypedDict, total=False): +class OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( + TypedDict, total=False +): oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] """oauth_plaintext_client_secret is the OAuth app's client secret in clear text. @@ -38,4 +46,7 @@ class OAuthPlaintextClientSecret(TypedDict, total=False): """Define the timeout, in ms""" -ScmIntegrationCreateParams: TypeAlias = Union[OAuthClientID, OAuthPlaintextClientSecret] +ScmIntegrationCreateParams: TypeAlias = Union[ + OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet, + OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored, +] diff --git a/src/gitpod/types/runner_configurations/scm_integration_create_response.py b/src/gitpod/types/runners/configurations/scm_integration_create_response.py similarity index 90% rename from src/gitpod/types/runner_configurations/scm_integration_create_response.py rename to src/gitpod/types/runners/configurations/scm_integration_create_response.py index c2a3461f..b71bc665 100644 --- a/src/gitpod/types/runner_configurations/scm_integration_create_response.py +++ b/src/gitpod/types/runners/configurations/scm_integration_create_response.py @@ -2,7 +2,7 @@ from typing import Optional -from ..._models import BaseModel +from ...._models import BaseModel __all__ = ["ScmIntegrationCreateResponse"] diff --git a/src/gitpod/types/environments/automations/task_execution_stop_params.py b/src/gitpod/types/runners/configurations/scm_integration_delete_params.py similarity index 84% rename from src/gitpod/types/environments/automations/task_execution_stop_params.py rename to src/gitpod/types/runners/configurations/scm_integration_delete_params.py index eeb7a922..7fb7d75e 100644 --- a/src/gitpod/types/environments/automations/task_execution_stop_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_delete_params.py @@ -6,10 +6,10 @@ from ...._utils import PropertyInfo -__all__ = ["TaskExecutionStopParams"] +__all__ = ["ScmIntegrationDeleteParams"] -class TaskExecutionStopParams(TypedDict, total=False): +class ScmIntegrationDeleteParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_params.py b/src/gitpod/types/runners/configurations/scm_integration_list_params.py new file mode 100644 index 00000000..53cababc --- /dev/null +++ b/src/gitpod/types/runners/configurations/scm_integration_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["ScmIntegrationListParams"] + + +class ScmIntegrationListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_response.py b/src/gitpod/types/runners/configurations/scm_integration_list_response.py new file mode 100644 index 00000000..7b1fc5e7 --- /dev/null +++ b/src/gitpod/types/runners/configurations/scm_integration_list_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["ScmIntegrationListResponse", "Integration", "IntegrationOAuth", "Pagination"] + + +class IntegrationOAuth(BaseModel): + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + """client_id is the OAuth app's client ID in clear text.""" + + encrypted_client_secret: Optional[str] = FieldInfo(alias="encryptedClientSecret", default=None) + """ + encrypted_client_secret is the OAuth app's secret encrypted with the runner's + public key. + """ + + +class Integration(BaseModel): + oauth: IntegrationOAuth + + id: Optional[str] = None + """id is the unique identifier of the SCM integration""" + + host: Optional[str] = None + + pat: Optional[bool] = None + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + """ + scm_id references the scm_id in the runner's configuration schema that this + integration is for + """ + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class ScmIntegrationListResponse(BaseModel): + integrations: Optional[List[Integration]] = None + + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing scm integrations""" diff --git a/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py b/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py new file mode 100644 index 00000000..4f26afc1 --- /dev/null +++ b/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["ScmIntegrationRetrieveParams"] + + +class ScmIntegrationRetrieveParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py b/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py new file mode 100644 index 00000000..619b46da --- /dev/null +++ b/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["ScmIntegrationRetrieveResponse", "Integration", "IntegrationOAuth"] + + +class IntegrationOAuth(BaseModel): + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + """client_id is the OAuth app's client ID in clear text.""" + + encrypted_client_secret: Optional[str] = FieldInfo(alias="encryptedClientSecret", default=None) + """ + encrypted_client_secret is the OAuth app's secret encrypted with the runner's + public key. + """ + + +class Integration(BaseModel): + oauth: IntegrationOAuth + + +class ScmIntegrationRetrieveResponse(BaseModel): + integration: Optional[Integration] = None diff --git a/src/gitpod/types/runners/configurations/scm_integration_update_params.py b/src/gitpod/types/runners/configurations/scm_integration_update_params.py new file mode 100644 index 00000000..00c0d0f9 --- /dev/null +++ b/src/gitpod/types/runners/configurations/scm_integration_update_params.py @@ -0,0 +1,80 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ...._utils import PropertyInfo + +__all__ = [ + "ScmIntegrationUpdateParams", + "OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate", + "OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored", + "PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate", +] + + +class OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate( + TypedDict, total=False +): + oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] + """oauth_client_id can be set to update the OAuth app's client ID. + + If an empty string is set, the OAuth configuration will be removed (regardless + of whether a client secret is set), and any existing Host Authentication Tokens + for the SCM integration's runner and host that were created using the OAuth app + will be deleted. This might lead to users being unable to access their + repositories until they re-authenticate. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( + TypedDict, total=False +): + oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + """ + oauth_plaintext_client_secret can be set to update the OAuth app's client + secret. + + The cleartext secret will be encrypted with the runner's public key before being + stored. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate( + TypedDict, total=False +): + pat: Required[bool] + """pat can be set to enable or disable Personal Access Tokens support. + + When disabling PATs, any existing Host Authentication Tokens for the SCM + integration's runner and host that were created using a PAT will be deleted. + This might lead to users being unable to access their repositories until they + re-authenticate. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +ScmIntegrationUpdateParams: TypeAlias = Union[ + OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate, + OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored, + PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate, +] diff --git a/src/gitpod/types/runners/policy_create_params.py b/src/gitpod/types/runners/policy_create_params.py new file mode 100644 index 00000000..b0c6aa65 --- /dev/null +++ b/src/gitpod/types/runners/policy_create_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PolicyCreateParams"] + + +class PolicyCreateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + """group_id specifies the group_id identifier""" + + role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """runner_id specifies the project identifier""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/policy_create_response.py b/src/gitpod/types/runners/policy_create_response.py new file mode 100644 index 00000000..5ab2ef21 --- /dev/null +++ b/src/gitpod/types/runners/policy_create_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["PolicyCreateResponse", "Policy"] + + +class Policy(BaseModel): + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + + role: Optional[Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"]] = None + """role is the role assigned to the group""" + + +class PolicyCreateResponse(BaseModel): + policy: Optional[Policy] = None diff --git a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py b/src/gitpod/types/runners/policy_delete_params.py similarity index 69% rename from src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py rename to src/gitpod/types/runners/policy_delete_params.py index d8ca6699..0f6af171 100644 --- a/src/gitpod/types/runner_configurations/configuration_schema_retrieve_params.py +++ b/src/gitpod/types/runners/policy_delete_params.py @@ -6,14 +6,18 @@ from ..._utils import PropertyInfo -__all__ = ["ConfigurationSchemaRetrieveParams"] +__all__ = ["PolicyDeleteParams"] -class ConfigurationSchemaRetrieveParams(TypedDict, total=False): +class PolicyDeleteParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + group_id: Annotated[str, PropertyInfo(alias="groupId")] + """group_id specifies the group_id identifier""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """runner_id specifies the project identifier""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/policy_list_params.py b/src/gitpod/types/runners/policy_list_params.py index af0ca922..527570b7 100644 --- a/src/gitpod/types/runners/policy_list_params.py +++ b/src/gitpod/types/runners/policy_list_params.py @@ -6,32 +6,29 @@ from ..._utils import PropertyInfo -__all__ = ["PolicyListParams", "Pagination"] +__all__ = ["PolicyListParams"] class PolicyListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - pagination: Pagination - """pagination contains the pagination options for listing project policies""" - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """runner_id specifies the project identifier""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ -class Pagination(TypedDict, total=False): - token: str - """Token for the next set of results that was returned as next_token of a + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" - PaginationResponse - """ + connect: Literal["v1"] + """Define the version of the Connect protocol""" - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. + message: str - Maximum 100. - """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/policy_update_params.py b/src/gitpod/types/runners/policy_update_params.py new file mode 100644 index 00000000..b8e23b90 --- /dev/null +++ b/src/gitpod/types/runners/policy_update_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PolicyUpdateParams"] + + +class PolicyUpdateParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + """group_id specifies the group_id identifier""" + + role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """runner_id specifies the project identifier""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/policy_update_response.py b/src/gitpod/types/runners/policy_update_response.py new file mode 100644 index 00000000..15e39185 --- /dev/null +++ b/src/gitpod/types/runners/policy_update_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["PolicyUpdateResponse", "Policy"] + + +class Policy(BaseModel): + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + + role: Optional[Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"]] = None + """role is the role assigned to the group""" + + +class PolicyUpdateResponse(BaseModel): + policy: Optional[Policy] = None diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py new file mode 100644 index 00000000..ea4f7a10 --- /dev/null +++ b/src/gitpod/types/secret_create_params.py @@ -0,0 +1,67 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "SecretCreateParams", + "SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", + "AbsolutePathToTheFileWhereTheSecretIsMounted", +] + + +class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(TypedDict, total=False): + environment_variable: Required[Annotated[bool, PropertyInfo(alias="environmentVariable")]] + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + name: str + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id is the ProjectID this Secret belongs to""" + + value: str + """value is the plaintext value of the secret""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): + file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] + """ + absolute path to the file where the secret is mounted value must be an absolute + path (start with a /): + + ``` + this.matches('^/(?:[^/]*/)*.*$') + ``` + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + name: str + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id is the ProjectID this Secret belongs to""" + + value: str + """value is the plaintext value of the secret""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +SecretCreateParams: TypeAlias = Union[ + SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, AbsolutePathToTheFileWhereTheSecretIsMounted +] diff --git a/src/gitpod/types/secret_create_response.py b/src/gitpod/types/secret_create_response.py new file mode 100644 index 00000000..53a103b2 --- /dev/null +++ b/src/gitpod/types/secret_create_response.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "SecretCreateResponse", + "Secret", + "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", + "SecretAbsolutePathToTheFileWhereTheSecretIsMounted", +] + + +class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): + environment_variable: bool = FieldInfo(alias="environmentVariable") + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + + +class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): + file_path: str = FieldInfo(alias="filePath") + """absolute path to the file where the secret is mounted""" + + +Secret: TypeAlias = Union[ + SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, + SecretAbsolutePathToTheFileWhereTheSecretIsMounted, +] + + +class SecretCreateResponse(BaseModel): + secret: Optional[Secret] = None diff --git a/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py b/src/gitpod/types/secret_delete_params.py similarity index 72% rename from src/gitpod/types/runner_configurations/host_authentication_token_create_params.py rename to src/gitpod/types/secret_delete_params.py index fb34ff72..c7cd3adc 100644 --- a/src/gitpod/types/runner_configurations/host_authentication_token_create_params.py +++ b/src/gitpod/types/secret_delete_params.py @@ -4,16 +4,16 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from .._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenCreateParams"] +__all__ = ["SecretDeleteParams"] -class HostAuthenticationTokenCreateParams(TypedDict, total=False): +class SecretDeleteParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - id: str + secret_id: Annotated[str, PropertyInfo(alias="secretId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/secret_get_value_params.py b/src/gitpod/types/secret_get_value_params.py new file mode 100644 index 00000000..7b5a866c --- /dev/null +++ b/src/gitpod/types/secret_get_value_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["SecretGetValueParams"] + + +class SecretGetValueParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/secret_get_value_response.py b/src/gitpod/types/secret_get_value_response.py new file mode 100644 index 00000000..80a70acb --- /dev/null +++ b/src/gitpod/types/secret_get_value_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["SecretGetValueResponse"] + + +class SecretGetValueResponse(BaseModel): + value: Optional[str] = None diff --git a/src/gitpod/types/secret_list_params.py b/src/gitpod/types/secret_list_params.py new file mode 100644 index 00000000..e546a631 --- /dev/null +++ b/src/gitpod/types/secret_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["SecretListParams"] + + +class SecretListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/secret_list_response.py b/src/gitpod/types/secret_list_response.py new file mode 100644 index 00000000..7bbbf133 --- /dev/null +++ b/src/gitpod/types/secret_list_response.py @@ -0,0 +1,477 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "SecretListResponse", + "Pagination", + "Secret", + "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", + "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator", + "SecretAbsolutePathToTheFileWhereTheSecretIsMounted", + "SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator", +] + + +class Pagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retreiving the next set of results. Empty if there are no + + more results + """ + + +class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): + environment_variable: bool = FieldInfo(alias="environmentVariable") + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator] = None + """creator is the identity of the creator of the secret""" + + name: Optional[str] = None + """Name of the secret for humans.""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """The Project ID this Secret belongs to""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): + file_path: str = FieldInfo(alias="filePath") + """absolute path to the file where the secret is mounted""" + + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator] = None + """creator is the identity of the creator of the secret""" + + name: Optional[str] = None + """Name of the secret for humans.""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """The Project ID this Secret belongs to""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +Secret: TypeAlias = Union[ + SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, + SecretAbsolutePathToTheFileWhereTheSecretIsMounted, +] + + +class SecretListResponse(BaseModel): + pagination: Optional[Pagination] = None + """pagination contains the pagination options for listing secrets""" + + secrets: Optional[List[Secret]] = None diff --git a/src/gitpod/types/secret_update_value_params.py b/src/gitpod/types/secret_update_value_params.py new file mode 100644 index 00000000..a38e7c44 --- /dev/null +++ b/src/gitpod/types/secret_update_value_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["SecretUpdateValueParams"] + + +class SecretUpdateValueParams(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + secret_id: Annotated[str, PropertyInfo(alias="secretId")] + + value: str + """value is the plaintext value of the secret""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/user_get_authenticated_user_params.py b/src/gitpod/types/user_get_authenticated_user_params.py new file mode 100644 index 00000000..010f08d3 --- /dev/null +++ b/src/gitpod/types/user_get_authenticated_user_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["UserGetAuthenticatedUserParams"] + + +class UserGetAuthenticatedUserParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/user_get_authenticated_user_response.py b/src/gitpod/types/user_get_authenticated_user_response.py new file mode 100644 index 00000000..7b2d2f9e --- /dev/null +++ b/src/gitpod/types/user_get_authenticated_user_response.py @@ -0,0 +1,129 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["UserGetAuthenticatedUserResponse", "User"] + + +class User(BaseModel): + id: Optional[str] = None + """id is a UUID of the user""" + + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + """avatar_url is a link to the user avatar""" + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + name: Optional[str] = None + """name is the full name of the user""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the id of the organization this account is owned by. + + +optional if not set, this account is owned by the installation. + """ + + status: Optional[ + Literal["USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT"] + ] = None + """status is the status the user is in""" + + +class UserGetAuthenticatedUserResponse(BaseModel): + user: Optional[User] = None diff --git a/src/gitpod/types/organizations/invite/summary_retrieve_params.py b/src/gitpod/types/user_set_suspended_params.py similarity index 70% rename from src/gitpod/types/organizations/invite/summary_retrieve_params.py rename to src/gitpod/types/user_set_suspended_params.py index 86f4793d..a3719c44 100644 --- a/src/gitpod/types/organizations/invite/summary_retrieve_params.py +++ b/src/gitpod/types/user_set_suspended_params.py @@ -4,16 +4,18 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ...._utils import PropertyInfo +from .._utils import PropertyInfo -__all__ = ["SummaryRetrieveParams"] +__all__ = ["UserSetSuspendedParams"] -class SummaryRetrieveParams(TypedDict, total=False): +class UserSetSuspendedParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - invite_id: Annotated[str, PropertyInfo(alias="inviteId")] + suspended: bool + + user_id: Annotated[str, PropertyInfo(alias="userId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/users/__init__.py b/src/gitpod/types/users/__init__.py new file mode 100644 index 00000000..c5d40ad2 --- /dev/null +++ b/src/gitpod/types/users/__init__.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .pat_get_params import PatGetParams as PatGetParams +from .pat_list_params import PatListParams as PatListParams +from .pat_get_response import PatGetResponse as PatGetResponse +from .pat_delete_params import PatDeleteParams as PatDeleteParams +from .pat_list_response import PatListResponse as PatListResponse diff --git a/src/gitpod/types/personal_access_token_delete_params.py b/src/gitpod/types/users/pat_delete_params.py similarity index 79% rename from src/gitpod/types/personal_access_token_delete_params.py rename to src/gitpod/types/users/pat_delete_params.py index 39d64414..f307dac3 100644 --- a/src/gitpod/types/personal_access_token_delete_params.py +++ b/src/gitpod/types/users/pat_delete_params.py @@ -4,12 +4,12 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from .._utils import PropertyInfo +from ..._utils import PropertyInfo -__all__ = ["PersonalAccessTokenDeleteParams"] +__all__ = ["PatDeleteParams"] -class PersonalAccessTokenDeleteParams(TypedDict, total=False): +class PatDeleteParams(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" diff --git a/src/gitpod/types/users/pat_get_params.py b/src/gitpod/types/users/pat_get_params.py new file mode 100644 index 00000000..bad3d238 --- /dev/null +++ b/src/gitpod/types/users/pat_get_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PatGetParams"] + + +class PatGetParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_get_runner_response.py b/src/gitpod/types/users/pat_get_response.py similarity index 76% rename from src/gitpod/types/runner_get_runner_response.py rename to src/gitpod/types/users/pat_get_response.py index cda7e27b..8b468808 100644 --- a/src/gitpod/types/runner_get_runner_response.py +++ b/src/gitpod/types/users/pat_get_response.py @@ -1,25 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from typing_extensions import Literal from pydantic import Field as FieldInfo -from .._models import BaseModel +from ..._models import BaseModel -__all__ = [ - "RunnerGetRunnerResponse", - "Runner", - "RunnerCreator", - "RunnerSpec", - "RunnerSpecConfiguration", - "RunnerStatus", - "RunnerStatusAdditionalInfo", -] +__all__ = ["PatGetResponse", "Pat", "PatCreator"] -class RunnerCreator(BaseModel): +class PatCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -36,86 +28,10 @@ class RunnerCreator(BaseModel): """Principal is the principal of the subject""" -class RunnerSpecConfiguration(BaseModel): - auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) - """auto_update indicates whether the runner should automatically update itself.""" - - region: Optional[str] = None - """ - Region to deploy the runner in, if applicable. This is mainly used for remote - runners, and is only a hint. The runner may be deployed in a different region. - See the runner's status for the actual region. - """ - - release_channel: Optional[ - Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] - ] = FieldInfo(alias="releaseChannel", default=None) - """The release channel the runner is on""" - - -class RunnerSpec(BaseModel): - configuration: Optional[RunnerSpecConfiguration] = None - """The runner's configuration""" - - desired_phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """RunnerPhase represents the phase a runner is in""" - - -class RunnerStatusAdditionalInfo(BaseModel): - key: Optional[str] = None - - value: Optional[str] = None - - -class RunnerStatus(BaseModel): - additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) - """additional_info contains additional information about the runner, e.g. - - a CloudFormation stack URL. - """ - - capabilities: Optional[ - List[Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"]] - ] = None - """capabilities is a list of capabilities the runner supports.""" - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - - message: Optional[str] = None - """ - The runner's reported message which is shown to users. This message adds more - context to the runner's phase. - """ - - phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = None - """RunnerPhase represents the phase a runner is in""" - - region: Optional[str] = None - """region is the region the runner is running in, if applicable.""" - - system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) +class Pat(BaseModel): + id: Optional[str] = None - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -207,11 +123,11 @@ class RunnerStatus(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - version: Optional[str] = None + creator: Optional[PatCreator] = None + description: Optional[str] = None -class Runner(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) """A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -303,26 +219,7 @@ class Runner(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[RunnerCreator] = None - """creator is the identity of the creator of the environment""" - - kind: Optional[ - Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] - ] = None - """RunnerKind represents the kind of a runner""" - - name: Optional[str] = None - """The runner's name which is shown to users""" - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - spec: Optional[RunnerSpec] = None - """The runner's specification""" - - status: Optional[RunnerStatus] = None - """RunnerStatus represents the status of a runner""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + last_used: Optional[datetime] = FieldInfo(alias="lastUsed", default=None) """A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -414,6 +311,8 @@ class Runner(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + -class RunnerGetRunnerResponse(BaseModel): - runner: Optional[Runner] = None +class PatGetResponse(BaseModel): + pat: Optional[Pat] = None diff --git a/src/gitpod/types/users/pat_list_params.py b/src/gitpod/types/users/pat_list_params.py new file mode 100644 index 00000000..a28b33ed --- /dev/null +++ b/src/gitpod/types/users/pat_list_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PatListParams"] + + +class PatListParams(TypedDict, total=False): + encoding: Required[Literal["proto", "json"]] + """Define which encoding or 'Message-Codec' to use""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + base64: bool + """ + Specifies if the message query param is base64 encoded, which may be required + for binary data + """ + + compression: Literal["identity", "gzip", "br"] + """Which compression algorithm to use for this request""" + + connect: Literal["v1"] + """Define the version of the Connect protocol""" + + message: str + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" diff --git a/src/gitpod/types/personal_access_token_list_response.py b/src/gitpod/types/users/pat_list_response.py similarity index 98% rename from src/gitpod/types/personal_access_token_list_response.py rename to src/gitpod/types/users/pat_list_response.py index 4b755efb..944942ee 100644 --- a/src/gitpod/types/personal_access_token_list_response.py +++ b/src/gitpod/types/users/pat_list_response.py @@ -6,9 +6,9 @@ from pydantic import Field as FieldInfo -from .._models import BaseModel +from ..._models import BaseModel -__all__ = ["PersonalAccessTokenListResponse", "Pagination", "PersonalAccessToken", "PersonalAccessTokenCreator"] +__all__ = ["PatListResponse", "Pagination", "PersonalAccessToken", "PersonalAccessTokenCreator"] class Pagination(BaseModel): @@ -322,7 +322,7 @@ class PersonalAccessToken(BaseModel): user_id: Optional[str] = FieldInfo(alias="userId", default=None) -class PersonalAccessTokenListResponse(BaseModel): +class PatListResponse(BaseModel): pagination: Optional[Pagination] = None personal_access_tokens: Optional[List[PersonalAccessToken]] = FieldInfo(alias="personalAccessTokens", default=None) diff --git a/tests/api_resources/organizations/invite/__init__.py b/tests/api_resources/environments/automations/tasks/__init__.py similarity index 100% rename from tests/api_resources/organizations/invite/__init__.py rename to tests/api_resources/environments/automations/tasks/__init__.py diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py new file mode 100644 index 00000000..2f9f5614 --- /dev/null +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -0,0 +1,293 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.environments.automations.tasks import ( + ExecutionListResponse, + ExecutionRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestExecutions: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + execution = client.environments.automations.tasks.executions.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + execution = client.environments.automations.tasks.executions.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.environments.automations.tasks.executions.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.environments.automations.tasks.executions.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + execution = client.environments.automations.tasks.executions.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + execution = client.environments.automations.tasks.executions.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.environments.automations.tasks.executions.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(ExecutionListResponse, execution, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.environments.automations.tasks.executions.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(ExecutionListResponse, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_stop(self, client: Gitpod) -> None: + execution = client.environments.automations.tasks.executions.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, execution, path=["response"]) + + @parametrize + def test_method_stop_with_all_params(self, client: Gitpod) -> None: + execution = client.environments.automations.tasks.executions.stop( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, execution, path=["response"]) + + @parametrize + def test_raw_response_stop(self, client: Gitpod) -> None: + response = client.environments.automations.tasks.executions.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(object, execution, path=["response"]) + + @parametrize + def test_streaming_response_stop(self, client: Gitpod) -> None: + with client.environments.automations.tasks.executions.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(object, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncExecutions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + execution = await async_client.environments.automations.tasks.executions.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + execution = await async_client.environments.automations.tasks.executions.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.tasks.executions.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + execution = await async_client.environments.automations.tasks.executions.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + execution = await async_client.environments.automations.tasks.executions.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.tasks.executions.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(ExecutionListResponse, execution, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.tasks.executions.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(ExecutionListResponse, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_stop(self, async_client: AsyncGitpod) -> None: + execution = await async_client.environments.automations.tasks.executions.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, execution, path=["response"]) + + @parametrize + async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: + execution = await async_client.environments.automations.tasks.executions.stop( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, execution, path=["response"]) + + @parametrize + async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.tasks.executions.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(object, execution, path=["response"]) + + @parametrize + async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.tasks.executions.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(object, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 338ad174..d523efc0 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -9,8 +9,11 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod._utils import parse_datetime from gitpod.types.environments.automations import ( ServiceListResponse, + ServiceCreateResponse, + ServiceRetrieveResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,6 +22,120 @@ class TestServices: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_create(self, client: Gitpod) -> None: + service = client.environments.automations.services.create( + connect_protocol_version=1, + ) + assert_matches_type(ServiceCreateResponse, service, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + service = client.environments.automations.services.create( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={ + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "creator": { + "id": "id", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "description": "description", + "name": "x", + "reference": "reference", + "triggered_by": [{"manual": True}], + }, + spec={ + "commands": { + "ready": "ready", + "start": "x", + "stop": "stop", + }, + "desired_phase": "SERVICE_PHASE_UNSPECIFIED", + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, + "session": "session", + "spec_version": "specVersion", + }, + connect_timeout_ms=0, + ) + assert_matches_type(ServiceCreateResponse, service, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.environments.automations.services.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = response.parse() + assert_matches_type(ServiceCreateResponse, service, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.environments.automations.services.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = response.parse() + assert_matches_type(ServiceCreateResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + service = client.environments.automations.services.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + service = client.environments.automations.services.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.environments.automations.services.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = response.parse() + assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.environments.automations.services.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = response.parse() + assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_update(self, client: Gitpod) -> None: service = client.environments.automations.services.update( @@ -65,6 +182,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: service = client.environments.automations.services.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(ServiceListResponse, service, path=["response"]) @@ -72,16 +190,12 @@ def test_method_list(self, client: Gitpod) -> None: @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.list( + encoding="proto", connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], - "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - }, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(ServiceListResponse, service, path=["response"]) @@ -89,6 +203,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -100,6 +215,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -235,6 +351,120 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncServices: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + service = await async_client.environments.automations.services.create( + connect_protocol_version=1, + ) + assert_matches_type(ServiceCreateResponse, service, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + service = await async_client.environments.automations.services.create( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={ + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "creator": { + "id": "id", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "description": "description", + "name": "x", + "reference": "reference", + "triggered_by": [{"manual": True}], + }, + spec={ + "commands": { + "ready": "ready", + "start": "x", + "stop": "stop", + }, + "desired_phase": "SERVICE_PHASE_UNSPECIFIED", + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, + "session": "session", + "spec_version": "specVersion", + }, + connect_timeout_ms=0, + ) + assert_matches_type(ServiceCreateResponse, service, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.services.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = await response.parse() + assert_matches_type(ServiceCreateResponse, service, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.services.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = await response.parse() + assert_matches_type(ServiceCreateResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + service = await async_client.environments.automations.services.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + service = await async_client.environments.automations.services.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.automations.services.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service = await response.parse() + assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.automations.services.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service = await response.parse() + assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( @@ -281,6 +511,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(ServiceListResponse, service, path=["response"]) @@ -288,16 +519,12 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( + encoding="proto", connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], - "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - }, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(ServiceListResponse, service, path=["response"]) @@ -305,6 +532,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -316,6 +544,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/environments/automations/test_task_executions.py b/tests/api_resources/environments/automations/test_task_executions.py deleted file mode 100644 index f7d63563..00000000 --- a/tests/api_resources/environments/automations/test_task_executions.py +++ /dev/null @@ -1,463 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types.environments.automations import ( - TaskExecutionListResponse, - TaskExecutionRetrieveResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestTaskExecutions: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.retrieve( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.list( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.list( - connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], - "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "task_references": ["string"], - }, - pagination={ - "token": "token", - "page_size": 100, - }, - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_stop(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.stop( - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_method_stop_with_all_params(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.stop( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.stop( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_task_execution_status_overload_1(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_method_update_task_execution_status_with_all_params_overload_1(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_raw_response_update_task_execution_status_overload_1(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_update_task_execution_status_overload_1(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_task_execution_status_overload_2(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_method_update_task_execution_status_with_all_params_overload_2(self, client: Gitpod) -> None: - task_execution = client.environments.automations.task_executions.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_raw_response_update_task_execution_status_overload_2(self, client: Gitpod) -> None: - response = client.environments.automations.task_executions.with_raw_response.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - def test_streaming_response_update_task_execution_status_overload_2(self, client: Gitpod) -> None: - with client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncTaskExecutions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.retrieve( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.task_executions.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(TaskExecutionRetrieveResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.list( - connect_protocol_version=1, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.list( - connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], - "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "task_references": ["string"], - }, - pagination={ - "token": "token", - "page_size": 100, - }, - connect_timeout_ms=0, - ) - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.task_executions.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(TaskExecutionListResponse, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_stop(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.stop( - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.stop( - connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.task_executions.with_raw_response.stop( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_method_update_task_execution_status_with_all_params_overload_1( - self, async_client: AsyncGitpod - ) -> None: - task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: - response = ( - await async_client.environments.automations.task_executions.with_raw_response.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - ) - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_update_task_execution_status_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( - failure_message="failureMessage", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: - task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_method_update_task_execution_status_with_all_params_overload_2( - self, async_client: AsyncGitpod - ) -> None: - task_execution = await async_client.environments.automations.task_executions.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_raw_response_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: - response = ( - await async_client.environments.automations.task_executions.with_raw_response.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - ) - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - @parametrize - async def test_streaming_response_update_task_execution_status_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.task_executions.with_streaming_response.update_task_execution_status( - log_url="logUrl", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task_execution = await response.parse() - assert_matches_type(object, task_execution, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index febb4ef9..1ccf9ffa 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -87,6 +87,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -94,8 +95,12 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( + encoding="proto", connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -103,6 +108,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -114,6 +120,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -170,6 +177,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(TaskListResponse, task, path=["response"]) @@ -177,16 +185,12 @@ def test_method_list(self, client: Gitpod) -> None: @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( + encoding="proto", connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], - "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - }, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(TaskListResponse, task, path=["response"]) @@ -194,6 +198,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -205,6 +210,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -363,6 +369,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -370,8 +377,12 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( + encoding="proto", connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -379,6 +390,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -390,6 +402,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -446,6 +459,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(TaskListResponse, task, path=["response"]) @@ -453,16 +467,12 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( + encoding="proto", connect_protocol_version=1, - filter={ - "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], - "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - }, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(TaskListResponse, task, path=["response"]) @@ -470,6 +480,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -481,6 +492,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_environment_classes.py b/tests/api_resources/environments/test_classes.py similarity index 54% rename from tests/api_resources/test_environment_classes.py rename to tests/api_resources/environments/test_classes.py index 8ee23ac0..861d3bb2 100644 --- a/tests/api_resources/test_environment_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -9,102 +9,108 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import EnvironmentClassListResponse +from gitpod.types.environments import ClassListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestEnvironmentClasses: +class TestClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_list(self, client: Gitpod) -> None: - environment_class = client.environment_classes.list( + class_ = client.environments.classes.list( + encoding="proto", connect_protocol_version=1, ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: - environment_class = client.environment_classes.list( + class_ = client.environments.classes.list( + encoding="proto", connect_protocol_version=1, - filter={"enabled": True}, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environment_classes.with_raw_response.list( + response = client.environments.classes.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + class_ = response.parse() + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environment_classes.with_streaming_response.list( + with client.environments.classes.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + class_ = response.parse() + assert_matches_type(ClassListResponse, class_, path=["response"]) assert cast(Any, response.is_closed) is True -class TestAsyncEnvironmentClasses: +class TestAsyncClasses: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.environment_classes.list( + class_ = await async_client.environments.classes.list( + encoding="proto", connect_protocol_version=1, ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.environment_classes.list( + class_ = await async_client.environments.classes.list( + encoding="proto", connect_protocol_version=1, - filter={"enabled": True}, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environment_classes.with_raw_response.list( + response = await async_client.environments.classes.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = await response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + class_ = await response.parse() + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environment_classes.with_streaming_response.list( + async with async_client.environments.classes.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = await response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + class_ = await response.parse() + assert_matches_type(ClassListResponse, class_, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_invite.py b/tests/api_resources/organizations/test_invites.py similarity index 55% rename from tests/api_resources/organizations/test_invite.py rename to tests/api_resources/organizations/test_invites.py index 52a7e802..246a07dc 100644 --- a/tests/api_resources/organizations/test_invite.py +++ b/tests/api_resources/organizations/test_invites.py @@ -12,24 +12,25 @@ from gitpod.types.organizations import ( InviteCreateResponse, InviteRetrieveResponse, + InviteGetSummaryResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestInvite: +class TestInvites: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_create(self, client: Gitpod) -> None: - invite = client.organizations.invite.create( + invite = client.organizations.invites.create( connect_protocol_version=1, ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: - invite = client.organizations.invite.create( + invite = client.organizations.invites.create( connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -38,7 +39,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.invite.with_raw_response.create( + response = client.organizations.invites.with_raw_response.create( connect_protocol_version=1, ) @@ -49,7 +50,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.invite.with_streaming_response.create( + with client.organizations.invites.with_streaming_response.create( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -62,14 +63,14 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - invite = client.organizations.invite.retrieve( + invite = client.organizations.invites.retrieve( connect_protocol_version=1, ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - invite = client.organizations.invite.retrieve( + invite = client.organizations.invites.retrieve( connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -78,7 +79,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.invite.with_raw_response.retrieve( + response = client.organizations.invites.with_raw_response.retrieve( connect_protocol_version=1, ) @@ -89,7 +90,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.invite.with_streaming_response.retrieve( + with client.organizations.invites.with_streaming_response.retrieve( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -100,20 +101,67 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_get_summary(self, client: Gitpod) -> None: + invite = client.organizations.invites.get_summary( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + + @parametrize + def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: + invite = client.organizations.invites.get_summary( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + + @parametrize + def test_raw_response_get_summary(self, client: Gitpod) -> None: + response = client.organizations.invites.with_raw_response.get_summary( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invite = response.parse() + assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + + @parametrize + def test_streaming_response_get_summary(self, client: Gitpod) -> None: + with client.organizations.invites.with_streaming_response.get_summary( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invite = response.parse() + assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + + assert cast(Any, response.is_closed) is True + -class TestAsyncInvite: +class TestAsyncInvites: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invite.create( + invite = await async_client.organizations.invites.create( connect_protocol_version=1, ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invite.create( + invite = await async_client.organizations.invites.create( connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -122,7 +170,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invite.with_raw_response.create( + response = await async_client.organizations.invites.with_raw_response.create( connect_protocol_version=1, ) @@ -133,7 +181,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invite.with_streaming_response.create( + async with async_client.organizations.invites.with_streaming_response.create( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -146,14 +194,14 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invite.retrieve( + invite = await async_client.organizations.invites.retrieve( connect_protocol_version=1, ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invite.retrieve( + invite = await async_client.organizations.invites.retrieve( connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -162,7 +210,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invite.with_raw_response.retrieve( + response = await async_client.organizations.invites.with_raw_response.retrieve( connect_protocol_version=1, ) @@ -173,7 +221,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invite.with_streaming_response.retrieve( + async with async_client.organizations.invites.with_streaming_response.retrieve( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -183,3 +231,50 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: + invite = await async_client.organizations.invites.get_summary( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + + @parametrize + async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpod) -> None: + invite = await async_client.organizations.invites.get_summary( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + + @parametrize + async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.invites.with_raw_response.get_summary( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invite = await response.parse() + assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + + @parametrize + async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.invites.with_streaming_response.get_summary( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invite = await response.parse() + assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py new file mode 100644 index 00000000..fc905847 --- /dev/null +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -0,0 +1,812 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.organizations import ( + SSOConfigurationListResponse, + SSOConfigurationCreateResponse, + SSOConfigurationRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSSOConfigurations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.create( + connect_protocol_version=1, + ) + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.create( + connect_protocol_version=1, + client_id="x", + client_secret="x", + email_domain="xxxx", + issuer_url="https://example.com", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_1(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + client_id="x", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + client_id="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update( + client_id="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update( + client_id="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + client_secret="x", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + client_secret="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update( + client_secret="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update( + client_secret="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + email_domain="xxxx", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + email_domain="xxxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update( + email_domain="xxxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update( + email_domain="xxxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_4(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + issuer_url="https://example.com", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_4(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_5(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_5(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update( + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update( + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.delete( + connect_protocol_version=1, + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncSSOConfigurations: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.create( + connect_protocol_version=1, + ) + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.create( + connect_protocol_version=1, + client_id="x", + client_secret="x", + email_domain="xxxx", + issuer_url="https://example.com", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + client_id="x", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + client_id="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update( + client_id="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + client_id="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + client_secret="x", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + client_secret="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update( + client_secret="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + client_secret="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + email_domain="xxxx", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + email_domain="xxxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update( + email_domain="xxxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + email_domain="xxxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + issuer_url="https://example.com", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update( + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.delete( + connect_protocol_version=1, + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/__init__.py b/tests/api_resources/projects/__init__.py similarity index 100% rename from tests/api_resources/runner_configurations/__init__.py rename to tests/api_resources/projects/__init__.py diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py new file mode 100644 index 00000000..4cd564ab --- /dev/null +++ b/tests/api_resources/projects/test_policies.py @@ -0,0 +1,370 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.projects import ( + PolicyListResponse, + PolicyCreateResponse, + PolicyUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPolicies: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Gitpod) -> None: + policy = client.projects.policies.create( + connect_protocol_version=1, + ) + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + policy = client.projects.policies.create( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="PROJECT_ROLE_UNSPECIFIED", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.projects.policies.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.projects.policies.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update(self, client: Gitpod) -> None: + policy = client.projects.policies.update( + connect_protocol_version=1, + ) + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + policy = client.projects.policies.update( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="PROJECT_ROLE_UNSPECIFIED", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.projects.policies.with_raw_response.update( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.projects.policies.with_streaming_response.update( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + policy = client.projects.policies.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + policy = client.projects.policies.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.projects.policies.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.projects.policies.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + policy = client.projects.policies.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, policy, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + policy = client.projects.policies.delete( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, policy, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.projects.policies.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(object, policy, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.projects.policies.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(object, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncPolicies: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + policy = await async_client.projects.policies.create( + connect_protocol_version=1, + ) + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + policy = await async_client.projects.policies.create( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="PROJECT_ROLE_UNSPECIFIED", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.policies.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.policies.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + policy = await async_client.projects.policies.update( + connect_protocol_version=1, + ) + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + policy = await async_client.projects.policies.update( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="PROJECT_ROLE_UNSPECIFIED", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.policies.with_raw_response.update( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.policies.with_streaming_response.update( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + policy = await async_client.projects.policies.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + policy = await async_client.projects.policies.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.policies.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.policies.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(PolicyListResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + policy = await async_client.projects.policies.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, policy, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + policy = await async_client.projects.policies.delete( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, policy, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.policies.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(object, policy, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.policies.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(object, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/test_configuration_schema.py b/tests/api_resources/runner_configurations/test_configuration_schema.py deleted file mode 100644 index c3ec0956..00000000 --- a/tests/api_resources/runner_configurations/test_configuration_schema.py +++ /dev/null @@ -1,185 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types.runner_configurations import ( - ConfigurationSchemaCreateResponse, - ConfigurationSchemaRetrieveResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestConfigurationSchema: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.create( - connect_protocol_version=1, - ) - assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.create( - connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runner_configurations.configuration_schema.with_raw_response.create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration_schema = response.parse() - assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runner_configurations.configuration_schema.with_streaming_response.create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration_schema = response.parse() - assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_retrieve(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - configuration_schema = client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_configurations.configuration_schema.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration_schema = response.parse() - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_configurations.configuration_schema.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration_schema = response.parse() - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncConfigurationSchema: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.create( - connect_protocol_version=1, - ) - assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.create( - connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.configuration_schema.with_raw_response.create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration_schema = await response.parse() - assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.configuration_schema.with_streaming_response.create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration_schema = await response.parse() - assert_matches_type(ConfigurationSchemaCreateResponse, configuration_schema, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - ) - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - configuration_schema = await async_client.runner_configurations.configuration_schema.retrieve( - connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.configuration_schema.with_raw_response.retrieve( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration_schema = await response.parse() - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.configuration_schema.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration_schema = await response.parse() - assert_matches_type(ConfigurationSchemaRetrieveResponse, configuration_schema, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runner_configurations/test_scm_integration.py b/tests/api_resources/runner_configurations/test_scm_integration.py deleted file mode 100644 index e83be4b1..00000000 --- a/tests/api_resources/runner_configurations/test_scm_integration.py +++ /dev/null @@ -1,194 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types.runner_configurations import ScmIntegrationCreateResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestScmIntegration: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create_overload_1(self, client: Gitpod) -> None: - scm_integration = client.runner_configurations.scm_integration.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: - scm_integration = client.runner_configurations.scm_integration.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_raw_response_create_overload_1(self, client: Gitpod) -> None: - response = client.runner_configurations.scm_integration.with_raw_response.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: - with client.runner_configurations.scm_integration.with_streaming_response.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_create_overload_2(self, client: Gitpod) -> None: - scm_integration = client.runner_configurations.scm_integration.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: - scm_integration = client.runner_configurations.scm_integration.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_raw_response_create_overload_2(self, client: Gitpod) -> None: - response = client.runner_configurations.scm_integration.with_raw_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: - with client.runner_configurations.scm_integration.with_streaming_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncScmIntegration: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runner_configurations.scm_integration.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runner_configurations.scm_integration.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.scm_integration.with_raw_response.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = await response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.scm_integration.with_streaming_response.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = await response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runner_configurations.scm_integration.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runner_configurations.scm_integration.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.scm_integration.with_raw_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = await response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.scm_integration.with_streaming_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = await response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/__init__.py b/tests/api_resources/runners/configurations/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/runners/configurations/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/runner_configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py similarity index 50% rename from tests/api_resources/runner_configurations/test_environment_classes.py rename to tests/api_resources/runners/configurations/test_environment_classes.py index 14f6251e..41ce1135 100644 --- a/tests/api_resources/runner_configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -9,8 +9,10 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types.runner_configurations import ( +from gitpod.types.runners.configurations import ( EnvironmentClassListResponse, + EnvironmentClassCreateResponse, + EnvironmentClassRetrieveResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,9 +21,104 @@ class TestEnvironmentClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_create(self, client: Gitpod) -> None: + environment_class = client.runners.configurations.environment_classes.create( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + environment_class = client.runners.configurations.environment_classes.create( + connect_protocol_version=1, + configuration=[ + { + "key": "key", + "value": "value", + } + ], + description="xxx", + display_name="xxx", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.runners.configurations.environment_classes.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = response.parse() + assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.runners.configurations.environment_classes.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = response.parse() + assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + environment_class = client.runners.configurations.environment_classes.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + environment_class = client.runners.configurations.environment_classes.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runners.configurations.environment_classes.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = response.parse() + assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runners.configurations.environment_classes.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = response.parse() + assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.update( + environment_class = client.runners.configurations.environment_classes.update( description="xxx", connect_protocol_version=1, ) @@ -29,7 +126,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.update( + environment_class = client.runners.configurations.environment_classes.update( description="xxx", connect_protocol_version=1, connect_timeout_ms=0, @@ -38,7 +135,7 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runner_configurations.environment_classes.with_raw_response.update( + response = client.runners.configurations.environment_classes.with_raw_response.update( description="xxx", connect_protocol_version=1, ) @@ -50,7 +147,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runner_configurations.environment_classes.with_streaming_response.update( + with client.runners.configurations.environment_classes.with_streaming_response.update( description="xxx", connect_protocol_version=1, ) as response: @@ -64,7 +161,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.update( + environment_class = client.runners.configurations.environment_classes.update( display_name="xxx", connect_protocol_version=1, ) @@ -72,7 +169,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.update( + environment_class = client.runners.configurations.environment_classes.update( display_name="xxx", connect_protocol_version=1, connect_timeout_ms=0, @@ -81,7 +178,7 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.runner_configurations.environment_classes.with_raw_response.update( + response = client.runners.configurations.environment_classes.with_raw_response.update( display_name="xxx", connect_protocol_version=1, ) @@ -93,7 +190,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.runner_configurations.environment_classes.with_streaming_response.update( + with client.runners.configurations.environment_classes.with_streaming_response.update( display_name="xxx", connect_protocol_version=1, ) as response: @@ -107,7 +204,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.update( + environment_class = client.runners.configurations.environment_classes.update( enabled=True, connect_protocol_version=1, ) @@ -115,7 +212,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.update( + environment_class = client.runners.configurations.environment_classes.update( enabled=True, connect_protocol_version=1, connect_timeout_ms=0, @@ -124,7 +221,7 @@ def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: - response = client.runner_configurations.environment_classes.with_raw_response.update( + response = client.runners.configurations.environment_classes.with_raw_response.update( enabled=True, connect_protocol_version=1, ) @@ -136,7 +233,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: - with client.runner_configurations.environment_classes.with_streaming_response.update( + with client.runners.configurations.environment_classes.with_streaming_response.update( enabled=True, connect_protocol_version=1, ) as response: @@ -150,27 +247,29 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.list( + environment_class = client.runners.configurations.environment_classes.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: - environment_class = client.runner_configurations.environment_classes.list( + environment_class = client.runners.configurations.environment_classes.list( + encoding="proto", connect_protocol_version=1, - filter={"enabled": True}, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runner_configurations.environment_classes.with_raw_response.list( + response = client.runners.configurations.environment_classes.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -181,7 +280,8 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runner_configurations.environment_classes.with_streaming_response.list( + with client.runners.configurations.environment_classes.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -196,9 +296,104 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncEnvironmentClasses: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runners.configurations.environment_classes.create( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runners.configurations.environment_classes.create( + connect_protocol_version=1, + configuration=[ + { + "key": "key", + "value": "value", + } + ], + description="xxx", + display_name="xxx", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.environment_classes.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = await response.parse() + assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.environment_classes.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = await response.parse() + assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runners.configurations.environment_classes.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runners.configurations.environment_classes.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.environment_classes.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = await response.parse() + assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.environment_classes.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = await response.parse() + assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.update( + environment_class = await async_client.runners.configurations.environment_classes.update( description="xxx", connect_protocol_version=1, ) @@ -206,7 +401,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.update( + environment_class = await async_client.runners.configurations.environment_classes.update( description="xxx", connect_protocol_version=1, connect_timeout_ms=0, @@ -215,7 +410,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.environment_classes.with_raw_response.update( + response = await async_client.runners.configurations.environment_classes.with_raw_response.update( description="xxx", connect_protocol_version=1, ) @@ -227,7 +422,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.environment_classes.with_streaming_response.update( + async with async_client.runners.configurations.environment_classes.with_streaming_response.update( description="xxx", connect_protocol_version=1, ) as response: @@ -241,7 +436,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.update( + environment_class = await async_client.runners.configurations.environment_classes.update( display_name="xxx", connect_protocol_version=1, ) @@ -249,7 +444,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.update( + environment_class = await async_client.runners.configurations.environment_classes.update( display_name="xxx", connect_protocol_version=1, connect_timeout_ms=0, @@ -258,7 +453,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.environment_classes.with_raw_response.update( + response = await async_client.runners.configurations.environment_classes.with_raw_response.update( display_name="xxx", connect_protocol_version=1, ) @@ -270,7 +465,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.environment_classes.with_streaming_response.update( + async with async_client.runners.configurations.environment_classes.with_streaming_response.update( display_name="xxx", connect_protocol_version=1, ) as response: @@ -284,7 +479,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.update( + environment_class = await async_client.runners.configurations.environment_classes.update( enabled=True, connect_protocol_version=1, ) @@ -292,7 +487,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.update( + environment_class = await async_client.runners.configurations.environment_classes.update( enabled=True, connect_protocol_version=1, connect_timeout_ms=0, @@ -301,7 +496,7 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.environment_classes.with_raw_response.update( + response = await async_client.runners.configurations.environment_classes.with_raw_response.update( enabled=True, connect_protocol_version=1, ) @@ -313,7 +508,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.environment_classes.with_streaming_response.update( + async with async_client.runners.configurations.environment_classes.with_streaming_response.update( enabled=True, connect_protocol_version=1, ) as response: @@ -327,27 +522,29 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.list( + environment_class = await async_client.runners.configurations.environment_classes.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runner_configurations.environment_classes.list( + environment_class = await async_client.runners.configurations.environment_classes.list( + encoding="proto", connect_protocol_version=1, - filter={"enabled": True}, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.environment_classes.with_raw_response.list( + response = await async_client.runners.configurations.environment_classes.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -358,7 +555,8 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.environment_classes.with_streaming_response.list( + async with async_client.runners.configurations.environment_classes.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py similarity index 74% rename from tests/api_resources/runner_configurations/test_host_authentication_tokens.py rename to tests/api_resources/runners/configurations/test_host_authentication_tokens.py index baff3306..1153fe3e 100644 --- a/tests/api_resources/runner_configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod._utils import parse_datetime -from gitpod.types.runner_configurations import ( +from gitpod.types.runners.configurations import ( HostAuthenticationTokenListResponse, HostAuthenticationTokenCreateResponse, HostAuthenticationTokenRetrieveResponse, @@ -24,23 +24,29 @@ class TestHostAuthenticationTokens: @parametrize def test_method_create(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.create( + host_authentication_token = client.runners.configurations.host_authentication_tokens.create( connect_protocol_version=1, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.create( + host_authentication_token = client.runners.configurations.host_authentication_tokens.create( connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + token="x", + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + host="x", + refresh_token="refreshToken", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.create( + response = client.runners.configurations.host_authentication_tokens.with_raw_response.create( connect_protocol_version=1, ) @@ -51,7 +57,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.create( + with client.runners.configurations.host_authentication_tokens.with_streaming_response.create( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -64,23 +70,29 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( + host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.retrieve( + host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( + encoding="proto", connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( + response = client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -91,7 +103,8 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( + with client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -104,7 +117,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, ) @@ -112,7 +125,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, connect_timeout_ms=0, @@ -121,7 +134,7 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( + response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, ) @@ -133,7 +146,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, ) as response: @@ -147,7 +160,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( refresh_token="refreshToken", connect_protocol_version=1, ) @@ -155,7 +168,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( refresh_token="refreshToken", connect_protocol_version=1, connect_timeout_ms=0, @@ -164,7 +177,7 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( + response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( refresh_token="refreshToken", connect_protocol_version=1, ) @@ -176,7 +189,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( refresh_token="refreshToken", connect_protocol_version=1, ) as response: @@ -190,7 +203,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( token="x", connect_protocol_version=1, ) @@ -198,7 +211,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( token="x", connect_protocol_version=1, connect_timeout_ms=0, @@ -207,7 +220,7 @@ def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.update( + response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( token="x", connect_protocol_version=1, ) @@ -219,7 +232,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( token="x", connect_protocol_version=1, ) as response: @@ -233,27 +246,29 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.list( + host_authentication_token = client.runners.configurations.host_authentication_tokens.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.list( + host_authentication_token = client.runners.configurations.host_authentication_tokens.list( + encoding="proto", connect_protocol_version=1, - filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.list( + response = client.runners.configurations.host_authentication_tokens.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -264,7 +279,8 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.list( + with client.runners.configurations.host_authentication_tokens.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -277,14 +293,14 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.delete( + host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( connect_protocol_version=1, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: - host_authentication_token = client.runner_configurations.host_authentication_tokens.delete( + host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -293,7 +309,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.runner_configurations.host_authentication_tokens.with_raw_response.delete( + response = client.runners.configurations.host_authentication_tokens.with_raw_response.delete( connect_protocol_version=1, ) @@ -304,7 +320,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.runner_configurations.host_authentication_tokens.with_streaming_response.delete( + with client.runners.configurations.host_authentication_tokens.with_streaming_response.delete( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -321,23 +337,29 @@ class TestAsyncHostAuthenticationTokens: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( connect_protocol_version=1, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.create( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + token="x", + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + host="x", + refresh_token="refreshToken", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.create( + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.create( connect_protocol_version=1, ) @@ -348,7 +370,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.create( + async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.create( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -361,23 +383,29 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.retrieve( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( + encoding="proto", connect_protocol_version=1, - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.retrieve( + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -388,7 +416,8 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.retrieve( + async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -401,7 +430,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, ) @@ -409,7 +438,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, connect_timeout_ms=0, @@ -418,7 +447,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, ) @@ -430,7 +459,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), connect_protocol_version=1, ) as response: @@ -444,7 +473,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( refresh_token="refreshToken", connect_protocol_version=1, ) @@ -452,7 +481,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( refresh_token="refreshToken", connect_protocol_version=1, connect_timeout_ms=0, @@ -461,7 +490,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( refresh_token="refreshToken", connect_protocol_version=1, ) @@ -473,7 +502,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( refresh_token="refreshToken", connect_protocol_version=1, ) as response: @@ -487,7 +516,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( token="x", connect_protocol_version=1, ) @@ -495,7 +524,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.update( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( token="x", connect_protocol_version=1, connect_timeout_ms=0, @@ -504,7 +533,7 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.update( + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( token="x", connect_protocol_version=1, ) @@ -516,7 +545,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.update( + async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( token="x", connect_protocol_version=1, ) as response: @@ -530,27 +559,29 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.list( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( + encoding="proto", connect_protocol_version=1, - filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.list( + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -561,7 +592,8 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.list( + async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -574,14 +606,14 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( connect_protocol_version=1, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runner_configurations.host_authentication_tokens.delete( + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, @@ -590,7 +622,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.host_authentication_tokens.with_raw_response.delete( + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.delete( connect_protocol_version=1, ) @@ -601,7 +633,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.host_authentication_tokens.with_streaming_response.delete( + async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.delete( connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/organizations/invite/test_summary.py b/tests/api_resources/runners/configurations/test_schema.py similarity index 54% rename from tests/api_resources/organizations/invite/test_summary.py rename to tests/api_resources/runners/configurations/test_schema.py index efed9ad1..87f404ad 100644 --- a/tests/api_resources/organizations/invite/test_summary.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -9,94 +9,108 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types.organizations.invite import SummaryRetrieveResponse +from gitpod.types.runners.configurations import SchemaRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestSummary: +class TestSchema: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - summary = client.organizations.invite.summary.retrieve( + schema = client.runners.configurations.schema.retrieve( + encoding="proto", connect_protocol_version=1, ) - assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - summary = client.organizations.invite.summary.retrieve( + schema = client.runners.configurations.schema.retrieve( + encoding="proto", connect_protocol_version=1, - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) - assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.invite.summary.with_raw_response.retrieve( + response = client.runners.configurations.schema.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - summary = response.parse() - assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + schema = response.parse() + assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.invite.summary.with_streaming_response.retrieve( + with client.runners.configurations.schema.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - summary = response.parse() - assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + schema = response.parse() + assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) assert cast(Any, response.is_closed) is True -class TestAsyncSummary: +class TestAsyncSchema: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - summary = await async_client.organizations.invite.summary.retrieve( + schema = await async_client.runners.configurations.schema.retrieve( + encoding="proto", connect_protocol_version=1, ) - assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - summary = await async_client.organizations.invite.summary.retrieve( + schema = await async_client.runners.configurations.schema.retrieve( + encoding="proto", connect_protocol_version=1, - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) - assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invite.summary.with_raw_response.retrieve( + response = await async_client.runners.configurations.schema.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - summary = await response.parse() - assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + schema = await response.parse() + assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invite.summary.with_streaming_response.retrieve( + async with async_client.runners.configurations.schema.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - summary = await response.parse() - assert_matches_type(SummaryRetrieveResponse, summary, path=["response"]) + schema = await response.parse() + assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py new file mode 100644 index 00000000..c22ad989 --- /dev/null +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -0,0 +1,724 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.runners.configurations import ( + ScmIntegrationListResponse, + ScmIntegrationCreateResponse, + ScmIntegrationRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestScmIntegrations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create_overload_1(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_create_overload_1(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_create_overload_2(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_1(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + pat=True, + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + pat=True, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.update( + pat=True, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.update( + pat=True, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.delete( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncScmIntegrations: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + pat=True, + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + pat=True, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( + pat=True, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( + pat=True, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.delete( + connect_protocol_version=1, + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runner_configurations.py b/tests/api_resources/runners/test_configurations.py similarity index 63% rename from tests/api_resources/test_runner_configurations.py rename to tests/api_resources/runners/test_configurations.py index 34570373..30cbd663 100644 --- a/tests/api_resources/test_runner_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -9,25 +9,25 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import RunnerConfigurationValidateResponse +from gitpod.types.runners import ConfigurationValidateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestRunnerConfigurations: +class TestConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_validate_overload_1(self, client: Gitpod) -> None: - runner_configuration = client.runner_configurations.validate( + configuration = client.runners.configurations.validate( environment_class={}, connect_protocol_version=1, ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> None: - runner_configuration = client.runner_configurations.validate( + configuration = client.runners.configurations.validate( environment_class={ "id": "id", "configuration": [ @@ -45,93 +45,93 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: - response = client.runner_configurations.with_raw_response.validate( + response = client.runners.configurations.with_raw_response.validate( environment_class={}, connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + configuration = response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: - with client.runner_configurations.with_streaming_response.validate( + with client.runners.configurations.with_streaming_response.validate( environment_class={}, connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + configuration = response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_validate_overload_2(self, client: Gitpod) -> None: - runner_configuration = client.runner_configurations.validate( + configuration = client.runners.configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: - runner_configuration = client.runner_configurations.validate( + configuration = client.runners.configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: - response = client.runner_configurations.with_raw_response.validate( + response = client.runners.configurations.with_raw_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + configuration = response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: - with client.runner_configurations.with_streaming_response.validate( + with client.runners.configurations.with_streaming_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + configuration = response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) assert cast(Any, response.is_closed) is True -class TestAsyncRunnerConfigurations: +class TestAsyncConfigurations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: - runner_configuration = await async_client.runner_configurations.validate( + configuration = await async_client.runners.configurations.validate( environment_class={}, connect_protocol_version=1, ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize async def test_method_validate_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - runner_configuration = await async_client.runner_configurations.validate( + configuration = await async_client.runners.configurations.validate( environment_class={ "id": "id", "configuration": [ @@ -149,74 +149,74 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.with_raw_response.validate( + response = await async_client.runners.configurations.with_raw_response.validate( environment_class={}, connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = await response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + configuration = await response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.with_streaming_response.validate( + async with async_client.runners.configurations.with_streaming_response.validate( environment_class={}, connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = await response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + configuration = await response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: - runner_configuration = await async_client.runner_configurations.validate( + configuration = await async_client.runners.configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - runner_configuration = await async_client.runner_configurations.validate( + configuration = await async_client.runners.configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runner_configurations.with_raw_response.validate( + response = await async_client.runners.configurations.with_raw_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = await response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + configuration = await response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @parametrize async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runner_configurations.with_streaming_response.validate( + async with async_client.runners.configurations.with_streaming_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner_configuration = await response.parse() - assert_matches_type(RunnerConfigurationValidateResponse, runner_configuration, path=["response"]) + configuration = await response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index 410b9adb..3ca7e016 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -9,7 +9,11 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types.runners import PolicyListResponse +from gitpod.types.runners import ( + PolicyListResponse, + PolicyCreateResponse, + PolicyUpdateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,9 +21,94 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_create(self, client: Gitpod) -> None: + policy = client.runners.policies.create( + connect_protocol_version=1, + ) + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + policy = client.runners.policies.create( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="RUNNER_ROLE_UNSPECIFIED", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.runners.policies.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.runners.policies.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update(self, client: Gitpod) -> None: + policy = client.runners.policies.update( + connect_protocol_version=1, + ) + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + policy = client.runners.policies.update( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="RUNNER_ROLE_UNSPECIFIED", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.runners.policies.with_raw_response.update( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.runners.policies.with_streaming_response.update( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.runners.policies.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @@ -27,12 +116,12 @@ def test_method_list(self, client: Gitpod) -> None: @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.list( + encoding="proto", connect_protocol_version=1, - pagination={ - "token": "token", - "page_size": 100, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @@ -40,6 +129,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -51,6 +141,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -61,13 +152,139 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + policy = client.runners.policies.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, policy, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + policy = client.runners.policies.delete( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, policy, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.runners.policies.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(object, policy, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.runners.policies.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(object, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncPolicies: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + policy = await async_client.runners.policies.create( + connect_protocol_version=1, + ) + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + policy = await async_client.runners.policies.create( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="RUNNER_ROLE_UNSPECIFIED", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.policies.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.policies.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + policy = await async_client.runners.policies.update( + connect_protocol_version=1, + ) + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + policy = await async_client.runners.policies.update( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="RUNNER_ROLE_UNSPECIFIED", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.policies.with_raw_response.update( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.policies.with_streaming_response.update( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @@ -75,12 +292,12 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( + encoding="proto", connect_protocol_version=1, - pagination={ - "token": "token", - "page_size": 100, - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(PolicyListResponse, policy, path=["response"]) @@ -88,6 +305,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -99,6 +317,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -108,3 +327,44 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert_matches_type(PolicyListResponse, policy, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + policy = await async_client.runners.policies.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, policy, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + policy = await async_client.runners.policies.delete( + connect_protocol_version=1, + group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, policy, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.policies.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(object, policy, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.policies.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(object, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py new file mode 100644 index 00000000..c32b438d --- /dev/null +++ b/tests/api_resources/test_accounts.py @@ -0,0 +1,388 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + AccountRetrieveResponse, + AccountGetSSOLoginURLResponse, + AccountListLoginProvidersResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAccounts: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + account = client.accounts.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.accounts.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = response.parse() + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.accounts.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = response.parse() + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + account = client.accounts.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, account, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.delete( + connect_protocol_version=1, + account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, account, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.accounts.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = response.parse() + assert_matches_type(object, account, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.accounts.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = response.parse() + assert_matches_type(object, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_sso_login_url(self, client: Gitpod) -> None: + account = client.accounts.get_sso_login_url( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + + @parametrize + def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.get_sso_login_url( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + + @parametrize + def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: + response = client.accounts.with_raw_response.get_sso_login_url( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = response.parse() + assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + + @parametrize + def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: + with client.accounts.with_streaming_response.get_sso_login_url( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = response.parse() + assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list_login_providers(self, client: Gitpod) -> None: + account = client.accounts.list_login_providers( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + + @parametrize + def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.list_login_providers( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + + @parametrize + def test_raw_response_list_login_providers(self, client: Gitpod) -> None: + response = client.accounts.with_raw_response.list_login_providers( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = response.parse() + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + + @parametrize + def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: + with client.accounts.with_streaming_response.list_login_providers( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = response.parse() + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncAccounts: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.accounts.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = await response.parse() + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.accounts.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = await response.parse() + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, account, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.delete( + connect_protocol_version=1, + account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, account, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.accounts.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = await response.parse() + assert_matches_type(object, account, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.accounts.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = await response.parse() + assert_matches_type(object, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.get_sso_login_url( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + + @parametrize + async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.get_sso_login_url( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + + @parametrize + async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: + response = await async_client.accounts.with_raw_response.get_sso_login_url( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = await response.parse() + assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + + @parametrize + async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: + async with async_client.accounts.with_streaming_response.get_sso_login_url( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = await response.parse() + assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.list_login_providers( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + + @parametrize + async def test_method_list_login_providers_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.list_login_providers( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + + @parametrize + async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod) -> None: + response = await async_client.accounts.with_raw_response.list_login_providers( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = await response.parse() + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + + @parametrize + async def test_streaming_response_list_login_providers(self, async_client: AsyncGitpod) -> None: + async with async_client.accounts.with_streaming_response.list_login_providers( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = await response.parse() + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py new file mode 100644 index 00000000..776748cd --- /dev/null +++ b/tests/api_resources/test_editors.py @@ -0,0 +1,298 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + EditorListResponse, + EditorRetrieveResponse, + EditorResolveURLResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEditors: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + editor = client.editors.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + editor = client.editors.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.editors.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = response.parse() + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.editors.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = response.parse() + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + editor = client.editors.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + editor = client.editors.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.editors.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = response.parse() + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.editors.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = response.parse() + assert_matches_type(EditorListResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_resolve_url(self, client: Gitpod) -> None: + editor = client.editors.resolve_url( + connect_protocol_version=1, + ) + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + + @parametrize + def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: + editor = client.editors.resolve_url( + connect_protocol_version=1, + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + + @parametrize + def test_raw_response_resolve_url(self, client: Gitpod) -> None: + response = client.editors.with_raw_response.resolve_url( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = response.parse() + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + + @parametrize + def test_streaming_response_resolve_url(self, client: Gitpod) -> None: + with client.editors.with_streaming_response.resolve_url( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = response.parse() + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEditors: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.editors.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = await response.parse() + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.editors.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = await response.parse() + assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.editors.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = await response.parse() + assert_matches_type(EditorListResponse, editor, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.editors.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = await response.parse() + assert_matches_type(EditorListResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.resolve_url( + connect_protocol_version=1, + ) + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + + @parametrize + async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.resolve_url( + connect_protocol_version=1, + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + + @parametrize + async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: + response = await async_client.editors.with_raw_response.resolve_url( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + editor = await response.parse() + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + + @parametrize + async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: + async with async_client.editors.with_streaming_response.resolve_url( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + editor = await response.parse() + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index a949657b..6c117e93 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -13,8 +13,10 @@ EnvironmentListResponse, EnvironmentCreateResponse, EnvironmentRetrieveResponse, + EnvironmentCreateLogsTokenResponse, EnvironmentCreateFromProjectResponse, ) +from gitpod._utils import parse_datetime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -110,6 +112,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment = client.environments.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @@ -117,8 +120,12 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment = client.environments.retrieve( + encoding="proto", connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @@ -126,6 +133,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -137,6 +145,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -147,9 +156,96 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_update_overload_1(self, client: Gitpod) -> None: + environment = client.environments.update( + metadata={}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + environment = client.environments.update( + metadata={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.update( + metadata={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.update( + metadata={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + environment = client.environments.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + environment = client.environments.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_list(self, client: Gitpod) -> None: environment = client.environments.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @@ -157,19 +253,12 @@ def test_method_list(self, client: Gitpod) -> None: @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( + encoding="proto", connect_protocol_version=1, - filter={ - "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], - "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], - }, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @@ -177,6 +266,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -188,6 +278,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -198,6 +289,47 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + environment = client.environments.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.delete( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + force=True, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: environment = client.environments.create_from_project( @@ -284,6 +416,90 @@ def test_streaming_response_create_from_project(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_create_logs_token(self, client: Gitpod) -> None: + environment = client.environments.create_logs_token( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + + @parametrize + def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.create_logs_token( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + + @parametrize + def test_raw_response_create_logs_token(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.create_logs_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + + @parametrize + def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.create_logs_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_mark_active(self, client: Gitpod) -> None: + environment = client.environments.mark_active( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.mark_active( + connect_protocol_version=1, + activity_signal={ + "source": "xxx", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_raw_response_mark_active(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.mark_active( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_streaming_response_mark_active(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.mark_active( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_start(self, client: Gitpod) -> None: environment = client.environments.start( @@ -324,6 +540,46 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_stop(self, client: Gitpod) -> None: + environment = client.environments.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_method_stop_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.stop( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_raw_response_stop(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_streaming_response_stop(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncEnvironments: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -416,6 +672,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @@ -423,8 +680,12 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( + encoding="proto", connect_protocol_version=1, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @@ -432,6 +693,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -443,6 +705,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -453,9 +716,96 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.update( + metadata={}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.update( + metadata={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.update( + metadata={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.update( + metadata={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @@ -463,19 +813,12 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( + encoding="proto", connect_protocol_version=1, - filter={ - "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], - "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], - }, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(EnvironmentListResponse, environment, path=["response"]) @@ -483,6 +826,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) @@ -494,6 +838,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -504,6 +849,47 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.delete( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + force=True, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( @@ -590,6 +976,90 @@ async def test_streaming_response_create_from_project(self, async_client: AsyncG assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.create_logs_token( + connect_protocol_version=1, + ) + assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + + @parametrize + async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.create_logs_token( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + + @parametrize + async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.create_logs_token( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + + @parametrize + async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.create_logs_token( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.mark_active( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.mark_active( + connect_protocol_version=1, + activity_signal={ + "source": "xxx", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.mark_active( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.mark_active( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( @@ -629,3 +1099,43 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert_matches_type(object, environment, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_stop(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.stop( + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.stop( + connect_protocol_version=1, + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.stop( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.stop( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py new file mode 100644 index 00000000..f539a4b9 --- /dev/null +++ b/tests/api_resources/test_events.py @@ -0,0 +1,288 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import EventListResponse, EventWatchResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEvents: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + event = client.events.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(EventListResponse, event, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + event = client.events.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(EventListResponse, event, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.events.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event = response.parse() + assert_matches_type(EventListResponse, event, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.events.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event = response.parse() + assert_matches_type(EventListResponse, event, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_watch_overload_1(self, client: Gitpod) -> None: + event = client.events.watch( + environment_id="environmentId", + connect_protocol_version=1, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + def test_method_watch_with_all_params_overload_1(self, client: Gitpod) -> None: + event = client.events.watch( + environment_id="environmentId", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + def test_raw_response_watch_overload_1(self, client: Gitpod) -> None: + response = client.events.with_raw_response.watch( + environment_id="environmentId", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event = response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + def test_streaming_response_watch_overload_1(self, client: Gitpod) -> None: + with client.events.with_streaming_response.watch( + environment_id="environmentId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event = response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_watch_overload_2(self, client: Gitpod) -> None: + event = client.events.watch( + organization=True, + connect_protocol_version=1, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + def test_method_watch_with_all_params_overload_2(self, client: Gitpod) -> None: + event = client.events.watch( + organization=True, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + def test_raw_response_watch_overload_2(self, client: Gitpod) -> None: + response = client.events.with_raw_response.watch( + organization=True, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event = response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: + with client.events.with_streaming_response.watch( + organization=True, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event = response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEvents: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + event = await async_client.events.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(EventListResponse, event, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + event = await async_client.events.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(EventListResponse, event, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.events.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event = await response.parse() + assert_matches_type(EventListResponse, event, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.events.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event = await response.parse() + assert_matches_type(EventListResponse, event, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_watch_overload_1(self, async_client: AsyncGitpod) -> None: + event = await async_client.events.watch( + environment_id="environmentId", + connect_protocol_version=1, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + async def test_method_watch_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + event = await async_client.events.watch( + environment_id="environmentId", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + async def test_raw_response_watch_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.events.with_raw_response.watch( + environment_id="environmentId", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event = await response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + async def test_streaming_response_watch_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.events.with_streaming_response.watch( + environment_id="environmentId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event = await response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_watch_overload_2(self, async_client: AsyncGitpod) -> None: + event = await async_client.events.watch( + organization=True, + connect_protocol_version=1, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + async def test_method_watch_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + event = await async_client.events.watch( + organization=True, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + async def test_raw_response_watch_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.events.with_raw_response.watch( + organization=True, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event = await response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + async def test_streaming_response_watch_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.events.with_streaming_response.watch( + organization=True, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event = await response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py new file mode 100644 index 00000000..a7c2f9ba --- /dev/null +++ b/tests/api_resources/test_groups.py @@ -0,0 +1,116 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import GroupListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestGroups: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + group = client.groups.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(GroupListResponse, group, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + group = client.groups.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(GroupListResponse, group, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.groups.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(GroupListResponse, group, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.groups.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(GroupListResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncGroups: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(GroupListResponse, group, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(GroupListResponse, group, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(GroupListResponse, group, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(GroupListResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index ae92d5e8..a7d93100 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -64,7 +64,7 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: @parametrize def test_method_get_authenticated_identity(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( - body={}, + encoding="proto", connect_protocol_version=1, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -72,8 +72,12 @@ def test_method_get_authenticated_identity(self, client: Gitpod) -> None: @parametrize def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( - body={}, + encoding="proto", connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -81,7 +85,7 @@ def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) @parametrize def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_authenticated_identity( - body={}, + encoding="proto", connect_protocol_version=1, ) @@ -93,7 +97,7 @@ def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_authenticated_identity( - body={}, + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -191,7 +195,7 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod @parametrize async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( - body={}, + encoding="proto", connect_protocol_version=1, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -199,8 +203,12 @@ async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod @parametrize async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( - body={}, + encoding="proto", connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -208,7 +216,7 @@ async def test_method_get_authenticated_identity_with_all_params(self, async_cli @parametrize async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_authenticated_identity( - body={}, + encoding="proto", connect_protocol_version=1, ) @@ -220,7 +228,7 @@ async def test_raw_response_get_authenticated_identity(self, async_client: Async @parametrize async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_authenticated_identity( - body={}, + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 58d19c5f..9caa1fea 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -10,6 +10,11 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( + OrganizationJoinResponse, + OrganizationListResponse, + OrganizationCreateResponse, + OrganizationUpdateResponse, + OrganizationRetrieveResponse, OrganizationListMembersResponse, ) @@ -19,6 +24,354 @@ class TestOrganizations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_create(self, client: Gitpod) -> None: + organization = client.organizations.create( + connect_protocol_version=1, + ) + assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + organization = client.organizations.create( + connect_protocol_version=1, + invite_accounts_with_matching_domain=True, + join_organization=True, + name="xxx", + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + organization = client.organizations.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + organization = client.organizations.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_1(self, client: Gitpod) -> None: + organization = client.organizations.update( + invite_domains={}, + connect_protocol_version=1, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + organization = client.organizations.update( + invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.update( + invite_domains={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.update( + invite_domains={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + organization = client.organizations.update( + name="name", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + organization = client.organizations.update( + name="name", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.update( + name="name", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.update( + name="name", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + organization = client.organizations.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationListResponse, organization, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + organization = client.organizations.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationListResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationListResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationListResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + organization = client.organizations.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + organization = client.organizations.delete( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(object, organization, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(object, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_join_overload_1(self, client: Gitpod) -> None: + organization = client.organizations.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + def test_method_join_with_all_params_overload_1(self, client: Gitpod) -> None: + organization = client.organizations.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_join_overload_1(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_join_overload_2(self, client: Gitpod) -> None: + organization = client.organizations.join( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + def test_method_join_with_all_params_overload_2(self, client: Gitpod) -> None: + organization = client.organizations.join( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_join_overload_2(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.join( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.join( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_leave(self, client: Gitpod) -> None: organization = client.organizations.leave( @@ -62,6 +415,7 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: @parametrize def test_method_list_members(self, client: Gitpod) -> None: organization = client.organizations.list_members( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @@ -69,12 +423,12 @@ def test_method_list_members(self, client: Gitpod) -> None: @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( + encoding="proto", connect_protocol_version=1, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @@ -82,6 +436,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list_members( + encoding="proto", connect_protocol_version=1, ) @@ -93,6 +448,7 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list_members( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -149,6 +505,354 @@ def test_streaming_response_set_role(self, client: Gitpod) -> None: class TestAsyncOrganizations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.create( + connect_protocol_version=1, + ) + assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.create( + connect_protocol_version=1, + invite_accounts_with_matching_domain=True, + join_organization=True, + name="xxx", + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.retrieve( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.retrieve( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.update( + invite_domains={}, + connect_protocol_version=1, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.update( + invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.update( + invite_domains={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.update( + invite_domains={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.update( + name="name", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.update( + name="name", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.update( + name="name", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.update( + name="name", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationListResponse, organization, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationListResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationListResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationListResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.delete( + connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, organization, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(object, organization, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(object, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_join_overload_1(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + async def test_method_join_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_join_overload_2(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.join( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + async def test_method_join_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.join( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.join( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.join( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( @@ -192,6 +896,7 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @@ -199,12 +904,12 @@ async def test_method_list_members(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( + encoding="proto", connect_protocol_version=1, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - pagination={ - "token": "token", - "page_size": 100, - }, + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @@ -212,6 +917,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list_members( + encoding="proto", connect_protocol_version=1, ) @@ -223,6 +929,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list_members( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_personal_access_tokens.py b/tests/api_resources/test_personal_access_tokens.py deleted file mode 100644 index 734793be..00000000 --- a/tests/api_resources/test_personal_access_tokens.py +++ /dev/null @@ -1,192 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gitpod import Gitpod, AsyncGitpod -from tests.utils import assert_matches_type -from gitpod.types import ( - PersonalAccessTokenListResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestPersonalAccessTokens: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Gitpod) -> None: - personal_access_token = client.personal_access_tokens.list( - connect_protocol_version=1, - ) - assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Gitpod) -> None: - personal_access_token = client.personal_access_tokens.list( - connect_protocol_version=1, - filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, - pagination={ - "token": "token", - "page_size": 100, - }, - connect_timeout_ms=0, - ) - assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.personal_access_tokens.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - personal_access_token = response.parse() - assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.personal_access_tokens.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - personal_access_token = response.parse() - assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_delete(self, client: Gitpod) -> None: - personal_access_token = client.personal_access_tokens.delete( - connect_protocol_version=1, - ) - assert_matches_type(object, personal_access_token, path=["response"]) - - @parametrize - def test_method_delete_with_all_params(self, client: Gitpod) -> None: - personal_access_token = client.personal_access_tokens.delete( - connect_protocol_version=1, - personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, personal_access_token, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.personal_access_tokens.with_raw_response.delete( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - personal_access_token = response.parse() - assert_matches_type(object, personal_access_token, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.personal_access_tokens.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - personal_access_token = response.parse() - assert_matches_type(object, personal_access_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncPersonalAccessTokens: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncGitpod) -> None: - personal_access_token = await async_client.personal_access_tokens.list( - connect_protocol_version=1, - ) - assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - personal_access_token = await async_client.personal_access_tokens.list( - connect_protocol_version=1, - filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, - pagination={ - "token": "token", - "page_size": 100, - }, - connect_timeout_ms=0, - ) - assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.personal_access_tokens.with_raw_response.list( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - personal_access_token = await response.parse() - assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.personal_access_tokens.with_streaming_response.list( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - personal_access_token = await response.parse() - assert_matches_type(PersonalAccessTokenListResponse, personal_access_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_delete(self, async_client: AsyncGitpod) -> None: - personal_access_token = await async_client.personal_access_tokens.delete( - connect_protocol_version=1, - ) - assert_matches_type(object, personal_access_token, path=["response"]) - - @parametrize - async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: - personal_access_token = await async_client.personal_access_tokens.delete( - connect_protocol_version=1, - personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(object, personal_access_token, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.personal_access_tokens.with_raw_response.delete( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - personal_access_token = await response.parse() - assert_matches_type(object, personal_access_token, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.personal_access_tokens.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - personal_access_token = await response.parse() - assert_matches_type(object, personal_access_token, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 5529ac09..0ecb83c0 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -10,7 +10,9 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( + ProjectListResponse, ProjectCreateResponse, + ProjectUpdateResponse, ProjectRetrieveResponse, ProjectCreateFromEnvironmentResponse, ) @@ -74,6 +76,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: project = client.projects.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -81,8 +84,12 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( + encoding="proto", connect_protocol_version=1, - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -90,6 +97,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.projects.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -101,6 +109,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.projects.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -111,6 +120,308 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_update_overload_1(self, client: Gitpod) -> None: + project = client.projects.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + project = client.projects.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + project = client.projects.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + project = client.projects.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: + project = client.projects.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + project = client.projects.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_4(self, client: Gitpod) -> None: + project = client.projects.update( + initializer={}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: + project = client.projects.update( + initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_update_overload_4(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update( + initializer={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update( + initializer={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_5(self, client: Gitpod) -> None: + project = client.projects.update( + name="x", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: + project = client.projects.update( + name="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_update_overload_5(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update( + name="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update( + name="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + project = client.projects.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ProjectListResponse, project, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + project = client.projects.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectListResponse, project, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectListResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectListResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + project = client.projects.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, project, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + project = client.projects.delete( + connect_protocol_version=1, + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, project, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(object, project, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(object, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: project = client.projects.create_from_environment( @@ -209,6 +520,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -216,8 +528,12 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( + encoding="proto", connect_protocol_version=1, - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -225,6 +541,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -236,6 +553,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -246,6 +564,308 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + initializer={}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update( + initializer={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update( + initializer={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + name="x", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + name="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update( + name="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update( + name="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(ProjectListResponse, project, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(ProjectListResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectListResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectListResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, project, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.delete( + connect_protocol_version=1, + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, project, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(object, project, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(object, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index ffb4d2b6..9bfb347f 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -13,7 +13,6 @@ RunnerListResponse, RunnerCreateResponse, RunnerRetrieveResponse, - RunnerGetRunnerResponse, RunnerParseContextURLResponse, RunnerCreateRunnerTokenResponse, RunnerCheckAuthenticationForHostResponse, @@ -77,6 +76,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: runner = client.runners.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -84,8 +84,12 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( + encoding="proto", connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -93,6 +97,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -104,6 +109,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -115,143 +121,148 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_list(self, client: Gitpod) -> None: - runner = client.runners.list( + def test_method_update_overload_1(self, client: Gitpod) -> None: + runner = client.runners.update( + name="xxx", connect_protocol_version=1, ) - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - def test_method_list_with_all_params(self, client: Gitpod) -> None: - runner = client.runners.list( + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + runner = client.runners.update( + name="xxx", connect_protocol_version=1, - filter={ - "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "kinds": ["RUNNER_KIND_UNSPECIFIED"], - }, - pagination={ - "token": "token", - "page_size": 100, - }, connect_timeout_ms=0, ) - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.list( + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.update( + name="xxx", connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.list( + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.update( + name="xxx", connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_method_check_authentication_for_host(self, client: Gitpod) -> None: - runner = client.runners.check_authentication_for_host( + def test_method_update_overload_2(self, client: Gitpod) -> None: + runner = client.runners.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) - assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: - runner = client.runners.check_authentication_for_host( + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + runner = client.runners.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, - host="host", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.check_authentication_for_host( + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.check_authentication_for_host( + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_runner_token(self, client: Gitpod) -> None: - runner = client.runners.create_runner_token( + def test_method_list(self, client: Gitpod) -> None: + runner = client.runners.list( + encoding="proto", connect_protocol_version=1, ) - assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize - def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: - runner = client.runners.create_runner_token( + def test_method_list_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.list( + encoding="proto", connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) - assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize - def test_raw_response_create_runner_token(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.create_runner_token( + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize - def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.create_runner_token( + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + assert_matches_type(RunnerListResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_method_delete_runner(self, client: Gitpod) -> None: - runner = client.runners.delete_runner( + def test_method_delete(self, client: Gitpod) -> None: + runner = client.runners.delete( connect_protocol_version=1, ) assert_matches_type(object, runner, path=["response"]) @parametrize - def test_method_delete_runner_with_all_params(self, client: Gitpod) -> None: - runner = client.runners.delete_runner( + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.delete( connect_protocol_version=1, force=True, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -260,8 +271,8 @@ def test_method_delete_runner_with_all_params(self, client: Gitpod) -> None: assert_matches_type(object, runner, path=["response"]) @parametrize - def test_raw_response_delete_runner(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.delete_runner( + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.delete( connect_protocol_version=1, ) @@ -271,8 +282,8 @@ def test_raw_response_delete_runner(self, client: Gitpod) -> None: assert_matches_type(object, runner, path=["response"]) @parametrize - def test_streaming_response_delete_runner(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.delete_runner( + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.delete( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -284,169 +295,124 @@ def test_streaming_response_delete_runner(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_get_runner(self, client: Gitpod) -> None: - runner = client.runners.get_runner( + def test_method_check_authentication_for_host(self, client: Gitpod) -> None: + runner = client.runners.check_authentication_for_host( connect_protocol_version=1, ) - assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize - def test_method_get_runner_with_all_params(self, client: Gitpod) -> None: - runner = client.runners.get_runner( + def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.check_authentication_for_host( connect_protocol_version=1, + host="host", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize - def test_raw_response_get_runner(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.get_runner( + def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.check_authentication_for_host( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize - def test_streaming_response_get_runner(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.get_runner( + def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.check_authentication_for_host( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_method_parse_context_url(self, client: Gitpod) -> None: - runner = client.runners.parse_context_url( + def test_method_create_runner_token(self, client: Gitpod) -> None: + runner = client.runners.create_runner_token( connect_protocol_version=1, ) - assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize - def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: - runner = client.runners.parse_context_url( + def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.create_runner_token( connect_protocol_version=1, - context_url="https://example.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - - @parametrize - def test_raw_response_parse_context_url(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.parse_context_url( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner = response.parse() - assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - - @parametrize - def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.parse_context_url( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner = response.parse() - assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_runner_overload_1(self, client: Gitpod) -> None: - runner = client.runners.update_runner( - name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - def test_method_update_runner_with_all_params_overload_1(self, client: Gitpod) -> None: - runner = client.runners.update_runner( - name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize - def test_raw_response_update_runner_overload_1(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.update_runner( - name="xxx", + def test_raw_response_create_runner_token(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.create_runner_token( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize - def test_streaming_response_update_runner_overload_1(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.update_runner( - name="xxx", + def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.create_runner_token( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_runner_overload_2(self, client: Gitpod) -> None: - runner = client.runners.update_runner( - spec={"configuration": {"auto_update": True}}, + def test_method_parse_context_url(self, client: Gitpod) -> None: + runner = client.runners.parse_context_url( connect_protocol_version=1, ) - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize - def test_method_update_runner_with_all_params_overload_2(self, client: Gitpod) -> None: - runner = client.runners.update_runner( - spec={"configuration": {"auto_update": True}}, + def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.parse_context_url( connect_protocol_version=1, + context_url="https://example.com", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize - def test_raw_response_update_runner_overload_2(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.update_runner( - spec={"configuration": {"auto_update": True}}, + def test_raw_response_parse_context_url(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.parse_context_url( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize - def test_streaming_response_update_runner_overload_2(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.update_runner( - spec={"configuration": {"auto_update": True}}, + def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.parse_context_url( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True @@ -506,6 +472,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( + encoding="proto", connect_protocol_version=1, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -513,8 +480,12 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( + encoding="proto", connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -522,6 +493,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.retrieve( + encoding="proto", connect_protocol_version=1, ) @@ -533,6 +505,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.retrieve( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -544,143 +517,148 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_list(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.list( + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update( + name="xxx", connect_protocol_version=1, ) - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.list( + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update( + name="xxx", connect_protocol_version=1, - filter={ - "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "kinds": ["RUNNER_KIND_UNSPECIFIED"], - }, - pagination={ - "token": "token", - "page_size": 100, - }, connect_timeout_ms=0, ) - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.list( + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.update( + name="xxx", connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.list( + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.update( + name="xxx", connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.check_authentication_for_host( + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) - assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.check_authentication_for_host( + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, - host="host", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.check_authentication_for_host( + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.check_authentication_for_host( + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + assert_matches_type(object, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.create_runner_token( + async def test_method_list(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.list( + encoding="proto", connect_protocol_version=1, ) - assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize - async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.create_runner_token( + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.list( + encoding="proto", connect_protocol_version=1, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + base64=True, + compression="identity", + connect="v1", + message="message", connect_timeout_ms=0, ) - assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize - async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.create_runner_token( + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.list( + encoding="proto", connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + assert_matches_type(RunnerListResponse, runner, path=["response"]) @parametrize - async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.create_runner_token( + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.list( + encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + assert_matches_type(RunnerListResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_method_delete_runner(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.delete_runner( + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.delete( connect_protocol_version=1, ) assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_method_delete_runner_with_all_params(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.delete_runner( + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.delete( connect_protocol_version=1, force=True, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -689,8 +667,8 @@ async def test_method_delete_runner_with_all_params(self, async_client: AsyncGit assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_raw_response_delete_runner(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.delete_runner( + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.delete( connect_protocol_version=1, ) @@ -700,8 +678,8 @@ async def test_raw_response_delete_runner(self, async_client: AsyncGitpod) -> No assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_streaming_response_delete_runner(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.delete_runner( + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.delete( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -713,168 +691,123 @@ async def test_streaming_response_delete_runner(self, async_client: AsyncGitpod) assert cast(Any, response.is_closed) is True @parametrize - async def test_method_get_runner(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.get_runner( + async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.check_authentication_for_host( connect_protocol_version=1, ) - assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize - async def test_method_get_runner_with_all_params(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.get_runner( + async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.check_authentication_for_host( connect_protocol_version=1, + host="host", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize - async def test_raw_response_get_runner(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.get_runner( + async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.check_authentication_for_host( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize - async def test_streaming_response_get_runner(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.get_runner( + async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.check_authentication_for_host( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerGetRunnerResponse, runner, path=["response"]) + assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.parse_context_url( + async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create_runner_token( connect_protocol_version=1, ) - assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize - async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.parse_context_url( + async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create_runner_token( connect_protocol_version=1, - context_url="https://example.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - - @parametrize - async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.parse_context_url( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner = await response.parse() - assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - - @parametrize - async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.parse_context_url( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner = await response.parse() - assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update_runner( - name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - async def test_method_update_runner_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update_runner( - name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize - async def test_raw_response_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.update_runner( - name="xxx", + async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.create_runner_token( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize - async def test_streaming_response_update_runner_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.update_runner( - name="xxx", + async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.create_runner_token( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update_runner( - spec={"configuration": {"auto_update": True}}, + async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.parse_context_url( connect_protocol_version=1, ) - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize - async def test_method_update_runner_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update_runner( - spec={"configuration": {"auto_update": True}}, + async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.parse_context_url( connect_protocol_version=1, + context_url="https://example.com", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize - async def test_raw_response_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.update_runner( - spec={"configuration": {"auto_update": True}}, + async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.parse_context_url( connect_protocol_version=1, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize - async def test_streaming_response_update_runner_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.update_runner( - spec={"configuration": {"auto_update": True}}, + async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.parse_context_url( connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(object, runner, path=["response"]) + assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py new file mode 100644 index 00000000..a1936fad --- /dev/null +++ b/tests/api_resources/test_secrets.py @@ -0,0 +1,560 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + SecretListResponse, + SecretCreateResponse, + SecretGetValueResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSecrets: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create_overload_1(self, client: Gitpod) -> None: + secret = client.secrets.create( + environment_variable=True, + connect_protocol_version=1, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: + secret = client.secrets.create( + environment_variable=True, + connect_protocol_version=1, + name="name", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + value="x", + connect_timeout_ms=0, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + def test_raw_response_create_overload_1(self, client: Gitpod) -> None: + response = client.secrets.with_raw_response.create( + environment_variable=True, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: + with client.secrets.with_streaming_response.create( + environment_variable=True, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_2(self, client: Gitpod) -> None: + secret = client.secrets.create( + file_path="filePath", + connect_protocol_version=1, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: + secret = client.secrets.create( + file_path="filePath", + connect_protocol_version=1, + name="name", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + value="x", + connect_timeout_ms=0, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + def test_raw_response_create_overload_2(self, client: Gitpod) -> None: + response = client.secrets.with_raw_response.create( + file_path="filePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: + with client.secrets.with_streaming_response.create( + file_path="filePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + secret = client.secrets.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(SecretListResponse, secret, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + secret = client.secrets.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(SecretListResponse, secret, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.secrets.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(SecretListResponse, secret, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.secrets.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(SecretListResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + secret = client.secrets.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, secret, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + secret = client.secrets.delete( + connect_protocol_version=1, + secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, secret, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.secrets.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(object, secret, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.secrets.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(object, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_value(self, client: Gitpod) -> None: + secret = client.secrets.get_value( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + + @parametrize + def test_method_get_value_with_all_params(self, client: Gitpod) -> None: + secret = client.secrets.get_value( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + + @parametrize + def test_raw_response_get_value(self, client: Gitpod) -> None: + response = client.secrets.with_raw_response.get_value( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + + @parametrize + def test_streaming_response_get_value(self, client: Gitpod) -> None: + with client.secrets.with_streaming_response.get_value( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_value(self, client: Gitpod) -> None: + secret = client.secrets.update_value( + connect_protocol_version=1, + ) + assert_matches_type(object, secret, path=["response"]) + + @parametrize + def test_method_update_value_with_all_params(self, client: Gitpod) -> None: + secret = client.secrets.update_value( + connect_protocol_version=1, + secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + value="x", + connect_timeout_ms=0, + ) + assert_matches_type(object, secret, path=["response"]) + + @parametrize + def test_raw_response_update_value(self, client: Gitpod) -> None: + response = client.secrets.with_raw_response.update_value( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(object, secret, path=["response"]) + + @parametrize + def test_streaming_response_update_value(self, client: Gitpod) -> None: + with client.secrets.with_streaming_response.update_value( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(object, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncSecrets: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.create( + environment_variable=True, + connect_protocol_version=1, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.create( + environment_variable=True, + connect_protocol_version=1, + name="name", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + value="x", + connect_timeout_ms=0, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.secrets.with_raw_response.create( + environment_variable=True, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.secrets.with_streaming_response.create( + environment_variable=True, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.create( + file_path="filePath", + connect_protocol_version=1, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.create( + file_path="filePath", + connect_protocol_version=1, + name="name", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + value="x", + connect_timeout_ms=0, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.secrets.with_raw_response.create( + file_path="filePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.secrets.with_streaming_response.create( + file_path="filePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(SecretListResponse, secret, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(SecretListResponse, secret, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.secrets.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(SecretListResponse, secret, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.secrets.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(SecretListResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, secret, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.delete( + connect_protocol_version=1, + secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, secret, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.secrets.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(object, secret, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.secrets.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(object, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_value(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.get_value( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + + @parametrize + async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.get_value( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + + @parametrize + async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: + response = await async_client.secrets.with_raw_response.get_value( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + + @parametrize + async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> None: + async with async_client.secrets.with_streaming_response.get_value( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_value(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.update_value( + connect_protocol_version=1, + ) + assert_matches_type(object, secret, path=["response"]) + + @parametrize + async def test_method_update_value_with_all_params(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.update_value( + connect_protocol_version=1, + secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + value="x", + connect_timeout_ms=0, + ) + assert_matches_type(object, secret, path=["response"]) + + @parametrize + async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> None: + response = await async_client.secrets.with_raw_response.update_value( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(object, secret, path=["response"]) + + @parametrize + async def test_streaming_response_update_value(self, async_client: AsyncGitpod) -> None: + async with async_client.secrets.with_streaming_response.update_value( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(object, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py new file mode 100644 index 00000000..84d9bfa2 --- /dev/null +++ b/tests/api_resources/test_users.py @@ -0,0 +1,198 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import UserGetAuthenticatedUserResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestUsers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get_authenticated_user(self, client: Gitpod) -> None: + user = client.users.get_authenticated_user( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + @parametrize + def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> None: + user = client.users.get_authenticated_user( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + @parametrize + def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: + response = client.users.with_raw_response.get_authenticated_user( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + @parametrize + def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None: + with client.users.with_streaming_response.get_authenticated_user( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_set_suspended(self, client: Gitpod) -> None: + user = client.users.set_suspended( + connect_protocol_version=1, + ) + assert_matches_type(object, user, path=["response"]) + + @parametrize + def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: + user = client.users.set_suspended( + connect_protocol_version=1, + suspended=True, + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, user, path=["response"]) + + @parametrize + def test_raw_response_set_suspended(self, client: Gitpod) -> None: + response = client.users.with_raw_response.set_suspended( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(object, user, path=["response"]) + + @parametrize + def test_streaming_response_set_suspended(self, client: Gitpod) -> None: + with client.users.with_streaming_response.set_suspended( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(object, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncUsers: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.get_authenticated_user( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + @parametrize + async def test_method_get_authenticated_user_with_all_params(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.get_authenticated_user( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + @parametrize + async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.with_raw_response.get_authenticated_user( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + @parametrize + async def test_streaming_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: + async with async_client.users.with_streaming_response.get_authenticated_user( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.set_suspended( + connect_protocol_version=1, + ) + assert_matches_type(object, user, path=["response"]) + + @parametrize + async def test_method_set_suspended_with_all_params(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.set_suspended( + connect_protocol_version=1, + suspended=True, + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, user, path=["response"]) + + @parametrize + async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.with_raw_response.set_suspended( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(object, user, path=["response"]) + + @parametrize + async def test_streaming_response_set_suspended(self, async_client: AsyncGitpod) -> None: + async with async_client.users.with_streaming_response.set_suspended( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(object, user, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/users/__init__.py b/tests/api_resources/users/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/users/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py new file mode 100644 index 00000000..cd34d91c --- /dev/null +++ b/tests/api_resources/users/test_pats.py @@ -0,0 +1,290 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.users import PatGetResponse, PatListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPats: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Gitpod) -> None: + pat = client.users.pats.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(PatListResponse, pat, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + pat = client.users.pats.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(PatListResponse, pat, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.users.pats.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pat = response.parse() + assert_matches_type(PatListResponse, pat, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.users.pats.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pat = response.parse() + assert_matches_type(PatListResponse, pat, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + pat = client.users.pats.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, pat, path=["response"]) + + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + pat = client.users.pats.delete( + connect_protocol_version=1, + personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, pat, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.users.pats.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pat = response.parse() + assert_matches_type(object, pat, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.users.pats.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pat = response.parse() + assert_matches_type(object, pat, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get(self, client: Gitpod) -> None: + pat = client.users.pats.get( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(PatGetResponse, pat, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Gitpod) -> None: + pat = client.users.pats.get( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(PatGetResponse, pat, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Gitpod) -> None: + response = client.users.pats.with_raw_response.get( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pat = response.parse() + assert_matches_type(PatGetResponse, pat, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Gitpod) -> None: + with client.users.pats.with_streaming_response.get( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pat = response.parse() + assert_matches_type(PatGetResponse, pat, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncPats: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + pat = await async_client.users.pats.list( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(PatListResponse, pat, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + pat = await async_client.users.pats.list( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(PatListResponse, pat, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.pats.with_raw_response.list( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pat = await response.parse() + assert_matches_type(PatListResponse, pat, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.users.pats.with_streaming_response.list( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pat = await response.parse() + assert_matches_type(PatListResponse, pat, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + pat = await async_client.users.pats.delete( + connect_protocol_version=1, + ) + assert_matches_type(object, pat, path=["response"]) + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + pat = await async_client.users.pats.delete( + connect_protocol_version=1, + personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(object, pat, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.pats.with_raw_response.delete( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pat = await response.parse() + assert_matches_type(object, pat, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.users.pats.with_streaming_response.delete( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pat = await response.parse() + assert_matches_type(object, pat, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get(self, async_client: AsyncGitpod) -> None: + pat = await async_client.users.pats.get( + encoding="proto", + connect_protocol_version=1, + ) + assert_matches_type(PatGetResponse, pat, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: + pat = await async_client.users.pats.get( + encoding="proto", + connect_protocol_version=1, + base64=True, + compression="identity", + connect="v1", + message="message", + connect_timeout_ms=0, + ) + assert_matches_type(PatGetResponse, pat, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.pats.with_raw_response.get( + encoding="proto", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pat = await response.parse() + assert_matches_type(PatGetResponse, pat, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: + async with async_client.users.pats.with_streaming_response.get( + encoding="proto", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pat = await response.parse() + assert_matches_type(PatGetResponse, pat, path=["response"]) + + assert cast(Any, response.is_closed) is True From 7439e411b745f19a63a08861e4a5809e6ca181e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:21:11 +0000 Subject: [PATCH 056/505] feat(api): update via SDK Studio --- src/gitpod/pagination.py | 349 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 349 insertions(+) create mode 100644 src/gitpod/pagination.py diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py new file mode 100644 index 00000000..f3baede5 --- /dev/null +++ b/src/gitpod/pagination.py @@ -0,0 +1,349 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Generic, TypeVar, Optional +from typing_extensions import override + +from pydantic import Field as FieldInfo + +from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage + +__all__ = [ + "SyncServicesPage", + "AsyncServicesPage", + "SyncTasksPage", + "AsyncTasksPage", + "SyncTaskExecutionsPage", + "AsyncTaskExecutionsPage", + "SyncEnvironnmentClassesPage", + "AsyncEnvironnmentClassesPage", + "SyncEnvironmentsPage", + "AsyncEnvironmentsPage", + "SyncEntriesPage", + "AsyncEntriesPage", + "SyncGroupsPage", + "AsyncGroupsPage", + "SyncMembersPage", + "AsyncMembersPage", +] + +_T = TypeVar("_T") + + +class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + services: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + services = self.services + if not services: + return [] + return services + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + services: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + services = self.services + if not services: + return [] + return services + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + tasks: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + tasks = self.tasks + if not tasks: + return [] + return tasks + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + tasks: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + tasks = self.tasks + if not tasks: + return [] + return tasks + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + task_executions: List[_T] = FieldInfo(alias="taskExecutions") + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + task_executions = self.task_executions + if not task_executions: + return [] + return task_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + task_executions: List[_T] = FieldInfo(alias="taskExecutions") + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + task_executions = self.task_executions + if not task_executions: + return [] + return task_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncEnvironnmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environment_classes = self.environment_classes + if not environment_classes: + return [] + return environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEnvironnmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environment_classes = self.environment_classes + if not environment_classes: + return [] + return environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + environments: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environments = self.environments + if not environments: + return [] + return environments + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEnvironmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + environments: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environments = self.environments + if not environments: + return [] + return environments + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + entries: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + entries = self.entries + if not entries: + return [] + return entries + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEntriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + entries: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + entries = self.entries + if not entries: + return [] + return entries + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + groups: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + groups = self.groups + if not groups: + return [] + return groups + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncGroupsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + groups: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + groups = self.groups + if not groups: + return [] + return groups + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + members: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + members = self.members + if not members: + return [] + return members + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + members: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + members = self.members + if not members: + return [] + return members + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) From b5c2fe28a669c1395c60f3d0aa7f7fc9dcf78d6a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 19:47:19 +0000 Subject: [PATCH 057/505] feat(api): update via SDK Studio --- src/gitpod/pagination.py | 642 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 592 insertions(+), 50 deletions(-) diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index f3baede5..c9ab21f2 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -8,37 +8,59 @@ from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ + "SyncPersonalAccessTokensPage", + "AsyncPersonalAccessTokensPage", + "SyncOrganizationsPage", + "AsyncOrganizationsPage", + "SyncMembersPage", + "AsyncMembersPage", + "SyncSSOConfigurationsPage", + "AsyncSSOConfigurationsPage", + "SyncLoginProvidersPage", + "AsyncLoginProvidersPage", + "SyncEditorsPage", + "AsyncEditorsPage", + "SyncTokensPage", + "AsyncTokensPage", + "SyncIntegrationsPage", + "AsyncIntegrationsPage", + "SyncEnvironmentClassesPage", + "AsyncEnvironmentClassesPage", + "SyncRunnersPage", + "AsyncRunnersPage", + "SyncPoliciesPage", + "AsyncPoliciesPage", + "SyncEnvironmentsPage", + "AsyncEnvironmentsPage", "SyncServicesPage", "AsyncServicesPage", "SyncTasksPage", "AsyncTasksPage", "SyncTaskExecutionsPage", "AsyncTaskExecutionsPage", - "SyncEnvironnmentClassesPage", - "AsyncEnvironnmentClassesPage", - "SyncEnvironmentsPage", - "AsyncEnvironmentsPage", "SyncEntriesPage", "AsyncEntriesPage", "SyncGroupsPage", "AsyncGroupsPage", - "SyncMembersPage", - "AsyncMembersPage", + "SyncProjectsPage", + "AsyncProjectsPage", + "SyncSecretsPage", + "AsyncSecretsPage", ] _T = TypeVar("_T") -class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] +class SyncPersonalAccessTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + personal_access_tokens: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override def _get_page_items(self) -> List[_T]: - services = self.services - if not services: + personal_access_tokens = self.personal_access_tokens + if not personal_access_tokens: return [] - return services + return personal_access_tokens @override def next_page_info(self) -> Optional[PageInfo]: @@ -49,16 +71,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] +class AsyncPersonalAccessTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + personal_access_tokens: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override def _get_page_items(self) -> List[_T]: - services = self.services - if not services: + personal_access_tokens = self.personal_access_tokens + if not personal_access_tokens: return [] - return services + return personal_access_tokens @override def next_page_info(self) -> Optional[PageInfo]: @@ -69,16 +91,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] +class SyncOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + organizations: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override def _get_page_items(self) -> List[_T]: - tasks = self.tasks - if not tasks: + organizations = self.organizations + if not organizations: return [] - return tasks + return organizations @override def next_page_info(self) -> Optional[PageInfo]: @@ -89,16 +111,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] +class AsyncOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + organizations: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override def _get_page_items(self) -> List[_T]: - tasks = self.tasks - if not tasks: + organizations = self.organizations + if not organizations: return [] - return tasks + return organizations @override def next_page_info(self) -> Optional[PageInfo]: @@ -109,16 +131,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] = FieldInfo(alias="taskExecutions") +class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + members: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions - if not task_executions: + members = self.members + if not members: return [] - return task_executions + return members @override def next_page_info(self) -> Optional[PageInfo]: @@ -129,16 +151,216 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] = FieldInfo(alias="taskExecutions") +class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + members: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions - if not task_executions: + members = self.members + if not members: return [] - return task_executions + return members + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncSSOConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + sso_configurations: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + sso_configurations = self.sso_configurations + if not sso_configurations: + return [] + return sso_configurations + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncSSOConfigurationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + sso_configurations: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + sso_configurations = self.sso_configurations + if not sso_configurations: + return [] + return sso_configurations + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncLoginProvidersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + login_providers: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + login_providers = self.login_providers + if not login_providers: + return [] + return login_providers + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncLoginProvidersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + login_providers: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + login_providers = self.login_providers + if not login_providers: + return [] + return login_providers + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncEditorsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + editors: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + editors = self.editors + if not editors: + return [] + return editors + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEditorsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + editors: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + editors = self.editors + if not editors: + return [] + return editors + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + tokens: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + tokens = self.tokens + if not tokens: + return [] + return tokens + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + tokens: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + tokens = self.tokens + if not tokens: + return [] + return tokens + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncIntegrationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + integrations: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + integrations = self.integrations + if not integrations: + return [] + return integrations + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncIntegrationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + integrations: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + integrations = self.integrations + if not integrations: + return [] + return integrations @override def next_page_info(self) -> Optional[PageInfo]: @@ -149,8 +371,8 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SyncEnvironnmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] = FieldInfo(alias="environmentClasses") +class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override @@ -169,8 +391,8 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncEnvironnmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] = FieldInfo(alias="environmentClasses") +class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override @@ -189,6 +411,86 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class SyncRunnersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + runners: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + runners = self.runners + if not runners: + return [] + return runners + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncRunnersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + runners: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + runners = self.runners + if not runners: + return [] + return runners + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + policies: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + policies = self.policies + if not policies: + return [] + return policies + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + policies: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + policies = self.policies + if not policies: + return [] + return policies + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): environments: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -229,6 +531,166 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environment_classes = self.environment_classes + if not environment_classes: + return [] + return environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + environment_classes = self.environment_classes + if not environment_classes: + return [] + return environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + services: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + services = self.services + if not services: + return [] + return services + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + services: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + services = self.services + if not services: + return [] + return services + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + tasks: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + tasks = self.tasks + if not tasks: + return [] + return tasks + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + tasks: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + tasks = self.tasks + if not tasks: + return [] + return tasks + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + task_executions: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + task_executions = self.task_executions + if not task_executions: + return [] + return task_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + task_executions: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + task_executions = self.task_executions + if not task_executions: + return [] + return task_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): entries: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -309,16 +771,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] +class SyncProjectsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + projects: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override def _get_page_items(self) -> List[_T]: - members = self.members - if not members: + projects = self.projects + if not projects: return [] - return members + return projects @override def next_page_info(self) -> Optional[PageInfo]: @@ -329,16 +791,96 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] +class AsyncProjectsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + projects: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @override def _get_page_items(self) -> List[_T]: - members = self.members - if not members: + projects = self.projects + if not projects: return [] - return members + return projects + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + policies: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + policies = self.policies + if not policies: + return [] + return policies + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + policies: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + policies = self.policies + if not policies: + return [] + return policies + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class SyncSecretsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + secrets: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + secrets = self.secrets + if not secrets: + return [] + return secrets + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = self.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncSecretsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + secrets: List[_T] + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + @override + def _get_page_items(self) -> List[_T]: + secrets = self.secrets + if not secrets: + return [] + return secrets @override def next_page_info(self) -> Optional[PageInfo]: From 21007275d7c67e4a8483a00d0ebd5822b5fe031b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 07:55:35 +0000 Subject: [PATCH 058/505] feat(api): update via SDK Studio --- .stats.yml | 2 +- .../resources/environments/environments.py | 123 +--- src/gitpod/resources/events.py | 126 +++- .../resources/organizations/organizations.py | 232 +++--- .../organizations/sso_configurations.py | 365 +--------- src/gitpod/resources/projects/projects.py | 371 +--------- .../runners/configurations/configurations.py | 96 ++- .../configurations/environment_classes.py | 199 +----- .../host_authentication_tokens.py | 377 +--------- .../configurations/scm_integrations.py | 381 +--------- src/gitpod/resources/runners/runners.py | 151 +--- src/gitpod/resources/secrets.py | 144 +++- src/gitpod/types/account_retrieve_response.py | 504 ++++++++++++- src/gitpod/types/editor_list_response.py | 2 + src/gitpod/types/editor_retrieve_response.py | 2 + .../environment_create_from_project_params.py | 156 +++- ...nvironment_create_from_project_response.py | 155 +++- src/gitpod/types/environment_create_params.py | 156 +++- .../types/environment_create_response.py | 155 +++- src/gitpod/types/environment_list_response.py | 155 +++- .../types/environment_retrieve_response.py | 155 +++- src/gitpod/types/environment_update_params.py | 290 +------- .../environments/automation_upsert_params.py | 26 +- .../automations/service_create_params.py | 48 +- .../automations/service_create_response.py | 50 +- .../automations/service_list_response.py | 50 +- .../automations/service_retrieve_response.py | 50 +- .../automations/service_update_params.py | 133 +--- .../automations/task_create_params.py | 48 +- .../automations/task_create_response.py | 50 +- .../automations/task_list_response.py | 50 +- .../automations/task_retrieve_response.py | 50 +- .../automations/task_start_response.py | 100 ++- .../automations/task_update_params.py | 81 +-- .../tasks/execution_list_response.py | 100 ++- .../tasks/execution_retrieve_response.py | 100 ++- src/gitpod/types/event_watch_params.py | 57 +- src/gitpod/types/organization_join_params.py | 35 +- .../types/organization_update_params.py | 38 +- .../sso_configuration_update_params.py | 73 +- ...roject_create_from_environment_response.py | 139 +++- src/gitpod/types/project_create_params.py | 141 +++- src/gitpod/types/project_create_response.py | 139 +++- src/gitpod/types/project_list_response.py | 139 +++- src/gitpod/types/project_retrieve_response.py | 139 +++- src/gitpod/types/project_update_params.py | 167 +---- src/gitpod/types/project_update_response.py | 139 +++- src/gitpod/types/runner_create_params.py | 12 + src/gitpod/types/runner_create_response.py | 14 + src/gitpod/types/runner_list_response.py | 14 + src/gitpod/types/runner_retrieve_response.py | 14 + src/gitpod/types/runner_update_params.py | 87 +-- .../runners/configuration_validate_params.py | 127 ++-- .../configuration_validate_response.py | 70 +- .../environment_class_update_params.py | 32 +- ...host_authentication_token_update_params.py | 123 +--- .../schema_retrieve_response.py | 490 ++++++++++++- .../scm_integration_create_params.py | 41 +- .../scm_integration_list_response.py | 52 +- .../scm_integration_retrieve_response.py | 66 +- .../scm_integration_update_params.py | 69 +- src/gitpod/types/secret_create_params.py | 62 +- src/gitpod/types/secret_create_response.py | 676 +++++++++++++++++- src/gitpod/types/secret_list_response.py | 259 ++++++- .../environments/automations/test_services.py | 28 +- .../environments/automations/test_tasks.py | 24 +- .../organizations/test_sso_configurations.py | 392 +--------- .../test_environment_classes.py | 214 +----- .../test_host_authentication_tokens.py | 214 +----- .../configurations/test_scm_integrations.py | 346 ++------- .../runners/test_configurations.py | 152 +++- tests/api_resources/test_environments.py | 194 +++-- tests/api_resources/test_events.py | 86 +++ tests/api_resources/test_organizations.py | 212 +++--- tests/api_resources/test_projects.py | 462 +++--------- tests/api_resources/test_runners.py | 128 +--- tests/api_resources/test_secrets.py | 92 +++ 77 files changed, 5875 insertions(+), 5316 deletions(-) diff --git a/.stats.yml b/.stats.yml index ef35b8b8..dc330120 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fc48decca7519160b9146df6a972d3a28e692fc1d555d9085e03feb88c196711.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-69a0fc74a7438a8961de8a3254bdb714a3062e4c77b5e2e1fb037baafeeac9ce.yml diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index edba88c0..49609540 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx @@ -29,7 +29,6 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -214,11 +213,10 @@ def retrieve( cast_to=EnvironmentRetrieveResponse, ) - @overload def update( self, *, - metadata: object, + body: environment_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -244,55 +242,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - *, - spec: environment_update_params.Variant1Spec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironment updates the environment partially. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["metadata", "connect_protocol_version"], ["spec", "connect_protocol_version"]) - def update( - self, - *, - metadata: object | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -304,13 +253,7 @@ def update( } return self._post( "/gitpod.v1.EnvironmentService/UpdateEnvironment", - body=maybe_transform( - { - "metadata": metadata, - "spec": spec, - }, - environment_update_params.EnvironmentUpdateParams, - ), + body=maybe_transform(body, environment_update_params.EnvironmentUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -885,11 +828,10 @@ async def retrieve( cast_to=EnvironmentRetrieveResponse, ) - @overload async def update( self, *, - metadata: object, + body: environment_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -915,55 +857,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - *, - spec: environment_update_params.Variant1Spec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironment updates the environment partially. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["metadata", "connect_protocol_version"], ["spec", "connect_protocol_version"]) - async def update( - self, - *, - metadata: object | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -975,13 +868,7 @@ async def update( } return await self._post( "/gitpod.v1.EnvironmentService/UpdateEnvironment", - body=await async_maybe_transform( - { - "metadata": metadata, - "spec": spec, - }, - environment_update_params.EnvironmentUpdateParams, - ), + body=await async_maybe_transform(body, environment_update_params.EnvironmentUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index 4dc3ff5a..b7ecd014 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -129,6 +129,7 @@ def watch( *, environment_id: str, connect_protocol_version: Literal[1], + organization: bool | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -148,6 +149,11 @@ def watch( connect_protocol_version: Define the version of the Connect protocol + organization: Organization scope produces events for all projects, runners and environments + + the caller can see within their organization. No task, task execution or service + events are produed. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -166,6 +172,7 @@ def watch( *, organization: bool, connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -185,6 +192,11 @@ def watch( connect_protocol_version: Define the version of the Connect protocol + environment_id: Environment scope produces events for the environment itself, all tasks, task + executions, + + and services associated with that environment. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -197,14 +209,61 @@ def watch( """ ... - @required_args(["environment_id", "connect_protocol_version"], ["organization", "connect_protocol_version"]) + @overload def watch( self, *, - environment_id: str | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + organization: bool | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventWatchResponse: + """ + WatchEvents streams all requests events to the client + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: Environment scope produces events for the environment itself, all tasks, task + executions, + + and services associated with that environment. + + organization: Organization scope produces events for all projects, runners and environments + + the caller can see within their organization. No task, task execution or service + events are produed. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["environment_id", "connect_protocol_version"], + ["organization", "connect_protocol_version"], + ["connect_protocol_version"], + ) + def watch( + self, + *, + environment_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], organization: bool | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -337,6 +396,7 @@ async def watch( *, environment_id: str, connect_protocol_version: Literal[1], + organization: bool | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -356,6 +416,11 @@ async def watch( connect_protocol_version: Define the version of the Connect protocol + organization: Organization scope produces events for all projects, runners and environments + + the caller can see within their organization. No task, task execution or service + events are produed. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -374,6 +439,7 @@ async def watch( *, organization: bool, connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -393,6 +459,11 @@ async def watch( connect_protocol_version: Define the version of the Connect protocol + environment_id: Environment scope produces events for the environment itself, all tasks, task + executions, + + and services associated with that environment. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -405,14 +476,61 @@ async def watch( """ ... - @required_args(["environment_id", "connect_protocol_version"], ["organization", "connect_protocol_version"]) + @overload async def watch( self, *, - environment_id: str | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], + environment_id: str | NotGiven = NOT_GIVEN, + organization: bool | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventWatchResponse: + """ + WatchEvents streams all requests events to the client + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_id: Environment scope produces events for the environment itself, all tasks, task + executions, + + and services associated with that environment. + + organization: Organization scope produces events for all projects, runners and environments + + the caller can see within their organization. No task, task execution or service + events are produed. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["environment_id", "connect_protocol_version"], + ["organization", "connect_protocol_version"], + ["connect_protocol_version"], + ) + async def watch( + self, + *, + environment_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], organization: bool | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 04dddd1a..70483783 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -224,45 +224,10 @@ def retrieve( cast_to=OrganizationRetrieveResponse, ) - @overload - def update( - self, - *, - invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationUpdateResponse: - """ - UpdateOrganization updates the properties of an Organization. - - Args: - invite_domains: invite_domains is the domain allowlist of the organization - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload def update( self, *, - name: str, + body: organization_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -276,8 +241,6 @@ def update( UpdateOrganization updates the properties of an Organization. Args: - name: name is the new name of the organization - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -290,24 +253,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["invite_domains", "connect_protocol_version"], ["name", "connect_protocol_version"]) - def update( - self, - *, - invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains - | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationUpdateResponse: extra_headers = { **strip_not_given( { @@ -319,13 +264,7 @@ def update( } return self._post( "/gitpod.v1.OrganizationService/UpdateOrganization", - body=maybe_transform( - { - "invite_domains": invite_domains, - "name": name, - }, - organization_update_params.OrganizationUpdateParams, - ), + body=maybe_transform(body, organization_update_params.OrganizationUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -461,6 +400,7 @@ def join( *, invite_id: str, connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -477,6 +417,8 @@ def join( connect_protocol_version: Define the version of the Connect protocol + organization_id: organization_id is the unique identifier of the Organization to join. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -495,6 +437,7 @@ def join( *, organization_id: str, connect_protocol_version: Literal[1], + invite_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -511,6 +454,8 @@ def join( connect_protocol_version: Define the version of the Connect protocol + invite_id: invite_id is the unique identifier of the invite to join the organization. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -523,14 +468,55 @@ def join( """ ... - @required_args(["invite_id", "connect_protocol_version"], ["organization_id", "connect_protocol_version"]) + @overload def join( self, *, - invite_id: str | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], + invite_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationJoinResponse: + """ + JoinOrganization lets accounts join an Organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + invite_id: invite_id is the unique identifier of the invite to join the organization. + + organization_id: organization_id is the unique identifier of the Organization to join. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["invite_id", "connect_protocol_version"], + ["organization_id", "connect_protocol_version"], + ["connect_protocol_version"], + ) + def join( + self, + *, + invite_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -903,45 +889,10 @@ async def retrieve( cast_to=OrganizationRetrieveResponse, ) - @overload - async def update( - self, - *, - invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationUpdateResponse: - """ - UpdateOrganization updates the properties of an Organization. - - Args: - invite_domains: invite_domains is the domain allowlist of the organization - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload async def update( self, *, - name: str, + body: organization_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -955,8 +906,6 @@ async def update( UpdateOrganization updates the properties of an Organization. Args: - name: name is the new name of the organization - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -969,24 +918,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["invite_domains", "connect_protocol_version"], ["name", "connect_protocol_version"]) - async def update( - self, - *, - invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains - | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationUpdateResponse: extra_headers = { **strip_not_given( { @@ -998,13 +929,7 @@ async def update( } return await self._post( "/gitpod.v1.OrganizationService/UpdateOrganization", - body=await async_maybe_transform( - { - "invite_domains": invite_domains, - "name": name, - }, - organization_update_params.OrganizationUpdateParams, - ), + body=await async_maybe_transform(body, organization_update_params.OrganizationUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1140,6 +1065,7 @@ async def join( *, invite_id: str, connect_protocol_version: Literal[1], + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1156,6 +1082,8 @@ async def join( connect_protocol_version: Define the version of the Connect protocol + organization_id: organization_id is the unique identifier of the Organization to join. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -1174,6 +1102,7 @@ async def join( *, organization_id: str, connect_protocol_version: Literal[1], + invite_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1190,6 +1119,8 @@ async def join( connect_protocol_version: Define the version of the Connect protocol + invite_id: invite_id is the unique identifier of the invite to join the organization. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -1202,14 +1133,55 @@ async def join( """ ... - @required_args(["invite_id", "connect_protocol_version"], ["organization_id", "connect_protocol_version"]) + @overload async def join( self, *, - invite_id: str | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], + invite_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationJoinResponse: + """ + JoinOrganization lets accounts join an Organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + invite_id: invite_id is the unique identifier of the invite to join the organization. + + organization_id: organization_id is the unique identifier of the Organization to join. + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["invite_id", "connect_protocol_version"], + ["organization_id", "connect_protocol_version"], + ["connect_protocol_version"], + ) + async def join( + self, + *, + invite_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 986668af..4dc3e3c8 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -2,14 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -197,11 +196,10 @@ def retrieve( cast_to=SSOConfigurationRetrieveResponse, ) - @overload def update( self, *, - client_id: str, + body: sso_configuration_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -215,8 +213,6 @@ def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: - client_id: client_id is the client ID of the SSO provider - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -229,171 +225,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - *, - client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - client_secret: client_secret is the client secret of the SSO provider - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - email_domain: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - issuer_url: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - issuer_url: issuer_url is the URL of the IdP issuer - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - state: Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ], - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - state: state is the state of the SSO configuration - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["client_id", "connect_protocol_version"], - ["client_secret", "connect_protocol_version"], - ["email_domain", "connect_protocol_version"], - ["issuer_url", "connect_protocol_version"], - ["state", "connect_protocol_version"], - ) - def update( - self, - *, - client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - client_secret: str | NotGiven = NOT_GIVEN, - email_domain: str | NotGiven = NOT_GIVEN, - issuer_url: str | NotGiven = NOT_GIVEN, - state: Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ] - | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -405,16 +236,7 @@ def update( } return self._post( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", - body=maybe_transform( - { - "client_id": client_id, - "client_secret": client_secret, - "email_domain": email_domain, - "issuer_url": issuer_url, - "state": state, - }, - sso_configuration_update_params.SSOConfigurationUpdateParams, - ), + body=maybe_transform(body, sso_configuration_update_params.SSOConfigurationUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -704,11 +526,10 @@ async def retrieve( cast_to=SSOConfigurationRetrieveResponse, ) - @overload async def update( self, *, - client_id: str, + body: sso_configuration_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -722,8 +543,6 @@ async def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: - client_id: client_id is the client ID of the SSO provider - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -736,171 +555,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - *, - client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - client_secret: client_secret is the client secret of the SSO provider - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - email_domain: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - issuer_url: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - issuer_url: issuer_url is the URL of the IdP issuer - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - state: Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ], - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - state: state is the state of the SSO configuration - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["client_id", "connect_protocol_version"], - ["client_secret", "connect_protocol_version"], - ["email_domain", "connect_protocol_version"], - ["issuer_url", "connect_protocol_version"], - ["state", "connect_protocol_version"], - ) - async def update( - self, - *, - client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - client_secret: str | NotGiven = NOT_GIVEN, - email_domain: str | NotGiven = NOT_GIVEN, - issuer_url: str | NotGiven = NOT_GIVEN, - state: Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ] - | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -912,16 +566,7 @@ async def update( } return await self._post( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", - body=await async_maybe_transform( - { - "client_id": client_id, - "client_secret": client_secret, - "email_domain": email_domain, - "issuer_url": issuer_url, - "state": state, - }, - sso_configuration_update_params.SSOConfigurationUpdateParams, - ), + body=await async_maybe_transform(body, sso_configuration_update_params.SSOConfigurationUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index b9a75132..4a9da9b3 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx @@ -17,7 +17,6 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -220,155 +219,10 @@ def retrieve( cast_to=ProjectRetrieveResponse, ) - @overload def update( self, *, - automations_file_path: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - automations_file_path: automations_file_path is the path to the automations file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches("^$|^[^/].*") - ``` - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - devcontainer_file_path: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches("^$|^[^/].*") - ``` - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - environment_class: project_update_params.Variant2EnvironmentClass, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - initializer: project_update_params.InitializerIsTheContentInitializerInitializer, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - initializer: EnvironmentInitializer specifies how an environment is to be initialized - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - name: str, + body: project_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -394,32 +248,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args( - ["automations_file_path", "connect_protocol_version"], - ["devcontainer_file_path", "connect_protocol_version"], - ["environment_class", "connect_protocol_version"], - ["initializer", "connect_protocol_version"], - ["name", "connect_protocol_version"], - ) - def update( - self, - *, - automations_file_path: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, - initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: extra_headers = { **strip_not_given( { @@ -431,16 +259,7 @@ def update( } return self._post( "/gitpod.v1.ProjectService/UpdateProject", - body=maybe_transform( - { - "automations_file_path": automations_file_path, - "devcontainer_file_path": devcontainer_file_path, - "environment_class": environment_class, - "initializer": initializer, - "name": name, - }, - project_update_params.ProjectUpdateParams, - ), + body=maybe_transform(body, project_update_params.ProjectUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -797,155 +616,10 @@ async def retrieve( cast_to=ProjectRetrieveResponse, ) - @overload async def update( self, *, - automations_file_path: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - automations_file_path: automations_file_path is the path to the automations file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches("^$|^[^/].*") - ``` - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - devcontainer_file_path: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches("^$|^[^/].*") - ``` - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - environment_class: project_update_params.Variant2EnvironmentClass, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - initializer: project_update_params.InitializerIsTheContentInitializerInitializer, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - initializer: EnvironmentInitializer specifies how an environment is to be initialized - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - name: str, + body: project_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -971,32 +645,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args( - ["automations_file_path", "connect_protocol_version"], - ["devcontainer_file_path", "connect_protocol_version"], - ["environment_class", "connect_protocol_version"], - ["initializer", "connect_protocol_version"], - ["name", "connect_protocol_version"], - ) - async def update( - self, - *, - automations_file_path: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, - initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: extra_headers = { **strip_not_given( { @@ -1008,16 +656,7 @@ async def update( } return await self._post( "/gitpod.v1.ProjectService/UpdateProject", - body=await async_maybe_transform( - { - "automations_file_path": automations_file_path, - "devcontainer_file_path": devcontainer_file_path, - "environment_class": environment_class, - "initializer": initializer, - "name": name, - }, - project_update_params.ProjectUpdateParams, - ), + body=await async_maybe_transform(body, project_update_params.ProjectUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index 0e6273c8..ce13d00b 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -105,6 +105,7 @@ def validate( environment_class: configuration_validate_params.Variant0EnvironmentClass, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant0ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -141,6 +142,7 @@ def validate( *, scm_integration: configuration_validate_params.Variant1ScmIntegration, connect_protocol_version: Literal[1], + environment_class: configuration_validate_params.Variant1EnvironmentClass | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -172,15 +174,57 @@ def validate( """ ... - @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) + @overload + def validate( + self, + *, + connect_protocol_version: Literal[1], + environment_class: configuration_validate_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant2ScmIntegration | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) + + with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["environment_class", "connect_protocol_version"], + ["scm_integration", "connect_protocol_version"], + ["connect_protocol_version"], + ) def validate( self, *, environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant0ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -262,6 +306,7 @@ async def validate( environment_class: configuration_validate_params.Variant0EnvironmentClass, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant0ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -298,7 +343,46 @@ async def validate( *, scm_integration: configuration_validate_params.Variant1ScmIntegration, connect_protocol_version: Literal[1], + environment_class: configuration_validate_params.Variant1EnvironmentClass | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigurationValidateResponse: + """ValidateRunnerConfiguration validates a runner configuration (e.g. + + environment + class, SCM integration) + + with the runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def validate( + self, + *, + connect_protocol_version: Literal[1], + environment_class: configuration_validate_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant2ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -329,15 +413,19 @@ async def validate( """ ... - @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) + @required_args( + ["environment_class", "connect_protocol_version"], + ["scm_integration", "connect_protocol_version"], + ["connect_protocol_version"], + ) async def validate( self, *, environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant0ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index e7a3e500..84410459 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -3,14 +3,13 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -187,11 +186,10 @@ def retrieve( cast_to=EnvironmentClassRetrieveResponse, ) - @overload def update( self, *, - description: str, + body: environment_class_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -217,92 +215,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - *, - display_name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironmentClass updates an existing environment class on a runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - enabled: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironmentClass updates an existing environment class on a runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["description", "connect_protocol_version"], - ["display_name", "connect_protocol_version"], - ["enabled", "connect_protocol_version"], - ) - def update( - self, - *, - description: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - display_name: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -314,14 +226,7 @@ def update( } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", - body=maybe_transform( - { - "description": description, - "display_name": display_name, - "enabled": enabled, - }, - environment_class_update_params.EnvironmentClassUpdateParams, - ), + body=maybe_transform(body, environment_class_update_params.EnvironmentClassUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -553,11 +458,10 @@ async def retrieve( cast_to=EnvironmentClassRetrieveResponse, ) - @overload async def update( self, *, - description: str, + body: environment_class_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -583,92 +487,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - *, - display_name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironmentClass updates an existing environment class on a runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - enabled: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironmentClass updates an existing environment class on a runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["description", "connect_protocol_version"], - ["display_name", "connect_protocol_version"], - ["enabled", "connect_protocol_version"], - ) - async def update( - self, - *, - description: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - display_name: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -680,14 +498,7 @@ async def update( } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", - body=await async_maybe_transform( - { - "description": description, - "display_name": display_name, - "enabled": enabled, - }, - environment_class_update_params.EnvironmentClassUpdateParams, - ), + body=await async_maybe_transform(body, environment_class_update_params.EnvironmentClassUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 13ed925f..bdb27371 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -4,14 +4,13 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -294,11 +293,10 @@ def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) - @overload def update( self, *, - expires_at: Union[str, datetime], + body: host_authentication_token_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -312,96 +310,6 @@ def update( UpdateHostAuthenticationToken Args: - expires_at: A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -414,92 +322,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - *, - refresh_token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["expires_at", "connect_protocol_version"], - ["refresh_token", "connect_protocol_version"], - ["token", "connect_protocol_version"], - ) - def update( - self, - *, - expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - refresh_token: str | NotGiven = NOT_GIVEN, - token: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -511,14 +333,7 @@ def update( } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", - body=maybe_transform( - { - "expires_at": expires_at, - "refresh_token": refresh_token, - "token": token, - }, - host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, - ), + body=maybe_transform(body, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -898,133 +713,10 @@ async def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) - @overload - async def update( - self, - *, - expires_at: Union[str, datetime], - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - expires_at: A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload async def update( self, *, - refresh_token: str, + body: host_authentication_token_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1050,60 +742,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - *, - token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["expires_at", "connect_protocol_version"], - ["refresh_token", "connect_protocol_version"], - ["token", "connect_protocol_version"], - ) - async def update( - self, - *, - expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - refresh_token: str | NotGiven = NOT_GIVEN, - token: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -1116,12 +754,7 @@ async def update( return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=await async_maybe_transform( - { - "expires_at": expires_at, - "refresh_token": refresh_token, - "token": token, - }, - host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, + body, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 8c002740..aa1d1f08 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -2,14 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -57,11 +56,10 @@ def with_streaming_response(self) -> ScmIntegrationsResourceWithStreamingRespons """ return ScmIntegrationsResourceWithStreamingResponse(self) - @overload def create( self, *, - oauth_client_id: str, + body: scm_integration_create_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -75,46 +73,6 @@ def create( CreateSCMIntegration creates a new SCM integration on a runner. Args: - oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_plaintext_client_secret must also be set. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def create( - self, - *, - oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - """ - CreateSCMIntegration creates a new SCM integration on a runner. - - Args: - oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. - - This will first be encrypted with the runner's public key before being stored. - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -127,25 +85,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args( - ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] - ) - def create( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: extra_headers = { **strip_not_given( { @@ -157,13 +96,7 @@ def create( } return self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", - body=maybe_transform( - { - "oauth_client_id": oauth_client_id, - "oauth_plaintext_client_secret": oauth_plaintext_client_secret, - }, - scm_integration_create_params.ScmIntegrationCreateParams, - ), + body=maybe_transform(body, scm_integration_create_params.ScmIntegrationCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -242,11 +175,10 @@ def retrieve( cast_to=ScmIntegrationRetrieveResponse, ) - @overload def update( self, *, - oauth_client_id: str, + body: scm_integration_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -260,14 +192,6 @@ def update( UpdateSCMIntegration updates an existing SCM integration on a runner. Args: - oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. - - If an empty string is set, the OAuth configuration will be removed (regardless - of whether a client secret is set), and any existing Host Authentication Tokens - for the SCM integration's runner and host that were created using the OAuth app - will be deleted. This might lead to users being unable to access their - repositories until they re-authenticate. - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -280,105 +204,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - *, - oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSCMIntegration updates an existing SCM integration on a runner. - - Args: - oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client - secret. - - The cleartext secret will be encrypted with the runner's public key before being - stored. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - pat: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSCMIntegration updates an existing SCM integration on a runner. - - Args: - pat: pat can be set to enable or disable Personal Access Tokens support. - - When disabling PATs, any existing Host Authentication Tokens for the SCM - integration's runner and host that were created using a PAT will be deleted. - This might lead to users being unable to access their repositories until they - re-authenticate. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["oauth_client_id", "connect_protocol_version"], - ["oauth_plaintext_client_secret", "connect_protocol_version"], - ["pat", "connect_protocol_version"], - ) - def update( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - pat: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -390,14 +215,7 @@ def update( } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", - body=maybe_transform( - { - "oauth_client_id": oauth_client_id, - "oauth_plaintext_client_secret": oauth_plaintext_client_secret, - "pat": pat, - }, - scm_integration_update_params.ScmIntegrationUpdateParams, - ), + body=maybe_transform(body, scm_integration_update_params.ScmIntegrationUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -544,11 +362,10 @@ def with_streaming_response(self) -> AsyncScmIntegrationsResourceWithStreamingRe """ return AsyncScmIntegrationsResourceWithStreamingResponse(self) - @overload async def create( self, *, - oauth_client_id: str, + body: scm_integration_create_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -562,46 +379,6 @@ async def create( CreateSCMIntegration creates a new SCM integration on a runner. Args: - oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_plaintext_client_secret must also be set. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def create( - self, - *, - oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - """ - CreateSCMIntegration creates a new SCM integration on a runner. - - Args: - oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. - - This will first be encrypted with the runner's public key before being stored. - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -614,25 +391,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args( - ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] - ) - async def create( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: extra_headers = { **strip_not_given( { @@ -644,13 +402,7 @@ async def create( } return await self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", - body=await async_maybe_transform( - { - "oauth_client_id": oauth_client_id, - "oauth_plaintext_client_secret": oauth_plaintext_client_secret, - }, - scm_integration_create_params.ScmIntegrationCreateParams, - ), + body=await async_maybe_transform(body, scm_integration_create_params.ScmIntegrationCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -729,11 +481,10 @@ async def retrieve( cast_to=ScmIntegrationRetrieveResponse, ) - @overload async def update( self, *, - oauth_client_id: str, + body: scm_integration_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -747,14 +498,6 @@ async def update( UpdateSCMIntegration updates an existing SCM integration on a runner. Args: - oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. - - If an empty string is set, the OAuth configuration will be removed (regardless - of whether a client secret is set), and any existing Host Authentication Tokens - for the SCM integration's runner and host that were created using the OAuth app - will be deleted. This might lead to users being unable to access their - repositories until they re-authenticate. - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -767,105 +510,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - *, - oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSCMIntegration updates an existing SCM integration on a runner. - - Args: - oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client - secret. - - The cleartext secret will be encrypted with the runner's public key before being - stored. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - pat: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSCMIntegration updates an existing SCM integration on a runner. - - Args: - pat: pat can be set to enable or disable Personal Access Tokens support. - - When disabling PATs, any existing Host Authentication Tokens for the SCM - integration's runner and host that were created using a PAT will be deleted. - This might lead to users being unable to access their repositories until they - re-authenticate. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["oauth_client_id", "connect_protocol_version"], - ["oauth_plaintext_client_secret", "connect_protocol_version"], - ["pat", "connect_protocol_version"], - ) - async def update( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - pat: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -877,14 +521,7 @@ async def update( } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", - body=await async_maybe_transform( - { - "oauth_client_id": oauth_client_id, - "oauth_plaintext_client_secret": oauth_plaintext_client_secret, - "pat": pat, - }, - scm_integration_update_params.ScmIntegrationUpdateParams, - ), + body=await async_maybe_transform(body, scm_integration_update_params.ScmIntegrationUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index f06bc67d..9f099a50 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx @@ -19,7 +19,6 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, - required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -96,6 +95,13 @@ def create( ] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + provider: Literal[ + "RUNNER_PROVIDER_UNSPECIFIED", + "RUNNER_PROVIDER_AWS_EC2", + "RUNNER_PROVIDER_LINUX_HOST", + "RUNNER_PROVIDER_DESKTOP_MAC", + ] + | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -119,6 +125,10 @@ def create( name: The runner name for humans + provider: RunnerProvider identifies the specific implementation type of a runner. Each + provider maps to a specific kind of runner (local or remote), as specified below + for each provider. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -144,6 +154,7 @@ def create( { "kind": kind, "name": name, + "provider": provider, "spec": spec, }, runner_create_params.RunnerCreateParams, @@ -226,11 +237,10 @@ def retrieve( cast_to=RunnerRetrieveResponse, ) - @overload def update( self, *, - name: str, + body: runner_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -244,8 +254,6 @@ def update( UpdateRunner updates an environment runner. Args: - name: The runner's name which is shown to users - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -258,55 +266,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - *, - spec: runner_update_params.Variant1Spec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunner updates an environment runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) - def update( - self, - *, - name: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -318,13 +277,7 @@ def update( } return self._post( "/gitpod.v1.RunnerService/UpdateRunner", - body=maybe_transform( - { - "name": name, - "spec": spec, - }, - runner_update_params.RunnerUpdateParams, - ), + body=maybe_transform(body, runner_update_params.RunnerUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -675,6 +628,13 @@ async def create( ] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + provider: Literal[ + "RUNNER_PROVIDER_UNSPECIFIED", + "RUNNER_PROVIDER_AWS_EC2", + "RUNNER_PROVIDER_LINUX_HOST", + "RUNNER_PROVIDER_DESKTOP_MAC", + ] + | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -698,6 +658,10 @@ async def create( name: The runner name for humans + provider: RunnerProvider identifies the specific implementation type of a runner. Each + provider maps to a specific kind of runner (local or remote), as specified below + for each provider. + connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -723,6 +687,7 @@ async def create( { "kind": kind, "name": name, + "provider": provider, "spec": spec, }, runner_create_params.RunnerCreateParams, @@ -805,11 +770,10 @@ async def retrieve( cast_to=RunnerRetrieveResponse, ) - @overload async def update( self, *, - name: str, + body: runner_update_params.Body, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -823,8 +787,6 @@ async def update( UpdateRunner updates an environment runner. Args: - name: The runner's name which is shown to users - connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -837,55 +799,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - *, - spec: runner_update_params.Variant1Spec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunner updates an environment runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) - async def update( - self, - *, - name: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: extra_headers = { **strip_not_given( { @@ -897,13 +810,7 @@ async def update( } return await self._post( "/gitpod.v1.RunnerService/UpdateRunner", - body=await async_maybe_transform( - { - "name": name, - "spec": spec, - }, - runner_update_params.RunnerUpdateParams, - ), + body=await async_maybe_transform(body, runner_update_params.RunnerUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 8e50019b..03b2b304 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -63,6 +63,7 @@ def create( *, environment_variable: bool, connect_protocol_version: Literal[1], + file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -83,6 +84,13 @@ def create( connect_protocol_version: Define the version of the Connect protocol + file_path: absolute path to the file where the secret is mounted value must be an absolute + path (start with a /): + + ``` + this.matches("^/(?:[^/]*/)*.*$") + ``` + project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret @@ -105,6 +113,7 @@ def create( *, file_path: str, connect_protocol_version: Literal[1], + environment_variable: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -129,6 +138,9 @@ def create( connect_protocol_version: Define the version of the Connect protocol + environment_variable: secret will be created as an Environment Variable with the same name as the + secret + project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret @@ -145,17 +157,71 @@ def create( """ ... - @required_args(["environment_variable", "connect_protocol_version"], ["file_path", "connect_protocol_version"]) + @overload def create( self, *, - environment_variable: bool | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], + environment_variable: bool | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretCreateResponse: + """ + CreateSecret creates a new secret. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_variable: secret will be created as an Environment Variable with the same name as the + secret + + file_path: absolute path to the file where the secret is mounted value must be an absolute + path (start with a /): + + ``` + this.matches("^/(?:[^/]*/)*.*$") + ``` + + project_id: project_id is the ProjectID this Secret belongs to + + value: value is the plaintext value of the secret + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["environment_variable", "connect_protocol_version"], + ["file_path", "connect_protocol_version"], + ["connect_protocol_version"], + ) + def create( + self, + *, + environment_variable: bool | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], file_path: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -177,10 +243,10 @@ def create( body=maybe_transform( { "environment_variable": environment_variable, + "file_path": file_path, "name": name, "project_id": project_id, "value": value, - "file_path": file_path, }, secret_create_params.SecretCreateParams, ), @@ -465,6 +531,7 @@ async def create( *, environment_variable: bool, connect_protocol_version: Literal[1], + file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -485,6 +552,13 @@ async def create( connect_protocol_version: Define the version of the Connect protocol + file_path: absolute path to the file where the secret is mounted value must be an absolute + path (start with a /): + + ``` + this.matches("^/(?:[^/]*/)*.*$") + ``` + project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret @@ -507,6 +581,7 @@ async def create( *, file_path: str, connect_protocol_version: Literal[1], + environment_variable: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -531,6 +606,9 @@ async def create( connect_protocol_version: Define the version of the Connect protocol + environment_variable: secret will be created as an Environment Variable with the same name as the + secret + project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret @@ -547,17 +625,71 @@ async def create( """ ... - @required_args(["environment_variable", "connect_protocol_version"], ["file_path", "connect_protocol_version"]) + @overload async def create( self, *, - environment_variable: bool | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], + environment_variable: bool | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretCreateResponse: + """ + CreateSecret creates a new secret. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + environment_variable: secret will be created as an Environment Variable with the same name as the + secret + + file_path: absolute path to the file where the secret is mounted value must be an absolute + path (start with a /): + + ``` + this.matches("^/(?:[^/]*/)*.*$") + ``` + + project_id: project_id is the ProjectID this Secret belongs to + + value: value is the plaintext value of the secret + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["environment_variable", "connect_protocol_version"], + ["file_path", "connect_protocol_version"], + ["connect_protocol_version"], + ) + async def create( + self, + *, + environment_variable: bool | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], file_path: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, + value: str | NotGiven = NOT_GIVEN, + connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -579,10 +711,10 @@ async def create( body=await async_maybe_transform( { "environment_variable": environment_variable, + "file_path": file_path, "name": name, "project_id": project_id, "value": value, - "file_path": file_path, }, secret_create_params.SecretCreateParams, ), diff --git a/src/gitpod/types/account_retrieve_response.py b/src/gitpod/types/account_retrieve_response.py index d0dffe2e..b1812059 100644 --- a/src/gitpod/types/account_retrieve_response.py +++ b/src/gitpod/types/account_retrieve_response.py @@ -1,21 +1,519 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["AccountRetrieveResponse", "Account"] +__all__ = [ + "AccountRetrieveResponse", + "Account", + "AccountUnionMember0", + "AccountUnionMember0Joinable", + "AccountUnionMember0Membership", + "AccountUnionMember1", + "AccountUnionMember1Joinable", + "AccountUnionMember1Membership", +] -class Account(BaseModel): +class AccountUnionMember0Joinable(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the id of the organization the user can join""" + + organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + """ + organization_member_count is the member count of the organization the user can + join + """ + + organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) + """organization_name is the name of the organization the user can join""" + + +class AccountUnionMember0Membership(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the id of the organization the user is a member of""" + + organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + """ + organization_name is the member count of the organization the user is a member + of + """ + + organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) + """organization_name is the name of the organization the user is a member of""" + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + """user_id is the ID the user has in the organization""" + + user_role: Optional[ + Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] + ] = FieldInfo(alias="userRole", default=None) + """user_role is the role the user has in the organization""" + + +class AccountUnionMember0(BaseModel): organization_id: str = FieldInfo(alias="organizationId") """ organization_id is the ID of the organization the account is owned by if it's created through custom SSO """ + id: Optional[str] = None + + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + email: Optional[str] = None + + joinables: Optional[List[AccountUnionMember0Joinable]] = None + + memberships: Optional[List[AccountUnionMember0Membership]] = None + + name: Optional[str] = None + + public_email_provider: Optional[bool] = FieldInfo(alias="publicEmailProvider", default=None) + """ + public_email_provider is true if the email for the Account matches a known + public email provider + """ + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class AccountUnionMember1Joinable(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the id of the organization the user can join""" + + organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + """ + organization_member_count is the member count of the organization the user can + join + """ + + organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) + """organization_name is the name of the organization the user can join""" + + +class AccountUnionMember1Membership(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the id of the organization the user is a member of""" + + organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + """ + organization_name is the member count of the organization the user is a member + of + """ + + organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) + """organization_name is the name of the organization the user is a member of""" + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + """user_id is the ID the user has in the organization""" + + user_role: Optional[ + Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] + ] = FieldInfo(alias="userRole", default=None) + """user_role is the role the user has in the organization""" + + +class AccountUnionMember1(BaseModel): + id: Optional[str] = None + + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + email: Optional[str] = None + + joinables: Optional[List[AccountUnionMember1Joinable]] = None + + memberships: Optional[List[AccountUnionMember1Membership]] = None + + name: Optional[str] = None + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """ + organization_id is the ID of the organization the account is owned by if it's + created through custom SSO + """ + + public_email_provider: Optional[bool] = FieldInfo(alias="publicEmailProvider", default=None) + """ + public_email_provider is true if the email for the Account matches a known + public email provider + """ + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +Account: TypeAlias = Union[AccountUnionMember0, AccountUnionMember1] + class AccountRetrieveResponse(BaseModel): account: Optional[Account] = None diff --git a/src/gitpod/types/editor_list_response.py b/src/gitpod/types/editor_list_response.py index a4355f0b..3af4fa8b 100644 --- a/src/gitpod/types/editor_list_response.py +++ b/src/gitpod/types/editor_list_response.py @@ -12,6 +12,8 @@ class Editor(BaseModel): id: Optional[str] = None + alias: Optional[str] = None + icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) diff --git a/src/gitpod/types/editor_retrieve_response.py b/src/gitpod/types/editor_retrieve_response.py index 774b3d09..a6896cec 100644 --- a/src/gitpod/types/editor_retrieve_response.py +++ b/src/gitpod/types/editor_retrieve_response.py @@ -12,6 +12,8 @@ class Editor(BaseModel): id: Optional[str] = None + alias: Optional[str] = None + icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index 4413cb62..f18ebb68 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -14,17 +14,23 @@ "SpecContent", "SpecContentInitializer", "SpecContentInitializerSpec", - "SpecContentInitializerSpecContextURL", - "SpecContentInitializerSpecContextURLContextURL", - "SpecContentInitializerSpecGit", - "SpecContentInitializerSpecGitGit", + "SpecContentInitializerSpecUnionMember0", + "SpecContentInitializerSpecUnionMember0ContextURL", + "SpecContentInitializerSpecUnionMember0Git", + "SpecContentInitializerSpecUnionMember1", + "SpecContentInitializerSpecUnionMember1Git", + "SpecContentInitializerSpecUnionMember1ContextURL", + "SpecContentInitializerSpecUnionMember2", + "SpecContentInitializerSpecUnionMember2ContextURL", + "SpecContentInitializerSpecUnionMember2Git", "SpecDevcontainer", "SpecMachine", "SpecPort", "SpecSecret", "SpecSecretUnionMember0", - "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "SpecSecretUnionMember1", "SpecSecretUnionMember2", + "SpecSecretUnionMember3", "SpecSSHPublicKey", "SpecTimeout", ] @@ -62,16 +68,92 @@ class SpecAutomationsFile(TypedDict, total=False): session: str -class SpecContentInitializerSpecContextURLContextURL(TypedDict, total=False): +class SpecContentInitializerSpecUnionMember0ContextURL(TypedDict, total=False): url: str """url is the URL from which the environment is created""" -class SpecContentInitializerSpecContextURL(TypedDict, total=False): - context_url: Required[Annotated[SpecContentInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] +class SpecContentInitializerSpecUnionMember0Git(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class SpecContentInitializerSpecUnionMember0(TypedDict, total=False): + context_url: Required[Annotated[SpecContentInitializerSpecUnionMember0ContextURL, PropertyInfo(alias="contextUrl")]] + + git: SpecContentInitializerSpecUnionMember0Git + + +class SpecContentInitializerSpecUnionMember1Git(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class SpecContentInitializerSpecUnionMember1ContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + +class SpecContentInitializerSpecUnionMember1(TypedDict, total=False): + git: Required[SpecContentInitializerSpecUnionMember1Git] -class SpecContentInitializerSpecGitGit(TypedDict, total=False): + context_url: Annotated[SpecContentInitializerSpecUnionMember1ContextURL, PropertyInfo(alias="contextUrl")] + + +class SpecContentInitializerSpecUnionMember2ContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class SpecContentInitializerSpecUnionMember2Git(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] """a path relative to the environment root in which the code will be checked out @@ -100,11 +182,17 @@ class SpecContentInitializerSpecGitGit(TypedDict, total=False): """upstream_Remote_uri is the fork upstream of a repository""" -class SpecContentInitializerSpecGit(TypedDict, total=False): - git: Required[SpecContentInitializerSpecGitGit] +class SpecContentInitializerSpecUnionMember2(TypedDict, total=False): + context_url: Annotated[SpecContentInitializerSpecUnionMember2ContextURL, PropertyInfo(alias="contextUrl")] + git: SpecContentInitializerSpecUnionMember2Git -SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] + +SpecContentInitializerSpec: TypeAlias = Union[ + SpecContentInitializerSpecUnionMember0, + SpecContentInitializerSpecUnionMember1, + SpecContentInitializerSpecUnionMember2, +] class SpecContentInitializer(TypedDict, total=False): @@ -165,6 +253,11 @@ class SpecPort(TypedDict, total=False): class SpecSecretUnionMember0(TypedDict, total=False): environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] + file_path: Annotated[str, PropertyInfo(alias="filePath")] + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] + name: str """name is the human readable description of the secret""" @@ -181,10 +274,14 @@ class SpecSecretUnionMember0(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(TypedDict, total=False): +class SpecSecretUnionMember1(TypedDict, total=False): file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] """file_path is the path inside the devcontainer where the secret is mounted""" + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] + + git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] + name: str """name is the human readable description of the secret""" @@ -204,6 +301,35 @@ class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(Ty class SpecSecretUnionMember2(TypedDict, total=False): git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] + + file_path: Annotated[str, PropertyInfo(alias="filePath")] + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: str + """name is the human readable description of the secret""" + + session: str + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: str + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class SpecSecretUnionMember3(TypedDict, total=False): + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] + + file_path: Annotated[str, PropertyInfo(alias="filePath")] + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] + name: str """name is the human readable description of the secret""" @@ -221,9 +347,7 @@ class SpecSecretUnionMember2(TypedDict, total=False): SpecSecret: TypeAlias = Union[ - SpecSecretUnionMember0, - SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, - SpecSecretUnionMember2, + SpecSecretUnionMember0, SpecSecretUnionMember1, SpecSecretUnionMember2, SpecSecretUnionMember3 ] diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index fac2dc9e..805cf82d 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -18,17 +18,23 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecContextURL", - "EnvironmentSpecContentInitializerSpecContextURLContextURL", - "EnvironmentSpecContentInitializerSpecGit", - "EnvironmentSpecContentInitializerSpecGitGit", + "EnvironmentSpecContentInitializerSpecUnionMember0", + "EnvironmentSpecContentInitializerSpecUnionMember0ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember0Git", + "EnvironmentSpecContentInitializerSpecUnionMember1", + "EnvironmentSpecContentInitializerSpecUnionMember1Git", + "EnvironmentSpecContentInitializerSpecUnionMember1ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember2", + "EnvironmentSpecContentInitializerSpecUnionMember2ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember2Git", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "EnvironmentSpecSecretUnionMember1", "EnvironmentSpecSecretUnionMember2", + "EnvironmentSpecSecretUnionMember3", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -298,16 +304,46 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): +class EnvironmentSpecContentInitializerSpecUnionMember0ContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class EnvironmentSpecContentInitializerSpecUnionMember0Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): +class EnvironmentSpecContentInitializerSpecUnionMember0(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") + + git: Optional[EnvironmentSpecContentInitializerSpecUnionMember0Git] = None + + +class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -335,12 +371,64 @@ class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecGit(BaseModel): - git: EnvironmentSpecContentInitializerSpecGitGit +class EnvironmentSpecContentInitializerSpecUnionMember1ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecUnionMember1(BaseModel): + git: EnvironmentSpecContentInitializerSpecUnionMember1Git + + context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember1ContextURL] = FieldInfo( + alias="contextUrl", default=None + ) + + +class EnvironmentSpecContentInitializerSpecUnionMember2ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecUnionMember2Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class EnvironmentSpecContentInitializerSpecUnionMember2(BaseModel): + context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember2ContextURL] = FieldInfo( + alias="contextUrl", default=None + ) + + git: Optional[EnvironmentSpecContentInitializerSpecUnionMember2Git] = None EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit + EnvironmentSpecContentInitializerSpecUnionMember0, + EnvironmentSpecContentInitializerSpecUnionMember1, + EnvironmentSpecContentInitializerSpecUnionMember2, ] @@ -398,6 +486,11 @@ class EnvironmentSpecPort(BaseModel): class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -414,10 +507,14 @@ class EnvironmentSpecSecretUnionMember0(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): +class EnvironmentSpecSecretUnionMember1(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -437,6 +534,35 @@ class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretI class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretUnionMember3(BaseModel): + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -455,8 +581,9 @@ class EnvironmentSpecSecretUnionMember2(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + EnvironmentSpecSecretUnionMember1, EnvironmentSpecSecretUnionMember2, + EnvironmentSpecSecretUnionMember3, ] diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index 7b8da702..48f448ec 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -14,17 +14,23 @@ "SpecContent", "SpecContentInitializer", "SpecContentInitializerSpec", - "SpecContentInitializerSpecContextURL", - "SpecContentInitializerSpecContextURLContextURL", - "SpecContentInitializerSpecGit", - "SpecContentInitializerSpecGitGit", + "SpecContentInitializerSpecUnionMember0", + "SpecContentInitializerSpecUnionMember0ContextURL", + "SpecContentInitializerSpecUnionMember0Git", + "SpecContentInitializerSpecUnionMember1", + "SpecContentInitializerSpecUnionMember1Git", + "SpecContentInitializerSpecUnionMember1ContextURL", + "SpecContentInitializerSpecUnionMember2", + "SpecContentInitializerSpecUnionMember2ContextURL", + "SpecContentInitializerSpecUnionMember2Git", "SpecDevcontainer", "SpecMachine", "SpecPort", "SpecSecret", "SpecSecretUnionMember0", - "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "SpecSecretUnionMember1", "SpecSecretUnionMember2", + "SpecSecretUnionMember3", "SpecSSHPublicKey", "SpecTimeout", ] @@ -60,16 +66,92 @@ class SpecAutomationsFile(TypedDict, total=False): session: str -class SpecContentInitializerSpecContextURLContextURL(TypedDict, total=False): +class SpecContentInitializerSpecUnionMember0ContextURL(TypedDict, total=False): url: str """url is the URL from which the environment is created""" -class SpecContentInitializerSpecContextURL(TypedDict, total=False): - context_url: Required[Annotated[SpecContentInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] +class SpecContentInitializerSpecUnionMember0Git(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class SpecContentInitializerSpecUnionMember0(TypedDict, total=False): + context_url: Required[Annotated[SpecContentInitializerSpecUnionMember0ContextURL, PropertyInfo(alias="contextUrl")]] + + git: SpecContentInitializerSpecUnionMember0Git + + +class SpecContentInitializerSpecUnionMember1Git(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class SpecContentInitializerSpecUnionMember1ContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + +class SpecContentInitializerSpecUnionMember1(TypedDict, total=False): + git: Required[SpecContentInitializerSpecUnionMember1Git] -class SpecContentInitializerSpecGitGit(TypedDict, total=False): + context_url: Annotated[SpecContentInitializerSpecUnionMember1ContextURL, PropertyInfo(alias="contextUrl")] + + +class SpecContentInitializerSpecUnionMember2ContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class SpecContentInitializerSpecUnionMember2Git(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] """a path relative to the environment root in which the code will be checked out @@ -98,11 +180,17 @@ class SpecContentInitializerSpecGitGit(TypedDict, total=False): """upstream_Remote_uri is the fork upstream of a repository""" -class SpecContentInitializerSpecGit(TypedDict, total=False): - git: Required[SpecContentInitializerSpecGitGit] +class SpecContentInitializerSpecUnionMember2(TypedDict, total=False): + context_url: Annotated[SpecContentInitializerSpecUnionMember2ContextURL, PropertyInfo(alias="contextUrl")] + git: SpecContentInitializerSpecUnionMember2Git -SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] + +SpecContentInitializerSpec: TypeAlias = Union[ + SpecContentInitializerSpecUnionMember0, + SpecContentInitializerSpecUnionMember1, + SpecContentInitializerSpecUnionMember2, +] class SpecContentInitializer(TypedDict, total=False): @@ -163,6 +251,11 @@ class SpecPort(TypedDict, total=False): class SpecSecretUnionMember0(TypedDict, total=False): environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] + file_path: Annotated[str, PropertyInfo(alias="filePath")] + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] + name: str """name is the human readable description of the secret""" @@ -179,10 +272,14 @@ class SpecSecretUnionMember0(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(TypedDict, total=False): +class SpecSecretUnionMember1(TypedDict, total=False): file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] """file_path is the path inside the devcontainer where the secret is mounted""" + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] + + git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] + name: str """name is the human readable description of the secret""" @@ -202,6 +299,35 @@ class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(Ty class SpecSecretUnionMember2(TypedDict, total=False): git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] + + file_path: Annotated[str, PropertyInfo(alias="filePath")] + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: str + """name is the human readable description of the secret""" + + session: str + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: str + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class SpecSecretUnionMember3(TypedDict, total=False): + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] + + file_path: Annotated[str, PropertyInfo(alias="filePath")] + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] + name: str """name is the human readable description of the secret""" @@ -219,9 +345,7 @@ class SpecSecretUnionMember2(TypedDict, total=False): SpecSecret: TypeAlias = Union[ - SpecSecretUnionMember0, - SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, - SpecSecretUnionMember2, + SpecSecretUnionMember0, SpecSecretUnionMember1, SpecSecretUnionMember2, SpecSecretUnionMember3 ] diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index 0573ca9e..5debb71b 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -18,17 +18,23 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecContextURL", - "EnvironmentSpecContentInitializerSpecContextURLContextURL", - "EnvironmentSpecContentInitializerSpecGit", - "EnvironmentSpecContentInitializerSpecGitGit", + "EnvironmentSpecContentInitializerSpecUnionMember0", + "EnvironmentSpecContentInitializerSpecUnionMember0ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember0Git", + "EnvironmentSpecContentInitializerSpecUnionMember1", + "EnvironmentSpecContentInitializerSpecUnionMember1Git", + "EnvironmentSpecContentInitializerSpecUnionMember1ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember2", + "EnvironmentSpecContentInitializerSpecUnionMember2ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember2Git", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "EnvironmentSpecSecretUnionMember1", "EnvironmentSpecSecretUnionMember2", + "EnvironmentSpecSecretUnionMember3", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -298,16 +304,46 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): +class EnvironmentSpecContentInitializerSpecUnionMember0ContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class EnvironmentSpecContentInitializerSpecUnionMember0Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): +class EnvironmentSpecContentInitializerSpecUnionMember0(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") + + git: Optional[EnvironmentSpecContentInitializerSpecUnionMember0Git] = None + + +class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -335,12 +371,64 @@ class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecGit(BaseModel): - git: EnvironmentSpecContentInitializerSpecGitGit +class EnvironmentSpecContentInitializerSpecUnionMember1ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecUnionMember1(BaseModel): + git: EnvironmentSpecContentInitializerSpecUnionMember1Git + + context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember1ContextURL] = FieldInfo( + alias="contextUrl", default=None + ) + + +class EnvironmentSpecContentInitializerSpecUnionMember2ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecUnionMember2Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class EnvironmentSpecContentInitializerSpecUnionMember2(BaseModel): + context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember2ContextURL] = FieldInfo( + alias="contextUrl", default=None + ) + + git: Optional[EnvironmentSpecContentInitializerSpecUnionMember2Git] = None EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit + EnvironmentSpecContentInitializerSpecUnionMember0, + EnvironmentSpecContentInitializerSpecUnionMember1, + EnvironmentSpecContentInitializerSpecUnionMember2, ] @@ -398,6 +486,11 @@ class EnvironmentSpecPort(BaseModel): class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -414,10 +507,14 @@ class EnvironmentSpecSecretUnionMember0(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): +class EnvironmentSpecSecretUnionMember1(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -437,6 +534,35 @@ class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretI class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretUnionMember3(BaseModel): + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -455,8 +581,9 @@ class EnvironmentSpecSecretUnionMember2(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + EnvironmentSpecSecretUnionMember1, EnvironmentSpecSecretUnionMember2, + EnvironmentSpecSecretUnionMember3, ] diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py index 16e8fa8a..459782f6 100644 --- a/src/gitpod/types/environment_list_response.py +++ b/src/gitpod/types/environment_list_response.py @@ -18,17 +18,23 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecContextURL", - "EnvironmentSpecContentInitializerSpecContextURLContextURL", - "EnvironmentSpecContentInitializerSpecGit", - "EnvironmentSpecContentInitializerSpecGitGit", + "EnvironmentSpecContentInitializerSpecUnionMember0", + "EnvironmentSpecContentInitializerSpecUnionMember0ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember0Git", + "EnvironmentSpecContentInitializerSpecUnionMember1", + "EnvironmentSpecContentInitializerSpecUnionMember1Git", + "EnvironmentSpecContentInitializerSpecUnionMember1ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember2", + "EnvironmentSpecContentInitializerSpecUnionMember2ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember2Git", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "EnvironmentSpecSecretUnionMember1", "EnvironmentSpecSecretUnionMember2", + "EnvironmentSpecSecretUnionMember3", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -299,16 +305,46 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): +class EnvironmentSpecContentInitializerSpecUnionMember0ContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class EnvironmentSpecContentInitializerSpecUnionMember0Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): +class EnvironmentSpecContentInitializerSpecUnionMember0(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") + + git: Optional[EnvironmentSpecContentInitializerSpecUnionMember0Git] = None + + +class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -336,12 +372,64 @@ class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecGit(BaseModel): - git: EnvironmentSpecContentInitializerSpecGitGit +class EnvironmentSpecContentInitializerSpecUnionMember1ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecUnionMember1(BaseModel): + git: EnvironmentSpecContentInitializerSpecUnionMember1Git + + context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember1ContextURL] = FieldInfo( + alias="contextUrl", default=None + ) + + +class EnvironmentSpecContentInitializerSpecUnionMember2ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecUnionMember2Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class EnvironmentSpecContentInitializerSpecUnionMember2(BaseModel): + context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember2ContextURL] = FieldInfo( + alias="contextUrl", default=None + ) + + git: Optional[EnvironmentSpecContentInitializerSpecUnionMember2Git] = None EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit + EnvironmentSpecContentInitializerSpecUnionMember0, + EnvironmentSpecContentInitializerSpecUnionMember1, + EnvironmentSpecContentInitializerSpecUnionMember2, ] @@ -399,6 +487,11 @@ class EnvironmentSpecPort(BaseModel): class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -415,10 +508,14 @@ class EnvironmentSpecSecretUnionMember0(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): +class EnvironmentSpecSecretUnionMember1(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -438,6 +535,35 @@ class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretI class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretUnionMember3(BaseModel): + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -456,8 +582,9 @@ class EnvironmentSpecSecretUnionMember2(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + EnvironmentSpecSecretUnionMember1, EnvironmentSpecSecretUnionMember2, + EnvironmentSpecSecretUnionMember3, ] diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index f4b32ccb..c2c065c8 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -18,17 +18,23 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecContextURL", - "EnvironmentSpecContentInitializerSpecContextURLContextURL", - "EnvironmentSpecContentInitializerSpecGit", - "EnvironmentSpecContentInitializerSpecGitGit", + "EnvironmentSpecContentInitializerSpecUnionMember0", + "EnvironmentSpecContentInitializerSpecUnionMember0ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember0Git", + "EnvironmentSpecContentInitializerSpecUnionMember1", + "EnvironmentSpecContentInitializerSpecUnionMember1Git", + "EnvironmentSpecContentInitializerSpecUnionMember1ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember2", + "EnvironmentSpecContentInitializerSpecUnionMember2ContextURL", + "EnvironmentSpecContentInitializerSpecUnionMember2Git", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "EnvironmentSpecSecretUnionMember1", "EnvironmentSpecSecretUnionMember2", + "EnvironmentSpecSecretUnionMember3", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -298,16 +304,46 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): +class EnvironmentSpecContentInitializerSpecUnionMember0ContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class EnvironmentSpecContentInitializerSpecUnionMember0Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): +class EnvironmentSpecContentInitializerSpecUnionMember0(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") + + git: Optional[EnvironmentSpecContentInitializerSpecUnionMember0Git] = None + + +class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -335,12 +371,64 @@ class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecGit(BaseModel): - git: EnvironmentSpecContentInitializerSpecGitGit +class EnvironmentSpecContentInitializerSpecUnionMember1ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecUnionMember1(BaseModel): + git: EnvironmentSpecContentInitializerSpecUnionMember1Git + + context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember1ContextURL] = FieldInfo( + alias="contextUrl", default=None + ) + + +class EnvironmentSpecContentInitializerSpecUnionMember2ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class EnvironmentSpecContentInitializerSpecUnionMember2Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class EnvironmentSpecContentInitializerSpecUnionMember2(BaseModel): + context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember2ContextURL] = FieldInfo( + alias="contextUrl", default=None + ) + + git: Optional[EnvironmentSpecContentInitializerSpecUnionMember2Git] = None EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit + EnvironmentSpecContentInitializerSpecUnionMember0, + EnvironmentSpecContentInitializerSpecUnionMember1, + EnvironmentSpecContentInitializerSpecUnionMember2, ] @@ -398,6 +486,11 @@ class EnvironmentSpecPort(BaseModel): class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -414,10 +507,14 @@ class EnvironmentSpecSecretUnionMember0(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): +class EnvironmentSpecSecretUnionMember1(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -437,6 +534,35 @@ class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretI class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class EnvironmentSpecSecretUnionMember3(BaseModel): + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + name: Optional[str] = None """name is the human readable description of the secret""" @@ -455,8 +581,9 @@ class EnvironmentSpecSecretUnionMember2(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + EnvironmentSpecSecretUnionMember1, EnvironmentSpecSecretUnionMember2, + EnvironmentSpecSecretUnionMember3, ] diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index be559eb5..108189b1 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -2,43 +2,15 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = [ - "EnvironmentUpdateParams", - "Variant0", - "Variant1", - "Variant1Spec", - "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment", - "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile", - "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot", - "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession", - "Variant1SpecContent", - "Variant1SpecContentContent", - "Variant1SpecContentContentTheGitEmailAddress", - "Variant1SpecContentContentTheGitUsername", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit", - "Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization", - "Variant1SpecDevcontainer", - "Variant1SpecDevcontainerDevcontainer", - "Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", - "Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild", - "Variant1SpecTimeoutConfiguresTheEnvironmentTimeout", - "Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout", -] +__all__ = ["EnvironmentUpdateParams", "Body"] -class Variant0(TypedDict, total=False): - metadata: Required[object] +class EnvironmentUpdateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -47,255 +19,5 @@ class Variant0(TypedDict, total=False): """Define the timeout, in ms""" -class Variant1(TypedDict, total=False): - spec: Required[Variant1Spec] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot( - TypedDict, total=False -): - automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] - """ - automations_file_path is the path to the automations file that is applied in the - environment, - - relative to the repo root. path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - -class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession(TypedDict, total=False): - session: Required[str] - - -Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile: TypeAlias = Union[ - Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot, - Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession, -] - - -class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment(TypedDict, total=False): - automations_file: Required[ - Annotated[ - Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile, - PropertyInfo(alias="automationsFile"), - ] - ] - """automations_file is the automations file spec of the environment""" - - -class Variant1SpecContentContentTheGitEmailAddress(TypedDict, total=False): - git_email: Required[Annotated[str, PropertyInfo(alias="gitEmail")]] - """The Git email address""" - - -class Variant1SpecContentContentTheGitUsername(TypedDict, total=False): - git_username: Required[Annotated[str, PropertyInfo(alias="gitUsername")]] - """The Git username""" - - -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL( - TypedDict, total=False -): - url: str - """url is the URL from which the environment is created""" - - -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL( - TypedDict, total=False -): - context_url: Required[ - Annotated[ - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL, - PropertyInfo(alias="contextUrl"), - ] - ] - - -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit( - TypedDict, total=False -): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit( - TypedDict, total=False -): - git: Required[ - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit - ] - - -Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec: TypeAlias = Union[ - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL, - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit, -] - - -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer( - TypedDict, total=False -): - specs: Iterable[Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec] - - -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized(TypedDict, total=False): - initializer: Required[Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer] - """EnvironmentInitializer specifies how an environment is to be initialized""" - - -class Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization(TypedDict, total=False): - session: Required[str] - """session should be changed to trigger a content reinitialization""" - - -Variant1SpecContentContent: TypeAlias = Union[ - Variant1SpecContentContentTheGitEmailAddress, - Variant1SpecContentContentTheGitUsername, - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized, - Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization, -] - - -class Variant1SpecContent(TypedDict, total=False): - content: Required[Variant1SpecContentContent] - - -class Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot( - TypedDict, total=False -): - devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - -class Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild(TypedDict, total=False): - session: Required[str] - """session should be changed to trigger a devcontainer rebuild""" - - -Variant1SpecDevcontainerDevcontainer: TypeAlias = Union[ - Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, - Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild, -] - - -class Variant1SpecDevcontainer(TypedDict, total=False): - devcontainer: Required[Variant1SpecDevcontainerDevcontainer] - - -class Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout(TypedDict, total=False): - disconnected: Required[str] - """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". - """ - - -class Variant1SpecTimeoutConfiguresTheEnvironmentTimeout(TypedDict, total=False): - timeout: Required[Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout] - """Timeout configures the environment timeout""" - - -Variant1Spec: TypeAlias = Union[ - Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment, - Variant1SpecContent, - Variant1SpecDevcontainer, - Variant1SpecTimeoutConfiguresTheEnvironmentTimeout, -] - -EnvironmentUpdateParams: TypeAlias = Union[Variant0, Variant1] +class Body: + pass diff --git a/src/gitpod/types/environments/automation_upsert_params.py b/src/gitpod/types/environments/automation_upsert_params.py index 3285979c..4b36e6a6 100644 --- a/src/gitpod/types/environments/automation_upsert_params.py +++ b/src/gitpod/types/environments/automation_upsert_params.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Dict, List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Dict, List, Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo @@ -14,9 +14,11 @@ "AutomationsFileServicesCommands", "AutomationsFileServicesRunsOn", "AutomationsFileServicesRunsOnDocker", + "AutomationsFileServicesRunsOnDockerDocker", "AutomationsFileTasks", "AutomationsFileTasksRunsOn", "AutomationsFileTasksRunsOnDocker", + "AutomationsFileTasksRunsOnDockerDocker", ] @@ -73,14 +75,19 @@ class AutomationsFileServicesCommands(TypedDict, total=False): """ -class AutomationsFileServicesRunsOnDocker(TypedDict, total=False): +class AutomationsFileServicesRunsOnDockerDocker(TypedDict, total=False): environment: List[str] image: str -class AutomationsFileServicesRunsOn(TypedDict, total=False): - docker: Required[AutomationsFileServicesRunsOnDocker] +class AutomationsFileServicesRunsOnDocker(TypedDict, total=False): + docker: Required[AutomationsFileServicesRunsOnDockerDocker] + + +AutomationsFileServicesRunsOn: TypeAlias = Union[ + AutomationsFileServicesRunsOnDocker, AutomationsFileServicesRunsOnDocker +] class AutomationsFileServices(TypedDict, total=False): @@ -95,14 +102,17 @@ class AutomationsFileServices(TypedDict, total=False): triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] -class AutomationsFileTasksRunsOnDocker(TypedDict, total=False): +class AutomationsFileTasksRunsOnDockerDocker(TypedDict, total=False): environment: List[str] image: str -class AutomationsFileTasksRunsOn(TypedDict, total=False): - docker: Required[AutomationsFileTasksRunsOnDocker] +class AutomationsFileTasksRunsOnDocker(TypedDict, total=False): + docker: Required[AutomationsFileTasksRunsOnDockerDocker] + + +AutomationsFileTasksRunsOn: TypeAlias = Union[AutomationsFileTasksRunsOnDocker, AutomationsFileTasksRunsOnDocker] class AutomationsFileTasks(TypedDict, total=False): diff --git a/src/gitpod/types/environments/automations/service_create_params.py b/src/gitpod/types/environments/automations/service_create_params.py index 386d562b..d575602d 100644 --- a/src/gitpod/types/environments/automations/service_create_params.py +++ b/src/gitpod/types/environments/automations/service_create_params.py @@ -13,13 +13,15 @@ "Metadata", "MetadataCreator", "MetadataTriggeredBy", - "MetadataTriggeredByManual", - "MetadataTriggeredByPostDevcontainerStart", - "MetadataTriggeredByPostEnvironmentStart", + "MetadataTriggeredByUnionMember0", + "MetadataTriggeredByUnionMember1", + "MetadataTriggeredByUnionMember2", + "MetadataTriggeredByUnionMember3", "Spec", "SpecCommands", "SpecRunsOn", "SpecRunsOnDocker", + "SpecRunsOnDockerDocker", ] @@ -52,20 +54,43 @@ class MetadataCreator(TypedDict, total=False): """Principal is the principal of the subject""" -class MetadataTriggeredByManual(TypedDict, total=False): +class MetadataTriggeredByUnionMember0(TypedDict, total=False): manual: Required[bool] + post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] -class MetadataTriggeredByPostDevcontainerStart(TypedDict, total=False): + post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] + + +class MetadataTriggeredByUnionMember1(TypedDict, total=False): post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] + manual: bool + + post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] + -class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): +class MetadataTriggeredByUnionMember2(TypedDict, total=False): post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] + manual: bool + + post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] + + +class MetadataTriggeredByUnionMember3(TypedDict, total=False): + manual: bool + + post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] + + post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] + MetadataTriggeredBy: TypeAlias = Union[ - MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart + MetadataTriggeredByUnionMember0, + MetadataTriggeredByUnionMember1, + MetadataTriggeredByUnionMember2, + MetadataTriggeredByUnionMember3, ] @@ -226,14 +251,17 @@ class SpecCommands(TypedDict, total=False): """ -class SpecRunsOnDocker(TypedDict, total=False): +class SpecRunsOnDockerDocker(TypedDict, total=False): environment: List[str] image: str -class SpecRunsOn(TypedDict, total=False): - docker: Required[SpecRunsOnDocker] +class SpecRunsOnDocker(TypedDict, total=False): + docker: Required[SpecRunsOnDockerDocker] + + +SpecRunsOn: TypeAlias = Union[SpecRunsOnDocker, SpecRunsOnDocker] class Spec(TypedDict, total=False): diff --git a/src/gitpod/types/environments/automations/service_create_response.py b/src/gitpod/types/environments/automations/service_create_response.py index 2ae3f289..ccf0ba28 100644 --- a/src/gitpod/types/environments/automations/service_create_response.py +++ b/src/gitpod/types/environments/automations/service_create_response.py @@ -14,13 +14,15 @@ "ServiceMetadata", "ServiceMetadataCreator", "ServiceMetadataTriggeredBy", - "ServiceMetadataTriggeredByManual", - "ServiceMetadataTriggeredByPostDevcontainerStart", - "ServiceMetadataTriggeredByPostEnvironmentStart", + "ServiceMetadataTriggeredByUnionMember0", + "ServiceMetadataTriggeredByUnionMember1", + "ServiceMetadataTriggeredByUnionMember2", + "ServiceMetadataTriggeredByUnionMember3", "ServiceSpec", "ServiceSpecCommands", "ServiceSpecRunsOn", "ServiceSpecRunsOnDocker", + "ServiceSpecRunsOnDockerDocker", "ServiceStatus", ] @@ -42,22 +44,43 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class ServiceMetadataTriggeredByManual(BaseModel): +class ServiceMetadataTriggeredByUnionMember0(BaseModel): manual: bool + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) -class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + + +class ServiceMetadataTriggeredByUnionMember1(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + manual: Optional[bool] = None + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + -class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): +class ServiceMetadataTriggeredByUnionMember2(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + +class ServiceMetadataTriggeredByUnionMember3(BaseModel): + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + ServiceMetadataTriggeredBy: TypeAlias = Union[ - ServiceMetadataTriggeredByManual, - ServiceMetadataTriggeredByPostDevcontainerStart, - ServiceMetadataTriggeredByPostEnvironmentStart, + ServiceMetadataTriggeredByUnionMember0, + ServiceMetadataTriggeredByUnionMember1, + ServiceMetadataTriggeredByUnionMember2, + ServiceMetadataTriggeredByUnionMember3, ] @@ -218,14 +241,17 @@ class ServiceSpecCommands(BaseModel): """ -class ServiceSpecRunsOnDocker(BaseModel): +class ServiceSpecRunsOnDockerDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class ServiceSpecRunsOn(BaseModel): - docker: ServiceSpecRunsOnDocker +class ServiceSpecRunsOnDocker(BaseModel): + docker: ServiceSpecRunsOnDockerDocker + + +ServiceSpecRunsOn: TypeAlias = Union[ServiceSpecRunsOnDocker, ServiceSpecRunsOnDocker] class ServiceSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/service_list_response.py b/src/gitpod/types/environments/automations/service_list_response.py index 3ee87638..90412049 100644 --- a/src/gitpod/types/environments/automations/service_list_response.py +++ b/src/gitpod/types/environments/automations/service_list_response.py @@ -15,13 +15,15 @@ "ServiceMetadata", "ServiceMetadataCreator", "ServiceMetadataTriggeredBy", - "ServiceMetadataTriggeredByManual", - "ServiceMetadataTriggeredByPostDevcontainerStart", - "ServiceMetadataTriggeredByPostEnvironmentStart", + "ServiceMetadataTriggeredByUnionMember0", + "ServiceMetadataTriggeredByUnionMember1", + "ServiceMetadataTriggeredByUnionMember2", + "ServiceMetadataTriggeredByUnionMember3", "ServiceSpec", "ServiceSpecCommands", "ServiceSpecRunsOn", "ServiceSpecRunsOnDocker", + "ServiceSpecRunsOnDockerDocker", "ServiceStatus", ] @@ -51,22 +53,43 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class ServiceMetadataTriggeredByManual(BaseModel): +class ServiceMetadataTriggeredByUnionMember0(BaseModel): manual: bool + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) -class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + + +class ServiceMetadataTriggeredByUnionMember1(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + manual: Optional[bool] = None + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + -class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): +class ServiceMetadataTriggeredByUnionMember2(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + +class ServiceMetadataTriggeredByUnionMember3(BaseModel): + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + ServiceMetadataTriggeredBy: TypeAlias = Union[ - ServiceMetadataTriggeredByManual, - ServiceMetadataTriggeredByPostDevcontainerStart, - ServiceMetadataTriggeredByPostEnvironmentStart, + ServiceMetadataTriggeredByUnionMember0, + ServiceMetadataTriggeredByUnionMember1, + ServiceMetadataTriggeredByUnionMember2, + ServiceMetadataTriggeredByUnionMember3, ] @@ -227,14 +250,17 @@ class ServiceSpecCommands(BaseModel): """ -class ServiceSpecRunsOnDocker(BaseModel): +class ServiceSpecRunsOnDockerDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class ServiceSpecRunsOn(BaseModel): - docker: ServiceSpecRunsOnDocker +class ServiceSpecRunsOnDocker(BaseModel): + docker: ServiceSpecRunsOnDockerDocker + + +ServiceSpecRunsOn: TypeAlias = Union[ServiceSpecRunsOnDocker, ServiceSpecRunsOnDocker] class ServiceSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/service_retrieve_response.py b/src/gitpod/types/environments/automations/service_retrieve_response.py index 70832cbd..49c792d2 100644 --- a/src/gitpod/types/environments/automations/service_retrieve_response.py +++ b/src/gitpod/types/environments/automations/service_retrieve_response.py @@ -14,13 +14,15 @@ "ServiceMetadata", "ServiceMetadataCreator", "ServiceMetadataTriggeredBy", - "ServiceMetadataTriggeredByManual", - "ServiceMetadataTriggeredByPostDevcontainerStart", - "ServiceMetadataTriggeredByPostEnvironmentStart", + "ServiceMetadataTriggeredByUnionMember0", + "ServiceMetadataTriggeredByUnionMember1", + "ServiceMetadataTriggeredByUnionMember2", + "ServiceMetadataTriggeredByUnionMember3", "ServiceSpec", "ServiceSpecCommands", "ServiceSpecRunsOn", "ServiceSpecRunsOnDocker", + "ServiceSpecRunsOnDockerDocker", "ServiceStatus", ] @@ -42,22 +44,43 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class ServiceMetadataTriggeredByManual(BaseModel): +class ServiceMetadataTriggeredByUnionMember0(BaseModel): manual: bool + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) -class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + + +class ServiceMetadataTriggeredByUnionMember1(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + manual: Optional[bool] = None + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + -class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): +class ServiceMetadataTriggeredByUnionMember2(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + +class ServiceMetadataTriggeredByUnionMember3(BaseModel): + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + ServiceMetadataTriggeredBy: TypeAlias = Union[ - ServiceMetadataTriggeredByManual, - ServiceMetadataTriggeredByPostDevcontainerStart, - ServiceMetadataTriggeredByPostEnvironmentStart, + ServiceMetadataTriggeredByUnionMember0, + ServiceMetadataTriggeredByUnionMember1, + ServiceMetadataTriggeredByUnionMember2, + ServiceMetadataTriggeredByUnionMember3, ] @@ -218,14 +241,17 @@ class ServiceSpecCommands(BaseModel): """ -class ServiceSpecRunsOnDocker(BaseModel): +class ServiceSpecRunsOnDockerDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class ServiceSpecRunsOn(BaseModel): - docker: ServiceSpecRunsOnDocker +class ServiceSpecRunsOnDocker(BaseModel): + docker: ServiceSpecRunsOnDockerDocker + + +ServiceSpecRunsOn: TypeAlias = Union[ServiceSpecRunsOnDocker, ServiceSpecRunsOnDocker] class ServiceSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index e31fb35d..6cad65fa 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -2,37 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = [ - "ServiceUpdateParams", - "Metadata", - "MetadataDescription", - "MetadataName", - "MetadataTriggeredBy", - "MetadataTriggeredByTriggeredBy", - "MetadataTriggeredByTriggeredByTrigger", - "MetadataTriggeredByTriggeredByTriggerManual", - "MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart", - "MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart", - "Spec", - "SpecCommands", - "SpecCommandsCommands", - "SpecCommandsCommandsReady", - "SpecCommandsCommandsStart", - "SpecCommandsCommandsStop", - "SpecRunsOn", - "SpecRunsOnRunsOn", - "SpecRunsOnRunsOnDocker", - "Status", - "StatusFailureMessage", - "StatusLogURL", - "StatusPhase", - "StatusSession", -] +__all__ = ["ServiceUpdateParams", "Metadata", "Spec", "Status"] class ServiceUpdateParams(TypedDict, total=False): @@ -63,104 +37,13 @@ class ServiceUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class MetadataDescription(TypedDict, total=False): - description: Required[str] +class Metadata: + pass -class MetadataName(TypedDict, total=False): - name: Required[str] +class Spec: + pass -class MetadataTriggeredByTriggeredByTriggerManual(TypedDict, total=False): - manual: Required[bool] - - -class MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart(TypedDict, total=False): - post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] - - -class MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart(TypedDict, total=False): - post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] - - -MetadataTriggeredByTriggeredByTrigger: TypeAlias = Union[ - MetadataTriggeredByTriggeredByTriggerManual, - MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart, - MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart, -] - - -class MetadataTriggeredByTriggeredBy(TypedDict, total=False): - trigger: Iterable[MetadataTriggeredByTriggeredByTrigger] - - -class MetadataTriggeredBy(TypedDict, total=False): - triggered_by: Required[Annotated[MetadataTriggeredByTriggeredBy, PropertyInfo(alias="triggeredBy")]] - - -Metadata: TypeAlias = Union[MetadataDescription, MetadataName, MetadataTriggeredBy] - - -class SpecCommandsCommandsReady(TypedDict, total=False): - ready: Required[str] - - -class SpecCommandsCommandsStart(TypedDict, total=False): - start: Required[str] - - -class SpecCommandsCommandsStop(TypedDict, total=False): - stop: Required[str] - - -SpecCommandsCommands: TypeAlias = Union[SpecCommandsCommandsReady, SpecCommandsCommandsStart, SpecCommandsCommandsStop] - - -class SpecCommands(TypedDict, total=False): - commands: Required[SpecCommandsCommands] - - -class SpecRunsOnRunsOnDocker(TypedDict, total=False): - environment: List[str] - - image: str - - -class SpecRunsOnRunsOn(TypedDict, total=False): - docker: Required[SpecRunsOnRunsOnDocker] - - -class SpecRunsOn(TypedDict, total=False): - runs_on: Required[Annotated[SpecRunsOnRunsOn, PropertyInfo(alias="runsOn")]] - - -Spec: TypeAlias = Union[SpecCommands, SpecRunsOn] - - -class StatusFailureMessage(TypedDict, total=False): - failure_message: Required[Annotated[str, PropertyInfo(alias="failureMessage")]] - - -class StatusLogURL(TypedDict, total=False): - log_url: Required[Annotated[str, PropertyInfo(alias="logUrl")]] - - -class StatusPhase(TypedDict, total=False): - phase: Required[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] - - -class StatusSession(TypedDict, total=False): - session: Required[str] - - -Status: TypeAlias = Union[StatusFailureMessage, StatusLogURL, StatusPhase, StatusSession] +class Status: + pass diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index a1d9bf64..32cdb0e1 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -13,12 +13,14 @@ "Metadata", "MetadataCreator", "MetadataTriggeredBy", - "MetadataTriggeredByManual", - "MetadataTriggeredByPostDevcontainerStart", - "MetadataTriggeredByPostEnvironmentStart", + "MetadataTriggeredByUnionMember0", + "MetadataTriggeredByUnionMember1", + "MetadataTriggeredByUnionMember2", + "MetadataTriggeredByUnionMember3", "Spec", "SpecRunsOn", "SpecRunsOnDocker", + "SpecRunsOnDockerDocker", ] @@ -53,20 +55,43 @@ class MetadataCreator(TypedDict, total=False): """Principal is the principal of the subject""" -class MetadataTriggeredByManual(TypedDict, total=False): +class MetadataTriggeredByUnionMember0(TypedDict, total=False): manual: Required[bool] + post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] -class MetadataTriggeredByPostDevcontainerStart(TypedDict, total=False): + post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] + + +class MetadataTriggeredByUnionMember1(TypedDict, total=False): post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] + manual: bool + + post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] + -class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): +class MetadataTriggeredByUnionMember2(TypedDict, total=False): post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] + manual: bool + + post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] + + +class MetadataTriggeredByUnionMember3(TypedDict, total=False): + manual: bool + + post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] + + post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] + MetadataTriggeredBy: TypeAlias = Union[ - MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart + MetadataTriggeredByUnionMember0, + MetadataTriggeredByUnionMember1, + MetadataTriggeredByUnionMember2, + MetadataTriggeredByUnionMember3, ] @@ -194,14 +219,17 @@ class Metadata(TypedDict, total=False): """triggered_by is a list of trigger that start the task.""" -class SpecRunsOnDocker(TypedDict, total=False): +class SpecRunsOnDockerDocker(TypedDict, total=False): environment: List[str] image: str -class SpecRunsOn(TypedDict, total=False): - docker: Required[SpecRunsOnDocker] +class SpecRunsOnDocker(TypedDict, total=False): + docker: Required[SpecRunsOnDockerDocker] + + +SpecRunsOn: TypeAlias = Union[SpecRunsOnDocker, SpecRunsOnDocker] class Spec(TypedDict, total=False): diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index 3a91f48b..e3ce966c 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -14,12 +14,14 @@ "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", - "TaskMetadataTriggeredByManual", - "TaskMetadataTriggeredByPostDevcontainerStart", - "TaskMetadataTriggeredByPostEnvironmentStart", + "TaskMetadataTriggeredByUnionMember0", + "TaskMetadataTriggeredByUnionMember1", + "TaskMetadataTriggeredByUnionMember2", + "TaskMetadataTriggeredByUnionMember3", "TaskSpec", "TaskSpecRunsOn", "TaskSpecRunsOnDocker", + "TaskSpecRunsOnDockerDocker", ] @@ -40,22 +42,43 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredByManual(BaseModel): +class TaskMetadataTriggeredByUnionMember0(BaseModel): manual: bool + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) -class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + + +class TaskMetadataTriggeredByUnionMember1(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + manual: Optional[bool] = None + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + -class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): +class TaskMetadataTriggeredByUnionMember2(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + +class TaskMetadataTriggeredByUnionMember3(BaseModel): + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + TaskMetadataTriggeredBy: TypeAlias = Union[ - TaskMetadataTriggeredByManual, - TaskMetadataTriggeredByPostDevcontainerStart, - TaskMetadataTriggeredByPostEnvironmentStart, + TaskMetadataTriggeredByUnionMember0, + TaskMetadataTriggeredByUnionMember1, + TaskMetadataTriggeredByUnionMember2, + TaskMetadataTriggeredByUnionMember3, ] @@ -183,14 +206,17 @@ class TaskMetadata(BaseModel): """triggered_by is a list of trigger that start the task.""" -class TaskSpecRunsOnDocker(BaseModel): +class TaskSpecRunsOnDockerDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskSpecRunsOn(BaseModel): - docker: TaskSpecRunsOnDocker +class TaskSpecRunsOnDocker(BaseModel): + docker: TaskSpecRunsOnDockerDocker + + +TaskSpecRunsOn: TypeAlias = Union[TaskSpecRunsOnDocker, TaskSpecRunsOnDocker] class TaskSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_list_response.py b/src/gitpod/types/environments/automations/task_list_response.py index eebde115..4d3881c5 100644 --- a/src/gitpod/types/environments/automations/task_list_response.py +++ b/src/gitpod/types/environments/automations/task_list_response.py @@ -15,12 +15,14 @@ "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", - "TaskMetadataTriggeredByManual", - "TaskMetadataTriggeredByPostDevcontainerStart", - "TaskMetadataTriggeredByPostEnvironmentStart", + "TaskMetadataTriggeredByUnionMember0", + "TaskMetadataTriggeredByUnionMember1", + "TaskMetadataTriggeredByUnionMember2", + "TaskMetadataTriggeredByUnionMember3", "TaskSpec", "TaskSpecRunsOn", "TaskSpecRunsOnDocker", + "TaskSpecRunsOnDockerDocker", ] @@ -49,22 +51,43 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredByManual(BaseModel): +class TaskMetadataTriggeredByUnionMember0(BaseModel): manual: bool + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) -class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + + +class TaskMetadataTriggeredByUnionMember1(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + manual: Optional[bool] = None + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + -class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): +class TaskMetadataTriggeredByUnionMember2(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + +class TaskMetadataTriggeredByUnionMember3(BaseModel): + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + TaskMetadataTriggeredBy: TypeAlias = Union[ - TaskMetadataTriggeredByManual, - TaskMetadataTriggeredByPostDevcontainerStart, - TaskMetadataTriggeredByPostEnvironmentStart, + TaskMetadataTriggeredByUnionMember0, + TaskMetadataTriggeredByUnionMember1, + TaskMetadataTriggeredByUnionMember2, + TaskMetadataTriggeredByUnionMember3, ] @@ -192,14 +215,17 @@ class TaskMetadata(BaseModel): """triggered_by is a list of trigger that start the task.""" -class TaskSpecRunsOnDocker(BaseModel): +class TaskSpecRunsOnDockerDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskSpecRunsOn(BaseModel): - docker: TaskSpecRunsOnDocker +class TaskSpecRunsOnDocker(BaseModel): + docker: TaskSpecRunsOnDockerDocker + + +TaskSpecRunsOn: TypeAlias = Union[TaskSpecRunsOnDocker, TaskSpecRunsOnDocker] class TaskSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index a9b4c055..866e5439 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -14,12 +14,14 @@ "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", - "TaskMetadataTriggeredByManual", - "TaskMetadataTriggeredByPostDevcontainerStart", - "TaskMetadataTriggeredByPostEnvironmentStart", + "TaskMetadataTriggeredByUnionMember0", + "TaskMetadataTriggeredByUnionMember1", + "TaskMetadataTriggeredByUnionMember2", + "TaskMetadataTriggeredByUnionMember3", "TaskSpec", "TaskSpecRunsOn", "TaskSpecRunsOnDocker", + "TaskSpecRunsOnDockerDocker", ] @@ -40,22 +42,43 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredByManual(BaseModel): +class TaskMetadataTriggeredByUnionMember0(BaseModel): manual: bool + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) -class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + + +class TaskMetadataTriggeredByUnionMember1(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") + manual: Optional[bool] = None + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + -class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): +class TaskMetadataTriggeredByUnionMember2(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + +class TaskMetadataTriggeredByUnionMember3(BaseModel): + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + TaskMetadataTriggeredBy: TypeAlias = Union[ - TaskMetadataTriggeredByManual, - TaskMetadataTriggeredByPostDevcontainerStart, - TaskMetadataTriggeredByPostEnvironmentStart, + TaskMetadataTriggeredByUnionMember0, + TaskMetadataTriggeredByUnionMember1, + TaskMetadataTriggeredByUnionMember2, + TaskMetadataTriggeredByUnionMember3, ] @@ -183,14 +206,17 @@ class TaskMetadata(BaseModel): """triggered_by is a list of trigger that start the task.""" -class TaskSpecRunsOnDocker(BaseModel): +class TaskSpecRunsOnDockerDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskSpecRunsOn(BaseModel): - docker: TaskSpecRunsOnDocker +class TaskSpecRunsOnDocker(BaseModel): + docker: TaskSpecRunsOnDockerDocker + + +TaskSpecRunsOn: TypeAlias = Union[TaskSpecRunsOnDocker, TaskSpecRunsOnDocker] class TaskSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py index 35d969e0..7575b51f 100644 --- a/src/gitpod/types/environments/automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -17,11 +17,23 @@ "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", "TaskExecutionSpecPlanStepUnionMember0", + "TaskExecutionSpecPlanStepUnionMember0Task", + "TaskExecutionSpecPlanStepUnionMember0TaskSpec", + "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn", + "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker", "TaskExecutionSpecPlanStepUnionMember1", "TaskExecutionSpecPlanStepUnionMember1Task", "TaskExecutionSpecPlanStepUnionMember1TaskSpec", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker", + "TaskExecutionSpecPlanStepUnionMember2", + "TaskExecutionSpecPlanStepUnionMember2Task", + "TaskExecutionSpecPlanStepUnionMember2TaskSpec", + "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn", + "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -334,6 +346,35 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" +class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker + + +TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker +] + + +class TaskExecutionSpecPlanStepUnionMember0TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class TaskExecutionSpecPlanStepUnionMember0Task(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpec] = None + + class TaskExecutionSpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") @@ -344,15 +385,22 @@ class TaskExecutionSpecPlanStepUnionMember0(BaseModel): label: Optional[str] = None + task: Optional[TaskExecutionSpecPlanStepUnionMember0Task] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): + +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker + + +TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker +] class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): @@ -379,9 +427,53 @@ class TaskExecutionSpecPlanStepUnionMember1(BaseModel): label: Optional[str] = None + service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) + + +class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker + + +TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker +] + + +class TaskExecutionSpecPlanStepUnionMember2TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class TaskExecutionSpecPlanStepUnionMember2Task(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpec] = None + + +class TaskExecutionSpecPlanStepUnionMember2(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) + + task: Optional[TaskExecutionSpecPlanStepUnionMember2Task] = None + TaskExecutionSpecPlanStep: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 + TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1, TaskExecutionSpecPlanStepUnionMember2 ] diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index adb1ba2e..19c461b8 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -2,28 +2,12 @@ from __future__ import annotations -from typing import List, Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing import List +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = [ - "TaskUpdateParams", - "Metadata", - "MetadataDescription", - "MetadataName", - "MetadataTriggeredBy", - "MetadataTriggeredByTriggeredBy", - "MetadataTriggeredByTriggeredByTrigger", - "MetadataTriggeredByTriggeredByTriggerManual", - "MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart", - "MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart", - "Spec", - "SpecCommand", - "SpecRunsOn", - "SpecRunsOnRunsOn", - "SpecRunsOnRunsOnDocker", -] +__all__ = ["TaskUpdateParams", "Metadata", "Spec"] class TaskUpdateParams(TypedDict, total=False): @@ -43,60 +27,9 @@ class TaskUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class MetadataDescription(TypedDict, total=False): - description: Required[str] +class Metadata: + pass -class MetadataName(TypedDict, total=False): - name: Required[str] - - -class MetadataTriggeredByTriggeredByTriggerManual(TypedDict, total=False): - manual: Required[bool] - - -class MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart(TypedDict, total=False): - post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] - - -class MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart(TypedDict, total=False): - post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] - - -MetadataTriggeredByTriggeredByTrigger: TypeAlias = Union[ - MetadataTriggeredByTriggeredByTriggerManual, - MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart, - MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart, -] - - -class MetadataTriggeredByTriggeredBy(TypedDict, total=False): - trigger: Iterable[MetadataTriggeredByTriggeredByTrigger] - - -class MetadataTriggeredBy(TypedDict, total=False): - triggered_by: Required[Annotated[MetadataTriggeredByTriggeredBy, PropertyInfo(alias="triggeredBy")]] - - -Metadata: TypeAlias = Union[MetadataDescription, MetadataName, MetadataTriggeredBy] - - -class SpecCommand(TypedDict, total=False): - command: Required[str] - - -class SpecRunsOnRunsOnDocker(TypedDict, total=False): - environment: List[str] - - image: str - - -class SpecRunsOnRunsOn(TypedDict, total=False): - docker: Required[SpecRunsOnRunsOnDocker] - - -class SpecRunsOn(TypedDict, total=False): - runs_on: Required[Annotated[SpecRunsOnRunsOn, PropertyInfo(alias="runsOn")]] - - -Spec: TypeAlias = Union[SpecCommand, SpecRunsOn] +class Spec: + pass diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_response.py b/src/gitpod/types/environments/automations/tasks/execution_list_response.py index 8a862ecb..bf26a880 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_list_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_list_response.py @@ -18,11 +18,23 @@ "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", "TaskExecutionSpecPlanStepUnionMember0", + "TaskExecutionSpecPlanStepUnionMember0Task", + "TaskExecutionSpecPlanStepUnionMember0TaskSpec", + "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn", + "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker", "TaskExecutionSpecPlanStepUnionMember1", "TaskExecutionSpecPlanStepUnionMember1Task", "TaskExecutionSpecPlanStepUnionMember1TaskSpec", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker", + "TaskExecutionSpecPlanStepUnionMember2", + "TaskExecutionSpecPlanStepUnionMember2Task", + "TaskExecutionSpecPlanStepUnionMember2TaskSpec", + "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn", + "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -343,6 +355,35 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" +class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker + + +TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker +] + + +class TaskExecutionSpecPlanStepUnionMember0TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class TaskExecutionSpecPlanStepUnionMember0Task(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpec] = None + + class TaskExecutionSpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") @@ -353,15 +394,22 @@ class TaskExecutionSpecPlanStepUnionMember0(BaseModel): label: Optional[str] = None + task: Optional[TaskExecutionSpecPlanStepUnionMember0Task] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): + +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker + + +TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker +] class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): @@ -388,9 +436,53 @@ class TaskExecutionSpecPlanStepUnionMember1(BaseModel): label: Optional[str] = None + service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) + + +class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker + + +TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker +] + + +class TaskExecutionSpecPlanStepUnionMember2TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class TaskExecutionSpecPlanStepUnionMember2Task(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpec] = None + + +class TaskExecutionSpecPlanStepUnionMember2(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) + + task: Optional[TaskExecutionSpecPlanStepUnionMember2Task] = None + TaskExecutionSpecPlanStep: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 + TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1, TaskExecutionSpecPlanStepUnionMember2 ] diff --git a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py index b42c9e35..22437f91 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py @@ -17,11 +17,23 @@ "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", "TaskExecutionSpecPlanStepUnionMember0", + "TaskExecutionSpecPlanStepUnionMember0Task", + "TaskExecutionSpecPlanStepUnionMember0TaskSpec", + "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn", + "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker", "TaskExecutionSpecPlanStepUnionMember1", "TaskExecutionSpecPlanStepUnionMember1Task", "TaskExecutionSpecPlanStepUnionMember1TaskSpec", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker", + "TaskExecutionSpecPlanStepUnionMember2", + "TaskExecutionSpecPlanStepUnionMember2Task", + "TaskExecutionSpecPlanStepUnionMember2TaskSpec", + "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn", + "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker", + "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -334,6 +346,35 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" +class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker + + +TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker +] + + +class TaskExecutionSpecPlanStepUnionMember0TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class TaskExecutionSpecPlanStepUnionMember0Task(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpec] = None + + class TaskExecutionSpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") @@ -344,15 +385,22 @@ class TaskExecutionSpecPlanStepUnionMember0(BaseModel): label: Optional[str] = None + task: Optional[TaskExecutionSpecPlanStepUnionMember0Task] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): + +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker + + +TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker +] class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): @@ -379,9 +427,53 @@ class TaskExecutionSpecPlanStepUnionMember1(BaseModel): label: Optional[str] = None + service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) + + +class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker + + +TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn: TypeAlias = Union[ + TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker +] + + +class TaskExecutionSpecPlanStepUnionMember2TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" + + +class TaskExecutionSpecPlanStepUnionMember2Task(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpec] = None + + +class TaskExecutionSpecPlanStepUnionMember2(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) + + task: Optional[TaskExecutionSpecPlanStepUnionMember2Task] = None + TaskExecutionSpecPlanStep: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 + TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1, TaskExecutionSpecPlanStepUnionMember2 ] diff --git a/src/gitpod/types/event_watch_params.py b/src/gitpod/types/event_watch_params.py index 1303a6a3..bc1fdbbe 100644 --- a/src/gitpod/types/event_watch_params.py +++ b/src/gitpod/types/event_watch_params.py @@ -7,16 +7,10 @@ from .._utils import PropertyInfo -__all__ = [ - "EventWatchParams", - "EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment", - "OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued", -] +__all__ = ["EventWatchParams", "Variant0", "Variant1", "Variant2"] -class EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment( - TypedDict, total=False -): +class Variant0(TypedDict, total=False): environment_id: Required[Annotated[str, PropertyInfo(alias="environmentId")]] """ Environment scope produces events for the environment itself, all tasks, task @@ -28,13 +22,18 @@ class EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecution connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + organization: bool + """Organization scope produces events for all projects, runners and environments + + the caller can see within their organization. No task, task execution or service + events are produed. + """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -class OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued( - TypedDict, total=False -): +class Variant1(TypedDict, total=False): organization: Required[bool] """Organization scope produces events for all projects, runners and environments @@ -45,11 +44,39 @@ class OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCall connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """ + Environment scope produces events for the environment itself, all tasks, task + executions, + + and services associated with that environment. + """ + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """ + Environment scope produces events for the environment itself, all tasks, task + executions, + + and services associated with that environment. + """ + + organization: bool + """Organization scope produces events for all projects, runners and environments + + the caller can see within their organization. No task, task execution or service + events are produed. + """ + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -EventWatchParams: TypeAlias = Union[ - EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment, - OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued, -] +EventWatchParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/organization_join_params.py b/src/gitpod/types/organization_join_params.py index 40550797..cdc8f4db 100644 --- a/src/gitpod/types/organization_join_params.py +++ b/src/gitpod/types/organization_join_params.py @@ -7,36 +7,49 @@ from .._utils import PropertyInfo -__all__ = [ - "OrganizationJoinParams", - "InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization", - "OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin", -] +__all__ = ["OrganizationJoinParams", "Variant0", "Variant1", "Variant2"] -class InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization(TypedDict, total=False): +class Variant0(TypedDict, total=False): invite_id: Required[Annotated[str, PropertyInfo(alias="inviteId")]] """invite_id is the unique identifier of the invite to join the organization.""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the unique identifier of the Organization to join.""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -class OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin(TypedDict, total=False): +class Variant1(TypedDict, total=False): organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organization_id is the unique identifier of the Organization to join.""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + invite_id: Annotated[str, PropertyInfo(alias="inviteId")] + """invite_id is the unique identifier of the invite to join the organization.""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + invite_id: Annotated[str, PropertyInfo(alias="inviteId")] + """invite_id is the unique identifier of the invite to join the organization.""" + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the unique identifier of the Organization to join.""" + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -OrganizationJoinParams: TypeAlias = Union[ - InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization, - OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin, -] +OrganizationJoinParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/organization_update_params.py b/src/gitpod/types/organization_update_params.py index 51f2345f..9cd27531 100644 --- a/src/gitpod/types/organization_update_params.py +++ b/src/gitpod/types/organization_update_params.py @@ -2,24 +2,15 @@ from __future__ import annotations -from typing import List, Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = [ - "OrganizationUpdateParams", - "InviteDomainsIsTheDomainAllowlistOfTheOrganization", - "InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains", - "NameIsTheNewNameOfTheOrganization", -] +__all__ = ["OrganizationUpdateParams", "Body"] -class InviteDomainsIsTheDomainAllowlistOfTheOrganization(TypedDict, total=False): - invite_domains: Required[ - Annotated[InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, PropertyInfo(alias="inviteDomains")] - ] - """invite_domains is the domain allowlist of the organization""" +class OrganizationUpdateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -28,22 +19,5 @@ class InviteDomainsIsTheDomainAllowlistOfTheOrganization(TypedDict, total=False) """Define the timeout, in ms""" -class InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains(TypedDict, total=False): - domains: List[str] - """domains is the list of domains that are allowed to join the organization""" - - -class NameIsTheNewNameOfTheOrganization(TypedDict, total=False): - name: Required[str] - """name is the new name of the organization""" - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -OrganizationUpdateParams: TypeAlias = Union[ - InviteDomainsIsTheDomainAllowlistOfTheOrganization, NameIsTheNewNameOfTheOrganization -] +class Body: + pass diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py index b550a136..d315b1f2 100644 --- a/src/gitpod/types/organizations/sso_configuration_update_params.py +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -2,24 +2,15 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = [ - "SSOConfigurationUpdateParams", - "ClientIDIsTheClientIDOfTheSSOProvider", - "ClientSecretIsTheClientSecretOfTheSSOProvider", - "Variant2", - "IssuerURLIsTheURLOfTheIDPIssuer", - "StateIsTheStateOfTheSSOConfiguration", -] +__all__ = ["SSOConfigurationUpdateParams", "Body"] -class ClientIDIsTheClientIDOfTheSSOProvider(TypedDict, total=False): - client_id: Required[Annotated[str, PropertyInfo(alias="clientId")]] - """client_id is the client ID of the SSO provider""" +class SSOConfigurationUpdateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -28,57 +19,5 @@ class ClientIDIsTheClientIDOfTheSSOProvider(TypedDict, total=False): """Define the timeout, in ms""" -class ClientSecretIsTheClientSecretOfTheSSOProvider(TypedDict, total=False): - client_secret: Required[Annotated[str, PropertyInfo(alias="clientSecret")]] - """client_secret is the client secret of the SSO provider""" - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2(TypedDict, total=False): - email_domain: Required[Annotated[str, PropertyInfo(alias="emailDomain")]] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class IssuerURLIsTheURLOfTheIDPIssuer(TypedDict, total=False): - issuer_url: Required[Annotated[str, PropertyInfo(alias="issuerUrl")]] - """issuer_url is the URL of the IdP issuer""" - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class StateIsTheStateOfTheSSOConfiguration(TypedDict, total=False): - state: Required[ - Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ] - ] - """state is the state of the SSO configuration""" - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -SSOConfigurationUpdateParams: TypeAlias = Union[ - ClientIDIsTheClientIDOfTheSSOProvider, - ClientSecretIsTheClientSecretOfTheSSOProvider, - Variant2, - IssuerURLIsTheURLOfTheIDPIssuer, - StateIsTheStateOfTheSSOConfiguration, -] +class Body: + pass diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py index c9e9529f..f4f2277a 100644 --- a/src/gitpod/types/project_create_from_environment_response.py +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -12,14 +12,20 @@ "ProjectCreateFromEnvironmentResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", + "ProjectEnvironmentClassUnionMember0", + "ProjectEnvironmentClassUnionMember1", + "ProjectEnvironmentClassUnionMember2", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", + "ProjectInitializerSpecUnionMember0", + "ProjectInitializerSpecUnionMember0ContextURL", + "ProjectInitializerSpecUnionMember0Git", + "ProjectInitializerSpecUnionMember1", + "ProjectInitializerSpecUnionMember1Git", + "ProjectInitializerSpecUnionMember1ContextURL", + "ProjectInitializerSpecUnionMember2", + "ProjectInitializerSpecUnionMember2ContextURL", + "ProjectInitializerSpecUnionMember2Git", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -27,37 +33,84 @@ ] -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): +class ProjectEnvironmentClassUnionMember0(BaseModel): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): +class ProjectEnvironmentClassUnionMember1(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassUnionMember2(BaseModel): + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, + ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 ] -class ProjectInitializerSpecContextURLContextURL(BaseModel): +class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecUnionMember0Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember0(BaseModel): + context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") + git: Optional[ProjectInitializerSpecUnionMember0Git] = None -class ProjectInitializerSpecGitGit(BaseModel): + +class ProjectInitializerSpecUnionMember1Git(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -85,11 +138,59 @@ class ProjectInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit +class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember1(BaseModel): + git: ProjectInitializerSpecUnionMember1Git + + context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] +class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember2Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember2(BaseModel): + context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) + + git: Optional[ProjectInitializerSpecUnionMember2Git] = None + + +ProjectInitializerSpec: TypeAlias = Union[ + ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 +] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index 708cecd0..c9fe81c3 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -10,14 +10,20 @@ __all__ = [ "ProjectCreateParams", "EnvironmentClass", - "EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "EnvironmentClassUseALocalRunnerForTheUser", + "EnvironmentClassUnionMember0", + "EnvironmentClassUnionMember1", + "EnvironmentClassUnionMember2", "Initializer", "InitializerSpec", - "InitializerSpecContextURL", - "InitializerSpecContextURLContextURL", - "InitializerSpecGit", - "InitializerSpecGitGit", + "InitializerSpecUnionMember0", + "InitializerSpecUnionMember0ContextURL", + "InitializerSpecUnionMember0Git", + "InitializerSpecUnionMember1", + "InitializerSpecUnionMember1Git", + "InitializerSpecUnionMember1ContextURL", + "InitializerSpecUnionMember2", + "InitializerSpecUnionMember2ContextURL", + "InitializerSpecUnionMember2Git", ] @@ -56,37 +62,130 @@ class ProjectCreateParams(TypedDict, total=False): """Define the timeout, in ms""" -class EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - TypedDict, total=False -): +class EnvironmentClassUnionMember0(TypedDict, total=False): environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ + local_runner: Annotated[bool, PropertyInfo(alias="localRunner")] + """Use a local runner for the user""" + -class EnvironmentClassUseALocalRunnerForTheUser(TypedDict, total=False): +class EnvironmentClassUnionMember1(TypedDict, total=False): local_runner: Required[Annotated[bool, PropertyInfo(alias="localRunner")]] """Use a local runner for the user""" + environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class EnvironmentClassUnionMember2(TypedDict, total=False): + environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + local_runner: Annotated[bool, PropertyInfo(alias="localRunner")] + """Use a local runner for the user""" + EnvironmentClass: TypeAlias = Union[ - EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - EnvironmentClassUseALocalRunnerForTheUser, + EnvironmentClassUnionMember0, EnvironmentClassUnionMember1, EnvironmentClassUnionMember2 ] -class InitializerSpecContextURLContextURL(TypedDict, total=False): +class InitializerSpecUnionMember0ContextURL(TypedDict, total=False): url: str """url is the URL from which the environment is created""" -class InitializerSpecContextURL(TypedDict, total=False): - context_url: Required[Annotated[InitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] +class InitializerSpecUnionMember0Git(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class InitializerSpecUnionMember0(TypedDict, total=False): + context_url: Required[Annotated[InitializerSpecUnionMember0ContextURL, PropertyInfo(alias="contextUrl")]] + git: InitializerSpecUnionMember0Git -class InitializerSpecGitGit(TypedDict, total=False): + +class InitializerSpecUnionMember1Git(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class InitializerSpecUnionMember1ContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class InitializerSpecUnionMember1(TypedDict, total=False): + git: Required[InitializerSpecUnionMember1Git] + + context_url: Annotated[InitializerSpecUnionMember1ContextURL, PropertyInfo(alias="contextUrl")] + + +class InitializerSpecUnionMember2ContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class InitializerSpecUnionMember2Git(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] """a path relative to the environment root in which the code will be checked out @@ -115,11 +214,15 @@ class InitializerSpecGitGit(TypedDict, total=False): """upstream_Remote_uri is the fork upstream of a repository""" -class InitializerSpecGit(TypedDict, total=False): - git: Required[InitializerSpecGitGit] +class InitializerSpecUnionMember2(TypedDict, total=False): + context_url: Annotated[InitializerSpecUnionMember2ContextURL, PropertyInfo(alias="contextUrl")] + git: InitializerSpecUnionMember2Git -InitializerSpec: TypeAlias = Union[InitializerSpecContextURL, InitializerSpecGit] + +InitializerSpec: TypeAlias = Union[ + InitializerSpecUnionMember0, InitializerSpecUnionMember1, InitializerSpecUnionMember2 +] class Initializer(TypedDict, total=False): diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py index 96ecc716..6e7065ba 100644 --- a/src/gitpod/types/project_create_response.py +++ b/src/gitpod/types/project_create_response.py @@ -12,14 +12,20 @@ "ProjectCreateResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", + "ProjectEnvironmentClassUnionMember0", + "ProjectEnvironmentClassUnionMember1", + "ProjectEnvironmentClassUnionMember2", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", + "ProjectInitializerSpecUnionMember0", + "ProjectInitializerSpecUnionMember0ContextURL", + "ProjectInitializerSpecUnionMember0Git", + "ProjectInitializerSpecUnionMember1", + "ProjectInitializerSpecUnionMember1Git", + "ProjectInitializerSpecUnionMember1ContextURL", + "ProjectInitializerSpecUnionMember2", + "ProjectInitializerSpecUnionMember2ContextURL", + "ProjectInitializerSpecUnionMember2Git", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -27,37 +33,84 @@ ] -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): +class ProjectEnvironmentClassUnionMember0(BaseModel): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): +class ProjectEnvironmentClassUnionMember1(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassUnionMember2(BaseModel): + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, + ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 ] -class ProjectInitializerSpecContextURLContextURL(BaseModel): +class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecUnionMember0Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember0(BaseModel): + context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") + git: Optional[ProjectInitializerSpecUnionMember0Git] = None -class ProjectInitializerSpecGitGit(BaseModel): + +class ProjectInitializerSpecUnionMember1Git(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -85,11 +138,59 @@ class ProjectInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit +class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember1(BaseModel): + git: ProjectInitializerSpecUnionMember1Git + + context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] +class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember2Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember2(BaseModel): + context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) + + git: Optional[ProjectInitializerSpecUnionMember2Git] = None + + +ProjectInitializerSpec: TypeAlias = Union[ + ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 +] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/project_list_response.py b/src/gitpod/types/project_list_response.py index da32fdb4..db8dffdf 100644 --- a/src/gitpod/types/project_list_response.py +++ b/src/gitpod/types/project_list_response.py @@ -13,14 +13,20 @@ "Pagination", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", + "ProjectEnvironmentClassUnionMember0", + "ProjectEnvironmentClassUnionMember1", + "ProjectEnvironmentClassUnionMember2", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", + "ProjectInitializerSpecUnionMember0", + "ProjectInitializerSpecUnionMember0ContextURL", + "ProjectInitializerSpecUnionMember0Git", + "ProjectInitializerSpecUnionMember1", + "ProjectInitializerSpecUnionMember1Git", + "ProjectInitializerSpecUnionMember1ContextURL", + "ProjectInitializerSpecUnionMember2", + "ProjectInitializerSpecUnionMember2ContextURL", + "ProjectInitializerSpecUnionMember2Git", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -36,37 +42,84 @@ class Pagination(BaseModel): """ -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): +class ProjectEnvironmentClassUnionMember0(BaseModel): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): +class ProjectEnvironmentClassUnionMember1(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassUnionMember2(BaseModel): + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, + ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 ] -class ProjectInitializerSpecContextURLContextURL(BaseModel): +class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecUnionMember0Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember0(BaseModel): + context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") + git: Optional[ProjectInitializerSpecUnionMember0Git] = None -class ProjectInitializerSpecGitGit(BaseModel): + +class ProjectInitializerSpecUnionMember1Git(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -94,11 +147,59 @@ class ProjectInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit +class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember1(BaseModel): + git: ProjectInitializerSpecUnionMember1Git + + context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] +class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember2Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember2(BaseModel): + context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) + + git: Optional[ProjectInitializerSpecUnionMember2Git] = None + + +ProjectInitializerSpec: TypeAlias = Union[ + ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 +] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py index b8c2c736..c7a33dbd 100644 --- a/src/gitpod/types/project_retrieve_response.py +++ b/src/gitpod/types/project_retrieve_response.py @@ -12,14 +12,20 @@ "ProjectRetrieveResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", + "ProjectEnvironmentClassUnionMember0", + "ProjectEnvironmentClassUnionMember1", + "ProjectEnvironmentClassUnionMember2", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", + "ProjectInitializerSpecUnionMember0", + "ProjectInitializerSpecUnionMember0ContextURL", + "ProjectInitializerSpecUnionMember0Git", + "ProjectInitializerSpecUnionMember1", + "ProjectInitializerSpecUnionMember1Git", + "ProjectInitializerSpecUnionMember1ContextURL", + "ProjectInitializerSpecUnionMember2", + "ProjectInitializerSpecUnionMember2ContextURL", + "ProjectInitializerSpecUnionMember2Git", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -27,37 +33,84 @@ ] -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): +class ProjectEnvironmentClassUnionMember0(BaseModel): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): +class ProjectEnvironmentClassUnionMember1(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassUnionMember2(BaseModel): + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, + ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 ] -class ProjectInitializerSpecContextURLContextURL(BaseModel): +class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecUnionMember0Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember0(BaseModel): + context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") + git: Optional[ProjectInitializerSpecUnionMember0Git] = None -class ProjectInitializerSpecGitGit(BaseModel): + +class ProjectInitializerSpecUnionMember1Git(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -85,11 +138,59 @@ class ProjectInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit +class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember1(BaseModel): + git: ProjectInitializerSpecUnionMember1Git + + context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] +class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember2Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember2(BaseModel): + context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) + + git: Optional[ProjectInitializerSpecUnionMember2Git] = None + + +ProjectInitializerSpec: TypeAlias = Union[ + ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 +] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py index c8ac42c1..f5df394f 100644 --- a/src/gitpod/types/project_update_params.py +++ b/src/gitpod/types/project_update_params.py @@ -2,165 +2,15 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = [ - "ProjectUpdateParams", - "AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot", - "DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", - "Variant2", - "Variant2EnvironmentClass", - "Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "Variant2EnvironmentClassUseALocalRunnerForTheUser", - "InitializerIsTheContentInitializer", - "InitializerIsTheContentInitializerInitializer", - "InitializerIsTheContentInitializerInitializerSpec", - "InitializerIsTheContentInitializerInitializerSpecContextURL", - "InitializerIsTheContentInitializerInitializerSpecContextURLContextURL", - "InitializerIsTheContentInitializerInitializerSpecGit", - "InitializerIsTheContentInitializerInitializerSpecGitGit", - "Variant4", -] +__all__ = ["ProjectUpdateParams", "Body"] -class AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot(TypedDict, total=False): - automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] - """ - automations_file_path is the path to the automations file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot(TypedDict, total=False): - devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2(TypedDict, total=False): - environment_class: Required[Annotated[Variant2EnvironmentClass, PropertyInfo(alias="environmentClass")]] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - TypedDict, total=False -): - environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class Variant2EnvironmentClassUseALocalRunnerForTheUser(TypedDict, total=False): - local_runner: Required[Annotated[bool, PropertyInfo(alias="localRunner")]] - """Use a local runner for the user""" - - -Variant2EnvironmentClass: TypeAlias = Union[ - Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - Variant2EnvironmentClassUseALocalRunnerForTheUser, -] - - -class InitializerIsTheContentInitializer(TypedDict, total=False): - initializer: Required[InitializerIsTheContentInitializerInitializer] - """EnvironmentInitializer specifies how an environment is to be initialized""" - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class InitializerIsTheContentInitializerInitializerSpecContextURLContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - - -class InitializerIsTheContentInitializerInitializerSpecContextURL(TypedDict, total=False): - context_url: Required[ - Annotated[ - InitializerIsTheContentInitializerInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl") - ] - ] - - -class InitializerIsTheContentInitializerInitializerSpecGitGit(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class InitializerIsTheContentInitializerInitializerSpecGit(TypedDict, total=False): - git: Required[InitializerIsTheContentInitializerInitializerSpecGitGit] - - -InitializerIsTheContentInitializerInitializerSpec: TypeAlias = Union[ - InitializerIsTheContentInitializerInitializerSpecContextURL, InitializerIsTheContentInitializerInitializerSpecGit -] - - -class InitializerIsTheContentInitializerInitializer(TypedDict, total=False): - specs: Iterable[InitializerIsTheContentInitializerInitializerSpec] - - -class Variant4(TypedDict, total=False): - name: Required[str] +class ProjectUpdateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -169,10 +19,5 @@ class Variant4(TypedDict, total=False): """Define the timeout, in ms""" -ProjectUpdateParams: TypeAlias = Union[ - AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot, - DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, - Variant2, - InitializerIsTheContentInitializer, - Variant4, -] +class Body: + pass diff --git a/src/gitpod/types/project_update_response.py b/src/gitpod/types/project_update_response.py index f90b85b6..b4130475 100644 --- a/src/gitpod/types/project_update_response.py +++ b/src/gitpod/types/project_update_response.py @@ -12,14 +12,20 @@ "ProjectUpdateResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", + "ProjectEnvironmentClassUnionMember0", + "ProjectEnvironmentClassUnionMember1", + "ProjectEnvironmentClassUnionMember2", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", + "ProjectInitializerSpecUnionMember0", + "ProjectInitializerSpecUnionMember0ContextURL", + "ProjectInitializerSpecUnionMember0Git", + "ProjectInitializerSpecUnionMember1", + "ProjectInitializerSpecUnionMember1Git", + "ProjectInitializerSpecUnionMember1ContextURL", + "ProjectInitializerSpecUnionMember2", + "ProjectInitializerSpecUnionMember2ContextURL", + "ProjectInitializerSpecUnionMember2Git", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -27,37 +33,84 @@ ] -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): +class ProjectEnvironmentClassUnionMember0(BaseModel): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): +class ProjectEnvironmentClassUnionMember1(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class ProjectEnvironmentClassUnionMember2(BaseModel): + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" + ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, + ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 ] -class ProjectInitializerSpecContextURLContextURL(BaseModel): +class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecUnionMember0Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember0(BaseModel): + context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") + git: Optional[ProjectInitializerSpecUnionMember0Git] = None -class ProjectInitializerSpecGitGit(BaseModel): + +class ProjectInitializerSpecUnionMember1Git(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -85,11 +138,59 @@ class ProjectInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit +class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember1(BaseModel): + git: ProjectInitializerSpecUnionMember1Git + + context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] +class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class ProjectInitializerSpecUnionMember2Git(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class ProjectInitializerSpecUnionMember2(BaseModel): + context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) + + git: Optional[ProjectInitializerSpecUnionMember2Git] = None + + +ProjectInitializerSpec: TypeAlias = Union[ + ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 +] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/runner_create_params.py b/src/gitpod/types/runner_create_params.py index 4e37b01e..cd560006 100644 --- a/src/gitpod/types/runner_create_params.py +++ b/src/gitpod/types/runner_create_params.py @@ -21,6 +21,18 @@ class RunnerCreateParams(TypedDict, total=False): name: str """The runner name for humans""" + provider: Literal[ + "RUNNER_PROVIDER_UNSPECIFIED", + "RUNNER_PROVIDER_AWS_EC2", + "RUNNER_PROVIDER_LINUX_HOST", + "RUNNER_PROVIDER_DESKTOP_MAC", + ] + """ + RunnerProvider identifies the specific implementation type of a runner. Each + provider maps to a specific kind of runner (local or remote), as specified below + for each provider. + """ + spec: Spec connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] diff --git a/src/gitpod/types/runner_create_response.py b/src/gitpod/types/runner_create_response.py index 0a2e92bf..5591848d 100644 --- a/src/gitpod/types/runner_create_response.py +++ b/src/gitpod/types/runner_create_response.py @@ -314,6 +314,20 @@ class Runner(BaseModel): name: Optional[str] = None """The runner's name which is shown to users""" + provider: Optional[ + Literal[ + "RUNNER_PROVIDER_UNSPECIFIED", + "RUNNER_PROVIDER_AWS_EC2", + "RUNNER_PROVIDER_LINUX_HOST", + "RUNNER_PROVIDER_DESKTOP_MAC", + ] + ] = None + """ + RunnerProvider identifies the specific implementation type of a runner. Each + provider maps to a specific kind of runner (local or remote), as specified below + for each provider. + """ + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) spec: Optional[RunnerSpec] = None diff --git a/src/gitpod/types/runner_list_response.py b/src/gitpod/types/runner_list_response.py index 2c0da5a1..0012aca6 100644 --- a/src/gitpod/types/runner_list_response.py +++ b/src/gitpod/types/runner_list_response.py @@ -323,6 +323,20 @@ class Runner(BaseModel): name: Optional[str] = None """The runner's name which is shown to users""" + provider: Optional[ + Literal[ + "RUNNER_PROVIDER_UNSPECIFIED", + "RUNNER_PROVIDER_AWS_EC2", + "RUNNER_PROVIDER_LINUX_HOST", + "RUNNER_PROVIDER_DESKTOP_MAC", + ] + ] = None + """ + RunnerProvider identifies the specific implementation type of a runner. Each + provider maps to a specific kind of runner (local or remote), as specified below + for each provider. + """ + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) spec: Optional[RunnerSpec] = None diff --git a/src/gitpod/types/runner_retrieve_response.py b/src/gitpod/types/runner_retrieve_response.py index b4ca023b..d1a70727 100644 --- a/src/gitpod/types/runner_retrieve_response.py +++ b/src/gitpod/types/runner_retrieve_response.py @@ -314,6 +314,20 @@ class Runner(BaseModel): name: Optional[str] = None """The runner's name which is shown to users""" + provider: Optional[ + Literal[ + "RUNNER_PROVIDER_UNSPECIFIED", + "RUNNER_PROVIDER_AWS_EC2", + "RUNNER_PROVIDER_LINUX_HOST", + "RUNNER_PROVIDER_DESKTOP_MAC", + ] + ] = None + """ + RunnerProvider identifies the specific implementation type of a runner. Each + provider maps to a specific kind of runner (local or remote), as specified below + for each provider. + """ + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) spec: Optional[RunnerSpec] = None diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index 28bcc60a..662314ee 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -2,27 +2,15 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = [ - "RunnerUpdateParams", - "TheRunnerSNameWhichIsShownToUsers", - "Variant1", - "Variant1Spec", - "Variant1SpecConfiguration", - "Variant1SpecConfigurationConfiguration", - "Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself", - "Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn", - "Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners", -] +__all__ = ["RunnerUpdateParams", "Body"] -class TheRunnerSNameWhichIsShownToUsers(TypedDict, total=False): - name: Required[str] - """The runner's name which is shown to users""" +class RunnerUpdateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -31,68 +19,5 @@ class TheRunnerSNameWhichIsShownToUsers(TypedDict, total=False): """Define the timeout, in ms""" -class Variant1(TypedDict, total=False): - spec: Required[Variant1Spec] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself( - TypedDict, total=False -): - auto_update: Required[Annotated[bool, PropertyInfo(alias="autoUpdate")]] - """auto_update indicates whether the runner should automatically update itself.""" - - -class Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn(TypedDict, total=False): - release_channel: Required[ - Annotated[ - Literal[ - "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST" - ], - PropertyInfo(alias="releaseChannel"), - ] - ] - """The release channel the runner is on""" - - -Variant1SpecConfigurationConfiguration: TypeAlias = Union[ - Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself, - Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn, -] - - -class Variant1SpecConfiguration(TypedDict, total=False): - configuration: Required[Variant1SpecConfigurationConfiguration] - - -class Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners( - TypedDict, total=False -): - desired_phase: Required[ - Annotated[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ], - PropertyInfo(alias="desiredPhase"), - ] - ] - """RunnerPhase represents the phase a runner is in""" - - -Variant1Spec: TypeAlias = Union[ - Variant1SpecConfiguration, - Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners, -] - -RunnerUpdateParams: TypeAlias = Union[TheRunnerSNameWhichIsShownToUsers, Variant1] +class Body: + pass diff --git a/src/gitpod/types/runners/configuration_validate_params.py b/src/gitpod/types/runners/configuration_validate_params.py index 03cc3565..5a418301 100644 --- a/src/gitpod/types/runners/configuration_validate_params.py +++ b/src/gitpod/types/runners/configuration_validate_params.py @@ -5,20 +5,22 @@ from typing import Union, Iterable from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from ..._types import Base64FileInput from ..._utils import PropertyInfo -from ..._models import set_pydantic_config __all__ = [ "ConfigurationValidateParams", "Variant0", "Variant0EnvironmentClass", "Variant0EnvironmentClassConfiguration", + "Variant0ScmIntegration", "Variant1", "Variant1ScmIntegration", - "Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet", - "Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration", - "Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner", + "Variant1EnvironmentClass", + "Variant1EnvironmentClassConfiguration", + "Variant2", + "Variant2EnvironmentClass", + "Variant2EnvironmentClassConfiguration", + "Variant2ScmIntegration", ] @@ -30,6 +32,8 @@ class Variant0(TypedDict, total=False): runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + scm_integration: Annotated[Variant0ScmIntegration, PropertyInfo(alias="scmIntegration")] + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" @@ -66,67 +70,108 @@ class Variant0EnvironmentClass(TypedDict, total=False): """ +class Variant0ScmIntegration: + pass + + class Variant1(TypedDict, total=False): scm_integration: Required[Annotated[Variant1ScmIntegration, PropertyInfo(alias="scmIntegration")]] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + environment_class: Annotated[Variant1EnvironmentClass, PropertyInfo(alias="environmentClass")] + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -class Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet( - TypedDict, total=False -): - oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] - """oauth_client_id is the OAuth app's client ID, if OAuth is configured. +class Variant1ScmIntegration: + pass - If configured, oauth_client_secret must also be set. - """ +class Variant1EnvironmentClassConfiguration(TypedDict, total=False): + key: str + + value: str + + +class Variant1EnvironmentClass(TypedDict, total=False): + id: str + """id is the unique identifier of the environment class""" + + configuration: Iterable[Variant1EnvironmentClassConfiguration] + """configuration describes the configuration of the environment class""" + + description: str + """description is a human readable description of the environment class""" + + display_name: Annotated[str, PropertyInfo(alias="displayName")] + """display_name is the human readable name of the environment class""" + + enabled: bool + """enabled indicates whether the environment class can be used to create -class Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration( - TypedDict, total=False -): - oauth_encrypted_client_secret: Required[ - Annotated[Union[str, Base64FileInput], PropertyInfo(alias="oauthEncryptedClientSecret", format="base64")] - ] + new environments. """ - oauth_encrypted_client_secret is the OAuth app's client secret encrypted with - the runner's public key, - if OAuth is configured. This can be used to e.g. validate an already encrypted - client secret of an existing SCM integration. + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """ + runner_id is the unique identifier of the runner the environment class belongs + to """ -set_pydantic_config( - Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration, - {"arbitrary_types_allowed": True}, -) +class Variant2(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + environment_class: Annotated[Variant2EnvironmentClass, PropertyInfo(alias="environmentClass")] + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] -class Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner( - TypedDict, total=False -): - oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + scm_integration: Annotated[Variant2ScmIntegration, PropertyInfo(alias="scmIntegration")] + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2EnvironmentClassConfiguration(TypedDict, total=False): + key: str + + value: str + + +class Variant2EnvironmentClass(TypedDict, total=False): + id: str + """id is the unique identifier of the environment class""" + + configuration: Iterable[Variant2EnvironmentClassConfiguration] + """configuration describes the configuration of the environment class""" + + description: str + """description is a human readable description of the environment class""" + + display_name: Annotated[str, PropertyInfo(alias="displayName")] + """display_name is the human readable name of the environment class""" + + enabled: bool + """enabled indicates whether the environment class can be used to create + + new environments. """ - oauth_plaintext_client_secret is the OAuth app's client secret in clear text, if - OAuth is configured. - This can be set to validate any new client secret before it is encrypted and - stored. This value will not be stored and get encrypted with the runner's public - key before passing it to the runner. + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """ + runner_id is the unique identifier of the runner the environment class belongs + to """ -Variant1ScmIntegration: TypeAlias = Union[ - Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet, - Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration, - Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner, -] +class Variant2ScmIntegration: + pass + -ConfigurationValidateParams: TypeAlias = Union[Variant0, Variant1] +ConfigurationValidateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/runners/configuration_validate_response.py b/src/gitpod/types/runners/configuration_validate_response.py index a16f6873..0e4d9185 100644 --- a/src/gitpod/types/runners/configuration_validate_response.py +++ b/src/gitpod/types/runners/configuration_validate_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias from pydantic import Field as FieldInfo @@ -9,62 +9,58 @@ __all__ = [ "ConfigurationValidateResponse", - "EnvironmentClass", - "EnvironmentClassEnvironmentClass", - "EnvironmentClassEnvironmentClassDescriptionError", - "EnvironmentClassEnvironmentClassDisplayNameError", - "ScmIntegration", - "ScmIntegrationScmIntegration", - "ScmIntegrationScmIntegrationHostError", - "ScmIntegrationScmIntegrationOAuthError", - "ScmIntegrationScmIntegrationPatError", - "ScmIntegrationScmIntegrationScmIDError", + "UnionMember0", + "UnionMember0EnvironmentClass", + "UnionMember0ScmIntegration", + "UnionMember1", + "UnionMember1ScmIntegration", + "UnionMember1EnvironmentClass", + "UnionMember2", + "UnionMember2EnvironmentClass", + "UnionMember2ScmIntegration", ] -class EnvironmentClassEnvironmentClassDescriptionError(BaseModel): - description_error: str = FieldInfo(alias="descriptionError") +class UnionMember0EnvironmentClass: + pass -class EnvironmentClassEnvironmentClassDisplayNameError(BaseModel): - display_name_error: str = FieldInfo(alias="displayNameError") +class UnionMember0ScmIntegration: + pass -EnvironmentClassEnvironmentClass: TypeAlias = Union[ - EnvironmentClassEnvironmentClassDescriptionError, EnvironmentClassEnvironmentClassDisplayNameError -] +class UnionMember0(BaseModel): + environment_class: UnionMember0EnvironmentClass = FieldInfo(alias="environmentClass") + scm_integration: Optional[UnionMember0ScmIntegration] = FieldInfo(alias="scmIntegration", default=None) -class EnvironmentClass(BaseModel): - environment_class: EnvironmentClassEnvironmentClass = FieldInfo(alias="environmentClass") +class UnionMember1ScmIntegration: + pass -class ScmIntegrationScmIntegrationHostError(BaseModel): - host_error: str = FieldInfo(alias="hostError") +class UnionMember1EnvironmentClass: + pass -class ScmIntegrationScmIntegrationOAuthError(BaseModel): - oauth_error: str = FieldInfo(alias="oauthError") +class UnionMember1(BaseModel): + scm_integration: UnionMember1ScmIntegration = FieldInfo(alias="scmIntegration") -class ScmIntegrationScmIntegrationPatError(BaseModel): - pat_error: str = FieldInfo(alias="patError") + environment_class: Optional[UnionMember1EnvironmentClass] = FieldInfo(alias="environmentClass", default=None) -class ScmIntegrationScmIntegrationScmIDError(BaseModel): - scm_id_error: str = FieldInfo(alias="scmIdError") +class UnionMember2EnvironmentClass: + pass -ScmIntegrationScmIntegration: TypeAlias = Union[ - ScmIntegrationScmIntegrationHostError, - ScmIntegrationScmIntegrationOAuthError, - ScmIntegrationScmIntegrationPatError, - ScmIntegrationScmIntegrationScmIDError, -] +class UnionMember2ScmIntegration: + pass + +class UnionMember2(BaseModel): + environment_class: Optional[UnionMember2EnvironmentClass] = FieldInfo(alias="environmentClass", default=None) -class ScmIntegration(BaseModel): - scm_integration: ScmIntegrationScmIntegration = FieldInfo(alias="scmIntegration") + scm_integration: Optional[UnionMember2ScmIntegration] = FieldInfo(alias="scmIntegration", default=None) -ConfigurationValidateResponse: TypeAlias = Union[EnvironmentClass, ScmIntegration] +ConfigurationValidateResponse: TypeAlias = Union[UnionMember0, UnionMember1, UnionMember2] diff --git a/src/gitpod/types/runners/configurations/environment_class_update_params.py b/src/gitpod/types/runners/configurations/environment_class_update_params.py index 7bcfd5fb..23004279 100644 --- a/src/gitpod/types/runners/configurations/environment_class_update_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_update_params.py @@ -2,16 +2,15 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["EnvironmentClassUpdateParams", "Variant0", "Variant1", "Variant2"] +__all__ = ["EnvironmentClassUpdateParams", "Body"] -class Variant0(TypedDict, total=False): - description: Required[str] +class EnvironmentClassUpdateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -20,24 +19,5 @@ class Variant0(TypedDict, total=False): """Define the timeout, in ms""" -class Variant1(TypedDict, total=False): - display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2(TypedDict, total=False): - enabled: Required[bool] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -EnvironmentClassUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] +class Body: + pass diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py index 9979ef22..2abc362b 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py @@ -2,127 +2,15 @@ from __future__ import annotations -from typing import Union -from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenUpdateParams", "Variant0", "Variant1", "Variant2"] +__all__ = ["HostAuthenticationTokenUpdateParams", "Body"] -class Variant0(TypedDict, total=False): - expires_at: Required[Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")]] - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant1(TypedDict, total=False): - refresh_token: Required[Annotated[str, PropertyInfo(alias="refreshToken")]] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2(TypedDict, total=False): - token: Required[str] +class HostAuthenticationTokenUpdateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -131,4 +19,5 @@ class Variant2(TypedDict, total=False): """Define the timeout, in ms""" -HostAuthenticationTokenUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] +class Body: + pass diff --git a/src/gitpod/types/runners/configurations/schema_retrieve_response.py b/src/gitpod/types/runners/configurations/schema_retrieve_response.py index 8ebcad63..bd3a4e7b 100644 --- a/src/gitpod/types/runners/configurations/schema_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/schema_retrieve_response.py @@ -14,25 +14,77 @@ "SchemaEnvironmentClass", "SchemaEnvironmentClassUnionMember0", "SchemaEnvironmentClassUnionMember0Bool", + "SchemaEnvironmentClassUnionMember0Display", + "SchemaEnvironmentClassUnionMember0Enum", + "SchemaEnvironmentClassUnionMember0Int", + "SchemaEnvironmentClassUnionMember0String", "SchemaEnvironmentClassUnionMember1", "SchemaEnvironmentClassUnionMember1Display", + "SchemaEnvironmentClassUnionMember1Bool", + "SchemaEnvironmentClassUnionMember1Enum", + "SchemaEnvironmentClassUnionMember1Int", + "SchemaEnvironmentClassUnionMember1String", "SchemaEnvironmentClassUnionMember2", "SchemaEnvironmentClassUnionMember2Enum", + "SchemaEnvironmentClassUnionMember2Bool", + "SchemaEnvironmentClassUnionMember2Display", + "SchemaEnvironmentClassUnionMember2Int", + "SchemaEnvironmentClassUnionMember2String", "SchemaEnvironmentClassUnionMember3", "SchemaEnvironmentClassUnionMember3Int", + "SchemaEnvironmentClassUnionMember3Bool", + "SchemaEnvironmentClassUnionMember3Display", + "SchemaEnvironmentClassUnionMember3Enum", + "SchemaEnvironmentClassUnionMember3String", "SchemaEnvironmentClassUnionMember4", "SchemaEnvironmentClassUnionMember4String", + "SchemaEnvironmentClassUnionMember4Bool", + "SchemaEnvironmentClassUnionMember4Display", + "SchemaEnvironmentClassUnionMember4Enum", + "SchemaEnvironmentClassUnionMember4Int", + "SchemaEnvironmentClassUnionMember5", + "SchemaEnvironmentClassUnionMember5Bool", + "SchemaEnvironmentClassUnionMember5Display", + "SchemaEnvironmentClassUnionMember5Enum", + "SchemaEnvironmentClassUnionMember5Int", + "SchemaEnvironmentClassUnionMember5String", "SchemaRunnerConfig", "SchemaRunnerConfigUnionMember0", "SchemaRunnerConfigUnionMember0Bool", + "SchemaRunnerConfigUnionMember0Display", + "SchemaRunnerConfigUnionMember0Enum", + "SchemaRunnerConfigUnionMember0Int", + "SchemaRunnerConfigUnionMember0String", "SchemaRunnerConfigUnionMember1", "SchemaRunnerConfigUnionMember1Display", + "SchemaRunnerConfigUnionMember1Bool", + "SchemaRunnerConfigUnionMember1Enum", + "SchemaRunnerConfigUnionMember1Int", + "SchemaRunnerConfigUnionMember1String", "SchemaRunnerConfigUnionMember2", "SchemaRunnerConfigUnionMember2Enum", + "SchemaRunnerConfigUnionMember2Bool", + "SchemaRunnerConfigUnionMember2Display", + "SchemaRunnerConfigUnionMember2Int", + "SchemaRunnerConfigUnionMember2String", "SchemaRunnerConfigUnionMember3", "SchemaRunnerConfigUnionMember3Int", + "SchemaRunnerConfigUnionMember3Bool", + "SchemaRunnerConfigUnionMember3Display", + "SchemaRunnerConfigUnionMember3Enum", + "SchemaRunnerConfigUnionMember3String", "SchemaRunnerConfigUnionMember4", "SchemaRunnerConfigUnionMember4String", + "SchemaRunnerConfigUnionMember4Bool", + "SchemaRunnerConfigUnionMember4Display", + "SchemaRunnerConfigUnionMember4Enum", + "SchemaRunnerConfigUnionMember4Int", + "SchemaRunnerConfigUnionMember5", + "SchemaRunnerConfigUnionMember5Bool", + "SchemaRunnerConfigUnionMember5Display", + "SchemaRunnerConfigUnionMember5Enum", + "SchemaRunnerConfigUnionMember5Int", + "SchemaRunnerConfigUnionMember5String", "SchemaScm", "SchemaScmOAuth", "SchemaScmPat", @@ -43,6 +95,30 @@ class SchemaEnvironmentClassUnionMember0Bool(BaseModel): default: Optional[bool] = None +class SchemaEnvironmentClassUnionMember0Display(BaseModel): + default: Optional[str] = None + + +class SchemaEnvironmentClassUnionMember0Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaEnvironmentClassUnionMember0Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaEnvironmentClassUnionMember0String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + class SchemaEnvironmentClassUnionMember0(BaseModel): bool: SchemaEnvironmentClassUnionMember0Bool @@ -50,29 +126,69 @@ class SchemaEnvironmentClassUnionMember0(BaseModel): description: Optional[str] = None + display: Optional[SchemaEnvironmentClassUnionMember0Display] = None + + enum: Optional[SchemaEnvironmentClassUnionMember0Enum] = None + + int: Optional[SchemaEnvironmentClassUnionMember0Int] = None + name: Optional[str] = None required: Optional[builtins.bool] = None secret: Optional[builtins.bool] = None + string: Optional[SchemaEnvironmentClassUnionMember0String] = None + class SchemaEnvironmentClassUnionMember1Display(BaseModel): default: Optional[str] = None +class SchemaEnvironmentClassUnionMember1Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaEnvironmentClassUnionMember1Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaEnvironmentClassUnionMember1Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaEnvironmentClassUnionMember1String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + class SchemaEnvironmentClassUnionMember1(BaseModel): display: SchemaEnvironmentClassUnionMember1Display id: Optional[str] = None + bool: Optional[SchemaEnvironmentClassUnionMember1Bool] = None + description: Optional[str] = None + enum: Optional[SchemaEnvironmentClassUnionMember1Enum] = None + + int: Optional[SchemaEnvironmentClassUnionMember1Int] = None + name: Optional[str] = None - required: Optional[bool] = None + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None - secret: Optional[bool] = None + string: Optional[SchemaEnvironmentClassUnionMember1String] = None class SchemaEnvironmentClassUnionMember2Enum(BaseModel): @@ -81,18 +197,48 @@ class SchemaEnvironmentClassUnionMember2Enum(BaseModel): values: Optional[List[str]] = None +class SchemaEnvironmentClassUnionMember2Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaEnvironmentClassUnionMember2Display(BaseModel): + default: Optional[str] = None + + +class SchemaEnvironmentClassUnionMember2Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaEnvironmentClassUnionMember2String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + class SchemaEnvironmentClassUnionMember2(BaseModel): enum: SchemaEnvironmentClassUnionMember2Enum id: Optional[str] = None + bool: Optional[SchemaEnvironmentClassUnionMember2Bool] = None + description: Optional[str] = None + display: Optional[SchemaEnvironmentClassUnionMember2Display] = None + + int: Optional[SchemaEnvironmentClassUnionMember2Int] = None + name: Optional[str] = None - required: Optional[bool] = None + required: Optional[builtins.bool] = None - secret: Optional[bool] = None + secret: Optional[builtins.bool] = None + + string: Optional[SchemaEnvironmentClassUnionMember2String] = None class SchemaEnvironmentClassUnionMember3Int(BaseModel): @@ -103,18 +249,46 @@ class SchemaEnvironmentClassUnionMember3Int(BaseModel): min: Optional[int] = None +class SchemaEnvironmentClassUnionMember3Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaEnvironmentClassUnionMember3Display(BaseModel): + default: Optional[str] = None + + +class SchemaEnvironmentClassUnionMember3Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaEnvironmentClassUnionMember3String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + class SchemaEnvironmentClassUnionMember3(BaseModel): int: SchemaEnvironmentClassUnionMember3Int id: Optional[str] = None + bool: Optional[SchemaEnvironmentClassUnionMember3Bool] = None + description: Optional[str] = None + display: Optional[SchemaEnvironmentClassUnionMember3Display] = None + + enum: Optional[SchemaEnvironmentClassUnionMember3Enum] = None + name: Optional[str] = None - required: Optional[bool] = None + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None - secret: Optional[bool] = None + string: Optional[SchemaEnvironmentClassUnionMember3String] = None class SchemaEnvironmentClassUnionMember4String(BaseModel): @@ -123,18 +297,98 @@ class SchemaEnvironmentClassUnionMember4String(BaseModel): pattern: Optional[str] = None +class SchemaEnvironmentClassUnionMember4Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaEnvironmentClassUnionMember4Display(BaseModel): + default: Optional[str] = None + + +class SchemaEnvironmentClassUnionMember4Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaEnvironmentClassUnionMember4Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + class SchemaEnvironmentClassUnionMember4(BaseModel): string: SchemaEnvironmentClassUnionMember4String id: Optional[str] = None + bool: Optional[SchemaEnvironmentClassUnionMember4Bool] = None + description: Optional[str] = None + display: Optional[SchemaEnvironmentClassUnionMember4Display] = None + + enum: Optional[SchemaEnvironmentClassUnionMember4Enum] = None + + int: Optional[SchemaEnvironmentClassUnionMember4Int] = None + name: Optional[str] = None - required: Optional[bool] = None + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None + + +class SchemaEnvironmentClassUnionMember5Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaEnvironmentClassUnionMember5Display(BaseModel): + default: Optional[str] = None + + +class SchemaEnvironmentClassUnionMember5Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaEnvironmentClassUnionMember5Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaEnvironmentClassUnionMember5String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + +class SchemaEnvironmentClassUnionMember5(BaseModel): + id: Optional[str] = None + + bool: Optional[SchemaEnvironmentClassUnionMember5Bool] = None + + description: Optional[str] = None + + display: Optional[SchemaEnvironmentClassUnionMember5Display] = None + + enum: Optional[SchemaEnvironmentClassUnionMember5Enum] = None + + int: Optional[SchemaEnvironmentClassUnionMember5Int] = None + + name: Optional[str] = None + + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None - secret: Optional[bool] = None + string: Optional[SchemaEnvironmentClassUnionMember5String] = None SchemaEnvironmentClass: TypeAlias = Union[ @@ -143,6 +397,7 @@ class SchemaEnvironmentClassUnionMember4(BaseModel): SchemaEnvironmentClassUnionMember2, SchemaEnvironmentClassUnionMember3, SchemaEnvironmentClassUnionMember4, + SchemaEnvironmentClassUnionMember5, ] @@ -150,6 +405,30 @@ class SchemaRunnerConfigUnionMember0Bool(BaseModel): default: Optional[bool] = None +class SchemaRunnerConfigUnionMember0Display(BaseModel): + default: Optional[str] = None + + +class SchemaRunnerConfigUnionMember0Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaRunnerConfigUnionMember0Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaRunnerConfigUnionMember0String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + class SchemaRunnerConfigUnionMember0(BaseModel): bool: SchemaRunnerConfigUnionMember0Bool @@ -157,29 +436,69 @@ class SchemaRunnerConfigUnionMember0(BaseModel): description: Optional[str] = None + display: Optional[SchemaRunnerConfigUnionMember0Display] = None + + enum: Optional[SchemaRunnerConfigUnionMember0Enum] = None + + int: Optional[SchemaRunnerConfigUnionMember0Int] = None + name: Optional[str] = None required: Optional[builtins.bool] = None secret: Optional[builtins.bool] = None + string: Optional[SchemaRunnerConfigUnionMember0String] = None + class SchemaRunnerConfigUnionMember1Display(BaseModel): default: Optional[str] = None +class SchemaRunnerConfigUnionMember1Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaRunnerConfigUnionMember1Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaRunnerConfigUnionMember1Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaRunnerConfigUnionMember1String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + class SchemaRunnerConfigUnionMember1(BaseModel): display: SchemaRunnerConfigUnionMember1Display id: Optional[str] = None + bool: Optional[SchemaRunnerConfigUnionMember1Bool] = None + description: Optional[str] = None + enum: Optional[SchemaRunnerConfigUnionMember1Enum] = None + + int: Optional[SchemaRunnerConfigUnionMember1Int] = None + name: Optional[str] = None - required: Optional[bool] = None + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None - secret: Optional[bool] = None + string: Optional[SchemaRunnerConfigUnionMember1String] = None class SchemaRunnerConfigUnionMember2Enum(BaseModel): @@ -188,18 +507,48 @@ class SchemaRunnerConfigUnionMember2Enum(BaseModel): values: Optional[List[str]] = None +class SchemaRunnerConfigUnionMember2Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaRunnerConfigUnionMember2Display(BaseModel): + default: Optional[str] = None + + +class SchemaRunnerConfigUnionMember2Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaRunnerConfigUnionMember2String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + class SchemaRunnerConfigUnionMember2(BaseModel): enum: SchemaRunnerConfigUnionMember2Enum id: Optional[str] = None + bool: Optional[SchemaRunnerConfigUnionMember2Bool] = None + description: Optional[str] = None + display: Optional[SchemaRunnerConfigUnionMember2Display] = None + + int: Optional[SchemaRunnerConfigUnionMember2Int] = None + name: Optional[str] = None - required: Optional[bool] = None + required: Optional[builtins.bool] = None - secret: Optional[bool] = None + secret: Optional[builtins.bool] = None + + string: Optional[SchemaRunnerConfigUnionMember2String] = None class SchemaRunnerConfigUnionMember3Int(BaseModel): @@ -210,18 +559,46 @@ class SchemaRunnerConfigUnionMember3Int(BaseModel): min: Optional[int] = None +class SchemaRunnerConfigUnionMember3Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaRunnerConfigUnionMember3Display(BaseModel): + default: Optional[str] = None + + +class SchemaRunnerConfigUnionMember3Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaRunnerConfigUnionMember3String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + class SchemaRunnerConfigUnionMember3(BaseModel): int: SchemaRunnerConfigUnionMember3Int id: Optional[str] = None + bool: Optional[SchemaRunnerConfigUnionMember3Bool] = None + description: Optional[str] = None + display: Optional[SchemaRunnerConfigUnionMember3Display] = None + + enum: Optional[SchemaRunnerConfigUnionMember3Enum] = None + name: Optional[str] = None - required: Optional[bool] = None + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None - secret: Optional[bool] = None + string: Optional[SchemaRunnerConfigUnionMember3String] = None class SchemaRunnerConfigUnionMember4String(BaseModel): @@ -230,18 +607,98 @@ class SchemaRunnerConfigUnionMember4String(BaseModel): pattern: Optional[str] = None +class SchemaRunnerConfigUnionMember4Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaRunnerConfigUnionMember4Display(BaseModel): + default: Optional[str] = None + + +class SchemaRunnerConfigUnionMember4Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaRunnerConfigUnionMember4Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + class SchemaRunnerConfigUnionMember4(BaseModel): string: SchemaRunnerConfigUnionMember4String id: Optional[str] = None + bool: Optional[SchemaRunnerConfigUnionMember4Bool] = None + description: Optional[str] = None + display: Optional[SchemaRunnerConfigUnionMember4Display] = None + + enum: Optional[SchemaRunnerConfigUnionMember4Enum] = None + + int: Optional[SchemaRunnerConfigUnionMember4Int] = None + name: Optional[str] = None - required: Optional[bool] = None + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None + + +class SchemaRunnerConfigUnionMember5Bool(BaseModel): + default: Optional[bool] = None + + +class SchemaRunnerConfigUnionMember5Display(BaseModel): + default: Optional[str] = None + + +class SchemaRunnerConfigUnionMember5Enum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class SchemaRunnerConfigUnionMember5Int(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class SchemaRunnerConfigUnionMember5String(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + +class SchemaRunnerConfigUnionMember5(BaseModel): + id: Optional[str] = None + + bool: Optional[SchemaRunnerConfigUnionMember5Bool] = None + + description: Optional[str] = None + + display: Optional[SchemaRunnerConfigUnionMember5Display] = None + + enum: Optional[SchemaRunnerConfigUnionMember5Enum] = None + + int: Optional[SchemaRunnerConfigUnionMember5Int] = None + + name: Optional[str] = None + + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None - secret: Optional[bool] = None + string: Optional[SchemaRunnerConfigUnionMember5String] = None SchemaRunnerConfig: TypeAlias = Union[ @@ -250,6 +707,7 @@ class SchemaRunnerConfigUnionMember4(BaseModel): SchemaRunnerConfigUnionMember2, SchemaRunnerConfigUnionMember3, SchemaRunnerConfigUnionMember4, + SchemaRunnerConfigUnionMember5, ] diff --git a/src/gitpod/types/runners/configurations/scm_integration_create_params.py b/src/gitpod/types/runners/configurations/scm_integration_create_params.py index fad0a6b8..4640545e 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_create_params.py @@ -2,42 +2,15 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = [ - "ScmIntegrationCreateParams", - "OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet", - "OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored", -] +__all__ = ["ScmIntegrationCreateParams", "Body"] -class OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet( - TypedDict, total=False -): - oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] - """oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_plaintext_client_secret must also be set. - """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( - TypedDict, total=False -): - oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] - """oauth_plaintext_client_secret is the OAuth app's client secret in clear text. - - This will first be encrypted with the runner's public key before being stored. - """ +class ScmIntegrationCreateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -46,7 +19,5 @@ class OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFir """Define the timeout, in ms""" -ScmIntegrationCreateParams: TypeAlias = Union[ - OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet, - OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored, -] +class Body: + pass diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_response.py b/src/gitpod/types/runners/configurations/scm_integration_list_response.py index 7b1fc5e7..0840c28e 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_list_response.py +++ b/src/gitpod/types/runners/configurations/scm_integration_list_response.py @@ -1,15 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional +from typing_extensions import TypeAlias from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["ScmIntegrationListResponse", "Integration", "IntegrationOAuth", "Pagination"] +__all__ = [ + "ScmIntegrationListResponse", + "Integration", + "IntegrationUnionMember0", + "IntegrationUnionMember0OAuth", + "IntegrationUnionMember1", + "IntegrationUnionMember1OAuth", + "Pagination", +] -class IntegrationOAuth(BaseModel): +class IntegrationUnionMember0OAuth(BaseModel): client_id: Optional[str] = FieldInfo(alias="clientId", default=None) """client_id is the OAuth app's client ID in clear text.""" @@ -20,8 +29,8 @@ class IntegrationOAuth(BaseModel): """ -class Integration(BaseModel): - oauth: IntegrationOAuth +class IntegrationUnionMember0(BaseModel): + oauth: IntegrationUnionMember0OAuth id: Optional[str] = None """id is the unique identifier of the SCM integration""" @@ -39,6 +48,39 @@ class Integration(BaseModel): """ +class IntegrationUnionMember1OAuth(BaseModel): + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + """client_id is the OAuth app's client ID in clear text.""" + + encrypted_client_secret: Optional[str] = FieldInfo(alias="encryptedClientSecret", default=None) + """ + encrypted_client_secret is the OAuth app's secret encrypted with the runner's + public key. + """ + + +class IntegrationUnionMember1(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the SCM integration""" + + host: Optional[str] = None + + oauth: Optional[IntegrationUnionMember1OAuth] = None + + pat: Optional[bool] = None + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + """ + scm_id references the scm_id in the runner's configuration schema that this + integration is for + """ + + +Integration: TypeAlias = Union[IntegrationUnionMember0, IntegrationUnionMember1] + + class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) """Token passed for retreiving the next set of results. Empty if there are no diff --git a/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py b/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py index 619b46da..1f4e7e5d 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py @@ -1,15 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Union, Optional +from typing_extensions import TypeAlias from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["ScmIntegrationRetrieveResponse", "Integration", "IntegrationOAuth"] +__all__ = [ + "ScmIntegrationRetrieveResponse", + "Integration", + "IntegrationUnionMember0", + "IntegrationUnionMember0OAuth", + "IntegrationUnionMember1", + "IntegrationUnionMember1OAuth", +] -class IntegrationOAuth(BaseModel): +class IntegrationUnionMember0OAuth(BaseModel): client_id: Optional[str] = FieldInfo(alias="clientId", default=None) """client_id is the OAuth app's client ID in clear text.""" @@ -20,8 +28,56 @@ class IntegrationOAuth(BaseModel): """ -class Integration(BaseModel): - oauth: IntegrationOAuth +class IntegrationUnionMember0(BaseModel): + oauth: IntegrationUnionMember0OAuth + + id: Optional[str] = None + """id is the unique identifier of the SCM integration""" + + host: Optional[str] = None + + pat: Optional[bool] = None + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + """ + scm_id references the scm_id in the runner's configuration schema that this + integration is for + """ + + +class IntegrationUnionMember1OAuth(BaseModel): + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + """client_id is the OAuth app's client ID in clear text.""" + + encrypted_client_secret: Optional[str] = FieldInfo(alias="encryptedClientSecret", default=None) + """ + encrypted_client_secret is the OAuth app's secret encrypted with the runner's + public key. + """ + + +class IntegrationUnionMember1(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the SCM integration""" + + host: Optional[str] = None + + oauth: Optional[IntegrationUnionMember1OAuth] = None + + pat: Optional[bool] = None + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + """ + scm_id references the scm_id in the runner's configuration schema that this + integration is for + """ + + +Integration: TypeAlias = Union[IntegrationUnionMember0, IntegrationUnionMember1] class ScmIntegrationRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/runners/configurations/scm_integration_update_params.py b/src/gitpod/types/runners/configurations/scm_integration_update_params.py index 00c0d0f9..53798b91 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_update_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_update_params.py @@ -2,69 +2,15 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = [ - "ScmIntegrationUpdateParams", - "OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate", - "OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored", - "PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate", -] +__all__ = ["ScmIntegrationUpdateParams", "Body"] -class OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate( - TypedDict, total=False -): - oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] - """oauth_client_id can be set to update the OAuth app's client ID. - - If an empty string is set, the OAuth configuration will be removed (regardless - of whether a client secret is set), and any existing Host Authentication Tokens - for the SCM integration's runner and host that were created using the OAuth app - will be deleted. This might lead to users being unable to access their - repositories until they re-authenticate. - """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( - TypedDict, total=False -): - oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] - """ - oauth_plaintext_client_secret can be set to update the OAuth app's client - secret. - - The cleartext secret will be encrypted with the runner's public key before being - stored. - """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate( - TypedDict, total=False -): - pat: Required[bool] - """pat can be set to enable or disable Personal Access Tokens support. - - When disabling PATs, any existing Host Authentication Tokens for the SCM - integration's runner and host that were created using a PAT will be deleted. - This might lead to users being unable to access their repositories until they - re-authenticate. - """ +class ScmIntegrationUpdateParams(TypedDict, total=False): + body: Required[Body] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -73,8 +19,5 @@ class PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAn """Define the timeout, in ms""" -ScmIntegrationUpdateParams: TypeAlias = Union[ - OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate, - OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored, - PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate, -] +class Body: + pass diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index ea4f7a10..ed910204 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -7,14 +7,10 @@ from .._utils import PropertyInfo -__all__ = [ - "SecretCreateParams", - "SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", - "AbsolutePathToTheFileWhereTheSecretIsMounted", -] +__all__ = ["SecretCreateParams", "Variant0", "Variant1", "Variant2"] -class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(TypedDict, total=False): +class Variant0(TypedDict, total=False): environment_variable: Required[Annotated[bool, PropertyInfo(alias="environmentVariable")]] """ secret will be created as an Environment Variable with the same name as the @@ -24,6 +20,16 @@ class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(Typed connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + file_path: Annotated[str, PropertyInfo(alias="filePath")] + """ + absolute path to the file where the secret is mounted value must be an absolute + path (start with a /): + + ``` + this.matches('^/(?:[^/]*/)*.*$') + ``` + """ + name: str project_id: Annotated[str, PropertyInfo(alias="projectId")] @@ -36,7 +42,7 @@ class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(Typed """Define the timeout, in ms""" -class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): +class Variant1(TypedDict, total=False): file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] """ absolute path to the file where the secret is mounted value must be an absolute @@ -50,6 +56,44 @@ class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" + environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + + name: str + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id is the ProjectID this Secret belongs to""" + + value: str + """value is the plaintext value of the secret""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + + file_path: Annotated[str, PropertyInfo(alias="filePath")] + """ + absolute path to the file where the secret is mounted value must be an absolute + path (start with a /): + + ``` + this.matches('^/(?:[^/]*/)*.*$') + ``` + """ + name: str project_id: Annotated[str, PropertyInfo(alias="projectId")] @@ -62,6 +106,4 @@ class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): """Define the timeout, in ms""" -SecretCreateParams: TypeAlias = Union[ - SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, AbsolutePathToTheFileWhereTheSecretIsMounted -] +SecretCreateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/secret_create_response.py b/src/gitpod/types/secret_create_response.py index 53a103b2..3b95c81c 100644 --- a/src/gitpod/types/secret_create_response.py +++ b/src/gitpod/types/secret_create_response.py @@ -1,7 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Union, Optional -from typing_extensions import TypeAlias +from datetime import datetime +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -10,28 +11,685 @@ __all__ = [ "SecretCreateResponse", "Secret", - "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", - "SecretAbsolutePathToTheFileWhereTheSecretIsMounted", + "SecretUnionMember0", + "SecretUnionMember0Creator", + "SecretUnionMember1", + "SecretUnionMember1Creator", + "SecretUnionMember2", + "SecretUnionMember2Creator", ] -class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): +class SecretUnionMember0Creator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class SecretUnionMember0(BaseModel): environment_variable: bool = FieldInfo(alias="environmentVariable") """ secret will be created as an Environment Variable with the same name as the secret """ + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[SecretUnionMember0Creator] = None + """creator is the identity of the creator of the secret""" + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """absolute path to the file where the secret is mounted""" + + name: Optional[str] = None + """Name of the secret for humans.""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """The Project ID this Secret belongs to""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); -class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class SecretUnionMember1Creator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class SecretUnionMember1(BaseModel): file_path: str = FieldInfo(alias="filePath") """absolute path to the file where the secret is mounted""" + id: Optional[str] = None -Secret: TypeAlias = Union[ - SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, - SecretAbsolutePathToTheFileWhereTheSecretIsMounted, -] + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[SecretUnionMember1Creator] = None + """creator is the identity of the creator of the secret""" + + environment_variable: Optional[bool] = FieldInfo(alias="environmentVariable", default=None) + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + + name: Optional[str] = None + """Name of the secret for humans.""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """The Project ID this Secret belongs to""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class SecretUnionMember2Creator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class SecretUnionMember2(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[SecretUnionMember2Creator] = None + """creator is the identity of the creator of the secret""" + + environment_variable: Optional[bool] = FieldInfo(alias="environmentVariable", default=None) + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """absolute path to the file where the secret is mounted""" + + name: Optional[str] = None + """Name of the secret for humans.""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """The Project ID this Secret belongs to""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +Secret: TypeAlias = Union[SecretUnionMember0, SecretUnionMember1, SecretUnionMember2] class SecretCreateResponse(BaseModel): diff --git a/src/gitpod/types/secret_list_response.py b/src/gitpod/types/secret_list_response.py index 7bbbf133..eb9f46d0 100644 --- a/src/gitpod/types/secret_list_response.py +++ b/src/gitpod/types/secret_list_response.py @@ -12,10 +12,12 @@ "SecretListResponse", "Pagination", "Secret", - "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", - "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator", - "SecretAbsolutePathToTheFileWhereTheSecretIsMounted", - "SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator", + "SecretUnionMember0", + "SecretUnionMember0Creator", + "SecretUnionMember1", + "SecretUnionMember1Creator", + "SecretUnionMember2", + "SecretUnionMember2Creator", ] @@ -27,7 +29,7 @@ class Pagination(BaseModel): """ -class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator(BaseModel): +class SecretUnionMember0Creator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -44,7 +46,7 @@ class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret """Principal is the principal of the subject""" -class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): +class SecretUnionMember0(BaseModel): environment_variable: bool = FieldInfo(alias="environmentVariable") """ secret will be created as an Environment Variable with the same name as the @@ -145,9 +147,12 @@ class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator] = None + creator: Optional[SecretUnionMember0Creator] = None """creator is the identity of the creator of the secret""" + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """absolute path to the file where the secret is mounted""" + name: Optional[str] = None """Name of the secret for humans.""" @@ -247,7 +252,7 @@ class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret """ -class SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator(BaseModel): +class SecretUnionMember1Creator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -264,7 +269,7 @@ class SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator(BaseModel): """Principal is the principal of the subject""" -class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): +class SecretUnionMember1(BaseModel): file_path: str = FieldInfo(alias="filePath") """absolute path to the file where the secret is mounted""" @@ -362,9 +367,15 @@ class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator] = None + creator: Optional[SecretUnionMember1Creator] = None """creator is the identity of the creator of the secret""" + environment_variable: Optional[bool] = FieldInfo(alias="environmentVariable", default=None) + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + name: Optional[str] = None """Name of the secret for humans.""" @@ -464,10 +475,230 @@ class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): """ -Secret: TypeAlias = Union[ - SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, - SecretAbsolutePathToTheFileWhereTheSecretIsMounted, -] +class SecretUnionMember2Creator(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ] = None + """Principal is the principal of the subject""" + + +class SecretUnionMember2(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[SecretUnionMember2Creator] = None + """creator is the identity of the creator of the secret""" + + environment_variable: Optional[bool] = FieldInfo(alias="environmentVariable", default=None) + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """absolute path to the file where the secret is mounted""" + + name: Optional[str] = None + """Name of the secret for humans.""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """The Project ID this Secret belongs to""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +Secret: TypeAlias = Union[SecretUnionMember0, SecretUnionMember1, SecretUnionMember2] class SecretListResponse(BaseModel): diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index d523efc0..a0a50e03 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -43,7 +43,13 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{"manual": True}], + "triggered_by": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ], }, spec={ "commands": { @@ -148,9 +154,9 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={"description": "description"}, - spec={"commands": {"ready": "ready"}}, - status={"failure_message": "failureMessage"}, + metadata={}, + spec={}, + status={}, connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @@ -372,7 +378,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{"manual": True}], + "triggered_by": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ], }, spec={ "commands": { @@ -477,9 +489,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> service = await async_client.environments.automations.services.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={"description": "description"}, - spec={"commands": {"ready": "ready"}}, - status={"failure_message": "failureMessage"}, + metadata={}, + spec={}, + status={}, connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 1ccf9ffa..85c01b8d 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -45,7 +45,13 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{"manual": True}], + "triggered_by": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ], }, spec={ "command": "command", @@ -144,8 +150,8 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - metadata={"description": "description"}, - spec={"command": "command"}, + metadata={}, + spec={}, connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @@ -327,7 +333,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{"manual": True}], + "triggered_by": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ], }, spec={ "command": "command", @@ -426,8 +438,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - metadata={"description": "description"}, - spec={"command": "command"}, + metadata={}, + spec={}, connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index fc905847..e3871d69 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -113,198 +113,34 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: + def test_method_update(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( - client_id="x", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - client_id="x", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update( - client_id="x", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update( - client_id="x", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - client_secret="x", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - client_secret="x", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update( - client_secret="x", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update( - client_secret="x", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - email_domain="xxxx", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - email_domain="xxxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update( - email_domain="xxxx", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update( - email_domain="xxxx", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_4(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - issuer_url="https://example.com", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - issuer_url="https://example.com", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_raw_response_update_overload_4(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update( - issuer_url="https://example.com", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update( - issuer_url="https://example.com", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_5(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + body={}, connect_protocol_version=1, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + body={ + "claims": {"foo": "string"}, + "clientId": "x", + "clientSecret": "x", + "emailDomain": "xxxx", + "issuerUrl": "https://example.com", + "ssoConfigurationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "state": "SSO_CONFIGURATION_STATE_UNSPECIFIED", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - def test_raw_response_update_overload_5(self, client: Gitpod) -> None: + def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + body={}, connect_protocol_version=1, ) @@ -314,9 +150,9 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: + def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -510,198 +346,34 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - client_id="x", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - client_id="x", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update( - client_id="x", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update( - client_id="x", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - client_secret="x", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - client_secret="x", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update( - client_secret="x", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update( - client_secret="x", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - email_domain="xxxx", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - email_domain="xxxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update( - email_domain="xxxx", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update( - email_domain="xxxx", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - issuer_url="https://example.com", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - issuer_url="https://example.com", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update( - issuer_url="https://example.com", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update( - issuer_url="https://example.com", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: + async def test_method_update(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + body={}, connect_protocol_version=1, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - async def test_method_update_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + body={ + "claims": {"foo": "string"}, + "clientId": "x", + "clientSecret": "x", + "emailDomain": "xxxx", + "issuerUrl": "https://example.com", + "ssoConfigurationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "state": "SSO_CONFIGURATION_STATE_UNSPECIFIED", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + body={}, connect_protocol_version=1, ) @@ -711,9 +383,9 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 41ce1135..bf6b49c4 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -117,112 +117,31 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: + def test_method_update(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( - description="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.update( - description="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runners.configurations.environment_classes.with_raw_response.update( - description="xxx", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runners.configurations.environment_classes.with_streaming_response.update( - description="xxx", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_class = response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.update( - display_name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.update( - display_name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.runners.configurations.environment_classes.with_raw_response.update( - display_name="xxx", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.runners.configurations.environment_classes.with_streaming_response.update( - display_name="xxx", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_class = response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.update( - enabled=True, + body={}, connect_protocol_version=1, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( - enabled=True, + body={ + "description": "xxx", + "displayName": "xxx", + "enabled": True, + "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: + def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( - enabled=True, + body={}, connect_protocol_version=1, ) @@ -232,9 +151,9 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: assert_matches_type(object, environment_class, path=["response"]) @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: + def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( - enabled=True, + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -392,112 +311,31 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.update( - description="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.update( - description="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.environment_classes.with_raw_response.update( - description="xxx", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = await response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.environment_classes.with_streaming_response.update( - description="xxx", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_class = await response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.update( - display_name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.update( - display_name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.environment_classes.with_raw_response.update( - display_name="xxx", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = await response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.environment_classes.with_streaming_response.update( - display_name="xxx", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_class = await response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_method_update(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( - enabled=True, + body={}, connect_protocol_version=1, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( - enabled=True, + body={ + "description": "xxx", + "displayName": "xxx", + "enabled": True, + "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( - enabled=True, + body={}, connect_protocol_version=1, ) @@ -507,9 +345,9 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - assert_matches_type(object, environment_class, path=["response"]) @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( - enabled=True, + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 1153fe3e..75187e64 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -116,112 +116,31 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: + def test_method_update(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - refresh_token="refreshToken", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - refresh_token="refreshToken", + body={}, connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( - refresh_token="refreshToken", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - refresh_token="refreshToken", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - token="x", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - token="x", + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "token": "x", + "expiresAt": parse_datetime("2019-12-27T18:11:19.117Z"), + "refreshToken": "refreshToken", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: + def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( - token="x", + body={}, connect_protocol_version=1, ) @@ -231,9 +150,9 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: + def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - token="x", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -429,112 +348,31 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_update(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - refresh_token="refreshToken", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - refresh_token="refreshToken", + body={}, connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( - refresh_token="refreshToken", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - refresh_token="refreshToken", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - token="x", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - token="x", + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "token": "x", + "expiresAt": parse_datetime("2019-12-27T18:11:19.117Z"), + "refreshToken": "refreshToken", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( - token="x", + body={}, connect_protocol_version=1, ) @@ -544,9 +382,9 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - token="x", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index c22ad989..c7ce2954 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -22,26 +22,33 @@ class TestScmIntegrations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_create_overload_1(self, client: Gitpod) -> None: + def test_method_create(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( - oauth_client_id="oauthClientId", + body={}, connect_protocol_version=1, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: + def test_method_create_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( - oauth_client_id="oauthClientId", + body={ + "host": "host", + "oauthClientId": "oauthClientId", + "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", + "pat": True, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmId": "scmId", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - def test_raw_response_create_overload_1(self, client: Gitpod) -> None: + def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( - oauth_client_id="oauthClientId", + body={}, connect_protocol_version=1, ) @@ -51,52 +58,9 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: + def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_create_overload_2(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_raw_response_create_overload_2(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -155,112 +119,31 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: + def test_method_update(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( - pat=True, + body={}, connect_protocol_version=1, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( - pat=True, + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "oauthClientId": "oauthClientId", + "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", + "pat": True, + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: + def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( - pat=True, + body={}, connect_protocol_version=1, ) @@ -270,9 +153,9 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: assert_matches_type(object, scm_integration, path=["response"]) @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: + def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( - pat=True, + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -375,26 +258,33 @@ class TestAsyncScmIntegrations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_create(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( - oauth_client_id="oauthClientId", + body={}, connect_protocol_version=1, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( - oauth_client_id="oauthClientId", + body={ + "host": "host", + "oauthClientId": "oauthClientId", + "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", + "pat": True, + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "scmId": "scmId", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( - oauth_client_id="oauthClientId", + body={}, connect_protocol_version=1, ) @@ -404,52 +294,9 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = await response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = await response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -508,112 +355,31 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = await response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = await response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = await response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = await response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_method_update(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( - pat=True, + body={}, connect_protocol_version=1, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( - pat=True, + body={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "oauthClientId": "oauthClientId", + "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", + "pat": True, + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( - pat=True, + body={}, connect_protocol_version=1, ) @@ -623,9 +389,9 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - assert_matches_type(object, scm_integration, path=["response"]) @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( - pat=True, + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 30cbd663..28a64c32 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -43,6 +43,7 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non }, connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + scm_integration={}, connect_timeout_ms=0, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -76,7 +77,7 @@ def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: @parametrize def test_method_validate_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, + scm_integration={}, connect_protocol_version=1, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -84,8 +85,21 @@ def test_method_validate_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, + scm_integration={}, connect_protocol_version=1, + environment_class={ + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) @@ -94,7 +108,7 @@ def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> Non @parametrize def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, + scm_integration={}, connect_protocol_version=1, ) @@ -106,7 +120,61 @@ def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: @parametrize def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, + scm_integration={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + configuration = response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_validate_overload_3(self, client: Gitpod) -> None: + configuration = client.runners.configurations.validate( + connect_protocol_version=1, + ) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + + @parametrize + def test_method_validate_with_all_params_overload_3(self, client: Gitpod) -> None: + configuration = client.runners.configurations.validate( + connect_protocol_version=1, + environment_class={ + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + scm_integration={}, + connect_timeout_ms=0, + ) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + + @parametrize + def test_raw_response_validate_overload_3(self, client: Gitpod) -> None: + response = client.runners.configurations.with_raw_response.validate( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + configuration = response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + + @parametrize + def test_streaming_response_validate_overload_3(self, client: Gitpod) -> None: + with client.runners.configurations.with_streaming_response.validate( connect_protocol_version=1, ) as response: assert not response.is_closed @@ -147,6 +215,7 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As }, connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + scm_integration={}, connect_timeout_ms=0, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -180,7 +249,7 @@ async def test_streaming_response_validate_overload_1(self, async_client: AsyncG @parametrize async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, + scm_integration={}, connect_protocol_version=1, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -188,8 +257,21 @@ async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> No @parametrize async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, + scm_integration={}, connect_protocol_version=1, + environment_class={ + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) @@ -198,7 +280,7 @@ async def test_method_validate_with_all_params_overload_2(self, async_client: As @parametrize async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, + scm_integration={}, connect_protocol_version=1, ) @@ -210,7 +292,61 @@ async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) @parametrize async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, + scm_integration={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + configuration = await response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_validate_overload_3(self, async_client: AsyncGitpod) -> None: + configuration = await async_client.runners.configurations.validate( + connect_protocol_version=1, + ) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + + @parametrize + async def test_method_validate_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + configuration = await async_client.runners.configurations.validate( + connect_protocol_version=1, + environment_class={ + "id": "id", + "configuration": [ + { + "key": "key", + "value": "value", + } + ], + "description": "xxx", + "display_name": "xxx", + "enabled": True, + "runner_id": "runnerId", + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + scm_integration={}, + connect_timeout_ms=0, + ) + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + + @parametrize + async def test_raw_response_validate_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.with_raw_response.validate( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + configuration = await response.parse() + assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + + @parametrize + async def test_streaming_response_validate_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.with_streaming_response.validate( connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 6c117e93..46a127ed 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -44,7 +44,20 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -66,6 +79,8 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "secrets": [ { "environment_variable": "environmentVariable", + "file_path": "filePath", + "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", @@ -157,69 +172,30 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: + def test_method_update(self, client: Gitpod) -> None: environment = client.environments.update( - metadata={}, + body={}, connect_protocol_version=1, ) assert_matches_type(object, environment, path=["response"]) @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: environment = client.environments.update( - metadata={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.update( - metadata={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = response.parse() - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.update( - metadata={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = response.parse() - assert_matches_type(object, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - environment = client.environments.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - environment = client.environments.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + body={ + "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "metadata": {}, + "spec": {}, + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + body={}, connect_protocol_version=1, ) @@ -229,9 +205,9 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: assert_matches_type(object, environment, path=["response"]) @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -351,7 +327,20 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -373,6 +362,8 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "secrets": [ { "environment_variable": "environmentVariable", + "file_path": "filePath", + "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", @@ -604,7 +595,20 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -626,6 +630,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "secrets": [ { "environment_variable": "environmentVariable", + "file_path": "filePath", + "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", @@ -717,69 +723,30 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_update(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( - metadata={}, + body={}, connect_protocol_version=1, ) assert_matches_type(object, environment, path=["response"]) @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( - metadata={}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.update( - metadata={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = await response.parse() - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.update( - metadata={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = await response.parse() - assert_matches_type(object, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + body={ + "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "metadata": {}, + "spec": {}, + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + body={}, connect_protocol_version=1, ) @@ -789,9 +756,9 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - assert_matches_type(object, environment, path=["response"]) @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -911,7 +878,20 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -933,6 +913,8 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "secrets": [ { "environment_variable": "environmentVariable", + "file_path": "filePath", + "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index f539a4b9..5f8aa01c 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -77,6 +77,7 @@ def test_method_watch_with_all_params_overload_1(self, client: Gitpod) -> None: event = client.events.watch( environment_id="environmentId", connect_protocol_version=1, + organization=True, connect_timeout_ms=0, ) assert_matches_type(EventWatchResponse, event, path=["response"]) @@ -120,6 +121,7 @@ def test_method_watch_with_all_params_overload_2(self, client: Gitpod) -> None: event = client.events.watch( organization=True, connect_protocol_version=1, + environment_id="environmentId", connect_timeout_ms=0, ) assert_matches_type(EventWatchResponse, event, path=["response"]) @@ -150,6 +152,47 @@ def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_watch_overload_3(self, client: Gitpod) -> None: + event = client.events.watch( + connect_protocol_version=1, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + def test_method_watch_with_all_params_overload_3(self, client: Gitpod) -> None: + event = client.events.watch( + connect_protocol_version=1, + environment_id="environmentId", + organization=True, + connect_timeout_ms=0, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + def test_raw_response_watch_overload_3(self, client: Gitpod) -> None: + response = client.events.with_raw_response.watch( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event = response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + def test_streaming_response_watch_overload_3(self, client: Gitpod) -> None: + with client.events.with_streaming_response.watch( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event = response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncEvents: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -214,6 +257,7 @@ async def test_method_watch_with_all_params_overload_1(self, async_client: Async event = await async_client.events.watch( environment_id="environmentId", connect_protocol_version=1, + organization=True, connect_timeout_ms=0, ) assert_matches_type(EventWatchResponse, event, path=["response"]) @@ -257,6 +301,7 @@ async def test_method_watch_with_all_params_overload_2(self, async_client: Async event = await async_client.events.watch( organization=True, connect_protocol_version=1, + environment_id="environmentId", connect_timeout_ms=0, ) assert_matches_type(EventWatchResponse, event, path=["response"]) @@ -286,3 +331,44 @@ async def test_streaming_response_watch_overload_2(self, async_client: AsyncGitp assert_matches_type(EventWatchResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_watch_overload_3(self, async_client: AsyncGitpod) -> None: + event = await async_client.events.watch( + connect_protocol_version=1, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + async def test_method_watch_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + event = await async_client.events.watch( + connect_protocol_version=1, + environment_id="environmentId", + organization=True, + connect_timeout_ms=0, + ) + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + async def test_raw_response_watch_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.events.with_raw_response.watch( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event = await response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + @parametrize + async def test_streaming_response_watch_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.events.with_streaming_response.watch( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event = await response.parse() + assert_matches_type(EventWatchResponse, event, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 9caa1fea..34666639 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -114,26 +114,30 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: + def test_method_update(self, client: Gitpod) -> None: organization = client.organizations.update( - invite_domains={}, + body={}, connect_protocol_version=1, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.update( - invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, + body={ + "inviteDomains": {"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, + "name": "name", + "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( - invite_domains={}, + body={}, connect_protocol_version=1, ) @@ -143,52 +147,9 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( - invite_domains={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = response.parse() - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - organization = client.organizations.update( - name="name", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - organization = client.organizations.update( - name="name", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.update( - name="name", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = response.parse() - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.update( - name="name", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -299,6 +260,7 @@ def test_method_join_with_all_params_overload_1(self, client: Gitpod) -> None: organization = client.organizations.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -342,6 +304,7 @@ def test_method_join_with_all_params_overload_2(self, client: Gitpod) -> None: organization = client.organizations.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_protocol_version=1, + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -372,6 +335,47 @@ def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_join_overload_3(self, client: Gitpod) -> None: + organization = client.organizations.join( + connect_protocol_version=1, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + def test_method_join_with_all_params_overload_3(self, client: Gitpod) -> None: + organization = client.organizations.join( + connect_protocol_version=1, + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_join_overload_3(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.join( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_join_overload_3(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.join( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_leave(self, client: Gitpod) -> None: organization = client.organizations.leave( @@ -595,26 +599,30 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_update(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( - invite_domains={}, + body={}, connect_protocol_version=1, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( - invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, + body={ + "inviteDomains": {"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, + "name": "name", + "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( - invite_domains={}, + body={}, connect_protocol_version=1, ) @@ -624,52 +632,9 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( - invite_domains={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = await response.parse() - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.update( - name="name", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.update( - name="name", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.update( - name="name", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = await response.parse() - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.update( - name="name", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -780,6 +745,7 @@ async def test_method_join_with_all_params_overload_1(self, async_client: AsyncG organization = await async_client.organizations.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_protocol_version=1, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -823,6 +789,7 @@ async def test_method_join_with_all_params_overload_2(self, async_client: AsyncG organization = await async_client.organizations.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_protocol_version=1, + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -853,6 +820,47 @@ async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_join_overload_3(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.join( + connect_protocol_version=1, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + async def test_method_join_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.join( + connect_protocol_version=1, + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_join_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.join( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_join_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.join( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 0ecb83c0..7aaef4d7 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -35,8 +35,24 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + environment_class={ + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + }, + initializer={ + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", @@ -121,198 +137,49 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - project = client.projects.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - project = client.projects.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - project = client.projects.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - project = client.projects.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: - project = client.projects.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - project = client.projects.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_4(self, client: Gitpod) -> None: - project = client.projects.update( - initializer={}, - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: - project = client.projects.update( - initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_raw_response_update_overload_4(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.update( - initializer={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.update( - initializer={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_5(self, client: Gitpod) -> None: + def test_method_update(self, client: Gitpod) -> None: project = client.projects.update( - name="x", + body={}, connect_protocol_version=1, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: project = client.projects.update( - name="x", + body={ + "automationsFilePath": "automationsFilePath", + "devcontainerFilePath": "devcontainerFilePath", + "environmentClass": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + }, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "name": "x", + "projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - def test_raw_response_update_overload_5(self, client: Gitpod) -> None: + def test_raw_response_update(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( - name="x", + body={}, connect_protocol_version=1, ) @@ -322,9 +189,9 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: + def test_streaming_response_update(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( - name="x", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -479,8 +346,24 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + environment_class={ + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + }, + initializer={ + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", @@ -565,198 +448,49 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - initializer={}, - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.update( - initializer={}, - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.update( - initializer={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: + async def test_method_update(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( - name="x", + body={}, connect_protocol_version=1, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - async def test_method_update_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( - name="x", + body={ + "automationsFilePath": "automationsFilePath", + "devcontainerFilePath": "devcontainerFilePath", + "environmentClass": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + }, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "name": "x", + "projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( - name="x", + body={}, connect_protocol_version=1, ) @@ -766,9 +500,9 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( - name="x", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 9bfb347f..1cfbd44b 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -37,6 +37,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: connect_protocol_version=1, kind="RUNNER_KIND_UNSPECIFIED", name="xxx", + provider="RUNNER_PROVIDER_UNSPECIFIED", spec={ "configuration": { "auto_update": True, @@ -121,69 +122,30 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: + def test_method_update(self, client: Gitpod) -> None: runner = client.runners.update( - name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - runner = client.runners.update( - name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.update( - name="xxx", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner = response.parse() - assert_matches_type(object, runner, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.update( - name="xxx", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner = response.parse() - assert_matches_type(object, runner, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - runner = client.runners.update( - spec={"configuration": {"auto_update": True}}, + body={}, connect_protocol_version=1, ) assert_matches_type(object, runner, path=["response"]) @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: runner = client.runners.update( - spec={"configuration": {"auto_update": True}}, + body={ + "name": "xxx", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "spec": {}, + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( - spec={"configuration": {"auto_update": True}}, + body={}, connect_protocol_version=1, ) @@ -193,9 +155,9 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: assert_matches_type(object, runner, path=["response"]) @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( - spec={"configuration": {"auto_update": True}}, + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -433,6 +395,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> connect_protocol_version=1, kind="RUNNER_KIND_UNSPECIFIED", name="xxx", + provider="RUNNER_PROVIDER_UNSPECIFIED", spec={ "configuration": { "auto_update": True, @@ -517,69 +480,30 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_update(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( - name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update( - name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.update( - name="xxx", - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner = await response.parse() - assert_matches_type(object, runner, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.update( - name="xxx", - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner = await response.parse() - assert_matches_type(object, runner, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update( - spec={"configuration": {"auto_update": True}}, + body={}, connect_protocol_version=1, ) assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( - spec={"configuration": {"auto_update": True}}, + body={ + "name": "xxx", + "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "spec": {}, + }, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( - spec={"configuration": {"auto_update": True}}, + body={}, connect_protocol_version=1, ) @@ -589,9 +513,9 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( - spec={"configuration": {"auto_update": True}}, + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index a1936fad..443c6f72 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -34,6 +34,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( environment_variable=True, connect_protocol_version=1, + file_path="filePath", name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", @@ -80,6 +81,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( file_path="filePath", connect_protocol_version=1, + environment_variable=True, name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", @@ -113,6 +115,50 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_create_overload_3(self, client: Gitpod) -> None: + secret = client.secrets.create( + connect_protocol_version=1, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_3(self, client: Gitpod) -> None: + secret = client.secrets.create( + connect_protocol_version=1, + environment_variable=True, + file_path="filePath", + name="name", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + value="x", + connect_timeout_ms=0, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + def test_raw_response_create_overload_3(self, client: Gitpod) -> None: + response = client.secrets.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_3(self, client: Gitpod) -> None: + with client.secrets.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_list(self, client: Gitpod) -> None: secret = client.secrets.list( @@ -305,6 +351,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn secret = await async_client.secrets.create( environment_variable=True, connect_protocol_version=1, + file_path="filePath", name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", @@ -351,6 +398,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn secret = await async_client.secrets.create( file_path="filePath", connect_protocol_version=1, + environment_variable=True, name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", @@ -384,6 +432,50 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_create_overload_3(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.create( + connect_protocol_version=1, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.create( + connect_protocol_version=1, + environment_variable=True, + file_path="filePath", + name="name", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + value="x", + connect_timeout_ms=0, + ) + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.secrets.with_raw_response.create( + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.secrets.with_streaming_response.create( + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(SecretCreateResponse, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list( From 5920dae0a4ad4cb676dff54b9b69467900901156 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 08:01:31 +0000 Subject: [PATCH 059/505] feat(api): update via SDK Studio --- .stats.yml | 2 +- .../resources/environments/environments.py | 123 +++- src/gitpod/resources/events.py | 126 +--- .../resources/organizations/organizations.py | 232 +++--- .../organizations/sso_configurations.py | 365 +++++++++- src/gitpod/resources/projects/projects.py | 371 +++++++++- .../runners/configurations/configurations.py | 96 +-- .../configurations/environment_classes.py | 199 +++++- .../host_authentication_tokens.py | 377 +++++++++- .../configurations/scm_integrations.py | 381 +++++++++- src/gitpod/resources/runners/runners.py | 127 +++- src/gitpod/resources/secrets.py | 144 +--- src/gitpod/types/account_retrieve_response.py | 504 +------------ .../environment_create_from_project_params.py | 156 +--- ...nvironment_create_from_project_response.py | 155 +--- src/gitpod/types/environment_create_params.py | 156 +--- .../types/environment_create_response.py | 155 +--- src/gitpod/types/environment_list_response.py | 155 +--- .../types/environment_retrieve_response.py | 155 +--- src/gitpod/types/environment_update_params.py | 290 +++++++- .../environments/automation_upsert_params.py | 26 +- .../automations/service_create_params.py | 48 +- .../automations/service_create_response.py | 50 +- .../automations/service_list_response.py | 50 +- .../automations/service_retrieve_response.py | 50 +- .../automations/service_update_params.py | 133 +++- .../automations/task_create_params.py | 48 +- .../automations/task_create_response.py | 50 +- .../automations/task_list_response.py | 50 +- .../automations/task_retrieve_response.py | 50 +- .../automations/task_start_response.py | 100 +-- .../automations/task_update_params.py | 81 ++- .../tasks/execution_list_response.py | 100 +-- .../tasks/execution_retrieve_response.py | 100 +-- src/gitpod/types/event_watch_params.py | 57 +- src/gitpod/types/organization_join_params.py | 35 +- .../types/organization_update_params.py | 38 +- .../sso_configuration_update_params.py | 73 +- ...roject_create_from_environment_response.py | 139 +--- src/gitpod/types/project_create_params.py | 141 +--- src/gitpod/types/project_create_response.py | 139 +--- src/gitpod/types/project_list_response.py | 139 +--- src/gitpod/types/project_retrieve_response.py | 139 +--- src/gitpod/types/project_update_params.py | 167 ++++- src/gitpod/types/project_update_response.py | 139 +--- src/gitpod/types/runner_update_params.py | 87 ++- .../runners/configuration_validate_params.py | 127 ++-- .../configuration_validate_response.py | 70 +- .../environment_class_update_params.py | 32 +- ...host_authentication_token_update_params.py | 123 +++- .../schema_retrieve_response.py | 490 +------------ .../scm_integration_create_params.py | 41 +- .../scm_integration_list_response.py | 52 +- .../scm_integration_retrieve_response.py | 66 +- .../scm_integration_update_params.py | 69 +- src/gitpod/types/secret_create_params.py | 62 +- src/gitpod/types/secret_create_response.py | 676 +----------------- src/gitpod/types/secret_list_response.py | 259 +------ .../environments/automations/test_services.py | 28 +- .../environments/automations/test_tasks.py | 24 +- .../organizations/test_sso_configurations.py | 392 +++++++++- .../test_environment_classes.py | 214 +++++- .../test_host_authentication_tokens.py | 214 +++++- .../configurations/test_scm_integrations.py | 346 +++++++-- .../runners/test_configurations.py | 152 +--- tests/api_resources/test_environments.py | 194 ++--- tests/api_resources/test_events.py | 86 --- tests/api_resources/test_organizations.py | 212 +++--- tests/api_resources/test_projects.py | 462 +++++++++--- tests/api_resources/test_runners.py | 126 +++- tests/api_resources/test_secrets.py | 92 --- 71 files changed, 5316 insertions(+), 5791 deletions(-) diff --git a/.stats.yml b/.stats.yml index dc330120..fdef86a8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-69a0fc74a7438a8961de8a3254bdb714a3062e4c77b5e2e1fb037baafeeac9ce.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2e9f8b8666b2fd4e346a3acbf81a2c82a6f3793e01bc146499708efaf0c250c5.yml diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 49609540..edba88c0 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx @@ -29,6 +29,7 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -213,10 +214,11 @@ def retrieve( cast_to=EnvironmentRetrieveResponse, ) + @overload def update( self, *, - body: environment_update_params.Body, + metadata: object, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -242,6 +244,55 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + *, + spec: environment_update_params.Variant1Spec, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironment updates the environment partially. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["metadata", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + def update( + self, + *, + metadata: object | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -253,7 +304,13 @@ def update( } return self._post( "/gitpod.v1.EnvironmentService/UpdateEnvironment", - body=maybe_transform(body, environment_update_params.EnvironmentUpdateParams), + body=maybe_transform( + { + "metadata": metadata, + "spec": spec, + }, + environment_update_params.EnvironmentUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -828,10 +885,11 @@ async def retrieve( cast_to=EnvironmentRetrieveResponse, ) + @overload async def update( self, *, - body: environment_update_params.Body, + metadata: object, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -857,6 +915,55 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + *, + spec: environment_update_params.Variant1Spec, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironment updates the environment partially. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["metadata", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + async def update( + self, + *, + metadata: object | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -868,7 +975,13 @@ async def update( } return await self._post( "/gitpod.v1.EnvironmentService/UpdateEnvironment", - body=await async_maybe_transform(body, environment_update_params.EnvironmentUpdateParams), + body=await async_maybe_transform( + { + "metadata": metadata, + "spec": spec, + }, + environment_update_params.EnvironmentUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index b7ecd014..4dc3ff5a 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -129,7 +129,6 @@ def watch( *, environment_id: str, connect_protocol_version: Literal[1], - organization: bool | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -149,11 +148,6 @@ def watch( connect_protocol_version: Define the version of the Connect protocol - organization: Organization scope produces events for all projects, runners and environments - - the caller can see within their organization. No task, task execution or service - events are produed. - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -172,7 +166,6 @@ def watch( *, organization: bool, connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -192,11 +185,6 @@ def watch( connect_protocol_version: Define the version of the Connect protocol - environment_id: Environment scope produces events for the environment itself, all tasks, task - executions, - - and services associated with that environment. - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -209,61 +197,14 @@ def watch( """ ... - @overload - def watch( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - organization: bool | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventWatchResponse: - """ - WatchEvents streams all requests events to the client - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: Environment scope produces events for the environment itself, all tasks, task - executions, - - and services associated with that environment. - - organization: Organization scope produces events for all projects, runners and environments - - the caller can see within their organization. No task, task execution or service - events are produed. - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["environment_id", "connect_protocol_version"], - ["organization", "connect_protocol_version"], - ["connect_protocol_version"], - ) + @required_args(["environment_id", "connect_protocol_version"], ["organization", "connect_protocol_version"]) def watch( self, *, environment_id: str | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], - organization: bool | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + organization: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -396,7 +337,6 @@ async def watch( *, environment_id: str, connect_protocol_version: Literal[1], - organization: bool | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -416,11 +356,6 @@ async def watch( connect_protocol_version: Define the version of the Connect protocol - organization: Organization scope produces events for all projects, runners and environments - - the caller can see within their organization. No task, task execution or service - events are produed. - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -439,7 +374,6 @@ async def watch( *, organization: bool, connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -459,11 +393,6 @@ async def watch( connect_protocol_version: Define the version of the Connect protocol - environment_id: Environment scope produces events for the environment itself, all tasks, task - executions, - - and services associated with that environment. - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -476,61 +405,14 @@ async def watch( """ ... - @overload - async def watch( - self, - *, - connect_protocol_version: Literal[1], - environment_id: str | NotGiven = NOT_GIVEN, - organization: bool | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventWatchResponse: - """ - WatchEvents streams all requests events to the client - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_id: Environment scope produces events for the environment itself, all tasks, task - executions, - - and services associated with that environment. - - organization: Organization scope produces events for all projects, runners and environments - - the caller can see within their organization. No task, task execution or service - events are produed. - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["environment_id", "connect_protocol_version"], - ["organization", "connect_protocol_version"], - ["connect_protocol_version"], - ) + @required_args(["environment_id", "connect_protocol_version"], ["organization", "connect_protocol_version"]) async def watch( self, *, environment_id: str | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], - organization: bool | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + organization: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 70483783..04dddd1a 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -224,10 +224,45 @@ def retrieve( cast_to=OrganizationRetrieveResponse, ) + @overload + def update( + self, + *, + invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationUpdateResponse: + """ + UpdateOrganization updates the properties of an Organization. + + Args: + invite_domains: invite_domains is the domain allowlist of the organization + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload def update( self, *, - body: organization_update_params.Body, + name: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -241,6 +276,8 @@ def update( UpdateOrganization updates the properties of an Organization. Args: + name: name is the new name of the organization + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -253,6 +290,24 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["invite_domains", "connect_protocol_version"], ["name", "connect_protocol_version"]) + def update( + self, + *, + invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains + | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationUpdateResponse: extra_headers = { **strip_not_given( { @@ -264,7 +319,13 @@ def update( } return self._post( "/gitpod.v1.OrganizationService/UpdateOrganization", - body=maybe_transform(body, organization_update_params.OrganizationUpdateParams), + body=maybe_transform( + { + "invite_domains": invite_domains, + "name": name, + }, + organization_update_params.OrganizationUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -400,7 +461,6 @@ def join( *, invite_id: str, connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -417,8 +477,6 @@ def join( connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the unique identifier of the Organization to join. - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -437,7 +495,6 @@ def join( *, organization_id: str, connect_protocol_version: Literal[1], - invite_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -454,45 +511,6 @@ def join( connect_protocol_version: Define the version of the Connect protocol - invite_id: invite_id is the unique identifier of the invite to join the organization. - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def join( - self, - *, - connect_protocol_version: Literal[1], - invite_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationJoinResponse: - """ - JoinOrganization lets accounts join an Organization. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - invite_id: invite_id is the unique identifier of the invite to join the organization. - - organization_id: organization_id is the unique identifier of the Organization to join. - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -505,18 +523,14 @@ def join( """ ... - @required_args( - ["invite_id", "connect_protocol_version"], - ["organization_id", "connect_protocol_version"], - ["connect_protocol_version"], - ) + @required_args(["invite_id", "connect_protocol_version"], ["organization_id", "connect_protocol_version"]) def join( self, *, invite_id: str | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -889,10 +903,45 @@ async def retrieve( cast_to=OrganizationRetrieveResponse, ) + @overload + async def update( + self, + *, + invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationUpdateResponse: + """ + UpdateOrganization updates the properties of an Organization. + + Args: + invite_domains: invite_domains is the domain allowlist of the organization + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload async def update( self, *, - body: organization_update_params.Body, + name: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -906,6 +955,8 @@ async def update( UpdateOrganization updates the properties of an Organization. Args: + name: name is the new name of the organization + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -918,6 +969,24 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["invite_domains", "connect_protocol_version"], ["name", "connect_protocol_version"]) + async def update( + self, + *, + invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains + | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OrganizationUpdateResponse: extra_headers = { **strip_not_given( { @@ -929,7 +998,13 @@ async def update( } return await self._post( "/gitpod.v1.OrganizationService/UpdateOrganization", - body=await async_maybe_transform(body, organization_update_params.OrganizationUpdateParams), + body=await async_maybe_transform( + { + "invite_domains": invite_domains, + "name": name, + }, + organization_update_params.OrganizationUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1065,7 +1140,6 @@ async def join( *, invite_id: str, connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1082,8 +1156,6 @@ async def join( connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the unique identifier of the Organization to join. - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -1102,7 +1174,6 @@ async def join( *, organization_id: str, connect_protocol_version: Literal[1], - invite_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1119,45 +1190,6 @@ async def join( connect_protocol_version: Define the version of the Connect protocol - invite_id: invite_id is the unique identifier of the invite to join the organization. - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def join( - self, - *, - connect_protocol_version: Literal[1], - invite_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationJoinResponse: - """ - JoinOrganization lets accounts join an Organization. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - invite_id: invite_id is the unique identifier of the invite to join the organization. - - organization_id: organization_id is the unique identifier of the Organization to join. - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -1170,18 +1202,14 @@ async def join( """ ... - @required_args( - ["invite_id", "connect_protocol_version"], - ["organization_id", "connect_protocol_version"], - ["connect_protocol_version"], - ) + @required_args(["invite_id", "connect_protocol_version"], ["organization_id", "connect_protocol_version"]) async def join( self, *, invite_id: str | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], - organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 4dc3e3c8..986668af 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -196,10 +197,11 @@ def retrieve( cast_to=SSOConfigurationRetrieveResponse, ) + @overload def update( self, *, - body: sso_configuration_update_params.Body, + client_id: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -213,6 +215,8 @@ def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: + client_id: client_id is the client ID of the SSO provider + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -225,6 +229,171 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + *, + client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + client_secret: client_secret is the client secret of the SSO provider + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + email_domain: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + issuer_url: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + issuer_url: issuer_url is the URL of the IdP issuer + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + state: Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ], + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + state: state is the state of the SSO configuration + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["client_id", "connect_protocol_version"], + ["client_secret", "connect_protocol_version"], + ["email_domain", "connect_protocol_version"], + ["issuer_url", "connect_protocol_version"], + ["state", "connect_protocol_version"], + ) + def update( + self, + *, + client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + client_secret: str | NotGiven = NOT_GIVEN, + email_domain: str | NotGiven = NOT_GIVEN, + issuer_url: str | NotGiven = NOT_GIVEN, + state: Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ] + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -236,7 +405,16 @@ def update( } return self._post( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", - body=maybe_transform(body, sso_configuration_update_params.SSOConfigurationUpdateParams), + body=maybe_transform( + { + "client_id": client_id, + "client_secret": client_secret, + "email_domain": email_domain, + "issuer_url": issuer_url, + "state": state, + }, + sso_configuration_update_params.SSOConfigurationUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -526,10 +704,11 @@ async def retrieve( cast_to=SSOConfigurationRetrieveResponse, ) + @overload async def update( self, *, - body: sso_configuration_update_params.Body, + client_id: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -543,6 +722,8 @@ async def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: + client_id: client_id is the client ID of the SSO provider + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -555,6 +736,171 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + *, + client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + client_secret: client_secret is the client secret of the SSO provider + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + email_domain: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + issuer_url: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + issuer_url: issuer_url is the URL of the IdP issuer + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + state: Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ], + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSSOConfiguration updates the SSO configuration for the organization. + + Args: + state: state is the state of the SSO configuration + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["client_id", "connect_protocol_version"], + ["client_secret", "connect_protocol_version"], + ["email_domain", "connect_protocol_version"], + ["issuer_url", "connect_protocol_version"], + ["state", "connect_protocol_version"], + ) + async def update( + self, + *, + client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + client_secret: str | NotGiven = NOT_GIVEN, + email_domain: str | NotGiven = NOT_GIVEN, + issuer_url: str | NotGiven = NOT_GIVEN, + state: Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ] + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -566,7 +912,16 @@ async def update( } return await self._post( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", - body=await async_maybe_transform(body, sso_configuration_update_params.SSOConfigurationUpdateParams), + body=await async_maybe_transform( + { + "client_id": client_id, + "client_secret": client_secret, + "email_domain": email_domain, + "issuer_url": issuer_url, + "state": state, + }, + sso_configuration_update_params.SSOConfigurationUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 4a9da9b3..b9a75132 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx @@ -17,6 +17,7 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -219,10 +220,155 @@ def retrieve( cast_to=ProjectRetrieveResponse, ) + @overload def update( self, *, - body: project_update_params.Body, + automations_file_path: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + automations_file_path: automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + devcontainer_file_path: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + environment_class: project_update_params.Variant2EnvironmentClass, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + initializer: project_update_params.InitializerIsTheContentInitializerInitializer, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + initializer: EnvironmentInitializer specifies how an environment is to be initialized + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + name: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -248,6 +394,32 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["automations_file_path", "connect_protocol_version"], + ["devcontainer_file_path", "connect_protocol_version"], + ["environment_class", "connect_protocol_version"], + ["initializer", "connect_protocol_version"], + ["name", "connect_protocol_version"], + ) + def update( + self, + *, + automations_file_path: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + devcontainer_file_path: str | NotGiven = NOT_GIVEN, + environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, + initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: extra_headers = { **strip_not_given( { @@ -259,7 +431,16 @@ def update( } return self._post( "/gitpod.v1.ProjectService/UpdateProject", - body=maybe_transform(body, project_update_params.ProjectUpdateParams), + body=maybe_transform( + { + "automations_file_path": automations_file_path, + "devcontainer_file_path": devcontainer_file_path, + "environment_class": environment_class, + "initializer": initializer, + "name": name, + }, + project_update_params.ProjectUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -616,10 +797,155 @@ async def retrieve( cast_to=ProjectRetrieveResponse, ) + @overload async def update( self, *, - body: project_update_params.Body, + automations_file_path: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + automations_file_path: automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + devcontainer_file_path: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches("^$|^[^/].*") + ``` + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + environment_class: project_update_params.Variant2EnvironmentClass, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + initializer: project_update_params.InitializerIsTheContentInitializerInitializer, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: + """ + UpdateProject updates the properties of a Project. + + Args: + initializer: EnvironmentInitializer specifies how an environment is to be initialized + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + name: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -645,6 +971,32 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["automations_file_path", "connect_protocol_version"], + ["devcontainer_file_path", "connect_protocol_version"], + ["environment_class", "connect_protocol_version"], + ["initializer", "connect_protocol_version"], + ["name", "connect_protocol_version"], + ) + async def update( + self, + *, + automations_file_path: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + devcontainer_file_path: str | NotGiven = NOT_GIVEN, + environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, + initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectUpdateResponse: extra_headers = { **strip_not_given( { @@ -656,7 +1008,16 @@ async def update( } return await self._post( "/gitpod.v1.ProjectService/UpdateProject", - body=await async_maybe_transform(body, project_update_params.ProjectUpdateParams), + body=await async_maybe_transform( + { + "automations_file_path": automations_file_path, + "devcontainer_file_path": devcontainer_file_path, + "environment_class": environment_class, + "initializer": initializer, + "name": name, + }, + project_update_params.ProjectUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index ce13d00b..0e6273c8 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -105,7 +105,6 @@ def validate( environment_class: configuration_validate_params.Variant0EnvironmentClass, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant0ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -142,7 +141,6 @@ def validate( *, scm_integration: configuration_validate_params.Variant1ScmIntegration, connect_protocol_version: Literal[1], - environment_class: configuration_validate_params.Variant1EnvironmentClass | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -174,57 +172,15 @@ def validate( """ ... - @overload - def validate( - self, - *, - connect_protocol_version: Literal[1], - environment_class: configuration_validate_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant2ScmIntegration | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. - - environment - class, SCM integration) - - with the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args( - ["environment_class", "connect_protocol_version"], - ["scm_integration", "connect_protocol_version"], - ["connect_protocol_version"], - ) + @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) def validate( self, *, environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant0ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -306,7 +262,6 @@ async def validate( environment_class: configuration_validate_params.Variant0EnvironmentClass, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant0ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -343,46 +298,7 @@ async def validate( *, scm_integration: configuration_validate_params.Variant1ScmIntegration, connect_protocol_version: Literal[1], - environment_class: configuration_validate_params.Variant1EnvironmentClass | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. - - environment - class, SCM integration) - - with the runner. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def validate( - self, - *, - connect_protocol_version: Literal[1], - environment_class: configuration_validate_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant2ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -413,19 +329,15 @@ async def validate( """ ... - @required_args( - ["environment_class", "connect_protocol_version"], - ["scm_integration", "connect_protocol_version"], - ["connect_protocol_version"], - ) + @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) async def validate( self, *, environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant0ScmIntegration | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index 84410459..e7a3e500 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -3,13 +3,14 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -186,10 +187,11 @@ def retrieve( cast_to=EnvironmentClassRetrieveResponse, ) + @overload def update( self, *, - body: environment_class_update_params.Body, + description: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -215,6 +217,92 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + *, + display_name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + enabled: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["description", "connect_protocol_version"], + ["display_name", "connect_protocol_version"], + ["enabled", "connect_protocol_version"], + ) + def update( + self, + *, + description: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + display_name: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -226,7 +314,14 @@ def update( } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", - body=maybe_transform(body, environment_class_update_params.EnvironmentClassUpdateParams), + body=maybe_transform( + { + "description": description, + "display_name": display_name, + "enabled": enabled, + }, + environment_class_update_params.EnvironmentClassUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -458,10 +553,11 @@ async def retrieve( cast_to=EnvironmentClassRetrieveResponse, ) + @overload async def update( self, *, - body: environment_class_update_params.Body, + description: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -487,6 +583,92 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + *, + display_name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + enabled: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateEnvironmentClass updates an existing environment class on a runner. + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["description", "connect_protocol_version"], + ["display_name", "connect_protocol_version"], + ["enabled", "connect_protocol_version"], + ) + async def update( + self, + *, + description: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + display_name: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -498,7 +680,14 @@ async def update( } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", - body=await async_maybe_transform(body, environment_class_update_params.EnvironmentClassUpdateParams), + body=await async_maybe_transform( + { + "description": description, + "display_name": display_name, + "enabled": enabled, + }, + environment_class_update_params.EnvironmentClassUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index bdb27371..13ed925f 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -4,13 +4,14 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -293,10 +294,11 @@ def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) + @overload def update( self, *, - body: host_authentication_token_update_params.Body, + expires_at: Union[str, datetime], connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -310,6 +312,96 @@ def update( UpdateHostAuthenticationToken Args: + expires_at: A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -322,6 +414,92 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + *, + refresh_token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["expires_at", "connect_protocol_version"], + ["refresh_token", "connect_protocol_version"], + ["token", "connect_protocol_version"], + ) + def update( + self, + *, + expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + refresh_token: str | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -333,7 +511,14 @@ def update( } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", - body=maybe_transform(body, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams), + body=maybe_transform( + { + "expires_at": expires_at, + "refresh_token": refresh_token, + "token": token, + }, + host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -713,10 +898,133 @@ async def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) + @overload + async def update( + self, + *, + expires_at: Union[str, datetime], + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + expires_at: A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload async def update( self, *, - body: host_authentication_token_update_params.Body, + refresh_token: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -742,6 +1050,60 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + *, + token: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateHostAuthenticationToken + + Args: + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["expires_at", "connect_protocol_version"], + ["refresh_token", "connect_protocol_version"], + ["token", "connect_protocol_version"], + ) + async def update( + self, + *, + expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + refresh_token: str | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -754,7 +1116,12 @@ async def update( return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=await async_maybe_transform( - body, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams + { + "expires_at": expires_at, + "refresh_token": refresh_token, + "token": token, + }, + host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index aa1d1f08..8c002740 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -56,10 +57,11 @@ def with_streaming_response(self) -> ScmIntegrationsResourceWithStreamingRespons """ return ScmIntegrationsResourceWithStreamingResponse(self) + @overload def create( self, *, - body: scm_integration_create_params.Body, + oauth_client_id: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -73,6 +75,46 @@ def create( CreateSCMIntegration creates a new SCM integration on a runner. Args: + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_plaintext_client_secret must also be set. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. + + This will first be encrypted with the runner's public key before being stored. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -85,6 +127,25 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] + ) + def create( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: extra_headers = { **strip_not_given( { @@ -96,7 +157,13 @@ def create( } return self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", - body=maybe_transform(body, scm_integration_create_params.ScmIntegrationCreateParams), + body=maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + }, + scm_integration_create_params.ScmIntegrationCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -175,10 +242,11 @@ def retrieve( cast_to=ScmIntegrationRetrieveResponse, ) + @overload def update( self, *, - body: scm_integration_update_params.Body, + oauth_client_id: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -192,6 +260,14 @@ def update( UpdateSCMIntegration updates an existing SCM integration on a runner. Args: + oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. + + If an empty string is set, the OAuth configuration will be removed (regardless + of whether a client secret is set), and any existing Host Authentication Tokens + for the SCM integration's runner and host that were created using the OAuth app + will be deleted. This might lead to users being unable to access their + repositories until they re-authenticate. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -204,6 +280,105 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client + secret. + + The cleartext secret will be encrypted with the runner's public key before being + stored. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + pat: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + pat: pat can be set to enable or disable Personal Access Tokens support. + + When disabling PATs, any existing Host Authentication Tokens for the SCM + integration's runner and host that were created using a PAT will be deleted. + This might lead to users being unable to access their repositories until they + re-authenticate. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], + ["oauth_plaintext_client_secret", "connect_protocol_version"], + ["pat", "connect_protocol_version"], + ) + def update( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + pat: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -215,7 +390,14 @@ def update( } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", - body=maybe_transform(body, scm_integration_update_params.ScmIntegrationUpdateParams), + body=maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + "pat": pat, + }, + scm_integration_update_params.ScmIntegrationUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -362,10 +544,11 @@ def with_streaming_response(self) -> AsyncScmIntegrationsResourceWithStreamingRe """ return AsyncScmIntegrationsResourceWithStreamingResponse(self) + @overload async def create( self, *, - body: scm_integration_create_params.Body, + oauth_client_id: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -379,6 +562,46 @@ async def create( CreateSCMIntegration creates a new SCM integration on a runner. Args: + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_plaintext_client_secret must also be set. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: + """ + CreateSCMIntegration creates a new SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. + + This will first be encrypted with the runner's public key before being stored. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -391,6 +614,25 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] + ) + async def create( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScmIntegrationCreateResponse: extra_headers = { **strip_not_given( { @@ -402,7 +644,13 @@ async def create( } return await self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", - body=await async_maybe_transform(body, scm_integration_create_params.ScmIntegrationCreateParams), + body=await async_maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + }, + scm_integration_create_params.ScmIntegrationCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -481,10 +729,11 @@ async def retrieve( cast_to=ScmIntegrationRetrieveResponse, ) + @overload async def update( self, *, - body: scm_integration_update_params.Body, + oauth_client_id: str, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -498,6 +747,14 @@ async def update( UpdateSCMIntegration updates an existing SCM integration on a runner. Args: + oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. + + If an empty string is set, the OAuth configuration will be removed (regardless + of whether a client secret is set), and any existing Host Authentication Tokens + for the SCM integration's runner and host that were created using the OAuth app + will be deleted. This might lead to users being unable to access their + repositories until they re-authenticate. + connect_protocol_version: Define the version of the Connect protocol connect_timeout_ms: Define the timeout, in ms @@ -510,6 +767,105 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + *, + oauth_plaintext_client_secret: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client + secret. + + The cleartext secret will be encrypted with the runner's public key before being + stored. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + pat: bool, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateSCMIntegration updates an existing SCM integration on a runner. + + Args: + pat: pat can be set to enable or disable Personal Access Tokens support. + + When disabling PATs, any existing Host Authentication Tokens for the SCM + integration's runner and host that were created using a PAT will be deleted. + This might lead to users being unable to access their repositories until they + re-authenticate. + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["oauth_client_id", "connect_protocol_version"], + ["oauth_plaintext_client_secret", "connect_protocol_version"], + ["pat", "connect_protocol_version"], + ) + async def update( + self, + *, + oauth_client_id: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, + pat: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -521,7 +877,14 @@ async def update( } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", - body=await async_maybe_transform(body, scm_integration_update_params.ScmIntegrationUpdateParams), + body=await async_maybe_transform( + { + "oauth_client_id": oauth_client_id, + "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + "pat": pat, + }, + scm_integration_update_params.ScmIntegrationUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 9f099a50..d8d7edf5 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal +from typing_extensions import Literal, overload import httpx @@ -19,6 +19,7 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( is_given, + required_args, maybe_transform, strip_not_given, async_maybe_transform, @@ -237,10 +238,45 @@ def retrieve( cast_to=RunnerRetrieveResponse, ) + @overload def update( self, *, - body: runner_update_params.Body, + name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunner updates an environment runner. + + Args: + name: The runner's name which is shown to users + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + *, + spec: runner_update_params.Variant1Spec, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -266,6 +302,23 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + def update( + self, + *, + name: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -277,7 +330,13 @@ def update( } return self._post( "/gitpod.v1.RunnerService/UpdateRunner", - body=maybe_transform(body, runner_update_params.RunnerUpdateParams), + body=maybe_transform( + { + "name": name, + "spec": spec, + }, + runner_update_params.RunnerUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -770,10 +829,45 @@ async def retrieve( cast_to=RunnerRetrieveResponse, ) + @overload async def update( self, *, - body: runner_update_params.Body, + name: str, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + UpdateRunner updates an environment runner. + + Args: + name: The runner's name which is shown to users + + connect_protocol_version: Define the version of the Connect protocol + + connect_timeout_ms: Define the timeout, in ms + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def update( + self, + *, + spec: runner_update_params.Variant1Spec, connect_protocol_version: Literal[1], connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -799,6 +893,23 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + async def update( + self, + *, + name: str | NotGiven = NOT_GIVEN, + connect_protocol_version: Literal[1], + connect_timeout_ms: float | NotGiven = NOT_GIVEN, + spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: extra_headers = { **strip_not_given( { @@ -810,7 +921,13 @@ async def update( } return await self._post( "/gitpod.v1.RunnerService/UpdateRunner", - body=await async_maybe_transform(body, runner_update_params.RunnerUpdateParams), + body=await async_maybe_transform( + { + "name": name, + "spec": spec, + }, + runner_update_params.RunnerUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 03b2b304..8e50019b 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -63,7 +63,6 @@ def create( *, environment_variable: bool, connect_protocol_version: Literal[1], - file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -84,13 +83,6 @@ def create( connect_protocol_version: Define the version of the Connect protocol - file_path: absolute path to the file where the secret is mounted value must be an absolute - path (start with a /): - - ``` - this.matches("^/(?:[^/]*/)*.*$") - ``` - project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret @@ -113,7 +105,6 @@ def create( *, file_path: str, connect_protocol_version: Literal[1], - environment_variable: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -138,59 +129,6 @@ def create( connect_protocol_version: Define the version of the Connect protocol - environment_variable: secret will be created as an Environment Variable with the same name as the - secret - - project_id: project_id is the ProjectID this Secret belongs to - - value: value is the plaintext value of the secret - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def create( - self, - *, - connect_protocol_version: Literal[1], - environment_variable: bool | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SecretCreateResponse: - """ - CreateSecret creates a new secret. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_variable: secret will be created as an Environment Variable with the same name as the - secret - - file_path: absolute path to the file where the secret is mounted value must be an absolute - path (start with a /): - - ``` - this.matches("^/(?:[^/]*/)*.*$") - ``` - project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret @@ -207,21 +145,17 @@ def create( """ ... - @required_args( - ["environment_variable", "connect_protocol_version"], - ["file_path", "connect_protocol_version"], - ["connect_protocol_version"], - ) + @required_args(["environment_variable", "connect_protocol_version"], ["file_path", "connect_protocol_version"]) def create( self, *, environment_variable: bool | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], - file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -243,10 +177,10 @@ def create( body=maybe_transform( { "environment_variable": environment_variable, - "file_path": file_path, "name": name, "project_id": project_id, "value": value, + "file_path": file_path, }, secret_create_params.SecretCreateParams, ), @@ -531,7 +465,6 @@ async def create( *, environment_variable: bool, connect_protocol_version: Literal[1], - file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -552,13 +485,6 @@ async def create( connect_protocol_version: Define the version of the Connect protocol - file_path: absolute path to the file where the secret is mounted value must be an absolute - path (start with a /): - - ``` - this.matches("^/(?:[^/]*/)*.*$") - ``` - project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret @@ -581,7 +507,6 @@ async def create( *, file_path: str, connect_protocol_version: Literal[1], - environment_variable: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -606,59 +531,6 @@ async def create( connect_protocol_version: Define the version of the Connect protocol - environment_variable: secret will be created as an Environment Variable with the same name as the - secret - - project_id: project_id is the ProjectID this Secret belongs to - - value: value is the plaintext value of the secret - - connect_timeout_ms: Define the timeout, in ms - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def create( - self, - *, - connect_protocol_version: Literal[1], - environment_variable: bool | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SecretCreateResponse: - """ - CreateSecret creates a new secret. - - Args: - connect_protocol_version: Define the version of the Connect protocol - - environment_variable: secret will be created as an Environment Variable with the same name as the - secret - - file_path: absolute path to the file where the secret is mounted value must be an absolute - path (start with a /): - - ``` - this.matches("^/(?:[^/]*/)*.*$") - ``` - project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret @@ -675,21 +547,17 @@ async def create( """ ... - @required_args( - ["environment_variable", "connect_protocol_version"], - ["file_path", "connect_protocol_version"], - ["connect_protocol_version"], - ) + @required_args(["environment_variable", "connect_protocol_version"], ["file_path", "connect_protocol_version"]) async def create( self, *, environment_variable: bool | NotGiven = NOT_GIVEN, connect_protocol_version: Literal[1], - file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -711,10 +579,10 @@ async def create( body=await async_maybe_transform( { "environment_variable": environment_variable, - "file_path": file_path, "name": name, "project_id": project_id, "value": value, + "file_path": file_path, }, secret_create_params.SecretCreateParams, ), diff --git a/src/gitpod/types/account_retrieve_response.py b/src/gitpod/types/account_retrieve_response.py index b1812059..d0dffe2e 100644 --- a/src/gitpod/types/account_retrieve_response.py +++ b/src/gitpod/types/account_retrieve_response.py @@ -1,519 +1,21 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias +from typing import Optional from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = [ - "AccountRetrieveResponse", - "Account", - "AccountUnionMember0", - "AccountUnionMember0Joinable", - "AccountUnionMember0Membership", - "AccountUnionMember1", - "AccountUnionMember1Joinable", - "AccountUnionMember1Membership", -] +__all__ = ["AccountRetrieveResponse", "Account"] -class AccountUnionMember0Joinable(BaseModel): - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the id of the organization the user can join""" - - organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) - """ - organization_member_count is the member count of the organization the user can - join - """ - - organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) - """organization_name is the name of the organization the user can join""" - - -class AccountUnionMember0Membership(BaseModel): - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the id of the organization the user is a member of""" - - organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) - """ - organization_name is the member count of the organization the user is a member - of - """ - - organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) - """organization_name is the name of the organization the user is a member of""" - - user_id: Optional[str] = FieldInfo(alias="userId", default=None) - """user_id is the ID the user has in the organization""" - - user_role: Optional[ - Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] - ] = FieldInfo(alias="userRole", default=None) - """user_role is the role the user has in the organization""" - - -class AccountUnionMember0(BaseModel): +class Account(BaseModel): organization_id: str = FieldInfo(alias="organizationId") """ organization_id is the ID of the organization the account is owned by if it's created through custom SSO """ - id: Optional[str] = None - - avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - email: Optional[str] = None - - joinables: Optional[List[AccountUnionMember0Joinable]] = None - - memberships: Optional[List[AccountUnionMember0Membership]] = None - - name: Optional[str] = None - - public_email_provider: Optional[bool] = FieldInfo(alias="publicEmailProvider", default=None) - """ - public_email_provider is true if the email for the Account matches a known - public email provider - """ - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class AccountUnionMember1Joinable(BaseModel): - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the id of the organization the user can join""" - - organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) - """ - organization_member_count is the member count of the organization the user can - join - """ - - organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) - """organization_name is the name of the organization the user can join""" - - -class AccountUnionMember1Membership(BaseModel): - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the id of the organization the user is a member of""" - - organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) - """ - organization_name is the member count of the organization the user is a member - of - """ - - organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) - """organization_name is the name of the organization the user is a member of""" - - user_id: Optional[str] = FieldInfo(alias="userId", default=None) - """user_id is the ID the user has in the organization""" - - user_role: Optional[ - Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] - ] = FieldInfo(alias="userRole", default=None) - """user_role is the role the user has in the organization""" - - -class AccountUnionMember1(BaseModel): - id: Optional[str] = None - - avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - email: Optional[str] = None - - joinables: Optional[List[AccountUnionMember1Joinable]] = None - - memberships: Optional[List[AccountUnionMember1Membership]] = None - - name: Optional[str] = None - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """ - organization_id is the ID of the organization the account is owned by if it's - created through custom SSO - """ - - public_email_provider: Optional[bool] = FieldInfo(alias="publicEmailProvider", default=None) - """ - public_email_provider is true if the email for the Account matches a known - public email provider - """ - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -Account: TypeAlias = Union[AccountUnionMember0, AccountUnionMember1] - class AccountRetrieveResponse(BaseModel): account: Optional[Account] = None diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index f18ebb68..4413cb62 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -14,23 +14,17 @@ "SpecContent", "SpecContentInitializer", "SpecContentInitializerSpec", - "SpecContentInitializerSpecUnionMember0", - "SpecContentInitializerSpecUnionMember0ContextURL", - "SpecContentInitializerSpecUnionMember0Git", - "SpecContentInitializerSpecUnionMember1", - "SpecContentInitializerSpecUnionMember1Git", - "SpecContentInitializerSpecUnionMember1ContextURL", - "SpecContentInitializerSpecUnionMember2", - "SpecContentInitializerSpecUnionMember2ContextURL", - "SpecContentInitializerSpecUnionMember2Git", + "SpecContentInitializerSpecContextURL", + "SpecContentInitializerSpecContextURLContextURL", + "SpecContentInitializerSpecGit", + "SpecContentInitializerSpecGitGit", "SpecDevcontainer", "SpecMachine", "SpecPort", "SpecSecret", "SpecSecretUnionMember0", - "SpecSecretUnionMember1", + "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", "SpecSecretUnionMember2", - "SpecSecretUnionMember3", "SpecSSHPublicKey", "SpecTimeout", ] @@ -68,92 +62,16 @@ class SpecAutomationsFile(TypedDict, total=False): session: str -class SpecContentInitializerSpecUnionMember0ContextURL(TypedDict, total=False): +class SpecContentInitializerSpecContextURLContextURL(TypedDict, total=False): url: str """url is the URL from which the environment is created""" -class SpecContentInitializerSpecUnionMember0Git(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class SpecContentInitializerSpecUnionMember0(TypedDict, total=False): - context_url: Required[Annotated[SpecContentInitializerSpecUnionMember0ContextURL, PropertyInfo(alias="contextUrl")]] - - git: SpecContentInitializerSpecUnionMember0Git - - -class SpecContentInitializerSpecUnionMember1Git(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class SpecContentInitializerSpecUnionMember1ContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - +class SpecContentInitializerSpecContextURL(TypedDict, total=False): + context_url: Required[Annotated[SpecContentInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] -class SpecContentInitializerSpecUnionMember1(TypedDict, total=False): - git: Required[SpecContentInitializerSpecUnionMember1Git] - context_url: Annotated[SpecContentInitializerSpecUnionMember1ContextURL, PropertyInfo(alias="contextUrl")] - - -class SpecContentInitializerSpecUnionMember2ContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - - -class SpecContentInitializerSpecUnionMember2Git(TypedDict, total=False): +class SpecContentInitializerSpecGitGit(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] """a path relative to the environment root in which the code will be checked out @@ -182,17 +100,11 @@ class SpecContentInitializerSpecUnionMember2Git(TypedDict, total=False): """upstream_Remote_uri is the fork upstream of a repository""" -class SpecContentInitializerSpecUnionMember2(TypedDict, total=False): - context_url: Annotated[SpecContentInitializerSpecUnionMember2ContextURL, PropertyInfo(alias="contextUrl")] +class SpecContentInitializerSpecGit(TypedDict, total=False): + git: Required[SpecContentInitializerSpecGitGit] - git: SpecContentInitializerSpecUnionMember2Git - -SpecContentInitializerSpec: TypeAlias = Union[ - SpecContentInitializerSpecUnionMember0, - SpecContentInitializerSpecUnionMember1, - SpecContentInitializerSpecUnionMember2, -] +SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] class SpecContentInitializer(TypedDict, total=False): @@ -253,11 +165,6 @@ class SpecPort(TypedDict, total=False): class SpecSecretUnionMember0(TypedDict, total=False): environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] - file_path: Annotated[str, PropertyInfo(alias="filePath")] - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] - name: str """name is the human readable description of the secret""" @@ -274,14 +181,10 @@ class SpecSecretUnionMember0(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class SpecSecretUnionMember1(TypedDict, total=False): +class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(TypedDict, total=False): file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] """file_path is the path inside the devcontainer where the secret is mounted""" - environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] - - git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] - name: str """name is the human readable description of the secret""" @@ -301,35 +204,6 @@ class SpecSecretUnionMember1(TypedDict, total=False): class SpecSecretUnionMember2(TypedDict, total=False): git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] - environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] - - file_path: Annotated[str, PropertyInfo(alias="filePath")] - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: str - """name is the human readable description of the secret""" - - session: str - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: str - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class SpecSecretUnionMember3(TypedDict, total=False): - environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] - - file_path: Annotated[str, PropertyInfo(alias="filePath")] - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] - name: str """name is the human readable description of the secret""" @@ -347,7 +221,9 @@ class SpecSecretUnionMember3(TypedDict, total=False): SpecSecret: TypeAlias = Union[ - SpecSecretUnionMember0, SpecSecretUnionMember1, SpecSecretUnionMember2, SpecSecretUnionMember3 + SpecSecretUnionMember0, + SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + SpecSecretUnionMember2, ] diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index 805cf82d..fac2dc9e 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -18,23 +18,17 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecUnionMember0", - "EnvironmentSpecContentInitializerSpecUnionMember0ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember0Git", - "EnvironmentSpecContentInitializerSpecUnionMember1", - "EnvironmentSpecContentInitializerSpecUnionMember1Git", - "EnvironmentSpecContentInitializerSpecUnionMember1ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember2", - "EnvironmentSpecContentInitializerSpecUnionMember2ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember2Git", + "EnvironmentSpecContentInitializerSpecContextURL", + "EnvironmentSpecContentInitializerSpecContextURLContextURL", + "EnvironmentSpecContentInitializerSpecGit", + "EnvironmentSpecContentInitializerSpecGitGit", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretUnionMember1", + "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", "EnvironmentSpecSecretUnionMember2", - "EnvironmentSpecSecretUnionMember3", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -304,46 +298,16 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpecUnionMember0ContextURL(BaseModel): +class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class EnvironmentSpecContentInitializerSpecUnionMember0Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" +class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") -class EnvironmentSpecContentInitializerSpecUnionMember0(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") - - git: Optional[EnvironmentSpecContentInitializerSpecUnionMember0Git] = None - - -class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): +class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -371,64 +335,12 @@ class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecUnionMember1ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecUnionMember1(BaseModel): - git: EnvironmentSpecContentInitializerSpecUnionMember1Git - - context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember1ContextURL] = FieldInfo( - alias="contextUrl", default=None - ) - - -class EnvironmentSpecContentInitializerSpecUnionMember2ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecUnionMember2Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class EnvironmentSpecContentInitializerSpecUnionMember2(BaseModel): - context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember2ContextURL] = FieldInfo( - alias="contextUrl", default=None - ) - - git: Optional[EnvironmentSpecContentInitializerSpecUnionMember2Git] = None +class EnvironmentSpecContentInitializerSpecGit(BaseModel): + git: EnvironmentSpecContentInitializerSpecGitGit EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecUnionMember0, - EnvironmentSpecContentInitializerSpecUnionMember1, - EnvironmentSpecContentInitializerSpecUnionMember2, + EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit ] @@ -486,11 +398,6 @@ class EnvironmentSpecPort(BaseModel): class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -507,14 +414,10 @@ class EnvironmentSpecSecretUnionMember0(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretUnionMember1(BaseModel): +class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -534,35 +437,6 @@ class EnvironmentSpecSecretUnionMember1(BaseModel): class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretUnionMember3(BaseModel): - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -581,9 +455,8 @@ class EnvironmentSpecSecretUnionMember3(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretUnionMember1, + EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, EnvironmentSpecSecretUnionMember2, - EnvironmentSpecSecretUnionMember3, ] diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index 48f448ec..7b8da702 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -14,23 +14,17 @@ "SpecContent", "SpecContentInitializer", "SpecContentInitializerSpec", - "SpecContentInitializerSpecUnionMember0", - "SpecContentInitializerSpecUnionMember0ContextURL", - "SpecContentInitializerSpecUnionMember0Git", - "SpecContentInitializerSpecUnionMember1", - "SpecContentInitializerSpecUnionMember1Git", - "SpecContentInitializerSpecUnionMember1ContextURL", - "SpecContentInitializerSpecUnionMember2", - "SpecContentInitializerSpecUnionMember2ContextURL", - "SpecContentInitializerSpecUnionMember2Git", + "SpecContentInitializerSpecContextURL", + "SpecContentInitializerSpecContextURLContextURL", + "SpecContentInitializerSpecGit", + "SpecContentInitializerSpecGitGit", "SpecDevcontainer", "SpecMachine", "SpecPort", "SpecSecret", "SpecSecretUnionMember0", - "SpecSecretUnionMember1", + "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", "SpecSecretUnionMember2", - "SpecSecretUnionMember3", "SpecSSHPublicKey", "SpecTimeout", ] @@ -66,92 +60,16 @@ class SpecAutomationsFile(TypedDict, total=False): session: str -class SpecContentInitializerSpecUnionMember0ContextURL(TypedDict, total=False): +class SpecContentInitializerSpecContextURLContextURL(TypedDict, total=False): url: str """url is the URL from which the environment is created""" -class SpecContentInitializerSpecUnionMember0Git(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class SpecContentInitializerSpecUnionMember0(TypedDict, total=False): - context_url: Required[Annotated[SpecContentInitializerSpecUnionMember0ContextURL, PropertyInfo(alias="contextUrl")]] - - git: SpecContentInitializerSpecUnionMember0Git - - -class SpecContentInitializerSpecUnionMember1Git(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class SpecContentInitializerSpecUnionMember1ContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - +class SpecContentInitializerSpecContextURL(TypedDict, total=False): + context_url: Required[Annotated[SpecContentInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] -class SpecContentInitializerSpecUnionMember1(TypedDict, total=False): - git: Required[SpecContentInitializerSpecUnionMember1Git] - context_url: Annotated[SpecContentInitializerSpecUnionMember1ContextURL, PropertyInfo(alias="contextUrl")] - - -class SpecContentInitializerSpecUnionMember2ContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - - -class SpecContentInitializerSpecUnionMember2Git(TypedDict, total=False): +class SpecContentInitializerSpecGitGit(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] """a path relative to the environment root in which the code will be checked out @@ -180,17 +98,11 @@ class SpecContentInitializerSpecUnionMember2Git(TypedDict, total=False): """upstream_Remote_uri is the fork upstream of a repository""" -class SpecContentInitializerSpecUnionMember2(TypedDict, total=False): - context_url: Annotated[SpecContentInitializerSpecUnionMember2ContextURL, PropertyInfo(alias="contextUrl")] +class SpecContentInitializerSpecGit(TypedDict, total=False): + git: Required[SpecContentInitializerSpecGitGit] - git: SpecContentInitializerSpecUnionMember2Git - -SpecContentInitializerSpec: TypeAlias = Union[ - SpecContentInitializerSpecUnionMember0, - SpecContentInitializerSpecUnionMember1, - SpecContentInitializerSpecUnionMember2, -] +SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] class SpecContentInitializer(TypedDict, total=False): @@ -251,11 +163,6 @@ class SpecPort(TypedDict, total=False): class SpecSecretUnionMember0(TypedDict, total=False): environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] - file_path: Annotated[str, PropertyInfo(alias="filePath")] - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] - name: str """name is the human readable description of the secret""" @@ -272,14 +179,10 @@ class SpecSecretUnionMember0(TypedDict, total=False): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class SpecSecretUnionMember1(TypedDict, total=False): +class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(TypedDict, total=False): file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] """file_path is the path inside the devcontainer where the secret is mounted""" - environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] - - git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] - name: str """name is the human readable description of the secret""" @@ -299,35 +202,6 @@ class SpecSecretUnionMember1(TypedDict, total=False): class SpecSecretUnionMember2(TypedDict, total=False): git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] - environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] - - file_path: Annotated[str, PropertyInfo(alias="filePath")] - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: str - """name is the human readable description of the secret""" - - session: str - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: str - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class SpecSecretUnionMember3(TypedDict, total=False): - environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] - - file_path: Annotated[str, PropertyInfo(alias="filePath")] - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] - name: str """name is the human readable description of the secret""" @@ -345,7 +219,9 @@ class SpecSecretUnionMember3(TypedDict, total=False): SpecSecret: TypeAlias = Union[ - SpecSecretUnionMember0, SpecSecretUnionMember1, SpecSecretUnionMember2, SpecSecretUnionMember3 + SpecSecretUnionMember0, + SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + SpecSecretUnionMember2, ] diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index 5debb71b..0573ca9e 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -18,23 +18,17 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecUnionMember0", - "EnvironmentSpecContentInitializerSpecUnionMember0ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember0Git", - "EnvironmentSpecContentInitializerSpecUnionMember1", - "EnvironmentSpecContentInitializerSpecUnionMember1Git", - "EnvironmentSpecContentInitializerSpecUnionMember1ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember2", - "EnvironmentSpecContentInitializerSpecUnionMember2ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember2Git", + "EnvironmentSpecContentInitializerSpecContextURL", + "EnvironmentSpecContentInitializerSpecContextURLContextURL", + "EnvironmentSpecContentInitializerSpecGit", + "EnvironmentSpecContentInitializerSpecGitGit", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretUnionMember1", + "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", "EnvironmentSpecSecretUnionMember2", - "EnvironmentSpecSecretUnionMember3", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -304,46 +298,16 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpecUnionMember0ContextURL(BaseModel): +class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class EnvironmentSpecContentInitializerSpecUnionMember0Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" +class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") -class EnvironmentSpecContentInitializerSpecUnionMember0(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") - - git: Optional[EnvironmentSpecContentInitializerSpecUnionMember0Git] = None - - -class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): +class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -371,64 +335,12 @@ class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecUnionMember1ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecUnionMember1(BaseModel): - git: EnvironmentSpecContentInitializerSpecUnionMember1Git - - context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember1ContextURL] = FieldInfo( - alias="contextUrl", default=None - ) - - -class EnvironmentSpecContentInitializerSpecUnionMember2ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecUnionMember2Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class EnvironmentSpecContentInitializerSpecUnionMember2(BaseModel): - context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember2ContextURL] = FieldInfo( - alias="contextUrl", default=None - ) - - git: Optional[EnvironmentSpecContentInitializerSpecUnionMember2Git] = None +class EnvironmentSpecContentInitializerSpecGit(BaseModel): + git: EnvironmentSpecContentInitializerSpecGitGit EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecUnionMember0, - EnvironmentSpecContentInitializerSpecUnionMember1, - EnvironmentSpecContentInitializerSpecUnionMember2, + EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit ] @@ -486,11 +398,6 @@ class EnvironmentSpecPort(BaseModel): class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -507,14 +414,10 @@ class EnvironmentSpecSecretUnionMember0(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretUnionMember1(BaseModel): +class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -534,35 +437,6 @@ class EnvironmentSpecSecretUnionMember1(BaseModel): class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretUnionMember3(BaseModel): - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -581,9 +455,8 @@ class EnvironmentSpecSecretUnionMember3(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretUnionMember1, + EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, EnvironmentSpecSecretUnionMember2, - EnvironmentSpecSecretUnionMember3, ] diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py index 459782f6..16e8fa8a 100644 --- a/src/gitpod/types/environment_list_response.py +++ b/src/gitpod/types/environment_list_response.py @@ -18,23 +18,17 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecUnionMember0", - "EnvironmentSpecContentInitializerSpecUnionMember0ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember0Git", - "EnvironmentSpecContentInitializerSpecUnionMember1", - "EnvironmentSpecContentInitializerSpecUnionMember1Git", - "EnvironmentSpecContentInitializerSpecUnionMember1ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember2", - "EnvironmentSpecContentInitializerSpecUnionMember2ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember2Git", + "EnvironmentSpecContentInitializerSpecContextURL", + "EnvironmentSpecContentInitializerSpecContextURLContextURL", + "EnvironmentSpecContentInitializerSpecGit", + "EnvironmentSpecContentInitializerSpecGitGit", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretUnionMember1", + "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", "EnvironmentSpecSecretUnionMember2", - "EnvironmentSpecSecretUnionMember3", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -305,46 +299,16 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpecUnionMember0ContextURL(BaseModel): +class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class EnvironmentSpecContentInitializerSpecUnionMember0Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" +class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") -class EnvironmentSpecContentInitializerSpecUnionMember0(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") - - git: Optional[EnvironmentSpecContentInitializerSpecUnionMember0Git] = None - - -class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): +class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -372,64 +336,12 @@ class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecUnionMember1ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecUnionMember1(BaseModel): - git: EnvironmentSpecContentInitializerSpecUnionMember1Git - - context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember1ContextURL] = FieldInfo( - alias="contextUrl", default=None - ) - - -class EnvironmentSpecContentInitializerSpecUnionMember2ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecUnionMember2Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class EnvironmentSpecContentInitializerSpecUnionMember2(BaseModel): - context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember2ContextURL] = FieldInfo( - alias="contextUrl", default=None - ) - - git: Optional[EnvironmentSpecContentInitializerSpecUnionMember2Git] = None +class EnvironmentSpecContentInitializerSpecGit(BaseModel): + git: EnvironmentSpecContentInitializerSpecGitGit EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecUnionMember0, - EnvironmentSpecContentInitializerSpecUnionMember1, - EnvironmentSpecContentInitializerSpecUnionMember2, + EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit ] @@ -487,11 +399,6 @@ class EnvironmentSpecPort(BaseModel): class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -508,14 +415,10 @@ class EnvironmentSpecSecretUnionMember0(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretUnionMember1(BaseModel): +class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -535,35 +438,6 @@ class EnvironmentSpecSecretUnionMember1(BaseModel): class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretUnionMember3(BaseModel): - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -582,9 +456,8 @@ class EnvironmentSpecSecretUnionMember3(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretUnionMember1, + EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, EnvironmentSpecSecretUnionMember2, - EnvironmentSpecSecretUnionMember3, ] diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index c2c065c8..f4b32ccb 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -18,23 +18,17 @@ "EnvironmentSpecContent", "EnvironmentSpecContentInitializer", "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecUnionMember0", - "EnvironmentSpecContentInitializerSpecUnionMember0ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember0Git", - "EnvironmentSpecContentInitializerSpecUnionMember1", - "EnvironmentSpecContentInitializerSpecUnionMember1Git", - "EnvironmentSpecContentInitializerSpecUnionMember1ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember2", - "EnvironmentSpecContentInitializerSpecUnionMember2ContextURL", - "EnvironmentSpecContentInitializerSpecUnionMember2Git", + "EnvironmentSpecContentInitializerSpecContextURL", + "EnvironmentSpecContentInitializerSpecContextURLContextURL", + "EnvironmentSpecContentInitializerSpecGit", + "EnvironmentSpecContentInitializerSpecGitGit", "EnvironmentSpecDevcontainer", "EnvironmentSpecMachine", "EnvironmentSpecPort", "EnvironmentSpecSecret", "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretUnionMember1", + "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", "EnvironmentSpecSecretUnionMember2", - "EnvironmentSpecSecretUnionMember3", "EnvironmentSpecSSHPublicKey", "EnvironmentSpecTimeout", "EnvironmentStatus", @@ -304,46 +298,16 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpecUnionMember0ContextURL(BaseModel): +class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class EnvironmentSpecContentInitializerSpecUnionMember0Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" +class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): + context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") -class EnvironmentSpecContentInitializerSpecUnionMember0(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") - - git: Optional[EnvironmentSpecContentInitializerSpecUnionMember0Git] = None - - -class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): +class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -371,64 +335,12 @@ class EnvironmentSpecContentInitializerSpecUnionMember1Git(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecUnionMember1ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecUnionMember1(BaseModel): - git: EnvironmentSpecContentInitializerSpecUnionMember1Git - - context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember1ContextURL] = FieldInfo( - alias="contextUrl", default=None - ) - - -class EnvironmentSpecContentInitializerSpecUnionMember2ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecUnionMember2Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class EnvironmentSpecContentInitializerSpecUnionMember2(BaseModel): - context_url: Optional[EnvironmentSpecContentInitializerSpecUnionMember2ContextURL] = FieldInfo( - alias="contextUrl", default=None - ) - - git: Optional[EnvironmentSpecContentInitializerSpecUnionMember2Git] = None +class EnvironmentSpecContentInitializerSpecGit(BaseModel): + git: EnvironmentSpecContentInitializerSpecGitGit EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecUnionMember0, - EnvironmentSpecContentInitializerSpecUnionMember1, - EnvironmentSpecContentInitializerSpecUnionMember2, + EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit ] @@ -486,11 +398,6 @@ class EnvironmentSpecPort(BaseModel): class EnvironmentSpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -507,14 +414,10 @@ class EnvironmentSpecSecretUnionMember0(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretUnionMember1(BaseModel): +class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -534,35 +437,6 @@ class EnvironmentSpecSecretUnionMember1(BaseModel): class EnvironmentSpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretUnionMember3(BaseModel): - environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """file_path is the path inside the devcontainer where the secret is mounted""" - - git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) - name: Optional[str] = None """name is the human readable description of the secret""" @@ -581,9 +455,8 @@ class EnvironmentSpecSecretUnionMember3(BaseModel): EnvironmentSpecSecret: TypeAlias = Union[ EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretUnionMember1, + EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, EnvironmentSpecSecretUnionMember2, - EnvironmentSpecSecretUnionMember3, ] diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index 108189b1..be559eb5 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -2,15 +2,43 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -__all__ = ["EnvironmentUpdateParams", "Body"] +__all__ = [ + "EnvironmentUpdateParams", + "Variant0", + "Variant1", + "Variant1Spec", + "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment", + "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile", + "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot", + "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession", + "Variant1SpecContent", + "Variant1SpecContentContent", + "Variant1SpecContentContentTheGitEmailAddress", + "Variant1SpecContentContentTheGitUsername", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit", + "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit", + "Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization", + "Variant1SpecDevcontainer", + "Variant1SpecDevcontainerDevcontainer", + "Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", + "Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild", + "Variant1SpecTimeoutConfiguresTheEnvironmentTimeout", + "Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout", +] -class EnvironmentUpdateParams(TypedDict, total=False): - body: Required[Body] +class Variant0(TypedDict, total=False): + metadata: Required[object] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +47,255 @@ class EnvironmentUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +class Variant1(TypedDict, total=False): + spec: Required[Variant1Spec] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot( + TypedDict, total=False +): + automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] + """ + automations_file_path is the path to the automations file that is applied in the + environment, + + relative to the repo root. path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + +class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession(TypedDict, total=False): + session: Required[str] + + +Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile: TypeAlias = Union[ + Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot, + Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession, +] + + +class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment(TypedDict, total=False): + automations_file: Required[ + Annotated[ + Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile, + PropertyInfo(alias="automationsFile"), + ] + ] + """automations_file is the automations file spec of the environment""" + + +class Variant1SpecContentContentTheGitEmailAddress(TypedDict, total=False): + git_email: Required[Annotated[str, PropertyInfo(alias="gitEmail")]] + """The Git email address""" + + +class Variant1SpecContentContentTheGitUsername(TypedDict, total=False): + git_username: Required[Annotated[str, PropertyInfo(alias="gitUsername")]] + """The Git username""" + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL( + TypedDict, total=False +): + url: str + """url is the URL from which the environment is created""" + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL( + TypedDict, total=False +): + context_url: Required[ + Annotated[ + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL, + PropertyInfo(alias="contextUrl"), + ] + ] + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit( + TypedDict, total=False +): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit( + TypedDict, total=False +): + git: Required[ + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit + ] + + +Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec: TypeAlias = Union[ + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL, + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit, +] + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer( + TypedDict, total=False +): + specs: Iterable[Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec] + + +class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized(TypedDict, total=False): + initializer: Required[Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer] + """EnvironmentInitializer specifies how an environment is to be initialized""" + + +class Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization(TypedDict, total=False): + session: Required[str] + """session should be changed to trigger a content reinitialization""" + + +Variant1SpecContentContent: TypeAlias = Union[ + Variant1SpecContentContentTheGitEmailAddress, + Variant1SpecContentContentTheGitUsername, + Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized, + Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization, +] + + +class Variant1SpecContent(TypedDict, total=False): + content: Required[Variant1SpecContentContent] + + +class Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot( + TypedDict, total=False +): + devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + +class Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild(TypedDict, total=False): + session: Required[str] + """session should be changed to trigger a devcontainer rebuild""" + + +Variant1SpecDevcontainerDevcontainer: TypeAlias = Union[ + Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, + Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild, +] + + +class Variant1SpecDevcontainer(TypedDict, total=False): + devcontainer: Required[Variant1SpecDevcontainerDevcontainer] + + +class Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout(TypedDict, total=False): + disconnected: Required[str] + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class Variant1SpecTimeoutConfiguresTheEnvironmentTimeout(TypedDict, total=False): + timeout: Required[Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout] + """Timeout configures the environment timeout""" + + +Variant1Spec: TypeAlias = Union[ + Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment, + Variant1SpecContent, + Variant1SpecDevcontainer, + Variant1SpecTimeoutConfiguresTheEnvironmentTimeout, +] + +EnvironmentUpdateParams: TypeAlias = Union[Variant0, Variant1] diff --git a/src/gitpod/types/environments/automation_upsert_params.py b/src/gitpod/types/environments/automation_upsert_params.py index 4b36e6a6..3285979c 100644 --- a/src/gitpod/types/environments/automation_upsert_params.py +++ b/src/gitpod/types/environments/automation_upsert_params.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Dict, List, Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing import Dict, List +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -14,11 +14,9 @@ "AutomationsFileServicesCommands", "AutomationsFileServicesRunsOn", "AutomationsFileServicesRunsOnDocker", - "AutomationsFileServicesRunsOnDockerDocker", "AutomationsFileTasks", "AutomationsFileTasksRunsOn", "AutomationsFileTasksRunsOnDocker", - "AutomationsFileTasksRunsOnDockerDocker", ] @@ -75,19 +73,14 @@ class AutomationsFileServicesCommands(TypedDict, total=False): """ -class AutomationsFileServicesRunsOnDockerDocker(TypedDict, total=False): +class AutomationsFileServicesRunsOnDocker(TypedDict, total=False): environment: List[str] image: str -class AutomationsFileServicesRunsOnDocker(TypedDict, total=False): - docker: Required[AutomationsFileServicesRunsOnDockerDocker] - - -AutomationsFileServicesRunsOn: TypeAlias = Union[ - AutomationsFileServicesRunsOnDocker, AutomationsFileServicesRunsOnDocker -] +class AutomationsFileServicesRunsOn(TypedDict, total=False): + docker: Required[AutomationsFileServicesRunsOnDocker] class AutomationsFileServices(TypedDict, total=False): @@ -102,17 +95,14 @@ class AutomationsFileServices(TypedDict, total=False): triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] -class AutomationsFileTasksRunsOnDockerDocker(TypedDict, total=False): +class AutomationsFileTasksRunsOnDocker(TypedDict, total=False): environment: List[str] image: str -class AutomationsFileTasksRunsOnDocker(TypedDict, total=False): - docker: Required[AutomationsFileTasksRunsOnDockerDocker] - - -AutomationsFileTasksRunsOn: TypeAlias = Union[AutomationsFileTasksRunsOnDocker, AutomationsFileTasksRunsOnDocker] +class AutomationsFileTasksRunsOn(TypedDict, total=False): + docker: Required[AutomationsFileTasksRunsOnDocker] class AutomationsFileTasks(TypedDict, total=False): diff --git a/src/gitpod/types/environments/automations/service_create_params.py b/src/gitpod/types/environments/automations/service_create_params.py index d575602d..386d562b 100644 --- a/src/gitpod/types/environments/automations/service_create_params.py +++ b/src/gitpod/types/environments/automations/service_create_params.py @@ -13,15 +13,13 @@ "Metadata", "MetadataCreator", "MetadataTriggeredBy", - "MetadataTriggeredByUnionMember0", - "MetadataTriggeredByUnionMember1", - "MetadataTriggeredByUnionMember2", - "MetadataTriggeredByUnionMember3", + "MetadataTriggeredByManual", + "MetadataTriggeredByPostDevcontainerStart", + "MetadataTriggeredByPostEnvironmentStart", "Spec", "SpecCommands", "SpecRunsOn", "SpecRunsOnDocker", - "SpecRunsOnDockerDocker", ] @@ -54,43 +52,20 @@ class MetadataCreator(TypedDict, total=False): """Principal is the principal of the subject""" -class MetadataTriggeredByUnionMember0(TypedDict, total=False): +class MetadataTriggeredByManual(TypedDict, total=False): manual: Required[bool] - post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] - post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] - - -class MetadataTriggeredByUnionMember1(TypedDict, total=False): +class MetadataTriggeredByPostDevcontainerStart(TypedDict, total=False): post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] - manual: bool - - post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] - -class MetadataTriggeredByUnionMember2(TypedDict, total=False): +class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] - manual: bool - - post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] - - -class MetadataTriggeredByUnionMember3(TypedDict, total=False): - manual: bool - - post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] - - post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] - MetadataTriggeredBy: TypeAlias = Union[ - MetadataTriggeredByUnionMember0, - MetadataTriggeredByUnionMember1, - MetadataTriggeredByUnionMember2, - MetadataTriggeredByUnionMember3, + MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart ] @@ -251,17 +226,14 @@ class SpecCommands(TypedDict, total=False): """ -class SpecRunsOnDockerDocker(TypedDict, total=False): +class SpecRunsOnDocker(TypedDict, total=False): environment: List[str] image: str -class SpecRunsOnDocker(TypedDict, total=False): - docker: Required[SpecRunsOnDockerDocker] - - -SpecRunsOn: TypeAlias = Union[SpecRunsOnDocker, SpecRunsOnDocker] +class SpecRunsOn(TypedDict, total=False): + docker: Required[SpecRunsOnDocker] class Spec(TypedDict, total=False): diff --git a/src/gitpod/types/environments/automations/service_create_response.py b/src/gitpod/types/environments/automations/service_create_response.py index ccf0ba28..2ae3f289 100644 --- a/src/gitpod/types/environments/automations/service_create_response.py +++ b/src/gitpod/types/environments/automations/service_create_response.py @@ -14,15 +14,13 @@ "ServiceMetadata", "ServiceMetadataCreator", "ServiceMetadataTriggeredBy", - "ServiceMetadataTriggeredByUnionMember0", - "ServiceMetadataTriggeredByUnionMember1", - "ServiceMetadataTriggeredByUnionMember2", - "ServiceMetadataTriggeredByUnionMember3", + "ServiceMetadataTriggeredByManual", + "ServiceMetadataTriggeredByPostDevcontainerStart", + "ServiceMetadataTriggeredByPostEnvironmentStart", "ServiceSpec", "ServiceSpecCommands", "ServiceSpecRunsOn", "ServiceSpecRunsOnDocker", - "ServiceSpecRunsOnDockerDocker", "ServiceStatus", ] @@ -44,43 +42,22 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class ServiceMetadataTriggeredByUnionMember0(BaseModel): +class ServiceMetadataTriggeredByManual(BaseModel): manual: bool - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - - -class ServiceMetadataTriggeredByUnionMember1(BaseModel): +class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - manual: Optional[bool] = None - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - -class ServiceMetadataTriggeredByUnionMember2(BaseModel): +class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - -class ServiceMetadataTriggeredByUnionMember3(BaseModel): - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - ServiceMetadataTriggeredBy: TypeAlias = Union[ - ServiceMetadataTriggeredByUnionMember0, - ServiceMetadataTriggeredByUnionMember1, - ServiceMetadataTriggeredByUnionMember2, - ServiceMetadataTriggeredByUnionMember3, + ServiceMetadataTriggeredByManual, + ServiceMetadataTriggeredByPostDevcontainerStart, + ServiceMetadataTriggeredByPostEnvironmentStart, ] @@ -241,17 +218,14 @@ class ServiceSpecCommands(BaseModel): """ -class ServiceSpecRunsOnDockerDocker(BaseModel): +class ServiceSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class ServiceSpecRunsOnDocker(BaseModel): - docker: ServiceSpecRunsOnDockerDocker - - -ServiceSpecRunsOn: TypeAlias = Union[ServiceSpecRunsOnDocker, ServiceSpecRunsOnDocker] +class ServiceSpecRunsOn(BaseModel): + docker: ServiceSpecRunsOnDocker class ServiceSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/service_list_response.py b/src/gitpod/types/environments/automations/service_list_response.py index 90412049..3ee87638 100644 --- a/src/gitpod/types/environments/automations/service_list_response.py +++ b/src/gitpod/types/environments/automations/service_list_response.py @@ -15,15 +15,13 @@ "ServiceMetadata", "ServiceMetadataCreator", "ServiceMetadataTriggeredBy", - "ServiceMetadataTriggeredByUnionMember0", - "ServiceMetadataTriggeredByUnionMember1", - "ServiceMetadataTriggeredByUnionMember2", - "ServiceMetadataTriggeredByUnionMember3", + "ServiceMetadataTriggeredByManual", + "ServiceMetadataTriggeredByPostDevcontainerStart", + "ServiceMetadataTriggeredByPostEnvironmentStart", "ServiceSpec", "ServiceSpecCommands", "ServiceSpecRunsOn", "ServiceSpecRunsOnDocker", - "ServiceSpecRunsOnDockerDocker", "ServiceStatus", ] @@ -53,43 +51,22 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class ServiceMetadataTriggeredByUnionMember0(BaseModel): +class ServiceMetadataTriggeredByManual(BaseModel): manual: bool - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - - -class ServiceMetadataTriggeredByUnionMember1(BaseModel): +class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - manual: Optional[bool] = None - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - -class ServiceMetadataTriggeredByUnionMember2(BaseModel): +class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - -class ServiceMetadataTriggeredByUnionMember3(BaseModel): - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - ServiceMetadataTriggeredBy: TypeAlias = Union[ - ServiceMetadataTriggeredByUnionMember0, - ServiceMetadataTriggeredByUnionMember1, - ServiceMetadataTriggeredByUnionMember2, - ServiceMetadataTriggeredByUnionMember3, + ServiceMetadataTriggeredByManual, + ServiceMetadataTriggeredByPostDevcontainerStart, + ServiceMetadataTriggeredByPostEnvironmentStart, ] @@ -250,17 +227,14 @@ class ServiceSpecCommands(BaseModel): """ -class ServiceSpecRunsOnDockerDocker(BaseModel): +class ServiceSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class ServiceSpecRunsOnDocker(BaseModel): - docker: ServiceSpecRunsOnDockerDocker - - -ServiceSpecRunsOn: TypeAlias = Union[ServiceSpecRunsOnDocker, ServiceSpecRunsOnDocker] +class ServiceSpecRunsOn(BaseModel): + docker: ServiceSpecRunsOnDocker class ServiceSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/service_retrieve_response.py b/src/gitpod/types/environments/automations/service_retrieve_response.py index 49c792d2..70832cbd 100644 --- a/src/gitpod/types/environments/automations/service_retrieve_response.py +++ b/src/gitpod/types/environments/automations/service_retrieve_response.py @@ -14,15 +14,13 @@ "ServiceMetadata", "ServiceMetadataCreator", "ServiceMetadataTriggeredBy", - "ServiceMetadataTriggeredByUnionMember0", - "ServiceMetadataTriggeredByUnionMember1", - "ServiceMetadataTriggeredByUnionMember2", - "ServiceMetadataTriggeredByUnionMember3", + "ServiceMetadataTriggeredByManual", + "ServiceMetadataTriggeredByPostDevcontainerStart", + "ServiceMetadataTriggeredByPostEnvironmentStart", "ServiceSpec", "ServiceSpecCommands", "ServiceSpecRunsOn", "ServiceSpecRunsOnDocker", - "ServiceSpecRunsOnDockerDocker", "ServiceStatus", ] @@ -44,43 +42,22 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class ServiceMetadataTriggeredByUnionMember0(BaseModel): +class ServiceMetadataTriggeredByManual(BaseModel): manual: bool - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - - -class ServiceMetadataTriggeredByUnionMember1(BaseModel): +class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - manual: Optional[bool] = None - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - -class ServiceMetadataTriggeredByUnionMember2(BaseModel): +class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - -class ServiceMetadataTriggeredByUnionMember3(BaseModel): - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - ServiceMetadataTriggeredBy: TypeAlias = Union[ - ServiceMetadataTriggeredByUnionMember0, - ServiceMetadataTriggeredByUnionMember1, - ServiceMetadataTriggeredByUnionMember2, - ServiceMetadataTriggeredByUnionMember3, + ServiceMetadataTriggeredByManual, + ServiceMetadataTriggeredByPostDevcontainerStart, + ServiceMetadataTriggeredByPostEnvironmentStart, ] @@ -241,17 +218,14 @@ class ServiceSpecCommands(BaseModel): """ -class ServiceSpecRunsOnDockerDocker(BaseModel): +class ServiceSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class ServiceSpecRunsOnDocker(BaseModel): - docker: ServiceSpecRunsOnDockerDocker - - -ServiceSpecRunsOn: TypeAlias = Union[ServiceSpecRunsOnDocker, ServiceSpecRunsOnDocker] +class ServiceSpecRunsOn(BaseModel): + docker: ServiceSpecRunsOnDocker class ServiceSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index 6cad65fa..e31fb35d 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -2,11 +2,37 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["ServiceUpdateParams", "Metadata", "Spec", "Status"] +__all__ = [ + "ServiceUpdateParams", + "Metadata", + "MetadataDescription", + "MetadataName", + "MetadataTriggeredBy", + "MetadataTriggeredByTriggeredBy", + "MetadataTriggeredByTriggeredByTrigger", + "MetadataTriggeredByTriggeredByTriggerManual", + "MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart", + "MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart", + "Spec", + "SpecCommands", + "SpecCommandsCommands", + "SpecCommandsCommandsReady", + "SpecCommandsCommandsStart", + "SpecCommandsCommandsStop", + "SpecRunsOn", + "SpecRunsOnRunsOn", + "SpecRunsOnRunsOnDocker", + "Status", + "StatusFailureMessage", + "StatusLogURL", + "StatusPhase", + "StatusSession", +] class ServiceUpdateParams(TypedDict, total=False): @@ -37,13 +63,104 @@ class ServiceUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Metadata: - pass +class MetadataDescription(TypedDict, total=False): + description: Required[str] -class Spec: - pass +class MetadataName(TypedDict, total=False): + name: Required[str] -class Status: - pass +class MetadataTriggeredByTriggeredByTriggerManual(TypedDict, total=False): + manual: Required[bool] + + +class MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart(TypedDict, total=False): + post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] + + +class MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart(TypedDict, total=False): + post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] + + +MetadataTriggeredByTriggeredByTrigger: TypeAlias = Union[ + MetadataTriggeredByTriggeredByTriggerManual, + MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart, + MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart, +] + + +class MetadataTriggeredByTriggeredBy(TypedDict, total=False): + trigger: Iterable[MetadataTriggeredByTriggeredByTrigger] + + +class MetadataTriggeredBy(TypedDict, total=False): + triggered_by: Required[Annotated[MetadataTriggeredByTriggeredBy, PropertyInfo(alias="triggeredBy")]] + + +Metadata: TypeAlias = Union[MetadataDescription, MetadataName, MetadataTriggeredBy] + + +class SpecCommandsCommandsReady(TypedDict, total=False): + ready: Required[str] + + +class SpecCommandsCommandsStart(TypedDict, total=False): + start: Required[str] + + +class SpecCommandsCommandsStop(TypedDict, total=False): + stop: Required[str] + + +SpecCommandsCommands: TypeAlias = Union[SpecCommandsCommandsReady, SpecCommandsCommandsStart, SpecCommandsCommandsStop] + + +class SpecCommands(TypedDict, total=False): + commands: Required[SpecCommandsCommands] + + +class SpecRunsOnRunsOnDocker(TypedDict, total=False): + environment: List[str] + + image: str + + +class SpecRunsOnRunsOn(TypedDict, total=False): + docker: Required[SpecRunsOnRunsOnDocker] + + +class SpecRunsOn(TypedDict, total=False): + runs_on: Required[Annotated[SpecRunsOnRunsOn, PropertyInfo(alias="runsOn")]] + + +Spec: TypeAlias = Union[SpecCommands, SpecRunsOn] + + +class StatusFailureMessage(TypedDict, total=False): + failure_message: Required[Annotated[str, PropertyInfo(alias="failureMessage")]] + + +class StatusLogURL(TypedDict, total=False): + log_url: Required[Annotated[str, PropertyInfo(alias="logUrl")]] + + +class StatusPhase(TypedDict, total=False): + phase: Required[ + Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", + ] + ] + + +class StatusSession(TypedDict, total=False): + session: Required[str] + + +Status: TypeAlias = Union[StatusFailureMessage, StatusLogURL, StatusPhase, StatusSession] diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index 32cdb0e1..a1d9bf64 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -13,14 +13,12 @@ "Metadata", "MetadataCreator", "MetadataTriggeredBy", - "MetadataTriggeredByUnionMember0", - "MetadataTriggeredByUnionMember1", - "MetadataTriggeredByUnionMember2", - "MetadataTriggeredByUnionMember3", + "MetadataTriggeredByManual", + "MetadataTriggeredByPostDevcontainerStart", + "MetadataTriggeredByPostEnvironmentStart", "Spec", "SpecRunsOn", "SpecRunsOnDocker", - "SpecRunsOnDockerDocker", ] @@ -55,43 +53,20 @@ class MetadataCreator(TypedDict, total=False): """Principal is the principal of the subject""" -class MetadataTriggeredByUnionMember0(TypedDict, total=False): +class MetadataTriggeredByManual(TypedDict, total=False): manual: Required[bool] - post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] - post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] - - -class MetadataTriggeredByUnionMember1(TypedDict, total=False): +class MetadataTriggeredByPostDevcontainerStart(TypedDict, total=False): post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] - manual: bool - - post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] - -class MetadataTriggeredByUnionMember2(TypedDict, total=False): +class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] - manual: bool - - post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] - - -class MetadataTriggeredByUnionMember3(TypedDict, total=False): - manual: bool - - post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] - - post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] - MetadataTriggeredBy: TypeAlias = Union[ - MetadataTriggeredByUnionMember0, - MetadataTriggeredByUnionMember1, - MetadataTriggeredByUnionMember2, - MetadataTriggeredByUnionMember3, + MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart ] @@ -219,17 +194,14 @@ class Metadata(TypedDict, total=False): """triggered_by is a list of trigger that start the task.""" -class SpecRunsOnDockerDocker(TypedDict, total=False): +class SpecRunsOnDocker(TypedDict, total=False): environment: List[str] image: str -class SpecRunsOnDocker(TypedDict, total=False): - docker: Required[SpecRunsOnDockerDocker] - - -SpecRunsOn: TypeAlias = Union[SpecRunsOnDocker, SpecRunsOnDocker] +class SpecRunsOn(TypedDict, total=False): + docker: Required[SpecRunsOnDocker] class Spec(TypedDict, total=False): diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index e3ce966c..3a91f48b 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -14,14 +14,12 @@ "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", - "TaskMetadataTriggeredByUnionMember0", - "TaskMetadataTriggeredByUnionMember1", - "TaskMetadataTriggeredByUnionMember2", - "TaskMetadataTriggeredByUnionMember3", + "TaskMetadataTriggeredByManual", + "TaskMetadataTriggeredByPostDevcontainerStart", + "TaskMetadataTriggeredByPostEnvironmentStart", "TaskSpec", "TaskSpecRunsOn", "TaskSpecRunsOnDocker", - "TaskSpecRunsOnDockerDocker", ] @@ -42,43 +40,22 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredByUnionMember0(BaseModel): +class TaskMetadataTriggeredByManual(BaseModel): manual: bool - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - - -class TaskMetadataTriggeredByUnionMember1(BaseModel): +class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - manual: Optional[bool] = None - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - -class TaskMetadataTriggeredByUnionMember2(BaseModel): +class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - -class TaskMetadataTriggeredByUnionMember3(BaseModel): - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - TaskMetadataTriggeredBy: TypeAlias = Union[ - TaskMetadataTriggeredByUnionMember0, - TaskMetadataTriggeredByUnionMember1, - TaskMetadataTriggeredByUnionMember2, - TaskMetadataTriggeredByUnionMember3, + TaskMetadataTriggeredByManual, + TaskMetadataTriggeredByPostDevcontainerStart, + TaskMetadataTriggeredByPostEnvironmentStart, ] @@ -206,17 +183,14 @@ class TaskMetadata(BaseModel): """triggered_by is a list of trigger that start the task.""" -class TaskSpecRunsOnDockerDocker(BaseModel): +class TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskSpecRunsOnDocker(BaseModel): - docker: TaskSpecRunsOnDockerDocker - - -TaskSpecRunsOn: TypeAlias = Union[TaskSpecRunsOnDocker, TaskSpecRunsOnDocker] +class TaskSpecRunsOn(BaseModel): + docker: TaskSpecRunsOnDocker class TaskSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_list_response.py b/src/gitpod/types/environments/automations/task_list_response.py index 4d3881c5..eebde115 100644 --- a/src/gitpod/types/environments/automations/task_list_response.py +++ b/src/gitpod/types/environments/automations/task_list_response.py @@ -15,14 +15,12 @@ "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", - "TaskMetadataTriggeredByUnionMember0", - "TaskMetadataTriggeredByUnionMember1", - "TaskMetadataTriggeredByUnionMember2", - "TaskMetadataTriggeredByUnionMember3", + "TaskMetadataTriggeredByManual", + "TaskMetadataTriggeredByPostDevcontainerStart", + "TaskMetadataTriggeredByPostEnvironmentStart", "TaskSpec", "TaskSpecRunsOn", "TaskSpecRunsOnDocker", - "TaskSpecRunsOnDockerDocker", ] @@ -51,43 +49,22 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredByUnionMember0(BaseModel): +class TaskMetadataTriggeredByManual(BaseModel): manual: bool - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - - -class TaskMetadataTriggeredByUnionMember1(BaseModel): +class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - manual: Optional[bool] = None - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - -class TaskMetadataTriggeredByUnionMember2(BaseModel): +class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - -class TaskMetadataTriggeredByUnionMember3(BaseModel): - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - TaskMetadataTriggeredBy: TypeAlias = Union[ - TaskMetadataTriggeredByUnionMember0, - TaskMetadataTriggeredByUnionMember1, - TaskMetadataTriggeredByUnionMember2, - TaskMetadataTriggeredByUnionMember3, + TaskMetadataTriggeredByManual, + TaskMetadataTriggeredByPostDevcontainerStart, + TaskMetadataTriggeredByPostEnvironmentStart, ] @@ -215,17 +192,14 @@ class TaskMetadata(BaseModel): """triggered_by is a list of trigger that start the task.""" -class TaskSpecRunsOnDockerDocker(BaseModel): +class TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskSpecRunsOnDocker(BaseModel): - docker: TaskSpecRunsOnDockerDocker - - -TaskSpecRunsOn: TypeAlias = Union[TaskSpecRunsOnDocker, TaskSpecRunsOnDocker] +class TaskSpecRunsOn(BaseModel): + docker: TaskSpecRunsOnDocker class TaskSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index 866e5439..a9b4c055 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -14,14 +14,12 @@ "TaskMetadata", "TaskMetadataCreator", "TaskMetadataTriggeredBy", - "TaskMetadataTriggeredByUnionMember0", - "TaskMetadataTriggeredByUnionMember1", - "TaskMetadataTriggeredByUnionMember2", - "TaskMetadataTriggeredByUnionMember3", + "TaskMetadataTriggeredByManual", + "TaskMetadataTriggeredByPostDevcontainerStart", + "TaskMetadataTriggeredByPostEnvironmentStart", "TaskSpec", "TaskSpecRunsOn", "TaskSpecRunsOnDocker", - "TaskSpecRunsOnDockerDocker", ] @@ -42,43 +40,22 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredByUnionMember0(BaseModel): +class TaskMetadataTriggeredByManual(BaseModel): manual: bool - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - - -class TaskMetadataTriggeredByUnionMember1(BaseModel): +class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - manual: Optional[bool] = None - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - -class TaskMetadataTriggeredByUnionMember2(BaseModel): +class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - -class TaskMetadataTriggeredByUnionMember3(BaseModel): - manual: Optional[bool] = None - - post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) - - post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) - TaskMetadataTriggeredBy: TypeAlias = Union[ - TaskMetadataTriggeredByUnionMember0, - TaskMetadataTriggeredByUnionMember1, - TaskMetadataTriggeredByUnionMember2, - TaskMetadataTriggeredByUnionMember3, + TaskMetadataTriggeredByManual, + TaskMetadataTriggeredByPostDevcontainerStart, + TaskMetadataTriggeredByPostEnvironmentStart, ] @@ -206,17 +183,14 @@ class TaskMetadata(BaseModel): """triggered_by is a list of trigger that start the task.""" -class TaskSpecRunsOnDockerDocker(BaseModel): +class TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskSpecRunsOnDocker(BaseModel): - docker: TaskSpecRunsOnDockerDocker - - -TaskSpecRunsOn: TypeAlias = Union[TaskSpecRunsOnDocker, TaskSpecRunsOnDocker] +class TaskSpecRunsOn(BaseModel): + docker: TaskSpecRunsOnDocker class TaskSpec(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py index 7575b51f..35d969e0 100644 --- a/src/gitpod/types/environments/automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -17,23 +17,11 @@ "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", "TaskExecutionSpecPlanStepUnionMember0", - "TaskExecutionSpecPlanStepUnionMember0Task", - "TaskExecutionSpecPlanStepUnionMember0TaskSpec", - "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn", - "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker", - "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker", "TaskExecutionSpecPlanStepUnionMember1", "TaskExecutionSpecPlanStepUnionMember1Task", "TaskExecutionSpecPlanStepUnionMember1TaskSpec", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", - "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker", - "TaskExecutionSpecPlanStepUnionMember2", - "TaskExecutionSpecPlanStepUnionMember2Task", - "TaskExecutionSpecPlanStepUnionMember2TaskSpec", - "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn", - "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker", - "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -346,35 +334,6 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker - - -TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker -] - - -class TaskExecutionSpecPlanStepUnionMember0TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class TaskExecutionSpecPlanStepUnionMember0Task(BaseModel): - id: Optional[str] = None - - spec: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpec] = None - - class TaskExecutionSpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") @@ -385,22 +344,15 @@ class TaskExecutionSpecPlanStepUnionMember0(BaseModel): label: Optional[str] = None - task: Optional[TaskExecutionSpecPlanStepUnionMember0Task] = None - -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker - - -TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker -] +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): @@ -427,53 +379,9 @@ class TaskExecutionSpecPlanStepUnionMember1(BaseModel): label: Optional[str] = None - service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) - - -class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker - - -TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker -] - - -class TaskExecutionSpecPlanStepUnionMember2TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class TaskExecutionSpecPlanStepUnionMember2Task(BaseModel): - id: Optional[str] = None - - spec: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpec] = None - - -class TaskExecutionSpecPlanStepUnionMember2(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - - label: Optional[str] = None - - service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) - - task: Optional[TaskExecutionSpecPlanStepUnionMember2Task] = None - TaskExecutionSpecPlanStep: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1, TaskExecutionSpecPlanStepUnionMember2 + TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 ] diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index 19c461b8..adb1ba2e 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -2,12 +2,28 @@ from __future__ import annotations -from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["TaskUpdateParams", "Metadata", "Spec"] +__all__ = [ + "TaskUpdateParams", + "Metadata", + "MetadataDescription", + "MetadataName", + "MetadataTriggeredBy", + "MetadataTriggeredByTriggeredBy", + "MetadataTriggeredByTriggeredByTrigger", + "MetadataTriggeredByTriggeredByTriggerManual", + "MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart", + "MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart", + "Spec", + "SpecCommand", + "SpecRunsOn", + "SpecRunsOnRunsOn", + "SpecRunsOnRunsOnDocker", +] class TaskUpdateParams(TypedDict, total=False): @@ -27,9 +43,60 @@ class TaskUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Metadata: - pass +class MetadataDescription(TypedDict, total=False): + description: Required[str] -class Spec: - pass +class MetadataName(TypedDict, total=False): + name: Required[str] + + +class MetadataTriggeredByTriggeredByTriggerManual(TypedDict, total=False): + manual: Required[bool] + + +class MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart(TypedDict, total=False): + post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] + + +class MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart(TypedDict, total=False): + post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] + + +MetadataTriggeredByTriggeredByTrigger: TypeAlias = Union[ + MetadataTriggeredByTriggeredByTriggerManual, + MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart, + MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart, +] + + +class MetadataTriggeredByTriggeredBy(TypedDict, total=False): + trigger: Iterable[MetadataTriggeredByTriggeredByTrigger] + + +class MetadataTriggeredBy(TypedDict, total=False): + triggered_by: Required[Annotated[MetadataTriggeredByTriggeredBy, PropertyInfo(alias="triggeredBy")]] + + +Metadata: TypeAlias = Union[MetadataDescription, MetadataName, MetadataTriggeredBy] + + +class SpecCommand(TypedDict, total=False): + command: Required[str] + + +class SpecRunsOnRunsOnDocker(TypedDict, total=False): + environment: List[str] + + image: str + + +class SpecRunsOnRunsOn(TypedDict, total=False): + docker: Required[SpecRunsOnRunsOnDocker] + + +class SpecRunsOn(TypedDict, total=False): + runs_on: Required[Annotated[SpecRunsOnRunsOn, PropertyInfo(alias="runsOn")]] + + +Spec: TypeAlias = Union[SpecCommand, SpecRunsOn] diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_response.py b/src/gitpod/types/environments/automations/tasks/execution_list_response.py index bf26a880..8a862ecb 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_list_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_list_response.py @@ -18,23 +18,11 @@ "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", "TaskExecutionSpecPlanStepUnionMember0", - "TaskExecutionSpecPlanStepUnionMember0Task", - "TaskExecutionSpecPlanStepUnionMember0TaskSpec", - "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn", - "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker", - "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker", "TaskExecutionSpecPlanStepUnionMember1", "TaskExecutionSpecPlanStepUnionMember1Task", "TaskExecutionSpecPlanStepUnionMember1TaskSpec", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", - "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker", - "TaskExecutionSpecPlanStepUnionMember2", - "TaskExecutionSpecPlanStepUnionMember2Task", - "TaskExecutionSpecPlanStepUnionMember2TaskSpec", - "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn", - "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker", - "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -355,35 +343,6 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker - - -TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker -] - - -class TaskExecutionSpecPlanStepUnionMember0TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class TaskExecutionSpecPlanStepUnionMember0Task(BaseModel): - id: Optional[str] = None - - spec: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpec] = None - - class TaskExecutionSpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") @@ -394,22 +353,15 @@ class TaskExecutionSpecPlanStepUnionMember0(BaseModel): label: Optional[str] = None - task: Optional[TaskExecutionSpecPlanStepUnionMember0Task] = None - -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker - - -TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker -] +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): @@ -436,53 +388,9 @@ class TaskExecutionSpecPlanStepUnionMember1(BaseModel): label: Optional[str] = None - service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) - - -class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker - - -TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker -] - - -class TaskExecutionSpecPlanStepUnionMember2TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class TaskExecutionSpecPlanStepUnionMember2Task(BaseModel): - id: Optional[str] = None - - spec: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpec] = None - - -class TaskExecutionSpecPlanStepUnionMember2(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - - label: Optional[str] = None - - service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) - - task: Optional[TaskExecutionSpecPlanStepUnionMember2Task] = None - TaskExecutionSpecPlanStep: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1, TaskExecutionSpecPlanStepUnionMember2 + TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 ] diff --git a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py index 22437f91..b42c9e35 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py @@ -17,23 +17,11 @@ "TaskExecutionSpecPlan", "TaskExecutionSpecPlanStep", "TaskExecutionSpecPlanStepUnionMember0", - "TaskExecutionSpecPlanStepUnionMember0Task", - "TaskExecutionSpecPlanStepUnionMember0TaskSpec", - "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn", - "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker", - "TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker", "TaskExecutionSpecPlanStepUnionMember1", "TaskExecutionSpecPlanStepUnionMember1Task", "TaskExecutionSpecPlanStepUnionMember1TaskSpec", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", - "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker", - "TaskExecutionSpecPlanStepUnionMember2", - "TaskExecutionSpecPlanStepUnionMember2Task", - "TaskExecutionSpecPlanStepUnionMember2TaskSpec", - "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn", - "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker", - "TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker", "TaskExecutionStatus", "TaskExecutionStatusStep", ] @@ -346,35 +334,6 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDockerDocker - - -TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOnDocker -] - - -class TaskExecutionSpecPlanStepUnionMember0TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class TaskExecutionSpecPlanStepUnionMember0Task(BaseModel): - id: Optional[str] = None - - spec: Optional[TaskExecutionSpecPlanStepUnionMember0TaskSpec] = None - - class TaskExecutionSpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") @@ -385,22 +344,15 @@ class TaskExecutionSpecPlanStepUnionMember0(BaseModel): label: Optional[str] = None - task: Optional[TaskExecutionSpecPlanStepUnionMember0Task] = None - -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker(BaseModel): +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDockerDocker - - -TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker -] +class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): + docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): @@ -427,53 +379,9 @@ class TaskExecutionSpecPlanStepUnionMember1(BaseModel): label: Optional[str] = None - service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) - - -class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDockerDocker - - -TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker, TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOnDocker -] - - -class TaskExecutionSpecPlanStepUnionMember2TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class TaskExecutionSpecPlanStepUnionMember2Task(BaseModel): - id: Optional[str] = None - - spec: Optional[TaskExecutionSpecPlanStepUnionMember2TaskSpec] = None - - -class TaskExecutionSpecPlanStepUnionMember2(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - - label: Optional[str] = None - - service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) - - task: Optional[TaskExecutionSpecPlanStepUnionMember2Task] = None - TaskExecutionSpecPlanStep: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1, TaskExecutionSpecPlanStepUnionMember2 + TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 ] diff --git a/src/gitpod/types/event_watch_params.py b/src/gitpod/types/event_watch_params.py index bc1fdbbe..1303a6a3 100644 --- a/src/gitpod/types/event_watch_params.py +++ b/src/gitpod/types/event_watch_params.py @@ -7,10 +7,16 @@ from .._utils import PropertyInfo -__all__ = ["EventWatchParams", "Variant0", "Variant1", "Variant2"] +__all__ = [ + "EventWatchParams", + "EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment", + "OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued", +] -class Variant0(TypedDict, total=False): +class EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment( + TypedDict, total=False +): environment_id: Required[Annotated[str, PropertyInfo(alias="environmentId")]] """ Environment scope produces events for the environment itself, all tasks, task @@ -22,18 +28,13 @@ class Variant0(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - organization: bool - """Organization scope produces events for all projects, runners and environments - - the caller can see within their organization. No task, task execution or service - events are produed. - """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -class Variant1(TypedDict, total=False): +class OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued( + TypedDict, total=False +): organization: Required[bool] """Organization scope produces events for all projects, runners and environments @@ -44,39 +45,11 @@ class Variant1(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - """ - Environment scope produces events for the environment itself, all tasks, task - executions, - - and services associated with that environment. - """ - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - """ - Environment scope produces events for the environment itself, all tasks, task - executions, - - and services associated with that environment. - """ - - organization: bool - """Organization scope produces events for all projects, runners and environments - - the caller can see within their organization. No task, task execution or service - events are produed. - """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -EventWatchParams: TypeAlias = Union[Variant0, Variant1, Variant2] +EventWatchParams: TypeAlias = Union[ + EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment, + OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued, +] diff --git a/src/gitpod/types/organization_join_params.py b/src/gitpod/types/organization_join_params.py index cdc8f4db..40550797 100644 --- a/src/gitpod/types/organization_join_params.py +++ b/src/gitpod/types/organization_join_params.py @@ -7,49 +7,36 @@ from .._utils import PropertyInfo -__all__ = ["OrganizationJoinParams", "Variant0", "Variant1", "Variant2"] +__all__ = [ + "OrganizationJoinParams", + "InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization", + "OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin", +] -class Variant0(TypedDict, total=False): +class InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization(TypedDict, total=False): invite_id: Required[Annotated[str, PropertyInfo(alias="inviteId")]] """invite_id is the unique identifier of the invite to join the organization.""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the unique identifier of the Organization to join.""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -class Variant1(TypedDict, total=False): +class OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin(TypedDict, total=False): organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organization_id is the unique identifier of the Organization to join.""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - invite_id: Annotated[str, PropertyInfo(alias="inviteId")] - """invite_id is the unique identifier of the invite to join the organization.""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - invite_id: Annotated[str, PropertyInfo(alias="inviteId")] - """invite_id is the unique identifier of the invite to join the organization.""" - - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the unique identifier of the Organization to join.""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -OrganizationJoinParams: TypeAlias = Union[Variant0, Variant1, Variant2] +OrganizationJoinParams: TypeAlias = Union[ + InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization, + OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin, +] diff --git a/src/gitpod/types/organization_update_params.py b/src/gitpod/types/organization_update_params.py index 9cd27531..51f2345f 100644 --- a/src/gitpod/types/organization_update_params.py +++ b/src/gitpod/types/organization_update_params.py @@ -2,15 +2,24 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List, Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -__all__ = ["OrganizationUpdateParams", "Body"] +__all__ = [ + "OrganizationUpdateParams", + "InviteDomainsIsTheDomainAllowlistOfTheOrganization", + "InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains", + "NameIsTheNewNameOfTheOrganization", +] -class OrganizationUpdateParams(TypedDict, total=False): - body: Required[Body] +class InviteDomainsIsTheDomainAllowlistOfTheOrganization(TypedDict, total=False): + invite_domains: Required[ + Annotated[InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, PropertyInfo(alias="inviteDomains")] + ] + """invite_domains is the domain allowlist of the organization""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +28,22 @@ class OrganizationUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +class InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains(TypedDict, total=False): + domains: List[str] + """domains is the list of domains that are allowed to join the organization""" + + +class NameIsTheNewNameOfTheOrganization(TypedDict, total=False): + name: Required[str] + """name is the new name of the organization""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +OrganizationUpdateParams: TypeAlias = Union[ + InviteDomainsIsTheDomainAllowlistOfTheOrganization, NameIsTheNewNameOfTheOrganization +] diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py index d315b1f2..b550a136 100644 --- a/src/gitpod/types/organizations/sso_configuration_update_params.py +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -2,15 +2,24 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo -__all__ = ["SSOConfigurationUpdateParams", "Body"] +__all__ = [ + "SSOConfigurationUpdateParams", + "ClientIDIsTheClientIDOfTheSSOProvider", + "ClientSecretIsTheClientSecretOfTheSSOProvider", + "Variant2", + "IssuerURLIsTheURLOfTheIDPIssuer", + "StateIsTheStateOfTheSSOConfiguration", +] -class SSOConfigurationUpdateParams(TypedDict, total=False): - body: Required[Body] +class ClientIDIsTheClientIDOfTheSSOProvider(TypedDict, total=False): + client_id: Required[Annotated[str, PropertyInfo(alias="clientId")]] + """client_id is the client ID of the SSO provider""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +28,57 @@ class SSOConfigurationUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +class ClientSecretIsTheClientSecretOfTheSSOProvider(TypedDict, total=False): + client_secret: Required[Annotated[str, PropertyInfo(alias="clientSecret")]] + """client_secret is the client secret of the SSO provider""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + email_domain: Required[Annotated[str, PropertyInfo(alias="emailDomain")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class IssuerURLIsTheURLOfTheIDPIssuer(TypedDict, total=False): + issuer_url: Required[Annotated[str, PropertyInfo(alias="issuerUrl")]] + """issuer_url is the URL of the IdP issuer""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class StateIsTheStateOfTheSSOConfiguration(TypedDict, total=False): + state: Required[ + Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" + ] + ] + """state is the state of the SSO configuration""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +SSOConfigurationUpdateParams: TypeAlias = Union[ + ClientIDIsTheClientIDOfTheSSOProvider, + ClientSecretIsTheClientSecretOfTheSSOProvider, + Variant2, + IssuerURLIsTheURLOfTheIDPIssuer, + StateIsTheStateOfTheSSOConfiguration, +] diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py index f4f2277a..c9e9529f 100644 --- a/src/gitpod/types/project_create_from_environment_response.py +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -12,20 +12,14 @@ "ProjectCreateFromEnvironmentResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUnionMember0", - "ProjectEnvironmentClassUnionMember1", - "ProjectEnvironmentClassUnionMember2", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecUnionMember0", - "ProjectInitializerSpecUnionMember0ContextURL", - "ProjectInitializerSpecUnionMember0Git", - "ProjectInitializerSpecUnionMember1", - "ProjectInitializerSpecUnionMember1Git", - "ProjectInitializerSpecUnionMember1ContextURL", - "ProjectInitializerSpecUnionMember2", - "ProjectInitializerSpecUnionMember2ContextURL", - "ProjectInitializerSpecUnionMember2Git", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -33,84 +27,37 @@ ] -class ProjectEnvironmentClassUnionMember0(BaseModel): +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - -class ProjectEnvironmentClassUnionMember1(BaseModel): +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class ProjectEnvironmentClassUnionMember2(BaseModel): - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, ] -class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): +class ProjectInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecUnionMember0Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember0(BaseModel): - context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - git: Optional[ProjectInitializerSpecUnionMember0Git] = None - -class ProjectInitializerSpecUnionMember1Git(BaseModel): +class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -138,59 +85,11 @@ class ProjectInitializerSpecUnionMember1Git(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember1(BaseModel): - git: ProjectInitializerSpecUnionMember1Git - - context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit -class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember2Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember2(BaseModel): - context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) - - git: Optional[ProjectInitializerSpecUnionMember2Git] = None - - -ProjectInitializerSpec: TypeAlias = Union[ - ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 -] +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index c9fe81c3..708cecd0 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -10,20 +10,14 @@ __all__ = [ "ProjectCreateParams", "EnvironmentClass", - "EnvironmentClassUnionMember0", - "EnvironmentClassUnionMember1", - "EnvironmentClassUnionMember2", + "EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "EnvironmentClassUseALocalRunnerForTheUser", "Initializer", "InitializerSpec", - "InitializerSpecUnionMember0", - "InitializerSpecUnionMember0ContextURL", - "InitializerSpecUnionMember0Git", - "InitializerSpecUnionMember1", - "InitializerSpecUnionMember1Git", - "InitializerSpecUnionMember1ContextURL", - "InitializerSpecUnionMember2", - "InitializerSpecUnionMember2ContextURL", - "InitializerSpecUnionMember2Git", + "InitializerSpecContextURL", + "InitializerSpecContextURLContextURL", + "InitializerSpecGit", + "InitializerSpecGitGit", ] @@ -62,130 +56,37 @@ class ProjectCreateParams(TypedDict, total=False): """Define the timeout, in ms""" -class EnvironmentClassUnionMember0(TypedDict, total=False): +class EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + TypedDict, total=False +): environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ - local_runner: Annotated[bool, PropertyInfo(alias="localRunner")] - """Use a local runner for the user""" - -class EnvironmentClassUnionMember1(TypedDict, total=False): +class EnvironmentClassUseALocalRunnerForTheUser(TypedDict, total=False): local_runner: Required[Annotated[bool, PropertyInfo(alias="localRunner")]] """Use a local runner for the user""" - environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class EnvironmentClassUnionMember2(TypedDict, total=False): - environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - local_runner: Annotated[bool, PropertyInfo(alias="localRunner")] - """Use a local runner for the user""" - EnvironmentClass: TypeAlias = Union[ - EnvironmentClassUnionMember0, EnvironmentClassUnionMember1, EnvironmentClassUnionMember2 + EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + EnvironmentClassUseALocalRunnerForTheUser, ] -class InitializerSpecUnionMember0ContextURL(TypedDict, total=False): +class InitializerSpecContextURLContextURL(TypedDict, total=False): url: str """url is the URL from which the environment is created""" -class InitializerSpecUnionMember0Git(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class InitializerSpecUnionMember0(TypedDict, total=False): - context_url: Required[Annotated[InitializerSpecUnionMember0ContextURL, PropertyInfo(alias="contextUrl")]] +class InitializerSpecContextURL(TypedDict, total=False): + context_url: Required[Annotated[InitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] - git: InitializerSpecUnionMember0Git - -class InitializerSpecUnionMember1Git(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class InitializerSpecUnionMember1ContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - - -class InitializerSpecUnionMember1(TypedDict, total=False): - git: Required[InitializerSpecUnionMember1Git] - - context_url: Annotated[InitializerSpecUnionMember1ContextURL, PropertyInfo(alias="contextUrl")] - - -class InitializerSpecUnionMember2ContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - - -class InitializerSpecUnionMember2Git(TypedDict, total=False): +class InitializerSpecGitGit(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] """a path relative to the environment root in which the code will be checked out @@ -214,15 +115,11 @@ class InitializerSpecUnionMember2Git(TypedDict, total=False): """upstream_Remote_uri is the fork upstream of a repository""" -class InitializerSpecUnionMember2(TypedDict, total=False): - context_url: Annotated[InitializerSpecUnionMember2ContextURL, PropertyInfo(alias="contextUrl")] +class InitializerSpecGit(TypedDict, total=False): + git: Required[InitializerSpecGitGit] - git: InitializerSpecUnionMember2Git - -InitializerSpec: TypeAlias = Union[ - InitializerSpecUnionMember0, InitializerSpecUnionMember1, InitializerSpecUnionMember2 -] +InitializerSpec: TypeAlias = Union[InitializerSpecContextURL, InitializerSpecGit] class Initializer(TypedDict, total=False): diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py index 6e7065ba..96ecc716 100644 --- a/src/gitpod/types/project_create_response.py +++ b/src/gitpod/types/project_create_response.py @@ -12,20 +12,14 @@ "ProjectCreateResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUnionMember0", - "ProjectEnvironmentClassUnionMember1", - "ProjectEnvironmentClassUnionMember2", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecUnionMember0", - "ProjectInitializerSpecUnionMember0ContextURL", - "ProjectInitializerSpecUnionMember0Git", - "ProjectInitializerSpecUnionMember1", - "ProjectInitializerSpecUnionMember1Git", - "ProjectInitializerSpecUnionMember1ContextURL", - "ProjectInitializerSpecUnionMember2", - "ProjectInitializerSpecUnionMember2ContextURL", - "ProjectInitializerSpecUnionMember2Git", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -33,84 +27,37 @@ ] -class ProjectEnvironmentClassUnionMember0(BaseModel): +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - -class ProjectEnvironmentClassUnionMember1(BaseModel): +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class ProjectEnvironmentClassUnionMember2(BaseModel): - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, ] -class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): +class ProjectInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecUnionMember0Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember0(BaseModel): - context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - git: Optional[ProjectInitializerSpecUnionMember0Git] = None - -class ProjectInitializerSpecUnionMember1Git(BaseModel): +class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -138,59 +85,11 @@ class ProjectInitializerSpecUnionMember1Git(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember1(BaseModel): - git: ProjectInitializerSpecUnionMember1Git - - context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit -class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember2Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember2(BaseModel): - context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) - - git: Optional[ProjectInitializerSpecUnionMember2Git] = None - - -ProjectInitializerSpec: TypeAlias = Union[ - ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 -] +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/project_list_response.py b/src/gitpod/types/project_list_response.py index db8dffdf..da32fdb4 100644 --- a/src/gitpod/types/project_list_response.py +++ b/src/gitpod/types/project_list_response.py @@ -13,20 +13,14 @@ "Pagination", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUnionMember0", - "ProjectEnvironmentClassUnionMember1", - "ProjectEnvironmentClassUnionMember2", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecUnionMember0", - "ProjectInitializerSpecUnionMember0ContextURL", - "ProjectInitializerSpecUnionMember0Git", - "ProjectInitializerSpecUnionMember1", - "ProjectInitializerSpecUnionMember1Git", - "ProjectInitializerSpecUnionMember1ContextURL", - "ProjectInitializerSpecUnionMember2", - "ProjectInitializerSpecUnionMember2ContextURL", - "ProjectInitializerSpecUnionMember2Git", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -42,84 +36,37 @@ class Pagination(BaseModel): """ -class ProjectEnvironmentClassUnionMember0(BaseModel): +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - -class ProjectEnvironmentClassUnionMember1(BaseModel): +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class ProjectEnvironmentClassUnionMember2(BaseModel): - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, ] -class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): +class ProjectInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecUnionMember0Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember0(BaseModel): - context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - git: Optional[ProjectInitializerSpecUnionMember0Git] = None - -class ProjectInitializerSpecUnionMember1Git(BaseModel): +class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -147,59 +94,11 @@ class ProjectInitializerSpecUnionMember1Git(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember1(BaseModel): - git: ProjectInitializerSpecUnionMember1Git - - context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit -class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember2Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember2(BaseModel): - context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) - - git: Optional[ProjectInitializerSpecUnionMember2Git] = None - - -ProjectInitializerSpec: TypeAlias = Union[ - ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 -] +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py index c7a33dbd..b8c2c736 100644 --- a/src/gitpod/types/project_retrieve_response.py +++ b/src/gitpod/types/project_retrieve_response.py @@ -12,20 +12,14 @@ "ProjectRetrieveResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUnionMember0", - "ProjectEnvironmentClassUnionMember1", - "ProjectEnvironmentClassUnionMember2", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecUnionMember0", - "ProjectInitializerSpecUnionMember0ContextURL", - "ProjectInitializerSpecUnionMember0Git", - "ProjectInitializerSpecUnionMember1", - "ProjectInitializerSpecUnionMember1Git", - "ProjectInitializerSpecUnionMember1ContextURL", - "ProjectInitializerSpecUnionMember2", - "ProjectInitializerSpecUnionMember2ContextURL", - "ProjectInitializerSpecUnionMember2Git", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -33,84 +27,37 @@ ] -class ProjectEnvironmentClassUnionMember0(BaseModel): +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - -class ProjectEnvironmentClassUnionMember1(BaseModel): +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class ProjectEnvironmentClassUnionMember2(BaseModel): - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, ] -class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): +class ProjectInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecUnionMember0Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember0(BaseModel): - context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - git: Optional[ProjectInitializerSpecUnionMember0Git] = None - -class ProjectInitializerSpecUnionMember1Git(BaseModel): +class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -138,59 +85,11 @@ class ProjectInitializerSpecUnionMember1Git(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember1(BaseModel): - git: ProjectInitializerSpecUnionMember1Git - - context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit -class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember2Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember2(BaseModel): - context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) - - git: Optional[ProjectInitializerSpecUnionMember2Git] = None - - -ProjectInitializerSpec: TypeAlias = Union[ - ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 -] +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py index f5df394f..c8ac42c1 100644 --- a/src/gitpod/types/project_update_params.py +++ b/src/gitpod/types/project_update_params.py @@ -2,15 +2,165 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -__all__ = ["ProjectUpdateParams", "Body"] +__all__ = [ + "ProjectUpdateParams", + "AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot", + "DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", + "Variant2", + "Variant2EnvironmentClass", + "Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "Variant2EnvironmentClassUseALocalRunnerForTheUser", + "InitializerIsTheContentInitializer", + "InitializerIsTheContentInitializerInitializer", + "InitializerIsTheContentInitializerInitializerSpec", + "InitializerIsTheContentInitializerInitializerSpecContextURL", + "InitializerIsTheContentInitializerInitializerSpecContextURLContextURL", + "InitializerIsTheContentInitializerInitializerSpecGit", + "InitializerIsTheContentInitializerInitializerSpecGitGit", + "Variant4", +] -class ProjectUpdateParams(TypedDict, total=False): - body: Required[Body] +class AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot(TypedDict, total=False): + automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] + """ + automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot(TypedDict, total=False): + devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + environment_class: Required[Annotated[Variant2EnvironmentClass, PropertyInfo(alias="environmentClass")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + TypedDict, total=False +): + environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + +class Variant2EnvironmentClassUseALocalRunnerForTheUser(TypedDict, total=False): + local_runner: Required[Annotated[bool, PropertyInfo(alias="localRunner")]] + """Use a local runner for the user""" + + +Variant2EnvironmentClass: TypeAlias = Union[ + Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + Variant2EnvironmentClassUseALocalRunnerForTheUser, +] + + +class InitializerIsTheContentInitializer(TypedDict, total=False): + initializer: Required[InitializerIsTheContentInitializerInitializer] + """EnvironmentInitializer specifies how an environment is to be initialized""" + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class InitializerIsTheContentInitializerInitializerSpecContextURLContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class InitializerIsTheContentInitializerInitializerSpecContextURL(TypedDict, total=False): + context_url: Required[ + Annotated[ + InitializerIsTheContentInitializerInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl") + ] + ] + + +class InitializerIsTheContentInitializerInitializerSpecGitGit(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """a path relative to the environment root in which the code will be checked out + + to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class InitializerIsTheContentInitializerInitializerSpecGit(TypedDict, total=False): + git: Required[InitializerIsTheContentInitializerInitializerSpecGitGit] + + +InitializerIsTheContentInitializerInitializerSpec: TypeAlias = Union[ + InitializerIsTheContentInitializerInitializerSpecContextURL, InitializerIsTheContentInitializerInitializerSpecGit +] + + +class InitializerIsTheContentInitializerInitializer(TypedDict, total=False): + specs: Iterable[InitializerIsTheContentInitializerInitializerSpec] + + +class Variant4(TypedDict, total=False): + name: Required[str] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +169,10 @@ class ProjectUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +ProjectUpdateParams: TypeAlias = Union[ + AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot, + DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, + Variant2, + InitializerIsTheContentInitializer, + Variant4, +] diff --git a/src/gitpod/types/project_update_response.py b/src/gitpod/types/project_update_response.py index b4130475..f90b85b6 100644 --- a/src/gitpod/types/project_update_response.py +++ b/src/gitpod/types/project_update_response.py @@ -12,20 +12,14 @@ "ProjectUpdateResponse", "Project", "ProjectEnvironmentClass", - "ProjectEnvironmentClassUnionMember0", - "ProjectEnvironmentClassUnionMember1", - "ProjectEnvironmentClassUnionMember2", + "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "ProjectEnvironmentClassUseALocalRunnerForTheUser", "ProjectInitializer", "ProjectInitializerSpec", - "ProjectInitializerSpecUnionMember0", - "ProjectInitializerSpecUnionMember0ContextURL", - "ProjectInitializerSpecUnionMember0Git", - "ProjectInitializerSpecUnionMember1", - "ProjectInitializerSpecUnionMember1Git", - "ProjectInitializerSpecUnionMember1ContextURL", - "ProjectInitializerSpecUnionMember2", - "ProjectInitializerSpecUnionMember2ContextURL", - "ProjectInitializerSpecUnionMember2Git", + "ProjectInitializerSpecContextURL", + "ProjectInitializerSpecContextURLContextURL", + "ProjectInitializerSpecGit", + "ProjectInitializerSpecGitGit", "ProjectMetadata", "ProjectMetadataCreator", "ProjectUsedBy", @@ -33,84 +27,37 @@ ] -class ProjectEnvironmentClassUnionMember0(BaseModel): +class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( + BaseModel +): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. """ - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - -class ProjectEnvironmentClassUnionMember1(BaseModel): +class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class ProjectEnvironmentClassUnionMember2(BaseModel): - environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) - """Use a local runner for the user""" - ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUnionMember0, ProjectEnvironmentClassUnionMember1, ProjectEnvironmentClassUnionMember2 + ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + ProjectEnvironmentClassUseALocalRunnerForTheUser, ] -class ProjectInitializerSpecUnionMember0ContextURL(BaseModel): +class ProjectInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecUnionMember0Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember0(BaseModel): - context_url: ProjectInitializerSpecUnionMember0ContextURL = FieldInfo(alias="contextUrl") +class ProjectInitializerSpecContextURL(BaseModel): + context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - git: Optional[ProjectInitializerSpecUnionMember0Git] = None - -class ProjectInitializerSpecUnionMember1Git(BaseModel): +class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """a path relative to the environment root in which the code will be checked out @@ -138,59 +85,11 @@ class ProjectInitializerSpecUnionMember1Git(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecUnionMember1ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember1(BaseModel): - git: ProjectInitializerSpecUnionMember1Git - - context_url: Optional[ProjectInitializerSpecUnionMember1ContextURL] = FieldInfo(alias="contextUrl", default=None) +class ProjectInitializerSpecGit(BaseModel): + git: ProjectInitializerSpecGitGit -class ProjectInitializerSpecUnionMember2ContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecUnionMember2Git(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecUnionMember2(BaseModel): - context_url: Optional[ProjectInitializerSpecUnionMember2ContextURL] = FieldInfo(alias="contextUrl", default=None) - - git: Optional[ProjectInitializerSpecUnionMember2Git] = None - - -ProjectInitializerSpec: TypeAlias = Union[ - ProjectInitializerSpecUnionMember0, ProjectInitializerSpecUnionMember1, ProjectInitializerSpecUnionMember2 -] +ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] class ProjectInitializer(BaseModel): diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index 662314ee..28bcc60a 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -2,15 +2,27 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -__all__ = ["RunnerUpdateParams", "Body"] +__all__ = [ + "RunnerUpdateParams", + "TheRunnerSNameWhichIsShownToUsers", + "Variant1", + "Variant1Spec", + "Variant1SpecConfiguration", + "Variant1SpecConfigurationConfiguration", + "Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself", + "Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn", + "Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners", +] -class RunnerUpdateParams(TypedDict, total=False): - body: Required[Body] +class TheRunnerSNameWhichIsShownToUsers(TypedDict, total=False): + name: Required[str] + """The runner's name which is shown to users""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +31,68 @@ class RunnerUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +class Variant1(TypedDict, total=False): + spec: Required[Variant1Spec] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself( + TypedDict, total=False +): + auto_update: Required[Annotated[bool, PropertyInfo(alias="autoUpdate")]] + """auto_update indicates whether the runner should automatically update itself.""" + + +class Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn(TypedDict, total=False): + release_channel: Required[ + Annotated[ + Literal[ + "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST" + ], + PropertyInfo(alias="releaseChannel"), + ] + ] + """The release channel the runner is on""" + + +Variant1SpecConfigurationConfiguration: TypeAlias = Union[ + Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself, + Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn, +] + + +class Variant1SpecConfiguration(TypedDict, total=False): + configuration: Required[Variant1SpecConfigurationConfiguration] + + +class Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners( + TypedDict, total=False +): + desired_phase: Required[ + Annotated[ + Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", + ], + PropertyInfo(alias="desiredPhase"), + ] + ] + """RunnerPhase represents the phase a runner is in""" + + +Variant1Spec: TypeAlias = Union[ + Variant1SpecConfiguration, + Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners, +] + +RunnerUpdateParams: TypeAlias = Union[TheRunnerSNameWhichIsShownToUsers, Variant1] diff --git a/src/gitpod/types/runners/configuration_validate_params.py b/src/gitpod/types/runners/configuration_validate_params.py index 5a418301..03cc3565 100644 --- a/src/gitpod/types/runners/configuration_validate_params.py +++ b/src/gitpod/types/runners/configuration_validate_params.py @@ -5,22 +5,20 @@ from typing import Union, Iterable from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from ..._types import Base64FileInput from ..._utils import PropertyInfo +from ..._models import set_pydantic_config __all__ = [ "ConfigurationValidateParams", "Variant0", "Variant0EnvironmentClass", "Variant0EnvironmentClassConfiguration", - "Variant0ScmIntegration", "Variant1", "Variant1ScmIntegration", - "Variant1EnvironmentClass", - "Variant1EnvironmentClassConfiguration", - "Variant2", - "Variant2EnvironmentClass", - "Variant2EnvironmentClassConfiguration", - "Variant2ScmIntegration", + "Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet", + "Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration", + "Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner", ] @@ -32,8 +30,6 @@ class Variant0(TypedDict, total=False): runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - scm_integration: Annotated[Variant0ScmIntegration, PropertyInfo(alias="scmIntegration")] - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" @@ -70,108 +66,67 @@ class Variant0EnvironmentClass(TypedDict, total=False): """ -class Variant0ScmIntegration: - pass - - class Variant1(TypedDict, total=False): scm_integration: Required[Annotated[Variant1ScmIntegration, PropertyInfo(alias="scmIntegration")]] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - environment_class: Annotated[Variant1EnvironmentClass, PropertyInfo(alias="environmentClass")] - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" -class Variant1ScmIntegration: - pass - - -class Variant1EnvironmentClassConfiguration(TypedDict, total=False): - key: str - - value: str - - -class Variant1EnvironmentClass(TypedDict, total=False): - id: str - """id is the unique identifier of the environment class""" - - configuration: Iterable[Variant1EnvironmentClassConfiguration] - """configuration describes the configuration of the environment class""" - - description: str - """description is a human readable description of the environment class""" +class Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet( + TypedDict, total=False +): + oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] + """oauth_client_id is the OAuth app's client ID, if OAuth is configured. - display_name: Annotated[str, PropertyInfo(alias="displayName")] - """display_name is the human readable name of the environment class""" + If configured, oauth_client_secret must also be set. + """ - enabled: bool - """enabled indicates whether the environment class can be used to create - new environments. +class Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration( + TypedDict, total=False +): + oauth_encrypted_client_secret: Required[ + Annotated[Union[str, Base64FileInput], PropertyInfo(alias="oauthEncryptedClientSecret", format="base64")] + ] """ + oauth_encrypted_client_secret is the OAuth app's client secret encrypted with + the runner's public key, - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """ - runner_id is the unique identifier of the runner the environment class belongs - to + if OAuth is configured. This can be used to e.g. validate an already encrypted + client secret of an existing SCM integration. """ -class Variant2(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" +set_pydantic_config( + Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration, + {"arbitrary_types_allowed": True}, +) - environment_class: Annotated[Variant2EnvironmentClass, PropertyInfo(alias="environmentClass")] - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - scm_integration: Annotated[Variant2ScmIntegration, PropertyInfo(alias="scmIntegration")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2EnvironmentClassConfiguration(TypedDict, total=False): - key: str - - value: str - - -class Variant2EnvironmentClass(TypedDict, total=False): - id: str - """id is the unique identifier of the environment class""" - - configuration: Iterable[Variant2EnvironmentClassConfiguration] - """configuration describes the configuration of the environment class""" - - description: str - """description is a human readable description of the environment class""" - - display_name: Annotated[str, PropertyInfo(alias="displayName")] - """display_name is the human readable name of the environment class""" - - enabled: bool - """enabled indicates whether the environment class can be used to create - - new environments. +class Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner( + TypedDict, total=False +): + oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] """ + oauth_plaintext_client_secret is the OAuth app's client secret in clear text, if + OAuth is configured. - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + This can be set to validate any new client secret before it is encrypted and + stored. This value will not be stored and get encrypted with the runner's public + key before passing it to the runner. """ - runner_id is the unique identifier of the runner the environment class belongs - to - """ - -class Variant2ScmIntegration: - pass +Variant1ScmIntegration: TypeAlias = Union[ + Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet, + Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration, + Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner, +] -ConfigurationValidateParams: TypeAlias = Union[Variant0, Variant1, Variant2] +ConfigurationValidateParams: TypeAlias = Union[Variant0, Variant1] diff --git a/src/gitpod/types/runners/configuration_validate_response.py b/src/gitpod/types/runners/configuration_validate_response.py index 0e4d9185..a16f6873 100644 --- a/src/gitpod/types/runners/configuration_validate_response.py +++ b/src/gitpod/types/runners/configuration_validate_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Union from typing_extensions import TypeAlias from pydantic import Field as FieldInfo @@ -9,58 +9,62 @@ __all__ = [ "ConfigurationValidateResponse", - "UnionMember0", - "UnionMember0EnvironmentClass", - "UnionMember0ScmIntegration", - "UnionMember1", - "UnionMember1ScmIntegration", - "UnionMember1EnvironmentClass", - "UnionMember2", - "UnionMember2EnvironmentClass", - "UnionMember2ScmIntegration", + "EnvironmentClass", + "EnvironmentClassEnvironmentClass", + "EnvironmentClassEnvironmentClassDescriptionError", + "EnvironmentClassEnvironmentClassDisplayNameError", + "ScmIntegration", + "ScmIntegrationScmIntegration", + "ScmIntegrationScmIntegrationHostError", + "ScmIntegrationScmIntegrationOAuthError", + "ScmIntegrationScmIntegrationPatError", + "ScmIntegrationScmIntegrationScmIDError", ] -class UnionMember0EnvironmentClass: - pass +class EnvironmentClassEnvironmentClassDescriptionError(BaseModel): + description_error: str = FieldInfo(alias="descriptionError") -class UnionMember0ScmIntegration: - pass +class EnvironmentClassEnvironmentClassDisplayNameError(BaseModel): + display_name_error: str = FieldInfo(alias="displayNameError") -class UnionMember0(BaseModel): - environment_class: UnionMember0EnvironmentClass = FieldInfo(alias="environmentClass") - - scm_integration: Optional[UnionMember0ScmIntegration] = FieldInfo(alias="scmIntegration", default=None) +EnvironmentClassEnvironmentClass: TypeAlias = Union[ + EnvironmentClassEnvironmentClassDescriptionError, EnvironmentClassEnvironmentClassDisplayNameError +] -class UnionMember1ScmIntegration: - pass +class EnvironmentClass(BaseModel): + environment_class: EnvironmentClassEnvironmentClass = FieldInfo(alias="environmentClass") -class UnionMember1EnvironmentClass: - pass +class ScmIntegrationScmIntegrationHostError(BaseModel): + host_error: str = FieldInfo(alias="hostError") -class UnionMember1(BaseModel): - scm_integration: UnionMember1ScmIntegration = FieldInfo(alias="scmIntegration") +class ScmIntegrationScmIntegrationOAuthError(BaseModel): + oauth_error: str = FieldInfo(alias="oauthError") - environment_class: Optional[UnionMember1EnvironmentClass] = FieldInfo(alias="environmentClass", default=None) +class ScmIntegrationScmIntegrationPatError(BaseModel): + pat_error: str = FieldInfo(alias="patError") -class UnionMember2EnvironmentClass: - pass +class ScmIntegrationScmIntegrationScmIDError(BaseModel): + scm_id_error: str = FieldInfo(alias="scmIdError") -class UnionMember2ScmIntegration: - pass +ScmIntegrationScmIntegration: TypeAlias = Union[ + ScmIntegrationScmIntegrationHostError, + ScmIntegrationScmIntegrationOAuthError, + ScmIntegrationScmIntegrationPatError, + ScmIntegrationScmIntegrationScmIDError, +] -class UnionMember2(BaseModel): - environment_class: Optional[UnionMember2EnvironmentClass] = FieldInfo(alias="environmentClass", default=None) - scm_integration: Optional[UnionMember2ScmIntegration] = FieldInfo(alias="scmIntegration", default=None) +class ScmIntegration(BaseModel): + scm_integration: ScmIntegrationScmIntegration = FieldInfo(alias="scmIntegration") -ConfigurationValidateResponse: TypeAlias = Union[UnionMember0, UnionMember1, UnionMember2] +ConfigurationValidateResponse: TypeAlias = Union[EnvironmentClass, ScmIntegration] diff --git a/src/gitpod/types/runners/configurations/environment_class_update_params.py b/src/gitpod/types/runners/configurations/environment_class_update_params.py index 23004279..7bcfd5fb 100644 --- a/src/gitpod/types/runners/configurations/environment_class_update_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_update_params.py @@ -2,15 +2,16 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["EnvironmentClassUpdateParams", "Body"] +__all__ = ["EnvironmentClassUpdateParams", "Variant0", "Variant1", "Variant2"] -class EnvironmentClassUpdateParams(TypedDict, total=False): - body: Required[Body] +class Variant0(TypedDict, total=False): + description: Required[str] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +20,24 @@ class EnvironmentClassUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +class Variant1(TypedDict, total=False): + display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + enabled: Required[bool] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +EnvironmentClassUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py index 2abc362b..9979ef22 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py @@ -2,15 +2,127 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenUpdateParams", "Body"] +__all__ = ["HostAuthenticationTokenUpdateParams", "Variant0", "Variant1", "Variant2"] -class HostAuthenticationTokenUpdateParams(TypedDict, total=False): - body: Required[Body] +class Variant0(TypedDict, total=False): + expires_at: Required[Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")]] + """A Timestamp represents a point in time independent of any time zone or local + + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant1(TypedDict, total=False): + refresh_token: Required[Annotated[str, PropertyInfo(alias="refreshToken")]] + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class Variant2(TypedDict, total=False): + token: Required[str] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +131,4 @@ class HostAuthenticationTokenUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +HostAuthenticationTokenUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/runners/configurations/schema_retrieve_response.py b/src/gitpod/types/runners/configurations/schema_retrieve_response.py index bd3a4e7b..8ebcad63 100644 --- a/src/gitpod/types/runners/configurations/schema_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/schema_retrieve_response.py @@ -14,77 +14,25 @@ "SchemaEnvironmentClass", "SchemaEnvironmentClassUnionMember0", "SchemaEnvironmentClassUnionMember0Bool", - "SchemaEnvironmentClassUnionMember0Display", - "SchemaEnvironmentClassUnionMember0Enum", - "SchemaEnvironmentClassUnionMember0Int", - "SchemaEnvironmentClassUnionMember0String", "SchemaEnvironmentClassUnionMember1", "SchemaEnvironmentClassUnionMember1Display", - "SchemaEnvironmentClassUnionMember1Bool", - "SchemaEnvironmentClassUnionMember1Enum", - "SchemaEnvironmentClassUnionMember1Int", - "SchemaEnvironmentClassUnionMember1String", "SchemaEnvironmentClassUnionMember2", "SchemaEnvironmentClassUnionMember2Enum", - "SchemaEnvironmentClassUnionMember2Bool", - "SchemaEnvironmentClassUnionMember2Display", - "SchemaEnvironmentClassUnionMember2Int", - "SchemaEnvironmentClassUnionMember2String", "SchemaEnvironmentClassUnionMember3", "SchemaEnvironmentClassUnionMember3Int", - "SchemaEnvironmentClassUnionMember3Bool", - "SchemaEnvironmentClassUnionMember3Display", - "SchemaEnvironmentClassUnionMember3Enum", - "SchemaEnvironmentClassUnionMember3String", "SchemaEnvironmentClassUnionMember4", "SchemaEnvironmentClassUnionMember4String", - "SchemaEnvironmentClassUnionMember4Bool", - "SchemaEnvironmentClassUnionMember4Display", - "SchemaEnvironmentClassUnionMember4Enum", - "SchemaEnvironmentClassUnionMember4Int", - "SchemaEnvironmentClassUnionMember5", - "SchemaEnvironmentClassUnionMember5Bool", - "SchemaEnvironmentClassUnionMember5Display", - "SchemaEnvironmentClassUnionMember5Enum", - "SchemaEnvironmentClassUnionMember5Int", - "SchemaEnvironmentClassUnionMember5String", "SchemaRunnerConfig", "SchemaRunnerConfigUnionMember0", "SchemaRunnerConfigUnionMember0Bool", - "SchemaRunnerConfigUnionMember0Display", - "SchemaRunnerConfigUnionMember0Enum", - "SchemaRunnerConfigUnionMember0Int", - "SchemaRunnerConfigUnionMember0String", "SchemaRunnerConfigUnionMember1", "SchemaRunnerConfigUnionMember1Display", - "SchemaRunnerConfigUnionMember1Bool", - "SchemaRunnerConfigUnionMember1Enum", - "SchemaRunnerConfigUnionMember1Int", - "SchemaRunnerConfigUnionMember1String", "SchemaRunnerConfigUnionMember2", "SchemaRunnerConfigUnionMember2Enum", - "SchemaRunnerConfigUnionMember2Bool", - "SchemaRunnerConfigUnionMember2Display", - "SchemaRunnerConfigUnionMember2Int", - "SchemaRunnerConfigUnionMember2String", "SchemaRunnerConfigUnionMember3", "SchemaRunnerConfigUnionMember3Int", - "SchemaRunnerConfigUnionMember3Bool", - "SchemaRunnerConfigUnionMember3Display", - "SchemaRunnerConfigUnionMember3Enum", - "SchemaRunnerConfigUnionMember3String", "SchemaRunnerConfigUnionMember4", "SchemaRunnerConfigUnionMember4String", - "SchemaRunnerConfigUnionMember4Bool", - "SchemaRunnerConfigUnionMember4Display", - "SchemaRunnerConfigUnionMember4Enum", - "SchemaRunnerConfigUnionMember4Int", - "SchemaRunnerConfigUnionMember5", - "SchemaRunnerConfigUnionMember5Bool", - "SchemaRunnerConfigUnionMember5Display", - "SchemaRunnerConfigUnionMember5Enum", - "SchemaRunnerConfigUnionMember5Int", - "SchemaRunnerConfigUnionMember5String", "SchemaScm", "SchemaScmOAuth", "SchemaScmPat", @@ -95,30 +43,6 @@ class SchemaEnvironmentClassUnionMember0Bool(BaseModel): default: Optional[bool] = None -class SchemaEnvironmentClassUnionMember0Display(BaseModel): - default: Optional[str] = None - - -class SchemaEnvironmentClassUnionMember0Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaEnvironmentClassUnionMember0Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaEnvironmentClassUnionMember0String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - class SchemaEnvironmentClassUnionMember0(BaseModel): bool: SchemaEnvironmentClassUnionMember0Bool @@ -126,69 +50,29 @@ class SchemaEnvironmentClassUnionMember0(BaseModel): description: Optional[str] = None - display: Optional[SchemaEnvironmentClassUnionMember0Display] = None - - enum: Optional[SchemaEnvironmentClassUnionMember0Enum] = None - - int: Optional[SchemaEnvironmentClassUnionMember0Int] = None - name: Optional[str] = None required: Optional[builtins.bool] = None secret: Optional[builtins.bool] = None - string: Optional[SchemaEnvironmentClassUnionMember0String] = None - class SchemaEnvironmentClassUnionMember1Display(BaseModel): default: Optional[str] = None -class SchemaEnvironmentClassUnionMember1Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaEnvironmentClassUnionMember1Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaEnvironmentClassUnionMember1Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaEnvironmentClassUnionMember1String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - class SchemaEnvironmentClassUnionMember1(BaseModel): display: SchemaEnvironmentClassUnionMember1Display id: Optional[str] = None - bool: Optional[SchemaEnvironmentClassUnionMember1Bool] = None - description: Optional[str] = None - enum: Optional[SchemaEnvironmentClassUnionMember1Enum] = None - - int: Optional[SchemaEnvironmentClassUnionMember1Int] = None - name: Optional[str] = None - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None + required: Optional[bool] = None - string: Optional[SchemaEnvironmentClassUnionMember1String] = None + secret: Optional[bool] = None class SchemaEnvironmentClassUnionMember2Enum(BaseModel): @@ -197,48 +81,18 @@ class SchemaEnvironmentClassUnionMember2Enum(BaseModel): values: Optional[List[str]] = None -class SchemaEnvironmentClassUnionMember2Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaEnvironmentClassUnionMember2Display(BaseModel): - default: Optional[str] = None - - -class SchemaEnvironmentClassUnionMember2Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaEnvironmentClassUnionMember2String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - class SchemaEnvironmentClassUnionMember2(BaseModel): enum: SchemaEnvironmentClassUnionMember2Enum id: Optional[str] = None - bool: Optional[SchemaEnvironmentClassUnionMember2Bool] = None - description: Optional[str] = None - display: Optional[SchemaEnvironmentClassUnionMember2Display] = None - - int: Optional[SchemaEnvironmentClassUnionMember2Int] = None - name: Optional[str] = None - required: Optional[builtins.bool] = None + required: Optional[bool] = None - secret: Optional[builtins.bool] = None - - string: Optional[SchemaEnvironmentClassUnionMember2String] = None + secret: Optional[bool] = None class SchemaEnvironmentClassUnionMember3Int(BaseModel): @@ -249,46 +103,18 @@ class SchemaEnvironmentClassUnionMember3Int(BaseModel): min: Optional[int] = None -class SchemaEnvironmentClassUnionMember3Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaEnvironmentClassUnionMember3Display(BaseModel): - default: Optional[str] = None - - -class SchemaEnvironmentClassUnionMember3Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaEnvironmentClassUnionMember3String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - class SchemaEnvironmentClassUnionMember3(BaseModel): int: SchemaEnvironmentClassUnionMember3Int id: Optional[str] = None - bool: Optional[SchemaEnvironmentClassUnionMember3Bool] = None - description: Optional[str] = None - display: Optional[SchemaEnvironmentClassUnionMember3Display] = None - - enum: Optional[SchemaEnvironmentClassUnionMember3Enum] = None - name: Optional[str] = None - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None + required: Optional[bool] = None - string: Optional[SchemaEnvironmentClassUnionMember3String] = None + secret: Optional[bool] = None class SchemaEnvironmentClassUnionMember4String(BaseModel): @@ -297,98 +123,18 @@ class SchemaEnvironmentClassUnionMember4String(BaseModel): pattern: Optional[str] = None -class SchemaEnvironmentClassUnionMember4Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaEnvironmentClassUnionMember4Display(BaseModel): - default: Optional[str] = None - - -class SchemaEnvironmentClassUnionMember4Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaEnvironmentClassUnionMember4Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - class SchemaEnvironmentClassUnionMember4(BaseModel): string: SchemaEnvironmentClassUnionMember4String id: Optional[str] = None - bool: Optional[SchemaEnvironmentClassUnionMember4Bool] = None - description: Optional[str] = None - display: Optional[SchemaEnvironmentClassUnionMember4Display] = None - - enum: Optional[SchemaEnvironmentClassUnionMember4Enum] = None - - int: Optional[SchemaEnvironmentClassUnionMember4Int] = None - name: Optional[str] = None - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None - - -class SchemaEnvironmentClassUnionMember5Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaEnvironmentClassUnionMember5Display(BaseModel): - default: Optional[str] = None - - -class SchemaEnvironmentClassUnionMember5Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaEnvironmentClassUnionMember5Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaEnvironmentClassUnionMember5String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - -class SchemaEnvironmentClassUnionMember5(BaseModel): - id: Optional[str] = None - - bool: Optional[SchemaEnvironmentClassUnionMember5Bool] = None - - description: Optional[str] = None - - display: Optional[SchemaEnvironmentClassUnionMember5Display] = None - - enum: Optional[SchemaEnvironmentClassUnionMember5Enum] = None - - int: Optional[SchemaEnvironmentClassUnionMember5Int] = None - - name: Optional[str] = None - - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None + required: Optional[bool] = None - string: Optional[SchemaEnvironmentClassUnionMember5String] = None + secret: Optional[bool] = None SchemaEnvironmentClass: TypeAlias = Union[ @@ -397,7 +143,6 @@ class SchemaEnvironmentClassUnionMember5(BaseModel): SchemaEnvironmentClassUnionMember2, SchemaEnvironmentClassUnionMember3, SchemaEnvironmentClassUnionMember4, - SchemaEnvironmentClassUnionMember5, ] @@ -405,30 +150,6 @@ class SchemaRunnerConfigUnionMember0Bool(BaseModel): default: Optional[bool] = None -class SchemaRunnerConfigUnionMember0Display(BaseModel): - default: Optional[str] = None - - -class SchemaRunnerConfigUnionMember0Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaRunnerConfigUnionMember0Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaRunnerConfigUnionMember0String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - class SchemaRunnerConfigUnionMember0(BaseModel): bool: SchemaRunnerConfigUnionMember0Bool @@ -436,69 +157,29 @@ class SchemaRunnerConfigUnionMember0(BaseModel): description: Optional[str] = None - display: Optional[SchemaRunnerConfigUnionMember0Display] = None - - enum: Optional[SchemaRunnerConfigUnionMember0Enum] = None - - int: Optional[SchemaRunnerConfigUnionMember0Int] = None - name: Optional[str] = None required: Optional[builtins.bool] = None secret: Optional[builtins.bool] = None - string: Optional[SchemaRunnerConfigUnionMember0String] = None - class SchemaRunnerConfigUnionMember1Display(BaseModel): default: Optional[str] = None -class SchemaRunnerConfigUnionMember1Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaRunnerConfigUnionMember1Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaRunnerConfigUnionMember1Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaRunnerConfigUnionMember1String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - class SchemaRunnerConfigUnionMember1(BaseModel): display: SchemaRunnerConfigUnionMember1Display id: Optional[str] = None - bool: Optional[SchemaRunnerConfigUnionMember1Bool] = None - description: Optional[str] = None - enum: Optional[SchemaRunnerConfigUnionMember1Enum] = None - - int: Optional[SchemaRunnerConfigUnionMember1Int] = None - name: Optional[str] = None - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None + required: Optional[bool] = None - string: Optional[SchemaRunnerConfigUnionMember1String] = None + secret: Optional[bool] = None class SchemaRunnerConfigUnionMember2Enum(BaseModel): @@ -507,48 +188,18 @@ class SchemaRunnerConfigUnionMember2Enum(BaseModel): values: Optional[List[str]] = None -class SchemaRunnerConfigUnionMember2Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaRunnerConfigUnionMember2Display(BaseModel): - default: Optional[str] = None - - -class SchemaRunnerConfigUnionMember2Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaRunnerConfigUnionMember2String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - class SchemaRunnerConfigUnionMember2(BaseModel): enum: SchemaRunnerConfigUnionMember2Enum id: Optional[str] = None - bool: Optional[SchemaRunnerConfigUnionMember2Bool] = None - description: Optional[str] = None - display: Optional[SchemaRunnerConfigUnionMember2Display] = None - - int: Optional[SchemaRunnerConfigUnionMember2Int] = None - name: Optional[str] = None - required: Optional[builtins.bool] = None + required: Optional[bool] = None - secret: Optional[builtins.bool] = None - - string: Optional[SchemaRunnerConfigUnionMember2String] = None + secret: Optional[bool] = None class SchemaRunnerConfigUnionMember3Int(BaseModel): @@ -559,46 +210,18 @@ class SchemaRunnerConfigUnionMember3Int(BaseModel): min: Optional[int] = None -class SchemaRunnerConfigUnionMember3Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaRunnerConfigUnionMember3Display(BaseModel): - default: Optional[str] = None - - -class SchemaRunnerConfigUnionMember3Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaRunnerConfigUnionMember3String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - class SchemaRunnerConfigUnionMember3(BaseModel): int: SchemaRunnerConfigUnionMember3Int id: Optional[str] = None - bool: Optional[SchemaRunnerConfigUnionMember3Bool] = None - description: Optional[str] = None - display: Optional[SchemaRunnerConfigUnionMember3Display] = None - - enum: Optional[SchemaRunnerConfigUnionMember3Enum] = None - name: Optional[str] = None - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None + required: Optional[bool] = None - string: Optional[SchemaRunnerConfigUnionMember3String] = None + secret: Optional[bool] = None class SchemaRunnerConfigUnionMember4String(BaseModel): @@ -607,98 +230,18 @@ class SchemaRunnerConfigUnionMember4String(BaseModel): pattern: Optional[str] = None -class SchemaRunnerConfigUnionMember4Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaRunnerConfigUnionMember4Display(BaseModel): - default: Optional[str] = None - - -class SchemaRunnerConfigUnionMember4Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaRunnerConfigUnionMember4Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - class SchemaRunnerConfigUnionMember4(BaseModel): string: SchemaRunnerConfigUnionMember4String id: Optional[str] = None - bool: Optional[SchemaRunnerConfigUnionMember4Bool] = None - description: Optional[str] = None - display: Optional[SchemaRunnerConfigUnionMember4Display] = None - - enum: Optional[SchemaRunnerConfigUnionMember4Enum] = None - - int: Optional[SchemaRunnerConfigUnionMember4Int] = None - name: Optional[str] = None - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None - - -class SchemaRunnerConfigUnionMember5Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaRunnerConfigUnionMember5Display(BaseModel): - default: Optional[str] = None - - -class SchemaRunnerConfigUnionMember5Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaRunnerConfigUnionMember5Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaRunnerConfigUnionMember5String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - -class SchemaRunnerConfigUnionMember5(BaseModel): - id: Optional[str] = None - - bool: Optional[SchemaRunnerConfigUnionMember5Bool] = None - - description: Optional[str] = None - - display: Optional[SchemaRunnerConfigUnionMember5Display] = None - - enum: Optional[SchemaRunnerConfigUnionMember5Enum] = None - - int: Optional[SchemaRunnerConfigUnionMember5Int] = None - - name: Optional[str] = None - - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None + required: Optional[bool] = None - string: Optional[SchemaRunnerConfigUnionMember5String] = None + secret: Optional[bool] = None SchemaRunnerConfig: TypeAlias = Union[ @@ -707,7 +250,6 @@ class SchemaRunnerConfigUnionMember5(BaseModel): SchemaRunnerConfigUnionMember2, SchemaRunnerConfigUnionMember3, SchemaRunnerConfigUnionMember4, - SchemaRunnerConfigUnionMember5, ] diff --git a/src/gitpod/types/runners/configurations/scm_integration_create_params.py b/src/gitpod/types/runners/configurations/scm_integration_create_params.py index 4640545e..fad0a6b8 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_create_params.py @@ -2,15 +2,42 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["ScmIntegrationCreateParams", "Body"] +__all__ = [ + "ScmIntegrationCreateParams", + "OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet", + "OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored", +] -class ScmIntegrationCreateParams(TypedDict, total=False): - body: Required[Body] +class OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet( + TypedDict, total=False +): + oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] + """oauth_client_id is the OAuth app's client ID, if OAuth is configured. + + If configured, oauth_plaintext_client_secret must also be set. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( + TypedDict, total=False +): + oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + """oauth_plaintext_client_secret is the OAuth app's client secret in clear text. + + This will first be encrypted with the runner's public key before being stored. + """ connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +46,7 @@ class ScmIntegrationCreateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +ScmIntegrationCreateParams: TypeAlias = Union[ + OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet, + OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored, +] diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_response.py b/src/gitpod/types/runners/configurations/scm_integration_list_response.py index 0840c28e..7b1fc5e7 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_list_response.py +++ b/src/gitpod/types/runners/configurations/scm_integration_list_response.py @@ -1,24 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from typing_extensions import TypeAlias +from typing import List, Optional from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = [ - "ScmIntegrationListResponse", - "Integration", - "IntegrationUnionMember0", - "IntegrationUnionMember0OAuth", - "IntegrationUnionMember1", - "IntegrationUnionMember1OAuth", - "Pagination", -] +__all__ = ["ScmIntegrationListResponse", "Integration", "IntegrationOAuth", "Pagination"] -class IntegrationUnionMember0OAuth(BaseModel): +class IntegrationOAuth(BaseModel): client_id: Optional[str] = FieldInfo(alias="clientId", default=None) """client_id is the OAuth app's client ID in clear text.""" @@ -29,8 +20,8 @@ class IntegrationUnionMember0OAuth(BaseModel): """ -class IntegrationUnionMember0(BaseModel): - oauth: IntegrationUnionMember0OAuth +class Integration(BaseModel): + oauth: IntegrationOAuth id: Optional[str] = None """id is the unique identifier of the SCM integration""" @@ -48,39 +39,6 @@ class IntegrationUnionMember0(BaseModel): """ -class IntegrationUnionMember1OAuth(BaseModel): - client_id: Optional[str] = FieldInfo(alias="clientId", default=None) - """client_id is the OAuth app's client ID in clear text.""" - - encrypted_client_secret: Optional[str] = FieldInfo(alias="encryptedClientSecret", default=None) - """ - encrypted_client_secret is the OAuth app's secret encrypted with the runner's - public key. - """ - - -class IntegrationUnionMember1(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the SCM integration""" - - host: Optional[str] = None - - oauth: Optional[IntegrationUnionMember1OAuth] = None - - pat: Optional[bool] = None - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) - """ - scm_id references the scm_id in the runner's configuration schema that this - integration is for - """ - - -Integration: TypeAlias = Union[IntegrationUnionMember0, IntegrationUnionMember1] - - class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) """Token passed for retreiving the next set of results. Empty if there are no diff --git a/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py b/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py index 1f4e7e5d..619b46da 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py @@ -1,23 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional -from typing_extensions import TypeAlias +from typing import Optional from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = [ - "ScmIntegrationRetrieveResponse", - "Integration", - "IntegrationUnionMember0", - "IntegrationUnionMember0OAuth", - "IntegrationUnionMember1", - "IntegrationUnionMember1OAuth", -] +__all__ = ["ScmIntegrationRetrieveResponse", "Integration", "IntegrationOAuth"] -class IntegrationUnionMember0OAuth(BaseModel): +class IntegrationOAuth(BaseModel): client_id: Optional[str] = FieldInfo(alias="clientId", default=None) """client_id is the OAuth app's client ID in clear text.""" @@ -28,56 +20,8 @@ class IntegrationUnionMember0OAuth(BaseModel): """ -class IntegrationUnionMember0(BaseModel): - oauth: IntegrationUnionMember0OAuth - - id: Optional[str] = None - """id is the unique identifier of the SCM integration""" - - host: Optional[str] = None - - pat: Optional[bool] = None - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) - """ - scm_id references the scm_id in the runner's configuration schema that this - integration is for - """ - - -class IntegrationUnionMember1OAuth(BaseModel): - client_id: Optional[str] = FieldInfo(alias="clientId", default=None) - """client_id is the OAuth app's client ID in clear text.""" - - encrypted_client_secret: Optional[str] = FieldInfo(alias="encryptedClientSecret", default=None) - """ - encrypted_client_secret is the OAuth app's secret encrypted with the runner's - public key. - """ - - -class IntegrationUnionMember1(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the SCM integration""" - - host: Optional[str] = None - - oauth: Optional[IntegrationUnionMember1OAuth] = None - - pat: Optional[bool] = None - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) - """ - scm_id references the scm_id in the runner's configuration schema that this - integration is for - """ - - -Integration: TypeAlias = Union[IntegrationUnionMember0, IntegrationUnionMember1] +class Integration(BaseModel): + oauth: IntegrationOAuth class ScmIntegrationRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/runners/configurations/scm_integration_update_params.py b/src/gitpod/types/runners/configurations/scm_integration_update_params.py index 53798b91..00c0d0f9 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_update_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_update_params.py @@ -2,15 +2,69 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["ScmIntegrationUpdateParams", "Body"] +__all__ = [ + "ScmIntegrationUpdateParams", + "OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate", + "OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored", + "PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate", +] -class ScmIntegrationUpdateParams(TypedDict, total=False): - body: Required[Body] +class OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate( + TypedDict, total=False +): + oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] + """oauth_client_id can be set to update the OAuth app's client ID. + + If an empty string is set, the OAuth configuration will be removed (regardless + of whether a client secret is set), and any existing Host Authentication Tokens + for the SCM integration's runner and host that were created using the OAuth app + will be deleted. This might lead to users being unable to access their + repositories until they re-authenticate. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( + TypedDict, total=False +): + oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + """ + oauth_plaintext_client_secret can be set to update the OAuth app's client + secret. + + The cleartext secret will be encrypted with the runner's public key before being + stored. + """ + + connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] + """Define the version of the Connect protocol""" + + connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] + """Define the timeout, in ms""" + + +class PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate( + TypedDict, total=False +): + pat: Required[bool] + """pat can be set to enable or disable Personal Access Tokens support. + + When disabling PATs, any existing Host Authentication Tokens for the SCM + integration's runner and host that were created using a PAT will be deleted. + This might lead to users being unable to access their repositories until they + re-authenticate. + """ connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" @@ -19,5 +73,8 @@ class ScmIntegrationUpdateParams(TypedDict, total=False): """Define the timeout, in ms""" -class Body: - pass +ScmIntegrationUpdateParams: TypeAlias = Union[ + OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate, + OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored, + PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate, +] diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index ed910204..ea4f7a10 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -7,10 +7,14 @@ from .._utils import PropertyInfo -__all__ = ["SecretCreateParams", "Variant0", "Variant1", "Variant2"] +__all__ = [ + "SecretCreateParams", + "SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", + "AbsolutePathToTheFileWhereTheSecretIsMounted", +] -class Variant0(TypedDict, total=False): +class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(TypedDict, total=False): environment_variable: Required[Annotated[bool, PropertyInfo(alias="environmentVariable")]] """ secret will be created as an Environment Variable with the same name as the @@ -20,16 +24,6 @@ class Variant0(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - file_path: Annotated[str, PropertyInfo(alias="filePath")] - """ - absolute path to the file where the secret is mounted value must be an absolute - path (start with a /): - - ``` - this.matches('^/(?:[^/]*/)*.*$') - ``` - """ - name: str project_id: Annotated[str, PropertyInfo(alias="projectId")] @@ -42,7 +36,7 @@ class Variant0(TypedDict, total=False): """Define the timeout, in ms""" -class Variant1(TypedDict, total=False): +class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] """ absolute path to the file where the secret is mounted value must be an absolute @@ -56,44 +50,6 @@ class Variant1(TypedDict, total=False): connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] - """ - secret will be created as an Environment Variable with the same name as the - secret - """ - - name: str - - project_id: Annotated[str, PropertyInfo(alias="projectId")] - """project_id is the ProjectID this Secret belongs to""" - - value: str - """value is the plaintext value of the secret""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - - -class Variant2(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] - """ - secret will be created as an Environment Variable with the same name as the - secret - """ - - file_path: Annotated[str, PropertyInfo(alias="filePath")] - """ - absolute path to the file where the secret is mounted value must be an absolute - path (start with a /): - - ``` - this.matches('^/(?:[^/]*/)*.*$') - ``` - """ - name: str project_id: Annotated[str, PropertyInfo(alias="projectId")] @@ -106,4 +62,6 @@ class Variant2(TypedDict, total=False): """Define the timeout, in ms""" -SecretCreateParams: TypeAlias = Union[Variant0, Variant1, Variant2] +SecretCreateParams: TypeAlias = Union[ + SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, AbsolutePathToTheFileWhereTheSecretIsMounted +] diff --git a/src/gitpod/types/secret_create_response.py b/src/gitpod/types/secret_create_response.py index 3b95c81c..53a103b2 100644 --- a/src/gitpod/types/secret_create_response.py +++ b/src/gitpod/types/secret_create_response.py @@ -1,8 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias +from typing_extensions import TypeAlias from pydantic import Field as FieldInfo @@ -11,685 +10,28 @@ __all__ = [ "SecretCreateResponse", "Secret", - "SecretUnionMember0", - "SecretUnionMember0Creator", - "SecretUnionMember1", - "SecretUnionMember1Creator", - "SecretUnionMember2", - "SecretUnionMember2Creator", + "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", + "SecretAbsolutePathToTheFileWhereTheSecretIsMounted", ] -class SecretUnionMember0Creator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class SecretUnionMember0(BaseModel): +class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): environment_variable: bool = FieldInfo(alias="environmentVariable") """ secret will be created as an Environment Variable with the same name as the secret """ - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[SecretUnionMember0Creator] = None - """creator is the identity of the creator of the secret""" - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """absolute path to the file where the secret is mounted""" - - name: Optional[str] = None - """Name of the secret for humans.""" - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """The Project ID this Secret belongs to""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class SecretUnionMember1Creator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class SecretUnionMember1(BaseModel): +class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """absolute path to the file where the secret is mounted""" - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[SecretUnionMember1Creator] = None - """creator is the identity of the creator of the secret""" - - environment_variable: Optional[bool] = FieldInfo(alias="environmentVariable", default=None) - """ - secret will be created as an Environment Variable with the same name as the - secret - """ - - name: Optional[str] = None - """Name of the secret for humans.""" - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """The Project ID this Secret belongs to""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class SecretUnionMember2Creator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class SecretUnionMember2(BaseModel): - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[SecretUnionMember2Creator] = None - """creator is the identity of the creator of the secret""" - - environment_variable: Optional[bool] = FieldInfo(alias="environmentVariable", default=None) - """ - secret will be created as an Environment Variable with the same name as the - secret - """ - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """absolute path to the file where the secret is mounted""" - - name: Optional[str] = None - """Name of the secret for humans.""" - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """The Project ID this Secret belongs to""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -Secret: TypeAlias = Union[SecretUnionMember0, SecretUnionMember1, SecretUnionMember2] +Secret: TypeAlias = Union[ + SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, + SecretAbsolutePathToTheFileWhereTheSecretIsMounted, +] class SecretCreateResponse(BaseModel): diff --git a/src/gitpod/types/secret_list_response.py b/src/gitpod/types/secret_list_response.py index eb9f46d0..7bbbf133 100644 --- a/src/gitpod/types/secret_list_response.py +++ b/src/gitpod/types/secret_list_response.py @@ -12,12 +12,10 @@ "SecretListResponse", "Pagination", "Secret", - "SecretUnionMember0", - "SecretUnionMember0Creator", - "SecretUnionMember1", - "SecretUnionMember1Creator", - "SecretUnionMember2", - "SecretUnionMember2Creator", + "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", + "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator", + "SecretAbsolutePathToTheFileWhereTheSecretIsMounted", + "SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator", ] @@ -29,7 +27,7 @@ class Pagination(BaseModel): """ -class SecretUnionMember0Creator(BaseModel): +class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -46,7 +44,7 @@ class SecretUnionMember0Creator(BaseModel): """Principal is the principal of the subject""" -class SecretUnionMember0(BaseModel): +class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): environment_variable: bool = FieldInfo(alias="environmentVariable") """ secret will be created as an Environment Variable with the same name as the @@ -147,12 +145,9 @@ class SecretUnionMember0(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[SecretUnionMember0Creator] = None + creator: Optional[SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator] = None """creator is the identity of the creator of the secret""" - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """absolute path to the file where the secret is mounted""" - name: Optional[str] = None """Name of the secret for humans.""" @@ -252,7 +247,7 @@ class SecretUnionMember0(BaseModel): """ -class SecretUnionMember1Creator(BaseModel): +class SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -269,7 +264,7 @@ class SecretUnionMember1Creator(BaseModel): """Principal is the principal of the subject""" -class SecretUnionMember1(BaseModel): +class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """absolute path to the file where the secret is mounted""" @@ -367,238 +362,9 @@ class SecretUnionMember1(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[SecretUnionMember1Creator] = None - """creator is the identity of the creator of the secret""" - - environment_variable: Optional[bool] = FieldInfo(alias="environmentVariable", default=None) - """ - secret will be created as an Environment Variable with the same name as the - secret - """ - - name: Optional[str] = None - """Name of the secret for humans.""" - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """The Project ID this Secret belongs to""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class SecretUnionMember2Creator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class SecretUnionMember2(BaseModel): - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[SecretUnionMember2Creator] = None + creator: Optional[SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator] = None """creator is the identity of the creator of the secret""" - environment_variable: Optional[bool] = FieldInfo(alias="environmentVariable", default=None) - """ - secret will be created as an Environment Variable with the same name as the - secret - """ - - file_path: Optional[str] = FieldInfo(alias="filePath", default=None) - """absolute path to the file where the secret is mounted""" - name: Optional[str] = None """Name of the secret for humans.""" @@ -698,7 +464,10 @@ class SecretUnionMember2(BaseModel): """ -Secret: TypeAlias = Union[SecretUnionMember0, SecretUnionMember1, SecretUnionMember2] +Secret: TypeAlias = Union[ + SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, + SecretAbsolutePathToTheFileWhereTheSecretIsMounted, +] class SecretListResponse(BaseModel): diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index a0a50e03..d523efc0 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -43,13 +43,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "description": "description", "name": "x", "reference": "reference", - "triggered_by": [ - { - "manual": True, - "post_devcontainer_start": True, - "post_environment_start": True, - } - ], + "triggered_by": [{"manual": True}], }, spec={ "commands": { @@ -154,9 +148,9 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={}, - spec={}, - status={}, + metadata={"description": "description"}, + spec={"commands": {"ready": "ready"}}, + status={"failure_message": "failureMessage"}, connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @@ -378,13 +372,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "description": "description", "name": "x", "reference": "reference", - "triggered_by": [ - { - "manual": True, - "post_devcontainer_start": True, - "post_environment_start": True, - } - ], + "triggered_by": [{"manual": True}], }, spec={ "commands": { @@ -489,9 +477,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> service = await async_client.environments.automations.services.update( connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={}, - spec={}, - status={}, + metadata={"description": "description"}, + spec={"commands": {"ready": "ready"}}, + status={"failure_message": "failureMessage"}, connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 85c01b8d..1ccf9ffa 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -45,13 +45,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "description": "description", "name": "x", "reference": "reference", - "triggered_by": [ - { - "manual": True, - "post_devcontainer_start": True, - "post_environment_start": True, - } - ], + "triggered_by": [{"manual": True}], }, spec={ "command": "command", @@ -150,8 +144,8 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - metadata={}, - spec={}, + metadata={"description": "description"}, + spec={"command": "command"}, connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @@ -333,13 +327,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "description": "description", "name": "x", "reference": "reference", - "triggered_by": [ - { - "manual": True, - "post_devcontainer_start": True, - "post_environment_start": True, - } - ], + "triggered_by": [{"manual": True}], }, spec={ "command": "command", @@ -438,8 +426,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - metadata={}, - spec={}, + metadata={"description": "description"}, + spec={"command": "command"}, connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index e3871d69..fc905847 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -113,34 +113,198 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( - body={}, + client_id="x", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + client_id="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update( + client_id="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update( + client_id="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + client_secret="x", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + client_secret="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update( + client_secret="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update( + client_secret="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + email_domain="xxxx", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + email_domain="xxxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update( + email_domain="xxxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update( + email_domain="xxxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_4(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + issuer_url="https://example.com", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_4(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_5(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update( + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", connect_protocol_version=1, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( - body={ - "claims": {"foo": "string"}, - "clientId": "x", - "clientSecret": "x", - "emailDomain": "xxxx", - "issuerUrl": "https://example.com", - "ssoConfigurationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "state": "SSO_CONFIGURATION_STATE_UNSPECIFIED", - }, + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( - body={}, + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", connect_protocol_version=1, ) @@ -150,9 +314,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( - body={}, + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -346,34 +510,198 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + client_id="x", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + client_id="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update( + client_id="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + client_id="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + client_secret="x", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + client_secret="x", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update( + client_secret="x", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + client_secret="x", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + email_domain="xxxx", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + email_domain="xxxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update( + email_domain="xxxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + email_domain="xxxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update( + issuer_url="https://example.com", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + issuer_url="https://example.com", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sso_configuration = await response.parse() + assert_matches_type(object, sso_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( - body={}, + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", connect_protocol_version=1, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( - body={ - "claims": {"foo": "string"}, - "clientId": "x", - "clientSecret": "x", - "emailDomain": "xxxx", - "issuerUrl": "https://example.com", - "ssoConfigurationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "state": "SSO_CONFIGURATION_STATE_UNSPECIFIED", - }, + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( - body={}, + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", connect_protocol_version=1, ) @@ -383,9 +711,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, sso_configuration, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( - body={}, + state="SSO_CONFIGURATION_STATE_UNSPECIFIED", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index bf6b49c4..41ce1135 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -117,31 +117,112 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( - body={}, + description="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + environment_class = client.runners.configurations.environment_classes.update( + description="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.runners.configurations.environment_classes.with_raw_response.update( + description="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.runners.configurations.environment_classes.with_streaming_response.update( + description="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + environment_class = client.runners.configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + environment_class = client.runners.configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.runners.configurations.environment_classes.with_raw_response.update( + display_name="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.runners.configurations.environment_classes.with_streaming_response.update( + display_name="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: + environment_class = client.runners.configurations.environment_classes.update( + enabled=True, connect_protocol_version=1, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( - body={ - "description": "xxx", - "displayName": "xxx", - "enabled": True, - "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, + enabled=True, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( - body={}, + enabled=True, connect_protocol_version=1, ) @@ -151,9 +232,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(object, environment_class, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( - body={}, + enabled=True, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -311,31 +392,112 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runners.configurations.environment_classes.update( + description="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runners.configurations.environment_classes.update( + description="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.environment_classes.with_raw_response.update( + description="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.environment_classes.with_streaming_response.update( + description="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runners.configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runners.configurations.environment_classes.update( + display_name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.environment_classes.with_raw_response.update( + display_name="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.environment_classes.with_streaming_response.update( + display_name="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_class = await response.parse() + assert_matches_type(object, environment_class, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( - body={}, + enabled=True, connect_protocol_version=1, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( - body={ - "description": "xxx", - "displayName": "xxx", - "enabled": True, - "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, + enabled=True, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( - body={}, + enabled=True, connect_protocol_version=1, ) @@ -345,9 +507,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, environment_class, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( - body={}, + enabled=True, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 75187e64..1153fe3e 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -116,31 +116,112 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - body={}, + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( + refresh_token="refreshToken", connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "token": "x", - "expiresAt": parse_datetime("2019-12-27T18:11:19.117Z"), - "refreshToken": "refreshToken", - }, + token="x", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + host_authentication_token = client.runners.configurations.host_authentication_tokens.update( + token="x", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( - body={}, + token="x", connect_protocol_version=1, ) @@ -150,9 +231,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - body={}, + token="x", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -348,31 +429,112 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - body={}, + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( + refresh_token="refreshToken", connect_protocol_version=1, + connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( + refresh_token="refreshToken", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + host_authentication_token = await response.parse() + assert_matches_type(object, host_authentication_token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "token": "x", - "expiresAt": parse_datetime("2019-12-27T18:11:19.117Z"), - "refreshToken": "refreshToken", - }, + token="x", + connect_protocol_version=1, + ) + assert_matches_type(object, host_authentication_token, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( + token="x", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( - body={}, + token="x", connect_protocol_version=1, ) @@ -382,9 +544,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - body={}, + token="x", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index c7ce2954..c22ad989 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -22,33 +22,26 @@ class TestScmIntegrations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_create(self, client: Gitpod) -> None: + def test_method_create_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( - body={}, + oauth_client_id="oauthClientId", connect_protocol_version=1, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - def test_method_create_with_all_params(self, client: Gitpod) -> None: + def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( - body={ - "host": "host", - "oauthClientId": "oauthClientId", - "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", - "pat": True, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmId": "scmId", - }, + oauth_client_id="oauthClientId", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - def test_raw_response_create(self, client: Gitpod) -> None: + def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( - body={}, + oauth_client_id="oauthClientId", connect_protocol_version=1, ) @@ -58,9 +51,52 @@ def test_raw_response_create(self, client: Gitpod) -> None: assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - def test_streaming_response_create(self, client: Gitpod) -> None: + def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( - body={}, + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_create_overload_2(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -119,31 +155,112 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( - body={}, + pat=True, connect_protocol_version=1, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "oauthClientId": "oauthClientId", - "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", - "pat": True, - }, + pat=True, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( - body={}, + pat=True, connect_protocol_version=1, ) @@ -153,9 +270,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(object, scm_integration, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( - body={}, + pat=True, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -258,33 +375,26 @@ class TestAsyncScmIntegrations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_create(self, async_client: AsyncGitpod) -> None: + async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( - body={}, + oauth_client_id="oauthClientId", connect_protocol_version=1, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( - body={ - "host": "host", - "oauthClientId": "oauthClientId", - "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", - "pat": True, - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "scmId": "scmId", - }, + oauth_client_id="oauthClientId", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( - body={}, + oauth_client_id="oauthClientId", connect_protocol_version=1, ) @@ -294,9 +404,52 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @parametrize - async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( - body={}, + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -355,31 +508,112 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( + oauth_client_id="oauthClientId", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( + oauth_plaintext_client_secret="oauthPlaintextClientSecret", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scm_integration = await response.parse() + assert_matches_type(object, scm_integration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( - body={}, + pat=True, connect_protocol_version=1, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( - body={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "oauthClientId": "oauthClientId", - "oauthPlaintextClientSecret": "oauthPlaintextClientSecret", - "pat": True, - }, + pat=True, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( - body={}, + pat=True, connect_protocol_version=1, ) @@ -389,9 +623,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, scm_integration, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( - body={}, + pat=True, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 28a64c32..30cbd663 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -43,7 +43,6 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non }, connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - scm_integration={}, connect_timeout_ms=0, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -77,7 +76,7 @@ def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: @parametrize def test_method_validate_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( - scm_integration={}, + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -85,21 +84,8 @@ def test_method_validate_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( - scm_integration={}, + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, - environment_class={ - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) @@ -108,7 +94,7 @@ def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> Non @parametrize def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( - scm_integration={}, + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) @@ -120,61 +106,7 @@ def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: @parametrize def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( - scm_integration={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration = response.parse() - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_validate_overload_3(self, client: Gitpod) -> None: - configuration = client.runners.configurations.validate( - connect_protocol_version=1, - ) - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @parametrize - def test_method_validate_with_all_params_overload_3(self, client: Gitpod) -> None: - configuration = client.runners.configurations.validate( - connect_protocol_version=1, - environment_class={ - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - scm_integration={}, - connect_timeout_ms=0, - ) - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @parametrize - def test_raw_response_validate_overload_3(self, client: Gitpod) -> None: - response = client.runners.configurations.with_raw_response.validate( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration = response.parse() - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @parametrize - def test_streaming_response_validate_overload_3(self, client: Gitpod) -> None: - with client.runners.configurations.with_streaming_response.validate( + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -215,7 +147,6 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As }, connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - scm_integration={}, connect_timeout_ms=0, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -249,7 +180,7 @@ async def test_streaming_response_validate_overload_1(self, async_client: AsyncG @parametrize async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( - scm_integration={}, + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -257,21 +188,8 @@ async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> No @parametrize async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( - scm_integration={}, + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, - environment_class={ - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) @@ -280,7 +198,7 @@ async def test_method_validate_with_all_params_overload_2(self, async_client: As @parametrize async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( - scm_integration={}, + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) @@ -292,61 +210,7 @@ async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) @parametrize async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( - scm_integration={}, - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration = await response.parse() - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_validate_overload_3(self, async_client: AsyncGitpod) -> None: - configuration = await async_client.runners.configurations.validate( - connect_protocol_version=1, - ) - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @parametrize - async def test_method_validate_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - configuration = await async_client.runners.configurations.validate( - connect_protocol_version=1, - environment_class={ - "id": "id", - "configuration": [ - { - "key": "key", - "value": "value", - } - ], - "description": "xxx", - "display_name": "xxx", - "enabled": True, - "runner_id": "runnerId", - }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - scm_integration={}, - connect_timeout_ms=0, - ) - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @parametrize - async def test_raw_response_validate_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.with_raw_response.validate( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration = await response.parse() - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @parametrize - async def test_streaming_response_validate_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.with_streaming_response.validate( + scm_integration={"oauth_client_id": "oauthClientId"}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 46a127ed..6c117e93 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -44,20 +44,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": { - "specs": [ - { - "context_url": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -79,8 +66,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "secrets": [ { "environment_variable": "environmentVariable", - "file_path": "filePath", - "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", @@ -172,30 +157,69 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: environment = client.environments.update( - body={}, + metadata={}, connect_protocol_version=1, ) assert_matches_type(object, environment, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: environment = client.environments.update( - body={ - "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "metadata": {}, - "spec": {}, - }, + metadata={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.update( + metadata={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.update( + metadata={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + environment = client.environments.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + environment = client.environments.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( - body={}, + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, connect_protocol_version=1, ) @@ -205,9 +229,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(object, environment, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( - body={}, + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -327,20 +351,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": { - "specs": [ - { - "context_url": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -362,8 +373,6 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "secrets": [ { "environment_variable": "environmentVariable", - "file_path": "filePath", - "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", @@ -595,20 +604,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": { - "specs": [ - { - "context_url": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -630,8 +626,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "secrets": [ { "environment_variable": "environmentVariable", - "file_path": "filePath", - "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", @@ -723,30 +717,69 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( - body={}, + metadata={}, connect_protocol_version=1, ) assert_matches_type(object, environment, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( - body={ - "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "metadata": {}, - "spec": {}, - }, + metadata={}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.update( + metadata={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.update( + metadata={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + connect_protocol_version=1, + ) + assert_matches_type(object, environment, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.update( + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( - body={}, + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, connect_protocol_version=1, ) @@ -756,9 +789,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, environment, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( - body={}, + spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -878,20 +911,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": { - "specs": [ - { - "context_url": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -913,8 +933,6 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "secrets": [ { "environment_variable": "environmentVariable", - "file_path": "filePath", - "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 5f8aa01c..f539a4b9 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -77,7 +77,6 @@ def test_method_watch_with_all_params_overload_1(self, client: Gitpod) -> None: event = client.events.watch( environment_id="environmentId", connect_protocol_version=1, - organization=True, connect_timeout_ms=0, ) assert_matches_type(EventWatchResponse, event, path=["response"]) @@ -121,7 +120,6 @@ def test_method_watch_with_all_params_overload_2(self, client: Gitpod) -> None: event = client.events.watch( organization=True, connect_protocol_version=1, - environment_id="environmentId", connect_timeout_ms=0, ) assert_matches_type(EventWatchResponse, event, path=["response"]) @@ -152,47 +150,6 @@ def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_watch_overload_3(self, client: Gitpod) -> None: - event = client.events.watch( - connect_protocol_version=1, - ) - assert_matches_type(EventWatchResponse, event, path=["response"]) - - @parametrize - def test_method_watch_with_all_params_overload_3(self, client: Gitpod) -> None: - event = client.events.watch( - connect_protocol_version=1, - environment_id="environmentId", - organization=True, - connect_timeout_ms=0, - ) - assert_matches_type(EventWatchResponse, event, path=["response"]) - - @parametrize - def test_raw_response_watch_overload_3(self, client: Gitpod) -> None: - response = client.events.with_raw_response.watch( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - event = response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) - - @parametrize - def test_streaming_response_watch_overload_3(self, client: Gitpod) -> None: - with client.events.with_streaming_response.watch( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - event = response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) - - assert cast(Any, response.is_closed) is True - class TestAsyncEvents: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -257,7 +214,6 @@ async def test_method_watch_with_all_params_overload_1(self, async_client: Async event = await async_client.events.watch( environment_id="environmentId", connect_protocol_version=1, - organization=True, connect_timeout_ms=0, ) assert_matches_type(EventWatchResponse, event, path=["response"]) @@ -301,7 +257,6 @@ async def test_method_watch_with_all_params_overload_2(self, async_client: Async event = await async_client.events.watch( organization=True, connect_protocol_version=1, - environment_id="environmentId", connect_timeout_ms=0, ) assert_matches_type(EventWatchResponse, event, path=["response"]) @@ -331,44 +286,3 @@ async def test_streaming_response_watch_overload_2(self, async_client: AsyncGitp assert_matches_type(EventWatchResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_watch_overload_3(self, async_client: AsyncGitpod) -> None: - event = await async_client.events.watch( - connect_protocol_version=1, - ) - assert_matches_type(EventWatchResponse, event, path=["response"]) - - @parametrize - async def test_method_watch_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - event = await async_client.events.watch( - connect_protocol_version=1, - environment_id="environmentId", - organization=True, - connect_timeout_ms=0, - ) - assert_matches_type(EventWatchResponse, event, path=["response"]) - - @parametrize - async def test_raw_response_watch_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.events.with_raw_response.watch( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - event = await response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) - - @parametrize - async def test_streaming_response_watch_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.events.with_streaming_response.watch( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - event = await response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 34666639..9caa1fea 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -114,30 +114,26 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( - body={}, + invite_domains={}, connect_protocol_version=1, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( - body={ - "inviteDomains": {"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, - "name": "name", - "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, + invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( - body={}, + invite_domains={}, connect_protocol_version=1, ) @@ -147,9 +143,52 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( - body={}, + invite_domains={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + organization = client.organizations.update( + name="name", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + organization = client.organizations.update( + name="name", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.update( + name="name", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.update( + name="name", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -260,7 +299,6 @@ def test_method_join_with_all_params_overload_1(self, client: Gitpod) -> None: organization = client.organizations.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_protocol_version=1, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -304,7 +342,6 @@ def test_method_join_with_all_params_overload_2(self, client: Gitpod) -> None: organization = client.organizations.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_protocol_version=1, - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -335,47 +372,6 @@ def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_join_overload_3(self, client: Gitpod) -> None: - organization = client.organizations.join( - connect_protocol_version=1, - ) - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - def test_method_join_with_all_params_overload_3(self, client: Gitpod) -> None: - organization = client.organizations.join( - connect_protocol_version=1, - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - def test_raw_response_join_overload_3(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.join( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = response.parse() - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - def test_streaming_response_join_overload_3(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.join( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = response.parse() - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_leave(self, client: Gitpod) -> None: organization = client.organizations.leave( @@ -599,30 +595,26 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( - body={}, + invite_domains={}, connect_protocol_version=1, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( - body={ - "inviteDomains": {"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, - "name": "name", - "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, + invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( - body={}, + invite_domains={}, connect_protocol_version=1, ) @@ -632,9 +624,52 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( - body={}, + invite_domains={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + organization = await response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.update( + name="name", + connect_protocol_version=1, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.update( + name="name", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.update( + name="name", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + organization = await response.parse() + assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.update( + name="name", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -745,7 +780,6 @@ async def test_method_join_with_all_params_overload_1(self, async_client: AsyncG organization = await async_client.organizations.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_protocol_version=1, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -789,7 +823,6 @@ async def test_method_join_with_all_params_overload_2(self, async_client: AsyncG organization = await async_client.organizations.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_protocol_version=1, - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -820,47 +853,6 @@ async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_join_overload_3(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.join( - connect_protocol_version=1, - ) - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - async def test_method_join_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.join( - connect_protocol_version=1, - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, - ) - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - async def test_raw_response_join_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.join( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = await response.parse() - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - async def test_streaming_response_join_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.join( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = await response.parse() - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 7aaef4d7..0ecb83c0 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -35,24 +35,8 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "local_runner": True, - }, - initializer={ - "specs": [ - { - "context_url": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", @@ -137,49 +121,198 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: + project = client.projects.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + project = client.projects.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + project = client.projects.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + project = client.projects.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_3(self, client: Gitpod) -> None: + project = client.projects.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: + project = client.projects.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_update_overload_3(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_4(self, client: Gitpod) -> None: + project = client.projects.update( + initializer={}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: + project = client.projects.update( + initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_raw_response_update_overload_4(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update( + initializer={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update( + initializer={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_5(self, client: Gitpod) -> None: project = client.projects.update( - body={}, + name="x", connect_protocol_version=1, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: project = client.projects.update( - body={ - "automationsFilePath": "automationsFilePath", - "devcontainerFilePath": "devcontainerFilePath", - "environmentClass": { - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "local_runner": True, - }, - "initializer": { - "specs": [ - { - "context_url": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, - "name": "x", - "projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, + name="x", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( - body={}, + name="x", connect_protocol_version=1, ) @@ -189,9 +322,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( - body={}, + name="x", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -346,24 +479,8 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "local_runner": True, - }, - initializer={ - "specs": [ - { - "context_url": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", @@ -448,49 +565,198 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update( + automations_file_path="automationsFilePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update( + devcontainer_file_path="devcontainerFilePath", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update( + environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + initializer={}, + connect_protocol_version=1, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update( + initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update( + initializer={}, + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update( + initializer={}, + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( - body={}, + name="x", connect_protocol_version=1, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( - body={ - "automationsFilePath": "automationsFilePath", - "devcontainerFilePath": "devcontainerFilePath", - "environmentClass": { - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "local_runner": True, - }, - "initializer": { - "specs": [ - { - "context_url": {"url": "https://example.com"}, - "git": { - "checkout_location": "checkoutLocation", - "clone_target": "cloneTarget", - "remote_uri": "remoteUri", - "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", - "upstream_remote_uri": "upstreamRemoteUri", - }, - } - ] - }, - "name": "x", - "projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - }, + name="x", connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( - body={}, + name="x", connect_protocol_version=1, ) @@ -500,9 +766,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( - body={}, + name="x", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 1cfbd44b..ecb141d5 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -122,30 +122,69 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_update(self, client: Gitpod) -> None: + def test_method_update_overload_1(self, client: Gitpod) -> None: runner = client.runners.update( - body={}, + name="xxx", connect_protocol_version=1, ) assert_matches_type(object, runner, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Gitpod) -> None: + def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: runner = client.runners.update( - body={ - "name": "xxx", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "spec": {}, - }, + name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.update( + name="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.update( + name="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(object, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update_overload_2(self, client: Gitpod) -> None: + runner = client.runners.update( + spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: + runner = client.runners.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize - def test_raw_response_update(self, client: Gitpod) -> None: + def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( - body={}, + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) @@ -155,9 +194,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: assert_matches_type(object, runner, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Gitpod) -> None: + def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( - body={}, + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -480,30 +519,69 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True @parametrize - async def test_method_update(self, async_client: AsyncGitpod) -> None: + async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( - body={}, + name="xxx", connect_protocol_version=1, ) assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( - body={ - "name": "xxx", - "runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "spec": {}, - }, + name="xxx", + connect_protocol_version=1, + connect_timeout_ms=0, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.update( + name="xxx", + connect_protocol_version=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.update( + name="xxx", + connect_protocol_version=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(object, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update( + spec={"configuration": {"auto_update": True}}, + connect_protocol_version=1, + ) + assert_matches_type(object, runner, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update( + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( - body={}, + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) @@ -513,9 +591,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, runner, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( - body={}, + spec={"configuration": {"auto_update": True}}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 443c6f72..a1936fad 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -34,7 +34,6 @@ def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( environment_variable=True, connect_protocol_version=1, - file_path="filePath", name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", @@ -81,7 +80,6 @@ def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( file_path="filePath", connect_protocol_version=1, - environment_variable=True, name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", @@ -115,50 +113,6 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_create_overload_3(self, client: Gitpod) -> None: - secret = client.secrets.create( - connect_protocol_version=1, - ) - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_3(self, client: Gitpod) -> None: - secret = client.secrets.create( - connect_protocol_version=1, - environment_variable=True, - file_path="filePath", - name="name", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - value="x", - connect_timeout_ms=0, - ) - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @parametrize - def test_raw_response_create_overload_3(self, client: Gitpod) -> None: - response = client.secrets.with_raw_response.create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - secret = response.parse() - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @parametrize - def test_streaming_response_create_overload_3(self, client: Gitpod) -> None: - with client.secrets.with_streaming_response.create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - secret = response.parse() - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_list(self, client: Gitpod) -> None: secret = client.secrets.list( @@ -351,7 +305,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn secret = await async_client.secrets.create( environment_variable=True, connect_protocol_version=1, - file_path="filePath", name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", @@ -398,7 +351,6 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn secret = await async_client.secrets.create( file_path="filePath", connect_protocol_version=1, - environment_variable=True, name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", @@ -432,50 +384,6 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_create_overload_3(self, async_client: AsyncGitpod) -> None: - secret = await async_client.secrets.create( - connect_protocol_version=1, - ) - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - secret = await async_client.secrets.create( - connect_protocol_version=1, - environment_variable=True, - file_path="filePath", - name="name", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - value="x", - connect_timeout_ms=0, - ) - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @parametrize - async def test_raw_response_create_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.secrets.with_raw_response.create( - connect_protocol_version=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - secret = await response.parse() - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @parametrize - async def test_streaming_response_create_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.secrets.with_streaming_response.create( - connect_protocol_version=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - secret = await response.parse() - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list( From e97cf698f20af88f63d5a288ec00f74756c4666d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 08:42:37 +0000 Subject: [PATCH 060/505] feat(api): update via SDK Studio --- src/gitpod/pagination.py | 80 ---------------------------------------- 1 file changed, 80 deletions(-) diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index c9ab21f2..a149247f 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -531,46 +531,6 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes - if not environment_classes: - return [] - return environment_classes - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes - if not environment_classes: - return [] - return environment_classes - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): services: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -811,46 +771,6 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - policies: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - policies = self.policies - if not policies: - return [] - return policies - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - policies: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - @override - def _get_page_items(self) -> List[_T]: - policies = self.policies - if not policies: - return [] - return policies - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - class SyncSecretsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): secrets: List[_T] next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) From e28e8a34b4a51fc806f562b19af9d725513cda72 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 08:49:37 +0000 Subject: [PATCH 061/505] feat(api): update via SDK Studio --- api.md | 40 ++--- src/gitpod/resources/accounts.py | 146 ++++-------------- src/gitpod/resources/editors.py | 66 ++------ .../environments/automations/services.py | 66 +------- .../automations/tasks/executions.py | 66 +------- .../environments/automations/tasks/tasks.py | 66 +------- .../resources/environments/environments.py | 70 ++------- src/gitpod/resources/identity.py | 70 ++------- src/gitpod/resources/organizations/invites.py | 68 ++------ .../resources/organizations/organizations.py | 70 ++------- .../organizations/sso_configurations.py | 72 ++------- src/gitpod/resources/projects/projects.py | 66 ++------ .../configurations/environment_classes.py | 72 ++------- .../host_authentication_tokens.py | 70 ++------- .../runners/configurations/schema.py | 66 +------- .../configurations/scm_integrations.py | 66 +------- src/gitpod/resources/runners/runners.py | 66 +------- src/gitpod/resources/secrets.py | 66 +------- src/gitpod/resources/users/pats.py | 68 ++------ src/gitpod/resources/users/users.py | 66 +------- .../types/account_get_sso_login_url_params.py | 19 +-- src/gitpod/types/account_retrieve_params.py | 17 +- src/gitpod/types/editor_retrieve_params.py | 18 +-- .../types/environment_retrieve_params.py | 18 +-- .../automations/service_retrieve_params.py | 17 +- .../automations/task_retrieve_params.py | 17 +- .../tasks/execution_retrieve_params.py | 17 +- ...ntity_get_authenticated_identity_params.py | 17 +- .../types/organization_retrieve_params.py | 18 +-- .../invite_get_summary_params.py | 17 +- .../sso_configuration_retrieve_params.py | 18 +-- src/gitpod/types/project_retrieve_params.py | 18 +-- src/gitpod/types/runner_retrieve_params.py | 17 +- .../environment_class_retrieve_params.py | 17 +- ...st_authentication_token_retrieve_params.py | 17 +- .../configurations/schema_retrieve_params.py | 17 +- .../scm_integration_retrieve_params.py | 17 +- src/gitpod/types/secret_get_value_params.py | 17 +- .../user_get_authenticated_user_params.py | 17 +- src/gitpod/types/users/pat_get_params.py | 17 +- .../automations/tasks/test_executions.py | 18 +-- .../environments/automations/test_services.py | 18 +-- .../environments/automations/test_tasks.py | 18 +-- .../organizations/test_invites.py | 18 +-- .../organizations/test_sso_configurations.py | 18 +-- .../test_environment_classes.py | 18 +-- .../test_host_authentication_tokens.py | 18 +-- .../runners/configurations/test_schema.py | 18 +-- .../configurations/test_scm_integrations.py | 18 +-- tests/api_resources/test_accounts.py | 50 +++--- tests/api_resources/test_editors.py | 18 +-- tests/api_resources/test_environments.py | 18 +-- tests/api_resources/test_identity.py | 24 +-- tests/api_resources/test_organizations.py | 18 +-- tests/api_resources/test_projects.py | 18 +-- tests/api_resources/test_runners.py | 18 +-- tests/api_resources/test_secrets.py | 18 +-- tests/api_resources/test_users.py | 24 +-- tests/api_resources/users/test_pats.py | 18 +-- 59 files changed, 334 insertions(+), 1805 deletions(-) diff --git a/api.md b/api.md index c5d60f2b..320dc6f2 100644 --- a/api.md +++ b/api.md @@ -13,9 +13,9 @@ from gitpod.types import ( Methods: -- client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse +- client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse - client.accounts.delete(\*\*params) -> object -- client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse +- client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse - client.accounts.list_login_providers(\*\*params) -> AccountListLoginProvidersResponse # Editors @@ -28,7 +28,7 @@ from gitpod.types import EditorRetrieveResponse, EditorListResponse, EditorResol Methods: -- client.editors.retrieve(\*\*params) -> EditorRetrieveResponse +- client.editors.retrieve(\*\*params) -> EditorRetrieveResponse - client.editors.list(\*\*params) -> EditorListResponse - client.editors.resolve_url(\*\*params) -> EditorResolveURLResponse @@ -54,7 +54,7 @@ from gitpod.types import ( Methods: - client.environments.create(\*\*params) -> EnvironmentCreateResponse -- client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse +- client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse - client.environments.update(\*\*params) -> object - client.environments.list(\*\*params) -> EnvironmentListResponse - client.environments.delete(\*\*params) -> object @@ -95,7 +95,7 @@ from gitpod.types.environments.automations import ( Methods: - client.environments.automations.services.create(\*\*params) -> ServiceCreateResponse -- client.environments.automations.services.retrieve(\*\*params) -> ServiceRetrieveResponse +- client.environments.automations.services.retrieve(\*\*params) -> ServiceRetrieveResponse - client.environments.automations.services.update(\*\*params) -> object - client.environments.automations.services.list(\*\*params) -> ServiceListResponse - client.environments.automations.services.delete(\*\*params) -> object @@ -120,7 +120,7 @@ from gitpod.types.environments.automations import ( Methods: - client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse -- client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse +- client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse - client.environments.automations.tasks.update(\*\*params) -> object - client.environments.automations.tasks.list(\*\*params) -> TaskListResponse - client.environments.automations.tasks.delete(\*\*params) -> object @@ -140,7 +140,7 @@ from gitpod.types.environments.automations.tasks import ( Methods: -- client.environments.automations.tasks.executions.retrieve(\*\*params) -> ExecutionRetrieveResponse +- client.environments.automations.tasks.executions.retrieve(\*\*params) -> ExecutionRetrieveResponse - client.environments.automations.tasks.executions.list(\*\*params) -> ExecutionListResponse - client.environments.automations.tasks.executions.stop(\*\*params) -> object @@ -196,7 +196,7 @@ from gitpod.types import ( Methods: - client.identity.exchange_token(\*\*params) -> IdentityExchangeTokenResponse -- client.identity.get_authenticated_identity(\*\*params) -> IdentityGetAuthenticatedIdentityResponse +- client.identity.get_authenticated_identity(\*\*params) -> IdentityGetAuthenticatedIdentityResponse - client.identity.get_id_token(\*\*params) -> IdentityGetIDTokenResponse # Organizations @@ -220,7 +220,7 @@ from gitpod.types import ( Methods: - client.organizations.create(\*\*params) -> OrganizationCreateResponse -- client.organizations.retrieve(\*\*params) -> OrganizationRetrieveResponse +- client.organizations.retrieve(\*\*params) -> OrganizationRetrieveResponse - client.organizations.update(\*\*params) -> OrganizationUpdateResponse - client.organizations.list(\*\*params) -> OrganizationListResponse - client.organizations.delete(\*\*params) -> object @@ -245,7 +245,7 @@ Methods: - client.organizations.invites.create(\*\*params) -> InviteCreateResponse - client.organizations.invites.retrieve(\*\*params) -> InviteRetrieveResponse -- client.organizations.invites.get_summary(\*\*params) -> InviteGetSummaryResponse +- client.organizations.invites.get_summary(\*\*params) -> InviteGetSummaryResponse ## SSOConfigurations @@ -264,7 +264,7 @@ from gitpod.types.organizations import ( Methods: - client.organizations.sso_configurations.create(\*\*params) -> SSOConfigurationCreateResponse -- client.organizations.sso_configurations.retrieve(\*\*params) -> SSOConfigurationRetrieveResponse +- client.organizations.sso_configurations.retrieve(\*\*params) -> SSOConfigurationRetrieveResponse - client.organizations.sso_configurations.update(\*\*params) -> object - client.organizations.sso_configurations.list(\*\*params) -> SSOConfigurationListResponse - client.organizations.sso_configurations.delete(\*\*params) -> object @@ -287,7 +287,7 @@ from gitpod.types import ( Methods: - client.projects.create(\*\*params) -> ProjectCreateResponse -- client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse +- client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse - client.projects.update(\*\*params) -> ProjectUpdateResponse - client.projects.list(\*\*params) -> ProjectListResponse - client.projects.delete(\*\*params) -> object @@ -333,7 +333,7 @@ from gitpod.types import ( Methods: - client.runners.create(\*\*params) -> RunnerCreateResponse -- client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse +- client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse - client.runners.update(\*\*params) -> object - client.runners.list(\*\*params) -> RunnerListResponse - client.runners.delete(\*\*params) -> object @@ -369,7 +369,7 @@ from gitpod.types.runners.configurations import ( Methods: - client.runners.configurations.environment_classes.create(\*\*params) -> EnvironmentClassCreateResponse -- client.runners.configurations.environment_classes.retrieve(\*\*params) -> EnvironmentClassRetrieveResponse +- client.runners.configurations.environment_classes.retrieve(\*\*params) -> EnvironmentClassRetrieveResponse - client.runners.configurations.environment_classes.update(\*\*params) -> object - client.runners.configurations.environment_classes.list(\*\*params) -> EnvironmentClassListResponse @@ -390,7 +390,7 @@ from gitpod.types.runners.configurations import ( Methods: - client.runners.configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse -- client.runners.configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse +- client.runners.configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse - client.runners.configurations.host_authentication_tokens.update(\*\*params) -> object - client.runners.configurations.host_authentication_tokens.list(\*\*params) -> HostAuthenticationTokenListResponse - client.runners.configurations.host_authentication_tokens.delete(\*\*params) -> object @@ -405,7 +405,7 @@ from gitpod.types.runners.configurations import SchemaRetrieveResponse Methods: -- client.runners.configurations.schema.retrieve(\*\*params) -> SchemaRetrieveResponse +- client.runners.configurations.schema.retrieve(\*\*params) -> SchemaRetrieveResponse ### ScmIntegrations @@ -424,7 +424,7 @@ from gitpod.types.runners.configurations import ( Methods: - client.runners.configurations.scm_integrations.create(\*\*params) -> ScmIntegrationCreateResponse -- client.runners.configurations.scm_integrations.retrieve(\*\*params) -> ScmIntegrationRetrieveResponse +- client.runners.configurations.scm_integrations.retrieve(\*\*params) -> ScmIntegrationRetrieveResponse - client.runners.configurations.scm_integrations.update(\*\*params) -> object - client.runners.configurations.scm_integrations.list(\*\*params) -> ScmIntegrationListResponse - client.runners.configurations.scm_integrations.delete(\*\*params) -> object @@ -468,7 +468,7 @@ Methods: - client.secrets.create(\*\*params) -> SecretCreateResponse - client.secrets.list(\*\*params) -> SecretListResponse - client.secrets.delete(\*\*params) -> object -- client.secrets.get_value(\*\*params) -> SecretGetValueResponse +- client.secrets.get_value(\*\*params) -> SecretGetValueResponse - client.secrets.update_value(\*\*params) -> object # Users @@ -481,7 +481,7 @@ from gitpod.types import UserGetAuthenticatedUserResponse, UserSetSuspendedRespo Methods: -- client.users.get_authenticated_user(\*\*params) -> UserGetAuthenticatedUserResponse +- client.users.get_authenticated_user(\*\*params) -> UserGetAuthenticatedUserResponse - client.users.set_suspended(\*\*params) -> object ## Pats @@ -496,4 +496,4 @@ Methods: - client.users.pats.list(\*\*params) -> PatListResponse - client.users.pats.delete(\*\*params) -> object -- client.users.pats.get(\*\*params) -> PatGetResponse +- client.users.pats.get(\*\*params) -> PatGetResponse diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index a81cb701..8246a689 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -58,12 +58,8 @@ def with_streaming_response(self) -> AccountsResourceWithStreamingResponse: def retrieve( self, *, - encoding: Literal["proto", "json"], + body: object, connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,17 +72,8 @@ def retrieve( GetAccount retrieves a single Account. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -106,23 +93,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.AccountService/GetAccount", + body=maybe_transform(body, account_retrieve_params.AccountRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - account_retrieve_params.AccountRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=AccountRetrieveResponse, ) @@ -179,12 +154,9 @@ def delete( def get_sso_login_url( self, *, - encoding: Literal["proto", "json"], + return_to: str, connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + email: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -197,16 +169,11 @@ def get_sso_login_url( GetSSOLoginURL returns the URL to redirect the user to for SSO login. Args: - encoding: Define which encoding or 'Message-Codec' to use + return_to: return_to is the URL the user will be redirected to after login connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + email: email is the email the user wants to login with connect_timeout_ms: Define the timeout, in ms @@ -227,23 +194,17 @@ def get_sso_login_url( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.AccountService/GetSSOLoginURL", + body=maybe_transform( + { + "return_to": return_to, + "email": email, + }, + account_get_sso_login_url_params.AccountGetSSOLoginURLParams, + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - account_get_sso_login_url_params.AccountGetSSOLoginURLParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=AccountGetSSOLoginURLResponse, ) @@ -345,12 +306,8 @@ def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse: async def retrieve( self, *, - encoding: Literal["proto", "json"], + body: object, connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -363,17 +320,8 @@ async def retrieve( GetAccount retrieves a single Account. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -393,23 +341,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.AccountService/GetAccount", + body=await async_maybe_transform(body, account_retrieve_params.AccountRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - account_retrieve_params.AccountRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=AccountRetrieveResponse, ) @@ -466,12 +402,9 @@ async def delete( async def get_sso_login_url( self, *, - encoding: Literal["proto", "json"], + return_to: str, connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + email: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -484,16 +417,11 @@ async def get_sso_login_url( GetSSOLoginURL returns the URL to redirect the user to for SSO login. Args: - encoding: Define which encoding or 'Message-Codec' to use + return_to: return_to is the URL the user will be redirected to after login connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + email: email is the email the user wants to login with connect_timeout_ms: Define the timeout, in ms @@ -514,23 +442,17 @@ async def get_sso_login_url( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.AccountService/GetSSOLoginURL", + body=await async_maybe_transform( + { + "return_to": return_to, + "email": email, + }, + account_get_sso_login_url_params.AccountGetSSOLoginURLParams, + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - account_get_sso_login_url_params.AccountGetSSOLoginURLParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=AccountGetSSOLoginURLResponse, ) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 1b4779a9..0f41191d 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -53,12 +53,8 @@ def with_streaming_response(self) -> EditorsResourceWithStreamingResponse: def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -71,16 +67,9 @@ def retrieve( GetEditor returns the editor with the given ID Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + id: id is the ID of the editor to get connect_timeout_ms: Define the timeout, in ms @@ -101,23 +90,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.EditorService/GetEditor", + body=maybe_transform({"id": id}, editor_retrieve_params.EditorRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - editor_retrieve_params.EditorRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=EditorRetrieveResponse, ) @@ -280,12 +257,8 @@ def with_streaming_response(self) -> AsyncEditorsResourceWithStreamingResponse: async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -298,16 +271,9 @@ async def retrieve( GetEditor returns the editor with the given ID Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + id: id is the ID of the editor to get connect_timeout_ms: Define the timeout, in ms @@ -328,23 +294,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.EditorService/GetEditor", + body=await async_maybe_transform({"id": id}, editor_retrieve_params.EditorRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - editor_retrieve_params.EditorRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=EditorRetrieveResponse, ) diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index dec0277c..f3e82f24 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -117,12 +117,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -135,17 +131,8 @@ def retrieve( GetService Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -165,23 +152,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.EnvironmentAutomationService/GetService", + body=maybe_transform({"id": id}, service_retrieve_params.ServiceRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - service_retrieve_params.ServiceRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ServiceRetrieveResponse, ) @@ -567,12 +542,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -585,17 +556,8 @@ async def retrieve( GetService Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -615,23 +577,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetService", + body=await async_maybe_transform({"id": id}, service_retrieve_params.ServiceRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - service_retrieve_params.ServiceRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ServiceRetrieveResponse, ) diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index a6206e0f..e3f0557c 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -56,12 +56,8 @@ def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -74,17 +70,8 @@ def retrieve( GetTaskExecution Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -104,23 +91,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + body=maybe_transform({"id": id}, execution_retrieve_params.ExecutionRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - execution_retrieve_params.ExecutionRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ExecutionRetrieveResponse, ) @@ -268,12 +243,8 @@ def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingRespons async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -286,17 +257,8 @@ async def retrieve( GetTaskExecution Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -316,23 +278,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", + body=await async_maybe_transform({"id": id}, execution_retrieve_params.ExecutionRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - execution_retrieve_params.ExecutionRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ExecutionRetrieveResponse, ) diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 40e8a3d8..15d4794e 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -132,12 +132,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -150,17 +146,8 @@ def retrieve( GetTask Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -180,23 +167,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.EnvironmentAutomationService/GetTask", + body=maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - task_retrieve_params.TaskRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=TaskRetrieveResponse, ) @@ -515,12 +490,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -533,17 +504,8 @@ async def retrieve( GetTask Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -563,23 +525,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetTask", + body=await async_maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - task_retrieve_params.TaskRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=TaskRetrieveResponse, ) diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index edba88c0..5400fae6 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -142,12 +142,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -163,16 +159,9 @@ def retrieve( +return NOT_FOUND Environment does not exist Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + environment_id: environment_id specifies the environment to get connect_timeout_ms: Define the timeout, in ms @@ -193,23 +182,13 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.EnvironmentService/GetEnvironment", + body=maybe_transform( + {"environment_id": environment_id}, environment_retrieve_params.EnvironmentRetrieveParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - environment_retrieve_params.EnvironmentRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=EnvironmentRetrieveResponse, ) @@ -813,12 +792,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + environment_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -834,16 +809,9 @@ async def retrieve( +return NOT_FOUND Environment does not exist Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + environment_id: environment_id specifies the environment to get connect_timeout_ms: Define the timeout, in ms @@ -864,23 +832,13 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.EnvironmentService/GetEnvironment", + body=await async_maybe_transform( + {"environment_id": environment_id}, environment_retrieve_params.EnvironmentRetrieveParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - environment_retrieve_params.EnvironmentRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=EnvironmentRetrieveResponse, ) diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 66ece2e6..1dd95ed9 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -109,12 +109,8 @@ def exchange_token( def get_authenticated_identity( self, *, - encoding: Literal["proto", "json"], + body: object, connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -127,17 +123,8 @@ def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -157,23 +144,13 @@ def get_authenticated_identity( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", + body=maybe_transform( + body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=IdentityGetAuthenticatedIdentityResponse, ) @@ -301,12 +278,8 @@ async def exchange_token( async def get_authenticated_identity( self, *, - encoding: Literal["proto", "json"], + body: object, connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -319,17 +292,8 @@ async def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -349,23 +313,13 @@ async def get_authenticated_identity( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", + body=await async_maybe_transform( + body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=IdentityGetAuthenticatedIdentityResponse, ) diff --git a/src/gitpod/resources/organizations/invites.py b/src/gitpod/resources/organizations/invites.py index 81e26e80..7f5333f8 100644 --- a/src/gitpod/resources/organizations/invites.py +++ b/src/gitpod/resources/organizations/invites.py @@ -151,12 +151,8 @@ def retrieve( def get_summary( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + invite_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -172,17 +168,8 @@ def get_summary( Used to discover which organization an invite is for. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -202,23 +189,11 @@ def get_summary( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", + body=maybe_transform({"invite_id": invite_id}, invite_get_summary_params.InviteGetSummaryParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - invite_get_summary_params.InviteGetSummaryParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=InviteGetSummaryResponse, ) @@ -349,12 +324,8 @@ async def retrieve( async def get_summary( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + invite_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -370,17 +341,8 @@ async def get_summary( Used to discover which organization an invite is for. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -400,23 +362,13 @@ async def get_summary( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", + body=await async_maybe_transform( + {"invite_id": invite_id}, invite_get_summary_params.InviteGetSummaryParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - invite_get_summary_params.InviteGetSummaryParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=InviteGetSummaryResponse, ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 04dddd1a..9597f1f5 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -155,12 +155,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -173,16 +169,9 @@ def retrieve( GetOrganization retrieves a single Organization. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + organization_id: organization_id is the unique identifier of the Organization to retreive. connect_timeout_ms: Define the timeout, in ms @@ -203,23 +192,13 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.OrganizationService/GetOrganization", + body=maybe_transform( + {"organization_id": organization_id}, organization_retrieve_params.OrganizationRetrieveParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - organization_retrieve_params.OrganizationRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=OrganizationRetrieveResponse, ) @@ -834,12 +813,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -852,16 +827,9 @@ async def retrieve( GetOrganization retrieves a single Organization. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + organization_id: organization_id is the unique identifier of the Organization to retreive. connect_timeout_ms: Define the timeout, in ms @@ -882,23 +850,13 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.OrganizationService/GetOrganization", + body=await async_maybe_transform( + {"organization_id": organization_id}, organization_retrieve_params.OrganizationRetrieveParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - organization_retrieve_params.OrganizationRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=OrganizationRetrieveResponse, ) diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 986668af..d3207ff8 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -128,12 +128,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + sso_configuration_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -146,16 +142,9 @@ def retrieve( GetSSOConfiguration returns an SSO configuration. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to get connect_timeout_ms: Define the timeout, in ms @@ -176,23 +165,14 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.OrganizationService/GetSSOConfiguration", + body=maybe_transform( + {"sso_configuration_id": sso_configuration_id}, + sso_configuration_retrieve_params.SSOConfigurationRetrieveParams, + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - sso_configuration_retrieve_params.SSOConfigurationRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=SSOConfigurationRetrieveResponse, ) @@ -635,12 +615,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + sso_configuration_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -653,16 +629,9 @@ async def retrieve( GetSSOConfiguration returns an SSO configuration. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to get connect_timeout_ms: Define the timeout, in ms @@ -683,23 +652,14 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.OrganizationService/GetSSOConfiguration", + body=await async_maybe_transform( + {"sso_configuration_id": sso_configuration_id}, + sso_configuration_retrieve_params.SSOConfigurationRetrieveParams, + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - sso_configuration_retrieve_params.SSOConfigurationRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=SSOConfigurationRetrieveResponse, ) diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index b9a75132..d62320e2 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -151,12 +151,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -169,16 +165,9 @@ def retrieve( GetProject retrieves a single Project. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + project_id: project_id specifies the project identifier connect_timeout_ms: Define the timeout, in ms @@ -199,23 +188,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.ProjectService/GetProject", + body=maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - project_retrieve_params.ProjectRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ProjectRetrieveResponse, ) @@ -728,12 +705,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -746,16 +719,9 @@ async def retrieve( GetProject retrieves a single Project. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + project_id: project_id specifies the project identifier connect_timeout_ms: Define the timeout, in ms @@ -776,23 +742,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.ProjectService/GetProject", + body=await async_maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - project_retrieve_params.ProjectRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ProjectRetrieveResponse, ) diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index e7a3e500..63025cce 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -118,12 +118,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + environment_class_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -136,17 +132,8 @@ def retrieve( GetEnvironmentClass returns a single environment class configured for a runner. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -166,23 +153,14 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.RunnerConfigurationService/GetEnvironmentClass", + body=maybe_transform( + {"environment_class_id": environment_class_id}, + environment_class_retrieve_params.EnvironmentClassRetrieveParams, + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - environment_class_retrieve_params.EnvironmentClassRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=EnvironmentClassRetrieveResponse, ) @@ -484,12 +462,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + environment_class_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -502,17 +476,8 @@ async def retrieve( GetEnvironmentClass returns a single environment class configured for a runner. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -532,23 +497,14 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.RunnerConfigurationService/GetEnvironmentClass", + body=await async_maybe_transform( + {"environment_class_id": environment_class_id}, + environment_class_retrieve_params.EnvironmentClassRetrieveParams, + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - environment_class_retrieve_params.EnvironmentClassRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=EnvironmentClassRetrieveResponse, ) diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 13ed925f..ebf8f414 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -225,12 +225,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -243,17 +239,8 @@ def retrieve( GetHostAuthenticationToken Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -273,23 +260,13 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + body=maybe_transform( + {"id": id}, host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=HostAuthenticationTokenRetrieveResponse, ) @@ -829,12 +806,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -847,17 +820,8 @@ async def retrieve( GetHostAuthenticationToken Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -877,23 +841,13 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", + body=await async_maybe_transform( + {"id": id}, host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - host_authentication_token_retrieve_params.HostAuthenticationTokenRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=HostAuthenticationTokenRetrieveResponse, ) diff --git a/src/gitpod/resources/runners/configurations/schema.py b/src/gitpod/resources/runners/configurations/schema.py index 347bf5db..5bb5cff6 100644 --- a/src/gitpod/resources/runners/configurations/schema.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -51,12 +51,8 @@ def with_streaming_response(self) -> SchemaResourceWithStreamingResponse: def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -69,17 +65,8 @@ def retrieve( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -99,23 +86,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + body=maybe_transform({"runner_id": runner_id}, schema_retrieve_params.SchemaRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - schema_retrieve_params.SchemaRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=SchemaRetrieveResponse, ) @@ -144,12 +119,8 @@ def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse: async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -162,17 +133,8 @@ async def retrieve( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -192,23 +154,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", + body=await async_maybe_transform({"runner_id": runner_id}, schema_retrieve_params.SchemaRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - schema_retrieve_params.SchemaRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=SchemaRetrieveResponse, ) diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 8c002740..19f8d776 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -173,12 +173,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -191,17 +187,8 @@ def retrieve( GetSCMIntegration returns a single SCM integration configured for a runner. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -221,23 +208,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.RunnerConfigurationService/GetSCMIntegration", + body=maybe_transform({"id": id}, scm_integration_retrieve_params.ScmIntegrationRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - scm_integration_retrieve_params.ScmIntegrationRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ScmIntegrationRetrieveResponse, ) @@ -660,12 +635,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -678,17 +649,8 @@ async def retrieve( GetSCMIntegration returns a single SCM integration configured for a runner. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -708,23 +670,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.RunnerConfigurationService/GetSCMIntegration", + body=await async_maybe_transform({"id": id}, scm_integration_retrieve_params.ScmIntegrationRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - scm_integration_retrieve_params.ScmIntegrationRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ScmIntegrationRetrieveResponse, ) diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index d8d7edf5..5d6ff286 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -169,12 +169,8 @@ def create( def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -187,17 +183,8 @@ def retrieve( GetRunner returns a single runner. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -217,23 +204,11 @@ def retrieve( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.RunnerService/GetRunner", + body=maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - runner_retrieve_params.RunnerRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=RunnerRetrieveResponse, ) @@ -760,12 +735,8 @@ async def create( async def retrieve( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -778,17 +749,8 @@ async def retrieve( GetRunner returns a single runner. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -808,23 +770,11 @@ async def retrieve( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.RunnerService/GetRunner", + body=await async_maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - runner_retrieve_params.RunnerRetrieveParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=RunnerRetrieveResponse, ) diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 8e50019b..e2a7da0c 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -312,12 +312,8 @@ def delete( def get_value( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + secret_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -331,17 +327,8 @@ def get_value( this operation, and only for secrets specified on the EnvironmentSpec. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -361,23 +348,11 @@ def get_value( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.SecretService/GetSecretValue", + body=maybe_transform({"secret_id": secret_id}, secret_get_value_params.SecretGetValueParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - secret_get_value_params.SecretGetValueParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=SecretGetValueResponse, ) @@ -714,12 +689,8 @@ async def delete( async def get_value( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + secret_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -733,17 +704,8 @@ async def get_value( this operation, and only for secrets specified on the EnvironmentSpec. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -763,23 +725,11 @@ async def get_value( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.SecretService/GetSecretValue", + body=await async_maybe_transform({"secret_id": secret_id}, secret_get_value_params.SecretGetValueParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - secret_get_value_params.SecretGetValueParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=SecretGetValueResponse, ) diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 3edadb79..766fe0a8 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -173,12 +173,8 @@ def delete( def get( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -191,17 +187,8 @@ def get( GetPersonalAccessToken Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -221,23 +208,11 @@ def get( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.UserService/GetPersonalAccessToken", + body=maybe_transform({"personal_access_token_id": personal_access_token_id}, pat_get_params.PatGetParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - pat_get_params.PatGetParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=PatGetResponse, ) @@ -387,12 +362,8 @@ async def delete( async def get( self, *, - encoding: Literal["proto", "json"], connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -405,17 +376,8 @@ async def get( GetPersonalAccessToken Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -435,23 +397,13 @@ async def get( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.UserService/GetPersonalAccessToken", + body=await async_maybe_transform( + {"personal_access_token_id": personal_access_token_id}, pat_get_params.PatGetParams + ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - pat_get_params.PatGetParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=PatGetResponse, ) diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index e016457c..04174ae7 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -63,12 +63,8 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: def get_authenticated_user( self, *, - encoding: Literal["proto", "json"], + body: object, connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -81,17 +77,8 @@ def get_authenticated_user( GetAuthenticatedUser allows to retrieve the current user. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -111,23 +98,11 @@ def get_authenticated_user( ), **(extra_headers or {}), } - return self._get( + return self._post( "/gitpod.v1.UserService/GetAuthenticatedUser", + body=maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - user_get_authenticated_user_params.UserGetAuthenticatedUserParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=UserGetAuthenticatedUserResponse, ) @@ -214,12 +189,8 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: async def get_authenticated_user( self, *, - encoding: Literal["proto", "json"], + body: object, connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -232,17 +203,8 @@ async def get_authenticated_user( GetAuthenticatedUser allows to retrieve the current user. Args: - encoding: Define which encoding or 'Message-Codec' to use - connect_protocol_version: Define the version of the Connect protocol - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - connect_timeout_ms: Define the timeout, in ms extra_headers: Send extra headers @@ -262,23 +224,11 @@ async def get_authenticated_user( ), **(extra_headers or {}), } - return await self._get( + return await self._post( "/gitpod.v1.UserService/GetAuthenticatedUser", + body=await async_maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, - }, - user_get_authenticated_user_params.UserGetAuthenticatedUserParams, - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=UserGetAuthenticatedUserResponse, ) diff --git a/src/gitpod/types/account_get_sso_login_url_params.py b/src/gitpod/types/account_get_sso_login_url_params.py index 0c39c77c..adf2e060 100644 --- a/src/gitpod/types/account_get_sso_login_url_params.py +++ b/src/gitpod/types/account_get_sso_login_url_params.py @@ -10,25 +10,14 @@ class AccountGetSSOLoginURLParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + return_to: Required[Annotated[str, PropertyInfo(alias="returnTo")]] + """return_to is the URL the user will be redirected to after login""" connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + email: str + """email is the email the user wants to login with""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/account_retrieve_params.py b/src/gitpod/types/account_retrieve_params.py index 9330e5a0..2ec77f46 100644 --- a/src/gitpod/types/account_retrieve_params.py +++ b/src/gitpod/types/account_retrieve_params.py @@ -10,25 +10,10 @@ class AccountRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + body: Required[object] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/editor_retrieve_params.py b/src/gitpod/types/editor_retrieve_params.py index 68bde29c..a0a1e574 100644 --- a/src/gitpod/types/editor_retrieve_params.py +++ b/src/gitpod/types/editor_retrieve_params.py @@ -10,25 +10,11 @@ class EditorRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + id: str + """id is the ID of the editor to get""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_retrieve_params.py b/src/gitpod/types/environment_retrieve_params.py index 8079b8a5..a06329ae 100644 --- a/src/gitpod/types/environment_retrieve_params.py +++ b/src/gitpod/types/environment_retrieve_params.py @@ -10,25 +10,11 @@ class EnvironmentRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environment_id specifies the environment to get""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_retrieve_params.py b/src/gitpod/types/environments/automations/service_retrieve_params.py index 37b1cc11..247621f6 100644 --- a/src/gitpod/types/environments/automations/service_retrieve_params.py +++ b/src/gitpod/types/environments/automations/service_retrieve_params.py @@ -10,25 +10,10 @@ class ServiceRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + id: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_retrieve_params.py b/src/gitpod/types/environments/automations/task_retrieve_params.py index ea568b41..b0d4d35b 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_params.py +++ b/src/gitpod/types/environments/automations/task_retrieve_params.py @@ -10,25 +10,10 @@ class TaskRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + id: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py index f10cdf36..2d751ff9 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py @@ -10,25 +10,10 @@ class ExecutionRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + id: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_authenticated_identity_params.py b/src/gitpod/types/identity_get_authenticated_identity_params.py index 1c9f8e40..457fe1f9 100644 --- a/src/gitpod/types/identity_get_authenticated_identity_params.py +++ b/src/gitpod/types/identity_get_authenticated_identity_params.py @@ -10,25 +10,10 @@ class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + body: Required[object] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_retrieve_params.py b/src/gitpod/types/organization_retrieve_params.py index 5fb3aea3..f9526f62 100644 --- a/src/gitpod/types/organization_retrieve_params.py +++ b/src/gitpod/types/organization_retrieve_params.py @@ -10,25 +10,11 @@ class OrganizationRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the unique identifier of the Organization to retreive.""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_get_summary_params.py b/src/gitpod/types/organizations/invite_get_summary_params.py index 38befbf2..33c941d1 100644 --- a/src/gitpod/types/organizations/invite_get_summary_params.py +++ b/src/gitpod/types/organizations/invite_get_summary_params.py @@ -10,25 +10,10 @@ class InviteGetSummaryParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + invite_id: Annotated[str, PropertyInfo(alias="inviteId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/sso_configuration_retrieve_params.py b/src/gitpod/types/organizations/sso_configuration_retrieve_params.py index 6f723393..c679072c 100644 --- a/src/gitpod/types/organizations/sso_configuration_retrieve_params.py +++ b/src/gitpod/types/organizations/sso_configuration_retrieve_params.py @@ -10,25 +10,11 @@ class SSOConfigurationRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + sso_configuration_id: Annotated[str, PropertyInfo(alias="ssoConfigurationId")] + """sso_configuration_id is the ID of the SSO configuration to get""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_retrieve_params.py b/src/gitpod/types/project_retrieve_params.py index 121cff2f..42abf44b 100644 --- a/src/gitpod/types/project_retrieve_params.py +++ b/src/gitpod/types/project_retrieve_params.py @@ -10,25 +10,11 @@ class ProjectRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_retrieve_params.py b/src/gitpod/types/runner_retrieve_params.py index bff25582..786b07dd 100644 --- a/src/gitpod/types/runner_retrieve_params.py +++ b/src/gitpod/types/runner_retrieve_params.py @@ -10,25 +10,10 @@ class RunnerRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py b/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py index 56caf95c..de55e417 100644 --- a/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py @@ -10,25 +10,10 @@ class EnvironmentClassRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py index c0c1092e..7933cb2a 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py @@ -10,25 +10,10 @@ class HostAuthenticationTokenRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + id: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/schema_retrieve_params.py b/src/gitpod/types/runners/configurations/schema_retrieve_params.py index 64bc845d..b69e5107 100644 --- a/src/gitpod/types/runners/configurations/schema_retrieve_params.py +++ b/src/gitpod/types/runners/configurations/schema_retrieve_params.py @@ -10,25 +10,10 @@ class SchemaRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py b/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py index 4f26afc1..093d3d61 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py @@ -10,25 +10,10 @@ class ScmIntegrationRetrieveParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + id: str connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/secret_get_value_params.py b/src/gitpod/types/secret_get_value_params.py index 7b5a866c..3b183130 100644 --- a/src/gitpod/types/secret_get_value_params.py +++ b/src/gitpod/types/secret_get_value_params.py @@ -10,25 +10,10 @@ class SecretGetValueParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + secret_id: Annotated[str, PropertyInfo(alias="secretId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/user_get_authenticated_user_params.py b/src/gitpod/types/user_get_authenticated_user_params.py index 010f08d3..2b7ca601 100644 --- a/src/gitpod/types/user_get_authenticated_user_params.py +++ b/src/gitpod/types/user_get_authenticated_user_params.py @@ -10,25 +10,10 @@ class UserGetAuthenticatedUserParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + body: Required[object] connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/src/gitpod/types/users/pat_get_params.py b/src/gitpod/types/users/pat_get_params.py index bad3d238..b57c1197 100644 --- a/src/gitpod/types/users/pat_get_params.py +++ b/src/gitpod/types/users/pat_get_params.py @@ -10,25 +10,10 @@ class PatGetParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] """Define the version of the Connect protocol""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - - connect: Literal["v1"] - """Define the version of the Connect protocol""" - - message: str + personal_access_token_id: Annotated[str, PropertyInfo(alias="personalAccessTokenId")] connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] """Define the timeout, in ms""" diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index 2f9f5614..d2771238 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -23,7 +23,6 @@ class TestExecutions: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @@ -31,12 +30,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @@ -44,7 +39,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -56,7 +50,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -161,7 +154,6 @@ class TestAsyncExecutions: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @@ -169,12 +161,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @@ -182,7 +170,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -194,7 +181,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index d523efc0..2f8c9b15 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -92,7 +92,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @@ -100,12 +99,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @@ -113,7 +108,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -125,7 +119,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -421,7 +414,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @@ -429,12 +421,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @@ -442,7 +430,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -454,7 +441,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 1ccf9ffa..b8c7fef1 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -87,7 +87,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -95,12 +94,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -108,7 +103,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -120,7 +114,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -369,7 +362,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -377,12 +369,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -390,7 +378,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -402,7 +389,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index 246a07dc..877e888f 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -104,7 +104,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_get_summary(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @@ -112,12 +111,8 @@ def test_method_get_summary(self, client: Gitpod) -> None: @parametrize def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @@ -125,7 +120,6 @@ def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_get_summary(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.get_summary( - encoding="proto", connect_protocol_version=1, ) @@ -137,7 +131,6 @@ def test_raw_response_get_summary(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_summary(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.get_summary( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -235,7 +228,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @@ -243,12 +235,8 @@ async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @@ -256,7 +244,6 @@ async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpo @parametrize async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.get_summary( - encoding="proto", connect_protocol_version=1, ) @@ -268,7 +255,6 @@ async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None @parametrize async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.get_summary( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index fc905847..8a7cedea 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -68,7 +68,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @@ -76,12 +75,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @@ -89,7 +84,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -101,7 +95,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -465,7 +458,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @@ -473,12 +465,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @@ -486,7 +474,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -498,7 +485,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 41ce1135..2e292f15 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -72,7 +72,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @@ -80,12 +79,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @@ -93,7 +88,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -105,7 +99,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -347,7 +340,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @@ -355,12 +347,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @@ -368,7 +356,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -380,7 +367,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 1153fe3e..1cc1de44 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -71,7 +71,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @@ -79,12 +78,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @@ -92,7 +87,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -104,7 +98,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -384,7 +377,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @@ -392,12 +384,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @@ -405,7 +393,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -417,7 +404,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index 87f404ad..502a5473 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -20,7 +20,6 @@ class TestSchema: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @@ -28,12 +27,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @@ -41,7 +36,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.schema.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -53,7 +47,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.schema.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -71,7 +64,6 @@ class TestAsyncSchema: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @@ -79,12 +71,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @@ -92,7 +80,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.schema.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -104,7 +91,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.schema.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index c22ad989..a42ff107 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -110,7 +110,6 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @@ -118,12 +117,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @@ -131,7 +126,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -143,7 +137,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -463,7 +456,6 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @@ -471,12 +463,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @@ -484,7 +472,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -496,7 +483,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index c32b438d..3a8ce5a4 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -24,7 +24,7 @@ class TestAccounts: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: account = client.accounts.retrieve( - encoding="proto", + body={}, connect_protocol_version=1, ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) @@ -32,12 +32,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: account = client.accounts.retrieve( - encoding="proto", + body={}, connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", connect_timeout_ms=0, ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) @@ -45,7 +41,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.retrieve( - encoding="proto", + body={}, connect_protocol_version=1, ) @@ -57,7 +53,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.retrieve( - encoding="proto", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -111,7 +107,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( - encoding="proto", + return_to="https://example.com", connect_protocol_version=1, ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -119,12 +115,9 @@ def test_method_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( - encoding="proto", + return_to="https://example.com", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + email="dev@stainlessapi.com", connect_timeout_ms=0, ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -132,7 +125,7 @@ def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.get_sso_login_url( - encoding="proto", + return_to="https://example.com", connect_protocol_version=1, ) @@ -144,7 +137,7 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.get_sso_login_url( - encoding="proto", + return_to="https://example.com", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -209,7 +202,7 @@ class TestAsyncAccounts: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve( - encoding="proto", + body={}, connect_protocol_version=1, ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) @@ -217,12 +210,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve( - encoding="proto", + body={}, connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", connect_timeout_ms=0, ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) @@ -230,7 +219,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.retrieve( - encoding="proto", + body={}, connect_protocol_version=1, ) @@ -242,7 +231,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.retrieve( - encoding="proto", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -296,7 +285,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( - encoding="proto", + return_to="https://example.com", connect_protocol_version=1, ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -304,12 +293,9 @@ async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( - encoding="proto", + return_to="https://example.com", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + email="dev@stainlessapi.com", connect_timeout_ms=0, ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -317,7 +303,7 @@ async def test_method_get_sso_login_url_with_all_params(self, async_client: Asyn @parametrize async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.get_sso_login_url( - encoding="proto", + return_to="https://example.com", connect_protocol_version=1, ) @@ -329,7 +315,7 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.get_sso_login_url( - encoding="proto", + return_to="https://example.com", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 776748cd..ae3e02f2 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -24,7 +24,6 @@ class TestEditors: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: editor = client.editors.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @@ -32,12 +31,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: editor = client.editors.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="id", connect_timeout_ms=0, ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @@ -45,7 +40,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.editors.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -57,7 +51,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.editors.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -164,7 +157,6 @@ class TestAsyncEditors: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @@ -172,12 +164,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + id="id", connect_timeout_ms=0, ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @@ -185,7 +173,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -197,7 +184,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 6c117e93..fd55df72 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -112,7 +112,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment = client.environments.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @@ -120,12 +119,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment = client.environments.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @@ -133,7 +128,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -145,7 +139,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -672,7 +665,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @@ -680,12 +672,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @@ -693,7 +681,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -705,7 +692,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index a7d93100..ae92d5e8 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -64,7 +64,7 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: @parametrize def test_method_get_authenticated_identity(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( - encoding="proto", + body={}, connect_protocol_version=1, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -72,12 +72,8 @@ def test_method_get_authenticated_identity(self, client: Gitpod) -> None: @parametrize def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( - encoding="proto", + body={}, connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -85,7 +81,7 @@ def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) @parametrize def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_authenticated_identity( - encoding="proto", + body={}, connect_protocol_version=1, ) @@ -97,7 +93,7 @@ def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_authenticated_identity( - encoding="proto", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -195,7 +191,7 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod @parametrize async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( - encoding="proto", + body={}, connect_protocol_version=1, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -203,12 +199,8 @@ async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod @parametrize async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( - encoding="proto", + body={}, connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -216,7 +208,7 @@ async def test_method_get_authenticated_identity_with_all_params(self, async_cli @parametrize async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_authenticated_identity( - encoding="proto", + body={}, connect_protocol_version=1, ) @@ -228,7 +220,7 @@ async def test_raw_response_get_authenticated_identity(self, async_client: Async @parametrize async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_authenticated_identity( - encoding="proto", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 9caa1fea..73fee220 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -69,7 +69,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: organization = client.organizations.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @@ -77,12 +76,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @@ -90,7 +85,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -102,7 +96,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -550,7 +543,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @@ -558,12 +550,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @@ -571,7 +559,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -583,7 +570,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 0ecb83c0..a607e84e 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -76,7 +76,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: project = client.projects.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -84,12 +83,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -97,7 +92,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.projects.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -109,7 +103,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.projects.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -520,7 +513,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -528,12 +520,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -541,7 +529,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -553,7 +540,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index ecb141d5..cc697546 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -77,7 +77,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: runner = client.runners.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -85,12 +84,8 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -98,7 +93,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -110,7 +104,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -474,7 +467,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -482,12 +474,8 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -495,7 +483,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.retrieve( - encoding="proto", connect_protocol_version=1, ) @@ -507,7 +494,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.retrieve( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index a1936fad..a7a0be4b 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -203,7 +203,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_get_value(self, client: Gitpod) -> None: secret = client.secrets.get_value( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @@ -211,12 +210,8 @@ def test_method_get_value(self, client: Gitpod) -> None: @parametrize def test_method_get_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.get_value( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @@ -224,7 +219,6 @@ def test_method_get_value_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_get_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.get_value( - encoding="proto", connect_protocol_version=1, ) @@ -236,7 +230,6 @@ def test_raw_response_get_value(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.get_value( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -474,7 +467,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_get_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @@ -482,12 +474,8 @@ async def test_method_get_value(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @@ -495,7 +483,6 @@ async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.get_value( - encoding="proto", connect_protocol_version=1, ) @@ -507,7 +494,6 @@ async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.get_value( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index 84d9bfa2..edef99ac 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -20,7 +20,7 @@ class TestUsers: @parametrize def test_method_get_authenticated_user(self, client: Gitpod) -> None: user = client.users.get_authenticated_user( - encoding="proto", + body={}, connect_protocol_version=1, ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) @@ -28,12 +28,8 @@ def test_method_get_authenticated_user(self, client: Gitpod) -> None: @parametrize def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> None: user = client.users.get_authenticated_user( - encoding="proto", + body={}, connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", connect_timeout_ms=0, ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) @@ -41,7 +37,7 @@ def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> @parametrize def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: response = client.users.with_raw_response.get_authenticated_user( - encoding="proto", + body={}, connect_protocol_version=1, ) @@ -53,7 +49,7 @@ def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None: with client.users.with_streaming_response.get_authenticated_user( - encoding="proto", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed @@ -112,7 +108,7 @@ class TestAsyncUsers: @parametrize async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user( - encoding="proto", + body={}, connect_protocol_version=1, ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) @@ -120,12 +116,8 @@ async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> @parametrize async def test_method_get_authenticated_user_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user( - encoding="proto", + body={}, connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", connect_timeout_ms=0, ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) @@ -133,7 +125,7 @@ async def test_method_get_authenticated_user_with_all_params(self, async_client: @parametrize async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.get_authenticated_user( - encoding="proto", + body={}, connect_protocol_version=1, ) @@ -145,7 +137,7 @@ async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitp @parametrize async def test_streaming_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.get_authenticated_user( - encoding="proto", + body={}, connect_protocol_version=1, ) as response: assert not response.is_closed diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index cd34d91c..1904dc1c 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -107,7 +107,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_get(self, client: Gitpod) -> None: pat = client.users.pats.get( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(PatGetResponse, pat, path=["response"]) @@ -115,12 +114,8 @@ def test_method_get(self, client: Gitpod) -> None: @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.get( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(PatGetResponse, pat, path=["response"]) @@ -128,7 +123,6 @@ def test_method_get_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_get(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.get( - encoding="proto", connect_protocol_version=1, ) @@ -140,7 +134,6 @@ def test_raw_response_get(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.get( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed @@ -245,7 +238,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get( - encoding="proto", connect_protocol_version=1, ) assert_matches_type(PatGetResponse, pat, path=["response"]) @@ -253,12 +245,8 @@ async def test_method_get(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get( - encoding="proto", connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", + personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connect_timeout_ms=0, ) assert_matches_type(PatGetResponse, pat, path=["response"]) @@ -266,7 +254,6 @@ async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> No @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.get( - encoding="proto", connect_protocol_version=1, ) @@ -278,7 +265,6 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.get( - encoding="proto", connect_protocol_version=1, ) as response: assert not response.is_closed From eb2c24deae5df53c357d63179fac35677f5256a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 03:15:40 +0000 Subject: [PATCH 062/505] chore(internal): change default timeout to an int --- src/gitpod/_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitpod/_constants.py b/src/gitpod/_constants.py index a2ac3b6f..6ddf2c71 100644 --- a/src/gitpod/_constants.py +++ b/src/gitpod/_constants.py @@ -6,7 +6,7 @@ OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" # default timeout is 1 minute -DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0) +DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) DEFAULT_MAX_RETRIES = 2 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) From 571bfa1d6599f43ace43582b3c96362e50fa2e4a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 03:43:14 +0000 Subject: [PATCH 063/505] chore(internal): codegen related update --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- scripts/utils/ruffen-docs.py | 4 ++-- src/gitpod/_models.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1a28968c..4fb1f51f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -177,7 +177,7 @@ select = [ "T201", "T203", # misuse of typing.TYPE_CHECKING - "TCH004", + "TC004", # import rules "TID251", ] diff --git a/requirements-dev.lock b/requirements-dev.lock index a3778f92..a0509181 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -78,7 +78,7 @@ pytz==2023.3.post1 # via dirty-equals respx==0.22.0 rich==13.7.1 -ruff==0.6.9 +ruff==0.9.4 setuptools==68.2.2 # via nodeenv six==1.16.0 diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py index 37b3d94f..0cf2bd2f 100644 --- a/scripts/utils/ruffen-docs.py +++ b/scripts/utils/ruffen-docs.py @@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str: with _collect_error(match): code = format_code_block(code) code = textwrap.indent(code, match["indent"]) - return f'{match["before"]}{code}{match["after"]}' + return f"{match['before']}{code}{match['after']}" def _pycon_match(match: Match[str]) -> str: code = "" @@ -97,7 +97,7 @@ def finish_fragment() -> None: def _md_pycon_match(match: Match[str]) -> str: code = _pycon_match(match) code = textwrap.indent(code, match["indent"]) - return f'{match["before"]}{code}{match["after"]}' + return f"{match['before']}{code}{match['after']}" src = MD_RE.sub(_md_match, src) src = MD_PYCON_RE.sub(_md_pycon_match, src) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 9a918aab..12c34b7d 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -172,7 +172,7 @@ def to_json( @override def __str__(self) -> str: # mypy complains about an invalid self arg - return f'{self.__repr_name__()}({self.__repr_str__(", ")})' # type: ignore[misc] + return f"{self.__repr_name__()}({self.__repr_str__(', ')})" # type: ignore[misc] # Override the 'construct' method in a way that supports recursive parsing without validation. # Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836. From e72c1f2cf94347784e9d214fa6481bc4ce00e21a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 12:04:58 +0000 Subject: [PATCH 064/505] feat(api): add events streaming --- .stats.yml | 2 +- api.md | 2 +- src/gitpod/_decoders/jsonl.py | 101 +++++++++++++++++++++++++++++ src/gitpod/_response.py | 22 +++++++ src/gitpod/resources/events.py | 23 ++++--- tests/api_resources/test_events.py | 49 +++++++++----- 6 files changed, 171 insertions(+), 28 deletions(-) create mode 100644 src/gitpod/_decoders/jsonl.py diff --git a/.stats.yml b/.stats.yml index fdef86a8..f1e1d640 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2e9f8b8666b2fd4e346a3acbf81a2c82a6f3793e01bc146499708efaf0c250c5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-922f204ec36b8a84ae8f96e73923e92cb2044a14c6497d173f4b7110a090ac30.yml diff --git a/api.md b/api.md index 320dc6f2..894da1c3 100644 --- a/api.md +++ b/api.md @@ -167,7 +167,7 @@ from gitpod.types import EventListResponse, EventWatchResponse Methods: - client.events.list(\*\*params) -> EventListResponse -- client.events.watch(\*\*params) -> EventWatchResponse +- client.events.watch(\*\*params) -> JSONLDecoder[EventWatchResponse] # Groups diff --git a/src/gitpod/_decoders/jsonl.py b/src/gitpod/_decoders/jsonl.py new file mode 100644 index 00000000..e9d29a1c --- /dev/null +++ b/src/gitpod/_decoders/jsonl.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +import json +from typing_extensions import Generic, TypeVar, Iterator, AsyncIterator + +import httpx + +from .._models import construct_type_unchecked + +_T = TypeVar("_T") + + +class JSONLDecoder(Generic[_T]): + """A decoder for [JSON Lines](https://jsonlines.org) format. + + This class provides an iterator over a byte-iterator that parses each JSON Line + into a given type. + """ + + http_response: httpx.Response | None + """The HTTP response this decoder was constructed from""" + + def __init__( + self, *, raw_iterator: Iterator[bytes], line_type: type[_T], http_response: httpx.Response | None + ) -> None: + super().__init__() + self.http_response = http_response + self._raw_iterator = raw_iterator + self._line_type = line_type + self._iterator = self.__decode__() + + def __decode__(self) -> Iterator[_T]: + buf = b"" + for chunk in self._raw_iterator: + for line in chunk.splitlines(keepends=True): + buf += line + if buf.endswith((b"\r", b"\n", b"\r\n")): + yield construct_type_unchecked( + value=json.loads(buf), + type_=self._line_type, + ) + buf = b"" + + # flush + if buf: + yield construct_type_unchecked( + value=json.loads(buf), + type_=self._line_type, + ) + + def __next__(self) -> _T: + return self._iterator.__next__() + + def __iter__(self) -> Iterator[_T]: + for item in self._iterator: + yield item + + +class AsyncJSONLDecoder(Generic[_T]): + """A decoder for [JSON Lines](https://jsonlines.org) format. + + This class provides an async iterator over a byte-iterator that parses each JSON Line + into a given type. + """ + + http_response: httpx.Response | None + + def __init__( + self, *, raw_iterator: AsyncIterator[bytes], line_type: type[_T], http_response: httpx.Response | None + ) -> None: + super().__init__() + self.http_response = http_response + self._raw_iterator = raw_iterator + self._line_type = line_type + self._iterator = self.__decode__() + + async def __decode__(self) -> AsyncIterator[_T]: + buf = b"" + async for chunk in self._raw_iterator: + for line in chunk.splitlines(keepends=True): + buf += line + if buf.endswith((b"\r", b"\n", b"\r\n")): + yield construct_type_unchecked( + value=json.loads(buf), + type_=self._line_type, + ) + buf = b"" + + # flush + if buf: + yield construct_type_unchecked( + value=json.loads(buf), + type_=self._line_type, + ) + + async def __anext__(self) -> _T: + return await self._iterator.__anext__() + + async def __aiter__(self) -> AsyncIterator[_T]: + async for item in self._iterator: + yield item diff --git a/src/gitpod/_response.py b/src/gitpod/_response.py index 9ffc616a..de6c36a6 100644 --- a/src/gitpod/_response.py +++ b/src/gitpod/_response.py @@ -30,6 +30,7 @@ from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type from ._exceptions import GitpodError, APIResponseValidationError +from ._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder if TYPE_CHECKING: from ._models import FinalRequestOptions @@ -138,6 +139,27 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: origin = get_origin(cast_to) or cast_to + if inspect.isclass(origin): + if issubclass(cast(Any, origin), JSONLDecoder): + return cast( + R, + cast("type[JSONLDecoder[Any]]", cast_to)( + raw_iterator=self.http_response.iter_bytes(chunk_size=4096), + line_type=extract_type_arg(cast_to, 0), + http_response=self.http_response, + ), + ) + + if issubclass(cast(Any, origin), AsyncJSONLDecoder): + return cast( + R, + cast("type[AsyncJSONLDecoder[Any]]", cast_to)( + raw_iterator=self.http_response.aiter_bytes(chunk_size=4096), + line_type=extract_type_arg(cast_to, 0), + http_response=self.http_response, + ), + ) + if self._is_sse_stream: if to: if not is_stream_class_type(to): diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index 4dc3ff5a..508d7738 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -24,6 +24,7 @@ async_to_streamed_response_wrapper, ) from .._base_client import make_request_options +from .._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder from ..types.event_list_response import EventListResponse from ..types.event_watch_response import EventWatchResponse @@ -136,7 +137,7 @@ def watch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventWatchResponse: + ) -> JSONLDecoder[EventWatchResponse]: """ WatchEvents streams all requests events to the client @@ -173,7 +174,7 @@ def watch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventWatchResponse: + ) -> JSONLDecoder[EventWatchResponse]: """ WatchEvents streams all requests events to the client @@ -211,8 +212,8 @@ def watch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventWatchResponse: - extra_headers = {"Accept": "application/connect+json", **(extra_headers or {})} + ) -> JSONLDecoder[EventWatchResponse]: + extra_headers = {"Accept": "application/jsonl", **(extra_headers or {})} extra_headers = { **strip_not_given( { @@ -234,7 +235,8 @@ def watch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EventWatchResponse, + cast_to=JSONLDecoder[EventWatchResponse], + stream=True, ) @@ -344,7 +346,7 @@ async def watch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventWatchResponse: + ) -> AsyncJSONLDecoder[EventWatchResponse]: """ WatchEvents streams all requests events to the client @@ -381,7 +383,7 @@ async def watch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventWatchResponse: + ) -> AsyncJSONLDecoder[EventWatchResponse]: """ WatchEvents streams all requests events to the client @@ -419,8 +421,8 @@ async def watch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventWatchResponse: - extra_headers = {"Accept": "application/connect+json", **(extra_headers or {})} + ) -> AsyncJSONLDecoder[EventWatchResponse]: + extra_headers = {"Accept": "application/jsonl", **(extra_headers or {})} extra_headers = { **strip_not_given( { @@ -442,7 +444,8 @@ async def watch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=EventWatchResponse, + cast_to=AsyncJSONLDecoder[EventWatchResponse], + stream=True, ) diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index f539a4b9..d24091bb 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -10,6 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import EventListResponse, EventWatchResponse +from gitpod._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -64,14 +65,16 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_method_watch_overload_1(self, client: Gitpod) -> None: event = client.events.watch( environment_id="environmentId", connect_protocol_version=1, ) - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_method_watch_with_all_params_overload_1(self, client: Gitpod) -> None: event = client.events.watch( @@ -79,8 +82,9 @@ def test_method_watch_with_all_params_overload_1(self, client: Gitpod) -> None: connect_protocol_version=1, connect_timeout_ms=0, ) - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_raw_response_watch_overload_1(self, client: Gitpod) -> None: response = client.events.with_raw_response.watch( @@ -91,8 +95,9 @@ def test_raw_response_watch_overload_1(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_streaming_response_watch_overload_1(self, client: Gitpod) -> None: with client.events.with_streaming_response.watch( @@ -103,18 +108,20 @@ def test_streaming_response_watch_overload_1(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_method_watch_overload_2(self, client: Gitpod) -> None: event = client.events.watch( organization=True, connect_protocol_version=1, ) - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_method_watch_with_all_params_overload_2(self, client: Gitpod) -> None: event = client.events.watch( @@ -122,8 +129,9 @@ def test_method_watch_with_all_params_overload_2(self, client: Gitpod) -> None: connect_protocol_version=1, connect_timeout_ms=0, ) - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_raw_response_watch_overload_2(self, client: Gitpod) -> None: response = client.events.with_raw_response.watch( @@ -134,8 +142,9 @@ def test_raw_response_watch_overload_2(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: with client.events.with_streaming_response.watch( @@ -146,7 +155,7 @@ def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -201,14 +210,16 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_method_watch_overload_1(self, async_client: AsyncGitpod) -> None: event = await async_client.events.watch( environment_id="environmentId", connect_protocol_version=1, ) - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_method_watch_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: event = await async_client.events.watch( @@ -216,8 +227,9 @@ async def test_method_watch_with_all_params_overload_1(self, async_client: Async connect_protocol_version=1, connect_timeout_ms=0, ) - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_raw_response_watch_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.watch( @@ -228,8 +240,9 @@ async def test_raw_response_watch_overload_1(self, async_client: AsyncGitpod) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_streaming_response_watch_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.watch( @@ -240,18 +253,20 @@ async def test_streaming_response_watch_overload_1(self, async_client: AsyncGitp assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_method_watch_overload_2(self, async_client: AsyncGitpod) -> None: event = await async_client.events.watch( organization=True, connect_protocol_version=1, ) - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_method_watch_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: event = await async_client.events.watch( @@ -259,8 +274,9 @@ async def test_method_watch_with_all_params_overload_2(self, async_client: Async connect_protocol_version=1, connect_timeout_ms=0, ) - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_raw_response_watch_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.watch( @@ -271,8 +287,9 @@ async def test_raw_response_watch_overload_2(self, async_client: AsyncGitpod) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_streaming_response_watch_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.watch( @@ -283,6 +300,6 @@ async def test_streaming_response_watch_overload_2(self, async_client: AsyncGitp assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(EventWatchResponse, event, path=["response"]) + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True From 2efc1f6e3853e71448ae5c75bf3e47edfae0e94b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:58:13 +0000 Subject: [PATCH 065/505] feat: pagination responses --- src/gitpod/pagination.py | 628 +++++++++++++++++++++++++++++---------- 1 file changed, 476 insertions(+), 152 deletions(-) diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index a149247f..cfbe6615 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -5,45 +5,65 @@ from pydantic import Field as FieldInfo +from ._models import GenericModel from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ + "PersonalAccessTokensPagePagination", "SyncPersonalAccessTokensPage", "AsyncPersonalAccessTokensPage", + "OrganizationsPagePagination", "SyncOrganizationsPage", "AsyncOrganizationsPage", + "MembersPagePagination", "SyncMembersPage", "AsyncMembersPage", + "SSOConfigurationsPagePagination", "SyncSSOConfigurationsPage", "AsyncSSOConfigurationsPage", + "LoginProvidersPagePagination", "SyncLoginProvidersPage", "AsyncLoginProvidersPage", + "EditorsPagePagination", "SyncEditorsPage", "AsyncEditorsPage", + "TokensPagePagination", "SyncTokensPage", "AsyncTokensPage", + "IntegrationsPagePagination", "SyncIntegrationsPage", "AsyncIntegrationsPage", + "EnvironmentClassesPagePagination", "SyncEnvironmentClassesPage", "AsyncEnvironmentClassesPage", + "RunnersPagePagination", "SyncRunnersPage", "AsyncRunnersPage", + "PoliciesPagePagination", "SyncPoliciesPage", "AsyncPoliciesPage", + "EnvironmentsPagePagination", "SyncEnvironmentsPage", "AsyncEnvironmentsPage", + "ServicesPagePagination", "SyncServicesPage", "AsyncServicesPage", + "TasksPagePagination", "SyncTasksPage", "AsyncTasksPage", + "TaskExecutionsPagePagination", "SyncTaskExecutionsPage", "AsyncTaskExecutionsPage", + "EntriesPagePagination", "SyncEntriesPage", "AsyncEntriesPage", + "GroupsPagePagination", "SyncGroupsPage", "AsyncGroupsPage", + "ProjectsPagePagination", "SyncProjectsPage", "AsyncProjectsPage", + "SecretsPagePagination", "SyncSecretsPage", "AsyncSecretsPage", ] @@ -51,20 +71,31 @@ _T = TypeVar("_T") -class SyncPersonalAccessTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - personal_access_tokens: List[_T] +class PersonalAccessTokensPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + personal_access_tokens: Optional[List[_T]] = None + + +class SyncPersonalAccessTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PersonalAccessTokensPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - personal_access_tokens = self.personal_access_tokens + personal_access_tokens = None + if self.pagination is not None: + if self.pagination.personal_access_tokens is not None: + personal_access_tokens = self.pagination.personal_access_tokens if not personal_access_tokens: return [] return personal_access_tokens @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -72,39 +103,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncPersonalAccessTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - personal_access_tokens: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[PersonalAccessTokensPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - personal_access_tokens = self.personal_access_tokens + personal_access_tokens = None + if self.pagination is not None: + if self.pagination.personal_access_tokens is not None: + personal_access_tokens = self.pagination.personal_access_tokens if not personal_access_tokens: return [] return personal_access_tokens @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - organizations: List[_T] +class OrganizationsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + organizations: Optional[List[_T]] = None + + +class SyncOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[OrganizationsPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - organizations = self.organizations + organizations = None + if self.pagination is not None: + if self.pagination.organizations is not None: + organizations = self.pagination.organizations if not organizations: return [] return organizations @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -112,39 +159,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - organizations: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[OrganizationsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - organizations = self.organizations + organizations = None + if self.pagination is not None: + if self.pagination.organizations is not None: + organizations = self.pagination.organizations if not organizations: return [] return organizations @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] +class MembersPagePagination(GenericModel, Generic[_T]): + members: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + +class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[MembersPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - members = self.members + members = None + if self.pagination is not None: + if self.pagination.members is not None: + members = self.pagination.members if not members: return [] return members @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -152,39 +215,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[MembersPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - members = self.members + members = None + if self.pagination is not None: + if self.pagination.members is not None: + members = self.pagination.members if not members: return [] return members @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncSSOConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - sso_configurations: List[_T] +class SSOConfigurationsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + sso_configurations: Optional[List[_T]] = None + + +class SyncSSOConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[SSOConfigurationsPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - sso_configurations = self.sso_configurations + sso_configurations = None + if self.pagination is not None: + if self.pagination.sso_configurations is not None: + sso_configurations = self.pagination.sso_configurations if not sso_configurations: return [] return sso_configurations @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -192,39 +271,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncSSOConfigurationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - sso_configurations: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[SSOConfigurationsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - sso_configurations = self.sso_configurations + sso_configurations = None + if self.pagination is not None: + if self.pagination.sso_configurations is not None: + sso_configurations = self.pagination.sso_configurations if not sso_configurations: return [] return sso_configurations @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncLoginProvidersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - login_providers: List[_T] +class LoginProvidersPagePagination(GenericModel, Generic[_T]): + login_providers: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + +class SyncLoginProvidersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[LoginProvidersPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - login_providers = self.login_providers + login_providers = None + if self.pagination is not None: + if self.pagination.login_providers is not None: + login_providers = self.pagination.login_providers if not login_providers: return [] return login_providers @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -232,39 +327,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncLoginProvidersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - login_providers: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[LoginProvidersPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - login_providers = self.login_providers + login_providers = None + if self.pagination is not None: + if self.pagination.login_providers is not None: + login_providers = self.pagination.login_providers if not login_providers: return [] return login_providers @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncEditorsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - editors: List[_T] +class EditorsPagePagination(GenericModel, Generic[_T]): + editors: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + +class SyncEditorsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[EditorsPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - editors = self.editors + editors = None + if self.pagination is not None: + if self.pagination.editors is not None: + editors = self.pagination.editors if not editors: return [] return editors @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -272,39 +383,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEditorsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - editors: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[EditorsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - editors = self.editors + editors = None + if self.pagination is not None: + if self.pagination.editors is not None: + editors = self.pagination.editors if not editors: return [] return editors @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - tokens: List[_T] +class TokensPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + tokens: Optional[List[_T]] = None + + +class SyncTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[TokensPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - tokens = self.tokens + tokens = None + if self.pagination is not None: + if self.pagination.tokens is not None: + tokens = self.pagination.tokens if not tokens: return [] return tokens @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -312,39 +439,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - tokens: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[TokensPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - tokens = self.tokens + tokens = None + if self.pagination is not None: + if self.pagination.tokens is not None: + tokens = self.pagination.tokens if not tokens: return [] return tokens @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncIntegrationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - integrations: List[_T] +class IntegrationsPagePagination(GenericModel, Generic[_T]): + integrations: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + +class SyncIntegrationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[IntegrationsPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - integrations = self.integrations + integrations = None + if self.pagination is not None: + if self.pagination.integrations is not None: + integrations = self.pagination.integrations if not integrations: return [] return integrations @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -352,39 +495,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncIntegrationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - integrations: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[IntegrationsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - integrations = self.integrations + integrations = None + if self.pagination is not None: + if self.pagination.integrations is not None: + integrations = self.pagination.integrations if not integrations: return [] return integrations @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] +class EnvironmentClassesPagePagination(GenericModel, Generic[_T]): + environment_classes: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + +class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[EnvironmentClassesPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes + environment_classes = None + if self.pagination is not None: + if self.pagination.environment_classes is not None: + environment_classes = self.pagination.environment_classes if not environment_classes: return [] return environment_classes @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -392,39 +551,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[EnvironmentClassesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes + environment_classes = None + if self.pagination is not None: + if self.pagination.environment_classes is not None: + environment_classes = self.pagination.environment_classes if not environment_classes: return [] return environment_classes @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncRunnersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - runners: List[_T] +class RunnersPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + runners: Optional[List[_T]] = None + + +class SyncRunnersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[RunnersPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - runners = self.runners + runners = None + if self.pagination is not None: + if self.pagination.runners is not None: + runners = self.pagination.runners if not runners: return [] return runners @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -432,39 +607,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncRunnersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - runners: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[RunnersPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - runners = self.runners + runners = None + if self.pagination is not None: + if self.pagination.runners is not None: + runners = self.pagination.runners if not runners: return [] return runners @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - policies: List[_T] +class PoliciesPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + policies: Optional[List[_T]] = None + + +class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PoliciesPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - policies = self.policies + policies = None + if self.pagination is not None: + if self.pagination.policies is not None: + policies = self.pagination.policies if not policies: return [] return policies @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -472,39 +663,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - policies: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[PoliciesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - policies = self.policies + policies = None + if self.pagination is not None: + if self.pagination.policies is not None: + policies = self.pagination.policies if not policies: return [] return policies @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environments: List[_T] +class EnvironmentsPagePagination(GenericModel, Generic[_T]): + environments: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + +class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[EnvironmentsPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - environments = self.environments + environments = None + if self.pagination is not None: + if self.pagination.environments is not None: + environments = self.pagination.environments if not environments: return [] return environments @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -512,39 +719,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEnvironmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environments: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[EnvironmentsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - environments = self.environments + environments = None + if self.pagination is not None: + if self.pagination.environments is not None: + environments = self.pagination.environments if not environments: return [] return environments @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] +class ServicesPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + services: Optional[List[_T]] = None + + +class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ServicesPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - services = self.services + services = None + if self.pagination is not None: + if self.pagination.services is not None: + services = self.pagination.services if not services: return [] return services @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -552,39 +775,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[ServicesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - services = self.services + services = None + if self.pagination is not None: + if self.pagination.services is not None: + services = self.pagination.services if not services: return [] return services @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] +class TasksPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + tasks: Optional[List[_T]] = None + + +class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[TasksPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - tasks = self.tasks + tasks = None + if self.pagination is not None: + if self.pagination.tasks is not None: + tasks = self.pagination.tasks if not tasks: return [] return tasks @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -592,39 +831,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[TasksPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - tasks = self.tasks + tasks = None + if self.pagination is not None: + if self.pagination.tasks is not None: + tasks = self.pagination.tasks if not tasks: return [] return tasks @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] +class TaskExecutionsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + task_executions: Optional[List[_T]] = None + + +class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[TaskExecutionsPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions + task_executions = None + if self.pagination is not None: + if self.pagination.task_executions is not None: + task_executions = self.pagination.task_executions if not task_executions: return [] return task_executions @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -632,39 +887,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[TaskExecutionsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions + task_executions = None + if self.pagination is not None: + if self.pagination.task_executions is not None: + task_executions = self.pagination.task_executions if not task_executions: return [] return task_executions @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - entries: List[_T] +class EntriesPagePagination(GenericModel, Generic[_T]): + entries: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + +class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[EntriesPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - entries = self.entries + entries = None + if self.pagination is not None: + if self.pagination.entries is not None: + entries = self.pagination.entries if not entries: return [] return entries @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -672,39 +943,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEntriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - entries: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[EntriesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - entries = self.entries + entries = None + if self.pagination is not None: + if self.pagination.entries is not None: + entries = self.pagination.entries if not entries: return [] return entries @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - groups: List[_T] +class GroupsPagePagination(GenericModel, Generic[_T]): + groups: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + +class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[GroupsPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - groups = self.groups + groups = None + if self.pagination is not None: + if self.pagination.groups is not None: + groups = self.pagination.groups if not groups: return [] return groups @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -712,39 +999,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncGroupsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - groups: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[GroupsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - groups = self.groups + groups = None + if self.pagination is not None: + if self.pagination.groups is not None: + groups = self.pagination.groups if not groups: return [] return groups @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncProjectsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - projects: List[_T] +class ProjectsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + projects: Optional[List[_T]] = None + + +class SyncProjectsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ProjectsPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - projects = self.projects + projects = None + if self.pagination is not None: + if self.pagination.projects is not None: + projects = self.pagination.projects if not projects: return [] return projects @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -752,39 +1055,55 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncProjectsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - projects: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[ProjectsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - projects = self.projects + projects = None + if self.pagination is not None: + if self.pagination.projects is not None: + projects = self.pagination.projects if not projects: return [] return projects @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None return PageInfo(params={"token": next_token}) -class SyncSecretsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - secrets: List[_T] +class SecretsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + secrets: Optional[List[_T]] = None + + +class SyncSecretsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[SecretsPagePagination[_T]] = None + @override def _get_page_items(self) -> List[_T]: - secrets = self.secrets + secrets = None + if self.pagination is not None: + if self.pagination.secrets is not None: + secrets = self.pagination.secrets if not secrets: return [] return secrets @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None @@ -792,19 +1111,24 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncSecretsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - secrets: List[_T] - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + pagination: Optional[SecretsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - secrets = self.secrets + secrets = None + if self.pagination is not None: + if self.pagination.secrets is not None: + secrets = self.pagination.secrets if not secrets: return [] return secrets @override def next_page_info(self) -> Optional[PageInfo]: - next_token = self.next_token + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token if not next_token: return None From fc2a93f9410eb1f511293a579e13cb05ade707ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:59:01 +0000 Subject: [PATCH 066/505] chore: security config --- README.md | 10 ++++++++-- tests/test_client.py | 22 +++++++++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dc9f51db..fff07275 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,12 @@ pip install git+ssh://git@github.com/stainless-sdks/gitpod-python.git The full API of this library can be found in [api.md](api.md). ```python +import os from gitpod import Gitpod -client = Gitpod() +client = Gitpod( + bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted +) runner = client.runners.create( connect_protocol_version=1, @@ -47,10 +50,13 @@ so that your Bearer Token is not stored in source control. Simply import `AsyncGitpod` instead of `Gitpod` and use `await` with each API call: ```python +import os import asyncio from gitpod import AsyncGitpod -client = AsyncGitpod() +client = AsyncGitpod( + bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted +) async def main() -> None: diff --git a/tests/test_client.py b/tests/test_client.py index 289b035c..16628405 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -25,7 +25,7 @@ from gitpod._types import Omit from gitpod._models import BaseModel, FinalRequestOptions from gitpod._constants import RAW_RESPONSE_HEADER -from gitpod._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError +from gitpod._exceptions import GitpodError, APIStatusError, APITimeoutError, APIResponseValidationError from gitpod._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options from .utils import update_env @@ -335,6 +335,16 @@ def test_default_headers_option(self) -> None: assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + def test_validate_headers(self) -> None: + client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("Authorization") == f"Bearer {bearer_token}" + + with pytest.raises(GitpodError): + with update_env(**{"GITPOD_API_KEY": Omit()}): + client2 = Gitpod(base_url=base_url, bearer_token=None, _strict_response_validation=True) + _ = client2 + def test_default_query_option(self) -> None: client = Gitpod( base_url=base_url, @@ -1121,6 +1131,16 @@ def test_default_headers_option(self) -> None: assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + def test_validate_headers(self) -> None: + client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("Authorization") == f"Bearer {bearer_token}" + + with pytest.raises(GitpodError): + with update_env(**{"GITPOD_API_KEY": Omit()}): + client2 = AsyncGitpod(base_url=base_url, bearer_token=None, _strict_response_validation=True) + _ = client2 + def test_default_query_option(self) -> None: client = AsyncGitpod( base_url=base_url, From 4d9877a9601ba79afe2796483d9adee669d4ba1e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 13:38:47 +0000 Subject: [PATCH 067/505] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f1e1d640..aa87812d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-922f204ec36b8a84ae8f96e73923e92cb2044a14c6497d173f4b7110a090ac30.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-76ecfc3c43432fe5bd5694c008064c2ccdee367459a1c1a06aba00d2a3bbbce1.yml From 4c79ffb08888a3ac5c3d4e0f6b012824c6a0f598 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 15:05:10 +0000 Subject: [PATCH 068/505] feat(api): pagination config --- src/gitpod/pagination.py | 382 ++++++++++++++------------------------- 1 file changed, 134 insertions(+), 248 deletions(-) diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index cfbe6615..7f903e8d 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -5,7 +5,7 @@ from pydantic import Field as FieldInfo -from ._models import GenericModel +from ._models import BaseModel from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ @@ -71,21 +71,17 @@ _T = TypeVar("_T") -class PersonalAccessTokensPagePagination(GenericModel, Generic[_T]): +class PersonalAccessTokensPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - personal_access_tokens: Optional[List[_T]] = None - class SyncPersonalAccessTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PersonalAccessTokensPagePagination[_T]] = None + personal_access_tokens: List[_T] = FieldInfo(alias="personalAccessTokens") + pagination: Optional[PersonalAccessTokensPagePagination] = None @override def _get_page_items(self) -> List[_T]: - personal_access_tokens = None - if self.pagination is not None: - if self.pagination.personal_access_tokens is not None: - personal_access_tokens = self.pagination.personal_access_tokens + personal_access_tokens = self.personal_access_tokens if not personal_access_tokens: return [] return personal_access_tokens @@ -103,14 +99,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncPersonalAccessTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PersonalAccessTokensPagePagination[_T]] = None + personal_access_tokens: List[_T] = FieldInfo(alias="personalAccessTokens") + pagination: Optional[PersonalAccessTokensPagePagination] = None @override def _get_page_items(self) -> List[_T]: - personal_access_tokens = None - if self.pagination is not None: - if self.pagination.personal_access_tokens is not None: - personal_access_tokens = self.pagination.personal_access_tokens + personal_access_tokens = self.personal_access_tokens if not personal_access_tokens: return [] return personal_access_tokens @@ -127,21 +121,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class OrganizationsPagePagination(GenericModel, Generic[_T]): +class OrganizationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - organizations: Optional[List[_T]] = None - class SyncOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[OrganizationsPagePagination[_T]] = None + organizations: List[_T] + pagination: Optional[OrganizationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - organizations = None - if self.pagination is not None: - if self.pagination.organizations is not None: - organizations = self.pagination.organizations + organizations = self.organizations if not organizations: return [] return organizations @@ -159,14 +149,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[OrganizationsPagePagination[_T]] = None + organizations: List[_T] + pagination: Optional[OrganizationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - organizations = None - if self.pagination is not None: - if self.pagination.organizations is not None: - organizations = self.pagination.organizations + organizations = self.organizations if not organizations: return [] return organizations @@ -183,21 +171,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class MembersPagePagination(GenericModel, Generic[_T]): - members: Optional[List[_T]] = None - +class MembersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[MembersPagePagination[_T]] = None + members: List[_T] + pagination: Optional[MembersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - members = None - if self.pagination is not None: - if self.pagination.members is not None: - members = self.pagination.members + members = self.members if not members: return [] return members @@ -215,14 +199,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[MembersPagePagination[_T]] = None + members: List[_T] + pagination: Optional[MembersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - members = None - if self.pagination is not None: - if self.pagination.members is not None: - members = self.pagination.members + members = self.members if not members: return [] return members @@ -239,21 +221,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SSOConfigurationsPagePagination(GenericModel, Generic[_T]): +class SSOConfigurationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - sso_configurations: Optional[List[_T]] = None - class SyncSSOConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SSOConfigurationsPagePagination[_T]] = None + sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") + pagination: Optional[SSOConfigurationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - sso_configurations = None - if self.pagination is not None: - if self.pagination.sso_configurations is not None: - sso_configurations = self.pagination.sso_configurations + sso_configurations = self.sso_configurations if not sso_configurations: return [] return sso_configurations @@ -271,14 +249,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncSSOConfigurationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SSOConfigurationsPagePagination[_T]] = None + sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") + pagination: Optional[SSOConfigurationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - sso_configurations = None - if self.pagination is not None: - if self.pagination.sso_configurations is not None: - sso_configurations = self.pagination.sso_configurations + sso_configurations = self.sso_configurations if not sso_configurations: return [] return sso_configurations @@ -295,21 +271,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class LoginProvidersPagePagination(GenericModel, Generic[_T]): - login_providers: Optional[List[_T]] = None - +class LoginProvidersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncLoginProvidersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[LoginProvidersPagePagination[_T]] = None + login_providers: List[_T] = FieldInfo(alias="loginProviders") + pagination: Optional[LoginProvidersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - login_providers = None - if self.pagination is not None: - if self.pagination.login_providers is not None: - login_providers = self.pagination.login_providers + login_providers = self.login_providers if not login_providers: return [] return login_providers @@ -327,14 +299,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncLoginProvidersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[LoginProvidersPagePagination[_T]] = None + login_providers: List[_T] = FieldInfo(alias="loginProviders") + pagination: Optional[LoginProvidersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - login_providers = None - if self.pagination is not None: - if self.pagination.login_providers is not None: - login_providers = self.pagination.login_providers + login_providers = self.login_providers if not login_providers: return [] return login_providers @@ -351,21 +321,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EditorsPagePagination(GenericModel, Generic[_T]): - editors: Optional[List[_T]] = None - +class EditorsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEditorsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EditorsPagePagination[_T]] = None + editors: List[_T] + pagination: Optional[EditorsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - editors = None - if self.pagination is not None: - if self.pagination.editors is not None: - editors = self.pagination.editors + editors = self.editors if not editors: return [] return editors @@ -383,14 +349,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEditorsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EditorsPagePagination[_T]] = None + editors: List[_T] + pagination: Optional[EditorsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - editors = None - if self.pagination is not None: - if self.pagination.editors is not None: - editors = self.pagination.editors + editors = self.editors if not editors: return [] return editors @@ -407,21 +371,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TokensPagePagination(GenericModel, Generic[_T]): +class TokensPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - tokens: Optional[List[_T]] = None - class SyncTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TokensPagePagination[_T]] = None + tokens: List[_T] + pagination: Optional[TokensPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tokens = None - if self.pagination is not None: - if self.pagination.tokens is not None: - tokens = self.pagination.tokens + tokens = self.tokens if not tokens: return [] return tokens @@ -439,14 +399,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TokensPagePagination[_T]] = None + tokens: List[_T] + pagination: Optional[TokensPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tokens = None - if self.pagination is not None: - if self.pagination.tokens is not None: - tokens = self.pagination.tokens + tokens = self.tokens if not tokens: return [] return tokens @@ -463,21 +421,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class IntegrationsPagePagination(GenericModel, Generic[_T]): - integrations: Optional[List[_T]] = None - +class IntegrationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncIntegrationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[IntegrationsPagePagination[_T]] = None + integrations: List[_T] + pagination: Optional[IntegrationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - integrations = None - if self.pagination is not None: - if self.pagination.integrations is not None: - integrations = self.pagination.integrations + integrations = self.integrations if not integrations: return [] return integrations @@ -495,14 +449,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncIntegrationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[IntegrationsPagePagination[_T]] = None + integrations: List[_T] + pagination: Optional[IntegrationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - integrations = None - if self.pagination is not None: - if self.pagination.integrations is not None: - integrations = self.pagination.integrations + integrations = self.integrations if not integrations: return [] return integrations @@ -519,21 +471,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EnvironmentClassesPagePagination(GenericModel, Generic[_T]): - environment_classes: Optional[List[_T]] = None - +class EnvironmentClassesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EnvironmentClassesPagePagination[_T]] = None + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") + pagination: Optional[EnvironmentClassesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - environment_classes = None - if self.pagination is not None: - if self.pagination.environment_classes is not None: - environment_classes = self.pagination.environment_classes + environment_classes = self.environment_classes if not environment_classes: return [] return environment_classes @@ -551,14 +499,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EnvironmentClassesPagePagination[_T]] = None + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") + pagination: Optional[EnvironmentClassesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - environment_classes = None - if self.pagination is not None: - if self.pagination.environment_classes is not None: - environment_classes = self.pagination.environment_classes + environment_classes = self.environment_classes if not environment_classes: return [] return environment_classes @@ -575,21 +521,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class RunnersPagePagination(GenericModel, Generic[_T]): +class RunnersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - runners: Optional[List[_T]] = None - class SyncRunnersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[RunnersPagePagination[_T]] = None + runners: List[_T] + pagination: Optional[RunnersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - runners = None - if self.pagination is not None: - if self.pagination.runners is not None: - runners = self.pagination.runners + runners = self.runners if not runners: return [] return runners @@ -607,14 +549,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncRunnersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[RunnersPagePagination[_T]] = None + runners: List[_T] + pagination: Optional[RunnersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - runners = None - if self.pagination is not None: - if self.pagination.runners is not None: - runners = self.pagination.runners + runners = self.runners if not runners: return [] return runners @@ -631,21 +571,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class PoliciesPagePagination(GenericModel, Generic[_T]): +class PoliciesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - policies: Optional[List[_T]] = None - class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PoliciesPagePagination[_T]] = None + policies: List[_T] + pagination: Optional[PoliciesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - policies = None - if self.pagination is not None: - if self.pagination.policies is not None: - policies = self.pagination.policies + policies = self.policies if not policies: return [] return policies @@ -663,14 +599,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PoliciesPagePagination[_T]] = None + policies: List[_T] + pagination: Optional[PoliciesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - policies = None - if self.pagination is not None: - if self.pagination.policies is not None: - policies = self.pagination.policies + policies = self.policies if not policies: return [] return policies @@ -687,21 +621,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EnvironmentsPagePagination(GenericModel, Generic[_T]): - environments: Optional[List[_T]] = None - +class EnvironmentsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EnvironmentsPagePagination[_T]] = None + environments: List[_T] + pagination: Optional[EnvironmentsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - environments = None - if self.pagination is not None: - if self.pagination.environments is not None: - environments = self.pagination.environments + environments = self.environments if not environments: return [] return environments @@ -719,14 +649,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEnvironmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EnvironmentsPagePagination[_T]] = None + environments: List[_T] + pagination: Optional[EnvironmentsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - environments = None - if self.pagination is not None: - if self.pagination.environments is not None: - environments = self.pagination.environments + environments = self.environments if not environments: return [] return environments @@ -743,21 +671,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class ServicesPagePagination(GenericModel, Generic[_T]): +class ServicesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - services: Optional[List[_T]] = None - class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[ServicesPagePagination[_T]] = None + services: List[_T] + pagination: Optional[ServicesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - services = None - if self.pagination is not None: - if self.pagination.services is not None: - services = self.pagination.services + services = self.services if not services: return [] return services @@ -775,14 +699,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[ServicesPagePagination[_T]] = None + services: List[_T] + pagination: Optional[ServicesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - services = None - if self.pagination is not None: - if self.pagination.services is not None: - services = self.pagination.services + services = self.services if not services: return [] return services @@ -799,21 +721,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TasksPagePagination(GenericModel, Generic[_T]): +class TasksPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - tasks: Optional[List[_T]] = None - class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TasksPagePagination[_T]] = None + tasks: List[_T] + pagination: Optional[TasksPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tasks = None - if self.pagination is not None: - if self.pagination.tasks is not None: - tasks = self.pagination.tasks + tasks = self.tasks if not tasks: return [] return tasks @@ -831,14 +749,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TasksPagePagination[_T]] = None + tasks: List[_T] + pagination: Optional[TasksPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tasks = None - if self.pagination is not None: - if self.pagination.tasks is not None: - tasks = self.pagination.tasks + tasks = self.tasks if not tasks: return [] return tasks @@ -855,21 +771,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TaskExecutionsPagePagination(GenericModel, Generic[_T]): +class TaskExecutionsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - task_executions: Optional[List[_T]] = None - class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TaskExecutionsPagePagination[_T]] = None + task_executions: List[_T] = FieldInfo(alias="taskExecutions") + pagination: Optional[TaskExecutionsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - task_executions = None - if self.pagination is not None: - if self.pagination.task_executions is not None: - task_executions = self.pagination.task_executions + task_executions = self.task_executions if not task_executions: return [] return task_executions @@ -887,14 +799,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TaskExecutionsPagePagination[_T]] = None + task_executions: List[_T] = FieldInfo(alias="taskExecutions") + pagination: Optional[TaskExecutionsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - task_executions = None - if self.pagination is not None: - if self.pagination.task_executions is not None: - task_executions = self.pagination.task_executions + task_executions = self.task_executions if not task_executions: return [] return task_executions @@ -911,21 +821,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EntriesPagePagination(GenericModel, Generic[_T]): - entries: Optional[List[_T]] = None - +class EntriesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EntriesPagePagination[_T]] = None + entries: List[_T] + pagination: Optional[EntriesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - entries = None - if self.pagination is not None: - if self.pagination.entries is not None: - entries = self.pagination.entries + entries = self.entries if not entries: return [] return entries @@ -943,14 +849,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEntriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EntriesPagePagination[_T]] = None + entries: List[_T] + pagination: Optional[EntriesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - entries = None - if self.pagination is not None: - if self.pagination.entries is not None: - entries = self.pagination.entries + entries = self.entries if not entries: return [] return entries @@ -967,21 +871,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class GroupsPagePagination(GenericModel, Generic[_T]): - groups: Optional[List[_T]] = None - +class GroupsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[GroupsPagePagination[_T]] = None + groups: List[_T] + pagination: Optional[GroupsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - groups = None - if self.pagination is not None: - if self.pagination.groups is not None: - groups = self.pagination.groups + groups = self.groups if not groups: return [] return groups @@ -999,14 +899,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncGroupsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[GroupsPagePagination[_T]] = None + groups: List[_T] + pagination: Optional[GroupsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - groups = None - if self.pagination is not None: - if self.pagination.groups is not None: - groups = self.pagination.groups + groups = self.groups if not groups: return [] return groups @@ -1023,21 +921,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class ProjectsPagePagination(GenericModel, Generic[_T]): +class ProjectsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - projects: Optional[List[_T]] = None - class SyncProjectsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[ProjectsPagePagination[_T]] = None + projects: List[_T] + pagination: Optional[ProjectsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - projects = None - if self.pagination is not None: - if self.pagination.projects is not None: - projects = self.pagination.projects + projects = self.projects if not projects: return [] return projects @@ -1055,14 +949,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncProjectsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[ProjectsPagePagination[_T]] = None + projects: List[_T] + pagination: Optional[ProjectsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - projects = None - if self.pagination is not None: - if self.pagination.projects is not None: - projects = self.pagination.projects + projects = self.projects if not projects: return [] return projects @@ -1079,21 +971,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SecretsPagePagination(GenericModel, Generic[_T]): +class SecretsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - secrets: Optional[List[_T]] = None - class SyncSecretsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SecretsPagePagination[_T]] = None + secrets: List[_T] + pagination: Optional[SecretsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - secrets = None - if self.pagination is not None: - if self.pagination.secrets is not None: - secrets = self.pagination.secrets + secrets = self.secrets if not secrets: return [] return secrets @@ -1111,14 +999,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncSecretsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SecretsPagePagination[_T]] = None + secrets: List[_T] + pagination: Optional[SecretsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - secrets = None - if self.pagination is not None: - if self.pagination.secrets is not None: - secrets = self.pagination.secrets + secrets = self.secrets if not secrets: return [] return secrets From 3a760cf19870a7c146f5b262ce5f4c2c72dbe549 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 15:17:38 +0000 Subject: [PATCH 069/505] feat(api): manual updates --- .stats.yml | 2 +- README.md | 28 +- api.md | 42 +- src/gitpod/pagination.py | 382 +++++++++----- src/gitpod/resources/accounts.py | 209 ++------ src/gitpod/resources/editors.py | 167 +----- .../environments/automations/automations.py | 50 +- .../environments/automations/services.py | 343 +++---------- .../automations/tasks/executions.py | 177 ++----- .../environments/automations/tasks/tasks.py | 266 ++-------- src/gitpod/resources/environments/classes.py | 132 ++--- .../resources/environments/environments.py | 425 ++-------------- src/gitpod/resources/events.py | 177 ++----- src/gitpod/resources/groups.py | 112 ++-- src/gitpod/resources/identity.py | 93 ---- src/gitpod/resources/organizations/invites.py | 102 +--- .../resources/organizations/organizations.py | 477 ++++-------------- .../organizations/sso_configurations.py | 303 ++--------- src/gitpod/resources/projects/policies.py | 205 ++------ src/gitpod/resources/projects/projects.py | 321 ++---------- .../runners/configurations/configurations.py | 70 +-- .../configurations/environment_classes.py | 249 ++------- .../host_authentication_tokens.py | 281 ++--------- .../runners/configurations/schema.py | 34 -- .../configurations/scm_integrations.py | 361 +++---------- src/gitpod/resources/runners/policies.py | 205 ++------ src/gitpod/resources/runners/runners.py | 373 ++------------ src/gitpod/resources/secrets.py | 257 ++-------- src/gitpod/resources/users/pats.py | 177 ++----- src/gitpod/resources/users/users.py | 64 --- src/gitpod/types/account_delete_params.py | 8 +- .../types/account_get_sso_login_url_params.py | 8 +- .../account_list_login_providers_params.py | 42 +- .../account_list_login_providers_response.py | 4 +- src/gitpod/types/account_retrieve_params.py | 10 +- src/gitpod/types/editor_list_params.py | 34 +- src/gitpod/types/editor_list_response.py | 4 +- src/gitpod/types/editor_resolve_url_params.py | 8 +- src/gitpod/types/editor_retrieve_params.py | 10 +- .../environment_create_from_project_params.py | 20 +- ...nvironment_create_from_project_response.py | 85 ++-- .../environment_create_logs_token_params.py | 8 +- src/gitpod/types/environment_create_params.py | 20 +- .../types/environment_create_response.py | 85 ++-- src/gitpod/types/environment_delete_params.py | 8 +- src/gitpod/types/environment_list_params.py | 89 +++- src/gitpod/types/environment_list_response.py | 89 ++-- .../types/environment_mark_active_params.py | 18 +- .../types/environment_retrieve_params.py | 8 +- .../types/environment_retrieve_response.py | 85 ++-- src/gitpod/types/environment_start_params.py | 8 +- src/gitpod/types/environment_stop_params.py | 8 +- src/gitpod/types/environment_update_params.py | 22 +- .../environments/automation_upsert_params.py | 43 +- .../automations/service_create_params.py | 45 +- .../automations/service_create_response.py | 44 +- .../automations/service_delete_params.py | 10 +- .../automations/service_list_params.py | 49 +- .../automations/service_list_response.py | 48 +- .../automations/service_retrieve_params.py | 10 +- .../automations/service_retrieve_response.py | 44 +- .../automations/service_start_params.py | 10 +- .../automations/service_stop_params.py | 10 +- .../automations/service_update_params.py | 18 +- .../automations/task_create_params.py | 20 +- .../automations/task_create_response.py | 14 +- .../automations/task_delete_params.py | 10 +- .../automations/task_list_params.py | 49 +- .../automations/task_list_response.py | 18 +- .../automations/task_retrieve_params.py | 10 +- .../automations/task_retrieve_response.py | 14 +- .../automations/task_start_params.py | 10 +- .../automations/task_start_response.py | 35 +- .../automations/task_update_params.py | 8 +- .../tasks/execution_list_params.py | 61 ++- .../tasks/execution_list_response.py | 39 +- .../tasks/execution_retrieve_params.py | 10 +- .../tasks/execution_retrieve_response.py | 35 +- .../tasks/execution_stop_params.py | 10 +- .../types/environments/class_list_params.py | 40 +- .../types/environments/class_list_response.py | 10 +- src/gitpod/types/event_list_params.py | 83 ++- src/gitpod/types/event_list_response.py | 8 +- src/gitpod/types/event_watch_params.py | 22 +- src/gitpod/types/group_list_params.py | 34 +- src/gitpod/types/group_list_response.py | 12 +- .../types/identity_exchange_token_params.py | 8 +- ...ntity_get_authenticated_identity_params.py | 10 +- .../types/identity_get_id_token_params.py | 10 +- .../types/organization_create_params.py | 8 +- .../types/organization_create_response.py | 12 +- .../types/organization_delete_params.py | 8 +- src/gitpod/types/organization_join_params.py | 14 +- .../types/organization_join_response.py | 4 +- src/gitpod/types/organization_leave_params.py | 8 +- .../types/organization_list_members_params.py | 37 +- .../organization_list_members_response.py | 8 +- src/gitpod/types/organization_list_params.py | 37 +- .../types/organization_list_response.py | 12 +- .../types/organization_retrieve_params.py | 8 +- .../types/organization_retrieve_response.py | 8 +- .../types/organization_set_role_params.py | 8 +- .../types/organization_update_params.py | 14 +- .../types/organization_update_response.py | 8 +- .../organizations/invite_create_params.py | 8 +- .../organizations/invite_create_response.py | 6 +- .../invite_get_summary_params.py | 8 +- .../organizations/invite_retrieve_params.py | 8 +- .../organizations/invite_retrieve_response.py | 6 +- .../sso_configuration_create_params.py | 8 +- .../sso_configuration_delete_params.py | 8 +- .../sso_configuration_list_params.py | 36 +- .../sso_configuration_list_response.py | 4 +- .../sso_configuration_retrieve_params.py | 8 +- .../sso_configuration_update_params.py | 30 -- .../project_create_from_environment_params.py | 8 +- ...roject_create_from_environment_response.py | 13 +- src/gitpod/types/project_create_params.py | 11 +- src/gitpod/types/project_create_response.py | 13 +- src/gitpod/types/project_delete_params.py | 8 +- src/gitpod/types/project_list_params.py | 34 +- src/gitpod/types/project_list_response.py | 17 +- src/gitpod/types/project_retrieve_params.py | 8 +- src/gitpod/types/project_retrieve_response.py | 13 +- src/gitpod/types/project_update_params.py | 35 +- src/gitpod/types/project_update_response.py | 13 +- .../types/projects/policy_create_params.py | 8 +- .../types/projects/policy_delete_params.py | 8 +- .../types/projects/policy_list_params.py | 37 +- .../types/projects/policy_list_response.py | 4 +- .../types/projects/policy_update_params.py | 8 +- ...er_check_authentication_for_host_params.py | 8 +- src/gitpod/types/runner_create_params.py | 8 +- src/gitpod/types/runner_create_response.py | 12 +- .../runner_create_runner_token_params.py | 8 +- src/gitpod/types/runner_delete_params.py | 8 +- src/gitpod/types/runner_list_params.py | 57 ++- src/gitpod/types/runner_list_response.py | 16 +- .../types/runner_parse_context_url_params.py | 8 +- src/gitpod/types/runner_retrieve_params.py | 8 +- src/gitpod/types/runner_retrieve_response.py | 12 +- src/gitpod/types/runner_update_params.py | 12 - .../runners/configuration_validate_params.py | 40 +- .../environment_class_create_params.py | 8 +- .../environment_class_list_params.py | 40 +- .../environment_class_list_response.py | 10 +- .../environment_class_retrieve_params.py | 8 +- .../environment_class_retrieve_response.py | 6 +- .../environment_class_update_params.py | 20 +- ...host_authentication_token_create_params.py | 12 +- ...st_authentication_token_create_response.py | 4 +- ...host_authentication_token_delete_params.py | 10 +- .../host_authentication_token_list_params.py | 47 +- ...host_authentication_token_list_response.py | 8 +- ...st_authentication_token_retrieve_params.py | 10 +- ..._authentication_token_retrieve_response.py | 4 +- ...host_authentication_token_update_params.py | 24 +- .../configurations/schema_retrieve_params.py | 8 +- .../scm_integration_create_params.py | 24 +- .../scm_integration_delete_params.py | 10 +- .../scm_integration_list_params.py | 42 +- .../scm_integration_list_response.py | 4 +- .../scm_integration_retrieve_params.py | 10 +- .../scm_integration_update_params.py | 46 +- .../types/runners/policy_create_params.py | 8 +- .../types/runners/policy_delete_params.py | 8 +- .../types/runners/policy_list_params.py | 37 +- .../types/runners/policy_list_response.py | 4 +- .../types/runners/policy_update_params.py | 8 +- src/gitpod/types/secret_create_params.py | 14 +- src/gitpod/types/secret_delete_params.py | 8 +- src/gitpod/types/secret_get_value_params.py | 8 +- src/gitpod/types/secret_list_params.py | 42 +- src/gitpod/types/secret_list_response.py | 20 +- .../types/secret_update_value_params.py | 8 +- .../user_get_authenticated_user_params.py | 10 +- .../user_get_authenticated_user_response.py | 4 +- src/gitpod/types/user_set_suspended_params.py | 8 +- src/gitpod/types/users/pat_delete_params.py | 8 +- src/gitpod/types/users/pat_get_params.py | 8 +- src/gitpod/types/users/pat_get_response.py | 12 +- src/gitpod/types/users/pat_list_params.py | 40 +- src/gitpod/types/users/pat_list_response.py | 16 +- .../automations/tasks/test_executions.py | 145 ++---- .../environments/automations/test_services.py | 251 +++------ .../environments/automations/test_tasks.py | 223 +++----- .../environments/test_automations.py | 36 +- .../environments/test_classes.py | 75 ++- .../organizations/test_invites.py | 84 +-- .../organizations/test_sso_configurations.py | 291 +++-------- tests/api_resources/projects/test_policies.py | 159 ++---- .../test_environment_classes.py | 215 ++------ .../test_host_authentication_tokens.py | 259 +++------- .../runners/configurations/test_schema.py | 28 +- .../configurations/test_scm_integrations.py | 263 ++-------- .../runners/test_configurations.py | 20 - tests/api_resources/runners/test_policies.py | 159 ++---- tests/api_resources/test_accounts.py | 145 ++---- tests/api_resources/test_editors.py | 129 ++--- tests/api_resources/test_environments.py | 361 ++++--------- tests/api_resources/test_events.py | 141 ++---- tests/api_resources/test_groups.py | 73 +-- tests/api_resources/test_identity.py | 80 +-- tests/api_resources/test_organizations.py | 385 ++++---------- tests/api_resources/test_projects.py | 273 ++-------- tests/api_resources/test_runners.py | 299 +++-------- tests/api_resources/test_secrets.py | 179 ++----- tests/api_resources/test_users.py | 52 +- tests/api_resources/users/test_pats.py | 131 ++--- tests/test_client.py | 20 +- 210 files changed, 3598 insertions(+), 9939 deletions(-) diff --git a/.stats.yml b/.stats.yml index aa87812d..54b5007f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-76ecfc3c43432fe5bd5694c008064c2ccdee367459a1c1a06aba00d2a3bbbce1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-63491b1baa3dbc60caaec79becdece3854356b354909e4bb3f1ccaab80a6be20.yml diff --git a/README.md b/README.md index fff07275..b43b2f8b 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,7 @@ client = Gitpod( bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted ) -runner = client.runners.create( - connect_protocol_version=1, -) +runner = client.runners.create() print(runner.access_token) ``` @@ -60,9 +58,7 @@ client = AsyncGitpod( async def main() -> None: - runner = await client.runners.create( - connect_protocol_version=1, - ) + runner = await client.runners.create() print(runner.access_token) @@ -96,9 +92,7 @@ from gitpod import Gitpod client = Gitpod() try: - client.runners.create( - connect_protocol_version=1, - ) + client.runners.create() except gitpod.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. @@ -141,9 +135,7 @@ client = Gitpod( ) # Or, configure per-request: -client.with_options(max_retries=5).runners.create( - connect_protocol_version=1, -) +client.with_options(max_retries=5).runners.create() ``` ### Timeouts @@ -166,9 +158,7 @@ client = Gitpod( ) # Override per-request: -client.with_options(timeout=5.0).runners.create( - connect_protocol_version=1, -) +client.with_options(timeout=5.0).runners.create() ``` On timeout, an `APITimeoutError` is thrown. @@ -209,9 +199,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to from gitpod import Gitpod client = Gitpod() -response = client.runners.with_raw_response.create( - connect_protocol_version=1, -) +response = client.runners.with_raw_response.create() print(response.headers.get('X-My-Header')) runner = response.parse() # get the object that `runners.create()` would have returned @@ -229,9 +217,7 @@ The above interface eagerly reads the full response body when you make the reque To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. ```python -with client.runners.with_streaming_response.create( - connect_protocol_version=1, -) as response: +with client.runners.with_streaming_response.create() as response: print(response.headers.get("X-My-Header")) for line in response.iter_lines(): diff --git a/api.md b/api.md index 894da1c3..b2094915 100644 --- a/api.md +++ b/api.md @@ -16,7 +16,7 @@ Methods: - client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse - client.accounts.delete(\*\*params) -> object - client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse -- client.accounts.list_login_providers(\*\*params) -> AccountListLoginProvidersResponse +- client.accounts.list_login_providers(\*\*params) -> SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse] # Editors @@ -29,7 +29,7 @@ from gitpod.types import EditorRetrieveResponse, EditorListResponse, EditorResol Methods: - client.editors.retrieve(\*\*params) -> EditorRetrieveResponse -- client.editors.list(\*\*params) -> EditorListResponse +- client.editors.list(\*\*params) -> SyncPersonalAccessTokensPage[EditorListResponse] - client.editors.resolve_url(\*\*params) -> EditorResolveURLResponse # Environments @@ -56,7 +56,7 @@ Methods: - client.environments.create(\*\*params) -> EnvironmentCreateResponse - client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse - client.environments.update(\*\*params) -> object -- client.environments.list(\*\*params) -> EnvironmentListResponse +- client.environments.list(\*\*params) -> SyncPersonalAccessTokensPage[EnvironmentListResponse] - client.environments.delete(\*\*params) -> object - client.environments.create_from_project(\*\*params) -> EnvironmentCreateFromProjectResponse - client.environments.create_logs_token(\*\*params) -> EnvironmentCreateLogsTokenResponse @@ -97,7 +97,7 @@ Methods: - client.environments.automations.services.create(\*\*params) -> ServiceCreateResponse - client.environments.automations.services.retrieve(\*\*params) -> ServiceRetrieveResponse - client.environments.automations.services.update(\*\*params) -> object -- client.environments.automations.services.list(\*\*params) -> ServiceListResponse +- client.environments.automations.services.list(\*\*params) -> SyncPersonalAccessTokensPage[ServiceListResponse] - client.environments.automations.services.delete(\*\*params) -> object - client.environments.automations.services.start(\*\*params) -> object - client.environments.automations.services.stop(\*\*params) -> object @@ -122,7 +122,7 @@ Methods: - client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse - client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse - client.environments.automations.tasks.update(\*\*params) -> object -- client.environments.automations.tasks.list(\*\*params) -> TaskListResponse +- client.environments.automations.tasks.list(\*\*params) -> SyncPersonalAccessTokensPage[TaskListResponse] - client.environments.automations.tasks.delete(\*\*params) -> object - client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse @@ -141,7 +141,7 @@ from gitpod.types.environments.automations.tasks import ( Methods: - client.environments.automations.tasks.executions.retrieve(\*\*params) -> ExecutionRetrieveResponse -- client.environments.automations.tasks.executions.list(\*\*params) -> ExecutionListResponse +- client.environments.automations.tasks.executions.list(\*\*params) -> SyncPersonalAccessTokensPage[ExecutionListResponse] - client.environments.automations.tasks.executions.stop(\*\*params) -> object ## Classes @@ -154,7 +154,7 @@ from gitpod.types.environments import ClassListResponse Methods: -- client.environments.classes.list(\*\*params) -> ClassListResponse +- client.environments.classes.list(\*\*params) -> SyncPersonalAccessTokensPage[ClassListResponse] # Events @@ -166,7 +166,7 @@ from gitpod.types import EventListResponse, EventWatchResponse Methods: -- client.events.list(\*\*params) -> EventListResponse +- client.events.list(\*\*params) -> SyncPersonalAccessTokensPage[EventListResponse] - client.events.watch(\*\*params) -> JSONLDecoder[EventWatchResponse] # Groups @@ -179,7 +179,7 @@ from gitpod.types import GroupListResponse Methods: -- client.groups.list(\*\*params) -> GroupListResponse +- client.groups.list(\*\*params) -> SyncPersonalAccessTokensPage[GroupListResponse] # Identity @@ -222,11 +222,11 @@ Methods: - client.organizations.create(\*\*params) -> OrganizationCreateResponse - client.organizations.retrieve(\*\*params) -> OrganizationRetrieveResponse - client.organizations.update(\*\*params) -> OrganizationUpdateResponse -- client.organizations.list(\*\*params) -> OrganizationListResponse +- client.organizations.list(\*\*params) -> SyncPersonalAccessTokensPage[OrganizationListResponse] - client.organizations.delete(\*\*params) -> object - client.organizations.join(\*\*params) -> OrganizationJoinResponse - client.organizations.leave(\*\*params) -> object -- client.organizations.list_members(\*\*params) -> OrganizationListMembersResponse +- client.organizations.list_members(\*\*params) -> SyncPersonalAccessTokensPage[OrganizationListMembersResponse] - client.organizations.set_role(\*\*params) -> object ## Invites @@ -266,7 +266,7 @@ Methods: - client.organizations.sso_configurations.create(\*\*params) -> SSOConfigurationCreateResponse - client.organizations.sso_configurations.retrieve(\*\*params) -> SSOConfigurationRetrieveResponse - client.organizations.sso_configurations.update(\*\*params) -> object -- client.organizations.sso_configurations.list(\*\*params) -> SSOConfigurationListResponse +- client.organizations.sso_configurations.list(\*\*params) -> SyncPersonalAccessTokensPage[SSOConfigurationListResponse] - client.organizations.sso_configurations.delete(\*\*params) -> object # Projects @@ -289,7 +289,7 @@ Methods: - client.projects.create(\*\*params) -> ProjectCreateResponse - client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse - client.projects.update(\*\*params) -> ProjectUpdateResponse -- client.projects.list(\*\*params) -> ProjectListResponse +- client.projects.list(\*\*params) -> SyncPersonalAccessTokensPage[ProjectListResponse] - client.projects.delete(\*\*params) -> object - client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse @@ -310,7 +310,7 @@ Methods: - client.projects.policies.create(\*\*params) -> PolicyCreateResponse - client.projects.policies.update(\*\*params) -> PolicyUpdateResponse -- client.projects.policies.list(\*\*params) -> PolicyListResponse +- client.projects.policies.list(\*\*params) -> SyncPersonalAccessTokensPage[PolicyListResponse] - client.projects.policies.delete(\*\*params) -> object # Runners @@ -335,7 +335,7 @@ Methods: - client.runners.create(\*\*params) -> RunnerCreateResponse - client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse - client.runners.update(\*\*params) -> object -- client.runners.list(\*\*params) -> RunnerListResponse +- client.runners.list(\*\*params) -> SyncPersonalAccessTokensPage[RunnerListResponse] - client.runners.delete(\*\*params) -> object - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse @@ -371,7 +371,7 @@ Methods: - client.runners.configurations.environment_classes.create(\*\*params) -> EnvironmentClassCreateResponse - client.runners.configurations.environment_classes.retrieve(\*\*params) -> EnvironmentClassRetrieveResponse - client.runners.configurations.environment_classes.update(\*\*params) -> object -- client.runners.configurations.environment_classes.list(\*\*params) -> EnvironmentClassListResponse +- client.runners.configurations.environment_classes.list(\*\*params) -> SyncPersonalAccessTokensPage[EnvironmentClassListResponse] ### HostAuthenticationTokens @@ -392,7 +392,7 @@ Methods: - client.runners.configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse - client.runners.configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse - client.runners.configurations.host_authentication_tokens.update(\*\*params) -> object -- client.runners.configurations.host_authentication_tokens.list(\*\*params) -> HostAuthenticationTokenListResponse +- client.runners.configurations.host_authentication_tokens.list(\*\*params) -> SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse] - client.runners.configurations.host_authentication_tokens.delete(\*\*params) -> object ### Schema @@ -426,7 +426,7 @@ Methods: - client.runners.configurations.scm_integrations.create(\*\*params) -> ScmIntegrationCreateResponse - client.runners.configurations.scm_integrations.retrieve(\*\*params) -> ScmIntegrationRetrieveResponse - client.runners.configurations.scm_integrations.update(\*\*params) -> object -- client.runners.configurations.scm_integrations.list(\*\*params) -> ScmIntegrationListResponse +- client.runners.configurations.scm_integrations.list(\*\*params) -> SyncPersonalAccessTokensPage[ScmIntegrationListResponse] - client.runners.configurations.scm_integrations.delete(\*\*params) -> object ## Policies @@ -446,7 +446,7 @@ Methods: - client.runners.policies.create(\*\*params) -> PolicyCreateResponse - client.runners.policies.update(\*\*params) -> PolicyUpdateResponse -- client.runners.policies.list(\*\*params) -> PolicyListResponse +- client.runners.policies.list(\*\*params) -> SyncPersonalAccessTokensPage[PolicyListResponse] - client.runners.policies.delete(\*\*params) -> object # Secrets @@ -466,7 +466,7 @@ from gitpod.types import ( Methods: - client.secrets.create(\*\*params) -> SecretCreateResponse -- client.secrets.list(\*\*params) -> SecretListResponse +- client.secrets.list(\*\*params) -> SyncPersonalAccessTokensPage[SecretListResponse] - client.secrets.delete(\*\*params) -> object - client.secrets.get_value(\*\*params) -> SecretGetValueResponse - client.secrets.update_value(\*\*params) -> object @@ -494,6 +494,6 @@ from gitpod.types.users import PatListResponse, PatDeleteResponse, PatGetRespons Methods: -- client.users.pats.list(\*\*params) -> PatListResponse +- client.users.pats.list(\*\*params) -> SyncPersonalAccessTokensPage[PatListResponse] - client.users.pats.delete(\*\*params) -> object - client.users.pats.get(\*\*params) -> PatGetResponse diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 7f903e8d..cfbe6615 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -5,7 +5,7 @@ from pydantic import Field as FieldInfo -from ._models import BaseModel +from ._models import GenericModel from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ @@ -71,17 +71,21 @@ _T = TypeVar("_T") -class PersonalAccessTokensPagePagination(BaseModel): +class PersonalAccessTokensPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + personal_access_tokens: Optional[List[_T]] = None + class SyncPersonalAccessTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - personal_access_tokens: List[_T] = FieldInfo(alias="personalAccessTokens") - pagination: Optional[PersonalAccessTokensPagePagination] = None + pagination: Optional[PersonalAccessTokensPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - personal_access_tokens = self.personal_access_tokens + personal_access_tokens = None + if self.pagination is not None: + if self.pagination.personal_access_tokens is not None: + personal_access_tokens = self.pagination.personal_access_tokens if not personal_access_tokens: return [] return personal_access_tokens @@ -99,12 +103,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncPersonalAccessTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - personal_access_tokens: List[_T] = FieldInfo(alias="personalAccessTokens") - pagination: Optional[PersonalAccessTokensPagePagination] = None + pagination: Optional[PersonalAccessTokensPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - personal_access_tokens = self.personal_access_tokens + personal_access_tokens = None + if self.pagination is not None: + if self.pagination.personal_access_tokens is not None: + personal_access_tokens = self.pagination.personal_access_tokens if not personal_access_tokens: return [] return personal_access_tokens @@ -121,17 +127,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class OrganizationsPagePagination(BaseModel): +class OrganizationsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + organizations: Optional[List[_T]] = None + class SyncOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - organizations: List[_T] - pagination: Optional[OrganizationsPagePagination] = None + pagination: Optional[OrganizationsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - organizations = self.organizations + organizations = None + if self.pagination is not None: + if self.pagination.organizations is not None: + organizations = self.pagination.organizations if not organizations: return [] return organizations @@ -149,12 +159,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - organizations: List[_T] - pagination: Optional[OrganizationsPagePagination] = None + pagination: Optional[OrganizationsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - organizations = self.organizations + organizations = None + if self.pagination is not None: + if self.pagination.organizations is not None: + organizations = self.pagination.organizations if not organizations: return [] return organizations @@ -171,17 +183,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class MembersPagePagination(BaseModel): +class MembersPagePagination(GenericModel, Generic[_T]): + members: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] - pagination: Optional[MembersPagePagination] = None + pagination: Optional[MembersPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - members = self.members + members = None + if self.pagination is not None: + if self.pagination.members is not None: + members = self.pagination.members if not members: return [] return members @@ -199,12 +215,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] - pagination: Optional[MembersPagePagination] = None + pagination: Optional[MembersPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - members = self.members + members = None + if self.pagination is not None: + if self.pagination.members is not None: + members = self.pagination.members if not members: return [] return members @@ -221,17 +239,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SSOConfigurationsPagePagination(BaseModel): +class SSOConfigurationsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + sso_configurations: Optional[List[_T]] = None + class SyncSSOConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") - pagination: Optional[SSOConfigurationsPagePagination] = None + pagination: Optional[SSOConfigurationsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - sso_configurations = self.sso_configurations + sso_configurations = None + if self.pagination is not None: + if self.pagination.sso_configurations is not None: + sso_configurations = self.pagination.sso_configurations if not sso_configurations: return [] return sso_configurations @@ -249,12 +271,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncSSOConfigurationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") - pagination: Optional[SSOConfigurationsPagePagination] = None + pagination: Optional[SSOConfigurationsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - sso_configurations = self.sso_configurations + sso_configurations = None + if self.pagination is not None: + if self.pagination.sso_configurations is not None: + sso_configurations = self.pagination.sso_configurations if not sso_configurations: return [] return sso_configurations @@ -271,17 +295,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class LoginProvidersPagePagination(BaseModel): +class LoginProvidersPagePagination(GenericModel, Generic[_T]): + login_providers: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncLoginProvidersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - login_providers: List[_T] = FieldInfo(alias="loginProviders") - pagination: Optional[LoginProvidersPagePagination] = None + pagination: Optional[LoginProvidersPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - login_providers = self.login_providers + login_providers = None + if self.pagination is not None: + if self.pagination.login_providers is not None: + login_providers = self.pagination.login_providers if not login_providers: return [] return login_providers @@ -299,12 +327,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncLoginProvidersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - login_providers: List[_T] = FieldInfo(alias="loginProviders") - pagination: Optional[LoginProvidersPagePagination] = None + pagination: Optional[LoginProvidersPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - login_providers = self.login_providers + login_providers = None + if self.pagination is not None: + if self.pagination.login_providers is not None: + login_providers = self.pagination.login_providers if not login_providers: return [] return login_providers @@ -321,17 +351,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EditorsPagePagination(BaseModel): +class EditorsPagePagination(GenericModel, Generic[_T]): + editors: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEditorsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - editors: List[_T] - pagination: Optional[EditorsPagePagination] = None + pagination: Optional[EditorsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - editors = self.editors + editors = None + if self.pagination is not None: + if self.pagination.editors is not None: + editors = self.pagination.editors if not editors: return [] return editors @@ -349,12 +383,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEditorsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - editors: List[_T] - pagination: Optional[EditorsPagePagination] = None + pagination: Optional[EditorsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - editors = self.editors + editors = None + if self.pagination is not None: + if self.pagination.editors is not None: + editors = self.pagination.editors if not editors: return [] return editors @@ -371,17 +407,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TokensPagePagination(BaseModel): +class TokensPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + tokens: Optional[List[_T]] = None + class SyncTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - tokens: List[_T] - pagination: Optional[TokensPagePagination] = None + pagination: Optional[TokensPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - tokens = self.tokens + tokens = None + if self.pagination is not None: + if self.pagination.tokens is not None: + tokens = self.pagination.tokens if not tokens: return [] return tokens @@ -399,12 +439,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - tokens: List[_T] - pagination: Optional[TokensPagePagination] = None + pagination: Optional[TokensPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - tokens = self.tokens + tokens = None + if self.pagination is not None: + if self.pagination.tokens is not None: + tokens = self.pagination.tokens if not tokens: return [] return tokens @@ -421,17 +463,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class IntegrationsPagePagination(BaseModel): +class IntegrationsPagePagination(GenericModel, Generic[_T]): + integrations: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncIntegrationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - integrations: List[_T] - pagination: Optional[IntegrationsPagePagination] = None + pagination: Optional[IntegrationsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - integrations = self.integrations + integrations = None + if self.pagination is not None: + if self.pagination.integrations is not None: + integrations = self.pagination.integrations if not integrations: return [] return integrations @@ -449,12 +495,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncIntegrationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - integrations: List[_T] - pagination: Optional[IntegrationsPagePagination] = None + pagination: Optional[IntegrationsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - integrations = self.integrations + integrations = None + if self.pagination is not None: + if self.pagination.integrations is not None: + integrations = self.pagination.integrations if not integrations: return [] return integrations @@ -471,17 +519,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EnvironmentClassesPagePagination(BaseModel): +class EnvironmentClassesPagePagination(GenericModel, Generic[_T]): + environment_classes: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] = FieldInfo(alias="environmentClasses") - pagination: Optional[EnvironmentClassesPagePagination] = None + pagination: Optional[EnvironmentClassesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes + environment_classes = None + if self.pagination is not None: + if self.pagination.environment_classes is not None: + environment_classes = self.pagination.environment_classes if not environment_classes: return [] return environment_classes @@ -499,12 +551,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] = FieldInfo(alias="environmentClasses") - pagination: Optional[EnvironmentClassesPagePagination] = None + pagination: Optional[EnvironmentClassesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes + environment_classes = None + if self.pagination is not None: + if self.pagination.environment_classes is not None: + environment_classes = self.pagination.environment_classes if not environment_classes: return [] return environment_classes @@ -521,17 +575,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class RunnersPagePagination(BaseModel): +class RunnersPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + runners: Optional[List[_T]] = None + class SyncRunnersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - runners: List[_T] - pagination: Optional[RunnersPagePagination] = None + pagination: Optional[RunnersPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - runners = self.runners + runners = None + if self.pagination is not None: + if self.pagination.runners is not None: + runners = self.pagination.runners if not runners: return [] return runners @@ -549,12 +607,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncRunnersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - runners: List[_T] - pagination: Optional[RunnersPagePagination] = None + pagination: Optional[RunnersPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - runners = self.runners + runners = None + if self.pagination is not None: + if self.pagination.runners is not None: + runners = self.pagination.runners if not runners: return [] return runners @@ -571,17 +631,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class PoliciesPagePagination(BaseModel): +class PoliciesPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + policies: Optional[List[_T]] = None + class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - policies: List[_T] - pagination: Optional[PoliciesPagePagination] = None + pagination: Optional[PoliciesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - policies = self.policies + policies = None + if self.pagination is not None: + if self.pagination.policies is not None: + policies = self.pagination.policies if not policies: return [] return policies @@ -599,12 +663,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - policies: List[_T] - pagination: Optional[PoliciesPagePagination] = None + pagination: Optional[PoliciesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - policies = self.policies + policies = None + if self.pagination is not None: + if self.pagination.policies is not None: + policies = self.pagination.policies if not policies: return [] return policies @@ -621,17 +687,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EnvironmentsPagePagination(BaseModel): +class EnvironmentsPagePagination(GenericModel, Generic[_T]): + environments: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environments: List[_T] - pagination: Optional[EnvironmentsPagePagination] = None + pagination: Optional[EnvironmentsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - environments = self.environments + environments = None + if self.pagination is not None: + if self.pagination.environments is not None: + environments = self.pagination.environments if not environments: return [] return environments @@ -649,12 +719,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEnvironmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environments: List[_T] - pagination: Optional[EnvironmentsPagePagination] = None + pagination: Optional[EnvironmentsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - environments = self.environments + environments = None + if self.pagination is not None: + if self.pagination.environments is not None: + environments = self.pagination.environments if not environments: return [] return environments @@ -671,17 +743,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class ServicesPagePagination(BaseModel): +class ServicesPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + services: Optional[List[_T]] = None + class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] - pagination: Optional[ServicesPagePagination] = None + pagination: Optional[ServicesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - services = self.services + services = None + if self.pagination is not None: + if self.pagination.services is not None: + services = self.pagination.services if not services: return [] return services @@ -699,12 +775,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] - pagination: Optional[ServicesPagePagination] = None + pagination: Optional[ServicesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - services = self.services + services = None + if self.pagination is not None: + if self.pagination.services is not None: + services = self.pagination.services if not services: return [] return services @@ -721,17 +799,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TasksPagePagination(BaseModel): +class TasksPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + tasks: Optional[List[_T]] = None + class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] - pagination: Optional[TasksPagePagination] = None + pagination: Optional[TasksPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - tasks = self.tasks + tasks = None + if self.pagination is not None: + if self.pagination.tasks is not None: + tasks = self.pagination.tasks if not tasks: return [] return tasks @@ -749,12 +831,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] - pagination: Optional[TasksPagePagination] = None + pagination: Optional[TasksPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - tasks = self.tasks + tasks = None + if self.pagination is not None: + if self.pagination.tasks is not None: + tasks = self.pagination.tasks if not tasks: return [] return tasks @@ -771,17 +855,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TaskExecutionsPagePagination(BaseModel): +class TaskExecutionsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + task_executions: Optional[List[_T]] = None + class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] = FieldInfo(alias="taskExecutions") - pagination: Optional[TaskExecutionsPagePagination] = None + pagination: Optional[TaskExecutionsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions + task_executions = None + if self.pagination is not None: + if self.pagination.task_executions is not None: + task_executions = self.pagination.task_executions if not task_executions: return [] return task_executions @@ -799,12 +887,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] = FieldInfo(alias="taskExecutions") - pagination: Optional[TaskExecutionsPagePagination] = None + pagination: Optional[TaskExecutionsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions + task_executions = None + if self.pagination is not None: + if self.pagination.task_executions is not None: + task_executions = self.pagination.task_executions if not task_executions: return [] return task_executions @@ -821,17 +911,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EntriesPagePagination(BaseModel): +class EntriesPagePagination(GenericModel, Generic[_T]): + entries: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - entries: List[_T] - pagination: Optional[EntriesPagePagination] = None + pagination: Optional[EntriesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - entries = self.entries + entries = None + if self.pagination is not None: + if self.pagination.entries is not None: + entries = self.pagination.entries if not entries: return [] return entries @@ -849,12 +943,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEntriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - entries: List[_T] - pagination: Optional[EntriesPagePagination] = None + pagination: Optional[EntriesPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - entries = self.entries + entries = None + if self.pagination is not None: + if self.pagination.entries is not None: + entries = self.pagination.entries if not entries: return [] return entries @@ -871,17 +967,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class GroupsPagePagination(BaseModel): +class GroupsPagePagination(GenericModel, Generic[_T]): + groups: Optional[List[_T]] = None + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - groups: List[_T] - pagination: Optional[GroupsPagePagination] = None + pagination: Optional[GroupsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - groups = self.groups + groups = None + if self.pagination is not None: + if self.pagination.groups is not None: + groups = self.pagination.groups if not groups: return [] return groups @@ -899,12 +999,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncGroupsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - groups: List[_T] - pagination: Optional[GroupsPagePagination] = None + pagination: Optional[GroupsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - groups = self.groups + groups = None + if self.pagination is not None: + if self.pagination.groups is not None: + groups = self.pagination.groups if not groups: return [] return groups @@ -921,17 +1023,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class ProjectsPagePagination(BaseModel): +class ProjectsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + projects: Optional[List[_T]] = None + class SyncProjectsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - projects: List[_T] - pagination: Optional[ProjectsPagePagination] = None + pagination: Optional[ProjectsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - projects = self.projects + projects = None + if self.pagination is not None: + if self.pagination.projects is not None: + projects = self.pagination.projects if not projects: return [] return projects @@ -949,12 +1055,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncProjectsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - projects: List[_T] - pagination: Optional[ProjectsPagePagination] = None + pagination: Optional[ProjectsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - projects = self.projects + projects = None + if self.pagination is not None: + if self.pagination.projects is not None: + projects = self.pagination.projects if not projects: return [] return projects @@ -971,17 +1079,21 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SecretsPagePagination(BaseModel): +class SecretsPagePagination(GenericModel, Generic[_T]): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + secrets: Optional[List[_T]] = None + class SyncSecretsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - secrets: List[_T] - pagination: Optional[SecretsPagePagination] = None + pagination: Optional[SecretsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - secrets = self.secrets + secrets = None + if self.pagination is not None: + if self.pagination.secrets is not None: + secrets = self.pagination.secrets if not secrets: return [] return secrets @@ -999,12 +1111,14 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncSecretsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - secrets: List[_T] - pagination: Optional[SecretsPagePagination] = None + pagination: Optional[SecretsPagePagination[_T]] = None @override def _get_page_items(self) -> List[_T]: - secrets = self.secrets + secrets = None + if self.pagination is not None: + if self.pagination.secrets is not None: + secrets = self.pagination.secrets if not secrets: return [] return secrets diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 8246a689..1d70bbdc 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..types import ( @@ -14,9 +12,7 @@ ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -27,7 +23,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options +from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from .._base_client import AsyncPaginator, make_request_options from ..types.account_retrieve_response import AccountRetrieveResponse from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse from ..types.account_list_login_providers_response import AccountListLoginProvidersResponse @@ -59,8 +56,6 @@ def retrieve( self, *, body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,10 +67,6 @@ def retrieve( GetAccount retrieves a single Account. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -84,15 +75,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.AccountService/GetAccount", body=maybe_transform(body, account_retrieve_params.AccountRetrieveParams), @@ -105,9 +87,7 @@ def retrieve( def delete( self, *, - connect_protocol_version: Literal[1], account_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -121,10 +101,6 @@ def delete( an active member of any Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -133,15 +109,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.AccountService/DeleteAccount", body=maybe_transform({"account_id": account_id}, account_delete_params.AccountDeleteParams), @@ -155,9 +122,7 @@ def get_sso_login_url( self, *, return_to: str, - connect_protocol_version: Literal[1], email: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -171,12 +136,8 @@ def get_sso_login_url( Args: return_to: return_to is the URL the user will be redirected to after login - connect_protocol_version: Define the version of the Connect protocol - email: email is the email the user wants to login with - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -185,15 +146,6 @@ def get_sso_login_url( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.AccountService/GetSSOLoginURL", body=maybe_transform( @@ -212,37 +164,25 @@ def get_sso_login_url( def list_login_providers( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: account_list_login_providers_params.Filter | NotGiven = NOT_GIVEN, + pagination: account_list_login_providers_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AccountListLoginProvidersResponse: + ) -> SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse]: """ ListLoginProviders returns the list of login providers matching the provided filters. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + filter: filter contains the filter options for listing login methods - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing login methods extra_headers: Send extra headers @@ -252,17 +192,16 @@ def list_login_providers( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.AccountService/ListLoginProviders", + page=SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + account_list_login_providers_params.AccountListLoginProvidersParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.AccountService/ListLoginProviders", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -270,16 +209,14 @@ def list_login_providers( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, account_list_login_providers_params.AccountListLoginProvidersParams, ), ), - cast_to=AccountListLoginProvidersResponse, + model=AccountListLoginProvidersResponse, + method="post", ) @@ -307,8 +244,6 @@ async def retrieve( self, *, body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -320,10 +255,6 @@ async def retrieve( GetAccount retrieves a single Account. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -332,15 +263,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.AccountService/GetAccount", body=await async_maybe_transform(body, account_retrieve_params.AccountRetrieveParams), @@ -353,9 +275,7 @@ async def retrieve( async def delete( self, *, - connect_protocol_version: Literal[1], account_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -369,10 +289,6 @@ async def delete( an active member of any Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -381,15 +297,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.AccountService/DeleteAccount", body=await async_maybe_transform({"account_id": account_id}, account_delete_params.AccountDeleteParams), @@ -403,9 +310,7 @@ async def get_sso_login_url( self, *, return_to: str, - connect_protocol_version: Literal[1], email: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -419,12 +324,8 @@ async def get_sso_login_url( Args: return_to: return_to is the URL the user will be redirected to after login - connect_protocol_version: Define the version of the Connect protocol - email: email is the email the user wants to login with - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -433,15 +334,6 @@ async def get_sso_login_url( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.AccountService/GetSSOLoginURL", body=await async_maybe_transform( @@ -457,40 +349,30 @@ async def get_sso_login_url( cast_to=AccountGetSSOLoginURLResponse, ) - async def list_login_providers( + def list_login_providers( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: account_list_login_providers_params.Filter | NotGiven = NOT_GIVEN, + pagination: account_list_login_providers_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AccountListLoginProvidersResponse: + ) -> AsyncPaginator[ + AccountListLoginProvidersResponse, AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse] + ]: """ ListLoginProviders returns the list of login providers matching the provided filters. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + filter: filter contains the filter options for listing login methods - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing login methods extra_headers: Send extra headers @@ -500,34 +382,31 @@ async def list_login_providers( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.AccountService/ListLoginProviders", + page=AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + account_list_login_providers_params.AccountListLoginProvidersParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.AccountService/ListLoginProviders", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, account_list_login_providers_params.AccountListLoginProvidersParams, ), ), - cast_to=AccountListLoginProvidersResponse, + model=AccountListLoginProvidersResponse, + method="post", ) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 0f41191d..fa1c787e 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -2,16 +2,12 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..types import editor_list_params, editor_retrieve_params, editor_resolve_url_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -22,7 +18,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options +from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from .._base_client import AsyncPaginator, make_request_options from ..types.editor_list_response import EditorListResponse from ..types.editor_retrieve_response import EditorRetrieveResponse from ..types.editor_resolve_url_response import EditorResolveURLResponse @@ -53,9 +50,7 @@ def with_streaming_response(self) -> EditorsResourceWithStreamingResponse: def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -67,12 +62,8 @@ def retrieve( GetEditor returns the editor with the given ID Args: - connect_protocol_version: Define the version of the Connect protocol - id: id is the ID of the editor to get - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -81,15 +72,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EditorService/GetEditor", body=maybe_transform({"id": id}, editor_retrieve_params.EditorRetrieveParams), @@ -102,36 +84,21 @@ def retrieve( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EditorListResponse: + ) -> SyncPersonalAccessTokensPage[EditorListResponse]: """ ListEditors lists all editors available to the caller Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -141,17 +108,10 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( + return self._get_api_list( "/gitpod.v1.EditorService/ListEditors", + page=SyncPersonalAccessTokensPage[EditorListResponse], + body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -159,26 +119,22 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, editor_list_params.EditorListParams, ), ), - cast_to=EditorListResponse, + model=EditorListResponse, + method="post", ) def resolve_url( self, *, - connect_protocol_version: Literal[1], editor_id: str | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -190,16 +146,12 @@ def resolve_url( ResolveEditorURL resolves the editor's URL for an environment Args: - connect_protocol_version: Define the version of the Connect protocol - editor_id: editorId is the ID of the editor to resolve the URL for environment_id: environmentId is the ID of the environment to resolve the URL for organization_id: organizationId is the ID of the organization to resolve the URL for - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -208,15 +160,6 @@ def resolve_url( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EditorService/ResolveEditorURL", body=maybe_transform( @@ -257,9 +200,7 @@ def with_streaming_response(self) -> AsyncEditorsResourceWithStreamingResponse: async def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -271,12 +212,8 @@ async def retrieve( GetEditor returns the editor with the given ID Args: - connect_protocol_version: Define the version of the Connect protocol - id: id is the ID of the editor to get - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -285,15 +222,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EditorService/GetEditor", body=await async_maybe_transform({"id": id}, editor_retrieve_params.EditorRetrieveParams), @@ -303,39 +231,24 @@ async def retrieve( cast_to=EditorRetrieveResponse, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EditorListResponse: + ) -> AsyncPaginator[EditorListResponse, AsyncPersonalAccessTokensPage[EditorListResponse]]: """ ListEditors lists all editors available to the caller Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -345,44 +258,33 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( + return self._get_api_list( "/gitpod.v1.EditorService/ListEditors", + page=AsyncPersonalAccessTokensPage[EditorListResponse], + body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, editor_list_params.EditorListParams, ), ), - cast_to=EditorListResponse, + model=EditorListResponse, + method="post", ) async def resolve_url( self, *, - connect_protocol_version: Literal[1], editor_id: str | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -394,16 +296,12 @@ async def resolve_url( ResolveEditorURL resolves the editor's URL for an environment Args: - connect_protocol_version: Define the version of the Connect protocol - editor_id: editorId is the ID of the editor to resolve the URL for environment_id: environmentId is the ID of the environment to resolve the URL for organization_id: organizationId is the ID of the organization to resolve the URL for - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -412,15 +310,6 @@ async def resolve_url( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EditorService/ResolveEditorURL", body=await async_maybe_transform( diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index 0fe73d8e..92069a01 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from .services import ( @@ -16,9 +14,7 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -75,10 +71,8 @@ def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: def upsert( self, *, - connect_protocol_version: Literal[1], automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -90,16 +84,10 @@ def upsert( UpsertAutomationsFile upserts the automations file for the given environment. Args: - connect_protocol_version: Define the version of the Connect protocol - automations_file: WARN: Do not remove any field here, as it will break reading automation yaml - files. We error if there are any - - unknown fields in the yaml (to ensure the yaml is correct), but would break if - we removed any fields. This includes marking a field as "reserved" in the proto - file, this will also break reading the yaml. - - connect_timeout_ms: Define the timeout, in ms + files. We error if there are any unknown fields in the yaml (to ensure the yaml + is correct), but would break if we removed any fields. This includes marking a + field as "reserved" in the proto file, this will also break reading the yaml. extra_headers: Send extra headers @@ -109,15 +97,6 @@ def upsert( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", body=maybe_transform( @@ -165,10 +144,8 @@ def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingRespon async def upsert( self, *, - connect_protocol_version: Literal[1], automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -180,16 +157,10 @@ async def upsert( UpsertAutomationsFile upserts the automations file for the given environment. Args: - connect_protocol_version: Define the version of the Connect protocol - automations_file: WARN: Do not remove any field here, as it will break reading automation yaml - files. We error if there are any - - unknown fields in the yaml (to ensure the yaml is correct), but would break if - we removed any fields. This includes marking a field as "reserved" in the proto - file, this will also break reading the yaml. - - connect_timeout_ms: Define the timeout, in ms + files. We error if there are any unknown fields in the yaml (to ensure the yaml + is correct), but would break if we removed any fields. This includes marking a + field as "reserved" in the proto file, this will also break reading the yaml. extra_headers: Send extra headers @@ -199,15 +170,6 @@ async def upsert( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile", body=await async_maybe_transform( diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index f3e82f24..ce3490fb 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -2,15 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -21,7 +17,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._base_client import make_request_options +from ....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...._base_client import AsyncPaginator, make_request_options from ....types.environments.automations import ( service_list_params, service_stop_params, @@ -61,11 +58,9 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, metadata: service_create_params.Metadata | NotGiven = NOT_GIVEN, spec: service_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,10 +72,6 @@ def create( CreateService Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -89,15 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/CreateService", body=maybe_transform( @@ -117,9 +99,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -131,10 +111,6 @@ def retrieve( GetService Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -143,15 +119,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/GetService", body=maybe_transform({"id": id}, service_retrieve_params.ServiceRetrieveParams), @@ -164,12 +131,10 @@ def retrieve( def update( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, spec: service_update_params.Spec | NotGiven = NOT_GIVEN, status: service_update_params.Status | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -181,20 +146,13 @@ def update( UpdateService Args: - connect_protocol_version: Define the version of the Connect protocol - - spec: Changing the spec of a service is a complex operation. The spec of a service - - can only be updated if the service is in a stopped state. If the service is - running, it must be stopped first. + spec: Changing the spec of a service is a complex operation. The spec of a service can + only be updated if the service is in a stopped state. If the service is running, + it must be stopped first. status: Service status updates are only expected from the executing environment. As a - client - - of this API you are not expected to provide this field. Updating this field - requires the `environmentservice:update_status` permission. - - connect_timeout_ms: Define the timeout, in ms + client of this API you are not expected to provide this field. Updating this + field requires the `environmentservice:update_status` permission. extra_headers: Send extra headers @@ -204,15 +162,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateService", body=maybe_transform( @@ -233,36 +182,24 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: service_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceListResponse: + ) -> SyncPersonalAccessTokensPage[ServiceListResponse]: """ ListServices Args: - encoding: Define which encoding or 'Message-Codec' to use + filter: filter contains the filter options for listing services - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing services extra_headers: Send extra headers @@ -272,17 +209,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentAutomationService/ListServices", + page=SyncPersonalAccessTokensPage[ServiceListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + service_list_params.ServiceListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.EnvironmentAutomationService/ListServices", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -290,25 +226,21 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, service_list_params.ServiceListParams, ), ), - cast_to=ServiceListResponse, + model=ServiceListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, force: bool | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -319,15 +251,9 @@ def delete( """DeleteService deletes a service. This call does not block until the service is - deleted. - - If the service is not stopped it will be stopped before deletion. + deleted. If the service is not stopped it will be stopped before deletion. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -336,15 +262,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteService", body=maybe_transform( @@ -363,9 +280,7 @@ def delete( def start( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -376,15 +291,10 @@ def start( """StartService starts a service. This call does not block until the service is + started. This call will not error if the service is already running or has been started. - This call will not error if the service is already running or has been started. - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -393,15 +303,6 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/StartService", body=maybe_transform({"id": id}, service_start_params.ServiceStartParams), @@ -414,9 +315,7 @@ def start( def stop( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -427,15 +326,10 @@ def stop( """StopService stops a service. This call does not block until the service is + stopped. This call will not error if the service is already stopped or has been stopped. - This call will not error if the service is already stopped or has been stopped. - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -444,15 +338,6 @@ def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/StopService", body=maybe_transform({"id": id}, service_stop_params.ServiceStopParams), @@ -486,11 +371,9 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: async def create( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, metadata: service_create_params.Metadata | NotGiven = NOT_GIVEN, spec: service_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -502,10 +385,6 @@ async def create( CreateService Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -514,15 +393,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/CreateService", body=await async_maybe_transform( @@ -542,9 +412,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -556,10 +424,6 @@ async def retrieve( GetService Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -568,15 +432,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetService", body=await async_maybe_transform({"id": id}, service_retrieve_params.ServiceRetrieveParams), @@ -589,12 +444,10 @@ async def retrieve( async def update( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, spec: service_update_params.Spec | NotGiven = NOT_GIVEN, status: service_update_params.Status | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -606,20 +459,13 @@ async def update( UpdateService Args: - connect_protocol_version: Define the version of the Connect protocol - - spec: Changing the spec of a service is a complex operation. The spec of a service - - can only be updated if the service is in a stopped state. If the service is - running, it must be stopped first. + spec: Changing the spec of a service is a complex operation. The spec of a service can + only be updated if the service is in a stopped state. If the service is running, + it must be stopped first. status: Service status updates are only expected from the executing environment. As a - client - - of this API you are not expected to provide this field. Updating this field - requires the `environmentservice:update_status` permission. - - connect_timeout_ms: Define the timeout, in ms + client of this API you are not expected to provide this field. Updating this + field requires the `environmentservice:update_status` permission. extra_headers: Send extra headers @@ -629,15 +475,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateService", body=await async_maybe_transform( @@ -655,39 +492,27 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: service_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceListResponse: + ) -> AsyncPaginator[ServiceListResponse, AsyncPersonalAccessTokensPage[ServiceListResponse]]: """ ListServices Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol + filter: filter contains the filter options for listing services - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing services extra_headers: Send extra headers @@ -697,43 +522,38 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentAutomationService/ListServices", + page=AsyncPersonalAccessTokensPage[ServiceListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + service_list_params.ServiceListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.EnvironmentAutomationService/ListServices", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, service_list_params.ServiceListParams, ), ), - cast_to=ServiceListResponse, + model=ServiceListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, force: bool | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -744,15 +564,9 @@ async def delete( """DeleteService deletes a service. This call does not block until the service is - deleted. - - If the service is not stopped it will be stopped before deletion. + deleted. If the service is not stopped it will be stopped before deletion. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -761,15 +575,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteService", body=await async_maybe_transform( @@ -788,9 +593,7 @@ async def delete( async def start( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -801,15 +604,10 @@ async def start( """StartService starts a service. This call does not block until the service is + started. This call will not error if the service is already running or has been started. - This call will not error if the service is already running or has been started. - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -818,15 +616,6 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StartService", body=await async_maybe_transform({"id": id}, service_start_params.ServiceStartParams), @@ -839,9 +628,7 @@ async def start( async def stop( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -852,15 +639,10 @@ async def stop( """StopService stops a service. This call does not block until the service is + stopped. This call will not error if the service is already stopped or has been stopped. - This call will not error if the service is already stopped or has been stopped. - Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -869,15 +651,6 @@ async def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StopService", body=await async_maybe_transform({"id": id}, service_stop_params.ServiceStopParams), diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index e3f0557c..fa40eefb 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -2,15 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ....._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ....._compat import cached_property @@ -21,7 +17,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....._base_client import make_request_options +from .....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ....._base_client import AsyncPaginator, make_request_options from .....types.environments.automations.tasks import ( execution_list_params, execution_stop_params, @@ -56,9 +53,7 @@ def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -70,10 +65,6 @@ def retrieve( GetTaskExecution Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -82,15 +73,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", body=maybe_transform({"id": id}, execution_retrieve_params.ExecutionRetrieveParams), @@ -103,36 +85,24 @@ def retrieve( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: execution_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: execution_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ExecutionListResponse: + ) -> SyncPersonalAccessTokensPage[ExecutionListResponse]: """ ListTaskExecutions Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request + filter: filter contains the filter options for listing task runs - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing task runs extra_headers: Send extra headers @@ -142,17 +112,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + page=SyncPersonalAccessTokensPage[ExecutionListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + execution_list_params.ExecutionListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -160,24 +129,20 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, execution_list_params.ExecutionListParams, ), ), - cast_to=ExecutionListResponse, + model=ExecutionListResponse, + method="post", ) def stop( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -189,10 +154,6 @@ def stop( StopTaskExecution Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -201,15 +162,6 @@ def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", body=maybe_transform({"id": id}, execution_stop_params.ExecutionStopParams), @@ -243,9 +195,7 @@ def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingRespons async def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -257,10 +207,6 @@ async def retrieve( GetTaskExecution Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -269,15 +215,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetTaskExecution", body=await async_maybe_transform({"id": id}, execution_retrieve_params.ExecutionRetrieveParams), @@ -287,39 +224,27 @@ async def retrieve( cast_to=ExecutionRetrieveResponse, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: execution_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: execution_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ExecutionListResponse: + ) -> AsyncPaginator[ExecutionListResponse, AsyncPersonalAccessTokensPage[ExecutionListResponse]]: """ ListTaskExecutions Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + filter: filter contains the filter options for listing task runs - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing task runs extra_headers: Send extra headers @@ -329,42 +254,37 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + page=AsyncPersonalAccessTokensPage[ExecutionListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + execution_list_params.ExecutionListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, execution_list_params.ExecutionListParams, ), ), - cast_to=ExecutionListResponse, + model=ExecutionListResponse, + method="post", ) async def stop( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -376,10 +296,6 @@ async def stop( StopTaskExecution Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -388,15 +304,6 @@ async def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StopTaskExecution", body=await async_maybe_transform({"id": id}, execution_stop_params.ExecutionStopParams), diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 15d4794e..0e9e8e64 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -3,15 +3,12 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal import httpx from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ....._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from .executions import ( @@ -30,7 +27,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....._base_client import make_request_options +from .....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ....._base_client import AsyncPaginator, make_request_options from .....types.environments.automations import ( task_list_params, task_start_params, @@ -74,12 +72,10 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, spec: task_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -91,10 +87,6 @@ def create( CreateTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -103,15 +95,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/CreateTask", body=maybe_transform( @@ -132,9 +115,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -146,10 +127,6 @@ def retrieve( GetTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -158,15 +135,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/GetTask", body=maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), @@ -179,12 +147,10 @@ def retrieve( def update( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, depends_on: List[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, spec: task_update_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -196,12 +162,8 @@ def update( UpdateTask Args: - connect_protocol_version: Define the version of the Connect protocol - depends_on: dependencies specifies the IDs of the automations this task depends on. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -210,15 +172,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTask", body=maybe_transform( @@ -239,36 +192,24 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: task_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskListResponse: + ) -> SyncPersonalAccessTokensPage[TaskListResponse]: """ ListTasks Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request + filter: filter contains the filter options for listing tasks - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing tasks extra_headers: Send extra headers @@ -278,17 +219,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentAutomationService/ListTasks", + page=SyncPersonalAccessTokensPage[TaskListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + task_list_params.TaskListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.EnvironmentAutomationService/ListTasks", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -296,24 +236,20 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, task_list_params.TaskListParams, ), ), - cast_to=TaskListResponse, + model=TaskListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -325,10 +261,6 @@ def delete( DeleteTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -337,15 +269,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteTask", body=maybe_transform({"id": id}, task_delete_params.TaskDeleteParams), @@ -358,9 +281,7 @@ def delete( def start( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -374,10 +295,6 @@ def start( until the task is started; the task will be started asynchronously. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -386,15 +303,6 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentAutomationService/StartTask", body=maybe_transform({"id": id}, task_start_params.TaskStartParams), @@ -432,12 +340,10 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: async def create( self, *, - connect_protocol_version: Literal[1], depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, spec: task_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -449,10 +355,6 @@ async def create( CreateTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -461,15 +363,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/CreateTask", body=await async_maybe_transform( @@ -490,9 +383,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -504,10 +395,6 @@ async def retrieve( GetTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -516,15 +403,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/GetTask", body=await async_maybe_transform({"id": id}, task_retrieve_params.TaskRetrieveParams), @@ -537,12 +415,10 @@ async def retrieve( async def update( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, depends_on: List[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, spec: task_update_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -554,12 +430,8 @@ async def update( UpdateTask Args: - connect_protocol_version: Define the version of the Connect protocol - depends_on: dependencies specifies the IDs of the automations this task depends on. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -568,15 +440,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/UpdateTask", body=await async_maybe_transform( @@ -594,39 +457,27 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: task_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TaskListResponse: + ) -> AsyncPaginator[TaskListResponse, AsyncPersonalAccessTokensPage[TaskListResponse]]: """ ListTasks Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request + filter: filter contains the filter options for listing tasks - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing tasks extra_headers: Send extra headers @@ -636,42 +487,37 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentAutomationService/ListTasks", + page=AsyncPersonalAccessTokensPage[TaskListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + task_list_params.TaskListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.EnvironmentAutomationService/ListTasks", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, task_list_params.TaskListParams, ), ), - cast_to=TaskListResponse, + model=TaskListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -683,10 +529,6 @@ async def delete( DeleteTask Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -695,15 +537,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/DeleteTask", body=await async_maybe_transform({"id": id}, task_delete_params.TaskDeleteParams), @@ -716,9 +549,7 @@ async def delete( async def start( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -732,10 +563,6 @@ async def start( until the task is started; the task will be started asynchronously. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -744,15 +571,6 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentAutomationService/StartTask", body=await async_maybe_transform({"id": id}, task_start_params.TaskStartParams), diff --git a/src/gitpod/resources/environments/classes.py b/src/gitpod/resources/environments/classes.py index b272a36e..1e8ed9ec 100644 --- a/src/gitpod/resources/environments/classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -2,17 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -21,7 +14,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.environments import class_list_params from ...types.environments.class_list_response import ClassListResponse @@ -51,39 +45,24 @@ def with_streaming_response(self) -> ClassesResourceWithStreamingResponse: def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: class_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: class_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClassListResponse: + ) -> SyncPersonalAccessTokensPage[ClassListResponse]: """ ListEnvironmentClasses returns the list of environment classes with runner - details a user is able to use based on the - - query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + details a user is able to use based on the query buf:lint:ignore + RPC_REQUEST_RESPONSE_UNIQUE Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environment classes extra_headers: Send extra headers @@ -93,17 +72,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", + page=SyncPersonalAccessTokensPage[ClassListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + class_list_params.ClassListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -111,16 +89,14 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, class_list_params.ClassListParams, ), ), - cast_to=ClassListResponse, + model=ClassListResponse, + method="post", ) @@ -144,42 +120,27 @@ def with_streaming_response(self) -> AsyncClassesResourceWithStreamingResponse: """ return AsyncClassesResourceWithStreamingResponse(self) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: class_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: class_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClassListResponse: + ) -> AsyncPaginator[ClassListResponse, AsyncPersonalAccessTokensPage[ClassListResponse]]: """ ListEnvironmentClasses returns the list of environment classes with runner - details a user is able to use based on the - - query buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + details a user is able to use based on the query buf:lint:ignore + RPC_REQUEST_RESPONSE_UNIQUE Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environment classes extra_headers: Send extra headers @@ -189,34 +150,31 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", + page=AsyncPersonalAccessTokensPage[ClassListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + class_list_params.ClassListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, class_list_params.ClassListParams, ), ), - cast_to=ClassListResponse, + model=ClassListResponse, + method="post", ) diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 5400fae6..d66c4970 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx @@ -28,10 +28,8 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -42,7 +40,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..._base_client import AsyncPaginator, make_request_options from .automations.automations import ( AutomationsResource, AsyncAutomationsResource, @@ -91,9 +90,7 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -105,14 +102,9 @@ def create( CreateEnvironment creates a new environment and starts it. Args: - connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment - start - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -121,15 +113,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/CreateEnvironment", body=maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), @@ -142,9 +125,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -159,12 +140,8 @@ def retrieve( +return NOT_FOUND Environment does not exist Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment to get - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -173,15 +150,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/GetEnvironment", body=maybe_transform( @@ -198,8 +166,6 @@ def update( self, *, metadata: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -211,10 +177,6 @@ def update( UpdateEnvironment updates the environment partially. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -230,8 +192,6 @@ def update( self, *, spec: environment_update_params.Variant1Spec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -243,10 +203,6 @@ def update( UpdateEnvironment updates the environment partially. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -257,13 +213,11 @@ def update( """ ... - @required_args(["metadata", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + @required_args(["metadata"], ["spec"]) def update( self, *, metadata: object | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -272,15 +226,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/UpdateEnvironment", body=maybe_transform( @@ -299,36 +244,25 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentListResponse: + ) -> SyncPersonalAccessTokensPage[EnvironmentListResponse]: """ ListEnvironments returns a list of environments that match the query. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + organization_id: organization_id is the ID of the organization that contains the environments - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -338,17 +272,17 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentService/ListEnvironments", + page=SyncPersonalAccessTokensPage[EnvironmentListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "organization_id": organization_id, + "pagination": pagination, + }, + environment_list_params.EnvironmentListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.EnvironmentService/ListEnvironments", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -356,25 +290,21 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, environment_list_params.EnvironmentListParams, ), ), - cast_to=EnvironmentListResponse, + model=EnvironmentListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, force: bool | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -388,8 +318,6 @@ def delete( will be stopped as well. Deleted environments cannot be started again. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment that is going to delete. +required @@ -399,8 +327,6 @@ def delete( lifecycle is not respected. Force deleting can result in data loss on the environment. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -409,15 +335,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/DeleteEnvironment", body=maybe_transform( @@ -436,10 +353,8 @@ def delete( def create_from_project( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -452,14 +367,9 @@ def create_from_project( and starts it. Args: - connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment - start - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -468,15 +378,6 @@ def create_from_project( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", body=maybe_transform( @@ -495,9 +396,7 @@ def create_from_project( def create_logs_token( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -510,15 +409,11 @@ def create_logs_token( of an environment. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment for which the logs token should be created. +required - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -527,15 +422,6 @@ def create_logs_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken", body=maybe_transform( @@ -551,10 +437,8 @@ def create_logs_token( def mark_active( self, *, - connect_protocol_version: Literal[1], activity_signal: environment_mark_active_params.ActivitySignal | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -566,14 +450,10 @@ def mark_active( MarkEnvironmentActive allows tools to signal activity for an environment. Args: - connect_protocol_version: Define the version of the Connect protocol - activity_signal: EnvironmentActivitySignal used to signal activity for an environment. environment_id: The ID of the environment to update activity for. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -582,15 +462,6 @@ def mark_active( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/MarkEnvironmentActive", body=maybe_transform( @@ -609,9 +480,7 @@ def mark_active( def start( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -621,17 +490,12 @@ def start( ) -> object: """StartEnvironment starts an environment. - This function is idempotent, i.e. if - - the environment is already running no error is returned. + This function is idempotent, i.e. if the + environment is already running no error is returned. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies which environment should be started. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -640,15 +504,6 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", body=maybe_transform({"environment_id": environment_id}, environment_start_params.EnvironmentStartParams), @@ -661,9 +516,7 @@ def start( def stop( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -675,14 +528,10 @@ def stop( StopEnvironment stops a running environment. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies which environment should be stopped. +required - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -691,15 +540,6 @@ def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EnvironmentService/StopEnvironment", body=maybe_transform({"environment_id": environment_id}, environment_stop_params.EnvironmentStopParams), @@ -741,9 +581,7 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo async def create( self, *, - connect_protocol_version: Literal[1], spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -755,14 +593,9 @@ async def create( CreateEnvironment creates a new environment and starts it. Args: - connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment - start - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -771,15 +604,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/CreateEnvironment", body=await async_maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), @@ -792,9 +616,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -809,12 +631,8 @@ async def retrieve( +return NOT_FOUND Environment does not exist Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment to get - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -823,15 +641,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/GetEnvironment", body=await async_maybe_transform( @@ -848,8 +657,6 @@ async def update( self, *, metadata: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -861,10 +668,6 @@ async def update( UpdateEnvironment updates the environment partially. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -880,8 +683,6 @@ async def update( self, *, spec: environment_update_params.Variant1Spec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -893,10 +694,6 @@ async def update( UpdateEnvironment updates the environment partially. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -907,13 +704,11 @@ async def update( """ ... - @required_args(["metadata", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + @required_args(["metadata"], ["spec"]) async def update( self, *, metadata: object | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -922,15 +717,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/UpdateEnvironment", body=await async_maybe_transform( @@ -946,39 +732,28 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentListResponse: + ) -> AsyncPaginator[EnvironmentListResponse, AsyncPersonalAccessTokensPage[EnvironmentListResponse]]: """ ListEnvironments returns a list of environments that match the query. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol + organization_id: organization_id is the ID of the organization that contains the environments - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -988,43 +763,39 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EnvironmentService/ListEnvironments", + page=AsyncPersonalAccessTokensPage[EnvironmentListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "organization_id": organization_id, + "pagination": pagination, + }, + environment_list_params.EnvironmentListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.EnvironmentService/ListEnvironments", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, environment_list_params.EnvironmentListParams, ), ), - cast_to=EnvironmentListResponse, + model=EnvironmentListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, force: bool | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1038,8 +809,6 @@ async def delete( will be stopped as well. Deleted environments cannot be started again. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment that is going to delete. +required @@ -1049,8 +818,6 @@ async def delete( lifecycle is not respected. Force deleting can result in data loss on the environment. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1059,15 +826,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/DeleteEnvironment", body=await async_maybe_transform( @@ -1086,10 +844,8 @@ async def delete( async def create_from_project( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1102,14 +858,9 @@ async def create_from_project( and starts it. Args: - connect_protocol_version: Define the version of the Connect protocol - spec: EnvironmentSpec specifies the configuration of an environment for an environment - start - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1118,15 +869,6 @@ async def create_from_project( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", body=await async_maybe_transform( @@ -1145,9 +887,7 @@ async def create_from_project( async def create_logs_token( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1160,15 +900,11 @@ async def create_logs_token( of an environment. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment for which the logs token should be created. +required - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1177,15 +913,6 @@ async def create_logs_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken", body=await async_maybe_transform( @@ -1201,10 +928,8 @@ async def create_logs_token( async def mark_active( self, *, - connect_protocol_version: Literal[1], activity_signal: environment_mark_active_params.ActivitySignal | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1216,14 +941,10 @@ async def mark_active( MarkEnvironmentActive allows tools to signal activity for an environment. Args: - connect_protocol_version: Define the version of the Connect protocol - activity_signal: EnvironmentActivitySignal used to signal activity for an environment. environment_id: The ID of the environment to update activity for. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1232,15 +953,6 @@ async def mark_active( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/MarkEnvironmentActive", body=await async_maybe_transform( @@ -1259,9 +971,7 @@ async def mark_active( async def start( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1271,17 +981,12 @@ async def start( ) -> object: """StartEnvironment starts an environment. - This function is idempotent, i.e. if - - the environment is already running no error is returned. + This function is idempotent, i.e. if the + environment is already running no error is returned. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies which environment should be started. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1290,15 +995,6 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", body=await async_maybe_transform( @@ -1313,9 +1009,7 @@ async def start( async def stop( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1327,14 +1021,10 @@ async def stop( StopEnvironment stops a running environment. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies which environment should be stopped. +required - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1343,15 +1033,6 @@ async def stop( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EnvironmentService/StopEnvironment", body=await async_maybe_transform( diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index 508d7738..f2f98059 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -2,17 +2,15 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx from ..types import event_list_params, event_watch_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -23,7 +21,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options +from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from .._base_client import AsyncPaginator, make_request_options from .._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder from ..types.event_list_response import EventListResponse from ..types.event_watch_response import EventWatchResponse @@ -54,37 +53,23 @@ def with_streaming_response(self) -> EventsResourceWithStreamingResponse: def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: event_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: event_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventListResponse: + ) -> SyncPersonalAccessTokensPage[EventListResponse]: """ ListAuditLogs retrieves a paginated list of audit logs for the specified organization Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -94,17 +79,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EventService/ListAuditLogs", + page=SyncPersonalAccessTokensPage[EventListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + event_list_params.EventListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.EventService/ListAuditLogs", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -112,16 +96,14 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, event_list_params.EventListParams, ), ), - cast_to=EventListResponse, + model=EventListResponse, + method="post", ) @overload @@ -129,8 +111,6 @@ def watch( self, *, environment_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -143,13 +123,7 @@ def watch( Args: environment_id: Environment scope produces events for the environment itself, all tasks, task - executions, - - and services associated with that environment. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + executions, and services associated with that environment. extra_headers: Send extra headers @@ -166,8 +140,6 @@ def watch( self, *, organization: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -180,14 +152,9 @@ def watch( Args: organization: Organization scope produces events for all projects, runners and environments - the caller can see within their organization. No task, task execution or service events are produed. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -198,13 +165,11 @@ def watch( """ ... - @required_args(["environment_id", "connect_protocol_version"], ["organization", "connect_protocol_version"]) + @required_args(["environment_id"], ["organization"]) def watch( self, *, environment_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, organization: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -214,15 +179,6 @@ def watch( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> JSONLDecoder[EventWatchResponse]: extra_headers = {"Accept": "application/jsonl", **(extra_headers or {})} - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.EventService/WatchEvents", body=maybe_transform( @@ -260,40 +216,26 @@ def with_streaming_response(self) -> AsyncEventsResourceWithStreamingResponse: """ return AsyncEventsResourceWithStreamingResponse(self) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: event_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: event_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EventListResponse: + ) -> AsyncPaginator[EventListResponse, AsyncPersonalAccessTokensPage[EventListResponse]]: """ ListAuditLogs retrieves a paginated list of audit logs for the specified organization Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -303,34 +245,31 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.EventService/ListAuditLogs", + page=AsyncPersonalAccessTokensPage[EventListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + event_list_params.EventListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.EventService/ListAuditLogs", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, event_list_params.EventListParams, ), ), - cast_to=EventListResponse, + model=EventListResponse, + method="post", ) @overload @@ -338,8 +277,6 @@ async def watch( self, *, environment_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -352,13 +289,7 @@ async def watch( Args: environment_id: Environment scope produces events for the environment itself, all tasks, task - executions, - - and services associated with that environment. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + executions, and services associated with that environment. extra_headers: Send extra headers @@ -375,8 +306,6 @@ async def watch( self, *, organization: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -389,14 +318,9 @@ async def watch( Args: organization: Organization scope produces events for all projects, runners and environments - the caller can see within their organization. No task, task execution or service events are produed. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -407,13 +331,11 @@ async def watch( """ ... - @required_args(["environment_id", "connect_protocol_version"], ["organization", "connect_protocol_version"]) + @required_args(["environment_id"], ["organization"]) async def watch( self, *, environment_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, organization: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -423,15 +345,6 @@ async def watch( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncJSONLDecoder[EventWatchResponse]: extra_headers = {"Accept": "application/jsonl", **(extra_headers or {})} - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.EventService/WatchEvents", body=await async_maybe_transform( diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py index 8bfb6a68..b0d965ea 100644 --- a/src/gitpod/resources/groups.py +++ b/src/gitpod/resources/groups.py @@ -2,18 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..types import group_list_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - is_given, - maybe_transform, - strip_not_given, - async_maybe_transform, -) +from .._utils import maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -22,7 +15,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options +from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from .._base_client import AsyncPaginator, make_request_options from ..types.group_list_response import GroupListResponse __all__ = ["GroupsResource", "AsyncGroupsResource"] @@ -51,36 +45,21 @@ def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: group_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> GroupListResponse: + ) -> SyncPersonalAccessTokensPage[GroupListResponse]: """ ListGroups lists groups Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing groups extra_headers: Send extra headers @@ -90,17 +69,10 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( + return self._get_api_list( "/gitpod.v1.GroupService/ListGroups", + page=SyncPersonalAccessTokensPage[GroupListResponse], + body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -108,16 +80,14 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, group_list_params.GroupListParams, ), ), - cast_to=GroupListResponse, + model=GroupListResponse, + method="post", ) @@ -141,39 +111,24 @@ def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: """ return AsyncGroupsResourceWithStreamingResponse(self) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: group_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> GroupListResponse: + ) -> AsyncPaginator[GroupListResponse, AsyncPersonalAccessTokensPage[GroupListResponse]]: """ ListGroups lists groups Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing groups extra_headers: Send extra headers @@ -183,34 +138,25 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( + return self._get_api_list( "/gitpod.v1.GroupService/ListGroups", + page=AsyncPersonalAccessTokensPage[GroupListResponse], + body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, group_list_params.GroupListParams, ), ), - cast_to=GroupListResponse, + model=GroupListResponse, + method="post", ) diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 1dd95ed9..893f759b 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal import httpx @@ -14,9 +13,7 @@ ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -58,9 +55,7 @@ def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: def exchange_token( self, *, - connect_protocol_version: Literal[1], exchange_token: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,12 +67,8 @@ def exchange_token( ExchangeToken trades an exchange token for a new access token. Args: - connect_protocol_version: Define the version of the Connect protocol - exchange_token: exchange_token is the token to exchange - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -86,15 +77,6 @@ def exchange_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.IdentityService/ExchangeToken", body=maybe_transform( @@ -110,8 +92,6 @@ def get_authenticated_identity( self, *, body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -123,10 +103,6 @@ def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -135,15 +111,6 @@ def get_authenticated_identity( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=maybe_transform( @@ -158,9 +125,7 @@ def get_authenticated_identity( def get_id_token( self, *, - connect_protocol_version: Literal[1], audience: List[str] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -173,10 +138,6 @@ def get_id_token( other services. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -185,15 +146,6 @@ def get_id_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.IdentityService/GetIDToken", body=maybe_transform({"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams), @@ -227,9 +179,7 @@ def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: async def exchange_token( self, *, - connect_protocol_version: Literal[1], exchange_token: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -241,12 +191,8 @@ async def exchange_token( ExchangeToken trades an exchange token for a new access token. Args: - connect_protocol_version: Define the version of the Connect protocol - exchange_token: exchange_token is the token to exchange - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -255,15 +201,6 @@ async def exchange_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.IdentityService/ExchangeToken", body=await async_maybe_transform( @@ -279,8 +216,6 @@ async def get_authenticated_identity( self, *, body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -292,10 +227,6 @@ async def get_authenticated_identity( GetAuthenticatedIdentity allows to retrieve the current identity. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -304,15 +235,6 @@ async def get_authenticated_identity( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=await async_maybe_transform( @@ -327,9 +249,7 @@ async def get_authenticated_identity( async def get_id_token( self, *, - connect_protocol_version: Literal[1], audience: List[str] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -342,10 +262,6 @@ async def get_id_token( other services. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -354,15 +270,6 @@ async def get_id_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.IdentityService/GetIDToken", body=await async_maybe_transform( diff --git a/src/gitpod/resources/organizations/invites.py b/src/gitpod/resources/organizations/invites.py index 7f5333f8..872373da 100644 --- a/src/gitpod/resources/organizations/invites.py +++ b/src/gitpod/resources/organizations/invites.py @@ -2,15 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -53,9 +49,7 @@ def with_streaming_response(self) -> InvitesResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -69,10 +63,6 @@ def create( OrganizationInvites are invalidated and can no longer be used. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -81,15 +71,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/CreateOrganizationInvite", body=maybe_transform({"organization_id": organization_id}, invite_create_params.InviteCreateParams), @@ -102,9 +83,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -118,10 +97,6 @@ def retrieve( exists, a new one is created. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -130,15 +105,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/GetOrganizationInvite", body=maybe_transform({"organization_id": organization_id}, invite_retrieve_params.InviteRetrieveParams), @@ -151,9 +117,7 @@ def retrieve( def get_summary( self, *, - connect_protocol_version: Literal[1], invite_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -163,15 +127,9 @@ def get_summary( ) -> InviteGetSummaryResponse: """ GetOrganizationInviteSummary retrieves a summary of the organization based on an - Invite ID. - - Used to discover which organization an invite is for. + Invite ID. Used to discover which organization an invite is for. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -180,15 +138,6 @@ def get_summary( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", body=maybe_transform({"invite_id": invite_id}, invite_get_summary_params.InviteGetSummaryParams), @@ -222,9 +171,7 @@ def with_streaming_response(self) -> AsyncInvitesResourceWithStreamingResponse: async def create( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -238,10 +185,6 @@ async def create( OrganizationInvites are invalidated and can no longer be used. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -250,15 +193,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/CreateOrganizationInvite", body=await async_maybe_transform( @@ -273,9 +207,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -289,10 +221,6 @@ async def retrieve( exists, a new one is created. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -301,15 +229,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/GetOrganizationInvite", body=await async_maybe_transform( @@ -324,9 +243,7 @@ async def retrieve( async def get_summary( self, *, - connect_protocol_version: Literal[1], invite_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -336,15 +253,9 @@ async def get_summary( ) -> InviteGetSummaryResponse: """ GetOrganizationInviteSummary retrieves a summary of the organization based on an - Invite ID. - - Used to discover which organization an invite is for. + Invite ID. Used to discover which organization an invite is for. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -353,15 +264,6 @@ async def get_summary( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/GetOrganizationInviteSummary", body=await async_maybe_transform( diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 9597f1f5..b0e93c4d 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -27,10 +27,8 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -41,7 +39,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..._base_client import AsyncPaginator, make_request_options from .sso_configurations import ( SSOConfigurationsResource, AsyncSSOConfigurationsResource, @@ -91,11 +90,9 @@ def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, join_organization: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -107,8 +104,6 @@ def create( CreateOrganization creates a new Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - invite_accounts_with_matching_domain: Should other Accounts with the same domain be automatically invited to the organization? @@ -117,8 +112,6 @@ def create( name: name is the organization name - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -127,15 +120,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/CreateOrganization", body=maybe_transform( @@ -155,9 +139,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -169,12 +151,8 @@ def retrieve( GetOrganization retrieves a single Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the unique identifier of the Organization to retreive. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -183,15 +161,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/GetOrganization", body=maybe_transform( @@ -208,8 +177,6 @@ def update( self, *, invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -223,10 +190,6 @@ def update( Args: invite_domains: invite_domains is the domain allowlist of the organization - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -242,8 +205,6 @@ def update( self, *, name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -257,10 +218,6 @@ def update( Args: name: name is the new name of the organization - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -271,14 +228,12 @@ def update( """ ... - @required_args(["invite_domains", "connect_protocol_version"], ["name", "connect_protocol_version"]) + @required_args(["invite_domains"], ["name"]) def update( self, *, invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -287,15 +242,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationUpdateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/UpdateOrganization", body=maybe_transform( @@ -314,36 +260,24 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: organization_list_params.Pagination | NotGiven = NOT_GIVEN, + scope: Literal["SCOPE_UNSPECIFIED", "SCOPE_MEMBER", "SCOPE_ALL"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationListResponse: + ) -> SyncPersonalAccessTokensPage[OrganizationListResponse]: """ ListOrganizations lists all organization the caller has access to. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request + pagination: pagination contains the pagination options for listing organizations - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + scope: scope is the scope of the organizations to list extra_headers: Send extra headers @@ -353,17 +287,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListOrganizations", + page=SyncPersonalAccessTokensPage[OrganizationListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "pagination": pagination, + "scope": scope, + }, + organization_list_params.OrganizationListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.OrganizationService/ListOrganizations", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -371,24 +304,20 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, organization_list_params.OrganizationListParams, ), ), - cast_to=OrganizationListResponse, + model=OrganizationListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -400,12 +329,8 @@ def delete( DeleteOrganization deletes the specified organization. Args: - connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization to delete - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -414,15 +339,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/DeleteOrganization", body=maybe_transform( @@ -439,8 +355,6 @@ def join( self, *, invite_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -454,10 +368,6 @@ def join( Args: invite_id: invite_id is the unique identifier of the invite to join the organization. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -473,8 +383,6 @@ def join( self, *, organization_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -488,10 +396,6 @@ def join( Args: organization_id: organization_id is the unique identifier of the Organization to join. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -502,13 +406,11 @@ def join( """ ... - @required_args(["invite_id", "connect_protocol_version"], ["organization_id", "connect_protocol_version"]) + @required_args(["invite_id"], ["organization_id"]) def join( self, *, invite_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -517,15 +419,6 @@ def join( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationJoinResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/JoinOrganization", body=maybe_transform( @@ -544,9 +437,7 @@ def join( def leave( self, *, - connect_protocol_version: Literal[1], user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -558,10 +449,6 @@ def leave( LeaveOrganization lets the passed user leave an Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -570,15 +457,6 @@ def leave( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/LeaveOrganization", body=maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), @@ -591,36 +469,24 @@ def leave( def list_members( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationListMembersResponse: + ) -> SyncPersonalAccessTokensPage[OrganizationListMembersResponse]: """ ListMembers lists all members of the specified organization. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data + organization_id: organization_id is the ID of the organization to list members for - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing members extra_headers: Send extra headers @@ -630,17 +496,16 @@ def list_members( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListMembers", + page=SyncPersonalAccessTokensPage[OrganizationListMembersResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "organization_id": organization_id, + "pagination": pagination, + }, + organization_list_members_params.OrganizationListMembersParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.OrganizationService/ListMembers", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -648,27 +513,23 @@ def list_members( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, organization_list_members_params.OrganizationListMembersParams, ), ), - cast_to=OrganizationListMembersResponse, + model=OrganizationListMembersResponse, + method="post", ) def set_role( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -680,10 +541,6 @@ def set_role( SetRole Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -692,15 +549,6 @@ def set_role( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/SetRole", body=maybe_transform( @@ -749,11 +597,9 @@ def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResp async def create( self, *, - connect_protocol_version: Literal[1], invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, join_organization: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -765,8 +611,6 @@ async def create( CreateOrganization creates a new Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - invite_accounts_with_matching_domain: Should other Accounts with the same domain be automatically invited to the organization? @@ -775,8 +619,6 @@ async def create( name: name is the organization name - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -785,15 +627,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/CreateOrganization", body=await async_maybe_transform( @@ -813,9 +646,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -827,12 +658,8 @@ async def retrieve( GetOrganization retrieves a single Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the unique identifier of the Organization to retreive. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -841,15 +668,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/GetOrganization", body=await async_maybe_transform( @@ -866,8 +684,6 @@ async def update( self, *, invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -881,10 +697,6 @@ async def update( Args: invite_domains: invite_domains is the domain allowlist of the organization - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -900,8 +712,6 @@ async def update( self, *, name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -915,10 +725,6 @@ async def update( Args: name: name is the new name of the organization - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -929,14 +735,12 @@ async def update( """ ... - @required_args(["invite_domains", "connect_protocol_version"], ["name", "connect_protocol_version"]) + @required_args(["invite_domains"], ["name"]) async def update( self, *, invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -945,15 +749,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationUpdateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/UpdateOrganization", body=await async_maybe_transform( @@ -969,39 +764,27 @@ async def update( cast_to=OrganizationUpdateResponse, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: organization_list_params.Pagination | NotGiven = NOT_GIVEN, + scope: Literal["SCOPE_UNSPECIFIED", "SCOPE_MEMBER", "SCOPE_ALL"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationListResponse: + ) -> AsyncPaginator[OrganizationListResponse, AsyncPersonalAccessTokensPage[OrganizationListResponse]]: """ ListOrganizations lists all organization the caller has access to. Args: - encoding: Define which encoding or 'Message-Codec' to use + pagination: pagination contains the pagination options for listing organizations - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + scope: scope is the scope of the organizations to list extra_headers: Send extra headers @@ -1011,42 +794,37 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListOrganizations", + page=AsyncPersonalAccessTokensPage[OrganizationListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "pagination": pagination, + "scope": scope, + }, + organization_list_params.OrganizationListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.OrganizationService/ListOrganizations", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, organization_list_params.OrganizationListParams, ), ), - cast_to=OrganizationListResponse, + model=OrganizationListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1058,12 +836,8 @@ async def delete( DeleteOrganization deletes the specified organization. Args: - connect_protocol_version: Define the version of the Connect protocol - organization_id: organization_id is the ID of the organization to delete - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1072,15 +846,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/DeleteOrganization", body=await async_maybe_transform( @@ -1097,8 +862,6 @@ async def join( self, *, invite_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1112,10 +875,6 @@ async def join( Args: invite_id: invite_id is the unique identifier of the invite to join the organization. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1131,8 +890,6 @@ async def join( self, *, organization_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1146,10 +903,6 @@ async def join( Args: organization_id: organization_id is the unique identifier of the Organization to join. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1160,13 +913,11 @@ async def join( """ ... - @required_args(["invite_id", "connect_protocol_version"], ["organization_id", "connect_protocol_version"]) + @required_args(["invite_id"], ["organization_id"]) async def join( self, *, invite_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1175,15 +926,6 @@ async def join( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationJoinResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/JoinOrganization", body=await async_maybe_transform( @@ -1202,9 +944,7 @@ async def join( async def leave( self, *, - connect_protocol_version: Literal[1], user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1216,10 +956,6 @@ async def leave( LeaveOrganization lets the passed user leave an Organization. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1228,15 +964,6 @@ async def leave( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/LeaveOrganization", body=await async_maybe_transform({"user_id": user_id}, organization_leave_params.OrganizationLeaveParams), @@ -1246,39 +973,29 @@ async def leave( cast_to=object, ) - async def list_members( + def list_members( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationListMembersResponse: + ) -> AsyncPaginator[ + OrganizationListMembersResponse, AsyncPersonalAccessTokensPage[OrganizationListMembersResponse] + ]: """ ListMembers lists all members of the specified organization. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol + organization_id: organization_id is the ID of the organization to list members for - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing members extra_headers: Send extra headers @@ -1288,45 +1005,40 @@ async def list_members( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListMembers", + page=AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "organization_id": organization_id, + "pagination": pagination, + }, + organization_list_members_params.OrganizationListMembersParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.OrganizationService/ListMembers", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, organization_list_members_params.OrganizationListMembersParams, ), ), - cast_to=OrganizationListMembersResponse, + model=OrganizationListMembersResponse, + method="post", ) async def set_role( self, *, - connect_protocol_version: Literal[1], organization_id: str | NotGiven = NOT_GIVEN, role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1338,10 +1050,6 @@ async def set_role( SetRole Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1350,15 +1058,6 @@ async def set_role( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/SetRole", body=await async_maybe_transform( diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index d3207ff8..414ae66d 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -8,10 +8,8 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -22,7 +20,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.organizations import ( sso_configuration_list_params, sso_configuration_create_params, @@ -60,13 +59,11 @@ def with_streaming_response(self) -> SSOConfigurationsResourceWithStreamingRespo def create( self, *, - connect_protocol_version: Literal[1], client_id: str | NotGiven = NOT_GIVEN, client_secret: str | NotGiven = NOT_GIVEN, email_domain: str | NotGiven = NOT_GIVEN, issuer_url: str | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -78,8 +75,6 @@ def create( CreateSSOConfiguration creates a new SSO configuration for the organization. Args: - connect_protocol_version: Define the version of the Connect protocol - client_id: client_id is the client ID of the OIDC application set on the IdP client_secret: client_secret is the client secret of the OIDC application set on the IdP @@ -88,8 +83,6 @@ def create( issuer_url: issuer_url is the URL of the IdP issuer - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -98,15 +91,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/CreateSSOConfiguration", body=maybe_transform( @@ -128,9 +112,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], sso_configuration_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -142,12 +124,8 @@ def retrieve( GetSSOConfiguration returns an SSO configuration. Args: - connect_protocol_version: Define the version of the Connect protocol - sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to get - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -156,15 +134,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/GetSSOConfiguration", body=maybe_transform( @@ -182,8 +151,6 @@ def update( self, *, client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -197,10 +164,6 @@ def update( Args: client_id: client_id is the client ID of the SSO provider - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -216,8 +179,6 @@ def update( self, *, client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -231,10 +192,6 @@ def update( Args: client_secret: client_secret is the client secret of the SSO provider - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -250,8 +207,6 @@ def update( self, *, email_domain: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -263,10 +218,6 @@ def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -282,8 +233,6 @@ def update( self, *, issuer_url: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -297,10 +246,6 @@ def update( Args: issuer_url: issuer_url is the URL of the IdP issuer - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -318,8 +263,6 @@ def update( state: Literal[ "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" ], - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -333,10 +276,6 @@ def update( Args: state: state is the state of the SSO configuration - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -347,19 +286,11 @@ def update( """ ... - @required_args( - ["client_id", "connect_protocol_version"], - ["client_secret", "connect_protocol_version"], - ["email_domain", "connect_protocol_version"], - ["issuer_url", "connect_protocol_version"], - ["state", "connect_protocol_version"], - ) + @required_args(["client_id"], ["client_secret"], ["email_domain"], ["issuer_url"], ["state"]) def update( self, *, client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, client_secret: str | NotGiven = NOT_GIVEN, email_domain: str | NotGiven = NOT_GIVEN, issuer_url: str | NotGiven = NOT_GIVEN, @@ -374,15 +305,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", body=maybe_transform( @@ -404,36 +326,22 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: sso_configuration_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SSOConfigurationListResponse: + ) -> SyncPersonalAccessTokensPage[SSOConfigurationListResponse]: """ ListSSOConfigurations lists all SSO configurations matching provided filters. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + organization_id: organization_id is the ID of the organization to list SSO configurations for. extra_headers: Send extra headers @@ -443,17 +351,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListSSOConfigurations", + page=SyncPersonalAccessTokensPage[SSOConfigurationListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "organization_id": organization_id, + "pagination": pagination, + }, + sso_configuration_list_params.SSOConfigurationListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.OrganizationService/ListSSOConfigurations", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -461,24 +368,20 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, sso_configuration_list_params.SSOConfigurationListParams, ), ), - cast_to=SSOConfigurationListResponse, + model=SSOConfigurationListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], sso_configuration_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -490,10 +393,6 @@ def delete( DeleteSSOConfiguration deletes an SSO configuration. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -502,15 +401,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.OrganizationService/DeleteSSOConfiguration", body=maybe_transform( @@ -547,13 +437,11 @@ def with_streaming_response(self) -> AsyncSSOConfigurationsResourceWithStreaming async def create( self, *, - connect_protocol_version: Literal[1], client_id: str | NotGiven = NOT_GIVEN, client_secret: str | NotGiven = NOT_GIVEN, email_domain: str | NotGiven = NOT_GIVEN, issuer_url: str | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -565,8 +453,6 @@ async def create( CreateSSOConfiguration creates a new SSO configuration for the organization. Args: - connect_protocol_version: Define the version of the Connect protocol - client_id: client_id is the client ID of the OIDC application set on the IdP client_secret: client_secret is the client secret of the OIDC application set on the IdP @@ -575,8 +461,6 @@ async def create( issuer_url: issuer_url is the URL of the IdP issuer - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -585,15 +469,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/CreateSSOConfiguration", body=await async_maybe_transform( @@ -615,9 +490,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], sso_configuration_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -629,12 +502,8 @@ async def retrieve( GetSSOConfiguration returns an SSO configuration. Args: - connect_protocol_version: Define the version of the Connect protocol - sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to get - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -643,15 +512,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/GetSSOConfiguration", body=await async_maybe_transform( @@ -669,8 +529,6 @@ async def update( self, *, client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -684,10 +542,6 @@ async def update( Args: client_id: client_id is the client ID of the SSO provider - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -703,8 +557,6 @@ async def update( self, *, client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -718,10 +570,6 @@ async def update( Args: client_secret: client_secret is the client secret of the SSO provider - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -737,8 +585,6 @@ async def update( self, *, email_domain: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -750,10 +596,6 @@ async def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -769,8 +611,6 @@ async def update( self, *, issuer_url: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -784,10 +624,6 @@ async def update( Args: issuer_url: issuer_url is the URL of the IdP issuer - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -805,8 +641,6 @@ async def update( state: Literal[ "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" ], - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -820,10 +654,6 @@ async def update( Args: state: state is the state of the SSO configuration - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -834,19 +664,11 @@ async def update( """ ... - @required_args( - ["client_id", "connect_protocol_version"], - ["client_secret", "connect_protocol_version"], - ["email_domain", "connect_protocol_version"], - ["issuer_url", "connect_protocol_version"], - ["state", "connect_protocol_version"], - ) + @required_args(["client_id"], ["client_secret"], ["email_domain"], ["issuer_url"], ["state"]) async def update( self, *, client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, client_secret: str | NotGiven = NOT_GIVEN, email_domain: str | NotGiven = NOT_GIVEN, issuer_url: str | NotGiven = NOT_GIVEN, @@ -861,15 +683,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", body=await async_maybe_transform( @@ -888,39 +701,25 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: sso_configuration_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SSOConfigurationListResponse: + ) -> AsyncPaginator[SSOConfigurationListResponse, AsyncPersonalAccessTokensPage[SSOConfigurationListResponse]]: """ ListSSOConfigurations lists all SSO configurations matching provided filters. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + organization_id: organization_id is the ID of the organization to list SSO configurations for. extra_headers: Send extra headers @@ -930,42 +729,37 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListSSOConfigurations", + page=AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "organization_id": organization_id, + "pagination": pagination, + }, + sso_configuration_list_params.SSOConfigurationListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.OrganizationService/ListSSOConfigurations", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, sso_configuration_list_params.SSOConfigurationListParams, ), ), - cast_to=SSOConfigurationListResponse, + model=SSOConfigurationListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], sso_configuration_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -977,10 +771,6 @@ async def delete( DeleteSSOConfiguration deletes an SSO configuration. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -989,15 +779,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.OrganizationService/DeleteSSOConfiguration", body=await async_maybe_transform( diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index ee4a4825..70f043ff 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -8,9 +8,7 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -21,7 +19,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.projects import policy_list_params, policy_create_params, policy_delete_params, policy_update_params from ...types.projects.policy_list_response import PolicyListResponse from ...types.projects.policy_create_response import PolicyCreateResponse @@ -53,11 +52,9 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -69,14 +66,10 @@ def create( CreateProjectPolicy creates a Project Policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -85,15 +78,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/CreateProjectPolicy", body=maybe_transform( @@ -113,11 +97,9 @@ def create( def update( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -129,14 +111,10 @@ def update( UpdateProjectPolicy updates a Project Policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -145,15 +123,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/UpdateProjectPolicy", body=maybe_transform( @@ -173,36 +142,24 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PolicyListResponse: + ) -> SyncPersonalAccessTokensPage[PolicyListResponse]: """ ListProjectPolicies lists policies for a project. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request + pagination: pagination contains the pagination options for listing project policies - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + project_id: project_id specifies the project identifier extra_headers: Send extra headers @@ -212,17 +169,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.ProjectService/ListProjectPolicies", + page=SyncPersonalAccessTokensPage[PolicyListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "pagination": pagination, + "project_id": project_id, + }, + policy_list_params.PolicyListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.ProjectService/ListProjectPolicies", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -230,25 +186,21 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, policy_list_params.PolicyListParams, ), ), - cast_to=PolicyListResponse, + model=PolicyListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -260,14 +212,10 @@ def delete( DeleteProjectPolicy deletes a Project Policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -276,15 +224,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/DeleteProjectPolicy", body=maybe_transform( @@ -324,11 +263,9 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def create( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -340,14 +277,10 @@ async def create( CreateProjectPolicy creates a Project Policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -356,15 +289,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/CreateProjectPolicy", body=await async_maybe_transform( @@ -384,11 +308,9 @@ async def create( async def update( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -400,14 +322,10 @@ async def update( UpdateProjectPolicy updates a Project Policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -416,15 +334,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/UpdateProjectPolicy", body=await async_maybe_transform( @@ -441,39 +350,27 @@ async def update( cast_to=PolicyUpdateResponse, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PolicyListResponse: + ) -> AsyncPaginator[PolicyListResponse, AsyncPersonalAccessTokensPage[PolicyListResponse]]: """ ListProjectPolicies lists policies for a project. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request + pagination: pagination contains the pagination options for listing project policies - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + project_id: project_id specifies the project identifier extra_headers: Send extra headers @@ -483,43 +380,38 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.ProjectService/ListProjectPolicies", + page=AsyncPersonalAccessTokensPage[PolicyListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "pagination": pagination, + "project_id": project_id, + }, + policy_list_params.PolicyListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.ProjectService/ListProjectPolicies", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, policy_list_params.PolicyListParams, ), ), - cast_to=PolicyListResponse, + model=PolicyListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -531,14 +423,10 @@ async def delete( DeleteProjectPolicy deletes a Project Policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -547,15 +435,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/DeleteProjectPolicy", body=await async_maybe_transform( diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index d62320e2..2c77a8b4 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx @@ -16,10 +16,8 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from .policies import ( @@ -38,7 +36,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.project_list_response import ProjectListResponse from ...types.project_create_response import ProjectCreateResponse from ...types.project_update_response import ProjectUpdateResponse @@ -77,11 +76,9 @@ def create( *, environment_class: project_create_params.EnvironmentClass, initializer: project_create_params.Initializer, - connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -95,8 +92,6 @@ def create( Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized - connect_protocol_version: Define the version of the Connect protocol - automations_file_path: automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): @@ -111,8 +106,6 @@ def create( this.matches("^$|^[^/].*") ``` - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -121,15 +114,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/CreateProject", body=maybe_transform( @@ -151,9 +135,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -165,12 +147,8 @@ def retrieve( GetProject retrieves a single Project. Args: - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -179,15 +157,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/GetProject", body=maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), @@ -202,8 +171,6 @@ def update( self, *, automations_file_path: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -222,10 +189,6 @@ def update( this.matches("^$|^[^/].*") ``` - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -241,8 +204,6 @@ def update( self, *, devcontainer_file_path: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -261,10 +222,6 @@ def update( this.matches("^$|^[^/].*") ``` - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -280,8 +237,6 @@ def update( self, *, environment_class: project_update_params.Variant2EnvironmentClass, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -293,10 +248,6 @@ def update( UpdateProject updates the properties of a Project. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -312,8 +263,6 @@ def update( self, *, initializer: project_update_params.InitializerIsTheContentInitializerInitializer, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -327,10 +276,6 @@ def update( Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -346,8 +291,6 @@ def update( self, *, name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -359,10 +302,6 @@ def update( UpdateProject updates the properties of a Project. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -374,18 +313,12 @@ def update( ... @required_args( - ["automations_file_path", "connect_protocol_version"], - ["devcontainer_file_path", "connect_protocol_version"], - ["environment_class", "connect_protocol_version"], - ["initializer", "connect_protocol_version"], - ["name", "connect_protocol_version"], + ["automations_file_path"], ["devcontainer_file_path"], ["environment_class"], ["initializer"], ["name"] ) def update( self, *, automations_file_path: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, @@ -397,15 +330,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectUpdateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/UpdateProject", body=maybe_transform( @@ -427,36 +351,21 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: project_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectListResponse: + ) -> SyncPersonalAccessTokensPage[ProjectListResponse]: """ ListProjects lists all projects the caller has access to. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing organizations extra_headers: Send extra headers @@ -466,17 +375,10 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return self._get( + return self._get_api_list( "/gitpod.v1.ProjectService/ListProjects", + page=SyncPersonalAccessTokensPage[ProjectListResponse], + body=maybe_transform({"pagination": pagination}, project_list_params.ProjectListParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -484,24 +386,20 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, project_list_params.ProjectListParams, ), ), - cast_to=ProjectListResponse, + model=ProjectListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -513,12 +411,8 @@ def delete( DeleteProject deletes the specified project. Args: - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -527,15 +421,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/DeleteProject", body=maybe_transform({"project_id": project_id}, project_delete_params.ProjectDeleteParams), @@ -548,10 +433,8 @@ def delete( def create_from_environment( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -563,12 +446,8 @@ def create_from_environment( CreateProject creates a new Project using an environment as template. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -577,15 +456,6 @@ def create_from_environment( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", body=maybe_transform( @@ -631,11 +501,9 @@ async def create( *, environment_class: project_create_params.EnvironmentClass, initializer: project_create_params.Initializer, - connect_protocol_version: Literal[1], automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -649,8 +517,6 @@ async def create( Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized - connect_protocol_version: Define the version of the Connect protocol - automations_file_path: automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): @@ -665,8 +531,6 @@ async def create( this.matches("^$|^[^/].*") ``` - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -675,15 +539,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/CreateProject", body=await async_maybe_transform( @@ -705,9 +560,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -719,12 +572,8 @@ async def retrieve( GetProject retrieves a single Project. Args: - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -733,15 +582,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/GetProject", body=await async_maybe_transform({"project_id": project_id}, project_retrieve_params.ProjectRetrieveParams), @@ -756,8 +596,6 @@ async def update( self, *, automations_file_path: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -776,10 +614,6 @@ async def update( this.matches("^$|^[^/].*") ``` - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -795,8 +629,6 @@ async def update( self, *, devcontainer_file_path: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -815,10 +647,6 @@ async def update( this.matches("^$|^[^/].*") ``` - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -834,8 +662,6 @@ async def update( self, *, environment_class: project_update_params.Variant2EnvironmentClass, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -847,10 +673,6 @@ async def update( UpdateProject updates the properties of a Project. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -866,8 +688,6 @@ async def update( self, *, initializer: project_update_params.InitializerIsTheContentInitializerInitializer, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -881,10 +701,6 @@ async def update( Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -900,8 +716,6 @@ async def update( self, *, name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -913,10 +727,6 @@ async def update( UpdateProject updates the properties of a Project. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -928,18 +738,12 @@ async def update( ... @required_args( - ["automations_file_path", "connect_protocol_version"], - ["devcontainer_file_path", "connect_protocol_version"], - ["environment_class", "connect_protocol_version"], - ["initializer", "connect_protocol_version"], - ["name", "connect_protocol_version"], + ["automations_file_path"], ["devcontainer_file_path"], ["environment_class"], ["initializer"], ["name"] ) async def update( self, *, automations_file_path: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, @@ -951,15 +755,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectUpdateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/UpdateProject", body=await async_maybe_transform( @@ -978,39 +773,24 @@ async def update( cast_to=ProjectUpdateResponse, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: project_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectListResponse: + ) -> AsyncPaginator[ProjectListResponse, AsyncPersonalAccessTokensPage[ProjectListResponse]]: """ ListProjects lists all projects the caller has access to. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing organizations extra_headers: Send extra headers @@ -1020,42 +800,31 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } - return await self._get( + return self._get_api_list( "/gitpod.v1.ProjectService/ListProjects", + page=AsyncPersonalAccessTokensPage[ProjectListResponse], + body=maybe_transform({"pagination": pagination}, project_list_params.ProjectListParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, project_list_params.ProjectListParams, ), ), - cast_to=ProjectListResponse, + model=ProjectListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], project_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1067,12 +836,8 @@ async def delete( DeleteProject deletes the specified project. Args: - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1081,15 +846,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/DeleteProject", body=await async_maybe_transform({"project_id": project_id}, project_delete_params.ProjectDeleteParams), @@ -1102,10 +858,8 @@ async def delete( async def create_from_environment( self, *, - connect_protocol_version: Literal[1], environment_id: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1117,12 +871,8 @@ async def create_from_environment( CreateProject creates a new Project using an environment as template. Args: - connect_protocol_version: Define the version of the Connect protocol - environment_id: environment_id specifies the environment identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1131,15 +881,6 @@ async def create_from_environment( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.ProjectService/CreateProjectFromEnvironment", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index 0e6273c8..d5317a15 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Any, cast -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx @@ -17,10 +17,8 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -103,9 +101,7 @@ def validate( self, *, environment_class: configuration_validate_params.Variant0EnvironmentClass, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -116,15 +112,9 @@ def validate( """ValidateRunnerConfiguration validates a runner configuration (e.g. environment - class, SCM integration) - - with the runner. + class, SCM integration) with the runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -140,9 +130,7 @@ def validate( self, *, scm_integration: configuration_validate_params.Variant1ScmIntegration, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -153,15 +141,9 @@ def validate( """ValidateRunnerConfiguration validates a runner configuration (e.g. environment - class, SCM integration) - - with the runner. + class, SCM integration) with the runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -172,14 +154,12 @@ def validate( """ ... - @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) + @required_args(["environment_class"], ["scm_integration"]) def validate( self, *, environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -188,15 +168,6 @@ def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ConfigurationValidateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return cast( ConfigurationValidateResponse, self._post( @@ -260,9 +231,7 @@ async def validate( self, *, environment_class: configuration_validate_params.Variant0EnvironmentClass, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -273,15 +242,9 @@ async def validate( """ValidateRunnerConfiguration validates a runner configuration (e.g. environment - class, SCM integration) - - with the runner. + class, SCM integration) with the runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -297,9 +260,7 @@ async def validate( self, *, scm_integration: configuration_validate_params.Variant1ScmIntegration, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -310,15 +271,9 @@ async def validate( """ValidateRunnerConfiguration validates a runner configuration (e.g. environment - class, SCM integration) - - with the runner. + class, SCM integration) with the runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -329,14 +284,12 @@ async def validate( """ ... - @required_args(["environment_class", "connect_protocol_version"], ["scm_integration", "connect_protocol_version"]) + @required_args(["environment_class"], ["scm_integration"]) async def validate( self, *, environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -345,15 +298,6 @@ async def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ConfigurationValidateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return cast( ConfigurationValidateResponse, await self._post( diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index 63025cce..216bacb4 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -3,16 +3,14 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -23,7 +21,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._base_client import make_request_options +from ....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...._base_client import AsyncPaginator, make_request_options from ....types.runners.configurations import ( environment_class_list_params, environment_class_create_params, @@ -60,12 +59,10 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp def create( self, *, - connect_protocol_version: Literal[1], configuration: Iterable[environment_class_create_params.Configuration] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,10 +74,6 @@ def create( CreateEnvironmentClass creates a new environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -89,15 +82,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/CreateEnvironmentClass", body=maybe_transform( @@ -118,9 +102,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], environment_class_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -132,10 +114,6 @@ def retrieve( GetEnvironmentClass returns a single environment class configured for a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -144,15 +122,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/GetEnvironmentClass", body=maybe_transform( @@ -170,8 +139,6 @@ def update( self, *, description: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -183,10 +150,6 @@ def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -202,8 +165,6 @@ def update( self, *, display_name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -215,10 +176,6 @@ def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -234,8 +191,6 @@ def update( self, *, enabled: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -247,10 +202,6 @@ def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -261,17 +212,11 @@ def update( """ ... - @required_args( - ["description", "connect_protocol_version"], - ["display_name", "connect_protocol_version"], - ["enabled", "connect_protocol_version"], - ) + @required_args(["description"], ["display_name"], ["enabled"]) def update( self, *, description: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -281,15 +226,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", body=maybe_transform( @@ -309,38 +245,23 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentClassListResponse: + ) -> SyncPersonalAccessTokensPage[EnvironmentClassListResponse]: """ ListEnvironmentClasses returns all environment classes configured for a runner. - buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environment classes extra_headers: Send extra headers @@ -350,17 +271,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", + page=SyncPersonalAccessTokensPage[EnvironmentClassListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + environment_class_list_params.EnvironmentClassListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -368,16 +288,14 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, environment_class_list_params.EnvironmentClassListParams, ), ), - cast_to=EnvironmentClassListResponse, + model=EnvironmentClassListResponse, + method="post", ) @@ -404,12 +322,10 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin async def create( self, *, - connect_protocol_version: Literal[1], configuration: Iterable[environment_class_create_params.Configuration] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -421,10 +337,6 @@ async def create( CreateEnvironmentClass creates a new environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -433,15 +345,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/CreateEnvironmentClass", body=await async_maybe_transform( @@ -462,9 +365,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], environment_class_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -476,10 +377,6 @@ async def retrieve( GetEnvironmentClass returns a single environment class configured for a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -488,15 +385,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetEnvironmentClass", body=await async_maybe_transform( @@ -514,8 +402,6 @@ async def update( self, *, description: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -527,10 +413,6 @@ async def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -546,8 +428,6 @@ async def update( self, *, display_name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -559,10 +439,6 @@ async def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -578,8 +454,6 @@ async def update( self, *, enabled: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -591,10 +465,6 @@ async def update( UpdateEnvironmentClass updates an existing environment class on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -605,17 +475,11 @@ async def update( """ ... - @required_args( - ["description", "connect_protocol_version"], - ["display_name", "connect_protocol_version"], - ["enabled", "connect_protocol_version"], - ) + @required_args(["description"], ["display_name"], ["enabled"]) async def update( self, *, description: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -625,15 +489,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", body=await async_maybe_transform( @@ -650,41 +505,26 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentClassListResponse: + ) -> AsyncPaginator[EnvironmentClassListResponse, AsyncPersonalAccessTokensPage[EnvironmentClassListResponse]]: """ ListEnvironmentClasses returns all environment classes configured for a runner. - buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environment classes extra_headers: Send extra headers @@ -694,34 +534,31 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", + page=AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + environment_class_list_params.EnvironmentClassListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, environment_class_list_params.EnvironmentClassListParams, ), ), - cast_to=EnvironmentClassListResponse, + model=EnvironmentClassListResponse, + method="post", ) diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index ebf8f414..c8165449 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -10,10 +10,8 @@ from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -24,7 +22,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._base_client import make_request_options +from ....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...._base_client import AsyncPaginator, make_request_options from ....types.runners.configurations import ( host_authentication_token_list_params, host_authentication_token_create_params, @@ -66,7 +65,6 @@ def with_streaming_response(self) -> HostAuthenticationTokensResourceWithStreami def create( self, *, - connect_protocol_version: Literal[1], token: str | NotGiven = NOT_GIVEN, expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, host: str | NotGiven = NOT_GIVEN, @@ -79,7 +77,6 @@ def create( ] | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -91,10 +88,7 @@ def create( CreateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - expires_at: A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -183,8 +177,6 @@ def create( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -193,15 +185,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/CreateHostAuthenticationToken", body=maybe_transform( @@ -225,9 +208,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -239,10 +220,6 @@ def retrieve( GetHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -251,15 +228,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=maybe_transform( @@ -276,8 +244,6 @@ def update( self, *, expires_at: Union[str, datetime], - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -290,7 +256,6 @@ def update( Args: expires_at: A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -379,10 +344,6 @@ def update( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -398,8 +359,6 @@ def update( self, *, refresh_token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -411,10 +370,6 @@ def update( UpdateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -430,8 +385,6 @@ def update( self, *, token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -443,10 +396,6 @@ def update( UpdateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -457,17 +406,11 @@ def update( """ ... - @required_args( - ["expires_at", "connect_protocol_version"], - ["refresh_token", "connect_protocol_version"], - ["token", "connect_protocol_version"], - ) + @required_args(["expires_at"], ["refresh_token"], ["token"]) def update( self, *, expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, refresh_token: str | NotGiven = NOT_GIVEN, token: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -477,15 +420,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=maybe_transform( @@ -505,37 +439,21 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostAuthenticationTokenListResponse: + ) -> SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse]: """ ListHostAuthenticationTokens Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -544,17 +462,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", + page=SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + host_authentication_token_list_params.HostAuthenticationTokenListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -562,24 +479,20 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, host_authentication_token_list_params.HostAuthenticationTokenListParams, ), ), - cast_to=HostAuthenticationTokenListResponse, + model=HostAuthenticationTokenListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -591,10 +504,6 @@ def delete( DeleteHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -603,15 +512,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/DeleteHostAuthenticationToken", body=maybe_transform( @@ -647,7 +547,6 @@ def with_streaming_response(self) -> AsyncHostAuthenticationTokensResourceWithSt async def create( self, *, - connect_protocol_version: Literal[1], token: str | NotGiven = NOT_GIVEN, expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, host: str | NotGiven = NOT_GIVEN, @@ -660,7 +559,6 @@ async def create( ] | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -672,10 +570,7 @@ async def create( CreateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - expires_at: A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -764,8 +659,6 @@ async def create( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -774,15 +667,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/CreateHostAuthenticationToken", body=await async_maybe_transform( @@ -806,9 +690,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -820,10 +702,6 @@ async def retrieve( GetHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -832,15 +710,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken", body=await async_maybe_transform( @@ -857,8 +726,6 @@ async def update( self, *, expires_at: Union[str, datetime], - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -871,7 +738,6 @@ async def update( Args: expires_at: A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -960,10 +826,6 @@ async def update( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -979,8 +841,6 @@ async def update( self, *, refresh_token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -992,10 +852,6 @@ async def update( UpdateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1011,8 +867,6 @@ async def update( self, *, token: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1024,10 +878,6 @@ async def update( UpdateHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1038,17 +888,11 @@ async def update( """ ... - @required_args( - ["expires_at", "connect_protocol_version"], - ["refresh_token", "connect_protocol_version"], - ["token", "connect_protocol_version"], - ) + @required_args(["expires_at"], ["refresh_token"], ["token"]) async def update( self, *, expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, refresh_token: str | NotGiven = NOT_GIVEN, token: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1058,15 +902,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=await async_maybe_transform( @@ -1083,40 +918,26 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostAuthenticationTokenListResponse: + ) -> AsyncPaginator[ + HostAuthenticationTokenListResponse, AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse] + ]: """ ListHostAuthenticationTokens Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1125,42 +946,37 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", + page=AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + host_authentication_token_list_params.HostAuthenticationTokenListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, host_authentication_token_list_params.HostAuthenticationTokenListParams, ), ), - cast_to=HostAuthenticationTokenListResponse, + model=HostAuthenticationTokenListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1172,10 +988,6 @@ async def delete( DeleteHostAuthenticationToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1184,15 +996,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/DeleteHostAuthenticationToken", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runners/configurations/schema.py b/src/gitpod/resources/runners/configurations/schema.py index 5bb5cff6..c1f555cb 100644 --- a/src/gitpod/resources/runners/configurations/schema.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -2,15 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -51,9 +47,7 @@ def with_streaming_response(self) -> SchemaResourceWithStreamingResponse: def retrieve( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -65,10 +59,6 @@ def retrieve( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -77,15 +67,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=maybe_transform({"runner_id": runner_id}, schema_retrieve_params.SchemaRetrieveParams), @@ -119,9 +100,7 @@ def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse: async def retrieve( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -133,10 +112,6 @@ async def retrieve( GetRunnerConfigurationSchema retrieves the latest Runner configuration schema Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -145,15 +120,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema", body=await async_maybe_transform({"runner_id": runner_id}, schema_retrieve_params.SchemaRetrieveParams), diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 19f8d776..7108e737 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -2,16 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from ...._compat import cached_property @@ -22,7 +20,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._base_client import make_request_options +from ....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...._base_client import AsyncPaginator, make_request_options from ....types.runners.configurations import ( scm_integration_list_params, scm_integration_create_params, @@ -62,8 +61,6 @@ def create( self, *, oauth_client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -75,13 +72,8 @@ def create( CreateSCMIntegration creates a new SCM integration on a runner. Args: - oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_plaintext_client_secret must also be set. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If + configured, oauth_plaintext_client_secret must also be set. extra_headers: Send extra headers @@ -98,8 +90,6 @@ def create( self, *, oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -112,13 +102,8 @@ def create( Args: oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. - This will first be encrypted with the runner's public key before being stored. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -129,15 +114,11 @@ def create( """ ... - @required_args( - ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] - ) + @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"]) def create( self, *, oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -146,15 +127,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", body=maybe_transform( @@ -173,9 +145,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -187,10 +157,6 @@ def retrieve( GetSCMIntegration returns a single SCM integration configured for a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -199,15 +165,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/GetSCMIntegration", body=maybe_transform({"id": id}, scm_integration_retrieve_params.ScmIntegrationRetrieveParams), @@ -222,8 +179,6 @@ def update( self, *, oauth_client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -235,17 +190,12 @@ def update( UpdateSCMIntegration updates an existing SCM integration on a runner. Args: - oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. - - If an empty string is set, the OAuth configuration will be removed (regardless - of whether a client secret is set), and any existing Host Authentication Tokens - for the SCM integration's runner and host that were created using the OAuth app - will be deleted. This might lead to users being unable to access their - repositories until they re-authenticate. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. If an empty + string is set, the OAuth configuration will be removed (regardless of whether a + client secret is set), and any existing Host Authentication Tokens for the SCM + integration's runner and host that were created using the OAuth app will be + deleted. This might lead to users being unable to access their repositories + until they re-authenticate. extra_headers: Send extra headers @@ -262,8 +212,6 @@ def update( self, *, oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -276,14 +224,8 @@ def update( Args: oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client - secret. - - The cleartext secret will be encrypted with the runner's public key before being - stored. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + secret. The cleartext secret will be encrypted with the runner's public key + before being stored. extra_headers: Send extra headers @@ -300,8 +242,6 @@ def update( self, *, pat: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -313,17 +253,12 @@ def update( UpdateSCMIntegration updates an existing SCM integration on a runner. Args: - pat: pat can be set to enable or disable Personal Access Tokens support. - - When disabling PATs, any existing Host Authentication Tokens for the SCM + pat: pat can be set to enable or disable Personal Access Tokens support. When + disabling PATs, any existing Host Authentication Tokens for the SCM integration's runner and host that were created using a PAT will be deleted. This might lead to users being unable to access their repositories until they re-authenticate. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -334,17 +269,11 @@ def update( """ ... - @required_args( - ["oauth_client_id", "connect_protocol_version"], - ["oauth_plaintext_client_secret", "connect_protocol_version"], - ["pat", "connect_protocol_version"], - ) + @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"], ["pat"]) def update( self, *, oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, pat: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -354,15 +283,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", body=maybe_transform( @@ -382,36 +302,22 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: scm_integration_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: scm_integration_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationListResponse: + ) -> SyncPersonalAccessTokensPage[ScmIntegrationListResponse]: """ ListSCMIntegrations returns all SCM integrations configured for a runner. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing scm integrations extra_headers: Send extra headers @@ -421,17 +327,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", + page=SyncPersonalAccessTokensPage[ScmIntegrationListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + scm_integration_list_params.ScmIntegrationListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -439,24 +344,20 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, scm_integration_list_params.ScmIntegrationListParams, ), ), - cast_to=ScmIntegrationListResponse, + model=ScmIntegrationListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -468,10 +369,6 @@ def delete( DeleteSCMIntegration deletes an existing SCM integration on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -480,15 +377,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerConfigurationService/DeleteSCMIntegration", body=maybe_transform({"id": id}, scm_integration_delete_params.ScmIntegrationDeleteParams), @@ -524,8 +412,6 @@ async def create( self, *, oauth_client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -537,13 +423,8 @@ async def create( CreateSCMIntegration creates a new SCM integration on a runner. Args: - oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_plaintext_client_secret must also be set. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If + configured, oauth_plaintext_client_secret must also be set. extra_headers: Send extra headers @@ -560,8 +441,6 @@ async def create( self, *, oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -574,13 +453,8 @@ async def create( Args: oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. - This will first be encrypted with the runner's public key before being stored. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -591,15 +465,11 @@ async def create( """ ... - @required_args( - ["oauth_client_id", "connect_protocol_version"], ["oauth_plaintext_client_secret", "connect_protocol_version"] - ) + @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"]) async def create( self, *, oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -608,15 +478,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", body=await async_maybe_transform( @@ -635,9 +496,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -649,10 +508,6 @@ async def retrieve( GetSCMIntegration returns a single SCM integration configured for a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -661,15 +516,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/GetSCMIntegration", body=await async_maybe_transform({"id": id}, scm_integration_retrieve_params.ScmIntegrationRetrieveParams), @@ -684,8 +530,6 @@ async def update( self, *, oauth_client_id: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -697,17 +541,12 @@ async def update( UpdateSCMIntegration updates an existing SCM integration on a runner. Args: - oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. - - If an empty string is set, the OAuth configuration will be removed (regardless - of whether a client secret is set), and any existing Host Authentication Tokens - for the SCM integration's runner and host that were created using the OAuth app - will be deleted. This might lead to users being unable to access their - repositories until they re-authenticate. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. If an empty + string is set, the OAuth configuration will be removed (regardless of whether a + client secret is set), and any existing Host Authentication Tokens for the SCM + integration's runner and host that were created using the OAuth app will be + deleted. This might lead to users being unable to access their repositories + until they re-authenticate. extra_headers: Send extra headers @@ -724,8 +563,6 @@ async def update( self, *, oauth_plaintext_client_secret: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -738,14 +575,8 @@ async def update( Args: oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client - secret. - - The cleartext secret will be encrypted with the runner's public key before being - stored. - - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + secret. The cleartext secret will be encrypted with the runner's public key + before being stored. extra_headers: Send extra headers @@ -762,8 +593,6 @@ async def update( self, *, pat: bool, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -775,17 +604,12 @@ async def update( UpdateSCMIntegration updates an existing SCM integration on a runner. Args: - pat: pat can be set to enable or disable Personal Access Tokens support. - - When disabling PATs, any existing Host Authentication Tokens for the SCM + pat: pat can be set to enable or disable Personal Access Tokens support. When + disabling PATs, any existing Host Authentication Tokens for the SCM integration's runner and host that were created using a PAT will be deleted. This might lead to users being unable to access their repositories until they re-authenticate. - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -796,17 +620,11 @@ async def update( """ ... - @required_args( - ["oauth_client_id", "connect_protocol_version"], - ["oauth_plaintext_client_secret", "connect_protocol_version"], - ["pat", "connect_protocol_version"], - ) + @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"], ["pat"]) async def update( self, *, oauth_client_id: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, pat: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -816,15 +634,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", body=await async_maybe_transform( @@ -841,39 +650,25 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: scm_integration_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: scm_integration_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationListResponse: + ) -> AsyncPaginator[ScmIntegrationListResponse, AsyncPersonalAccessTokensPage[ScmIntegrationListResponse]]: """ ListSCMIntegrations returns all SCM integrations configured for a runner. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing scm integrations extra_headers: Send extra headers @@ -883,42 +678,37 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", + page=AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + scm_integration_list_params.ScmIntegrationListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, scm_integration_list_params.ScmIntegrationListParams, ), ), - cast_to=ScmIntegrationListResponse, + model=ScmIntegrationListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -930,10 +720,6 @@ async def delete( DeleteSCMIntegration deletes an existing SCM integration on a runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -942,15 +728,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerConfigurationService/DeleteSCMIntegration", body=await async_maybe_transform({"id": id}, scm_integration_delete_params.ScmIntegrationDeleteParams), diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 582d4f9e..b2355073 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -8,9 +8,7 @@ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -21,7 +19,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.runners import policy_list_params, policy_create_params, policy_delete_params, policy_update_params from ...types.runners.policy_list_response import PolicyListResponse from ...types.runners.policy_create_response import PolicyCreateResponse @@ -53,11 +52,9 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -69,14 +66,10 @@ def create( CreateRunnerPolicy creates a new runner policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier runner_id: runner_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -85,15 +78,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/CreateRunnerPolicy", body=maybe_transform( @@ -113,11 +97,9 @@ def create( def update( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -129,14 +111,10 @@ def update( UpdateRunnerPolicy an existing runner policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier runner_id: runner_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -145,15 +123,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/UpdateRunnerPolicy", body=maybe_transform( @@ -173,36 +142,24 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PolicyListResponse: + ) -> SyncPersonalAccessTokensPage[PolicyListResponse]: """ ListRunnerPolicies lists runner policies. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request + pagination: pagination contains the pagination options for listing project policies - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + runner_id: runner_id specifies the project identifier extra_headers: Send extra headers @@ -212,17 +169,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerService/ListRunnerPolicies", + page=SyncPersonalAccessTokensPage[PolicyListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "pagination": pagination, + "runner_id": runner_id, + }, + policy_list_params.PolicyListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.RunnerService/ListRunnerPolicies", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -230,25 +186,21 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, policy_list_params.PolicyListParams, ), ), - cast_to=PolicyListResponse, + model=PolicyListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -260,14 +212,10 @@ def delete( DeleteRunnerPolicy deletes a runner policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier runner_id: runner_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -276,15 +224,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/DeleteRunnerPolicy", body=maybe_transform( @@ -324,11 +263,9 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def create( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -340,14 +277,10 @@ async def create( CreateRunnerPolicy creates a new runner policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier runner_id: runner_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -356,15 +289,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/CreateRunnerPolicy", body=await async_maybe_transform( @@ -384,11 +308,9 @@ async def create( async def update( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -400,14 +322,10 @@ async def update( UpdateRunnerPolicy an existing runner policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier runner_id: runner_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -416,15 +334,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/UpdateRunnerPolicy", body=await async_maybe_transform( @@ -441,39 +350,27 @@ async def update( cast_to=PolicyUpdateResponse, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PolicyListResponse: + ) -> AsyncPaginator[PolicyListResponse, AsyncPersonalAccessTokensPage[PolicyListResponse]]: """ ListRunnerPolicies lists runner policies. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request + pagination: pagination contains the pagination options for listing project policies - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + runner_id: runner_id specifies the project identifier extra_headers: Send extra headers @@ -483,43 +380,38 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerService/ListRunnerPolicies", + page=AsyncPersonalAccessTokensPage[PolicyListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "pagination": pagination, + "runner_id": runner_id, + }, + policy_list_params.PolicyListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.RunnerService/ListRunnerPolicies", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, policy_list_params.PolicyListParams, ), ), - cast_to=PolicyListResponse, + model=PolicyListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], group_id: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -531,14 +423,10 @@ async def delete( DeleteRunnerPolicy deletes a runner policy. Args: - connect_protocol_version: Define the version of the Connect protocol - group_id: group_id specifies the group_id identifier runner_id: runner_id specifies the project identifier - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -547,15 +435,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/DeleteRunnerPolicy", body=await async_maybe_transform( diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 5d6ff286..82f8e867 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -18,10 +18,8 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from .policies import ( @@ -40,7 +38,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.runner_list_response import RunnerListResponse from .configurations.configurations import ( ConfigurationsResource, @@ -90,7 +89,6 @@ def with_streaming_response(self) -> RunnersResourceWithStreamingResponse: def create( self, *, - connect_protocol_version: Literal[1], kind: Literal[ "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" ] @@ -104,7 +102,6 @@ def create( ] | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -115,13 +112,10 @@ def create( """CreateRunner creates a new runner with the server. Registrations are very - short-lived and must be renewed every 30 seconds. Runners can be registered for an entire organisation or a single user. Args: - connect_protocol_version: Define the version of the Connect protocol - kind: RunnerKind represents the kind of a runner name: The runner name for humans @@ -130,8 +124,6 @@ def create( provider maps to a specific kind of runner (local or remote), as specified below for each provider. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -140,15 +132,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/CreateRunner", body=maybe_transform( @@ -169,9 +152,7 @@ def create( def retrieve( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -183,10 +164,6 @@ def retrieve( GetRunner returns a single runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -195,15 +172,6 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/GetRunner", body=maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), @@ -218,8 +186,6 @@ def update( self, *, name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -233,10 +199,6 @@ def update( Args: name: The runner's name which is shown to users - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -252,8 +214,6 @@ def update( self, *, spec: runner_update_params.Variant1Spec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -265,10 +225,6 @@ def update( UpdateRunner updates an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -279,13 +235,11 @@ def update( """ ... - @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + @required_args(["name"], ["spec"]) def update( self, *, name: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -294,15 +248,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/UpdateRunner", body=maybe_transform( @@ -321,36 +266,22 @@ def update( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerListResponse: + ) -> SyncPersonalAccessTokensPage[RunnerListResponse]: """ ListRunners returns all runners registered in the scope. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing runners extra_headers: Send extra headers @@ -360,17 +291,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerService/ListRunners", + page=SyncPersonalAccessTokensPage[RunnerListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + runner_list_params.RunnerListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.RunnerService/ListRunners", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -378,25 +308,21 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, runner_list_params.RunnerListParams, ), ), - cast_to=RunnerListResponse, + model=RunnerListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], force: bool | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -408,15 +334,11 @@ def delete( DeleteRunner deletes an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol - force: force indicates whether the runner should be deleted forcefully. When force deleting a Runner, all Environments on the runner are also force deleted and regular Runner lifecycle is not respected. Force deleting can result in data loss. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -425,15 +347,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/DeleteRunner", body=maybe_transform( @@ -452,10 +365,8 @@ def delete( def check_authentication_for_host( self, *, - connect_protocol_version: Literal[1], host: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -465,16 +376,11 @@ def check_authentication_for_host( ) -> RunnerCheckAuthenticationForHostResponse: """ CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. - - If not, this function will return a URL that the user should visit to - authenticate, or indicate that Personal Access Tokens are supported. + particular host, e.g. an SCM system. If not, this function will return a URL + that the user should visit to authenticate, or indicate that Personal Access + Tokens are supported. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -483,15 +389,6 @@ def check_authentication_for_host( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/CheckAuthenticationForHost", body=maybe_transform( @@ -510,9 +407,7 @@ def check_authentication_for_host( def create_runner_token( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -520,17 +415,13 @@ def create_runner_token( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateRunnerTokenResponse: - """ - CreateRunnerToken returns a token that can be used to authenticate as the + """CreateRunnerToken returns a token that can be used to authenticate as the + runner. - runner. Use this call to renew an outdated token - this does not expire any + Use this call to renew an outdated token - this does not expire any previouly issued tokens. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -539,15 +430,6 @@ def create_runner_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/CreateRunnerToken", body=maybe_transform( @@ -562,10 +444,8 @@ def create_runner_token( def parse_context_url( self, *, - connect_protocol_version: Literal[1], context_url: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -588,10 +468,6 @@ def parse_context_url( exist Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -600,15 +476,6 @@ def parse_context_url( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.RunnerService/ParseContextURL", body=maybe_transform( @@ -656,7 +523,6 @@ def with_streaming_response(self) -> AsyncRunnersResourceWithStreamingResponse: async def create( self, *, - connect_protocol_version: Literal[1], kind: Literal[ "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" ] @@ -670,7 +536,6 @@ async def create( ] | NotGiven = NOT_GIVEN, spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -681,13 +546,10 @@ async def create( """CreateRunner creates a new runner with the server. Registrations are very - short-lived and must be renewed every 30 seconds. Runners can be registered for an entire organisation or a single user. Args: - connect_protocol_version: Define the version of the Connect protocol - kind: RunnerKind represents the kind of a runner name: The runner name for humans @@ -696,8 +558,6 @@ async def create( provider maps to a specific kind of runner (local or remote), as specified below for each provider. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -706,15 +566,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/CreateRunner", body=await async_maybe_transform( @@ -735,9 +586,7 @@ async def create( async def retrieve( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -749,10 +598,6 @@ async def retrieve( GetRunner returns a single runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -761,15 +606,6 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/GetRunner", body=await async_maybe_transform({"runner_id": runner_id}, runner_retrieve_params.RunnerRetrieveParams), @@ -784,8 +620,6 @@ async def update( self, *, name: str, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -799,10 +633,6 @@ async def update( Args: name: The runner's name which is shown to users - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -818,8 +648,6 @@ async def update( self, *, spec: runner_update_params.Variant1Spec, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -831,10 +659,6 @@ async def update( UpdateRunner updates an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -845,13 +669,11 @@ async def update( """ ... - @required_args(["name", "connect_protocol_version"], ["spec", "connect_protocol_version"]) + @required_args(["name"], ["spec"]) async def update( self, *, name: str | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -860,15 +682,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/UpdateRunner", body=await async_maybe_transform( @@ -884,39 +697,25 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunnerListResponse: + ) -> AsyncPaginator[RunnerListResponse, AsyncPersonalAccessTokensPage[RunnerListResponse]]: """ ListRunners returns all runners registered in the scope. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing runners extra_headers: Send extra headers @@ -926,43 +725,38 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.RunnerService/ListRunners", + page=AsyncPersonalAccessTokensPage[RunnerListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + runner_list_params.RunnerListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.RunnerService/ListRunners", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, runner_list_params.RunnerListParams, ), ), - cast_to=RunnerListResponse, + model=RunnerListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], force: bool | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -974,15 +768,11 @@ async def delete( DeleteRunner deletes an environment runner. Args: - connect_protocol_version: Define the version of the Connect protocol - force: force indicates whether the runner should be deleted forcefully. When force deleting a Runner, all Environments on the runner are also force deleted and regular Runner lifecycle is not respected. Force deleting can result in data loss. - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -991,15 +781,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/DeleteRunner", body=await async_maybe_transform( @@ -1018,10 +799,8 @@ async def delete( async def check_authentication_for_host( self, *, - connect_protocol_version: Literal[1], host: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1031,16 +810,11 @@ async def check_authentication_for_host( ) -> RunnerCheckAuthenticationForHostResponse: """ CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. - - If not, this function will return a URL that the user should visit to - authenticate, or indicate that Personal Access Tokens are supported. + particular host, e.g. an SCM system. If not, this function will return a URL + that the user should visit to authenticate, or indicate that Personal Access + Tokens are supported. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1049,15 +823,6 @@ async def check_authentication_for_host( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/CheckAuthenticationForHost", body=await async_maybe_transform( @@ -1076,9 +841,7 @@ async def check_authentication_for_host( async def create_runner_token( self, *, - connect_protocol_version: Literal[1], runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1086,17 +849,13 @@ async def create_runner_token( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateRunnerTokenResponse: - """ - CreateRunnerToken returns a token that can be used to authenticate as the + """CreateRunnerToken returns a token that can be used to authenticate as the + runner. - runner. Use this call to renew an outdated token - this does not expire any + Use this call to renew an outdated token - this does not expire any previouly issued tokens. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1105,15 +864,6 @@ async def create_runner_token( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/CreateRunnerToken", body=await async_maybe_transform( @@ -1128,10 +878,8 @@ async def create_runner_token( async def parse_context_url( self, *, - connect_protocol_version: Literal[1], context_url: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1154,10 +902,6 @@ async def parse_context_url( exist Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1166,15 +910,6 @@ async def parse_context_url( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.RunnerService/ParseContextURL", body=await async_maybe_transform( diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index e2a7da0c..72b10043 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing_extensions import overload import httpx @@ -15,10 +15,8 @@ ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - is_given, required_args, maybe_transform, - strip_not_given, async_maybe_transform, ) from .._compat import cached_property @@ -29,7 +27,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options +from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from .._base_client import AsyncPaginator, make_request_options from ..types.secret_list_response import SecretListResponse from ..types.secret_create_response import SecretCreateResponse from ..types.secret_get_value_response import SecretGetValueResponse @@ -62,11 +61,9 @@ def create( self, *, environment_variable: bool, - connect_protocol_version: Literal[1], name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -81,14 +78,10 @@ def create( environment_variable: secret will be created as an Environment Variable with the same name as the secret - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -104,11 +97,9 @@ def create( self, *, file_path: str, - connect_protocol_version: Literal[1], name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -127,14 +118,10 @@ def create( this.matches("^/(?:[^/]*/)*.*$") ``` - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -145,16 +132,14 @@ def create( """ ... - @required_args(["environment_variable", "connect_protocol_version"], ["file_path", "connect_protocol_version"]) + @required_args(["environment_variable"], ["file_path"]) def create( self, *, environment_variable: bool | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -163,15 +148,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SecretCreateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.SecretService/CreateSecret", body=maybe_transform( @@ -193,36 +169,22 @@ def create( def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: secret_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: secret_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SecretListResponse: + ) -> SyncPersonalAccessTokensPage[SecretListResponse]: """ ListSecrets lists secrets. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -232,17 +194,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.SecretService/ListSecrets", + page=SyncPersonalAccessTokensPage[SecretListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + secret_list_params.SecretListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.SecretService/ListSecrets", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -250,24 +211,20 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, secret_list_params.SecretListParams, ), ), - cast_to=SecretListResponse, + model=SecretListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], secret_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -279,10 +236,6 @@ def delete( DeleteSecret deletes a secret. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -291,15 +244,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.SecretService/DeleteSecret", body=maybe_transform({"secret_id": secret_id}, secret_delete_params.SecretDeleteParams), @@ -312,9 +256,7 @@ def delete( def get_value( self, *, - connect_protocol_version: Literal[1], secret_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -327,10 +269,6 @@ def get_value( this operation, and only for secrets specified on the EnvironmentSpec. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -339,15 +277,6 @@ def get_value( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.SecretService/GetSecretValue", body=maybe_transform({"secret_id": secret_id}, secret_get_value_params.SecretGetValueParams), @@ -360,10 +289,8 @@ def get_value( def update_value( self, *, - connect_protocol_version: Literal[1], secret_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -375,12 +302,8 @@ def update_value( UpdateSecretValue updates the value of a secret. Args: - connect_protocol_version: Define the version of the Connect protocol - value: value is the plaintext value of the secret - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -389,15 +312,6 @@ def update_value( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.SecretService/UpdateSecretValue", body=maybe_transform( @@ -439,11 +353,9 @@ async def create( self, *, environment_variable: bool, - connect_protocol_version: Literal[1], name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -458,14 +370,10 @@ async def create( environment_variable: secret will be created as an Environment Variable with the same name as the secret - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -481,11 +389,9 @@ async def create( self, *, file_path: str, - connect_protocol_version: Literal[1], name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -504,14 +410,10 @@ async def create( this.matches("^/(?:[^/]*/)*.*$") ``` - connect_protocol_version: Define the version of the Connect protocol - project_id: project_id is the ProjectID this Secret belongs to value: value is the plaintext value of the secret - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -522,16 +424,14 @@ async def create( """ ... - @required_args(["environment_variable", "connect_protocol_version"], ["file_path", "connect_protocol_version"]) + @required_args(["environment_variable"], ["file_path"]) async def create( self, *, environment_variable: bool | NotGiven = NOT_GIVEN, - connect_protocol_version: Literal[1], name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -540,15 +440,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SecretCreateResponse: - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.SecretService/CreateSecret", body=await async_maybe_transform( @@ -567,39 +458,25 @@ async def create( cast_to=SecretCreateResponse, ) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: secret_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: secret_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SecretListResponse: + ) -> AsyncPaginator[SecretListResponse, AsyncPersonalAccessTokensPage[SecretListResponse]]: """ ListSecrets lists secrets. Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -609,42 +486,37 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.SecretService/ListSecrets", + page=AsyncPersonalAccessTokensPage[SecretListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + secret_list_params.SecretListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.SecretService/ListSecrets", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, secret_list_params.SecretListParams, ), ), - cast_to=SecretListResponse, + model=SecretListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], secret_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -656,10 +528,6 @@ async def delete( DeleteSecret deletes a secret. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -668,15 +536,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.SecretService/DeleteSecret", body=await async_maybe_transform({"secret_id": secret_id}, secret_delete_params.SecretDeleteParams), @@ -689,9 +548,7 @@ async def delete( async def get_value( self, *, - connect_protocol_version: Literal[1], secret_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -704,10 +561,6 @@ async def get_value( this operation, and only for secrets specified on the EnvironmentSpec. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -716,15 +569,6 @@ async def get_value( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.SecretService/GetSecretValue", body=await async_maybe_transform({"secret_id": secret_id}, secret_get_value_params.SecretGetValueParams), @@ -737,10 +581,8 @@ async def get_value( async def update_value( self, *, - connect_protocol_version: Literal[1], secret_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -752,12 +594,8 @@ async def update_value( UpdateSecretValue updates the value of a secret. Args: - connect_protocol_version: Define the version of the Connect protocol - value: value is the plaintext value of the secret - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -766,15 +604,6 @@ async def update_value( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.SecretService/UpdateSecretValue", body=await async_maybe_transform( diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 766fe0a8..17474a15 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -2,15 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -21,8 +17,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from ...types.users import pat_get_params, pat_list_params, pat_delete_params -from ..._base_client import make_request_options +from ..._base_client import AsyncPaginator, make_request_options from ...types.users.pat_get_response import PatGetResponse from ...types.users.pat_list_response import PatListResponse @@ -52,37 +49,21 @@ def with_streaming_response(self) -> PatsResourceWithStreamingResponse: def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: pat_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: pat_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PatListResponse: + ) -> SyncPersonalAccessTokensPage[PatListResponse]: """ ListPersonalAccessTokens Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -91,17 +72,16 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.UserService/ListPersonalAccessTokens", + page=SyncPersonalAccessTokensPage[PatListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + pat_list_params.PatListParams, ), - **(extra_headers or {}), - } - return self._get( - "/gitpod.v1.UserService/ListPersonalAccessTokens", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -109,24 +89,20 @@ def list( timeout=timeout, query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, pat_list_params.PatListParams, ), ), - cast_to=PatListResponse, + model=PatListResponse, + method="post", ) def delete( self, *, - connect_protocol_version: Literal[1], personal_access_token_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -138,10 +114,6 @@ def delete( DeletePersonalAccessToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -150,15 +122,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.UserService/DeletePersonalAccessToken", body=maybe_transform( @@ -173,9 +136,7 @@ def delete( def get( self, *, - connect_protocol_version: Literal[1], personal_access_token_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -187,10 +148,6 @@ def get( GetPersonalAccessToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -199,15 +156,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.UserService/GetPersonalAccessToken", body=maybe_transform({"personal_access_token_id": personal_access_token_id}, pat_get_params.PatGetParams), @@ -238,40 +186,24 @@ def with_streaming_response(self) -> AsyncPatsResourceWithStreamingResponse: """ return AsyncPatsResourceWithStreamingResponse(self) - async def list( + def list( self, *, - encoding: Literal["proto", "json"], - connect_protocol_version: Literal[1], - base64: bool | NotGiven = NOT_GIVEN, - compression: Literal["identity", "gzip", "br"] | NotGiven = NOT_GIVEN, - connect: Literal["v1"] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: pat_list_params.Filter | NotGiven = NOT_GIVEN, + pagination: pat_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PatListResponse: + ) -> AsyncPaginator[PatListResponse, AsyncPersonalAccessTokensPage[PatListResponse]]: """ ListPersonalAccessTokens Args: - encoding: Define which encoding or 'Message-Codec' to use - - connect_protocol_version: Define the version of the Connect protocol - - base64: Specifies if the message query param is base64 encoded, which may be required - for binary data - - compression: Which compression algorithm to use for this request - - connect: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -280,42 +212,37 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( + return self._get_api_list( + "/gitpod.v1.UserService/ListPersonalAccessTokens", + page=AsyncPersonalAccessTokensPage[PatListResponse], + body=maybe_transform( { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } + "filter": filter, + "pagination": pagination, + }, + pat_list_params.PatListParams, ), - **(extra_headers or {}), - } - return await self._get( - "/gitpod.v1.UserService/ListPersonalAccessTokens", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { - "encoding": encoding, - "base64": base64, - "compression": compression, - "connect": connect, - "message": message, + "token": token, + "page_size": page_size, }, pat_list_params.PatListParams, ), ), - cast_to=PatListResponse, + model=PatListResponse, + method="post", ) async def delete( self, *, - connect_protocol_version: Literal[1], personal_access_token_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -327,10 +254,6 @@ async def delete( DeletePersonalAccessToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -339,15 +262,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.UserService/DeletePersonalAccessToken", body=await async_maybe_transform( @@ -362,9 +276,7 @@ async def delete( async def get( self, *, - connect_protocol_version: Literal[1], personal_access_token_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -376,10 +288,6 @@ async def get( GetPersonalAccessToken Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -388,15 +296,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.UserService/GetPersonalAccessToken", body=await async_maybe_transform( diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index 04174ae7..e79311c0 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from .pats import ( @@ -17,9 +15,7 @@ from ...types import user_set_suspended_params, user_get_authenticated_user_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - is_given, maybe_transform, - strip_not_given, async_maybe_transform, ) from ..._compat import cached_property @@ -64,8 +60,6 @@ def get_authenticated_user( self, *, body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,10 +71,6 @@ def get_authenticated_user( GetAuthenticatedUser allows to retrieve the current user. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -89,15 +79,6 @@ def get_authenticated_user( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.UserService/GetAuthenticatedUser", body=maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams), @@ -110,10 +91,8 @@ def get_authenticated_user( def set_suspended( self, *, - connect_protocol_version: Literal[1], suspended: bool | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -125,10 +104,6 @@ def set_suspended( SetSuspended sets the suspended state of the user. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -137,15 +112,6 @@ def set_suspended( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return self._post( "/gitpod.v1.UserService/SetSuspended", body=maybe_transform( @@ -190,8 +156,6 @@ async def get_authenticated_user( self, *, body: object, - connect_protocol_version: Literal[1], - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -203,10 +167,6 @@ async def get_authenticated_user( GetAuthenticatedUser allows to retrieve the current user. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -215,15 +175,6 @@ async def get_authenticated_user( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.UserService/GetAuthenticatedUser", body=await async_maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams), @@ -236,10 +187,8 @@ async def get_authenticated_user( async def set_suspended( self, *, - connect_protocol_version: Literal[1], suspended: bool | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, - connect_timeout_ms: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -251,10 +200,6 @@ async def set_suspended( SetSuspended sets the suspended state of the user. Args: - connect_protocol_version: Define the version of the Connect protocol - - connect_timeout_ms: Define the timeout, in ms - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -263,15 +208,6 @@ async def set_suspended( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - **strip_not_given( - { - "Connect-Protocol-Version": str(connect_protocol_version), - "Connect-Timeout-Ms": str(connect_timeout_ms) if is_given(connect_timeout_ms) else NOT_GIVEN, - } - ), - **(extra_headers or {}), - } return await self._post( "/gitpod.v1.UserService/SetSuspended", body=await async_maybe_transform( diff --git a/src/gitpod/types/account_delete_params.py b/src/gitpod/types/account_delete_params.py index 753b0f36..93e5bf16 100644 --- a/src/gitpod/types/account_delete_params.py +++ b/src/gitpod/types/account_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class AccountDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - account_id: Annotated[str, PropertyInfo(alias="accountId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/account_get_sso_login_url_params.py b/src/gitpod/types/account_get_sso_login_url_params.py index adf2e060..5c5f85d7 100644 --- a/src/gitpod/types/account_get_sso_login_url_params.py +++ b/src/gitpod/types/account_get_sso_login_url_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -13,11 +13,5 @@ class AccountGetSSOLoginURLParams(TypedDict, total=False): return_to: Required[Annotated[str, PropertyInfo(alias="returnTo")]] """return_to is the URL the user will be redirected to after login""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - email: str """email is the email the user wants to login with""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/account_list_login_providers_params.py b/src/gitpod/types/account_list_login_providers_params.py index 6d2dc4dd..e7c5da7a 100644 --- a/src/gitpod/types/account_list_login_providers_params.py +++ b/src/gitpod/types/account_list_login_providers_params.py @@ -2,33 +2,39 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["AccountListLoginProvidersParams"] +__all__ = ["AccountListLoginProvidersParams", "Filter", "Pagination"] class AccountListLoginProvidersParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + """filter contains the filter options for listing login methods""" + + pagination: Pagination + """pagination contains the pagination options for listing login methods""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" +class Filter(TypedDict, total=False): + invite_id: Annotated[str, PropertyInfo(alias="inviteId")] + """invite_id is the ID of the invite URL the user wants to login with""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" - message: str +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/account_list_login_providers_response.py b/src/gitpod/types/account_list_login_providers_response.py index 987cfecd..231fb827 100644 --- a/src/gitpod/types/account_list_login_providers_response.py +++ b/src/gitpod/types/account_list_login_providers_response.py @@ -22,9 +22,9 @@ class LoginProvider(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/account_retrieve_params.py b/src/gitpod/types/account_retrieve_params.py index 2ec77f46..ad9497e8 100644 --- a/src/gitpod/types/account_retrieve_params.py +++ b/src/gitpod/types/account_retrieve_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo +from typing_extensions import Required, TypedDict __all__ = ["AccountRetrieveParams"] class AccountRetrieveParams(TypedDict, total=False): body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/editor_list_params.py b/src/gitpod/types/editor_list_params.py index b241f1b3..13184679 100644 --- a/src/gitpod/types/editor_list_params.py +++ b/src/gitpod/types/editor_list_params.py @@ -2,33 +2,31 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["EditorListParams"] +__all__ = ["EditorListParams", "Pagination"] class EditorListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + pagination: Pagination + """pagination contains the pagination options for listing environments""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/editor_list_response.py b/src/gitpod/types/editor_list_response.py index 3af4fa8b..9c4e96f9 100644 --- a/src/gitpod/types/editor_list_response.py +++ b/src/gitpod/types/editor_list_response.py @@ -27,8 +27,8 @@ class Editor(BaseModel): class Pagination(BaseModel): token: Optional[str] = None - """Token for the next set of results that was returned as next_token of a - + """ + Token for the next set of results that was returned as next_token of a PaginationResponse """ diff --git a/src/gitpod/types/editor_resolve_url_params.py b/src/gitpod/types/editor_resolve_url_params.py index 9338071a..a4a34df9 100644 --- a/src/gitpod/types/editor_resolve_url_params.py +++ b/src/gitpod/types/editor_resolve_url_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,9 +10,6 @@ class EditorResolveURLParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - editor_id: Annotated[str, PropertyInfo(alias="editorId")] """editorId is the ID of the editor to resolve the URL for""" @@ -21,6 +18,3 @@ class EditorResolveURLParams(TypedDict, total=False): organization_id: Annotated[str, PropertyInfo(alias="organizationId")] """organizationId is the ID of the organization to resolve the URL for""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/editor_retrieve_params.py b/src/gitpod/types/editor_retrieve_params.py index a0a1e574..9b01102e 100644 --- a/src/gitpod/types/editor_retrieve_params.py +++ b/src/gitpod/types/editor_retrieve_params.py @@ -2,19 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["EditorRetrieveParams"] class EditorRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str """id is the ID of the editor to get""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index 4413cb62..819fea64 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -31,28 +31,21 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - project_id: Annotated[str, PropertyInfo(alias="projectId")] spec: Spec - """EnvironmentSpec specifies the configuration of an environment for an environment - + """ + EnvironmentSpec specifies the configuration of an environment for an environment start """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file that is applied in the - environment, - - relative to the repo root. path must not be absolute (start with a /): + environment, relative to the repo root. path must not be absolute (start with a + /): ``` this.matches('^$|^[^/].*') @@ -73,9 +66,8 @@ class SpecContentInitializerSpecContextURL(TypedDict, total=False): class SpecContentInitializerSpecGitGit(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index fac2dc9e..b4ab8c64 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -68,14 +68,14 @@ class EnvironmentMetadataCreator(BaseModel): class EnvironmentMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None - """annotations are key/value pairs that gets attached to the environment. - + """ + annotations are key/value pairs that gets attached to the environment. +internal - not yet implemented """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -169,8 +169,8 @@ class EnvironmentMetadata(BaseModel): """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -267,8 +267,8 @@ class EnvironmentMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """original_context_url is the normalized URL from which the environment was - + """ + original_context_url is the normalized URL from which the environment was created """ @@ -286,9 +286,8 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, - - relative to the repo root. path must not be absolute (start with a /): + environment, relative to the repo root. path must not be absolute (start with a + /): ``` this.matches('^$|^[^/].*') @@ -309,9 +308,8 @@ class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) @@ -587,15 +585,15 @@ class EnvironmentSpec(BaseModel): class EnvironmentStatusActivitySignal(BaseModel): source: Optional[str] = None - """source of the activity signal, such as "VS Code", "SSH", or "Automations". - - It should be a human-readable string that describes the source of the activity + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity signal. """ timestamp: Optional[datetime] = None - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -702,8 +700,8 @@ class EnvironmentStatusAutomationsFile(BaseModel): """ failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the automations file failed to be applied. - + """ + failure_message contains the reason the automations file failed to be applied. This is only set if the phase is FAILED. """ @@ -752,8 +750,8 @@ class EnvironmentStatusContentGit(BaseModel): changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( alias="changedFiles", default=None ) - """changed_files is an array of changed files in the environment, possibly - + """ + changed_files is an array of changed files in the environment, possibly truncated """ @@ -772,8 +770,8 @@ class EnvironmentStatusContentGit(BaseModel): """the total number of unpushed changes""" unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """unpushed_commits is an array of unpushed changes in the environment, possibly - + """ + unpushed_commits is an array of unpushed changes in the environment, possibly truncated """ @@ -927,9 +925,9 @@ class EnvironmentStatusMachine(BaseModel): """session is the session that is currently active in the machine.""" timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. If this field is + """timeout contains the reason the environment has timed out. - empty, the environment has not timed out. + If this field is empty, the environment has not timed out. """ versions: Optional[EnvironmentStatusMachineVersions] = None @@ -1015,18 +1013,16 @@ class EnvironmentStatus(BaseModel): """devcontainer contains the status of the devcontainer.""" environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """environment_url contains the URL at which the environment can be accessed. - - This field is only set if the environment is running. + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. """ failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the environment failed to operate. - If this is non-empty - - the environment has failed to operate and will likely transition to a stopped - state. + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. """ machine: Optional[EnvironmentStatusMachine] = None @@ -1045,14 +1041,14 @@ class EnvironmentStatus(BaseModel): "ENVIRONMENT_PHASE_DELETED", ] ] = None - """the phase of an environment is a simple, high-level summary of where the - + """ + the phase of an environment is a simple, high-level summary of where the environment is in its lifecycle """ runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """RunnerACK is the acknowledgement from the runner that is has received the - + """ + RunnerACK is the acknowledgement from the runner that is has received the environment spec. """ @@ -1080,20 +1076,21 @@ class EnvironmentStatus(BaseModel): class Environment(BaseModel): id: Optional[str] = None - """ID is a unique identifier of this environment. No other environment with the + """ID is a unique identifier of this environment. - same name must be managed by this environment manager + No other environment with the same name must be managed by this environment + manager """ metadata: Optional[EnvironmentMetadata] = None - """EnvironmentMetadata is data associated with an environment that's required for - + """ + EnvironmentMetadata is data associated with an environment that's required for other parts of the system to function """ spec: Optional[EnvironmentSpec] = None - """EnvironmentSpec specifies the configuration of an environment for an environment - + """ + EnvironmentSpec specifies the configuration of an environment for an environment start """ diff --git a/src/gitpod/types/environment_create_logs_token_params.py b/src/gitpod/types/environment_create_logs_token_params.py index 9933a9b4..ba9f17eb 100644 --- a/src/gitpod/types/environment_create_logs_token_params.py +++ b/src/gitpod/types/environment_create_logs_token_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,9 +10,6 @@ class EnvironmentCreateLogsTokenParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """ environment_id specifies the environment for which the logs token should be @@ -20,6 +17,3 @@ class EnvironmentCreateLogsTokenParams(TypedDict, total=False): +required """ - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index 7b8da702..ee192d90 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -31,26 +31,19 @@ class EnvironmentCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - spec: Spec - """EnvironmentSpec specifies the configuration of an environment for an environment - + """ + EnvironmentSpec specifies the configuration of an environment for an environment start """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file that is applied in the - environment, - - relative to the repo root. path must not be absolute (start with a /): + environment, relative to the repo root. path must not be absolute (start with a + /): ``` this.matches('^$|^[^/].*') @@ -71,9 +64,8 @@ class SpecContentInitializerSpecContextURL(TypedDict, total=False): class SpecContentInitializerSpecGitGit(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index 0573ca9e..22377c6e 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -68,14 +68,14 @@ class EnvironmentMetadataCreator(BaseModel): class EnvironmentMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None - """annotations are key/value pairs that gets attached to the environment. - + """ + annotations are key/value pairs that gets attached to the environment. +internal - not yet implemented """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -169,8 +169,8 @@ class EnvironmentMetadata(BaseModel): """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -267,8 +267,8 @@ class EnvironmentMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """original_context_url is the normalized URL from which the environment was - + """ + original_context_url is the normalized URL from which the environment was created """ @@ -286,9 +286,8 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, - - relative to the repo root. path must not be absolute (start with a /): + environment, relative to the repo root. path must not be absolute (start with a + /): ``` this.matches('^$|^[^/].*') @@ -309,9 +308,8 @@ class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) @@ -587,15 +585,15 @@ class EnvironmentSpec(BaseModel): class EnvironmentStatusActivitySignal(BaseModel): source: Optional[str] = None - """source of the activity signal, such as "VS Code", "SSH", or "Automations". - - It should be a human-readable string that describes the source of the activity + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity signal. """ timestamp: Optional[datetime] = None - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -702,8 +700,8 @@ class EnvironmentStatusAutomationsFile(BaseModel): """ failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the automations file failed to be applied. - + """ + failure_message contains the reason the automations file failed to be applied. This is only set if the phase is FAILED. """ @@ -752,8 +750,8 @@ class EnvironmentStatusContentGit(BaseModel): changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( alias="changedFiles", default=None ) - """changed_files is an array of changed files in the environment, possibly - + """ + changed_files is an array of changed files in the environment, possibly truncated """ @@ -772,8 +770,8 @@ class EnvironmentStatusContentGit(BaseModel): """the total number of unpushed changes""" unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """unpushed_commits is an array of unpushed changes in the environment, possibly - + """ + unpushed_commits is an array of unpushed changes in the environment, possibly truncated """ @@ -927,9 +925,9 @@ class EnvironmentStatusMachine(BaseModel): """session is the session that is currently active in the machine.""" timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. If this field is + """timeout contains the reason the environment has timed out. - empty, the environment has not timed out. + If this field is empty, the environment has not timed out. """ versions: Optional[EnvironmentStatusMachineVersions] = None @@ -1015,18 +1013,16 @@ class EnvironmentStatus(BaseModel): """devcontainer contains the status of the devcontainer.""" environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """environment_url contains the URL at which the environment can be accessed. - - This field is only set if the environment is running. + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. """ failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the environment failed to operate. - If this is non-empty - - the environment has failed to operate and will likely transition to a stopped - state. + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. """ machine: Optional[EnvironmentStatusMachine] = None @@ -1045,14 +1041,14 @@ class EnvironmentStatus(BaseModel): "ENVIRONMENT_PHASE_DELETED", ] ] = None - """the phase of an environment is a simple, high-level summary of where the - + """ + the phase of an environment is a simple, high-level summary of where the environment is in its lifecycle """ runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """RunnerACK is the acknowledgement from the runner that is has received the - + """ + RunnerACK is the acknowledgement from the runner that is has received the environment spec. """ @@ -1080,20 +1076,21 @@ class EnvironmentStatus(BaseModel): class Environment(BaseModel): id: Optional[str] = None - """ID is a unique identifier of this environment. No other environment with the + """ID is a unique identifier of this environment. - same name must be managed by this environment manager + No other environment with the same name must be managed by this environment + manager """ metadata: Optional[EnvironmentMetadata] = None - """EnvironmentMetadata is data associated with an environment that's required for - + """ + EnvironmentMetadata is data associated with an environment that's required for other parts of the system to function """ spec: Optional[EnvironmentSpec] = None - """EnvironmentSpec specifies the configuration of an environment for an environment - + """ + EnvironmentSpec specifies the configuration of an environment for an environment start """ diff --git a/src/gitpod/types/environment_delete_params.py b/src/gitpod/types/environment_delete_params.py index bc66b2bb..20ce84ff 100644 --- a/src/gitpod/types/environment_delete_params.py +++ b/src/gitpod/types/environment_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,9 +10,6 @@ class EnvironmentDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies the environment that is going to delete. @@ -26,6 +23,3 @@ class EnvironmentDeleteParams(TypedDict, total=False): lifecycle is not respected. Force deleting can result in data loss on the environment. """ - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index a9449f03..29a26013 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -2,33 +2,90 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["EnvironmentListParams"] +__all__ = ["EnvironmentListParams", "Filter", "Pagination"] class EnvironmentListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool + filter: Filter + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the ID of the organization that contains the environments""" + + pagination: Pagination + """pagination contains the pagination options for listing environments""" + + +class Filter(TypedDict, total=False): + creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] """ - Specifies if the message query param is base64 encoded, which may be required - for binary data + creator_ids filters the response to only Environments created by specified + members """ - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" + project_ids: Annotated[List[str], PropertyInfo(alias="projectIds")] + """ + project_ids filters the response to only Environments associated with the + specified projects + """ - connect: Literal["v1"] - """Define the version of the Connect protocol""" + runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] + """ + runner_ids filters the response to only Environments running on these Runner IDs + """ - message: str + runner_kinds: Annotated[ + List[ + Literal[ + "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" + ] + ], + PropertyInfo(alias="runnerKinds"), + ] + """ + runner_kinds filters the response to only Environments running on these Runner + Kinds + """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + status_phases: Annotated[ + List[ + Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", + ] + ], + PropertyInfo(alias="statusPhases"), + ] + """ + actual_phases is a list of phases the environment must be in for it to be + returned in the API call + """ + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py index 16e8fa8a..b193d660 100644 --- a/src/gitpod/types/environment_list_response.py +++ b/src/gitpod/types/environment_list_response.py @@ -69,14 +69,14 @@ class EnvironmentMetadataCreator(BaseModel): class EnvironmentMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None - """annotations are key/value pairs that gets attached to the environment. - + """ + annotations are key/value pairs that gets attached to the environment. +internal - not yet implemented """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -170,8 +170,8 @@ class EnvironmentMetadata(BaseModel): """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -268,8 +268,8 @@ class EnvironmentMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """original_context_url is the normalized URL from which the environment was - + """ + original_context_url is the normalized URL from which the environment was created """ @@ -287,9 +287,8 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, - - relative to the repo root. path must not be absolute (start with a /): + environment, relative to the repo root. path must not be absolute (start with a + /): ``` this.matches('^$|^[^/].*') @@ -310,9 +309,8 @@ class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) @@ -588,15 +586,15 @@ class EnvironmentSpec(BaseModel): class EnvironmentStatusActivitySignal(BaseModel): source: Optional[str] = None - """source of the activity signal, such as "VS Code", "SSH", or "Automations". - - It should be a human-readable string that describes the source of the activity + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity signal. """ timestamp: Optional[datetime] = None - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -703,8 +701,8 @@ class EnvironmentStatusAutomationsFile(BaseModel): """ failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the automations file failed to be applied. - + """ + failure_message contains the reason the automations file failed to be applied. This is only set if the phase is FAILED. """ @@ -753,8 +751,8 @@ class EnvironmentStatusContentGit(BaseModel): changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( alias="changedFiles", default=None ) - """changed_files is an array of changed files in the environment, possibly - + """ + changed_files is an array of changed files in the environment, possibly truncated """ @@ -773,8 +771,8 @@ class EnvironmentStatusContentGit(BaseModel): """the total number of unpushed changes""" unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """unpushed_commits is an array of unpushed changes in the environment, possibly - + """ + unpushed_commits is an array of unpushed changes in the environment, possibly truncated """ @@ -928,9 +926,9 @@ class EnvironmentStatusMachine(BaseModel): """session is the session that is currently active in the machine.""" timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. If this field is + """timeout contains the reason the environment has timed out. - empty, the environment has not timed out. + If this field is empty, the environment has not timed out. """ versions: Optional[EnvironmentStatusMachineVersions] = None @@ -1016,18 +1014,16 @@ class EnvironmentStatus(BaseModel): """devcontainer contains the status of the devcontainer.""" environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """environment_url contains the URL at which the environment can be accessed. - - This field is only set if the environment is running. + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. """ failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the environment failed to operate. - If this is non-empty - - the environment has failed to operate and will likely transition to a stopped - state. + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. """ machine: Optional[EnvironmentStatusMachine] = None @@ -1046,14 +1042,14 @@ class EnvironmentStatus(BaseModel): "ENVIRONMENT_PHASE_DELETED", ] ] = None - """the phase of an environment is a simple, high-level summary of where the - + """ + the phase of an environment is a simple, high-level summary of where the environment is in its lifecycle """ runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """RunnerACK is the acknowledgement from the runner that is has received the - + """ + RunnerACK is the acknowledgement from the runner that is has received the environment spec. """ @@ -1081,20 +1077,21 @@ class EnvironmentStatus(BaseModel): class Environment(BaseModel): id: Optional[str] = None - """ID is a unique identifier of this environment. No other environment with the + """ID is a unique identifier of this environment. - same name must be managed by this environment manager + No other environment with the same name must be managed by this environment + manager """ metadata: Optional[EnvironmentMetadata] = None - """EnvironmentMetadata is data associated with an environment that's required for - + """ + EnvironmentMetadata is data associated with an environment that's required for other parts of the system to function """ spec: Optional[EnvironmentSpec] = None - """EnvironmentSpec specifies the configuration of an environment for an environment - + """ + EnvironmentSpec specifies the configuration of an environment for an environment start """ @@ -1104,9 +1101,9 @@ class Environment(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/environment_mark_active_params.py b/src/gitpod/types/environment_mark_active_params.py index bbab16b5..c88cd10d 100644 --- a/src/gitpod/types/environment_mark_active_params.py +++ b/src/gitpod/types/environment_mark_active_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -12,30 +12,24 @@ class EnvironmentMarkActiveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - activity_signal: Annotated[ActivitySignal, PropertyInfo(alias="activitySignal")] """EnvironmentActivitySignal used to signal activity for an environment.""" environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """The ID of the environment to update activity for.""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class ActivitySignal(TypedDict, total=False): source: str - """source of the activity signal, such as "VS Code", "SSH", or "Automations". - - It should be a human-readable string that describes the source of the activity + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity signal. """ timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/environment_retrieve_params.py b/src/gitpod/types/environment_retrieve_params.py index a06329ae..7be510e5 100644 --- a/src/gitpod/types/environment_retrieve_params.py +++ b/src/gitpod/types/environment_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class EnvironmentRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies the environment to get""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index f4b32ccb..5c40baec 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -68,14 +68,14 @@ class EnvironmentMetadataCreator(BaseModel): class EnvironmentMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None - """annotations are key/value pairs that gets attached to the environment. - + """ + annotations are key/value pairs that gets attached to the environment. +internal - not yet implemented """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -169,8 +169,8 @@ class EnvironmentMetadata(BaseModel): """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -267,8 +267,8 @@ class EnvironmentMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """original_context_url is the normalized URL from which the environment was - + """ + original_context_url is the normalized URL from which the environment was created """ @@ -286,9 +286,8 @@ class EnvironmentSpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the - environment, - - relative to the repo root. path must not be absolute (start with a /): + environment, relative to the repo root. path must not be absolute (start with a + /): ``` this.matches('^$|^[^/].*') @@ -309,9 +308,8 @@ class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) @@ -587,15 +585,15 @@ class EnvironmentSpec(BaseModel): class EnvironmentStatusActivitySignal(BaseModel): source: Optional[str] = None - """source of the activity signal, such as "VS Code", "SSH", or "Automations". - - It should be a human-readable string that describes the source of the activity + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity signal. """ timestamp: Optional[datetime] = None - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -702,8 +700,8 @@ class EnvironmentStatusAutomationsFile(BaseModel): """ failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the automations file failed to be applied. - + """ + failure_message contains the reason the automations file failed to be applied. This is only set if the phase is FAILED. """ @@ -752,8 +750,8 @@ class EnvironmentStatusContentGit(BaseModel): changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( alias="changedFiles", default=None ) - """changed_files is an array of changed files in the environment, possibly - + """ + changed_files is an array of changed files in the environment, possibly truncated """ @@ -772,8 +770,8 @@ class EnvironmentStatusContentGit(BaseModel): """the total number of unpushed changes""" unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """unpushed_commits is an array of unpushed changes in the environment, possibly - + """ + unpushed_commits is an array of unpushed changes in the environment, possibly truncated """ @@ -927,9 +925,9 @@ class EnvironmentStatusMachine(BaseModel): """session is the session that is currently active in the machine.""" timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. If this field is + """timeout contains the reason the environment has timed out. - empty, the environment has not timed out. + If this field is empty, the environment has not timed out. """ versions: Optional[EnvironmentStatusMachineVersions] = None @@ -1015,18 +1013,16 @@ class EnvironmentStatus(BaseModel): """devcontainer contains the status of the devcontainer.""" environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """environment_url contains the URL at which the environment can be accessed. - - This field is only set if the environment is running. + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. """ failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the environment failed to operate. - If this is non-empty - - the environment has failed to operate and will likely transition to a stopped - state. + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. """ machine: Optional[EnvironmentStatusMachine] = None @@ -1045,14 +1041,14 @@ class EnvironmentStatus(BaseModel): "ENVIRONMENT_PHASE_DELETED", ] ] = None - """the phase of an environment is a simple, high-level summary of where the - + """ + the phase of an environment is a simple, high-level summary of where the environment is in its lifecycle """ runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """RunnerACK is the acknowledgement from the runner that is has received the - + """ + RunnerACK is the acknowledgement from the runner that is has received the environment spec. """ @@ -1080,20 +1076,21 @@ class EnvironmentStatus(BaseModel): class Environment(BaseModel): id: Optional[str] = None - """ID is a unique identifier of this environment. No other environment with the + """ID is a unique identifier of this environment. - same name must be managed by this environment manager + No other environment with the same name must be managed by this environment + manager """ metadata: Optional[EnvironmentMetadata] = None - """EnvironmentMetadata is data associated with an environment that's required for - + """ + EnvironmentMetadata is data associated with an environment that's required for other parts of the system to function """ spec: Optional[EnvironmentSpec] = None - """EnvironmentSpec specifies the configuration of an environment for an environment - + """ + EnvironmentSpec specifies the configuration of an environment for an environment start """ diff --git a/src/gitpod/types/environment_start_params.py b/src/gitpod/types/environment_start_params.py index 7827114d..83fe0a45 100644 --- a/src/gitpod/types/environment_start_params.py +++ b/src/gitpod/types/environment_start_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class EnvironmentStartParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies which environment should be started.""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_stop_params.py b/src/gitpod/types/environment_stop_params.py index 5f2b96a9..885db41e 100644 --- a/src/gitpod/types/environment_stop_params.py +++ b/src/gitpod/types/environment_stop_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,14 +10,8 @@ class EnvironmentStopParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies which environment should be stopped. +required """ - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index be559eb5..332cd62a 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -40,22 +40,10 @@ class Variant0(TypedDict, total=False): metadata: Required[object] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant1(TypedDict, total=False): spec: Required[Variant1Spec] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot( TypedDict, total=False @@ -63,9 +51,8 @@ class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomat automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] """ automations_file_path is the path to the automations file that is applied in the - environment, - - relative to the repo root. path must not be absolute (start with a /): + environment, relative to the repo root. path must not be absolute (start with a + /): ``` this.matches('^$|^[^/].*') @@ -125,9 +112,8 @@ class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInit TypedDict, total=False ): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] diff --git a/src/gitpod/types/environments/automation_upsert_params.py b/src/gitpod/types/environments/automation_upsert_params.py index 3285979c..6c32b865 100644 --- a/src/gitpod/types/environments/automation_upsert_params.py +++ b/src/gitpod/types/environments/automation_upsert_params.py @@ -21,33 +21,23 @@ class AutomationUpsertParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - automations_file: Annotated[AutomationsFile, PropertyInfo(alias="automationsFile")] """ WARN: Do not remove any field here, as it will break reading automation yaml - files. We error if there are any - - unknown fields in the yaml (to ensure the yaml is correct), but would break if - we removed any fields. This includes marking a field as "reserved" in the proto - file, this will also break reading the yaml. + files. We error if there are any unknown fields in the yaml (to ensure the yaml + is correct), but would break if we removed any fields. This includes marking a + field as "reserved" in the proto file, this will also break reading the yaml. """ environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class AutomationsFileServicesCommands(TypedDict, total=False): ready: str """ ready is an optional command that is run repeatedly until it exits with a zero - exit code. - - If set, the service will first go into a Starting phase, and then into a Running - phase once the ready command exits with a zero exit code. + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. """ start: str @@ -62,14 +52,13 @@ class AutomationsFileServicesCommands(TypedDict, total=False): """ stop: str - """stop is an optional command that runs when the service is requested to stop. - - If set, instead of sending a SIGTERM signal to the start command, the stop - command will be run. Once the stop command exits, the start command will receive - a SIGKILL signal. If the stop command exits with a non-zero exit code, the - service will transition to the Failed phase. If the stop command does not exit - within 2 minutes, a SIGKILL signal will be sent to both the start and stop - commands. + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. """ @@ -92,7 +81,9 @@ class AutomationsFileServices(TypedDict, total=False): runs_on: Annotated[AutomationsFileServicesRunsOn, PropertyInfo(alias="runsOn")] - triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] + triggered_by: Annotated[ + List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart"]], PropertyInfo(alias="triggeredBy") + ] class AutomationsFileTasksRunsOnDocker(TypedDict, total=False): @@ -116,7 +107,9 @@ class AutomationsFileTasks(TypedDict, total=False): runs_on: Annotated[AutomationsFileTasksRunsOn, PropertyInfo(alias="runsOn")] - triggered_by: Annotated[List[str], PropertyInfo(alias="triggeredBy")] + triggered_by: Annotated[ + List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart"]], PropertyInfo(alias="triggeredBy") + ] class AutomationsFile(TypedDict, total=False): diff --git a/src/gitpod/types/environments/automations/service_create_params.py b/src/gitpod/types/environments/automations/service_create_params.py index 386d562b..5b503270 100644 --- a/src/gitpod/types/environments/automations/service_create_params.py +++ b/src/gitpod/types/environments/automations/service_create_params.py @@ -24,18 +24,12 @@ class ServiceCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] metadata: Metadata spec: Spec - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class MetadataCreator(TypedDict, total=False): id: str @@ -71,8 +65,8 @@ class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): class Metadata(TypedDict, total=False): created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -175,18 +169,14 @@ class Metadata(TypedDict, total=False): """name is a user-facing name for the service. Unlike the reference, this field is not unique, and not referenced by the - system. - - This is a short descriptive name for the service. + system. This is a short descriptive name for the service. """ reference: str """ reference is a user-facing identifier for the service which must be unique on - the environment. - - It is used to express dependencies between services, and to identify the service - in user interactions (e.g. the CLI). + the environment. It is used to express dependencies between services, and to + identify the service in user interactions (e.g. the CLI). """ triggered_by: Annotated[Iterable[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] @@ -197,10 +187,8 @@ class SpecCommands(TypedDict, total=False): ready: str """ ready is an optional command that is run repeatedly until it exits with a zero - exit code. - - If set, the service will first go into a Starting phase, and then into a Running - phase once the ready command exits with a zero exit code. + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. """ start: str @@ -215,14 +203,13 @@ class SpecCommands(TypedDict, total=False): """ stop: str - """stop is an optional command that runs when the service is requested to stop. - - If set, instead of sending a SIGTERM signal to the start command, the stop - command will be run. Once the stop command exits, the start command will receive - a SIGKILL signal. If the stop command exits with a non-zero exit code, the - service will transition to the Failed phase. If the stop command does not exit - within 2 minutes, a SIGKILL signal will be sent to both the start and stop - commands. + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. """ @@ -266,9 +253,7 @@ class Spec(TypedDict, total=False): session: str """session should be changed to trigger a restart of the service. - If a service exits it will - - not be restarted until the session is changed. + If a service exits it will not be restarted until the session is changed. """ spec_version: Annotated[str, PropertyInfo(alias="specVersion")] diff --git a/src/gitpod/types/environments/automations/service_create_response.py b/src/gitpod/types/environments/automations/service_create_response.py index 2ae3f289..5e01ca64 100644 --- a/src/gitpod/types/environments/automations/service_create_response.py +++ b/src/gitpod/types/environments/automations/service_create_response.py @@ -63,8 +63,8 @@ class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): class ServiceMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -167,18 +167,14 @@ class ServiceMetadata(BaseModel): """name is a user-facing name for the service. Unlike the reference, this field is not unique, and not referenced by the - system. - - This is a short descriptive name for the service. + system. This is a short descriptive name for the service. """ reference: Optional[str] = None """ reference is a user-facing identifier for the service which must be unique on - the environment. - - It is used to express dependencies between services, and to identify the service - in user interactions (e.g. the CLI). + the environment. It is used to express dependencies between services, and to + identify the service in user interactions (e.g. the CLI). """ triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) @@ -189,10 +185,8 @@ class ServiceSpecCommands(BaseModel): ready: Optional[str] = None """ ready is an optional command that is run repeatedly until it exits with a zero - exit code. - - If set, the service will first go into a Starting phase, and then into a Running - phase once the ready command exits with a zero exit code. + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. """ start: Optional[str] = None @@ -207,14 +201,13 @@ class ServiceSpecCommands(BaseModel): """ stop: Optional[str] = None - """stop is an optional command that runs when the service is requested to stop. - - If set, instead of sending a SIGTERM signal to the start command, the stop - command will be run. Once the stop command exits, the start command will receive - a SIGKILL signal. If the stop command exits with a non-zero exit code, the - service will transition to the Failed phase. If the stop command does not exit - within 2 minutes, a SIGKILL signal will be sent to both the start and stop - commands. + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. """ @@ -257,9 +250,7 @@ class ServiceSpec(BaseModel): session: Optional[str] = None """session should be changed to trigger a restart of the service. - If a service exits it will - - not be restarted until the session is changed. + If a service exits it will not be restarted until the session is changed. """ spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) @@ -275,9 +266,8 @@ class ServiceStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the service failed to operate. - If this is non-empty - - the service has failed to operate and will likely transition to a failed state. + If this is non-empty the service has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) diff --git a/src/gitpod/types/environments/automations/service_delete_params.py b/src/gitpod/types/environments/automations/service_delete_params.py index 11a2198a..2fc5f3d7 100644 --- a/src/gitpod/types/environments/automations/service_delete_params.py +++ b/src/gitpod/types/environments/automations/service_delete_params.py @@ -2,20 +2,12 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ServiceDeleteParams"] class ServiceDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str force: bool - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py index f368c316..c2c08b03 100644 --- a/src/gitpod/types/environments/automations/service_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -2,33 +2,46 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["ServiceListParams"] +__all__ = ["ServiceListParams", "Filter", "Pagination"] class ServiceListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + filter: Filter + """filter contains the filter options for listing services""" + + pagination: Pagination + """pagination contains the pagination options for listing services""" + + +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only services of these environments""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" + references: List[str] + """references filters the response to only services with these references""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" + service_ids: Annotated[List[str], PropertyInfo(alias="serviceIds")] + """service_ids filters the response to only services with these IDs""" - message: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environments/automations/service_list_response.py b/src/gitpod/types/environments/automations/service_list_response.py index 3ee87638..6eb25a7c 100644 --- a/src/gitpod/types/environments/automations/service_list_response.py +++ b/src/gitpod/types/environments/automations/service_list_response.py @@ -28,9 +28,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ @@ -72,8 +72,8 @@ class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): class ServiceMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -176,18 +176,14 @@ class ServiceMetadata(BaseModel): """name is a user-facing name for the service. Unlike the reference, this field is not unique, and not referenced by the - system. - - This is a short descriptive name for the service. + system. This is a short descriptive name for the service. """ reference: Optional[str] = None """ reference is a user-facing identifier for the service which must be unique on - the environment. - - It is used to express dependencies between services, and to identify the service - in user interactions (e.g. the CLI). + the environment. It is used to express dependencies between services, and to + identify the service in user interactions (e.g. the CLI). """ triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) @@ -198,10 +194,8 @@ class ServiceSpecCommands(BaseModel): ready: Optional[str] = None """ ready is an optional command that is run repeatedly until it exits with a zero - exit code. - - If set, the service will first go into a Starting phase, and then into a Running - phase once the ready command exits with a zero exit code. + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. """ start: Optional[str] = None @@ -216,14 +210,13 @@ class ServiceSpecCommands(BaseModel): """ stop: Optional[str] = None - """stop is an optional command that runs when the service is requested to stop. - - If set, instead of sending a SIGTERM signal to the start command, the stop - command will be run. Once the stop command exits, the start command will receive - a SIGKILL signal. If the stop command exits with a non-zero exit code, the - service will transition to the Failed phase. If the stop command does not exit - within 2 minutes, a SIGKILL signal will be sent to both the start and stop - commands. + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. """ @@ -266,9 +259,7 @@ class ServiceSpec(BaseModel): session: Optional[str] = None """session should be changed to trigger a restart of the service. - If a service exits it will - - not be restarted until the session is changed. + If a service exits it will not be restarted until the session is changed. """ spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) @@ -284,9 +275,8 @@ class ServiceStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the service failed to operate. - If this is non-empty - - the service has failed to operate and will likely transition to a failed state. + If this is non-empty the service has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) diff --git a/src/gitpod/types/environments/automations/service_retrieve_params.py b/src/gitpod/types/environments/automations/service_retrieve_params.py index 247621f6..857888ae 100644 --- a/src/gitpod/types/environments/automations/service_retrieve_params.py +++ b/src/gitpod/types/environments/automations/service_retrieve_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ServiceRetrieveParams"] class ServiceRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_retrieve_response.py b/src/gitpod/types/environments/automations/service_retrieve_response.py index 70832cbd..6a83eb94 100644 --- a/src/gitpod/types/environments/automations/service_retrieve_response.py +++ b/src/gitpod/types/environments/automations/service_retrieve_response.py @@ -63,8 +63,8 @@ class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): class ServiceMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -167,18 +167,14 @@ class ServiceMetadata(BaseModel): """name is a user-facing name for the service. Unlike the reference, this field is not unique, and not referenced by the - system. - - This is a short descriptive name for the service. + system. This is a short descriptive name for the service. """ reference: Optional[str] = None """ reference is a user-facing identifier for the service which must be unique on - the environment. - - It is used to express dependencies between services, and to identify the service - in user interactions (e.g. the CLI). + the environment. It is used to express dependencies between services, and to + identify the service in user interactions (e.g. the CLI). """ triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) @@ -189,10 +185,8 @@ class ServiceSpecCommands(BaseModel): ready: Optional[str] = None """ ready is an optional command that is run repeatedly until it exits with a zero - exit code. - - If set, the service will first go into a Starting phase, and then into a Running - phase once the ready command exits with a zero exit code. + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. """ start: Optional[str] = None @@ -207,14 +201,13 @@ class ServiceSpecCommands(BaseModel): """ stop: Optional[str] = None - """stop is an optional command that runs when the service is requested to stop. - - If set, instead of sending a SIGTERM signal to the start command, the stop - command will be run. Once the stop command exits, the start command will receive - a SIGKILL signal. If the stop command exits with a non-zero exit code, the - service will transition to the Failed phase. If the stop command does not exit - within 2 minutes, a SIGKILL signal will be sent to both the start and stop - commands. + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. """ @@ -257,9 +250,7 @@ class ServiceSpec(BaseModel): session: Optional[str] = None """session should be changed to trigger a restart of the service. - If a service exits it will - - not be restarted until the session is changed. + If a service exits it will not be restarted until the session is changed. """ spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) @@ -275,9 +266,8 @@ class ServiceStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the service failed to operate. - If this is non-empty - - the service has failed to operate and will likely transition to a failed state. + If this is non-empty the service has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) diff --git a/src/gitpod/types/environments/automations/service_start_params.py b/src/gitpod/types/environments/automations/service_start_params.py index 69eee8a0..237ab1e7 100644 --- a/src/gitpod/types/environments/automations/service_start_params.py +++ b/src/gitpod/types/environments/automations/service_start_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ServiceStartParams"] class ServiceStartParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_stop_params.py b/src/gitpod/types/environments/automations/service_stop_params.py index a86b4148..fcb5e253 100644 --- a/src/gitpod/types/environments/automations/service_stop_params.py +++ b/src/gitpod/types/environments/automations/service_stop_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ServiceStopParams"] class ServiceStopParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index e31fb35d..d45d4ce5 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -36,32 +36,24 @@ class ServiceUpdateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str metadata: Metadata spec: Spec - """Changing the spec of a service is a complex operation. The spec of a service + """Changing the spec of a service is a complex operation. - can only be updated if the service is in a stopped state. If the service is - running, it must be stopped first. + The spec of a service can only be updated if the service is in a stopped state. + If the service is running, it must be stopped first. """ status: Status """Service status updates are only expected from the executing environment. - As a client - - of this API you are not expected to provide this field. Updating this field - requires the `environmentservice:update_status` permission. + As a client of this API you are not expected to provide this field. Updating + this field requires the `environmentservice:update_status` permission. """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class MetadataDescription(TypedDict, total=False): description: Required[str] diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index a1d9bf64..f7454900 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -23,9 +23,6 @@ class TaskCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] environment_id: Annotated[str, PropertyInfo(alias="environmentId")] @@ -34,9 +31,6 @@ class TaskCreateParams(TypedDict, total=False): spec: Spec - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class MetadataCreator(TypedDict, total=False): id: str @@ -72,8 +66,8 @@ class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): class Metadata(TypedDict, total=False): created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -176,18 +170,14 @@ class Metadata(TypedDict, total=False): """name is a user-facing name for the task. Unlike the reference, this field is not unique, and not referenced by the - system. - - This is a short descriptive name for the task. + system. This is a short descriptive name for the task. """ reference: str """ reference is a user-facing identifier for the task which must be unique on the - environment. - - It is used to express dependencies between tasks, and to identify the task in - user interactions (e.g. the CLI). + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). """ triggered_by: Annotated[Iterable[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index 3a91f48b..22c1db51 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -61,8 +61,8 @@ class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -165,18 +165,14 @@ class TaskMetadata(BaseModel): """name is a user-facing name for the task. Unlike the reference, this field is not unique, and not referenced by the - system. - - This is a short descriptive name for the task. + system. This is a short descriptive name for the task. """ reference: Optional[str] = None """ reference is a user-facing identifier for the task which must be unique on the - environment. - - It is used to express dependencies between tasks, and to identify the task in - user interactions (e.g. the CLI). + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). """ triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) diff --git a/src/gitpod/types/environments/automations/task_delete_params.py b/src/gitpod/types/environments/automations/task_delete_params.py index 2c11ff0c..d1e4073d 100644 --- a/src/gitpod/types/environments/automations/task_delete_params.py +++ b/src/gitpod/types/environments/automations/task_delete_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TaskDeleteParams"] class TaskDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_list_params.py b/src/gitpod/types/environments/automations/task_list_params.py index 4a4900b8..7afc694b 100644 --- a/src/gitpod/types/environments/automations/task_list_params.py +++ b/src/gitpod/types/environments/automations/task_list_params.py @@ -2,33 +2,46 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["TaskListParams"] +__all__ = ["TaskListParams", "Filter", "Pagination"] class TaskListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + filter: Filter + """filter contains the filter options for listing tasks""" + + pagination: Pagination + """pagination contains the pagination options for listing tasks""" + + +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only tasks of these environments""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" + references: List[str] + """references filters the response to only services with these references""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" + task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] + """task_ids filters the response to only tasks with these IDs""" - message: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environments/automations/task_list_response.py b/src/gitpod/types/environments/automations/task_list_response.py index eebde115..e27ba172 100644 --- a/src/gitpod/types/environments/automations/task_list_response.py +++ b/src/gitpod/types/environments/automations/task_list_response.py @@ -26,9 +26,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ @@ -70,8 +70,8 @@ class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -174,18 +174,14 @@ class TaskMetadata(BaseModel): """name is a user-facing name for the task. Unlike the reference, this field is not unique, and not referenced by the - system. - - This is a short descriptive name for the task. + system. This is a short descriptive name for the task. """ reference: Optional[str] = None """ reference is a user-facing identifier for the task which must be unique on the - environment. - - It is used to express dependencies between tasks, and to identify the task in - user interactions (e.g. the CLI). + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). """ triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) diff --git a/src/gitpod/types/environments/automations/task_retrieve_params.py b/src/gitpod/types/environments/automations/task_retrieve_params.py index b0d4d35b..acd7ec7a 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_params.py +++ b/src/gitpod/types/environments/automations/task_retrieve_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TaskRetrieveParams"] class TaskRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index a9b4c055..cd0c4d61 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -61,8 +61,8 @@ class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -165,18 +165,14 @@ class TaskMetadata(BaseModel): """name is a user-facing name for the task. Unlike the reference, this field is not unique, and not referenced by the - system. - - This is a short descriptive name for the task. + system. This is a short descriptive name for the task. """ reference: Optional[str] = None """ reference is a user-facing identifier for the task which must be unique on the - environment. - - It is used to express dependencies between tasks, and to identify the task in - user interactions (e.g. the CLI). + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). """ triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) diff --git a/src/gitpod/types/environments/automations/task_start_params.py b/src/gitpod/types/environments/automations/task_start_params.py index 222ca23f..e9b47035 100644 --- a/src/gitpod/types/environments/automations/task_start_params.py +++ b/src/gitpod/types/environments/automations/task_start_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TaskStartParams"] class TaskStartParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py index 35d969e0..9aee77c7 100644 --- a/src/gitpod/types/environments/automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -46,8 +46,8 @@ class TaskExecutionMetadataCreator(BaseModel): class TaskExecutionMetadata(BaseModel): completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -138,8 +138,8 @@ class TaskExecutionMetadata(BaseModel): """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -236,8 +236,8 @@ class TaskExecutionMetadata(BaseModel): """environment_id is the ID of the environment in which the task run is executed.""" started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -409,9 +409,7 @@ class TaskExecutionSpec(BaseModel): """plan is a list of groups of steps. The steps in a group are executed concurrently, while the groups are executed - sequentially. - - The order of the groups is the order in which they are executed. + sequentially. The order of the groups is the order in which they are executed. """ @@ -420,9 +418,10 @@ class TaskExecutionStatusStep(BaseModel): """ID is the ID of the execution step""" failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. If this is non-empty + """failure_message summarises why the step failed to operate. - the step has failed to operate and will likely transition to a failed state. + If this is non-empty the step has failed to operate and will likely transition + to a failed state. """ phase: Optional[ @@ -442,18 +441,14 @@ class TaskExecutionStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the task execution failed to operate. - If this is non-empty - - the task execution has failed to operate and will likely transition to a failed - state. + If this is non-empty the task execution has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) """log_url is the URL to the logs of the task's steps. - If this is empty, the task either has no logs - - or has not yet started. + If this is empty, the task either has no logs or has not yet started. """ phase: Optional[ @@ -480,9 +475,7 @@ class TaskExecutionStatus(BaseModel): steps: Optional[List[TaskExecutionStatusStep]] = None """steps provides the status for each individual step of the task execution. - If a step is missing it - - has not yet started. + If a step is missing it has not yet started. """ diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index adb1ba2e..8ac5aae1 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -27,9 +27,6 @@ class TaskUpdateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] @@ -39,9 +36,6 @@ class TaskUpdateParams(TypedDict, total=False): spec: Spec - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class MetadataDescription(TypedDict, total=False): description: Required[str] diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_params.py b/src/gitpod/types/environments/automations/tasks/execution_list_params.py index 824e42ee..37ad2559 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_list_params.py +++ b/src/gitpod/types/environments/automations/tasks/execution_list_params.py @@ -2,33 +2,58 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List +from typing_extensions import Literal, Annotated, TypedDict from ....._utils import PropertyInfo -__all__ = ["ExecutionListParams"] +__all__ = ["ExecutionListParams", "Filter", "Pagination"] class ExecutionListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + filter: Filter + """filter contains the filter options for listing task runs""" + + pagination: Pagination + """pagination contains the pagination options for listing task runs""" + + +class Filter(TypedDict, total=False): + environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + """environment_ids filters the response to only task runs of these environments""" + + phases: List[ + Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", + ] + ] + """phases filters the response to only task runs in these phases""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" + task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] + """task_ids filters the response to only task runs of these tasks""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" + task_references: Annotated[List[str], PropertyInfo(alias="taskReferences")] + """task_references filters the response to only task runs with this reference""" - message: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_response.py b/src/gitpod/types/environments/automations/tasks/execution_list_response.py index 8a862ecb..74fc66a3 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_list_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_list_response.py @@ -30,9 +30,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ @@ -55,8 +55,8 @@ class TaskExecutionMetadataCreator(BaseModel): class TaskExecutionMetadata(BaseModel): completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -147,8 +147,8 @@ class TaskExecutionMetadata(BaseModel): """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -245,8 +245,8 @@ class TaskExecutionMetadata(BaseModel): """environment_id is the ID of the environment in which the task run is executed.""" started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -418,9 +418,7 @@ class TaskExecutionSpec(BaseModel): """plan is a list of groups of steps. The steps in a group are executed concurrently, while the groups are executed - sequentially. - - The order of the groups is the order in which they are executed. + sequentially. The order of the groups is the order in which they are executed. """ @@ -429,9 +427,10 @@ class TaskExecutionStatusStep(BaseModel): """ID is the ID of the execution step""" failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. If this is non-empty + """failure_message summarises why the step failed to operate. - the step has failed to operate and will likely transition to a failed state. + If this is non-empty the step has failed to operate and will likely transition + to a failed state. """ phase: Optional[ @@ -451,18 +450,14 @@ class TaskExecutionStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the task execution failed to operate. - If this is non-empty - - the task execution has failed to operate and will likely transition to a failed - state. + If this is non-empty the task execution has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) """log_url is the URL to the logs of the task's steps. - If this is empty, the task either has no logs - - or has not yet started. + If this is empty, the task either has no logs or has not yet started. """ phase: Optional[ @@ -489,9 +484,7 @@ class TaskExecutionStatus(BaseModel): steps: Optional[List[TaskExecutionStatusStep]] = None """steps provides the status for each individual step of the task execution. - If a step is missing it - - has not yet started. + If a step is missing it has not yet started. """ diff --git a/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py index 2d751ff9..85fa9fc4 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ....._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ExecutionRetrieveParams"] class ExecutionRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py index b42c9e35..99ff0295 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py @@ -46,8 +46,8 @@ class TaskExecutionMetadataCreator(BaseModel): class TaskExecutionMetadata(BaseModel): completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -138,8 +138,8 @@ class TaskExecutionMetadata(BaseModel): """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -236,8 +236,8 @@ class TaskExecutionMetadata(BaseModel): """environment_id is the ID of the environment in which the task run is executed.""" started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -409,9 +409,7 @@ class TaskExecutionSpec(BaseModel): """plan is a list of groups of steps. The steps in a group are executed concurrently, while the groups are executed - sequentially. - - The order of the groups is the order in which they are executed. + sequentially. The order of the groups is the order in which they are executed. """ @@ -420,9 +418,10 @@ class TaskExecutionStatusStep(BaseModel): """ID is the ID of the execution step""" failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. If this is non-empty + """failure_message summarises why the step failed to operate. - the step has failed to operate and will likely transition to a failed state. + If this is non-empty the step has failed to operate and will likely transition + to a failed state. """ phase: Optional[ @@ -442,18 +441,14 @@ class TaskExecutionStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the task execution failed to operate. - If this is non-empty - - the task execution has failed to operate and will likely transition to a failed - state. + If this is non-empty the task execution has failed to operate and will likely + transition to a failed state. """ log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) """log_url is the URL to the logs of the task's steps. - If this is empty, the task either has no logs - - or has not yet started. + If this is empty, the task either has no logs or has not yet started. """ phase: Optional[ @@ -480,9 +475,7 @@ class TaskExecutionStatus(BaseModel): steps: Optional[List[TaskExecutionStatusStep]] = None """steps provides the status for each individual step of the task execution. - If a step is missing it - - has not yet started. + If a step is missing it has not yet started. """ diff --git a/src/gitpod/types/environments/automations/tasks/execution_stop_params.py b/src/gitpod/types/environments/automations/tasks/execution_stop_params.py index 496a5e81..9a5188e2 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_stop_params.py +++ b/src/gitpod/types/environments/automations/tasks/execution_stop_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ....._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ExecutionStopParams"] class ExecutionStopParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/environments/class_list_params.py b/src/gitpod/types/environments/class_list_params.py index e7ee63fa..ca0eaf4c 100644 --- a/src/gitpod/types/environments/class_list_params.py +++ b/src/gitpod/types/environments/class_list_params.py @@ -2,33 +2,41 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["ClassListParams"] +__all__ = ["ClassListParams", "Filter", "Pagination"] class ClassListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool + filter: Filter + + pagination: Pagination + """pagination contains the pagination options for listing environment classes""" + + +class Filter(TypedDict, total=False): + enabled: Required[bool] """ - Specifies if the message query param is base64 encoded, which may be required - for binary data + enabled filters the response to only enabled or disabled environment classes. If + not set, all environment classes are returned. """ - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/environments/class_list_response.py b/src/gitpod/types/environments/class_list_response.py index b097e929..3152499a 100644 --- a/src/gitpod/types/environments/class_list_response.py +++ b/src/gitpod/types/environments/class_list_response.py @@ -29,9 +29,9 @@ class EnvironmentClass(BaseModel): """display_name is the human readable name of the environment class""" enabled: Optional[bool] = None - """enabled indicates whether the environment class can be used to create - - new environments. + """ + enabled indicates whether the environment class can be used to create new + environments. """ runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) @@ -43,9 +43,9 @@ class EnvironmentClass(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/event_list_params.py b/src/gitpod/types/event_list_params.py index 2a529ee2..7339620d 100644 --- a/src/gitpod/types/event_list_params.py +++ b/src/gitpod/types/event_list_params.py @@ -2,33 +2,80 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["EventListParams"] +__all__ = ["EventListParams", "Filter", "Pagination"] class EventListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + filter: Filter + + pagination: Pagination + """pagination contains the pagination options for listing environments""" + + +class Filter(TypedDict, total=False): + actor_ids: Annotated[List[str], PropertyInfo(alias="actorIds")] + + actor_principals: Annotated[ + List[ + Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", + ] + ], + PropertyInfo(alias="actorPrincipals"), + ] - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" + subject_ids: Annotated[List[str], PropertyInfo(alias="subjectIds")] - connect: Literal["v1"] - """Define the version of the Connect protocol""" + subject_types: Annotated[ + List[ + Literal[ + "RESOURCE_TYPE_UNSPECIFIED", + "RESOURCE_TYPE_ENVIRONMENT", + "RESOURCE_TYPE_RUNNER", + "RESOURCE_TYPE_PROJECT", + "RESOURCE_TYPE_TASK", + "RESOURCE_TYPE_TASK_EXECUTION", + "RESOURCE_TYPE_SERVICE", + "RESOURCE_TYPE_ORGANIZATION", + "RESOURCE_TYPE_USER", + "RESOURCE_TYPE_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION", + "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN", + "RESOURCE_TYPE_GROUP", + "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN", + "RESOURCE_TYPE_USER_PREFERENCE", + "RESOURCE_TYPE_SERVICE_ACCOUNT", + "RESOURCE_TYPE_SECRET", + "RESOURCE_TYPE_SSO_CONFIG", + ] + ], + PropertyInfo(alias="subjectTypes"), + ] - message: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/event_list_response.py b/src/gitpod/types/event_list_response.py index a47dd0af..58f31f1a 100644 --- a/src/gitpod/types/event_list_response.py +++ b/src/gitpod/types/event_list_response.py @@ -30,8 +30,8 @@ class Entry(BaseModel): ] = FieldInfo(alias="actorPrincipal", default=None) created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -149,9 +149,9 @@ class Entry(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/event_watch_params.py b/src/gitpod/types/event_watch_params.py index 1303a6a3..77d30929 100644 --- a/src/gitpod/types/event_watch_params.py +++ b/src/gitpod/types/event_watch_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo @@ -20,34 +20,20 @@ class EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecution environment_id: Required[Annotated[str, PropertyInfo(alias="environmentId")]] """ Environment scope produces events for the environment itself, all tasks, task - executions, - - and services associated with that environment. + executions, and services associated with that environment. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued( TypedDict, total=False ): organization: Required[bool] - """Organization scope produces events for all projects, runners and environments - + """ + Organization scope produces events for all projects, runners and environments the caller can see within their organization. No task, task execution or service events are produed. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - EventWatchParams: TypeAlias = Union[ EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment, diff --git a/src/gitpod/types/group_list_params.py b/src/gitpod/types/group_list_params.py index f10ea98e..9b7e7e8e 100644 --- a/src/gitpod/types/group_list_params.py +++ b/src/gitpod/types/group_list_params.py @@ -2,33 +2,31 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["GroupListParams"] +__all__ = ["GroupListParams", "Pagination"] class GroupListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + pagination: Pagination + """pagination contains the pagination options for listing groups""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/group_list_response.py b/src/gitpod/types/group_list_response.py index c07f53d1..7a6ab457 100644 --- a/src/gitpod/types/group_list_response.py +++ b/src/gitpod/types/group_list_response.py @@ -14,8 +14,8 @@ class Group(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -113,8 +113,8 @@ class Group(BaseModel): """system_managed indicates that this group is created by the system automatically""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -207,9 +207,9 @@ class Group(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/identity_exchange_token_params.py b/src/gitpod/types/identity_exchange_token_params.py index bb8becb3..e9114bd6 100644 --- a/src/gitpod/types/identity_exchange_token_params.py +++ b/src/gitpod/types/identity_exchange_token_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class IdentityExchangeTokenParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - exchange_token: Annotated[str, PropertyInfo(alias="exchangeToken")] """exchange_token is the token to exchange""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_authenticated_identity_params.py b/src/gitpod/types/identity_get_authenticated_identity_params.py index 457fe1f9..43dd9519 100644 --- a/src/gitpod/types/identity_get_authenticated_identity_params.py +++ b/src/gitpod/types/identity_get_authenticated_identity_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo +from typing_extensions import Required, TypedDict __all__ = ["IdentityGetAuthenticatedIdentityParams"] class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False): body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/identity_get_id_token_params.py b/src/gitpod/types/identity_get_id_token_params.py index 7291a3b6..e1d4c821 100644 --- a/src/gitpod/types/identity_get_id_token_params.py +++ b/src/gitpod/types/identity_get_id_token_params.py @@ -3,18 +3,10 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["IdentityGetIDTokenParams"] class IdentityGetIDTokenParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - audience: List[str] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_create_params.py b/src/gitpod/types/organization_create_params.py index e21c4e11..d31cc896 100644 --- a/src/gitpod/types/organization_create_params.py +++ b/src/gitpod/types/organization_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,9 +10,6 @@ class OrganizationCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - invite_accounts_with_matching_domain: Annotated[bool, PropertyInfo(alias="inviteAccountsWithMatchingDomain")] """ Should other Accounts with the same domain be automatically invited to the @@ -27,6 +24,3 @@ class OrganizationCreateParams(TypedDict, total=False): name: str """name is the organization name""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_create_response.py b/src/gitpod/types/organization_create_response.py index 4d0e78c0..c4ff11e4 100644 --- a/src/gitpod/types/organization_create_response.py +++ b/src/gitpod/types/organization_create_response.py @@ -22,8 +22,8 @@ class Member(BaseModel): """login_provider is the login provider the user uses to sign in""" member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -133,8 +133,8 @@ class Organization(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -229,8 +229,8 @@ class Organization(BaseModel): name: Optional[str] = None updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/organization_delete_params.py b/src/gitpod/types/organization_delete_params.py index 1c08ed30..c3915562 100644 --- a/src/gitpod/types/organization_delete_params.py +++ b/src/gitpod/types/organization_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class OrganizationDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] """organization_id is the ID of the organization to delete""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_join_params.py b/src/gitpod/types/organization_join_params.py index 40550797..f70703f5 100644 --- a/src/gitpod/types/organization_join_params.py +++ b/src/gitpod/types/organization_join_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo @@ -18,23 +18,11 @@ class InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization(TypedDict, t invite_id: Required[Annotated[str, PropertyInfo(alias="inviteId")]] """invite_id is the unique identifier of the invite to join the organization.""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin(TypedDict, total=False): organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organization_id is the unique identifier of the Organization to join.""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - OrganizationJoinParams: TypeAlias = Union[ InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization, diff --git a/src/gitpod/types/organization_join_response.py b/src/gitpod/types/organization_join_response.py index 3ea1469d..da8cff5d 100644 --- a/src/gitpod/types/organization_join_response.py +++ b/src/gitpod/types/organization_join_response.py @@ -22,8 +22,8 @@ class Member(BaseModel): """login_provider is the login provider the user uses to sign in""" member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/organization_leave_params.py b/src/gitpod/types/organization_leave_params.py index 4fe19ee5..c2c29933 100644 --- a/src/gitpod/types/organization_leave_params.py +++ b/src/gitpod/types/organization_leave_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class OrganizationLeaveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - user_id: Annotated[str, PropertyInfo(alias="userId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index ab47dac1..9c03562d 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -2,33 +2,34 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["OrganizationListMembersParams"] +__all__ = ["OrganizationListMembersParams", "Pagination"] class OrganizationListMembersParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the ID of the organization to list members for""" + + pagination: Pagination + """pagination contains the pagination options for listing members""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/organization_list_members_response.py b/src/gitpod/types/organization_list_members_response.py index 63fcc10a..5fce990c 100644 --- a/src/gitpod/types/organization_list_members_response.py +++ b/src/gitpod/types/organization_list_members_response.py @@ -22,8 +22,8 @@ class Member(BaseModel): """login_provider is the login provider the user uses to sign in""" member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -126,9 +126,9 @@ class Member(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/organization_list_params.py b/src/gitpod/types/organization_list_params.py index 2daac43b..34b6434c 100644 --- a/src/gitpod/types/organization_list_params.py +++ b/src/gitpod/types/organization_list_params.py @@ -2,33 +2,34 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["OrganizationListParams"] +__all__ = ["OrganizationListParams", "Pagination"] class OrganizationListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + pagination: Pagination + """pagination contains the pagination options for listing organizations""" + + scope: Literal["SCOPE_UNSPECIFIED", "SCOPE_MEMBER", "SCOPE_ALL"] + """scope is the scope of the organizations to list""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/organization_list_response.py b/src/gitpod/types/organization_list_response.py index 8232fcc8..753f469a 100644 --- a/src/gitpod/types/organization_list_response.py +++ b/src/gitpod/types/organization_list_response.py @@ -19,8 +19,8 @@ class Organization(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -115,8 +115,8 @@ class Organization(BaseModel): name: Optional[str] = None updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -209,9 +209,9 @@ class Organization(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/organization_retrieve_params.py b/src/gitpod/types/organization_retrieve_params.py index f9526f62..69947191 100644 --- a/src/gitpod/types/organization_retrieve_params.py +++ b/src/gitpod/types/organization_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class OrganizationRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] """organization_id is the unique identifier of the Organization to retreive.""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_retrieve_response.py b/src/gitpod/types/organization_retrieve_response.py index 998839c3..b6457360 100644 --- a/src/gitpod/types/organization_retrieve_response.py +++ b/src/gitpod/types/organization_retrieve_response.py @@ -19,8 +19,8 @@ class Organization(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -115,8 +115,8 @@ class Organization(BaseModel): name: Optional[str] = None updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/organization_set_role_params.py b/src/gitpod/types/organization_set_role_params.py index fbd10649..1a81fb4a 100644 --- a/src/gitpod/types/organization_set_role_params.py +++ b/src/gitpod/types/organization_set_role_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,14 +10,8 @@ class OrganizationSetRoleParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] user_id: Annotated[str, PropertyInfo(alias="userId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organization_update_params.py b/src/gitpod/types/organization_update_params.py index 51f2345f..096c5942 100644 --- a/src/gitpod/types/organization_update_params.py +++ b/src/gitpod/types/organization_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo @@ -21,12 +21,6 @@ class InviteDomainsIsTheDomainAllowlistOfTheOrganization(TypedDict, total=False) ] """invite_domains is the domain allowlist of the organization""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains(TypedDict, total=False): domains: List[str] @@ -37,12 +31,6 @@ class NameIsTheNewNameOfTheOrganization(TypedDict, total=False): name: Required[str] """name is the new name of the organization""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - OrganizationUpdateParams: TypeAlias = Union[ InviteDomainsIsTheDomainAllowlistOfTheOrganization, NameIsTheNewNameOfTheOrganization diff --git a/src/gitpod/types/organization_update_response.py b/src/gitpod/types/organization_update_response.py index 314e1e8b..c3a2f977 100644 --- a/src/gitpod/types/organization_update_response.py +++ b/src/gitpod/types/organization_update_response.py @@ -19,8 +19,8 @@ class Organization(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -115,8 +115,8 @@ class Organization(BaseModel): name: Optional[str] = None updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/organizations/invite_create_params.py b/src/gitpod/types/organizations/invite_create_params.py index 1cd14a51..7caa9f48 100644 --- a/src/gitpod/types/organizations/invite_create_params.py +++ b/src/gitpod/types/organizations/invite_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class InviteCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_create_response.py b/src/gitpod/types/organizations/invite_create_response.py index f277e670..fb0cbbae 100644 --- a/src/gitpod/types/organizations/invite_create_response.py +++ b/src/gitpod/types/organizations/invite_create_response.py @@ -11,9 +11,9 @@ class Invite(BaseModel): invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) - """invite_id is the unique identifier of the invite to join the organization. - - Use JoinOrganization with this ID to join the organization. + """ + invite_id is the unique identifier of the invite to join the organization. Use + JoinOrganization with this ID to join the organization. """ diff --git a/src/gitpod/types/organizations/invite_get_summary_params.py b/src/gitpod/types/organizations/invite_get_summary_params.py index 33c941d1..9cbd5c90 100644 --- a/src/gitpod/types/organizations/invite_get_summary_params.py +++ b/src/gitpod/types/organizations/invite_get_summary_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class InviteGetSummaryParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - invite_id: Annotated[str, PropertyInfo(alias="inviteId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_retrieve_params.py b/src/gitpod/types/organizations/invite_retrieve_params.py index fbbeaa6d..3a6a5fd4 100644 --- a/src/gitpod/types/organizations/invite_retrieve_params.py +++ b/src/gitpod/types/organizations/invite_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class InviteRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/invite_retrieve_response.py b/src/gitpod/types/organizations/invite_retrieve_response.py index 1b2a121b..ea2cbb09 100644 --- a/src/gitpod/types/organizations/invite_retrieve_response.py +++ b/src/gitpod/types/organizations/invite_retrieve_response.py @@ -11,9 +11,9 @@ class Invite(BaseModel): invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) - """invite_id is the unique identifier of the invite to join the organization. - - Use JoinOrganization with this ID to join the organization. + """ + invite_id is the unique identifier of the invite to join the organization. Use + JoinOrganization with this ID to join the organization. """ diff --git a/src/gitpod/types/organizations/sso_configuration_create_params.py b/src/gitpod/types/organizations/sso_configuration_create_params.py index 3056bf1a..7257b9be 100644 --- a/src/gitpod/types/organizations/sso_configuration_create_params.py +++ b/src/gitpod/types/organizations/sso_configuration_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,9 +10,6 @@ class SSOConfigurationCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - client_id: Annotated[str, PropertyInfo(alias="clientId")] """client_id is the client ID of the OIDC application set on the IdP""" @@ -26,6 +23,3 @@ class SSOConfigurationCreateParams(TypedDict, total=False): """issuer_url is the URL of the IdP issuer""" organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/sso_configuration_delete_params.py b/src/gitpod/types/organizations/sso_configuration_delete_params.py index d7301f33..889b5439 100644 --- a/src/gitpod/types/organizations/sso_configuration_delete_params.py +++ b/src/gitpod/types/organizations/sso_configuration_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class SSOConfigurationDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - sso_configuration_id: Annotated[str, PropertyInfo(alias="ssoConfigurationId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/sso_configuration_list_params.py b/src/gitpod/types/organizations/sso_configuration_list_params.py index 16d4faa4..3174a67d 100644 --- a/src/gitpod/types/organizations/sso_configuration_list_params.py +++ b/src/gitpod/types/organizations/sso_configuration_list_params.py @@ -2,33 +2,33 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["SSOConfigurationListParams"] +__all__ = ["SSOConfigurationListParams", "Pagination"] class SSOConfigurationListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the ID of the organization to list SSO configurations for.""" + + pagination: Pagination - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/organizations/sso_configuration_list_response.py b/src/gitpod/types/organizations/sso_configuration_list_response.py index f0e66afc..149af0b8 100644 --- a/src/gitpod/types/organizations/sso_configuration_list_response.py +++ b/src/gitpod/types/organizations/sso_configuration_list_response.py @@ -12,9 +12,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/organizations/sso_configuration_retrieve_params.py b/src/gitpod/types/organizations/sso_configuration_retrieve_params.py index c679072c..a8afe6ea 100644 --- a/src/gitpod/types/organizations/sso_configuration_retrieve_params.py +++ b/src/gitpod/types/organizations/sso_configuration_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,11 +10,5 @@ class SSOConfigurationRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - sso_configuration_id: Annotated[str, PropertyInfo(alias="ssoConfigurationId")] """sso_configuration_id is the ID of the SSO configuration to get""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py index b550a136..47698ca7 100644 --- a/src/gitpod/types/organizations/sso_configuration_update_params.py +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -21,44 +21,20 @@ class ClientIDIsTheClientIDOfTheSSOProvider(TypedDict, total=False): client_id: Required[Annotated[str, PropertyInfo(alias="clientId")]] """client_id is the client ID of the SSO provider""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class ClientSecretIsTheClientSecretOfTheSSOProvider(TypedDict, total=False): client_secret: Required[Annotated[str, PropertyInfo(alias="clientSecret")]] """client_secret is the client secret of the SSO provider""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant2(TypedDict, total=False): email_domain: Required[Annotated[str, PropertyInfo(alias="emailDomain")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class IssuerURLIsTheURLOfTheIDPIssuer(TypedDict, total=False): issuer_url: Required[Annotated[str, PropertyInfo(alias="issuerUrl")]] """issuer_url is the URL of the IdP issuer""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class StateIsTheStateOfTheSSOConfiguration(TypedDict, total=False): state: Required[ @@ -68,12 +44,6 @@ class StateIsTheStateOfTheSSOConfiguration(TypedDict, total=False): ] """state is the state of the SSO configuration""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - SSOConfigurationUpdateParams: TypeAlias = Union[ ClientIDIsTheClientIDOfTheSSOProvider, diff --git a/src/gitpod/types/project_create_from_environment_params.py b/src/gitpod/types/project_create_from_environment_params.py index 477cbbdc..17da3e40 100644 --- a/src/gitpod/types/project_create_from_environment_params.py +++ b/src/gitpod/types/project_create_from_environment_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,13 +10,7 @@ class ProjectCreateFromEnvironmentParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies the environment identifier""" name: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py index c9e9529f..5fc8cf4f 100644 --- a/src/gitpod/types/project_create_from_environment_response.py +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -59,9 +59,8 @@ class ProjectInitializerSpecContextURL(BaseModel): class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) @@ -115,8 +114,8 @@ class ProjectMetadataCreator(BaseModel): class ProjectMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -216,8 +215,8 @@ class ProjectMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index 708cecd0..47f1619d 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -27,9 +27,6 @@ class ProjectCreateParams(TypedDict, total=False): initializer: Required[Initializer] """EnvironmentInitializer specifies how an environment is to be initialized""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file relative to the repo @@ -52,9 +49,6 @@ class ProjectCreateParams(TypedDict, total=False): name: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( TypedDict, total=False @@ -88,9 +82,8 @@ class InitializerSpecContextURL(TypedDict, total=False): class InitializerSpecGitGit(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py index 96ecc716..06cfd52b 100644 --- a/src/gitpod/types/project_create_response.py +++ b/src/gitpod/types/project_create_response.py @@ -59,9 +59,8 @@ class ProjectInitializerSpecContextURL(BaseModel): class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) @@ -115,8 +114,8 @@ class ProjectMetadataCreator(BaseModel): class ProjectMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -216,8 +215,8 @@ class ProjectMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/project_delete_params.py b/src/gitpod/types/project_delete_params.py index 8004da17..8e7e188e 100644 --- a/src/gitpod/types/project_delete_params.py +++ b/src/gitpod/types/project_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class ProjectDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py index df0843b2..3d2202de 100644 --- a/src/gitpod/types/project_list_params.py +++ b/src/gitpod/types/project_list_params.py @@ -2,33 +2,31 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["ProjectListParams"] +__all__ = ["ProjectListParams", "Pagination"] class ProjectListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + pagination: Pagination + """pagination contains the pagination options for listing organizations""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/project_list_response.py b/src/gitpod/types/project_list_response.py index da32fdb4..4516741c 100644 --- a/src/gitpod/types/project_list_response.py +++ b/src/gitpod/types/project_list_response.py @@ -30,9 +30,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ @@ -68,9 +68,8 @@ class ProjectInitializerSpecContextURL(BaseModel): class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) @@ -124,8 +123,8 @@ class ProjectMetadataCreator(BaseModel): class ProjectMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -225,8 +224,8 @@ class ProjectMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/project_retrieve_params.py b/src/gitpod/types/project_retrieve_params.py index 42abf44b..0160fa6f 100644 --- a/src/gitpod/types/project_retrieve_params.py +++ b/src/gitpod/types/project_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,5 @@ class ProjectRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py index b8c2c736..788d1eb6 100644 --- a/src/gitpod/types/project_retrieve_response.py +++ b/src/gitpod/types/project_retrieve_response.py @@ -59,9 +59,8 @@ class ProjectInitializerSpecContextURL(BaseModel): class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) @@ -115,8 +114,8 @@ class ProjectMetadataCreator(BaseModel): class ProjectMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -216,8 +215,8 @@ class ProjectMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py index c8ac42c1..e8264524 100644 --- a/src/gitpod/types/project_update_params.py +++ b/src/gitpod/types/project_update_params.py @@ -37,12 +37,6 @@ class AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot(Type ``` """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot(TypedDict, total=False): devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] @@ -55,22 +49,10 @@ class DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot(Ty ``` """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant2(TypedDict, total=False): environment_class: Required[Annotated[Variant2EnvironmentClass, PropertyInfo(alias="environmentClass")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( TypedDict, total=False @@ -97,12 +79,6 @@ class InitializerIsTheContentInitializer(TypedDict, total=False): initializer: Required[InitializerIsTheContentInitializerInitializer] """EnvironmentInitializer specifies how an environment is to be initialized""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class InitializerIsTheContentInitializerInitializerSpecContextURLContextURL(TypedDict, total=False): url: str @@ -119,9 +95,8 @@ class InitializerIsTheContentInitializerInitializerSpecContextURL(TypedDict, tot class InitializerIsTheContentInitializerInitializerSpecGitGit(TypedDict, total=False): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] @@ -162,12 +137,6 @@ class InitializerIsTheContentInitializerInitializer(TypedDict, total=False): class Variant4(TypedDict, total=False): name: Required[str] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - ProjectUpdateParams: TypeAlias = Union[ AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot, diff --git a/src/gitpod/types/project_update_response.py b/src/gitpod/types/project_update_response.py index f90b85b6..c01a5020 100644 --- a/src/gitpod/types/project_update_response.py +++ b/src/gitpod/types/project_update_response.py @@ -59,9 +59,8 @@ class ProjectInitializerSpecContextURL(BaseModel): class ProjectInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """a path relative to the environment root in which the code will be checked out - - to + """ + a path relative to the environment root in which the code will be checked out to """ clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) @@ -115,8 +114,8 @@ class ProjectMetadataCreator(BaseModel): class ProjectMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -216,8 +215,8 @@ class ProjectMetadata(BaseModel): """organization_id is the ID of the organization that contains the environment""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/projects/policy_create_params.py b/src/gitpod/types/projects/policy_create_params.py index dcbee1c1..fb0bdf29 100644 --- a/src/gitpod/types/projects/policy_create_params.py +++ b/src/gitpod/types/projects/policy_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,9 +10,6 @@ class PolicyCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - group_id: Annotated[str, PropertyInfo(alias="groupId")] """group_id specifies the group_id identifier""" @@ -20,6 +17,3 @@ class PolicyCreateParams(TypedDict, total=False): """project_id specifies the project identifier""" role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/projects/policy_delete_params.py b/src/gitpod/types/projects/policy_delete_params.py index 28c08ec5..bd51f1a8 100644 --- a/src/gitpod/types/projects/policy_delete_params.py +++ b/src/gitpod/types/projects/policy_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,14 +10,8 @@ class PolicyDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - group_id: Annotated[str, PropertyInfo(alias="groupId")] """group_id specifies the group_id identifier""" project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/projects/policy_list_params.py b/src/gitpod/types/projects/policy_list_params.py index 527570b7..9f860882 100644 --- a/src/gitpod/types/projects/policy_list_params.py +++ b/src/gitpod/types/projects/policy_list_params.py @@ -2,33 +2,34 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["PolicyListParams"] +__all__ = ["PolicyListParams", "Pagination"] class PolicyListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + pagination: Pagination + """pagination contains the pagination options for listing project policies""" + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/projects/policy_list_response.py b/src/gitpod/types/projects/policy_list_response.py index 33a9facc..5f642f6b 100644 --- a/src/gitpod/types/projects/policy_list_response.py +++ b/src/gitpod/types/projects/policy_list_response.py @@ -12,9 +12,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/projects/policy_update_params.py b/src/gitpod/types/projects/policy_update_params.py index fd763d67..e9b4348d 100644 --- a/src/gitpod/types/projects/policy_update_params.py +++ b/src/gitpod/types/projects/policy_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,9 +10,6 @@ class PolicyUpdateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - group_id: Annotated[str, PropertyInfo(alias="groupId")] """group_id specifies the group_id identifier""" @@ -20,6 +17,3 @@ class PolicyUpdateParams(TypedDict, total=False): """project_id specifies the project identifier""" role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_check_authentication_for_host_params.py b/src/gitpod/types/runner_check_authentication_for_host_params.py index 67322e17..c3a5db48 100644 --- a/src/gitpod/types/runner_check_authentication_for_host_params.py +++ b/src/gitpod/types/runner_check_authentication_for_host_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,12 +10,6 @@ class RunnerCheckAuthenticationForHostParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - host: str runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_create_params.py b/src/gitpod/types/runner_create_params.py index cd560006..787f46ba 100644 --- a/src/gitpod/types/runner_create_params.py +++ b/src/gitpod/types/runner_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,9 +10,6 @@ class RunnerCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - kind: Literal[ "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" ] @@ -35,9 +32,6 @@ class RunnerCreateParams(TypedDict, total=False): spec: Spec - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class SpecConfiguration(TypedDict, total=False): auto_update: Annotated[bool, PropertyInfo(alias="autoUpdate")] diff --git a/src/gitpod/types/runner_create_response.py b/src/gitpod/types/runner_create_response.py index 5591848d..35c86786 100644 --- a/src/gitpod/types/runner_create_response.py +++ b/src/gitpod/types/runner_create_response.py @@ -116,8 +116,8 @@ class RunnerStatus(BaseModel): system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -212,8 +212,8 @@ class RunnerStatus(BaseModel): class Runner(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -337,8 +337,8 @@ class Runner(BaseModel): """RunnerStatus represents the status of a runner""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runner_create_runner_token_params.py b/src/gitpod/types/runner_create_runner_token_params.py index da185a2c..8bf7b700 100644 --- a/src/gitpod/types/runner_create_runner_token_params.py +++ b/src/gitpod/types/runner_create_runner_token_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class RunnerCreateRunnerTokenParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_delete_params.py b/src/gitpod/types/runner_delete_params.py index a3e01014..a5322686 100644 --- a/src/gitpod/types/runner_delete_params.py +++ b/src/gitpod/types/runner_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,9 +10,6 @@ class RunnerDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - force: bool """ force indicates whether the runner should be deleted forcefully. When force @@ -22,6 +19,3 @@ class RunnerDeleteParams(TypedDict, total=False): """ runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py index a1f38218..8963496b 100644 --- a/src/gitpod/types/runner_list_params.py +++ b/src/gitpod/types/runner_list_params.py @@ -2,33 +2,54 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["RunnerListParams"] +__all__ = ["RunnerListParams", "Filter", "Pagination"] class RunnerListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + filter: Filter + + pagination: Pagination + """pagination contains the pagination options for listing runners""" + + +class Filter(TypedDict, total=False): + creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] + """creator_ids filters the response to only runner created by specified users""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" + kinds: List[ + Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] + ] + """kinds filters the response to only runners of the specified kinds""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" + providers: List[ + Literal[ + "RUNNER_PROVIDER_UNSPECIFIED", + "RUNNER_PROVIDER_AWS_EC2", + "RUNNER_PROVIDER_LINUX_HOST", + "RUNNER_PROVIDER_DESKTOP_MAC", + ] + ] + """providers filters the response to only runners of the specified providers""" - message: str - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runner_list_response.py b/src/gitpod/types/runner_list_response.py index 0012aca6..18c54019 100644 --- a/src/gitpod/types/runner_list_response.py +++ b/src/gitpod/types/runner_list_response.py @@ -22,9 +22,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ @@ -125,8 +125,8 @@ class RunnerStatus(BaseModel): system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -221,8 +221,8 @@ class RunnerStatus(BaseModel): class Runner(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -346,8 +346,8 @@ class Runner(BaseModel): """RunnerStatus represents the status of a runner""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runner_parse_context_url_params.py b/src/gitpod/types/runner_parse_context_url_params.py index c131a243..986d37b1 100644 --- a/src/gitpod/types/runner_parse_context_url_params.py +++ b/src/gitpod/types/runner_parse_context_url_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,12 +10,6 @@ class RunnerParseContextURLParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - context_url: Annotated[str, PropertyInfo(alias="contextUrl")] runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_retrieve_params.py b/src/gitpod/types/runner_retrieve_params.py index 786b07dd..409766f2 100644 --- a/src/gitpod/types/runner_retrieve_params.py +++ b/src/gitpod/types/runner_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class RunnerRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runner_retrieve_response.py b/src/gitpod/types/runner_retrieve_response.py index d1a70727..c2f7320a 100644 --- a/src/gitpod/types/runner_retrieve_response.py +++ b/src/gitpod/types/runner_retrieve_response.py @@ -116,8 +116,8 @@ class RunnerStatus(BaseModel): system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -212,8 +212,8 @@ class RunnerStatus(BaseModel): class Runner(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -337,8 +337,8 @@ class Runner(BaseModel): """RunnerStatus represents the status of a runner""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index 28bcc60a..d13d613b 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -24,22 +24,10 @@ class TheRunnerSNameWhichIsShownToUsers(TypedDict, total=False): name: Required[str] """The runner's name which is shown to users""" - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant1(TypedDict, total=False): spec: Required[Variant1Spec] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself( TypedDict, total=False diff --git a/src/gitpod/types/runners/configuration_validate_params.py b/src/gitpod/types/runners/configuration_validate_params.py index 03cc3565..0bb99fad 100644 --- a/src/gitpod/types/runners/configuration_validate_params.py +++ b/src/gitpod/types/runners/configuration_validate_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ..._types import Base64FileInput from ..._utils import PropertyInfo @@ -25,14 +25,8 @@ class Variant0(TypedDict, total=False): environment_class: Required[Annotated[Variant0EnvironmentClass, PropertyInfo(alias="environmentClass")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant0EnvironmentClassConfiguration(TypedDict, total=False): key: str @@ -54,9 +48,9 @@ class Variant0EnvironmentClass(TypedDict, total=False): """display_name is the human readable name of the environment class""" enabled: bool - """enabled indicates whether the environment class can be used to create - - new environments. + """ + enabled indicates whether the environment class can be used to create new + environments. """ runner_id: Annotated[str, PropertyInfo(alias="runnerId")] @@ -69,22 +63,16 @@ class Variant0EnvironmentClass(TypedDict, total=False): class Variant1(TypedDict, total=False): scm_integration: Required[Annotated[Variant1ScmIntegration, PropertyInfo(alias="scmIntegration")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet( TypedDict, total=False ): oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] - """oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_client_secret must also be set. + """ + oauth_client_id is the OAuth app's client ID, if OAuth is configured. If + configured, oauth_client_secret must also be set. """ @@ -96,10 +84,8 @@ class Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecret ] """ oauth_encrypted_client_secret is the OAuth app's client secret encrypted with - the runner's public key, - - if OAuth is configured. This can be used to e.g. validate an already encrypted - client secret of an existing SCM integration. + the runner's public key, if OAuth is configured. This can be used to e.g. + validate an already encrypted client secret of an existing SCM integration. """ @@ -115,11 +101,9 @@ class Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecret oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] """ oauth_plaintext_client_secret is the OAuth app's client secret in clear text, if - OAuth is configured. - - This can be set to validate any new client secret before it is encrypted and - stored. This value will not be stored and get encrypted with the runner's public - key before passing it to the runner. + OAuth is configured. This can be set to validate any new client secret before it + is encrypted and stored. This value will not be stored and get encrypted with + the runner's public key before passing it to the runner. """ diff --git a/src/gitpod/types/runners/configurations/environment_class_create_params.py b/src/gitpod/types/runners/configurations/environment_class_create_params.py index 28287cd2..659e64e3 100644 --- a/src/gitpod/types/runners/configurations/environment_class_create_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo @@ -11,9 +11,6 @@ class EnvironmentClassCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - configuration: Iterable[Configuration] description: str @@ -22,9 +19,6 @@ class EnvironmentClassCreateParams(TypedDict, total=False): runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Configuration(TypedDict, total=False): key: str diff --git a/src/gitpod/types/runners/configurations/environment_class_list_params.py b/src/gitpod/types/runners/configurations/environment_class_list_params.py index b8aa9293..ce42b415 100644 --- a/src/gitpod/types/runners/configurations/environment_class_list_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_params.py @@ -2,33 +2,41 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["EnvironmentClassListParams"] +__all__ = ["EnvironmentClassListParams", "Filter", "Pagination"] class EnvironmentClassListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool + filter: Filter + + pagination: Pagination + """pagination contains the pagination options for listing environment classes""" + + +class Filter(TypedDict, total=False): + enabled: Required[bool] """ - Specifies if the message query param is base64 encoded, which may be required - for binary data + enabled filters the response to only enabled or disabled environment classes. If + not set, all environment classes are returned. """ - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/runners/configurations/environment_class_list_response.py b/src/gitpod/types/runners/configurations/environment_class_list_response.py index 1a0b9507..81eb2d66 100644 --- a/src/gitpod/types/runners/configurations/environment_class_list_response.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_response.py @@ -29,9 +29,9 @@ class EnvironmentClass(BaseModel): """display_name is the human readable name of the environment class""" enabled: Optional[bool] = None - """enabled indicates whether the environment class can be used to create - - new environments. + """ + enabled indicates whether the environment class can be used to create new + environments. """ runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) @@ -43,9 +43,9 @@ class EnvironmentClass(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py b/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py index de55e417..51b92e16 100644 --- a/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo @@ -10,10 +10,4 @@ class EnvironmentClassRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py b/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py index eafeed5c..fd91634b 100644 --- a/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py @@ -29,9 +29,9 @@ class EnvironmentClass(BaseModel): """display_name is the human readable name of the environment class""" enabled: Optional[bool] = None - """enabled indicates whether the environment class can be used to create - - new environments. + """ + enabled indicates whether the environment class can be used to create new + environments. """ runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) diff --git a/src/gitpod/types/runners/configurations/environment_class_update_params.py b/src/gitpod/types/runners/configurations/environment_class_update_params.py index 7bcfd5fb..53006f36 100644 --- a/src/gitpod/types/runners/configurations/environment_class_update_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -13,31 +13,13 @@ class Variant0(TypedDict, total=False): description: Required[str] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant1(TypedDict, total=False): display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant2(TypedDict, total=False): enabled: Required[bool] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - EnvironmentClassUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py index feba4855..ae8e98b2 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,14 +12,11 @@ class HostAuthenticationTokenCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - token: str expires_at: Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")] - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -122,6 +119,3 @@ class HostAuthenticationTokenCreateParams(TypedDict, total=False): ] user_id: Annotated[str, PropertyInfo(alias="userId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py index f3c4aebd..fe368a60 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py @@ -15,8 +15,8 @@ class Token(BaseModel): id: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_delete_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_delete_params.py index cc74f928..f7de02b2 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_delete_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_delete_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["HostAuthenticationTokenDeleteParams"] class HostAuthenticationTokenDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py index 4c46172f..77b971f1 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py @@ -2,33 +2,44 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenListParams"] +__all__ = ["HostAuthenticationTokenListParams", "Filter", "FilterRunnerID", "FilterUserID", "Pagination"] class HostAuthenticationTokenListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + + +class FilterRunnerID(TypedDict, total=False): + runner_id: Required[Annotated[str, PropertyInfo(alias="runnerId")]] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" +class FilterUserID(TypedDict, total=False): + user_id: Required[Annotated[str, PropertyInfo(alias="userId")]] - connect: Literal["v1"] - """Define the version of the Connect protocol""" - message: str +Filter: TypeAlias = Union[FilterRunnerID, FilterUserID] - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py index 63f9525d..7e7b78a5 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py @@ -13,9 +13,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ @@ -23,8 +23,8 @@ class Token(BaseModel): id: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py index 7933cb2a..c544285c 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["HostAuthenticationTokenRetrieveParams"] class HostAuthenticationTokenRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py index 92fca925..85cb9463 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py @@ -15,8 +15,8 @@ class Token(BaseModel): id: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py index 9979ef22..aea852e6 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -13,8 +13,8 @@ class Variant0(TypedDict, total=False): expires_at: Required[Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")]] - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -104,31 +104,13 @@ class Variant0(TypedDict, total=False): to obtain a formatter capable of generating timestamps in this format. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant1(TypedDict, total=False): refresh_token: Required[Annotated[str, PropertyInfo(alias="refreshToken")]] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class Variant2(TypedDict, total=False): token: Required[str] - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - HostAuthenticationTokenUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/src/gitpod/types/runners/configurations/schema_retrieve_params.py b/src/gitpod/types/runners/configurations/schema_retrieve_params.py index b69e5107..2988a4a3 100644 --- a/src/gitpod/types/runners/configurations/schema_retrieve_params.py +++ b/src/gitpod/types/runners/configurations/schema_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo @@ -10,10 +10,4 @@ class SchemaRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/scm_integration_create_params.py b/src/gitpod/types/runners/configurations/scm_integration_create_params.py index fad0a6b8..1bbfe2b7 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -18,33 +18,21 @@ class OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPla TypedDict, total=False ): oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] - """oauth_client_id is the OAuth app's client ID, if OAuth is configured. - - If configured, oauth_plaintext_client_secret must also be set. """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + oauth_client_id is the OAuth app's client ID, if OAuth is configured. If + configured, oauth_plaintext_client_secret must also be set. + """ class OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( TypedDict, total=False ): oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] - """oauth_plaintext_client_secret is the OAuth app's client secret in clear text. - + """ + oauth_plaintext_client_secret is the OAuth app's client secret in clear text. This will first be encrypted with the runner's public key before being stored. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - ScmIntegrationCreateParams: TypeAlias = Union[ OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet, diff --git a/src/gitpod/types/runners/configurations/scm_integration_delete_params.py b/src/gitpod/types/runners/configurations/scm_integration_delete_params.py index 7fb7d75e..f2b72fb4 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_delete_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_delete_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ScmIntegrationDeleteParams"] class ScmIntegrationDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_params.py b/src/gitpod/types/runners/configurations/scm_integration_list_params.py index 53cababc..649b18ad 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_list_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_list_params.py @@ -2,33 +2,39 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["ScmIntegrationListParams"] +__all__ = ["ScmIntegrationListParams", "Filter", "Pagination"] class ScmIntegrationListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + """pagination contains the pagination options for listing scm integrations""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" +class Filter(TypedDict, total=False): + runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] + """runner_ids filters the response to only SCM integrations of these Runner IDs""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" - message: str +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_response.py b/src/gitpod/types/runners/configurations/scm_integration_list_response.py index 7b1fc5e7..e7e6b3e4 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_list_response.py +++ b/src/gitpod/types/runners/configurations/scm_integration_list_response.py @@ -41,9 +41,9 @@ class Integration(BaseModel): class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py b/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py index 093d3d61..d39fe2ee 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_retrieve_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ScmIntegrationRetrieveParams"] class ScmIntegrationRetrieveParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - id: str - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/configurations/scm_integration_update_params.py b/src/gitpod/types/runners/configurations/scm_integration_update_params.py index 00c0d0f9..2732ed11 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_update_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -19,20 +19,14 @@ class OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOA TypedDict, total=False ): oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] - """oauth_client_id can be set to update the OAuth app's client ID. - - If an empty string is set, the OAuth configuration will be removed (regardless - of whether a client secret is set), and any existing Host Authentication Tokens - for the SCM integration's runner and host that were created using the OAuth app - will be deleted. This might lead to users being unable to access their - repositories until they re-authenticate. """ - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + oauth_client_id can be set to update the OAuth app's client ID. If an empty + string is set, the OAuth configuration will be removed (regardless of whether a + client secret is set), and any existing Host Authentication Tokens for the SCM + integration's runner and host that were created using the OAuth app will be + deleted. This might lead to users being unable to access their repositories + until they re-authenticate. + """ class OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( @@ -41,37 +35,23 @@ class OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheClear oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] """ oauth_plaintext_client_secret can be set to update the OAuth app's client - secret. - - The cleartext secret will be encrypted with the runner's public key before being - stored. + secret. The cleartext secret will be encrypted with the runner's public key + before being stored. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate( TypedDict, total=False ): pat: Required[bool] - """pat can be set to enable or disable Personal Access Tokens support. - - When disabling PATs, any existing Host Authentication Tokens for the SCM + """ + pat can be set to enable or disable Personal Access Tokens support. When + disabling PATs, any existing Host Authentication Tokens for the SCM integration's runner and host that were created using a PAT will be deleted. This might lead to users being unable to access their repositories until they re-authenticate. """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - ScmIntegrationUpdateParams: TypeAlias = Union[ OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate, diff --git a/src/gitpod/types/runners/policy_create_params.py b/src/gitpod/types/runners/policy_create_params.py index b0c6aa65..c79c1ef7 100644 --- a/src/gitpod/types/runners/policy_create_params.py +++ b/src/gitpod/types/runners/policy_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,9 +10,6 @@ class PolicyCreateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - group_id: Annotated[str, PropertyInfo(alias="groupId")] """group_id specifies the group_id identifier""" @@ -20,6 +17,3 @@ class PolicyCreateParams(TypedDict, total=False): runner_id: Annotated[str, PropertyInfo(alias="runnerId")] """runner_id specifies the project identifier""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/policy_delete_params.py b/src/gitpod/types/runners/policy_delete_params.py index 0f6af171..d77deca5 100644 --- a/src/gitpod/types/runners/policy_delete_params.py +++ b/src/gitpod/types/runners/policy_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,14 +10,8 @@ class PolicyDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - group_id: Annotated[str, PropertyInfo(alias="groupId")] """group_id specifies the group_id identifier""" runner_id: Annotated[str, PropertyInfo(alias="runnerId")] """runner_id specifies the project identifier""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/runners/policy_list_params.py b/src/gitpod/types/runners/policy_list_params.py index 527570b7..8317d429 100644 --- a/src/gitpod/types/runners/policy_list_params.py +++ b/src/gitpod/types/runners/policy_list_params.py @@ -2,33 +2,34 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["PolicyListParams"] +__all__ = ["PolicyListParams", "Pagination"] class PolicyListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ + pagination: Pagination + """pagination contains the pagination options for listing project policies""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """runner_id specifies the project identifier""" - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/runners/policy_list_response.py b/src/gitpod/types/runners/policy_list_response.py index 452fe18d..730960cb 100644 --- a/src/gitpod/types/runners/policy_list_response.py +++ b/src/gitpod/types/runners/policy_list_response.py @@ -12,9 +12,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ diff --git a/src/gitpod/types/runners/policy_update_params.py b/src/gitpod/types/runners/policy_update_params.py index b8e23b90..9f44d6bb 100644 --- a/src/gitpod/types/runners/policy_update_params.py +++ b/src/gitpod/types/runners/policy_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,9 +10,6 @@ class PolicyUpdateParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - group_id: Annotated[str, PropertyInfo(alias="groupId")] """group_id specifies the group_id identifier""" @@ -20,6 +17,3 @@ class PolicyUpdateParams(TypedDict, total=False): runner_id: Annotated[str, PropertyInfo(alias="runnerId")] """runner_id specifies the project identifier""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index ea4f7a10..b11ca479 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo @@ -21,9 +21,6 @@ class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(Typed secret """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - name: str project_id: Annotated[str, PropertyInfo(alias="projectId")] @@ -32,9 +29,6 @@ class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(Typed value: str """value is the plaintext value of the secret""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] @@ -47,9 +41,6 @@ class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): ``` """ - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - name: str project_id: Annotated[str, PropertyInfo(alias="projectId")] @@ -58,9 +49,6 @@ class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): value: str """value is the plaintext value of the secret""" - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" - SecretCreateParams: TypeAlias = Union[ SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, AbsolutePathToTheFileWhereTheSecretIsMounted diff --git a/src/gitpod/types/secret_delete_params.py b/src/gitpod/types/secret_delete_params.py index c7cd3adc..99d8bb65 100644 --- a/src/gitpod/types/secret_delete_params.py +++ b/src/gitpod/types/secret_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class SecretDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - secret_id: Annotated[str, PropertyInfo(alias="secretId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/secret_get_value_params.py b/src/gitpod/types/secret_get_value_params.py index 3b183130..7fbab3d8 100644 --- a/src/gitpod/types/secret_get_value_params.py +++ b/src/gitpod/types/secret_get_value_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,10 +10,4 @@ class SecretGetValueParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - secret_id: Annotated[str, PropertyInfo(alias="secretId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/secret_list_params.py b/src/gitpod/types/secret_list_params.py index e546a631..a0d7593d 100644 --- a/src/gitpod/types/secret_list_params.py +++ b/src/gitpod/types/secret_list_params.py @@ -2,33 +2,39 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["SecretListParams"] +__all__ = ["SecretListParams", "Filter", "Pagination"] class SecretListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + """pagination contains the pagination options for listing environments""" - base64: bool - """ - Specifies if the message query param is base64 encoded, which may be required - for binary data - """ - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" +class Filter(TypedDict, total=False): + project_ids: Annotated[List[str], PropertyInfo(alias="projectIds")] + """project_ids filters the response to only Secrets used by these Project IDs""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" - message: str +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/secret_list_response.py b/src/gitpod/types/secret_list_response.py index 7bbbf133..6fd44ba5 100644 --- a/src/gitpod/types/secret_list_response.py +++ b/src/gitpod/types/secret_list_response.py @@ -21,9 +21,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ @@ -54,8 +54,8 @@ class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -155,8 +155,8 @@ class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret """The Project ID this Secret belongs to""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -271,8 +271,8 @@ class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -372,8 +372,8 @@ class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): """The Project ID this Secret belongs to""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/secret_update_value_params.py b/src/gitpod/types/secret_update_value_params.py index a38e7c44..0195afc2 100644 --- a/src/gitpod/types/secret_update_value_params.py +++ b/src/gitpod/types/secret_update_value_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,13 +10,7 @@ class SecretUpdateValueParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - secret_id: Annotated[str, PropertyInfo(alias="secretId")] value: str """value is the plaintext value of the secret""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/user_get_authenticated_user_params.py b/src/gitpod/types/user_get_authenticated_user_params.py index 2b7ca601..0f1f105f 100644 --- a/src/gitpod/types/user_get_authenticated_user_params.py +++ b/src/gitpod/types/user_get_authenticated_user_params.py @@ -2,18 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo +from typing_extensions import Required, TypedDict __all__ = ["UserGetAuthenticatedUserParams"] class UserGetAuthenticatedUserParams(TypedDict, total=False): body: Required[object] - - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/user_get_authenticated_user_response.py b/src/gitpod/types/user_get_authenticated_user_response.py index 7b2d2f9e..5dc0b4f0 100644 --- a/src/gitpod/types/user_get_authenticated_user_response.py +++ b/src/gitpod/types/user_get_authenticated_user_response.py @@ -19,8 +19,8 @@ class User(BaseModel): """avatar_url is a link to the user avatar""" created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/user_set_suspended_params.py b/src/gitpod/types/user_set_suspended_params.py index a3719c44..1a4e3d95 100644 --- a/src/gitpod/types/user_set_suspended_params.py +++ b/src/gitpod/types/user_set_suspended_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,12 +10,6 @@ class UserSetSuspendedParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - suspended: bool user_id: Annotated[str, PropertyInfo(alias="userId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/users/pat_delete_params.py b/src/gitpod/types/users/pat_delete_params.py index f307dac3..990e6605 100644 --- a/src/gitpod/types/users/pat_delete_params.py +++ b/src/gitpod/types/users/pat_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class PatDeleteParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - personal_access_token_id: Annotated[str, PropertyInfo(alias="personalAccessTokenId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/users/pat_get_params.py b/src/gitpod/types/users/pat_get_params.py index b57c1197..6851c572 100644 --- a/src/gitpod/types/users/pat_get_params.py +++ b/src/gitpod/types/users/pat_get_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,10 +10,4 @@ class PatGetParams(TypedDict, total=False): - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" - personal_access_token_id: Annotated[str, PropertyInfo(alias="personalAccessTokenId")] - - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" diff --git a/src/gitpod/types/users/pat_get_response.py b/src/gitpod/types/users/pat_get_response.py index 8b468808..8616d1a2 100644 --- a/src/gitpod/types/users/pat_get_response.py +++ b/src/gitpod/types/users/pat_get_response.py @@ -32,8 +32,8 @@ class Pat(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -128,8 +128,8 @@ class Pat(BaseModel): description: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -220,8 +220,8 @@ class Pat(BaseModel): """ last_used: Optional[datetime] = FieldInfo(alias="lastUsed", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/src/gitpod/types/users/pat_list_params.py b/src/gitpod/types/users/pat_list_params.py index a28b33ed..b03f6d62 100644 --- a/src/gitpod/types/users/pat_list_params.py +++ b/src/gitpod/types/users/pat_list_params.py @@ -2,33 +2,41 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import List +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["PatListParams"] +__all__ = ["PatListParams", "Filter", "Pagination"] class PatListParams(TypedDict, total=False): - encoding: Required[Literal["proto", "json"]] - """Define which encoding or 'Message-Codec' to use""" + token: str - connect_protocol_version: Required[Annotated[Literal[1], PropertyInfo(alias="Connect-Protocol-Version")]] - """Define the version of the Connect protocol""" + page_size: Annotated[int, PropertyInfo(alias="pageSize")] - base64: bool + filter: Filter + + pagination: Pagination + + +class Filter(TypedDict, total=False): + user_ids: Annotated[List[str], PropertyInfo(alias="userIds")] """ - Specifies if the message query param is base64 encoded, which may be required - for binary data + creator_ids filters the response to only Environments created by specified + members """ - compression: Literal["identity", "gzip", "br"] - """Which compression algorithm to use for this request""" - connect: Literal["v1"] - """Define the version of the Connect protocol""" +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ - message: str + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. - connect_timeout_ms: Annotated[float, PropertyInfo(alias="Connect-Timeout-Ms")] - """Define the timeout, in ms""" + Maximum 100. + """ diff --git a/src/gitpod/types/users/pat_list_response.py b/src/gitpod/types/users/pat_list_response.py index 944942ee..aaf9d279 100644 --- a/src/gitpod/types/users/pat_list_response.py +++ b/src/gitpod/types/users/pat_list_response.py @@ -13,9 +13,9 @@ class Pagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. Empty if there are no + """Token passed for retreiving the next set of results. - more results + Empty if there are no more results """ @@ -40,8 +40,8 @@ class PersonalAccessToken(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -136,8 +136,8 @@ class PersonalAccessToken(BaseModel): description: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar @@ -228,8 +228,8 @@ class PersonalAccessToken(BaseModel): """ last_used: Optional[datetime] = FieldInfo(alias="lastUsed", default=None) - """A Timestamp represents a point in time independent of any time zone or local - + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index d2771238..cae56ad7 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.environments.automations.tasks import ( ExecutionListResponse, ExecutionRetrieveResponse, @@ -22,25 +23,19 @@ class TestExecutions: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - execution = client.environments.automations.tasks.executions.retrieve( - connect_protocol_version=1, - ) + execution = client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.executions.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.executions.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -49,9 +44,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.automations.tasks.executions.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.executions.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,72 +55,62 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - execution = client.environments.automations.tasks.executions.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + execution = client.environments.automations.tasks.executions.list() + assert_matches_type(SyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + token="token", + page_size=0, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "task_references": ["string"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.executions.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.executions.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.tasks.executions.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.executions.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_stop(self, client: Gitpod) -> None: - execution = client.environments.automations.tasks.executions.stop( - connect_protocol_version=1, - ) + execution = client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, execution, path=["response"]) @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.executions.with_raw_response.stop( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.executions.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -136,9 +119,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.environments.automations.tasks.executions.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.executions.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -153,25 +134,19 @@ class TestAsyncExecutions: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - execution = await async_client.environments.automations.tasks.executions.retrieve( - connect_protocol_version=1, - ) + execution = await async_client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -180,8 +155,8 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.executions.with_streaming_response.retrieve( - connect_protocol_version=1, + async with ( + async_client.environments.automations.tasks.executions.with_streaming_response.retrieve() ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -193,72 +168,62 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - execution = await async_client.environments.automations.tasks.executions.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + execution = await async_client.environments.automations.tasks.executions.list() + assert_matches_type(AsyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + token="token", + page_size=0, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "task_references": ["string"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.executions.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.executions.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.executions.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.executions.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: - execution = await async_client.environments.automations.tasks.executions.stop( - connect_protocol_version=1, - ) + execution = await async_client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, execution, path=["response"]) @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.executions.with_raw_response.stop( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.executions.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -267,9 +232,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.executions.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.executions.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 2f8c9b15..e88629c4 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -10,6 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod._utils import parse_datetime +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.environments.automations import ( ServiceListResponse, ServiceCreateResponse, @@ -24,15 +25,12 @@ class TestServices: @parametrize def test_method_create(self, client: Gitpod) -> None: - service = client.environments.automations.services.create( - connect_protocol_version=1, - ) + service = client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.create( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -61,15 +59,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "session": "session", "spec_version": "specVersion", }, - connect_timeout_ms=0, ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -78,9 +73,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -91,25 +84,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - service = client.environments.automations.services.retrieve( - connect_protocol_version=1, - ) + service = client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -118,9 +105,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -131,28 +116,22 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_update(self, client: Gitpod) -> None: - service = client.environments.automations.services.update( - connect_protocol_version=1, - ) + service = client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={"description": "description"}, spec={"commands": {"ready": "ready"}}, status={"failure_message": "failureMessage"}, - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.update( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -161,9 +140,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -174,73 +151,62 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - service = client.environments.automations.services.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(ServiceListResponse, service, path=["response"]) + service = client.environments.automations.services.list() + assert_matches_type(SyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(ServiceListResponse, service, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - service = client.environments.automations.services.delete( - connect_protocol_version=1, - ) + service = client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -249,9 +215,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -262,25 +226,19 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - service = client.environments.automations.services.start( - connect_protocol_version=1, - ) + service = client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.start( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.start( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,9 +247,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -302,25 +258,19 @@ def test_streaming_response_start(self, client: Gitpod) -> None: @parametrize def test_method_stop(self, client: Gitpod) -> None: - service = client.environments.automations.services.stop( - connect_protocol_version=1, - ) + service = client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.stop( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.environments.automations.services.with_raw_response.stop( - connect_protocol_version=1, - ) + response = client.environments.automations.services.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -329,9 +279,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.environments.automations.services.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + with client.environments.automations.services.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -346,15 +294,12 @@ class TestAsyncServices: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.create( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -383,15 +328,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "session": "session", "spec_version": "specVersion", }, - connect_timeout_ms=0, ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -400,9 +342,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -413,25 +353,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.retrieve( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -440,9 +374,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -453,28 +385,22 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.update( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={"description": "description"}, spec={"commands": {"ready": "ready"}}, status={"failure_message": "failureMessage"}, - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.update( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -483,9 +409,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -496,73 +420,62 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(ServiceListResponse, service, path=["response"]) + service = await async_client.environments.automations.services.list() + assert_matches_type(AsyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(ServiceListResponse, service, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = await response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = await response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.delete( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -571,9 +484,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -584,25 +495,19 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.start( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.start( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -611,9 +516,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -624,25 +527,19 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: - service = await async_client.environments.automations.services.stop( - connect_protocol_version=1, - ) + service = await async_client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, service, path=["response"]) @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.services.with_raw_response.stop( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.services.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -651,9 +548,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.services.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.services.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index b8c7fef1..13a3270a 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -10,6 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod._utils import parse_datetime +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.environments.automations import ( TaskListResponse, TaskStartResponse, @@ -25,15 +26,12 @@ class TestTasks: @parametrize def test_method_create(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.create( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create( - connect_protocol_version=1, depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ @@ -56,15 +54,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: } }, }, - connect_timeout_ms=0, ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -73,9 +68,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -86,25 +79,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.retrieve( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -113,9 +100,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -126,28 +111,22 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_update(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.update( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={"description": "description"}, spec={"command": "command"}, - connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.update( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -156,9 +135,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -169,72 +146,61 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(TaskListResponse, task, path=["response"]) + task = client.environments.automations.tasks.list() + assert_matches_type(SyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(TaskListResponse, task, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = response.parse() - assert_matches_type(TaskListResponse, task, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = response.parse() - assert_matches_type(TaskListResponse, task, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.delete( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -243,9 +209,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -256,25 +220,19 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - task = client.environments.automations.tasks.start( - connect_protocol_version=1, - ) + task = client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environments.automations.tasks.with_raw_response.start( - connect_protocol_version=1, - ) + response = client.environments.automations.tasks.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -283,9 +241,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environments.automations.tasks.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + with client.environments.automations.tasks.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -300,15 +256,12 @@ class TestAsyncTasks: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.create( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create( - connect_protocol_version=1, depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={ @@ -331,15 +284,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> } }, }, - connect_timeout_ms=0, ) assert_matches_type(TaskCreateResponse, task, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -348,9 +298,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -361,25 +309,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.retrieve( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -388,9 +330,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -401,28 +341,22 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.update( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={"description": "description"}, spec={"command": "command"}, - connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.update( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -431,9 +365,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -444,72 +376,61 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(TaskListResponse, task, path=["response"]) + task = await async_client.environments.automations.tasks.list() + assert_matches_type(AsyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={ + "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "references": ["x"], + "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(TaskListResponse, task, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = await response.parse() - assert_matches_type(TaskListResponse, task, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = await response.parse() - assert_matches_type(TaskListResponse, task, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.delete( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, task, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -518,9 +439,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -531,25 +450,19 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - task = await async_client.environments.automations.tasks.start( - connect_protocol_version=1, - ) + task = await async_client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(TaskStartResponse, task, path=["response"]) @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.tasks.with_raw_response.start( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.tasks.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -558,9 +471,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.tasks.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.tasks.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index cf302b07..5b0f7c20 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -19,15 +19,12 @@ class TestAutomations: @parametrize def test_method_upsert(self, client: Gitpod) -> None: - automation = client.environments.automations.upsert( - connect_protocol_version=1, - ) + automation = client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize def test_method_upsert_with_all_params(self, client: Gitpod) -> None: automation = client.environments.automations.upsert( - connect_protocol_version=1, automations_file={ "services": { "foo": { @@ -44,7 +41,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", } }, - "triggered_by": ["string"], + "triggered_by": ["manual"], } }, "tasks": { @@ -59,20 +56,17 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", } }, - "triggered_by": ["string"], + "triggered_by": ["manual"], } }, }, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize def test_raw_response_upsert(self, client: Gitpod) -> None: - response = client.environments.automations.with_raw_response.upsert( - connect_protocol_version=1, - ) + response = client.environments.automations.with_raw_response.upsert() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -81,9 +75,7 @@ def test_raw_response_upsert(self, client: Gitpod) -> None: @parametrize def test_streaming_response_upsert(self, client: Gitpod) -> None: - with client.environments.automations.with_streaming_response.upsert( - connect_protocol_version=1, - ) as response: + with client.environments.automations.with_streaming_response.upsert() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,15 +90,12 @@ class TestAsyncAutomations: @parametrize async def test_method_upsert(self, async_client: AsyncGitpod) -> None: - automation = await async_client.environments.automations.upsert( - connect_protocol_version=1, - ) + automation = await async_client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert( - connect_protocol_version=1, automations_file={ "services": { "foo": { @@ -123,7 +112,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", } }, - "triggered_by": ["string"], + "triggered_by": ["manual"], } }, "tasks": { @@ -138,20 +127,17 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", } }, - "triggered_by": ["string"], + "triggered_by": ["manual"], } }, }, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @parametrize async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.automations.with_raw_response.upsert( - connect_protocol_version=1, - ) + response = await async_client.environments.automations.with_raw_response.upsert() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -160,9 +146,7 @@ async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.automations.with_streaming_response.upsert( - connect_protocol_version=1, - ) as response: + async with async_client.environments.automations.with_streaming_response.upsert() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index 861d3bb2..490d4f8c 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.environments import ClassListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,48 +20,39 @@ class TestClasses: @parametrize def test_method_list(self, client: Gitpod) -> None: - class_ = client.environments.classes.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(ClassListResponse, class_, path=["response"]) + class_ = client.environments.classes.list() + assert_matches_type(SyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: class_ = client.environments.classes.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"enabled": True}, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.classes.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.environments.classes.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = response.parse() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.classes.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.environments.classes.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = response.parse() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,47 +62,38 @@ class TestAsyncClasses: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - class_ = await async_client.environments.classes.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(ClassListResponse, class_, path=["response"]) + class_ = await async_client.environments.classes.list() + assert_matches_type(AsyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"enabled": True}, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.classes.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.environments.classes.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = await response.parse() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.classes.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.environments.classes.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = await response.parse() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index 877e888f..0f80a2a1 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -23,25 +23,19 @@ class TestInvites: @parametrize def test_method_create(self, client: Gitpod) -> None: - invite = client.organizations.invites.create( - connect_protocol_version=1, - ) + invite = client.organizations.invites.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.create( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.invites.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.organizations.invites.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -50,9 +44,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.invites.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.organizations.invites.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,25 +55,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - invite = client.organizations.invites.retrieve( - connect_protocol_version=1, - ) + invite = client.organizations.invites.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.invites.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.organizations.invites.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,9 +76,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.invites.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.organizations.invites.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -103,25 +87,19 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_get_summary(self, client: Gitpod) -> None: - invite = client.organizations.invites.get_summary( - connect_protocol_version=1, - ) + invite = client.organizations.invites.get_summary() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @parametrize def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( - connect_protocol_version=1, invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @parametrize def test_raw_response_get_summary(self, client: Gitpod) -> None: - response = client.organizations.invites.with_raw_response.get_summary( - connect_protocol_version=1, - ) + response = client.organizations.invites.with_raw_response.get_summary() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -130,9 +108,7 @@ def test_raw_response_get_summary(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_summary(self, client: Gitpod) -> None: - with client.organizations.invites.with_streaming_response.get_summary( - connect_protocol_version=1, - ) as response: + with client.organizations.invites.with_streaming_response.get_summary() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -147,25 +123,19 @@ class TestAsyncInvites: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invites.create( - connect_protocol_version=1, - ) + invite = await async_client.organizations.invites.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invites.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.organizations.invites.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -174,9 +144,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invites.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.invites.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -187,25 +155,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invites.retrieve( - connect_protocol_version=1, - ) + invite = await async_client.organizations.invites.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invites.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.organizations.invites.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -214,9 +176,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invites.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.invites.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -227,25 +187,19 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invites.get_summary( - connect_protocol_version=1, - ) + invite = await async_client.organizations.invites.get_summary() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @parametrize async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( - connect_protocol_version=1, invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @parametrize async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invites.with_raw_response.get_summary( - connect_protocol_version=1, - ) + response = await async_client.organizations.invites.with_raw_response.get_summary() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -254,9 +208,7 @@ async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None @parametrize async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invites.with_streaming_response.get_summary( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.invites.with_streaming_response.get_summary() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 8a7cedea..66627b91 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.organizations import ( SSOConfigurationListResponse, SSOConfigurationCreateResponse, @@ -23,29 +24,23 @@ class TestSSOConfigurations: @parametrize def test_method_create(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.create( - connect_protocol_version=1, - ) + sso_configuration = client.organizations.sso_configurations.create() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( - connect_protocol_version=1, client_id="x", client_secret="x", email_domain="xxxx", issuer_url="https://example.com", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.organizations.sso_configurations.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,9 +49,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.organizations.sso_configurations.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -67,25 +60,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.retrieve( - connect_protocol_version=1, - ) + sso_configuration = client.organizations.sso_configurations.retrieve() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( - connect_protocol_version=1, sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.organizations.sso_configurations.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -94,9 +81,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.organizations.sso_configurations.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -109,16 +94,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( client_id="x", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - client_id="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -126,7 +101,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( client_id="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -138,7 +112,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( client_id="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -152,16 +125,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( client_secret="x", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - client_secret="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -169,7 +132,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( client_secret="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -181,7 +143,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( client_secret="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -195,16 +156,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: def test_method_update_overload_3(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( email_domain="xxxx", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - email_domain="xxxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -212,7 +163,6 @@ def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( email_domain="xxxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -224,7 +174,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( email_domain="xxxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -238,16 +187,6 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: def test_method_update_overload_4(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( issuer_url="https://example.com", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - issuer_url="https://example.com", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -255,7 +194,6 @@ def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: def test_raw_response_update_overload_4(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( issuer_url="https://example.com", - connect_protocol_version=1, ) assert response.is_closed is True @@ -267,7 +205,6 @@ def test_raw_response_update_overload_4(self, client: Gitpod) -> None: def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( issuer_url="https://example.com", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -281,16 +218,6 @@ def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: def test_method_update_overload_5(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -298,7 +225,6 @@ def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - connect_protocol_version=1, ) assert response.is_closed is True @@ -310,7 +236,6 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -322,72 +247,65 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.list( - encoding="proto", - connect_protocol_version=1, + sso_configuration = client.organizations.sso_configurations.list() + assert_matches_type( + SyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + SyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.organizations.sso_configurations.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = response.parse() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.organizations.sso_configurations.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = response.parse() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.delete( - connect_protocol_version=1, - ) + sso_configuration = client.organizations.sso_configurations.delete() assert_matches_type(object, sso_configuration, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete( - connect_protocol_version=1, sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.organizations.sso_configurations.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -396,9 +314,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.organizations.sso_configurations.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -413,29 +329,23 @@ class TestAsyncSSOConfigurations: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.create( - connect_protocol_version=1, - ) + sso_configuration = await async_client.organizations.sso_configurations.create() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( - connect_protocol_version=1, client_id="x", client_secret="x", email_domain="xxxx", issuer_url="https://example.com", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.organizations.sso_configurations.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -444,9 +354,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.sso_configurations.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -457,25 +365,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.retrieve( - connect_protocol_version=1, - ) + sso_configuration = await async_client.organizations.sso_configurations.retrieve() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( - connect_protocol_version=1, sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.organizations.sso_configurations.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -484,9 +386,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.sso_configurations.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -499,16 +399,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( client_id="x", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - client_id="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -516,7 +406,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( client_id="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -528,7 +417,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( client_id="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -542,16 +430,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( client_secret="x", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - client_secret="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -559,7 +437,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( client_secret="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -571,7 +448,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( client_secret="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -585,16 +461,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( email_domain="xxxx", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - email_domain="xxxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -602,7 +468,6 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( email_domain="xxxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -614,7 +479,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( email_domain="xxxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -628,16 +492,6 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( issuer_url="https://example.com", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - issuer_url="https://example.com", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -645,7 +499,6 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( issuer_url="https://example.com", - connect_protocol_version=1, ) assert response.is_closed is True @@ -657,7 +510,6 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( issuer_url="https://example.com", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -671,16 +523,6 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncGit async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - connect_protocol_version=1, - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -688,7 +530,6 @@ async def test_method_update_with_all_params_overload_5(self, async_client: Asyn async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - connect_protocol_version=1, ) assert response.is_closed is True @@ -700,7 +541,6 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -712,72 +552,65 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.list( - encoding="proto", - connect_protocol_version=1, + sso_configuration = await async_client.organizations.sso_configurations.list() + assert_matches_type( + AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.organizations.sso_configurations.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = await response.parse() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.organizations.sso_configurations.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = await response.parse() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.delete( - connect_protocol_version=1, - ) + sso_configuration = await async_client.organizations.sso_configurations.delete() assert_matches_type(object, sso_configuration, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete( - connect_protocol_version=1, sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, sso_configuration, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.organizations.sso_configurations.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -786,9 +619,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.sso_configurations.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index 4cd564ab..88f5b1f7 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.projects import ( PolicyListResponse, PolicyCreateResponse, @@ -23,27 +24,21 @@ class TestPolicies: @parametrize def test_method_create(self, client: Gitpod) -> None: - policy = client.projects.policies.create( - connect_protocol_version=1, - ) + policy = client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="PROJECT_ROLE_UNSPECIFIED", - connect_timeout_ms=0, ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.projects.policies.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.projects.policies.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -52,9 +47,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.projects.policies.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.projects.policies.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -65,27 +58,21 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_update(self, client: Gitpod) -> None: - policy = client.projects.policies.update( - connect_protocol_version=1, - ) + policy = client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="PROJECT_ROLE_UNSPECIFIED", - connect_timeout_ms=0, ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.projects.policies.with_raw_response.update( - connect_protocol_version=1, - ) + response = client.projects.policies.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -94,9 +81,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.projects.policies.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + with client.projects.policies.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -107,73 +92,58 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - policy = client.projects.policies.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(PolicyListResponse, policy, path=["response"]) + policy = client.projects.policies.list() + assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.projects.policies.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.projects.policies.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.projects.policies.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.projects.policies.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - policy = client.projects.policies.delete( - connect_protocol_version=1, - ) + policy = client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.delete( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, policy, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.projects.policies.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.projects.policies.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -182,9 +152,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.projects.policies.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.projects.policies.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -199,27 +167,21 @@ class TestAsyncPolicies: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - policy = await async_client.projects.policies.create( - connect_protocol_version=1, - ) + policy = await async_client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="PROJECT_ROLE_UNSPECIFIED", - connect_timeout_ms=0, ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.policies.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.projects.policies.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -228,9 +190,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.policies.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.projects.policies.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -241,27 +201,21 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - policy = await async_client.projects.policies.update( - connect_protocol_version=1, - ) + policy = await async_client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="PROJECT_ROLE_UNSPECIFIED", - connect_timeout_ms=0, ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.policies.with_raw_response.update( - connect_protocol_version=1, - ) + response = await async_client.projects.policies.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -270,9 +224,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.policies.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + async with async_client.projects.policies.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -283,73 +235,58 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - policy = await async_client.projects.policies.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(PolicyListResponse, policy, path=["response"]) + policy = await async_client.projects.policies.list() + assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.policies.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.projects.policies.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.policies.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.projects.policies.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - policy = await async_client.projects.policies.delete( - connect_protocol_version=1, - ) + policy = await async_client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, policy, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.policies.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.projects.policies.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -358,9 +295,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.policies.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.projects.policies.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 2e292f15..5e1d3dfa 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.runners.configurations import ( EnvironmentClassListResponse, EnvironmentClassCreateResponse, @@ -23,15 +24,12 @@ class TestEnvironmentClasses: @parametrize def test_method_create(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.create( - connect_protocol_version=1, - ) + environment_class = client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create( - connect_protocol_version=1, configuration=[ { "key": "key", @@ -41,15 +39,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: description="xxx", display_name="xxx", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runners.configurations.environment_classes.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.runners.configurations.environment_classes.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -58,9 +53,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runners.configurations.environment_classes.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.runners.configurations.environment_classes.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -71,25 +64,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.retrieve( - connect_protocol_version=1, - ) + environment_class = client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( - connect_protocol_version=1, environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runners.configurations.environment_classes.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.runners.configurations.environment_classes.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,9 +85,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runners.configurations.environment_classes.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.runners.configurations.environment_classes.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -113,16 +98,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( description="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.update( - description="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -130,7 +105,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( description="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -142,7 +116,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( description="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -156,16 +129,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( display_name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.update( - display_name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -173,7 +136,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( display_name="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -185,7 +147,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( display_name="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -199,16 +160,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: def test_method_update_overload_3(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( enabled=True, - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.update( - enabled=True, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -216,7 +167,6 @@ def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( enabled=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -228,7 +178,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( enabled=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -240,48 +189,47 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.list( - encoding="proto", - connect_protocol_version=1, + environment_class = client.runners.configurations.environment_classes.list() + assert_matches_type( + SyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"enabled": True}, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + SyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.configurations.environment_classes.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.runners.configurations.environment_classes.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.configurations.environment_classes.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.runners.configurations.environment_classes.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -291,15 +239,12 @@ class TestAsyncEnvironmentClasses: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.create( - connect_protocol_version=1, - ) + environment_class = await async_client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create( - connect_protocol_version=1, configuration=[ { "key": "key", @@ -309,15 +254,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> description="xxx", display_name="xxx", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.environment_classes.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.environment_classes.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -326,9 +268,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.environment_classes.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.runners.configurations.environment_classes.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -339,25 +279,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.retrieve( - connect_protocol_version=1, - ) + environment_class = await async_client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( - connect_protocol_version=1, environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.environment_classes.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.environment_classes.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -366,8 +300,8 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.environment_classes.with_streaming_response.retrieve( - connect_protocol_version=1, + async with ( + async_client.runners.configurations.environment_classes.with_streaming_response.retrieve() ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -381,16 +315,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( description="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.update( - description="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -398,7 +322,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( description="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -410,7 +333,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( description="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -424,16 +346,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( display_name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.update( - display_name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -441,7 +353,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( display_name="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -453,7 +364,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( display_name="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -467,16 +377,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( enabled=True, - connect_protocol_version=1, - ) - assert_matches_type(object, environment_class, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.update( - enabled=True, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment_class, path=["response"]) @@ -484,7 +384,6 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( enabled=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -496,7 +395,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( enabled=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -508,47 +406,46 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.list( - encoding="proto", - connect_protocol_version=1, + environment_class = await async_client.runners.configurations.environment_classes.list() + assert_matches_type( + AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"enabled": True}, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.environment_classes.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.environment_classes.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = await response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.environment_classes.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.runners.configurations.environment_classes.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = await response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 1cc1de44..a827e1a9 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -10,6 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod._utils import parse_datetime +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.runners.configurations import ( HostAuthenticationTokenListResponse, HostAuthenticationTokenCreateResponse, @@ -24,15 +25,12 @@ class TestHostAuthenticationTokens: @parametrize def test_method_create(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.create( - connect_protocol_version=1, - ) + host_authentication_token = client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create( - connect_protocol_version=1, token="x", expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), host="x", @@ -40,15 +38,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runners.configurations.host_authentication_tokens.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.runners.configurations.host_authentication_tokens.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,9 +52,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runners.configurations.host_authentication_tokens.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.runners.configurations.host_authentication_tokens.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -70,25 +63,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, - ) + host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -97,9 +84,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -112,16 +97,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -129,7 +104,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, ) assert response.is_closed is True @@ -141,7 +115,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -155,16 +128,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( refresh_token="refreshToken", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - refresh_token="refreshToken", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -172,7 +135,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( refresh_token="refreshToken", - connect_protocol_version=1, ) assert response.is_closed is True @@ -184,7 +146,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( refresh_token="refreshToken", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -198,16 +159,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: def test_method_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( token="x", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - token="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -215,7 +166,6 @@ def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( token="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -227,7 +177,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( token="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -239,72 +188,73 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.list( - encoding="proto", - connect_protocol_version=1, + host_authentication_token = client.runners.configurations.host_authentication_tokens.list() + assert_matches_type( + SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + host_authentication_token, + path=["response"], ) - assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + host_authentication_token, + path=["response"], ) - assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.configurations.host_authentication_tokens.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.runners.configurations.host_authentication_tokens.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = response.parse() - assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + host_authentication_token, + path=["response"], + ) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.configurations.host_authentication_tokens.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.runners.configurations.host_authentication_tokens.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = response.parse() - assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + host_authentication_token, + path=["response"], + ) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( - connect_protocol_version=1, - ) + host_authentication_token = client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.runners.configurations.host_authentication_tokens.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.runners.configurations.host_authentication_tokens.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -313,9 +263,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.runners.configurations.host_authentication_tokens.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.runners.configurations.host_authentication_tokens.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -330,15 +278,12 @@ class TestAsyncHostAuthenticationTokens: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( - connect_protocol_version=1, - ) + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( - connect_protocol_version=1, token="x", expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), host="x", @@ -346,15 +291,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -363,8 +305,8 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.create( - connect_protocol_version=1, + async with ( + async_client.runners.configurations.host_authentication_tokens.with_streaming_response.create() ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -376,25 +318,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, - ) + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -403,8 +339,8 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve( - connect_protocol_version=1, + async with ( + async_client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve() ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -418,16 +354,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -435,7 +361,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, ) assert response.is_closed is True @@ -447,7 +372,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -461,16 +385,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( refresh_token="refreshToken", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - refresh_token="refreshToken", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -478,7 +392,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( refresh_token="refreshToken", - connect_protocol_version=1, ) assert response.is_closed is True @@ -490,7 +403,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( refresh_token="refreshToken", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -504,16 +416,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( token="x", - connect_protocol_version=1, - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - token="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -521,7 +423,6 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( token="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -533,7 +434,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( token="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -545,72 +445,75 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( - encoding="proto", - connect_protocol_version=1, + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list() + assert_matches_type( + AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + host_authentication_token, + path=["response"], ) - assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + host_authentication_token, + path=["response"], ) - assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = await response.parse() - assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + host_authentication_token, + path=["response"], + ) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, + async with ( + async_client.runners.configurations.host_authentication_tokens.with_streaming_response.list() ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = await response.parse() - assert_matches_type(HostAuthenticationTokenListResponse, host_authentication_token, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + host_authentication_token, + path=["response"], + ) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( - connect_protocol_version=1, - ) + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, host_authentication_token, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -619,8 +522,8 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.delete( - connect_protocol_version=1, + async with ( + async_client.runners.configurations.host_authentication_tokens.with_streaming_response.delete() ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index 502a5473..47601189 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -19,25 +19,19 @@ class TestSchema: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - schema = client.runners.configurations.schema.retrieve( - connect_protocol_version=1, - ) + schema = client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runners.configurations.schema.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.runners.configurations.schema.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -46,9 +40,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runners.configurations.schema.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.runners.configurations.schema.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,25 +55,19 @@ class TestAsyncSchema: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - schema = await async_client.runners.configurations.schema.retrieve( - connect_protocol_version=1, - ) + schema = await async_client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.schema.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.schema.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,9 +76,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.schema.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.runners.configurations.schema.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index a42ff107..a733f139 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.runners.configurations import ( ScmIntegrationListResponse, ScmIntegrationCreateResponse, @@ -25,16 +26,6 @@ class TestScmIntegrations: def test_method_create_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -42,7 +33,6 @@ def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) assert response.is_closed is True @@ -54,7 +44,6 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -68,16 +57,6 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: def test_method_create_overload_2(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -85,7 +64,6 @@ def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) assert response.is_closed is True @@ -97,7 +75,6 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -109,25 +86,19 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.retrieve( - connect_protocol_version=1, - ) + scm_integration = client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.runners.configurations.scm_integrations.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -136,9 +107,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -151,16 +120,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -168,7 +127,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) assert response.is_closed is True @@ -180,7 +138,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -194,16 +151,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -211,7 +158,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) assert response.is_closed is True @@ -223,7 +169,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -237,16 +182,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: def test_method_update_overload_3(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( pat=True, - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.update( - pat=True, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -254,7 +189,6 @@ def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( pat=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -266,7 +200,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( pat=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -278,72 +211,65 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.list( - encoding="proto", - connect_protocol_version=1, + scm_integration = client.runners.configurations.scm_integrations.list() + assert_matches_type( + SyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] ) - assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + SyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] ) - assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.runners.configurations.scm_integrations.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = response.parse() - assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] + ) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.runners.configurations.scm_integrations.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = response.parse() - assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] + ) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.delete( - connect_protocol_version=1, - ) + scm_integration = client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.runners.configurations.scm_integrations.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -352,9 +278,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -371,16 +295,6 @@ class TestAsyncScmIntegrations: async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.create( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -388,7 +302,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) assert response.is_closed is True @@ -400,7 +313,6 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -414,16 +326,6 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -431,7 +333,6 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) assert response.is_closed is True @@ -443,7 +344,6 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -455,25 +355,19 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( - connect_protocol_version=1, - ) + scm_integration = await async_client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.scm_integrations.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -482,9 +376,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -497,16 +389,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( oauth_client_id="oauthClientId", - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.update( - oauth_client_id="oauthClientId", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -514,7 +396,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) assert response.is_closed is True @@ -526,7 +407,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( oauth_client_id="oauthClientId", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -540,16 +420,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -557,7 +427,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) assert response.is_closed is True @@ -569,7 +438,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( oauth_plaintext_client_secret="oauthPlaintextClientSecret", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -583,16 +451,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( pat=True, - connect_protocol_version=1, - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.update( - pat=True, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -600,7 +458,6 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( pat=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -612,7 +469,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( pat=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -624,72 +480,65 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.list( - encoding="proto", - connect_protocol_version=1, + scm_integration = await async_client.runners.configurations.scm_integrations.list() + assert_matches_type( + AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] ) - assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] ) - assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.scm_integrations.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = await response.parse() - assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] + ) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = await response.parse() - assert_matches_type(ScmIntegrationListResponse, scm_integration, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] + ) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.delete( - connect_protocol_version=1, - ) + scm_integration = await async_client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete( - connect_protocol_version=1, id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, scm_integration, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.runners.configurations.scm_integrations.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -698,9 +547,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 30cbd663..b64232aa 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -21,7 +21,6 @@ class TestConfigurations: def test_method_validate_overload_1(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( environment_class={}, - connect_protocol_version=1, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -41,9 +40,7 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non "enabled": True, "runner_id": "runnerId", }, - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -51,7 +48,6 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( environment_class={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -63,7 +59,6 @@ def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( environment_class={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -77,7 +72,6 @@ def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: def test_method_validate_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -85,9 +79,7 @@ def test_method_validate_overload_2(self, client: Gitpod) -> None: def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -95,7 +87,6 @@ def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> Non def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -107,7 +98,6 @@ def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -125,7 +115,6 @@ class TestAsyncConfigurations: async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( environment_class={}, - connect_protocol_version=1, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -145,9 +134,7 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As "enabled": True, "runner_id": "runnerId", }, - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -155,7 +142,6 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( environment_class={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -167,7 +153,6 @@ async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( environment_class={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -181,7 +166,6 @@ async def test_streaming_response_validate_overload_1(self, async_client: AsyncG async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -189,9 +173,7 @@ async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> No async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -199,7 +181,6 @@ async def test_method_validate_with_all_params_overload_2(self, async_client: As async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -211,7 +192,6 @@ async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( scm_integration={"oauth_client_id": "oauthClientId"}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index 3ca7e016..2d35e44a 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.runners import ( PolicyListResponse, PolicyCreateResponse, @@ -23,27 +24,21 @@ class TestPolicies: @parametrize def test_method_create(self, client: Gitpod) -> None: - policy = client.runners.policies.create( - connect_protocol_version=1, - ) + policy = client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="RUNNER_ROLE_UNSPECIFIED", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runners.policies.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.runners.policies.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -52,9 +47,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runners.policies.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.runners.policies.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -65,27 +58,21 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_update(self, client: Gitpod) -> None: - policy = client.runners.policies.update( - connect_protocol_version=1, - ) + policy = client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="RUNNER_ROLE_UNSPECIFIED", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.runners.policies.with_raw_response.update( - connect_protocol_version=1, - ) + response = client.runners.policies.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -94,9 +81,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.runners.policies.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + with client.runners.policies.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -107,73 +92,58 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - policy = client.runners.policies.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(PolicyListResponse, policy, path=["response"]) + policy = client.runners.policies.list() + assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.policies.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.runners.policies.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.policies.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.runners.policies.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - policy = client.runners.policies.delete( - connect_protocol_version=1, - ) + policy = client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.delete( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, policy, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.runners.policies.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.runners.policies.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -182,9 +152,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.runners.policies.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.runners.policies.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -199,27 +167,21 @@ class TestAsyncPolicies: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - policy = await async_client.runners.policies.create( - connect_protocol_version=1, - ) + policy = await async_client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="RUNNER_ROLE_UNSPECIFIED", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.policies.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.runners.policies.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -228,9 +190,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.policies.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.runners.policies.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -241,27 +201,21 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - policy = await async_client.runners.policies.update( - connect_protocol_version=1, - ) + policy = await async_client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="RUNNER_ROLE_UNSPECIFIED", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.policies.with_raw_response.update( - connect_protocol_version=1, - ) + response = await async_client.runners.policies.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -270,9 +224,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.policies.with_streaming_response.update( - connect_protocol_version=1, - ) as response: + async with async_client.runners.policies.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -283,73 +235,58 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - policy = await async_client.runners.policies.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(PolicyListResponse, policy, path=["response"]) + policy = await async_client.runners.policies.list() + assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.policies.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.runners.policies.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.policies.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.runners.policies.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PolicyListResponse, policy, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - policy = await async_client.runners.policies.delete( - connect_protocol_version=1, - ) + policy = await async_client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete( - connect_protocol_version=1, group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, policy, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.policies.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.runners.policies.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -358,9 +295,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.policies.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.runners.policies.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 3a8ce5a4..cccf5660 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -14,6 +14,7 @@ AccountGetSSOLoginURLResponse, AccountListLoginProvidersResponse, ) +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,16 +26,6 @@ class TestAccounts: def test_method_retrieve(self, client: Gitpod) -> None: account = client.accounts.retrieve( body={}, - connect_protocol_version=1, - ) - assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: - account = client.accounts.retrieve( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) @@ -42,7 +33,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.retrieve( body={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -54,7 +44,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.retrieve( body={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -66,25 +55,19 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: - account = client.accounts.delete( - connect_protocol_version=1, - ) + account = client.accounts.delete() assert_matches_type(object, account, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: account = client.accounts.delete( - connect_protocol_version=1, account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, account, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.accounts.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.accounts.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -93,9 +76,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.accounts.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.accounts.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -108,7 +89,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: def test_method_get_sso_login_url(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( return_to="https://example.com", - connect_protocol_version=1, ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -116,9 +96,7 @@ def test_method_get_sso_login_url(self, client: Gitpod) -> None: def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( return_to="https://example.com", - connect_protocol_version=1, email="dev@stainlessapi.com", - connect_timeout_ms=0, ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -126,7 +104,6 @@ def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.get_sso_login_url( return_to="https://example.com", - connect_protocol_version=1, ) assert response.is_closed is True @@ -138,7 +115,6 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.get_sso_login_url( return_to="https://example.com", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,48 +126,41 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: - account = client.accounts.list_login_providers( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + account = client.accounts.list_login_providers() + assert_matches_type(SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"]) @parametrize def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> None: account = client.accounts.list_login_providers( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"]) @parametrize def test_raw_response_list_login_providers(self, client: Gitpod) -> None: - response = client.accounts.with_raw_response.list_login_providers( - encoding="proto", - connect_protocol_version=1, - ) + response = client.accounts.with_raw_response.list_login_providers() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"]) @parametrize def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: - with client.accounts.with_streaming_response.list_login_providers( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.accounts.with_streaming_response.list_login_providers() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -203,16 +172,6 @@ class TestAsyncAccounts: async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve( body={}, - connect_protocol_version=1, - ) - assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: - account = await async_client.accounts.retrieve( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) @@ -220,7 +179,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.retrieve( body={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -232,7 +190,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.retrieve( body={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -244,25 +201,19 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - account = await async_client.accounts.delete( - connect_protocol_version=1, - ) + account = await async_client.accounts.delete() assert_matches_type(object, account, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete( - connect_protocol_version=1, account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, account, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.accounts.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.accounts.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -271,9 +222,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.accounts.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.accounts.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -286,7 +235,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( return_to="https://example.com", - connect_protocol_version=1, ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -294,9 +242,7 @@ async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( return_to="https://example.com", - connect_protocol_version=1, email="dev@stainlessapi.com", - connect_timeout_ms=0, ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -304,7 +250,6 @@ async def test_method_get_sso_login_url_with_all_params(self, async_client: Asyn async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.get_sso_login_url( return_to="https://example.com", - connect_protocol_version=1, ) assert response.is_closed is True @@ -316,7 +261,6 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.get_sso_login_url( return_to="https://example.com", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -328,47 +272,46 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: - account = await async_client.accounts.list_login_providers( - encoding="proto", - connect_protocol_version=1, + account = await async_client.accounts.list_login_providers() + assert_matches_type( + AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] ) - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) @parametrize async def test_method_list_login_providers_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] ) - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) @parametrize async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod) -> None: - response = await async_client.accounts.with_raw_response.list_login_providers( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.accounts.with_raw_response.list_login_providers() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] + ) @parametrize async def test_streaming_response_list_login_providers(self, async_client: AsyncGitpod) -> None: - async with async_client.accounts.with_streaming_response.list_login_providers( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.accounts.with_streaming_response.list_login_providers() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] + ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index ae3e02f2..1b71aa29 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -14,6 +14,7 @@ EditorRetrieveResponse, EditorResolveURLResponse, ) +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,25 +24,19 @@ class TestEditors: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - editor = client.editors.retrieve( - connect_protocol_version=1, - ) + editor = client.editors.retrieve() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: editor = client.editors.retrieve( - connect_protocol_version=1, id="id", - connect_timeout_ms=0, ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.editors.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -50,9 +45,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.editors.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,74 +56,58 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - editor = client.editors.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(EditorListResponse, editor, path=["response"]) + editor = client.editors.list() + assert_matches_type(SyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: editor = client.editors.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(EditorListResponse, editor, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.editors.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = response.parse() - assert_matches_type(EditorListResponse, editor, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.editors.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = response.parse() - assert_matches_type(EditorListResponse, editor, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_resolve_url(self, client: Gitpod) -> None: - editor = client.editors.resolve_url( - connect_protocol_version=1, - ) + editor = client.editors.resolve_url() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) @parametrize def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: editor = client.editors.resolve_url( - connect_protocol_version=1, editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.resolve_url( - connect_protocol_version=1, - ) + response = client.editors.with_raw_response.resolve_url() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -139,9 +116,7 @@ def test_raw_response_resolve_url(self, client: Gitpod) -> None: @parametrize def test_streaming_response_resolve_url(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.resolve_url( - connect_protocol_version=1, - ) as response: + with client.editors.with_streaming_response.resolve_url() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -156,25 +131,19 @@ class TestAsyncEditors: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.retrieve( - connect_protocol_version=1, - ) + editor = await async_client.editors.retrieve() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( - connect_protocol_version=1, id="id", - connect_timeout_ms=0, ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.editors.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -183,9 +152,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.editors.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -196,74 +163,58 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(EditorListResponse, editor, path=["response"]) + editor = await async_client.editors.list() + assert_matches_type(AsyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(EditorListResponse, editor, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.editors.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = await response.parse() - assert_matches_type(EditorListResponse, editor, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.editors.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = await response.parse() - assert_matches_type(EditorListResponse, editor, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.resolve_url( - connect_protocol_version=1, - ) + editor = await async_client.editors.resolve_url() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) @parametrize async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( - connect_protocol_version=1, editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.resolve_url( - connect_protocol_version=1, - ) + response = await async_client.editors.with_raw_response.resolve_url() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -272,9 +223,7 @@ async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None @parametrize async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.resolve_url( - connect_protocol_version=1, - ) as response: + async with async_client.editors.with_streaming_response.resolve_url() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index fd55df72..13b033fd 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -17,6 +17,7 @@ EnvironmentCreateFromProjectResponse, ) from gitpod._utils import parse_datetime +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,15 +27,12 @@ class TestEnvironments: @parametrize def test_method_create(self, client: Gitpod) -> None: - environment = client.environments.create( - connect_protocol_version=1, - ) + environment = client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( - connect_protocol_version=1, spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -81,15 +79,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "timeout": {"disconnected": "+9125115.360s"}, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,9 +93,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -111,25 +104,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - environment = client.environments.retrieve( - connect_protocol_version=1, - ) + environment = client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment = client.environments.retrieve( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -138,9 +125,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -153,16 +138,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: environment = client.environments.update( metadata={}, - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - environment = client.environments.update( - metadata={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @@ -170,7 +145,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( metadata={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -182,7 +156,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( metadata={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -196,16 +169,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: environment = client.environments.update( spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - environment = client.environments.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @@ -213,7 +176,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -225,7 +187,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -237,73 +198,65 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - environment = client.environments.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + environment = client.environments.list() + assert_matches_type(SyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={ + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], + }, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = response.parse() - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = response.parse() - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - environment = client.environments.delete( - connect_protocol_version=1, - ) + environment = client.environments.delete() assert_matches_type(object, environment, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: environment = client.environments.delete( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -312,9 +265,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -325,15 +276,12 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: - environment = client.environments.create_from_project( - connect_protocol_version=1, - ) + environment = client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", @@ -381,15 +329,12 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "timeout": {"disconnected": "+9125115.360s"}, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize def test_raw_response_create_from_project(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.create_from_project( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.create_from_project() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -398,9 +343,7 @@ def test_raw_response_create_from_project(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_from_project(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.create_from_project( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.create_from_project() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -411,25 +354,19 @@ def test_streaming_response_create_from_project(self, client: Gitpod) -> None: @parametrize def test_method_create_logs_token(self, client: Gitpod) -> None: - environment = client.environments.create_logs_token( - connect_protocol_version=1, - ) + environment = client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) @parametrize def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_logs_token( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) @parametrize def test_raw_response_create_logs_token(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.create_logs_token( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.create_logs_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -438,9 +375,7 @@ def test_raw_response_create_logs_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.create_logs_token( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.create_logs_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -451,29 +386,23 @@ def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: @parametrize def test_method_mark_active(self, client: Gitpod) -> None: - environment = client.environments.mark_active( - connect_protocol_version=1, - ) + environment = client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) @parametrize def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: environment = client.environments.mark_active( - connect_protocol_version=1, activity_signal={ "source": "xxx", "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), }, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize def test_raw_response_mark_active(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.mark_active( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.mark_active() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -482,9 +411,7 @@ def test_raw_response_mark_active(self, client: Gitpod) -> None: @parametrize def test_streaming_response_mark_active(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.mark_active( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.mark_active() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -495,25 +422,19 @@ def test_streaming_response_mark_active(self, client: Gitpod) -> None: @parametrize def test_method_start(self, client: Gitpod) -> None: - environment = client.environments.start( - connect_protocol_version=1, - ) + environment = client.environments.start() assert_matches_type(object, environment, path=["response"]) @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize def test_raw_response_start(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.start( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -522,9 +443,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -535,25 +454,19 @@ def test_streaming_response_start(self, client: Gitpod) -> None: @parametrize def test_method_stop(self, client: Gitpod) -> None: - environment = client.environments.stop( - connect_protocol_version=1, - ) + environment = client.environments.stop() assert_matches_type(object, environment, path=["response"]) @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: environment = client.environments.stop( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.stop( - connect_protocol_version=1, - ) + response = client.environments.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -562,9 +475,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + with client.environments.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -579,15 +490,12 @@ class TestAsyncEnvironments: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.create( - connect_protocol_version=1, - ) + environment = await async_client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( - connect_protocol_version=1, spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -634,15 +542,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "timeout": {"disconnected": "+9125115.360s"}, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -651,9 +556,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -664,25 +567,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.retrieve( - connect_protocol_version=1, - ) + environment = await async_client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -691,9 +588,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -706,16 +601,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( metadata={}, - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.update( - metadata={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @@ -723,7 +608,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( metadata={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -735,7 +619,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( metadata={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -749,16 +632,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, - ) - assert_matches_type(object, environment, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @@ -766,7 +639,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -778,7 +650,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -790,73 +661,65 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + environment = await async_client.environments.list() + assert_matches_type(AsyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={ + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], + }, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = await response.parse() - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = await response.parse() - assert_matches_type(EnvironmentListResponse, environment, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.delete( - connect_protocol_version=1, - ) + environment = await async_client.environments.delete() assert_matches_type(object, environment, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", force=True, - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -865,9 +728,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -878,15 +739,12 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.create_from_project( - connect_protocol_version=1, - ) + environment = await async_client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", @@ -934,15 +792,12 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "timeout": {"disconnected": "+9125115.360s"}, }, - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @parametrize async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.create_from_project( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.create_from_project() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -951,9 +806,7 @@ async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) @parametrize async def test_streaming_response_create_from_project(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.create_from_project( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.create_from_project() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -964,25 +817,19 @@ async def test_streaming_response_create_from_project(self, async_client: AsyncG @parametrize async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.create_logs_token( - connect_protocol_version=1, - ) + environment = await async_client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) @parametrize async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) @parametrize async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.create_logs_token( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.create_logs_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -991,9 +838,7 @@ async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.create_logs_token( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.create_logs_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1004,29 +849,23 @@ async def test_streaming_response_create_logs_token(self, async_client: AsyncGit @parametrize async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.mark_active( - connect_protocol_version=1, - ) + environment = await async_client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) @parametrize async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active( - connect_protocol_version=1, activity_signal={ "source": "xxx", "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), }, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.mark_active( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.mark_active() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1035,9 +874,7 @@ async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None @parametrize async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.mark_active( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.mark_active() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1048,25 +885,19 @@ async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) - @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.start( - connect_protocol_version=1, - ) + environment = await async_client.environments.start() assert_matches_type(object, environment, path=["response"]) @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.start( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.start() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1075,9 +906,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.start( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.start() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1088,25 +917,19 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.stop( - connect_protocol_version=1, - ) + environment = await async_client.environments.stop() assert_matches_type(object, environment, path=["response"]) @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, environment, path=["response"]) @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.stop( - connect_protocol_version=1, - ) + response = await async_client.environments.with_raw_response.stop() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1115,9 +938,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.stop( - connect_protocol_version=1, - ) as response: + async with async_client.environments.with_streaming_response.stop() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index d24091bb..ad43b458 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -10,6 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import EventListResponse, EventWatchResponse +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,48 +21,44 @@ class TestEvents: @parametrize def test_method_list(self, client: Gitpod) -> None: - event = client.events.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(EventListResponse, event, path=["response"]) + event = client.events.list() + assert_matches_type(SyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: event = client.events.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(EventListResponse, event, path=["response"]) + token="token", + page_size=0, + filter={ + "actor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "actor_principals": ["PRINCIPAL_UNSPECIFIED"], + "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.events.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.events.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(EventListResponse, event, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.events.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.events.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(EventListResponse, event, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,17 +67,6 @@ def test_streaming_response_list(self, client: Gitpod) -> None: def test_method_watch_overload_1(self, client: Gitpod) -> None: event = client.events.watch( environment_id="environmentId", - connect_protocol_version=1, - ) - assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) - - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") - @parametrize - def test_method_watch_with_all_params_overload_1(self, client: Gitpod) -> None: - event = client.events.watch( - environment_id="environmentId", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) @@ -89,7 +75,6 @@ def test_method_watch_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_watch_overload_1(self, client: Gitpod) -> None: response = client.events.with_raw_response.watch( environment_id="environmentId", - connect_protocol_version=1, ) assert response.is_closed is True @@ -102,7 +87,6 @@ def test_raw_response_watch_overload_1(self, client: Gitpod) -> None: def test_streaming_response_watch_overload_1(self, client: Gitpod) -> None: with client.events.with_streaming_response.watch( environment_id="environmentId", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -117,17 +101,6 @@ def test_streaming_response_watch_overload_1(self, client: Gitpod) -> None: def test_method_watch_overload_2(self, client: Gitpod) -> None: event = client.events.watch( organization=True, - connect_protocol_version=1, - ) - assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) - - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") - @parametrize - def test_method_watch_with_all_params_overload_2(self, client: Gitpod) -> None: - event = client.events.watch( - organization=True, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) @@ -136,7 +109,6 @@ def test_method_watch_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_watch_overload_2(self, client: Gitpod) -> None: response = client.events.with_raw_response.watch( organization=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -149,7 +121,6 @@ def test_raw_response_watch_overload_2(self, client: Gitpod) -> None: def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: with client.events.with_streaming_response.watch( organization=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -165,48 +136,44 @@ class TestAsyncEvents: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - event = await async_client.events.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(EventListResponse, event, path=["response"]) + event = await async_client.events.list() + assert_matches_type(AsyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, - ) - assert_matches_type(EventListResponse, event, path=["response"]) + token="token", + page_size=0, + filter={ + "actor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "actor_principals": ["PRINCIPAL_UNSPECIFIED"], + "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.events.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.events.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(EventListResponse, event, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.events.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.events.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(EventListResponse, event, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -215,17 +182,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async def test_method_watch_overload_1(self, async_client: AsyncGitpod) -> None: event = await async_client.events.watch( environment_id="environmentId", - connect_protocol_version=1, - ) - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) - - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") - @parametrize - async def test_method_watch_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - event = await async_client.events.watch( - environment_id="environmentId", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) @@ -234,7 +190,6 @@ async def test_method_watch_with_all_params_overload_1(self, async_client: Async async def test_raw_response_watch_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.watch( environment_id="environmentId", - connect_protocol_version=1, ) assert response.is_closed is True @@ -247,7 +202,6 @@ async def test_raw_response_watch_overload_1(self, async_client: AsyncGitpod) -> async def test_streaming_response_watch_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.watch( environment_id="environmentId", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -262,17 +216,6 @@ async def test_streaming_response_watch_overload_1(self, async_client: AsyncGitp async def test_method_watch_overload_2(self, async_client: AsyncGitpod) -> None: event = await async_client.events.watch( organization=True, - connect_protocol_version=1, - ) - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) - - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") - @parametrize - async def test_method_watch_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - event = await async_client.events.watch( - organization=True, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) @@ -281,7 +224,6 @@ async def test_method_watch_with_all_params_overload_2(self, async_client: Async async def test_raw_response_watch_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.watch( organization=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -294,7 +236,6 @@ async def test_raw_response_watch_overload_2(self, async_client: AsyncGitpod) -> async def test_streaming_response_watch_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.watch( organization=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index a7c2f9ba..449a34fe 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -10,6 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import GroupListResponse +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,48 +20,38 @@ class TestGroups: @parametrize def test_method_list(self, client: Gitpod) -> None: - group = client.groups.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(GroupListResponse, group, path=["response"]) + group = client.groups.list() + assert_matches_type(SyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: group = client.groups.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(GroupListResponse, group, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.groups.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.groups.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(GroupListResponse, group, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.groups.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.groups.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(GroupListResponse, group, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,47 +61,37 @@ class TestAsyncGroups: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - group = await async_client.groups.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(GroupListResponse, group, path=["response"]) + group = await async_client.groups.list() + assert_matches_type(AsyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(GroupListResponse, group, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.groups.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.groups.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(GroupListResponse, group, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.groups.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.groups.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(GroupListResponse, group, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index ae92d5e8..bdd08d3e 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -23,25 +23,19 @@ class TestIdentity: @parametrize def test_method_exchange_token(self, client: Gitpod) -> None: - identity = client.identity.exchange_token( - connect_protocol_version=1, - ) + identity = client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.exchange_token( - connect_protocol_version=1, exchange_token="exchangeToken", - connect_timeout_ms=0, ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize def test_raw_response_exchange_token(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.exchange_token( - connect_protocol_version=1, - ) + response = client.identity.with_raw_response.exchange_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -50,9 +44,7 @@ def test_raw_response_exchange_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_exchange_token(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.exchange_token( - connect_protocol_version=1, - ) as response: + with client.identity.with_streaming_response.exchange_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -65,16 +57,6 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: def test_method_get_authenticated_identity(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( body={}, - connect_protocol_version=1, - ) - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: - identity = client.identity.get_authenticated_identity( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -82,7 +64,6 @@ def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_authenticated_identity( body={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -94,7 +75,6 @@ def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_authenticated_identity( body={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,25 +86,19 @@ def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> @parametrize def test_method_get_id_token(self, client: Gitpod) -> None: - identity = client.identity.get_id_token( - connect_protocol_version=1, - ) + identity = client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( - connect_protocol_version=1, audience=["string"], - connect_timeout_ms=0, ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize def test_raw_response_get_id_token(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.get_id_token( - connect_protocol_version=1, - ) + response = client.identity.with_raw_response.get_id_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -133,9 +107,7 @@ def test_raw_response_get_id_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_id_token(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.get_id_token( - connect_protocol_version=1, - ) as response: + with client.identity.with_streaming_response.get_id_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,25 +122,19 @@ class TestAsyncIdentity: @parametrize async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.exchange_token( - connect_protocol_version=1, - ) + identity = await async_client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token( - connect_protocol_version=1, exchange_token="exchangeToken", - connect_timeout_ms=0, ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @parametrize async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.exchange_token( - connect_protocol_version=1, - ) + response = await async_client.identity.with_raw_response.exchange_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -177,9 +143,7 @@ async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> N @parametrize async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.exchange_token( - connect_protocol_version=1, - ) as response: + async with async_client.identity.with_streaming_response.exchange_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -192,16 +156,6 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( body={}, - connect_protocol_version=1, - ) - assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - - @parametrize - async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.get_authenticated_identity( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) @@ -209,7 +163,6 @@ async def test_method_get_authenticated_identity_with_all_params(self, async_cli async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_authenticated_identity( body={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -221,7 +174,6 @@ async def test_raw_response_get_authenticated_identity(self, async_client: Async async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_authenticated_identity( body={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -233,25 +185,19 @@ async def test_streaming_response_get_authenticated_identity(self, async_client: @parametrize async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: - identity = await async_client.identity.get_id_token( - connect_protocol_version=1, - ) + identity = await async_client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( - connect_protocol_version=1, audience=["string"], - connect_timeout_ms=0, ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @parametrize async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.get_id_token( - connect_protocol_version=1, - ) + response = await async_client.identity.with_raw_response.get_id_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -260,9 +206,7 @@ async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> Non @parametrize async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.get_id_token( - connect_protocol_version=1, - ) as response: + async with async_client.identity.with_streaming_response.get_id_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 73fee220..cbb26052 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -17,6 +17,7 @@ OrganizationRetrieveResponse, OrganizationListMembersResponse, ) +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,27 +27,21 @@ class TestOrganizations: @parametrize def test_method_create(self, client: Gitpod) -> None: - organization = client.organizations.create( - connect_protocol_version=1, - ) + organization = client.organizations.create() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.create( - connect_protocol_version=1, invite_accounts_with_matching_domain=True, join_organization=True, name="xxx", - connect_timeout_ms=0, ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -55,9 +50,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -68,25 +61,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - organization = client.organizations.retrieve( - connect_protocol_version=1, - ) + organization = client.organizations.retrieve() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.retrieve( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -95,9 +82,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -110,7 +95,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( invite_domains={}, - connect_protocol_version=1, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @@ -118,8 +102,6 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @@ -127,7 +109,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( invite_domains={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -139,7 +120,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( invite_domains={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -153,16 +133,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: organization = client.organizations.update( name="name", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - organization = client.organizations.update( - name="name", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @@ -170,7 +140,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( name="name", - connect_protocol_version=1, ) assert response.is_closed is True @@ -182,7 +151,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( name="name", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -194,72 +162,57 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - organization = client.organizations.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationListResponse, organization, path=["response"]) + organization = client.organizations.list() + assert_matches_type(SyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + scope="SCOPE_UNSPECIFIED", ) - assert_matches_type(OrganizationListResponse, organization, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(OrganizationListResponse, organization, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(OrganizationListResponse, organization, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - organization = client.organizations.delete( - connect_protocol_version=1, - ) + organization = client.organizations.delete() assert_matches_type(object, organization, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.delete( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -268,9 +221,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -283,16 +234,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: def test_method_join_overload_1(self, client: Gitpod) -> None: organization = client.organizations.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - def test_method_join_with_all_params_overload_1(self, client: Gitpod) -> None: - organization = client.organizations.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -300,7 +241,6 @@ def test_method_join_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_join_overload_1(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, ) assert response.is_closed is True @@ -312,7 +252,6 @@ def test_raw_response_join_overload_1(self, client: Gitpod) -> None: def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -326,16 +265,6 @@ def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: def test_method_join_overload_2(self, client: Gitpod) -> None: organization = client.organizations.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - def test_method_join_with_all_params_overload_2(self, client: Gitpod) -> None: - organization = client.organizations.join( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -343,7 +272,6 @@ def test_method_join_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_join_overload_2(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, ) assert response.is_closed is True @@ -355,7 +283,6 @@ def test_raw_response_join_overload_2(self, client: Gitpod) -> None: def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -367,25 +294,19 @@ def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_leave(self, client: Gitpod) -> None: - organization = client.organizations.leave( - connect_protocol_version=1, - ) + organization = client.organizations.leave() assert_matches_type(object, organization, path=["response"]) @parametrize def test_method_leave_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.leave( - connect_protocol_version=1, user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.leave( - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.leave() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -394,9 +315,7 @@ def test_raw_response_leave(self, client: Gitpod) -> None: @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.leave( - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.leave() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -407,74 +326,67 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: @parametrize def test_method_list_members(self, client: Gitpod) -> None: - organization = client.organizations.list_members( - encoding="proto", - connect_protocol_version=1, + organization = client.organizations.list_members() + assert_matches_type( + SyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] ) - assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + SyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] ) - assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.list_members( - encoding="proto", - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.list_members() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] + ) @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.list_members( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.list_members() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + assert_matches_type( + SyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] + ) assert cast(Any, response.is_closed) is True @parametrize def test_method_set_role(self, client: Gitpod) -> None: - organization = client.organizations.set_role( - connect_protocol_version=1, - ) + organization = client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) @parametrize def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="ORGANIZATION_ROLE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.set_role( - connect_protocol_version=1, - ) + response = client.organizations.with_raw_response.set_role() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -483,9 +395,7 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.set_role( - connect_protocol_version=1, - ) as response: + with client.organizations.with_streaming_response.set_role() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -500,27 +410,21 @@ class TestAsyncOrganizations: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.create( - connect_protocol_version=1, - ) + organization = await async_client.organizations.create() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( - connect_protocol_version=1, invite_accounts_with_matching_domain=True, join_organization=True, name="xxx", - connect_timeout_ms=0, ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -529,9 +433,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -542,25 +444,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.retrieve( - connect_protocol_version=1, - ) + organization = await async_client.organizations.retrieve() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -569,9 +465,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -584,7 +478,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( invite_domains={}, - connect_protocol_version=1, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @@ -592,8 +485,6 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @@ -601,7 +492,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( invite_domains={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -613,7 +503,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( invite_domains={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -627,16 +516,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( name="name", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.update( - name="name", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @@ -644,7 +523,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( name="name", - connect_protocol_version=1, ) assert response.is_closed is True @@ -656,7 +534,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( name="name", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -668,72 +545,59 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationListResponse, organization, path=["response"]) + organization = await async_client.organizations.list() + assert_matches_type(AsyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + scope="SCOPE_UNSPECIFIED", ) - assert_matches_type(OrganizationListResponse, organization, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(OrganizationListResponse, organization, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(OrganizationListResponse, organization, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"] + ) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.delete( - connect_protocol_version=1, - ) + organization = await async_client.organizations.delete() assert_matches_type(object, organization, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -742,9 +606,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -757,16 +619,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non async def test_method_join_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - async def test_method_join_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -774,7 +626,6 @@ async def test_method_join_with_all_params_overload_1(self, async_client: AsyncG async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, ) assert response.is_closed is True @@ -786,7 +637,6 @@ async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -800,16 +650,6 @@ async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpo async def test_method_join_overload_2(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, - ) - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @parametrize - async def test_method_join_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.join( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -817,7 +657,6 @@ async def test_method_join_with_all_params_overload_2(self, async_client: AsyncG async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, ) assert response.is_closed is True @@ -829,7 +668,6 @@ async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -841,25 +679,19 @@ async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpo @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.leave( - connect_protocol_version=1, - ) + organization = await async_client.organizations.leave() assert_matches_type(object, organization, path=["response"]) @parametrize async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( - connect_protocol_version=1, user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.leave( - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.leave() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -868,9 +700,7 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.leave( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.leave() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -881,74 +711,67 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.list_members( - encoding="proto", - connect_protocol_version=1, + organization = await async_client.organizations.list_members() + assert_matches_type( + AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] ) - assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type( + AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] ) - assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.list_members( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.list_members() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] + ) @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.list_members( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.list_members() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(OrganizationListMembersResponse, organization, path=["response"]) + assert_matches_type( + AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] + ) assert cast(Any, response.is_closed) is True @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.set_role( - connect_protocol_version=1, - ) + organization = await async_client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) @parametrize async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( - connect_protocol_version=1, organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", role="ORGANIZATION_ROLE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, organization, path=["response"]) @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.set_role( - connect_protocol_version=1, - ) + response = await async_client.organizations.with_raw_response.set_role() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -957,9 +780,7 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.set_role( - connect_protocol_version=1, - ) as response: + async with async_client.organizations.with_streaming_response.set_role() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index a607e84e..869f880e 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -16,6 +16,7 @@ ProjectRetrieveResponse, ProjectCreateFromEnvironmentResponse, ) +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +29,6 @@ def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -37,11 +37,9 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="x", - connect_timeout_ms=0, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -50,7 +48,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -63,7 +60,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -75,25 +71,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - project = client.projects.retrieve( - connect_protocol_version=1, - ) + project = client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.projects.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -102,9 +92,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.projects.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -117,16 +105,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: project = client.projects.update( automations_file_path="automationsFilePath", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - project = client.projects.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -134,7 +112,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( automations_file_path="automationsFilePath", - connect_protocol_version=1, ) assert response.is_closed is True @@ -146,7 +123,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( automations_file_path="automationsFilePath", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -160,16 +136,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: project = client.projects.update( devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - project = client.projects.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -177,7 +143,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, ) assert response.is_closed is True @@ -189,7 +154,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -203,16 +167,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: def test_method_update_overload_3(self, client: Gitpod) -> None: project = client.projects.update( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: - project = client.projects.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -220,7 +174,6 @@ def test_method_update_with_all_params_overload_3(self, client: Gitpod) -> None: def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -232,7 +185,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -246,7 +198,6 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: def test_method_update_overload_4(self, client: Gitpod) -> None: project = client.projects.update( initializer={}, - connect_protocol_version=1, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -254,8 +205,6 @@ def test_method_update_overload_4(self, client: Gitpod) -> None: def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: project = client.projects.update( initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -263,7 +212,6 @@ def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: def test_raw_response_update_overload_4(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( initializer={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -275,7 +223,6 @@ def test_raw_response_update_overload_4(self, client: Gitpod) -> None: def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( initializer={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,16 +236,6 @@ def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: def test_method_update_overload_5(self, client: Gitpod) -> None: project = client.projects.update( name="x", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: - project = client.projects.update( - name="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -306,7 +243,6 @@ def test_method_update_with_all_params_overload_5(self, client: Gitpod) -> None: def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( name="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -318,7 +254,6 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( name="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -330,72 +265,56 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - project = client.projects.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(ProjectListResponse, project, path=["response"]) + project = client.projects.list() + assert_matches_type(SyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: project = client.projects.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(ProjectListResponse, project, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.projects.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = response.parse() - assert_matches_type(ProjectListResponse, project, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.projects.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = response.parse() - assert_matches_type(ProjectListResponse, project, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - project = client.projects.delete( - connect_protocol_version=1, - ) + project = client.projects.delete() assert_matches_type(object, project, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: project = client.projects.delete( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, project, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.projects.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -404,9 +323,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.projects.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -417,26 +334,20 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: - project = client.projects.create_from_environment( - connect_protocol_version=1, - ) + project = client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name="x", - connect_timeout_ms=0, ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize def test_raw_response_create_from_environment(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.create_from_environment( - connect_protocol_version=1, - ) + response = client.projects.with_raw_response.create_from_environment() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -445,9 +356,7 @@ def test_raw_response_create_from_environment(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_from_environment(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.create_from_environment( - connect_protocol_version=1, - ) as response: + with client.projects.with_streaming_response.create_from_environment() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -465,7 +374,6 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -474,11 +382,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> project = await async_client.projects.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - connect_protocol_version=1, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="x", - connect_timeout_ms=0, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -487,7 +393,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -500,7 +405,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non async with async_client.projects.with_streaming_response.create( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, initializer={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -512,25 +416,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.retrieve( - connect_protocol_version=1, - ) + project = await async_client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.projects.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -539,9 +437,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.projects.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -554,16 +450,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( automations_file_path="automationsFilePath", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - automations_file_path="automationsFilePath", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -571,7 +457,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( automations_file_path="automationsFilePath", - connect_protocol_version=1, ) assert response.is_closed is True @@ -583,7 +468,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( automations_file_path="automationsFilePath", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -597,16 +481,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -614,7 +488,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, ) assert response.is_closed is True @@ -626,7 +499,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( devcontainer_file_path="devcontainerFilePath", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -640,16 +512,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_3(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -657,7 +519,6 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -669,7 +530,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -683,7 +543,6 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( initializer={}, - connect_protocol_version=1, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -691,8 +550,6 @@ async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -700,7 +557,6 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( initializer={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -712,7 +568,6 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( initializer={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -726,16 +581,6 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncGit async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( name="x", - connect_protocol_version=1, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_5(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - name="x", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -743,7 +588,6 @@ async def test_method_update_with_all_params_overload_5(self, async_client: Asyn async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( name="x", - connect_protocol_version=1, ) assert response.is_closed is True @@ -755,7 +599,6 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( name="x", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -767,72 +610,56 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(ProjectListResponse, project, path=["response"]) + project = await async_client.projects.list() + assert_matches_type(AsyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(ProjectListResponse, project, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.projects.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = await response.parse() - assert_matches_type(ProjectListResponse, project, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.projects.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = await response.parse() - assert_matches_type(ProjectListResponse, project, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.delete( - connect_protocol_version=1, - ) + project = await async_client.projects.delete() assert_matches_type(object, project, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete( - connect_protocol_version=1, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, project, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.projects.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -841,9 +668,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.projects.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -854,26 +679,20 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.create_from_environment( - connect_protocol_version=1, - ) + project = await async_client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( - connect_protocol_version=1, environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name="x", - connect_timeout_ms=0, ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @parametrize async def test_raw_response_create_from_environment(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.create_from_environment( - connect_protocol_version=1, - ) + response = await async_client.projects.with_raw_response.create_from_environment() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -882,9 +701,7 @@ async def test_raw_response_create_from_environment(self, async_client: AsyncGit @parametrize async def test_streaming_response_create_from_environment(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.create_from_environment( - connect_protocol_version=1, - ) as response: + async with async_client.projects.with_streaming_response.create_from_environment() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index cc697546..b752f186 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -17,6 +17,7 @@ RunnerCreateRunnerTokenResponse, RunnerCheckAuthenticationForHostResponse, ) +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,15 +27,12 @@ class TestRunners: @parametrize def test_method_create(self, client: Gitpod) -> None: - runner = client.runners.create( - connect_protocol_version=1, - ) + runner = client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( - connect_protocol_version=1, kind="RUNNER_KIND_UNSPECIFIED", name="xxx", provider="RUNNER_PROVIDER_UNSPECIFIED", @@ -46,15 +44,12 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, - connect_timeout_ms=0, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.create( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,9 +58,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -76,25 +69,19 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - runner = client.runners.retrieve( - connect_protocol_version=1, - ) + runner = client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -103,9 +90,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -118,16 +103,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: def test_method_update_overload_1(self, client: Gitpod) -> None: runner = client.runners.update( name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: - runner = client.runners.update( - name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -135,7 +110,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( name="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -147,7 +121,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( name="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -161,16 +134,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: def test_method_update_overload_2(self, client: Gitpod) -> None: runner = client.runners.update( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: - runner = client.runners.update( - spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -178,7 +141,6 @@ def test_method_update_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -190,7 +152,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -202,73 +163,62 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - runner = client.runners.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(RunnerListResponse, runner, path=["response"]) + runner = client.runners.list() + assert_matches_type(SyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={ + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "kinds": ["RUNNER_KIND_UNSPECIFIED"], + "providers": ["RUNNER_PROVIDER_UNSPECIFIED"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - runner = client.runners.delete( - connect_protocol_version=1, - ) + runner = client.runners.delete() assert_matches_type(object, runner, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete( - connect_protocol_version=1, force=True, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -277,9 +227,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -290,26 +238,20 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_check_authentication_for_host(self, client: Gitpod) -> None: - runner = client.runners.check_authentication_for_host( - connect_protocol_version=1, - ) + runner = client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( - connect_protocol_version=1, host="host", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.check_authentication_for_host( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.check_authentication_for_host() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -318,9 +260,7 @@ def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> Non @parametrize def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.check_authentication_for_host( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.check_authentication_for_host() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -331,25 +271,19 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: - runner = client.runners.create_runner_token( - connect_protocol_version=1, - ) + runner = client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize def test_raw_response_create_runner_token(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.create_runner_token( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.create_runner_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -358,9 +292,7 @@ def test_raw_response_create_runner_token(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.create_runner_token( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.create_runner_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -371,26 +303,20 @@ def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: @parametrize def test_method_parse_context_url(self, client: Gitpod) -> None: - runner = client.runners.parse_context_url( - connect_protocol_version=1, - ) + runner = client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( - connect_protocol_version=1, context_url="https://example.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize def test_raw_response_parse_context_url(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.parse_context_url( - connect_protocol_version=1, - ) + response = client.runners.with_raw_response.parse_context_url() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -399,9 +325,7 @@ def test_raw_response_parse_context_url(self, client: Gitpod) -> None: @parametrize def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.parse_context_url( - connect_protocol_version=1, - ) as response: + with client.runners.with_streaming_response.parse_context_url() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -416,15 +340,12 @@ class TestAsyncRunners: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.create( - connect_protocol_version=1, - ) + runner = await async_client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( - connect_protocol_version=1, kind="RUNNER_KIND_UNSPECIFIED", name="xxx", provider="RUNNER_PROVIDER_UNSPECIFIED", @@ -436,15 +357,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, - connect_timeout_ms=0, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.create( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -453,9 +371,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.create( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -466,25 +382,19 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.retrieve( - connect_protocol_version=1, - ) + runner = await async_client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.retrieve( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -493,9 +403,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.retrieve( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -508,16 +416,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( name="xxx", - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update( - name="xxx", - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -525,7 +423,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( name="xxx", - connect_protocol_version=1, ) assert response.is_closed is True @@ -537,7 +434,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( name="xxx", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -551,16 +447,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, - ) - assert_matches_type(object, runner, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update( - spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @@ -568,7 +454,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -580,7 +465,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( spec={"configuration": {"auto_update": True}}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -592,73 +476,62 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(RunnerListResponse, runner, path=["response"]) + runner = await async_client.runners.list() + assert_matches_type(AsyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={ + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "kinds": ["RUNNER_KIND_UNSPECIFIED"], + "providers": ["RUNNER_PROVIDER_UNSPECIFIED"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(RunnerListResponse, runner, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.delete( - connect_protocol_version=1, - ) + runner = await async_client.runners.delete() assert_matches_type(object, runner, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete( - connect_protocol_version=1, force=True, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, runner, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -667,9 +540,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -680,26 +551,20 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.check_authentication_for_host( - connect_protocol_version=1, - ) + runner = await async_client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( - connect_protocol_version=1, host="host", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @parametrize async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.check_authentication_for_host( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.check_authentication_for_host() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -708,9 +573,7 @@ async def test_raw_response_check_authentication_for_host(self, async_client: As @parametrize async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.check_authentication_for_host( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.check_authentication_for_host() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -721,25 +584,19 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.create_runner_token( - connect_protocol_version=1, - ) + runner = await async_client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( - connect_protocol_version=1, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @parametrize async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.create_runner_token( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.create_runner_token() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -748,9 +605,7 @@ async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) @parametrize async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.create_runner_token( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.create_runner_token() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -761,26 +616,20 @@ async def test_streaming_response_create_runner_token(self, async_client: AsyncG @parametrize async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.parse_context_url( - connect_protocol_version=1, - ) + runner = await async_client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( - connect_protocol_version=1, context_url="https://example.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @parametrize async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.parse_context_url( - connect_protocol_version=1, - ) + response = await async_client.runners.with_raw_response.parse_context_url() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -789,9 +638,7 @@ async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.parse_context_url( - connect_protocol_version=1, - ) as response: + async with async_client.runners.with_streaming_response.parse_context_url() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index a7a0be4b..8d14e621 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -14,6 +14,7 @@ SecretCreateResponse, SecretGetValueResponse, ) +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +26,6 @@ class TestSecrets: def test_method_create_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( environment_variable=True, - connect_protocol_version=1, ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -33,11 +33,9 @@ def test_method_create_overload_1(self, client: Gitpod) -> None: def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( environment_variable=True, - connect_protocol_version=1, name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", - connect_timeout_ms=0, ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -45,7 +43,6 @@ def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create( environment_variable=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -57,7 +54,6 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create( environment_variable=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -71,7 +67,6 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: def test_method_create_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( file_path="filePath", - connect_protocol_version=1, ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -79,11 +74,9 @@ def test_method_create_overload_2(self, client: Gitpod) -> None: def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( file_path="filePath", - connect_protocol_version=1, name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", - connect_timeout_ms=0, ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -91,7 +84,6 @@ def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create( file_path="filePath", - connect_protocol_version=1, ) assert response.is_closed is True @@ -103,7 +95,6 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create( file_path="filePath", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -115,72 +106,57 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: - secret = client.secrets.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(SecretListResponse, secret, path=["response"]) + secret = client.secrets.list() + assert_matches_type(SyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(SecretListResponse, secret, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.secrets.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.secrets.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = response.parse() - assert_matches_type(SecretListResponse, secret, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.secrets.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.secrets.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = response.parse() - assert_matches_type(SecretListResponse, secret, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - secret = client.secrets.delete( - connect_protocol_version=1, - ) + secret = client.secrets.delete() assert_matches_type(object, secret, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.delete( - connect_protocol_version=1, secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, secret, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.secrets.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.secrets.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -189,9 +165,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.secrets.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.secrets.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -202,25 +176,19 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_get_value(self, client: Gitpod) -> None: - secret = client.secrets.get_value( - connect_protocol_version=1, - ) + secret = client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @parametrize def test_method_get_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.get_value( - connect_protocol_version=1, secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @parametrize def test_raw_response_get_value(self, client: Gitpod) -> None: - response = client.secrets.with_raw_response.get_value( - connect_protocol_version=1, - ) + response = client.secrets.with_raw_response.get_value() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -229,9 +197,7 @@ def test_raw_response_get_value(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_value(self, client: Gitpod) -> None: - with client.secrets.with_streaming_response.get_value( - connect_protocol_version=1, - ) as response: + with client.secrets.with_streaming_response.get_value() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -242,26 +208,20 @@ def test_streaming_response_get_value(self, client: Gitpod) -> None: @parametrize def test_method_update_value(self, client: Gitpod) -> None: - secret = client.secrets.update_value( - connect_protocol_version=1, - ) + secret = client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) @parametrize def test_method_update_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.update_value( - connect_protocol_version=1, secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", - connect_timeout_ms=0, ) assert_matches_type(object, secret, path=["response"]) @parametrize def test_raw_response_update_value(self, client: Gitpod) -> None: - response = client.secrets.with_raw_response.update_value( - connect_protocol_version=1, - ) + response = client.secrets.with_raw_response.update_value() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -270,9 +230,7 @@ def test_raw_response_update_value(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update_value(self, client: Gitpod) -> None: - with client.secrets.with_streaming_response.update_value( - connect_protocol_version=1, - ) as response: + with client.secrets.with_streaming_response.update_value() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,7 +247,6 @@ class TestAsyncSecrets: async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( environment_variable=True, - connect_protocol_version=1, ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -297,11 +254,9 @@ async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( environment_variable=True, - connect_protocol_version=1, name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", - connect_timeout_ms=0, ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -309,7 +264,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create( environment_variable=True, - connect_protocol_version=1, ) assert response.is_closed is True @@ -321,7 +275,6 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create( environment_variable=True, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -335,7 +288,6 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( file_path="filePath", - connect_protocol_version=1, ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -343,11 +295,9 @@ async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( file_path="filePath", - connect_protocol_version=1, name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", - connect_timeout_ms=0, ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -355,7 +305,6 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create( file_path="filePath", - connect_protocol_version=1, ) assert response.is_closed is True @@ -367,7 +316,6 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create( file_path="filePath", - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -379,72 +327,57 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - secret = await async_client.secrets.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(SecretListResponse, secret, path=["response"]) + secret = await async_client.secrets.list() + assert_matches_type(AsyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(SecretListResponse, secret, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.secrets.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.secrets.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = await response.parse() - assert_matches_type(SecretListResponse, secret, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.secrets.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.secrets.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = await response.parse() - assert_matches_type(SecretListResponse, secret, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - secret = await async_client.secrets.delete( - connect_protocol_version=1, - ) + secret = await async_client.secrets.delete() assert_matches_type(object, secret, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete( - connect_protocol_version=1, secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, secret, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.secrets.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.secrets.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -453,9 +386,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.secrets.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.secrets.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -466,25 +397,19 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_get_value(self, async_client: AsyncGitpod) -> None: - secret = await async_client.secrets.get_value( - connect_protocol_version=1, - ) + secret = await async_client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @parametrize async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value( - connect_protocol_version=1, secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @parametrize async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: - response = await async_client.secrets.with_raw_response.get_value( - connect_protocol_version=1, - ) + response = await async_client.secrets.with_raw_response.get_value() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -493,9 +418,7 @@ async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> None: - async with async_client.secrets.with_streaming_response.get_value( - connect_protocol_version=1, - ) as response: + async with async_client.secrets.with_streaming_response.get_value() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -506,26 +429,20 @@ async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> @parametrize async def test_method_update_value(self, async_client: AsyncGitpod) -> None: - secret = await async_client.secrets.update_value( - connect_protocol_version=1, - ) + secret = await async_client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) @parametrize async def test_method_update_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value( - connect_protocol_version=1, secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", value="x", - connect_timeout_ms=0, ) assert_matches_type(object, secret, path=["response"]) @parametrize async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> None: - response = await async_client.secrets.with_raw_response.update_value( - connect_protocol_version=1, - ) + response = await async_client.secrets.with_raw_response.update_value() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -534,9 +451,7 @@ async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> Non @parametrize async def test_streaming_response_update_value(self, async_client: AsyncGitpod) -> None: - async with async_client.secrets.with_streaming_response.update_value( - connect_protocol_version=1, - ) as response: + async with async_client.secrets.with_streaming_response.update_value() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index edef99ac..a358d838 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -21,16 +21,6 @@ class TestUsers: def test_method_get_authenticated_user(self, client: Gitpod) -> None: user = client.users.get_authenticated_user( body={}, - connect_protocol_version=1, - ) - assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - - @parametrize - def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> None: - user = client.users.get_authenticated_user( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) @@ -38,7 +28,6 @@ def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: response = client.users.with_raw_response.get_authenticated_user( body={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -50,7 +39,6 @@ def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None: with client.users.with_streaming_response.get_authenticated_user( body={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,26 +50,20 @@ def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None @parametrize def test_method_set_suspended(self, client: Gitpod) -> None: - user = client.users.set_suspended( - connect_protocol_version=1, - ) + user = client.users.set_suspended() assert_matches_type(object, user, path=["response"]) @parametrize def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: user = client.users.set_suspended( - connect_protocol_version=1, suspended=True, user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, user, path=["response"]) @parametrize def test_raw_response_set_suspended(self, client: Gitpod) -> None: - response = client.users.with_raw_response.set_suspended( - connect_protocol_version=1, - ) + response = client.users.with_raw_response.set_suspended() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,9 +72,7 @@ def test_raw_response_set_suspended(self, client: Gitpod) -> None: @parametrize def test_streaming_response_set_suspended(self, client: Gitpod) -> None: - with client.users.with_streaming_response.set_suspended( - connect_protocol_version=1, - ) as response: + with client.users.with_streaming_response.set_suspended() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -109,16 +89,6 @@ class TestAsyncUsers: async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user( body={}, - connect_protocol_version=1, - ) - assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - - @parametrize - async def test_method_get_authenticated_user_with_all_params(self, async_client: AsyncGitpod) -> None: - user = await async_client.users.get_authenticated_user( - body={}, - connect_protocol_version=1, - connect_timeout_ms=0, ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) @@ -126,7 +96,6 @@ async def test_method_get_authenticated_user_with_all_params(self, async_client: async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.get_authenticated_user( body={}, - connect_protocol_version=1, ) assert response.is_closed is True @@ -138,7 +107,6 @@ async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitp async def test_streaming_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.get_authenticated_user( body={}, - connect_protocol_version=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,26 +118,20 @@ async def test_streaming_response_get_authenticated_user(self, async_client: Asy @parametrize async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: - user = await async_client.users.set_suspended( - connect_protocol_version=1, - ) + user = await async_client.users.set_suspended() assert_matches_type(object, user, path=["response"]) @parametrize async def test_method_set_suspended_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended( - connect_protocol_version=1, suspended=True, user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, user, path=["response"]) @parametrize async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> None: - response = await async_client.users.with_raw_response.set_suspended( - connect_protocol_version=1, - ) + response = await async_client.users.with_raw_response.set_suspended() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -178,9 +140,7 @@ async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> No @parametrize async def test_streaming_response_set_suspended(self, async_client: AsyncGitpod) -> None: - async with async_client.users.with_streaming_response.set_suspended( - connect_protocol_version=1, - ) as response: + async with async_client.users.with_streaming_response.set_suspended() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index 1904dc1c..c0fa515b 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.users import PatGetResponse, PatListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,72 +20,57 @@ class TestPats: @parametrize def test_method_list(self, client: Gitpod) -> None: - pat = client.users.pats.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(PatListResponse, pat, path=["response"]) + pat = client.users.pats.list() + assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.users.pats.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = client.users.pats.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = response.parse() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.users.pats.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + with client.users.pats.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = response.parse() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Gitpod) -> None: - pat = client.users.pats.delete( - connect_protocol_version=1, - ) + pat = client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.delete( - connect_protocol_version=1, personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, pat, path=["response"]) @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.users.pats.with_raw_response.delete( - connect_protocol_version=1, - ) + response = client.users.pats.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -93,9 +79,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.users.pats.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + with client.users.pats.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,25 +90,19 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_get(self, client: Gitpod) -> None: - pat = client.users.pats.get( - connect_protocol_version=1, - ) + pat = client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.get( - connect_protocol_version=1, personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(PatGetResponse, pat, path=["response"]) @parametrize def test_raw_response_get(self, client: Gitpod) -> None: - response = client.users.pats.with_raw_response.get( - connect_protocol_version=1, - ) + response = client.users.pats.with_raw_response.get() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -133,9 +111,7 @@ def test_raw_response_get(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: - with client.users.pats.with_streaming_response.get( - connect_protocol_version=1, - ) as response: + with client.users.pats.with_streaming_response.get() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,72 +126,57 @@ class TestAsyncPats: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - pat = await async_client.users.pats.list( - encoding="proto", - connect_protocol_version=1, - ) - assert_matches_type(PatListResponse, pat, path=["response"]) + pat = await async_client.users.pats.list() + assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list( - encoding="proto", - connect_protocol_version=1, - base64=True, - compression="identity", - connect="v1", - message="message", - connect_timeout_ms=0, + token="token", + page_size=0, + filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.users.pats.with_raw_response.list( - encoding="proto", - connect_protocol_version=1, - ) + response = await async_client.users.pats.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = await response.parse() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.users.pats.with_streaming_response.list( - encoding="proto", - connect_protocol_version=1, - ) as response: + async with async_client.users.pats.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = await response.parse() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - pat = await async_client.users.pats.delete( - connect_protocol_version=1, - ) + pat = await async_client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete( - connect_protocol_version=1, personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(object, pat, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.users.pats.with_raw_response.delete( - connect_protocol_version=1, - ) + response = await async_client.users.pats.with_raw_response.delete() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -224,9 +185,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.users.pats.with_streaming_response.delete( - connect_protocol_version=1, - ) as response: + async with async_client.users.pats.with_streaming_response.delete() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -237,25 +196,19 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: - pat = await async_client.users.pats.get( - connect_protocol_version=1, - ) + pat = await async_client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get( - connect_protocol_version=1, personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - connect_timeout_ms=0, ) assert_matches_type(PatGetResponse, pat, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: - response = await async_client.users.pats.with_raw_response.get( - connect_protocol_version=1, - ) + response = await async_client.users.pats.with_raw_response.get() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -264,9 +217,7 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: - async with async_client.users.pats.with_streaming_response.get( - connect_protocol_version=1, - ) as response: + async with async_client.users.pats.with_streaming_response.get() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/test_client.py b/tests/test_client.py index 16628405..10ecf0c9 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -790,7 +790,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create(connect_protocol_version=1) + response = client.runners.with_raw_response.create() assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -814,9 +814,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create( - connect_protocol_version=1, extra_headers={"x-stainless-retry-count": Omit()} - ) + response = client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -839,9 +837,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create( - connect_protocol_version=1, extra_headers={"x-stainless-retry-count": "42"} - ) + response = client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) assert response.http_request.headers.get("x-stainless-retry-count") == "42" @@ -1591,7 +1587,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create(connect_protocol_version=1) + response = await client.runners.with_raw_response.create() assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -1616,9 +1612,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create( - connect_protocol_version=1, extra_headers={"x-stainless-retry-count": Omit()} - ) + response = await client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -1642,9 +1636,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create( - connect_protocol_version=1, extra_headers={"x-stainless-retry-count": "42"} - ) + response = await client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) assert response.http_request.headers.get("x-stainless-retry-count") == "42" From d98f7e3d0af797653a6d22dc596b9bddcd73d027 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 16:21:06 +0000 Subject: [PATCH 070/505] fix: pagination response --- src/gitpod/pagination.py | 362 ++++++++++++++------------------------- 1 file changed, 127 insertions(+), 235 deletions(-) diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index cfbe6615..03c4e810 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -5,7 +5,7 @@ from pydantic import Field as FieldInfo -from ._models import GenericModel +from ._models import BaseModel, GenericModel from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ @@ -127,21 +127,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class OrganizationsPagePagination(GenericModel, Generic[_T]): +class OrganizationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - organizations: Optional[List[_T]] = None - class SyncOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[OrganizationsPagePagination[_T]] = None + organizations: List[_T] + pagination: Optional[OrganizationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - organizations = None - if self.pagination is not None: - if self.pagination.organizations is not None: - organizations = self.pagination.organizations + organizations = self.organizations if not organizations: return [] return organizations @@ -159,14 +155,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[OrganizationsPagePagination[_T]] = None + organizations: List[_T] + pagination: Optional[OrganizationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - organizations = None - if self.pagination is not None: - if self.pagination.organizations is not None: - organizations = self.pagination.organizations + organizations = self.organizations if not organizations: return [] return organizations @@ -183,21 +177,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class MembersPagePagination(GenericModel, Generic[_T]): - members: Optional[List[_T]] = None - +class MembersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[MembersPagePagination[_T]] = None + members: List[_T] + pagination: Optional[MembersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - members = None - if self.pagination is not None: - if self.pagination.members is not None: - members = self.pagination.members + members = self.members if not members: return [] return members @@ -215,14 +205,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[MembersPagePagination[_T]] = None + members: List[_T] + pagination: Optional[MembersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - members = None - if self.pagination is not None: - if self.pagination.members is not None: - members = self.pagination.members + members = self.members if not members: return [] return members @@ -239,21 +227,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SSOConfigurationsPagePagination(GenericModel, Generic[_T]): +class SSOConfigurationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - sso_configurations: Optional[List[_T]] = None - class SyncSSOConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SSOConfigurationsPagePagination[_T]] = None + sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") + pagination: Optional[SSOConfigurationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - sso_configurations = None - if self.pagination is not None: - if self.pagination.sso_configurations is not None: - sso_configurations = self.pagination.sso_configurations + sso_configurations = self.sso_configurations if not sso_configurations: return [] return sso_configurations @@ -271,14 +255,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncSSOConfigurationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SSOConfigurationsPagePagination[_T]] = None + sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") + pagination: Optional[SSOConfigurationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - sso_configurations = None - if self.pagination is not None: - if self.pagination.sso_configurations is not None: - sso_configurations = self.pagination.sso_configurations + sso_configurations = self.sso_configurations if not sso_configurations: return [] return sso_configurations @@ -295,21 +277,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class LoginProvidersPagePagination(GenericModel, Generic[_T]): - login_providers: Optional[List[_T]] = None - +class LoginProvidersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncLoginProvidersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[LoginProvidersPagePagination[_T]] = None + login_providers: List[_T] = FieldInfo(alias="loginProviders") + pagination: Optional[LoginProvidersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - login_providers = None - if self.pagination is not None: - if self.pagination.login_providers is not None: - login_providers = self.pagination.login_providers + login_providers = self.login_providers if not login_providers: return [] return login_providers @@ -327,14 +305,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncLoginProvidersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[LoginProvidersPagePagination[_T]] = None + login_providers: List[_T] = FieldInfo(alias="loginProviders") + pagination: Optional[LoginProvidersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - login_providers = None - if self.pagination is not None: - if self.pagination.login_providers is not None: - login_providers = self.pagination.login_providers + login_providers = self.login_providers if not login_providers: return [] return login_providers @@ -351,21 +327,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EditorsPagePagination(GenericModel, Generic[_T]): - editors: Optional[List[_T]] = None - +class EditorsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEditorsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EditorsPagePagination[_T]] = None + editors: List[_T] + pagination: Optional[EditorsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - editors = None - if self.pagination is not None: - if self.pagination.editors is not None: - editors = self.pagination.editors + editors = self.editors if not editors: return [] return editors @@ -383,14 +355,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEditorsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EditorsPagePagination[_T]] = None + editors: List[_T] + pagination: Optional[EditorsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - editors = None - if self.pagination is not None: - if self.pagination.editors is not None: - editors = self.pagination.editors + editors = self.editors if not editors: return [] return editors @@ -407,21 +377,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TokensPagePagination(GenericModel, Generic[_T]): +class TokensPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - tokens: Optional[List[_T]] = None - class SyncTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TokensPagePagination[_T]] = None + tokens: List[_T] + pagination: Optional[TokensPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tokens = None - if self.pagination is not None: - if self.pagination.tokens is not None: - tokens = self.pagination.tokens + tokens = self.tokens if not tokens: return [] return tokens @@ -439,14 +405,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TokensPagePagination[_T]] = None + tokens: List[_T] + pagination: Optional[TokensPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tokens = None - if self.pagination is not None: - if self.pagination.tokens is not None: - tokens = self.pagination.tokens + tokens = self.tokens if not tokens: return [] return tokens @@ -463,21 +427,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class IntegrationsPagePagination(GenericModel, Generic[_T]): - integrations: Optional[List[_T]] = None - +class IntegrationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncIntegrationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[IntegrationsPagePagination[_T]] = None + integrations: List[_T] + pagination: Optional[IntegrationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - integrations = None - if self.pagination is not None: - if self.pagination.integrations is not None: - integrations = self.pagination.integrations + integrations = self.integrations if not integrations: return [] return integrations @@ -495,14 +455,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncIntegrationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[IntegrationsPagePagination[_T]] = None + integrations: List[_T] + pagination: Optional[IntegrationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - integrations = None - if self.pagination is not None: - if self.pagination.integrations is not None: - integrations = self.pagination.integrations + integrations = self.integrations if not integrations: return [] return integrations @@ -519,21 +477,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EnvironmentClassesPagePagination(GenericModel, Generic[_T]): - environment_classes: Optional[List[_T]] = None - +class EnvironmentClassesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EnvironmentClassesPagePagination[_T]] = None + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") + pagination: Optional[EnvironmentClassesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - environment_classes = None - if self.pagination is not None: - if self.pagination.environment_classes is not None: - environment_classes = self.pagination.environment_classes + environment_classes = self.environment_classes if not environment_classes: return [] return environment_classes @@ -551,14 +505,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EnvironmentClassesPagePagination[_T]] = None + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") + pagination: Optional[EnvironmentClassesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - environment_classes = None - if self.pagination is not None: - if self.pagination.environment_classes is not None: - environment_classes = self.pagination.environment_classes + environment_classes = self.environment_classes if not environment_classes: return [] return environment_classes @@ -575,21 +527,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class RunnersPagePagination(GenericModel, Generic[_T]): +class RunnersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - runners: Optional[List[_T]] = None - class SyncRunnersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[RunnersPagePagination[_T]] = None + runners: List[_T] + pagination: Optional[RunnersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - runners = None - if self.pagination is not None: - if self.pagination.runners is not None: - runners = self.pagination.runners + runners = self.runners if not runners: return [] return runners @@ -607,14 +555,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncRunnersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[RunnersPagePagination[_T]] = None + runners: List[_T] + pagination: Optional[RunnersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - runners = None - if self.pagination is not None: - if self.pagination.runners is not None: - runners = self.pagination.runners + runners = self.runners if not runners: return [] return runners @@ -631,21 +577,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class PoliciesPagePagination(GenericModel, Generic[_T]): +class PoliciesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - policies: Optional[List[_T]] = None - class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PoliciesPagePagination[_T]] = None + policies: List[_T] + pagination: Optional[PoliciesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - policies = None - if self.pagination is not None: - if self.pagination.policies is not None: - policies = self.pagination.policies + policies = self.policies if not policies: return [] return policies @@ -663,14 +605,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PoliciesPagePagination[_T]] = None + policies: List[_T] + pagination: Optional[PoliciesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - policies = None - if self.pagination is not None: - if self.pagination.policies is not None: - policies = self.pagination.policies + policies = self.policies if not policies: return [] return policies @@ -687,21 +627,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EnvironmentsPagePagination(GenericModel, Generic[_T]): - environments: Optional[List[_T]] = None - +class EnvironmentsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EnvironmentsPagePagination[_T]] = None + environments: List[_T] + pagination: Optional[EnvironmentsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - environments = None - if self.pagination is not None: - if self.pagination.environments is not None: - environments = self.pagination.environments + environments = self.environments if not environments: return [] return environments @@ -719,14 +655,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEnvironmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EnvironmentsPagePagination[_T]] = None + environments: List[_T] + pagination: Optional[EnvironmentsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - environments = None - if self.pagination is not None: - if self.pagination.environments is not None: - environments = self.pagination.environments + environments = self.environments if not environments: return [] return environments @@ -743,21 +677,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class ServicesPagePagination(GenericModel, Generic[_T]): +class ServicesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - services: Optional[List[_T]] = None - class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[ServicesPagePagination[_T]] = None + services: List[_T] + pagination: Optional[ServicesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - services = None - if self.pagination is not None: - if self.pagination.services is not None: - services = self.pagination.services + services = self.services if not services: return [] return services @@ -775,14 +705,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[ServicesPagePagination[_T]] = None + services: List[_T] + pagination: Optional[ServicesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - services = None - if self.pagination is not None: - if self.pagination.services is not None: - services = self.pagination.services + services = self.services if not services: return [] return services @@ -799,21 +727,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TasksPagePagination(GenericModel, Generic[_T]): +class TasksPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - tasks: Optional[List[_T]] = None - class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TasksPagePagination[_T]] = None + tasks: List[_T] + pagination: Optional[TasksPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tasks = None - if self.pagination is not None: - if self.pagination.tasks is not None: - tasks = self.pagination.tasks + tasks = self.tasks if not tasks: return [] return tasks @@ -831,14 +755,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TasksPagePagination[_T]] = None + tasks: List[_T] + pagination: Optional[TasksPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tasks = None - if self.pagination is not None: - if self.pagination.tasks is not None: - tasks = self.pagination.tasks + tasks = self.tasks if not tasks: return [] return tasks @@ -855,21 +777,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TaskExecutionsPagePagination(GenericModel, Generic[_T]): +class TaskExecutionsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - task_executions: Optional[List[_T]] = None - class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TaskExecutionsPagePagination[_T]] = None + task_executions: List[_T] = FieldInfo(alias="taskExecutions") + pagination: Optional[TaskExecutionsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - task_executions = None - if self.pagination is not None: - if self.pagination.task_executions is not None: - task_executions = self.pagination.task_executions + task_executions = self.task_executions if not task_executions: return [] return task_executions @@ -887,14 +805,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[TaskExecutionsPagePagination[_T]] = None + task_executions: List[_T] = FieldInfo(alias="taskExecutions") + pagination: Optional[TaskExecutionsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - task_executions = None - if self.pagination is not None: - if self.pagination.task_executions is not None: - task_executions = self.pagination.task_executions + task_executions = self.task_executions if not task_executions: return [] return task_executions @@ -911,21 +827,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EntriesPagePagination(GenericModel, Generic[_T]): - entries: Optional[List[_T]] = None - +class EntriesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EntriesPagePagination[_T]] = None + entries: List[_T] + pagination: Optional[EntriesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - entries = None - if self.pagination is not None: - if self.pagination.entries is not None: - entries = self.pagination.entries + entries = self.entries if not entries: return [] return entries @@ -943,14 +855,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEntriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[EntriesPagePagination[_T]] = None + entries: List[_T] + pagination: Optional[EntriesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - entries = None - if self.pagination is not None: - if self.pagination.entries is not None: - entries = self.pagination.entries + entries = self.entries if not entries: return [] return entries @@ -967,21 +877,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class GroupsPagePagination(GenericModel, Generic[_T]): - groups: Optional[List[_T]] = None - +class GroupsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[GroupsPagePagination[_T]] = None + groups: List[_T] + pagination: Optional[GroupsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - groups = None - if self.pagination is not None: - if self.pagination.groups is not None: - groups = self.pagination.groups + groups = self.groups if not groups: return [] return groups @@ -999,14 +905,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncGroupsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[GroupsPagePagination[_T]] = None + groups: List[_T] + pagination: Optional[GroupsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - groups = None - if self.pagination is not None: - if self.pagination.groups is not None: - groups = self.pagination.groups + groups = self.groups if not groups: return [] return groups @@ -1023,21 +927,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class ProjectsPagePagination(GenericModel, Generic[_T]): +class ProjectsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - projects: Optional[List[_T]] = None - class SyncProjectsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[ProjectsPagePagination[_T]] = None + projects: List[_T] + pagination: Optional[ProjectsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - projects = None - if self.pagination is not None: - if self.pagination.projects is not None: - projects = self.pagination.projects + projects = self.projects if not projects: return [] return projects @@ -1055,14 +955,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncProjectsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[ProjectsPagePagination[_T]] = None + projects: List[_T] + pagination: Optional[ProjectsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - projects = None - if self.pagination is not None: - if self.pagination.projects is not None: - projects = self.pagination.projects + projects = self.projects if not projects: return [] return projects @@ -1079,21 +977,17 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SecretsPagePagination(GenericModel, Generic[_T]): +class SecretsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - secrets: Optional[List[_T]] = None - class SyncSecretsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SecretsPagePagination[_T]] = None + secrets: List[_T] + pagination: Optional[SecretsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - secrets = None - if self.pagination is not None: - if self.pagination.secrets is not None: - secrets = self.pagination.secrets + secrets = self.secrets if not secrets: return [] return secrets @@ -1111,14 +1005,12 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncSecretsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SecretsPagePagination[_T]] = None + secrets: List[_T] + pagination: Optional[SecretsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - secrets = None - if self.pagination is not None: - if self.pagination.secrets is not None: - secrets = self.pagination.secrets + secrets = self.secrets if not secrets: return [] return secrets From f379accda5585eaf707fc62b0ad1c8dda9d1df22 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 16:21:51 +0000 Subject: [PATCH 071/505] fix: pagination example --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/README.md b/README.md index b43b2f8b..643125fc 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,69 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`. +## Pagination + +List methods in the Gitpod API are paginated. + +This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually: + +```python +from gitpod import Gitpod + +client = Gitpod() + +all_services = [] +# Automatically fetches more pages as needed. +for service in client.environments.automations.services.list(): + # Do something with service here + all_services.append(service) +print(all_services) +``` + +Or, asynchronously: + +```python +import asyncio +from gitpod import AsyncGitpod + +client = AsyncGitpod() + + +async def main() -> None: + all_services = [] + # Iterate through items across all pages, issuing requests as needed. + async for service in client.environments.automations.services.list(): + all_services.append(service) + print(all_services) + + +asyncio.run(main()) +``` + +Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages: + +```python +first_page = await client.environments.automations.services.list() +if first_page.has_next_page(): + print(f"will fetch next page using these details: {first_page.next_page_info()}") + next_page = await first_page.get_next_page() + print(f"number of items we just fetched: {len(next_page.pagination.personal_access_tokens)}") + +# Remove `await` for non-async usage. +``` + +Or just work directly with the returned data: + +```python +first_page = await client.environments.automations.services.list() + +print(f"next page cursor: {first_page.pagination.next_token}") # => "next page cursor: ..." +for service in first_page.pagination.personal_access_tokens: + print(service.pagination) + +# Remove `await` for non-async usage. +``` + ## Handling errors When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `gitpod.APIConnectionError` is raised. From 88e6431808e14033dfb613f99e07f5bc36883497 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:32:58 +0000 Subject: [PATCH 072/505] feat(api): manual updates --- README.md | 6 +- api.md | 42 +- src/gitpod/pagination.py | 654 ++++++++++-------- src/gitpod/resources/accounts.py | 27 +- src/gitpod/resources/editors.py | 10 +- .../environments/automations/services.py | 10 +- .../automations/tasks/executions.py | 25 +- .../environments/automations/tasks/tasks.py | 10 +- src/gitpod/resources/environments/classes.py | 30 +- .../resources/environments/environments.py | 10 +- src/gitpod/resources/events.py | 10 +- src/gitpod/resources/groups.py | 10 +- .../resources/organizations/organizations.py | 20 +- .../organizations/sso_configurations.py | 25 +- src/gitpod/resources/projects/policies.py | 10 +- src/gitpod/resources/projects/projects.py | 10 +- .../configurations/environment_classes.py | 25 +- .../host_authentication_tokens.py | 12 +- .../configurations/scm_integrations.py | 10 +- src/gitpod/resources/runners/policies.py | 10 +- src/gitpod/resources/runners/runners.py | 10 +- src/gitpod/resources/secrets.py | 15 +- src/gitpod/resources/users/pats.py | 25 +- src/gitpod/types/editor_list_response.py | 28 +- src/gitpod/types/environment_list_response.py | 230 +++--- .../automations/service_list_response.py | 82 +-- .../automations/task_list_response.py | 70 +- src/gitpod/types/event_list_response.py | 21 +- src/gitpod/types/group_list_response.py | 20 +- .../organization_list_members_response.py | 22 +- .../types/organization_list_response.py | 24 +- src/gitpod/types/project_list_response.py | 95 +-- .../types/projects/policy_list_response.py | 20 +- src/gitpod/types/runner_list_response.py | 49 +- ...host_authentication_token_list_response.py | 20 +- .../scm_integration_list_response.py | 25 +- .../types/runners/policy_list_response.py | 20 +- src/gitpod/types/secret_list_response.py | 44 +- .../automations/tasks/test_executions.py | 17 +- .../environments/automations/test_services.py | 18 +- .../environments/automations/test_tasks.py | 18 +- .../environments/test_classes.py | 17 +- .../organizations/test_sso_configurations.py | 33 +- tests/api_resources/projects/test_policies.py | 18 +- .../test_environment_classes.py | 33 +- .../test_host_authentication_tokens.py | 34 +- .../configurations/test_scm_integrations.py | 34 +- tests/api_resources/runners/test_policies.py | 18 +- tests/api_resources/test_accounts.py | 27 +- tests/api_resources/test_editors.py | 18 +- tests/api_resources/test_environments.py | 18 +- tests/api_resources/test_events.py | 18 +- tests/api_resources/test_groups.py | 18 +- tests/api_resources/test_organizations.py | 52 +- tests/api_resources/test_projects.py | 18 +- tests/api_resources/test_runners.py | 18 +- tests/api_resources/test_secrets.py | 18 +- tests/api_resources/users/test_pats.py | 17 +- 58 files changed, 972 insertions(+), 1276 deletions(-) diff --git a/README.md b/README.md index 643125fc..c3987aaa 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ first_page = await client.environments.automations.services.list() if first_page.has_next_page(): print(f"will fetch next page using these details: {first_page.next_page_info()}") next_page = await first_page.get_next_page() - print(f"number of items we just fetched: {len(next_page.pagination.personal_access_tokens)}") + print(f"number of items we just fetched: {len(next_page.services)}") # Remove `await` for non-async usage. ``` @@ -133,8 +133,8 @@ Or just work directly with the returned data: first_page = await client.environments.automations.services.list() print(f"next page cursor: {first_page.pagination.next_token}") # => "next page cursor: ..." -for service in first_page.pagination.personal_access_tokens: - print(service.pagination) +for service in first_page.services: + print(service.id) # Remove `await` for non-async usage. ``` diff --git a/api.md b/api.md index b2094915..4732300c 100644 --- a/api.md +++ b/api.md @@ -16,7 +16,7 @@ Methods: - client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse - client.accounts.delete(\*\*params) -> object - client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse -- client.accounts.list_login_providers(\*\*params) -> SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse] +- client.accounts.list_login_providers(\*\*params) -> AccountListLoginProvidersResponse # Editors @@ -29,7 +29,7 @@ from gitpod.types import EditorRetrieveResponse, EditorListResponse, EditorResol Methods: - client.editors.retrieve(\*\*params) -> EditorRetrieveResponse -- client.editors.list(\*\*params) -> SyncPersonalAccessTokensPage[EditorListResponse] +- client.editors.list(\*\*params) -> SyncEditorsPage[EditorListResponse] - client.editors.resolve_url(\*\*params) -> EditorResolveURLResponse # Environments @@ -56,7 +56,7 @@ Methods: - client.environments.create(\*\*params) -> EnvironmentCreateResponse - client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse - client.environments.update(\*\*params) -> object -- client.environments.list(\*\*params) -> SyncPersonalAccessTokensPage[EnvironmentListResponse] +- client.environments.list(\*\*params) -> SyncEnvironmentsPage[EnvironmentListResponse] - client.environments.delete(\*\*params) -> object - client.environments.create_from_project(\*\*params) -> EnvironmentCreateFromProjectResponse - client.environments.create_logs_token(\*\*params) -> EnvironmentCreateLogsTokenResponse @@ -97,7 +97,7 @@ Methods: - client.environments.automations.services.create(\*\*params) -> ServiceCreateResponse - client.environments.automations.services.retrieve(\*\*params) -> ServiceRetrieveResponse - client.environments.automations.services.update(\*\*params) -> object -- client.environments.automations.services.list(\*\*params) -> SyncPersonalAccessTokensPage[ServiceListResponse] +- client.environments.automations.services.list(\*\*params) -> SyncServicesPage[ServiceListResponse] - client.environments.automations.services.delete(\*\*params) -> object - client.environments.automations.services.start(\*\*params) -> object - client.environments.automations.services.stop(\*\*params) -> object @@ -122,7 +122,7 @@ Methods: - client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse - client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse - client.environments.automations.tasks.update(\*\*params) -> object -- client.environments.automations.tasks.list(\*\*params) -> SyncPersonalAccessTokensPage[TaskListResponse] +- client.environments.automations.tasks.list(\*\*params) -> SyncTasksPage[TaskListResponse] - client.environments.automations.tasks.delete(\*\*params) -> object - client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse @@ -141,7 +141,7 @@ from gitpod.types.environments.automations.tasks import ( Methods: - client.environments.automations.tasks.executions.retrieve(\*\*params) -> ExecutionRetrieveResponse -- client.environments.automations.tasks.executions.list(\*\*params) -> SyncPersonalAccessTokensPage[ExecutionListResponse] +- client.environments.automations.tasks.executions.list(\*\*params) -> ExecutionListResponse - client.environments.automations.tasks.executions.stop(\*\*params) -> object ## Classes @@ -154,7 +154,7 @@ from gitpod.types.environments import ClassListResponse Methods: -- client.environments.classes.list(\*\*params) -> SyncPersonalAccessTokensPage[ClassListResponse] +- client.environments.classes.list(\*\*params) -> ClassListResponse # Events @@ -166,7 +166,7 @@ from gitpod.types import EventListResponse, EventWatchResponse Methods: -- client.events.list(\*\*params) -> SyncPersonalAccessTokensPage[EventListResponse] +- client.events.list(\*\*params) -> SyncEntriesPage[EventListResponse] - client.events.watch(\*\*params) -> JSONLDecoder[EventWatchResponse] # Groups @@ -179,7 +179,7 @@ from gitpod.types import GroupListResponse Methods: -- client.groups.list(\*\*params) -> SyncPersonalAccessTokensPage[GroupListResponse] +- client.groups.list(\*\*params) -> SyncGroupsPage[GroupListResponse] # Identity @@ -222,11 +222,11 @@ Methods: - client.organizations.create(\*\*params) -> OrganizationCreateResponse - client.organizations.retrieve(\*\*params) -> OrganizationRetrieveResponse - client.organizations.update(\*\*params) -> OrganizationUpdateResponse -- client.organizations.list(\*\*params) -> SyncPersonalAccessTokensPage[OrganizationListResponse] +- client.organizations.list(\*\*params) -> SyncOrganizationsPage[OrganizationListResponse] - client.organizations.delete(\*\*params) -> object - client.organizations.join(\*\*params) -> OrganizationJoinResponse - client.organizations.leave(\*\*params) -> object -- client.organizations.list_members(\*\*params) -> SyncPersonalAccessTokensPage[OrganizationListMembersResponse] +- client.organizations.list_members(\*\*params) -> SyncMembersPage[OrganizationListMembersResponse] - client.organizations.set_role(\*\*params) -> object ## Invites @@ -266,7 +266,7 @@ Methods: - client.organizations.sso_configurations.create(\*\*params) -> SSOConfigurationCreateResponse - client.organizations.sso_configurations.retrieve(\*\*params) -> SSOConfigurationRetrieveResponse - client.organizations.sso_configurations.update(\*\*params) -> object -- client.organizations.sso_configurations.list(\*\*params) -> SyncPersonalAccessTokensPage[SSOConfigurationListResponse] +- client.organizations.sso_configurations.list(\*\*params) -> SSOConfigurationListResponse - client.organizations.sso_configurations.delete(\*\*params) -> object # Projects @@ -289,7 +289,7 @@ Methods: - client.projects.create(\*\*params) -> ProjectCreateResponse - client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse - client.projects.update(\*\*params) -> ProjectUpdateResponse -- client.projects.list(\*\*params) -> SyncPersonalAccessTokensPage[ProjectListResponse] +- client.projects.list(\*\*params) -> SyncProjectsPage[ProjectListResponse] - client.projects.delete(\*\*params) -> object - client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse @@ -310,7 +310,7 @@ Methods: - client.projects.policies.create(\*\*params) -> PolicyCreateResponse - client.projects.policies.update(\*\*params) -> PolicyUpdateResponse -- client.projects.policies.list(\*\*params) -> SyncPersonalAccessTokensPage[PolicyListResponse] +- client.projects.policies.list(\*\*params) -> SyncPoliciesPage[PolicyListResponse] - client.projects.policies.delete(\*\*params) -> object # Runners @@ -335,7 +335,7 @@ Methods: - client.runners.create(\*\*params) -> RunnerCreateResponse - client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse - client.runners.update(\*\*params) -> object -- client.runners.list(\*\*params) -> SyncPersonalAccessTokensPage[RunnerListResponse] +- client.runners.list(\*\*params) -> SyncRunnersPage[RunnerListResponse] - client.runners.delete(\*\*params) -> object - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse @@ -371,7 +371,7 @@ Methods: - client.runners.configurations.environment_classes.create(\*\*params) -> EnvironmentClassCreateResponse - client.runners.configurations.environment_classes.retrieve(\*\*params) -> EnvironmentClassRetrieveResponse - client.runners.configurations.environment_classes.update(\*\*params) -> object -- client.runners.configurations.environment_classes.list(\*\*params) -> SyncPersonalAccessTokensPage[EnvironmentClassListResponse] +- client.runners.configurations.environment_classes.list(\*\*params) -> EnvironmentClassListResponse ### HostAuthenticationTokens @@ -392,7 +392,7 @@ Methods: - client.runners.configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse - client.runners.configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse - client.runners.configurations.host_authentication_tokens.update(\*\*params) -> object -- client.runners.configurations.host_authentication_tokens.list(\*\*params) -> SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse] +- client.runners.configurations.host_authentication_tokens.list(\*\*params) -> SyncTokensPage[HostAuthenticationTokenListResponse] - client.runners.configurations.host_authentication_tokens.delete(\*\*params) -> object ### Schema @@ -426,7 +426,7 @@ Methods: - client.runners.configurations.scm_integrations.create(\*\*params) -> ScmIntegrationCreateResponse - client.runners.configurations.scm_integrations.retrieve(\*\*params) -> ScmIntegrationRetrieveResponse - client.runners.configurations.scm_integrations.update(\*\*params) -> object -- client.runners.configurations.scm_integrations.list(\*\*params) -> SyncPersonalAccessTokensPage[ScmIntegrationListResponse] +- client.runners.configurations.scm_integrations.list(\*\*params) -> SyncIntegrationsPage[ScmIntegrationListResponse] - client.runners.configurations.scm_integrations.delete(\*\*params) -> object ## Policies @@ -446,7 +446,7 @@ Methods: - client.runners.policies.create(\*\*params) -> PolicyCreateResponse - client.runners.policies.update(\*\*params) -> PolicyUpdateResponse -- client.runners.policies.list(\*\*params) -> SyncPersonalAccessTokensPage[PolicyListResponse] +- client.runners.policies.list(\*\*params) -> SyncPoliciesPage[PolicyListResponse] - client.runners.policies.delete(\*\*params) -> object # Secrets @@ -466,7 +466,7 @@ from gitpod.types import ( Methods: - client.secrets.create(\*\*params) -> SecretCreateResponse -- client.secrets.list(\*\*params) -> SyncPersonalAccessTokensPage[SecretListResponse] +- client.secrets.list(\*\*params) -> SyncSecretsPage[SecretListResponse] - client.secrets.delete(\*\*params) -> object - client.secrets.get_value(\*\*params) -> SecretGetValueResponse - client.secrets.update_value(\*\*params) -> object @@ -494,6 +494,6 @@ from gitpod.types.users import PatListResponse, PatDeleteResponse, PatGetRespons Methods: -- client.users.pats.list(\*\*params) -> SyncPersonalAccessTokensPage[PatListResponse] +- client.users.pats.list(\*\*params) -> PatListResponse - client.users.pats.delete(\*\*params) -> object - client.users.pats.get(\*\*params) -> PatGetResponse diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 03c4e810..9bf11c1e 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -5,90 +5,109 @@ from pydantic import Field as FieldInfo -from ._models import BaseModel, GenericModel +from ._models import BaseModel from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ - "PersonalAccessTokensPagePagination", - "SyncPersonalAccessTokensPage", - "AsyncPersonalAccessTokensPage", - "OrganizationsPagePagination", - "SyncOrganizationsPage", - "AsyncOrganizationsPage", - "MembersPagePagination", - "SyncMembersPage", - "AsyncMembersPage", - "SSOConfigurationsPagePagination", - "SyncSSOConfigurationsPage", - "AsyncSSOConfigurationsPage", - "LoginProvidersPagePagination", - "SyncLoginProvidersPage", - "AsyncLoginProvidersPage", "EditorsPagePagination", "SyncEditorsPage", "AsyncEditorsPage", - "TokensPagePagination", - "SyncTokensPage", - "AsyncTokensPage", - "IntegrationsPagePagination", - "SyncIntegrationsPage", - "AsyncIntegrationsPage", + "EntriesPagePagination", + "SyncEntriesPage", + "AsyncEntriesPage", "EnvironmentClassesPagePagination", "SyncEnvironmentClassesPage", "AsyncEnvironmentClassesPage", - "RunnersPagePagination", - "SyncRunnersPage", - "AsyncRunnersPage", - "PoliciesPagePagination", - "SyncPoliciesPage", - "AsyncPoliciesPage", "EnvironmentsPagePagination", "SyncEnvironmentsPage", "AsyncEnvironmentsPage", - "ServicesPagePagination", - "SyncServicesPage", - "AsyncServicesPage", - "TasksPagePagination", - "SyncTasksPage", - "AsyncTasksPage", - "TaskExecutionsPagePagination", - "SyncTaskExecutionsPage", - "AsyncTaskExecutionsPage", - "EntriesPagePagination", - "SyncEntriesPage", - "AsyncEntriesPage", "GroupsPagePagination", "SyncGroupsPage", "AsyncGroupsPage", + "IntegrationsPagePagination", + "SyncIntegrationsPage", + "AsyncIntegrationsPage", + "LoginProvidersPagePagination", + "SyncLoginProvidersPage", + "AsyncLoginProvidersPage", + "MembersPagePagination", + "SyncMembersPage", + "AsyncMembersPage", + "OrganizationsPagePagination", + "SyncOrganizationsPage", + "AsyncOrganizationsPage", + "PersonalAccessTokensPagePagination", + "SyncPersonalAccessTokensPage", + "AsyncPersonalAccessTokensPage", + "PoliciesPagePagination", + "SyncPoliciesPage", + "AsyncPoliciesPage", "ProjectsPagePagination", "SyncProjectsPage", "AsyncProjectsPage", + "RunnersPagePagination", + "SyncRunnersPage", + "AsyncRunnersPage", "SecretsPagePagination", "SyncSecretsPage", "AsyncSecretsPage", + "ServicesPagePagination", + "SyncServicesPage", + "AsyncServicesPage", + "SSOConfigurationsPagePagination", + "SyncSSOConfigurationsPage", + "AsyncSSOConfigurationsPage", + "TaskExecutionsPagePagination", + "SyncTaskExecutionsPage", + "AsyncTaskExecutionsPage", + "TasksPagePagination", + "SyncTasksPage", + "AsyncTasksPage", + "TokensPagePagination", + "SyncTokensPage", + "AsyncTokensPage", ] _T = TypeVar("_T") -class PersonalAccessTokensPagePagination(GenericModel, Generic[_T]): +class EditorsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - personal_access_tokens: Optional[List[_T]] = None - -class SyncPersonalAccessTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PersonalAccessTokensPagePagination[_T]] = None +class SyncEditorsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + editors: List[_T] + pagination: Optional[EditorsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - personal_access_tokens = None + editors = self.editors + if not editors: + return [] + return editors + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None if self.pagination is not None: - if self.pagination.personal_access_tokens is not None: - personal_access_tokens = self.pagination.personal_access_tokens - if not personal_access_tokens: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEditorsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + editors: List[_T] + pagination: Optional[EditorsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + editors = self.editors + if not editors: return [] - return personal_access_tokens + return editors @override def next_page_info(self) -> Optional[PageInfo]: @@ -102,18 +121,43 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncPersonalAccessTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PersonalAccessTokensPagePagination[_T]] = None +class EntriesPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + entries: List[_T] + pagination: Optional[EntriesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - personal_access_tokens = None + entries = self.entries + if not entries: + return [] + return entries + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None if self.pagination is not None: - if self.pagination.personal_access_tokens is not None: - personal_access_tokens = self.pagination.personal_access_tokens - if not personal_access_tokens: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEntriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + entries: List[_T] + pagination: Optional[EntriesPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + entries = self.entries + if not entries: return [] - return personal_access_tokens + return entries @override def next_page_info(self) -> Optional[PageInfo]: @@ -127,20 +171,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class OrganizationsPagePagination(BaseModel): +class EnvironmentClassesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - organizations: List[_T] - pagination: Optional[OrganizationsPagePagination] = None +class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] + pagination: Optional[EnvironmentClassesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - organizations = self.organizations - if not organizations: + environment_classes = self.environment_classes + if not environment_classes: return [] - return organizations + return environment_classes @override def next_page_info(self) -> Optional[PageInfo]: @@ -154,16 +198,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - organizations: List[_T] - pagination: Optional[OrganizationsPagePagination] = None +class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] + pagination: Optional[EnvironmentClassesPagePagination] = None @override def _get_page_items(self) -> List[_T]: - organizations = self.organizations - if not organizations: + environment_classes = self.environment_classes + if not environment_classes: return [] - return organizations + return environment_classes @override def next_page_info(self) -> Optional[PageInfo]: @@ -177,20 +221,66 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class MembersPagePagination(BaseModel): +class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] + pagination: Optional[EnvironmentClassesPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + environment_classes = self.environment_classes + if not environment_classes: + return [] + return environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + environment_classes: List[_T] + pagination: Optional[EnvironmentClassesPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + environment_classes = self.environment_classes + if not environment_classes: + return [] + return environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class EnvironmentsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] - pagination: Optional[MembersPagePagination] = None +class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + environments: List[_T] + pagination: Optional[EnvironmentsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - members = self.members - if not members: + environments = self.environments + if not environments: return [] - return members + return environments @override def next_page_info(self) -> Optional[PageInfo]: @@ -204,16 +294,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - members: List[_T] - pagination: Optional[MembersPagePagination] = None +class AsyncEnvironmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + environments: List[_T] + pagination: Optional[EnvironmentsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - members = self.members - if not members: + environments = self.environments + if not environments: return [] - return members + return environments @override def next_page_info(self) -> Optional[PageInfo]: @@ -227,20 +317,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SSOConfigurationsPagePagination(BaseModel): +class GroupsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncSSOConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") - pagination: Optional[SSOConfigurationsPagePagination] = None +class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + groups: List[_T] + pagination: Optional[GroupsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - sso_configurations = self.sso_configurations - if not sso_configurations: + groups = self.groups + if not groups: return [] - return sso_configurations + return groups @override def next_page_info(self) -> Optional[PageInfo]: @@ -254,16 +344,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncSSOConfigurationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") - pagination: Optional[SSOConfigurationsPagePagination] = None +class AsyncGroupsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + groups: List[_T] + pagination: Optional[GroupsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - sso_configurations = self.sso_configurations - if not sso_configurations: + groups = self.groups + if not groups: return [] - return sso_configurations + return groups @override def next_page_info(self) -> Optional[PageInfo]: @@ -277,20 +367,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class LoginProvidersPagePagination(BaseModel): +class IntegrationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncLoginProvidersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - login_providers: List[_T] = FieldInfo(alias="loginProviders") - pagination: Optional[LoginProvidersPagePagination] = None +class SyncIntegrationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + integrations: List[_T] + pagination: Optional[IntegrationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - login_providers = self.login_providers - if not login_providers: + integrations = self.integrations + if not integrations: return [] - return login_providers + return integrations @override def next_page_info(self) -> Optional[PageInfo]: @@ -304,16 +394,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncLoginProvidersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - login_providers: List[_T] = FieldInfo(alias="loginProviders") - pagination: Optional[LoginProvidersPagePagination] = None +class AsyncIntegrationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + integrations: List[_T] + pagination: Optional[IntegrationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - login_providers = self.login_providers - if not login_providers: + integrations = self.integrations + if not integrations: return [] - return login_providers + return integrations @override def next_page_info(self) -> Optional[PageInfo]: @@ -327,20 +417,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EditorsPagePagination(BaseModel): +class LoginProvidersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncEditorsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - editors: List[_T] - pagination: Optional[EditorsPagePagination] = None +class SyncLoginProvidersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + login_providers: List[_T] + pagination: Optional[LoginProvidersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - editors = self.editors - if not editors: + login_providers = self.login_providers + if not login_providers: return [] - return editors + return login_providers @override def next_page_info(self) -> Optional[PageInfo]: @@ -354,16 +444,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncEditorsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - editors: List[_T] - pagination: Optional[EditorsPagePagination] = None +class AsyncLoginProvidersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + login_providers: List[_T] + pagination: Optional[LoginProvidersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - editors = self.editors - if not editors: + login_providers = self.login_providers + if not login_providers: return [] - return editors + return login_providers @override def next_page_info(self) -> Optional[PageInfo]: @@ -377,20 +467,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TokensPagePagination(BaseModel): +class MembersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - tokens: List[_T] - pagination: Optional[TokensPagePagination] = None +class SyncMembersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + members: List[_T] + pagination: Optional[MembersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tokens = self.tokens - if not tokens: + members = self.members + if not members: return [] - return tokens + return members @override def next_page_info(self) -> Optional[PageInfo]: @@ -404,16 +494,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - tokens: List[_T] - pagination: Optional[TokensPagePagination] = None +class AsyncMembersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + members: List[_T] + pagination: Optional[MembersPagePagination] = None @override def _get_page_items(self) -> List[_T]: - tokens = self.tokens - if not tokens: + members = self.members + if not members: return [] - return tokens + return members @override def next_page_info(self) -> Optional[PageInfo]: @@ -427,20 +517,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class IntegrationsPagePagination(BaseModel): +class OrganizationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncIntegrationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - integrations: List[_T] - pagination: Optional[IntegrationsPagePagination] = None +class SyncOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + organizations: List[_T] + pagination: Optional[OrganizationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - integrations = self.integrations - if not integrations: + organizations = self.organizations + if not organizations: return [] - return integrations + return organizations @override def next_page_info(self) -> Optional[PageInfo]: @@ -454,16 +544,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncIntegrationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - integrations: List[_T] - pagination: Optional[IntegrationsPagePagination] = None +class AsyncOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + organizations: List[_T] + pagination: Optional[OrganizationsPagePagination] = None @override def _get_page_items(self) -> List[_T]: - integrations = self.integrations - if not integrations: + organizations = self.organizations + if not organizations: return [] - return integrations + return organizations @override def next_page_info(self) -> Optional[PageInfo]: @@ -477,20 +567,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EnvironmentClassesPagePagination(BaseModel): +class PersonalAccessTokensPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] = FieldInfo(alias="environmentClasses") - pagination: Optional[EnvironmentClassesPagePagination] = None +class SyncPersonalAccessTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PersonalAccessTokensPagePagination] = None + personal_access_tokens: List[_T] @override def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes - if not environment_classes: + personal_access_tokens = self.personal_access_tokens + if not personal_access_tokens: return [] - return environment_classes + return personal_access_tokens @override def next_page_info(self) -> Optional[PageInfo]: @@ -504,16 +594,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] = FieldInfo(alias="environmentClasses") - pagination: Optional[EnvironmentClassesPagePagination] = None +class AsyncPersonalAccessTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PersonalAccessTokensPagePagination] = None + personal_access_tokens: List[_T] @override def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes - if not environment_classes: + personal_access_tokens = self.personal_access_tokens + if not personal_access_tokens: return [] - return environment_classes + return personal_access_tokens @override def next_page_info(self) -> Optional[PageInfo]: @@ -527,20 +617,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class RunnersPagePagination(BaseModel): +class PoliciesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncRunnersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - runners: List[_T] - pagination: Optional[RunnersPagePagination] = None +class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PoliciesPagePagination] = None + policies: List[_T] @override def _get_page_items(self) -> List[_T]: - runners = self.runners - if not runners: + policies = self.policies + if not policies: return [] - return runners + return policies @override def next_page_info(self) -> Optional[PageInfo]: @@ -554,16 +644,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncRunnersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - runners: List[_T] - pagination: Optional[RunnersPagePagination] = None +class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PoliciesPagePagination] = None + policies: List[_T] @override def _get_page_items(self) -> List[_T]: - runners = self.runners - if not runners: + policies = self.policies + if not policies: return [] - return runners + return policies @override def next_page_info(self) -> Optional[PageInfo]: @@ -577,13 +667,9 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class PoliciesPagePagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - policies: List[_T] pagination: Optional[PoliciesPagePagination] = None + policies: List[_T] @override def _get_page_items(self) -> List[_T]: @@ -605,8 +691,8 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - policies: List[_T] pagination: Optional[PoliciesPagePagination] = None + policies: List[_T] @override def _get_page_items(self) -> List[_T]: @@ -627,20 +713,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EnvironmentsPagePagination(BaseModel): +class ProjectsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncEnvironmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environments: List[_T] - pagination: Optional[EnvironmentsPagePagination] = None +class SyncProjectsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ProjectsPagePagination] = None + projects: List[_T] @override def _get_page_items(self) -> List[_T]: - environments = self.environments - if not environments: + projects = self.projects + if not projects: return [] - return environments + return projects @override def next_page_info(self) -> Optional[PageInfo]: @@ -654,16 +740,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncEnvironmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environments: List[_T] - pagination: Optional[EnvironmentsPagePagination] = None +class AsyncProjectsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ProjectsPagePagination] = None + projects: List[_T] @override def _get_page_items(self) -> List[_T]: - environments = self.environments - if not environments: + projects = self.projects + if not projects: return [] - return environments + return projects @override def next_page_info(self) -> Optional[PageInfo]: @@ -677,20 +763,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class ServicesPagePagination(BaseModel): +class RunnersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] - pagination: Optional[ServicesPagePagination] = None +class SyncRunnersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[RunnersPagePagination] = None + runners: List[_T] @override def _get_page_items(self) -> List[_T]: - services = self.services - if not services: + runners = self.runners + if not runners: return [] - return services + return runners @override def next_page_info(self) -> Optional[PageInfo]: @@ -704,16 +790,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - services: List[_T] - pagination: Optional[ServicesPagePagination] = None +class AsyncRunnersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[RunnersPagePagination] = None + runners: List[_T] @override def _get_page_items(self) -> List[_T]: - services = self.services - if not services: + runners = self.runners + if not runners: return [] - return services + return runners @override def next_page_info(self) -> Optional[PageInfo]: @@ -727,20 +813,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TasksPagePagination(BaseModel): +class SecretsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] - pagination: Optional[TasksPagePagination] = None +class SyncSecretsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[SecretsPagePagination] = None + secrets: List[_T] @override def _get_page_items(self) -> List[_T]: - tasks = self.tasks - if not tasks: + secrets = self.secrets + if not secrets: return [] - return tasks + return secrets @override def next_page_info(self) -> Optional[PageInfo]: @@ -754,16 +840,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - tasks: List[_T] - pagination: Optional[TasksPagePagination] = None +class AsyncSecretsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[SecretsPagePagination] = None + secrets: List[_T] @override def _get_page_items(self) -> List[_T]: - tasks = self.tasks - if not tasks: + secrets = self.secrets + if not secrets: return [] - return tasks + return secrets @override def next_page_info(self) -> Optional[PageInfo]: @@ -777,20 +863,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class TaskExecutionsPagePagination(BaseModel): +class ServicesPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] = FieldInfo(alias="taskExecutions") - pagination: Optional[TaskExecutionsPagePagination] = None +class SyncServicesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ServicesPagePagination] = None + services: List[_T] @override def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions - if not task_executions: + services = self.services + if not services: return [] - return task_executions + return services @override def next_page_info(self) -> Optional[PageInfo]: @@ -804,16 +890,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - task_executions: List[_T] = FieldInfo(alias="taskExecutions") - pagination: Optional[TaskExecutionsPagePagination] = None +class AsyncServicesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ServicesPagePagination] = None + services: List[_T] @override def _get_page_items(self) -> List[_T]: - task_executions = self.task_executions - if not task_executions: + services = self.services + if not services: return [] - return task_executions + return services @override def next_page_info(self) -> Optional[PageInfo]: @@ -827,20 +913,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class EntriesPagePagination(BaseModel): +class SSOConfigurationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncEntriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - entries: List[_T] - pagination: Optional[EntriesPagePagination] = None +class SyncSSOConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[SSOConfigurationsPagePagination] = None + sso_configurations: List[_T] @override def _get_page_items(self) -> List[_T]: - entries = self.entries - if not entries: + sso_configurations = self.sso_configurations + if not sso_configurations: return [] - return entries + return sso_configurations @override def next_page_info(self) -> Optional[PageInfo]: @@ -854,16 +940,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncEntriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - entries: List[_T] - pagination: Optional[EntriesPagePagination] = None +class AsyncSSOConfigurationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[SSOConfigurationsPagePagination] = None + sso_configurations: List[_T] @override def _get_page_items(self) -> List[_T]: - entries = self.entries - if not entries: + sso_configurations = self.sso_configurations + if not sso_configurations: return [] - return entries + return sso_configurations @override def next_page_info(self) -> Optional[PageInfo]: @@ -877,20 +963,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class GroupsPagePagination(BaseModel): +class TaskExecutionsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncGroupsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - groups: List[_T] - pagination: Optional[GroupsPagePagination] = None +class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[TaskExecutionsPagePagination] = None + task_executions: List[_T] @override def _get_page_items(self) -> List[_T]: - groups = self.groups - if not groups: + task_executions = self.task_executions + if not task_executions: return [] - return groups + return task_executions @override def next_page_info(self) -> Optional[PageInfo]: @@ -904,16 +990,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncGroupsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - groups: List[_T] - pagination: Optional[GroupsPagePagination] = None +class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[TaskExecutionsPagePagination] = None + task_executions: List[_T] @override def _get_page_items(self) -> List[_T]: - groups = self.groups - if not groups: + task_executions = self.task_executions + if not task_executions: return [] - return groups + return task_executions @override def next_page_info(self) -> Optional[PageInfo]: @@ -927,20 +1013,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class ProjectsPagePagination(BaseModel): +class TasksPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncProjectsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - projects: List[_T] - pagination: Optional[ProjectsPagePagination] = None +class SyncTasksPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[TasksPagePagination] = None + tasks: List[_T] @override def _get_page_items(self) -> List[_T]: - projects = self.projects - if not projects: + tasks = self.tasks + if not tasks: return [] - return projects + return tasks @override def next_page_info(self) -> Optional[PageInfo]: @@ -954,16 +1040,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncProjectsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - projects: List[_T] - pagination: Optional[ProjectsPagePagination] = None +class AsyncTasksPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[TasksPagePagination] = None + tasks: List[_T] @override def _get_page_items(self) -> List[_T]: - projects = self.projects - if not projects: + tasks = self.tasks + if not tasks: return [] - return projects + return tasks @override def next_page_info(self) -> Optional[PageInfo]: @@ -977,20 +1063,20 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SecretsPagePagination(BaseModel): +class TokensPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) -class SyncSecretsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - secrets: List[_T] - pagination: Optional[SecretsPagePagination] = None +class SyncTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[TokensPagePagination] = None + tokens: List[_T] @override def _get_page_items(self) -> List[_T]: - secrets = self.secrets - if not secrets: + tokens = self.tokens + if not tokens: return [] - return secrets + return tokens @override def next_page_info(self) -> Optional[PageInfo]: @@ -1004,16 +1090,16 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class AsyncSecretsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - secrets: List[_T] - pagination: Optional[SecretsPagePagination] = None +class AsyncTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[TokensPagePagination] = None + tokens: List[_T] @override def _get_page_items(self) -> List[_T]: - secrets = self.secrets - if not secrets: + tokens = self.tokens + if not tokens: return [] - return secrets + return tokens @override def next_page_info(self) -> Optional[PageInfo]: diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 1d70bbdc..b8493950 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -23,8 +23,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage -from .._base_client import AsyncPaginator, make_request_options +from .._base_client import make_request_options from ..types.account_retrieve_response import AccountRetrieveResponse from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse from ..types.account_list_login_providers_response import AccountListLoginProvidersResponse @@ -174,7 +173,7 @@ def list_login_providers( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse]: + ) -> AccountListLoginProvidersResponse: """ ListLoginProviders returns the list of login providers matching the provided filters. @@ -192,9 +191,8 @@ def list_login_providers( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return self._post( "/gitpod.v1.AccountService/ListLoginProviders", - page=SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], body=maybe_transform( { "filter": filter, @@ -215,8 +213,7 @@ def list_login_providers( account_list_login_providers_params.AccountListLoginProvidersParams, ), ), - model=AccountListLoginProvidersResponse, - method="post", + cast_to=AccountListLoginProvidersResponse, ) @@ -349,7 +346,7 @@ async def get_sso_login_url( cast_to=AccountGetSSOLoginURLResponse, ) - def list_login_providers( + async def list_login_providers( self, *, token: str | NotGiven = NOT_GIVEN, @@ -362,9 +359,7 @@ def list_login_providers( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ - AccountListLoginProvidersResponse, AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse] - ]: + ) -> AccountListLoginProvidersResponse: """ ListLoginProviders returns the list of login providers matching the provided filters. @@ -382,10 +377,9 @@ def list_login_providers( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return await self._post( "/gitpod.v1.AccountService/ListLoginProviders", - page=AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], - body=maybe_transform( + body=await async_maybe_transform( { "filter": filter, "pagination": pagination, @@ -397,7 +391,7 @@ def list_login_providers( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "token": token, "page_size": page_size, @@ -405,8 +399,7 @@ def list_login_providers( account_list_login_providers_params.AccountListLoginProvidersParams, ), ), - model=AccountListLoginProvidersResponse, - method="post", + cast_to=AccountListLoginProvidersResponse, ) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index fa1c787e..46537391 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -18,7 +18,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..pagination import SyncEditorsPage, AsyncEditorsPage from .._base_client import AsyncPaginator, make_request_options from ..types.editor_list_response import EditorListResponse from ..types.editor_retrieve_response import EditorRetrieveResponse @@ -93,7 +93,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[EditorListResponse]: + ) -> SyncEditorsPage[EditorListResponse]: """ ListEditors lists all editors available to the caller @@ -110,7 +110,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EditorService/ListEditors", - page=SyncPersonalAccessTokensPage[EditorListResponse], + page=SyncEditorsPage[EditorListResponse], body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), options=make_request_options( extra_headers=extra_headers, @@ -243,7 +243,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[EditorListResponse, AsyncPersonalAccessTokensPage[EditorListResponse]]: + ) -> AsyncPaginator[EditorListResponse, AsyncEditorsPage[EditorListResponse]]: """ ListEditors lists all editors available to the caller @@ -260,7 +260,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EditorService/ListEditors", - page=AsyncPersonalAccessTokensPage[EditorListResponse], + page=AsyncEditorsPage[EditorListResponse], body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), options=make_request_options( extra_headers=extra_headers, diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index ce3490fb..ecd36130 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -17,7 +17,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ....pagination import SyncServicesPage, AsyncServicesPage from ...._base_client import AsyncPaginator, make_request_options from ....types.environments.automations import ( service_list_params, @@ -192,7 +192,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[ServiceListResponse]: + ) -> SyncServicesPage[ServiceListResponse]: """ ListServices @@ -211,7 +211,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListServices", - page=SyncPersonalAccessTokensPage[ServiceListResponse], + page=SyncServicesPage[ServiceListResponse], body=maybe_transform( { "filter": filter, @@ -505,7 +505,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ServiceListResponse, AsyncPersonalAccessTokensPage[ServiceListResponse]]: + ) -> AsyncPaginator[ServiceListResponse, AsyncServicesPage[ServiceListResponse]]: """ ListServices @@ -524,7 +524,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListServices", - page=AsyncPersonalAccessTokensPage[ServiceListResponse], + page=AsyncServicesPage[ServiceListResponse], body=maybe_transform( { "filter": filter, diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index fa40eefb..4b0defae 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -17,8 +17,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage -from ....._base_client import AsyncPaginator, make_request_options +from ....._base_client import make_request_options from .....types.environments.automations.tasks import ( execution_list_params, execution_stop_params, @@ -95,7 +94,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[ExecutionListResponse]: + ) -> ExecutionListResponse: """ ListTaskExecutions @@ -112,9 +111,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return self._post( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", - page=SyncPersonalAccessTokensPage[ExecutionListResponse], body=maybe_transform( { "filter": filter, @@ -135,8 +133,7 @@ def list( execution_list_params.ExecutionListParams, ), ), - model=ExecutionListResponse, - method="post", + cast_to=ExecutionListResponse, ) def stop( @@ -224,7 +221,7 @@ async def retrieve( cast_to=ExecutionRetrieveResponse, ) - def list( + async def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -237,7 +234,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ExecutionListResponse, AsyncPersonalAccessTokensPage[ExecutionListResponse]]: + ) -> ExecutionListResponse: """ ListTaskExecutions @@ -254,10 +251,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return await self._post( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", - page=AsyncPersonalAccessTokensPage[ExecutionListResponse], - body=maybe_transform( + body=await async_maybe_transform( { "filter": filter, "pagination": pagination, @@ -269,7 +265,7 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "token": token, "page_size": page_size, @@ -277,8 +273,7 @@ def list( execution_list_params.ExecutionListParams, ), ), - model=ExecutionListResponse, - method="post", + cast_to=ExecutionListResponse, ) async def stop( diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 0e9e8e64..29d9e18e 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -27,7 +27,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from .....pagination import SyncTasksPage, AsyncTasksPage from ....._base_client import AsyncPaginator, make_request_options from .....types.environments.automations import ( task_list_params, @@ -202,7 +202,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[TaskListResponse]: + ) -> SyncTasksPage[TaskListResponse]: """ ListTasks @@ -221,7 +221,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListTasks", - page=SyncPersonalAccessTokensPage[TaskListResponse], + page=SyncTasksPage[TaskListResponse], body=maybe_transform( { "filter": filter, @@ -470,7 +470,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[TaskListResponse, AsyncPersonalAccessTokensPage[TaskListResponse]]: + ) -> AsyncPaginator[TaskListResponse, AsyncTasksPage[TaskListResponse]]: """ ListTasks @@ -489,7 +489,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListTasks", - page=AsyncPersonalAccessTokensPage[TaskListResponse], + page=AsyncTasksPage[TaskListResponse], body=maybe_transform( { "filter": filter, diff --git a/src/gitpod/resources/environments/classes.py b/src/gitpod/resources/environments/classes.py index 1e8ed9ec..99c3428c 100644 --- a/src/gitpod/resources/environments/classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -5,7 +5,10 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import maybe_transform +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -14,8 +17,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import make_request_options from ...types.environments import class_list_params from ...types.environments.class_list_response import ClassListResponse @@ -55,7 +57,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[ClassListResponse]: + ) -> ClassListResponse: """ ListEnvironmentClasses returns the list of environment classes with runner details a user is able to use based on the query buf:lint:ignore @@ -72,9 +74,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return self._post( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", - page=SyncPersonalAccessTokensPage[ClassListResponse], body=maybe_transform( { "filter": filter, @@ -95,8 +96,7 @@ def list( class_list_params.ClassListParams, ), ), - model=ClassListResponse, - method="post", + cast_to=ClassListResponse, ) @@ -120,7 +120,7 @@ def with_streaming_response(self) -> AsyncClassesResourceWithStreamingResponse: """ return AsyncClassesResourceWithStreamingResponse(self) - def list( + async def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -133,7 +133,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ClassListResponse, AsyncPersonalAccessTokensPage[ClassListResponse]]: + ) -> ClassListResponse: """ ListEnvironmentClasses returns the list of environment classes with runner details a user is able to use based on the query buf:lint:ignore @@ -150,10 +150,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return await self._post( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", - page=AsyncPersonalAccessTokensPage[ClassListResponse], - body=maybe_transform( + body=await async_maybe_transform( { "filter": filter, "pagination": pagination, @@ -165,7 +164,7 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "token": token, "page_size": page_size, @@ -173,8 +172,7 @@ def list( class_list_params.ClassListParams, ), ), - model=ClassListResponse, - method="post", + cast_to=ClassListResponse, ) diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index d66c4970..4b1b3661 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -40,7 +40,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...pagination import SyncEnvironmentsPage, AsyncEnvironmentsPage from ..._base_client import AsyncPaginator, make_request_options from .automations.automations import ( AutomationsResource, @@ -255,7 +255,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[EnvironmentListResponse]: + ) -> SyncEnvironmentsPage[EnvironmentListResponse]: """ ListEnvironments returns a list of environments that match the query. @@ -274,7 +274,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentService/ListEnvironments", - page=SyncPersonalAccessTokensPage[EnvironmentListResponse], + page=SyncEnvironmentsPage[EnvironmentListResponse], body=maybe_transform( { "filter": filter, @@ -746,7 +746,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[EnvironmentListResponse, AsyncPersonalAccessTokensPage[EnvironmentListResponse]]: + ) -> AsyncPaginator[EnvironmentListResponse, AsyncEnvironmentsPage[EnvironmentListResponse]]: """ ListEnvironments returns a list of environments that match the query. @@ -765,7 +765,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentService/ListEnvironments", - page=AsyncPersonalAccessTokensPage[EnvironmentListResponse], + page=AsyncEnvironmentsPage[EnvironmentListResponse], body=maybe_transform( { "filter": filter, diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index f2f98059..2293eac3 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -21,7 +21,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..pagination import SyncEntriesPage, AsyncEntriesPage from .._base_client import AsyncPaginator, make_request_options from .._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder from ..types.event_list_response import EventListResponse @@ -63,7 +63,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[EventListResponse]: + ) -> SyncEntriesPage[EventListResponse]: """ ListAuditLogs retrieves a paginated list of audit logs for the specified organization @@ -81,7 +81,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EventService/ListAuditLogs", - page=SyncPersonalAccessTokensPage[EventListResponse], + page=SyncEntriesPage[EventListResponse], body=maybe_transform( { "filter": filter, @@ -229,7 +229,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[EventListResponse, AsyncPersonalAccessTokensPage[EventListResponse]]: + ) -> AsyncPaginator[EventListResponse, AsyncEntriesPage[EventListResponse]]: """ ListAuditLogs retrieves a paginated list of audit logs for the specified organization @@ -247,7 +247,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EventService/ListAuditLogs", - page=AsyncPersonalAccessTokensPage[EventListResponse], + page=AsyncEntriesPage[EventListResponse], body=maybe_transform( { "filter": filter, diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py index b0d965ea..42b262f7 100644 --- a/src/gitpod/resources/groups.py +++ b/src/gitpod/resources/groups.py @@ -15,7 +15,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..pagination import SyncGroupsPage, AsyncGroupsPage from .._base_client import AsyncPaginator, make_request_options from ..types.group_list_response import GroupListResponse @@ -54,7 +54,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[GroupListResponse]: + ) -> SyncGroupsPage[GroupListResponse]: """ ListGroups lists groups @@ -71,7 +71,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.GroupService/ListGroups", - page=SyncPersonalAccessTokensPage[GroupListResponse], + page=SyncGroupsPage[GroupListResponse], body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), options=make_request_options( extra_headers=extra_headers, @@ -123,7 +123,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[GroupListResponse, AsyncPersonalAccessTokensPage[GroupListResponse]]: + ) -> AsyncPaginator[GroupListResponse, AsyncGroupsPage[GroupListResponse]]: """ ListGroups lists groups @@ -140,7 +140,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.GroupService/ListGroups", - page=AsyncPersonalAccessTokensPage[GroupListResponse], + page=AsyncGroupsPage[GroupListResponse], body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), options=make_request_options( extra_headers=extra_headers, diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index b0e93c4d..9323dc35 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -39,7 +39,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...pagination import SyncMembersPage, AsyncMembersPage, SyncOrganizationsPage, AsyncOrganizationsPage from ..._base_client import AsyncPaginator, make_request_options from .sso_configurations import ( SSOConfigurationsResource, @@ -270,7 +270,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[OrganizationListResponse]: + ) -> SyncOrganizationsPage[OrganizationListResponse]: """ ListOrganizations lists all organization the caller has access to. @@ -289,7 +289,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListOrganizations", - page=SyncPersonalAccessTokensPage[OrganizationListResponse], + page=SyncOrganizationsPage[OrganizationListResponse], body=maybe_transform( { "pagination": pagination, @@ -479,7 +479,7 @@ def list_members( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[OrganizationListMembersResponse]: + ) -> SyncMembersPage[OrganizationListMembersResponse]: """ ListMembers lists all members of the specified organization. @@ -498,7 +498,7 @@ def list_members( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListMembers", - page=SyncPersonalAccessTokensPage[OrganizationListMembersResponse], + page=SyncMembersPage[OrganizationListMembersResponse], body=maybe_transform( { "organization_id": organization_id, @@ -777,7 +777,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[OrganizationListResponse, AsyncPersonalAccessTokensPage[OrganizationListResponse]]: + ) -> AsyncPaginator[OrganizationListResponse, AsyncOrganizationsPage[OrganizationListResponse]]: """ ListOrganizations lists all organization the caller has access to. @@ -796,7 +796,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListOrganizations", - page=AsyncPersonalAccessTokensPage[OrganizationListResponse], + page=AsyncOrganizationsPage[OrganizationListResponse], body=maybe_transform( { "pagination": pagination, @@ -986,9 +986,7 @@ def list_members( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ - OrganizationListMembersResponse, AsyncPersonalAccessTokensPage[OrganizationListMembersResponse] - ]: + ) -> AsyncPaginator[OrganizationListMembersResponse, AsyncMembersPage[OrganizationListMembersResponse]]: """ ListMembers lists all members of the specified organization. @@ -1007,7 +1005,7 @@ def list_members( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListMembers", - page=AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], + page=AsyncMembersPage[OrganizationListMembersResponse], body=maybe_transform( { "organization_id": organization_id, diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 414ae66d..54b6e3c5 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -20,8 +20,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import make_request_options from ...types.organizations import ( sso_configuration_list_params, sso_configuration_create_params, @@ -336,7 +335,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[SSOConfigurationListResponse]: + ) -> SSOConfigurationListResponse: """ ListSSOConfigurations lists all SSO configurations matching provided filters. @@ -351,9 +350,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return self._post( "/gitpod.v1.OrganizationService/ListSSOConfigurations", - page=SyncPersonalAccessTokensPage[SSOConfigurationListResponse], body=maybe_transform( { "organization_id": organization_id, @@ -374,8 +372,7 @@ def list( sso_configuration_list_params.SSOConfigurationListParams, ), ), - model=SSOConfigurationListResponse, - method="post", + cast_to=SSOConfigurationListResponse, ) def delete( @@ -701,7 +698,7 @@ async def update( cast_to=object, ) - def list( + async def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -714,7 +711,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[SSOConfigurationListResponse, AsyncPersonalAccessTokensPage[SSOConfigurationListResponse]]: + ) -> SSOConfigurationListResponse: """ ListSSOConfigurations lists all SSO configurations matching provided filters. @@ -729,10 +726,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return await self._post( "/gitpod.v1.OrganizationService/ListSSOConfigurations", - page=AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], - body=maybe_transform( + body=await async_maybe_transform( { "organization_id": organization_id, "pagination": pagination, @@ -744,7 +740,7 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "token": token, "page_size": page_size, @@ -752,8 +748,7 @@ def list( sso_configuration_list_params.SSOConfigurationListParams, ), ), - model=SSOConfigurationListResponse, - method="post", + cast_to=SSOConfigurationListResponse, ) async def delete( diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index 70f043ff..d1a008fd 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -19,7 +19,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...pagination import SyncPoliciesPage, AsyncPoliciesPage from ..._base_client import AsyncPaginator, make_request_options from ...types.projects import policy_list_params, policy_create_params, policy_delete_params, policy_update_params from ...types.projects.policy_list_response import PolicyListResponse @@ -152,7 +152,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[PolicyListResponse]: + ) -> SyncPoliciesPage[PolicyListResponse]: """ ListProjectPolicies lists policies for a project. @@ -171,7 +171,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.ProjectService/ListProjectPolicies", - page=SyncPersonalAccessTokensPage[PolicyListResponse], + page=SyncPoliciesPage[PolicyListResponse], body=maybe_transform( { "pagination": pagination, @@ -363,7 +363,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PolicyListResponse, AsyncPersonalAccessTokensPage[PolicyListResponse]]: + ) -> AsyncPaginator[PolicyListResponse, AsyncPoliciesPage[PolicyListResponse]]: """ ListProjectPolicies lists policies for a project. @@ -382,7 +382,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.ProjectService/ListProjectPolicies", - page=AsyncPersonalAccessTokensPage[PolicyListResponse], + page=AsyncPoliciesPage[PolicyListResponse], body=maybe_transform( { "pagination": pagination, diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 2c77a8b4..90dab12b 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -36,7 +36,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...pagination import SyncProjectsPage, AsyncProjectsPage from ..._base_client import AsyncPaginator, make_request_options from ...types.project_list_response import ProjectListResponse from ...types.project_create_response import ProjectCreateResponse @@ -360,7 +360,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[ProjectListResponse]: + ) -> SyncProjectsPage[ProjectListResponse]: """ ListProjects lists all projects the caller has access to. @@ -377,7 +377,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.ProjectService/ListProjects", - page=SyncPersonalAccessTokensPage[ProjectListResponse], + page=SyncProjectsPage[ProjectListResponse], body=maybe_transform({"pagination": pagination}, project_list_params.ProjectListParams), options=make_request_options( extra_headers=extra_headers, @@ -785,7 +785,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ProjectListResponse, AsyncPersonalAccessTokensPage[ProjectListResponse]]: + ) -> AsyncPaginator[ProjectListResponse, AsyncProjectsPage[ProjectListResponse]]: """ ListProjects lists all projects the caller has access to. @@ -802,7 +802,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.ProjectService/ListProjects", - page=AsyncPersonalAccessTokensPage[ProjectListResponse], + page=AsyncProjectsPage[ProjectListResponse], body=maybe_transform({"pagination": pagination}, project_list_params.ProjectListParams), options=make_request_options( extra_headers=extra_headers, diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index 216bacb4..915532fb 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -21,8 +21,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage -from ...._base_client import AsyncPaginator, make_request_options +from ...._base_client import make_request_options from ....types.runners.configurations import ( environment_class_list_params, environment_class_create_params, @@ -255,7 +254,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[EnvironmentClassListResponse]: + ) -> EnvironmentClassListResponse: """ ListEnvironmentClasses returns all environment classes configured for a runner. buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE @@ -271,9 +270,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return self._post( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", - page=SyncPersonalAccessTokensPage[EnvironmentClassListResponse], body=maybe_transform( { "filter": filter, @@ -294,8 +292,7 @@ def list( environment_class_list_params.EnvironmentClassListParams, ), ), - model=EnvironmentClassListResponse, - method="post", + cast_to=EnvironmentClassListResponse, ) @@ -505,7 +502,7 @@ async def update( cast_to=object, ) - def list( + async def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -518,7 +515,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[EnvironmentClassListResponse, AsyncPersonalAccessTokensPage[EnvironmentClassListResponse]]: + ) -> EnvironmentClassListResponse: """ ListEnvironmentClasses returns all environment classes configured for a runner. buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE @@ -534,10 +531,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return await self._post( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", - page=AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], - body=maybe_transform( + body=await async_maybe_transform( { "filter": filter, "pagination": pagination, @@ -549,7 +545,7 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "token": token, "page_size": page_size, @@ -557,8 +553,7 @@ def list( environment_class_list_params.EnvironmentClassListParams, ), ), - model=EnvironmentClassListResponse, - method="post", + cast_to=EnvironmentClassListResponse, ) diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index c8165449..8321f34d 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -22,7 +22,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ....pagination import SyncTokensPage, AsyncTokensPage from ...._base_client import AsyncPaginator, make_request_options from ....types.runners.configurations import ( host_authentication_token_list_params, @@ -449,7 +449,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse]: + ) -> SyncTokensPage[HostAuthenticationTokenListResponse]: """ ListHostAuthenticationTokens @@ -464,7 +464,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", - page=SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + page=SyncTokensPage[HostAuthenticationTokenListResponse], body=maybe_transform( { "filter": filter, @@ -931,9 +931,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ - HostAuthenticationTokenListResponse, AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse] - ]: + ) -> AsyncPaginator[HostAuthenticationTokenListResponse, AsyncTokensPage[HostAuthenticationTokenListResponse]]: """ ListHostAuthenticationTokens @@ -948,7 +946,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", - page=AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], + page=AsyncTokensPage[HostAuthenticationTokenListResponse], body=maybe_transform( { "filter": filter, diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 7108e737..51596137 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -20,7 +20,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ....pagination import SyncIntegrationsPage, AsyncIntegrationsPage from ...._base_client import AsyncPaginator, make_request_options from ....types.runners.configurations import ( scm_integration_list_params, @@ -312,7 +312,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[ScmIntegrationListResponse]: + ) -> SyncIntegrationsPage[ScmIntegrationListResponse]: """ ListSCMIntegrations returns all SCM integrations configured for a runner. @@ -329,7 +329,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", - page=SyncPersonalAccessTokensPage[ScmIntegrationListResponse], + page=SyncIntegrationsPage[ScmIntegrationListResponse], body=maybe_transform( { "filter": filter, @@ -663,7 +663,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ScmIntegrationListResponse, AsyncPersonalAccessTokensPage[ScmIntegrationListResponse]]: + ) -> AsyncPaginator[ScmIntegrationListResponse, AsyncIntegrationsPage[ScmIntegrationListResponse]]: """ ListSCMIntegrations returns all SCM integrations configured for a runner. @@ -680,7 +680,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", - page=AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], + page=AsyncIntegrationsPage[ScmIntegrationListResponse], body=maybe_transform( { "filter": filter, diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index b2355073..4f703c1a 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -19,7 +19,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...pagination import SyncPoliciesPage, AsyncPoliciesPage from ..._base_client import AsyncPaginator, make_request_options from ...types.runners import policy_list_params, policy_create_params, policy_delete_params, policy_update_params from ...types.runners.policy_list_response import PolicyListResponse @@ -152,7 +152,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[PolicyListResponse]: + ) -> SyncPoliciesPage[PolicyListResponse]: """ ListRunnerPolicies lists runner policies. @@ -171,7 +171,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerService/ListRunnerPolicies", - page=SyncPersonalAccessTokensPage[PolicyListResponse], + page=SyncPoliciesPage[PolicyListResponse], body=maybe_transform( { "pagination": pagination, @@ -363,7 +363,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PolicyListResponse, AsyncPersonalAccessTokensPage[PolicyListResponse]]: + ) -> AsyncPaginator[PolicyListResponse, AsyncPoliciesPage[PolicyListResponse]]: """ ListRunnerPolicies lists runner policies. @@ -382,7 +382,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerService/ListRunnerPolicies", - page=AsyncPersonalAccessTokensPage[PolicyListResponse], + page=AsyncPoliciesPage[PolicyListResponse], body=maybe_transform( { "pagination": pagination, diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 82f8e867..85b041d4 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -38,7 +38,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ...pagination import SyncRunnersPage, AsyncRunnersPage from ..._base_client import AsyncPaginator, make_request_options from ...types.runner_list_response import RunnerListResponse from .configurations.configurations import ( @@ -276,7 +276,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[RunnerListResponse]: + ) -> SyncRunnersPage[RunnerListResponse]: """ ListRunners returns all runners registered in the scope. @@ -293,7 +293,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerService/ListRunners", - page=SyncPersonalAccessTokensPage[RunnerListResponse], + page=SyncRunnersPage[RunnerListResponse], body=maybe_transform( { "filter": filter, @@ -710,7 +710,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RunnerListResponse, AsyncPersonalAccessTokensPage[RunnerListResponse]]: + ) -> AsyncPaginator[RunnerListResponse, AsyncRunnersPage[RunnerListResponse]]: """ ListRunners returns all runners registered in the scope. @@ -727,7 +727,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerService/ListRunners", - page=AsyncPersonalAccessTokensPage[RunnerListResponse], + page=AsyncRunnersPage[RunnerListResponse], body=maybe_transform( { "filter": filter, diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 72b10043..8740065f 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Any, cast from typing_extensions import overload import httpx @@ -27,7 +28,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from ..pagination import SyncSecretsPage, AsyncSecretsPage from .._base_client import AsyncPaginator, make_request_options from ..types.secret_list_response import SecretListResponse from ..types.secret_create_response import SecretCreateResponse @@ -179,7 +180,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[SecretListResponse]: + ) -> SyncSecretsPage[SecretListResponse]: """ ListSecrets lists secrets. @@ -196,7 +197,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.SecretService/ListSecrets", - page=SyncPersonalAccessTokensPage[SecretListResponse], + page=SyncSecretsPage[SecretListResponse], body=maybe_transform( { "filter": filter, @@ -217,7 +218,7 @@ def list( secret_list_params.SecretListParams, ), ), - model=SecretListResponse, + model=cast(Any, SecretListResponse), # Union types cannot be passed in as arguments in the type system method="post", ) @@ -471,7 +472,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[SecretListResponse, AsyncPersonalAccessTokensPage[SecretListResponse]]: + ) -> AsyncPaginator[SecretListResponse, AsyncSecretsPage[SecretListResponse]]: """ ListSecrets lists secrets. @@ -488,7 +489,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.SecretService/ListSecrets", - page=AsyncPersonalAccessTokensPage[SecretListResponse], + page=AsyncSecretsPage[SecretListResponse], body=maybe_transform( { "filter": filter, @@ -509,7 +510,7 @@ def list( secret_list_params.SecretListParams, ), ), - model=SecretListResponse, + model=cast(Any, SecretListResponse), # Union types cannot be passed in as arguments in the type system method="post", ) diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 17474a15..53e07a76 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -17,9 +17,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from ...types.users import pat_get_params, pat_list_params, pat_delete_params -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import make_request_options from ...types.users.pat_get_response import PatGetResponse from ...types.users.pat_list_response import PatListResponse @@ -59,7 +58,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[PatListResponse]: + ) -> PatListResponse: """ ListPersonalAccessTokens @@ -72,9 +71,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return self._post( "/gitpod.v1.UserService/ListPersonalAccessTokens", - page=SyncPersonalAccessTokensPage[PatListResponse], body=maybe_transform( { "filter": filter, @@ -95,8 +93,7 @@ def list( pat_list_params.PatListParams, ), ), - model=PatListResponse, - method="post", + cast_to=PatListResponse, ) def delete( @@ -186,7 +183,7 @@ def with_streaming_response(self) -> AsyncPatsResourceWithStreamingResponse: """ return AsyncPatsResourceWithStreamingResponse(self) - def list( + async def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -199,7 +196,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PatListResponse, AsyncPersonalAccessTokensPage[PatListResponse]]: + ) -> PatListResponse: """ ListPersonalAccessTokens @@ -212,10 +209,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return await self._post( "/gitpod.v1.UserService/ListPersonalAccessTokens", - page=AsyncPersonalAccessTokensPage[PatListResponse], - body=maybe_transform( + body=await async_maybe_transform( { "filter": filter, "pagination": pagination, @@ -227,7 +223,7 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "token": token, "page_size": page_size, @@ -235,8 +231,7 @@ def list( pat_list_params.PatListParams, ), ), - model=PatListResponse, - method="post", + cast_to=PatListResponse, ) async def delete( diff --git a/src/gitpod/types/editor_list_response.py b/src/gitpod/types/editor_list_response.py index 9c4e96f9..d9482a8b 100644 --- a/src/gitpod/types/editor_list_response.py +++ b/src/gitpod/types/editor_list_response.py @@ -1,15 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["EditorListResponse", "Editor", "Pagination"] +__all__ = ["EditorListResponse"] -class Editor(BaseModel): +class EditorListResponse(BaseModel): id: Optional[str] = None alias: Optional[str] = None @@ -23,25 +23,3 @@ class Editor(BaseModel): short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) - - -class Pagination(BaseModel): - token: Optional[str] = None - """ - Token for the next set of results that was returned as next_token of a - PaginationResponse - """ - - page_size: Optional[int] = FieldInfo(alias="pageSize", default=None) - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ - - -class EditorListResponse(BaseModel): - editors: Optional[List[Editor]] = None - """editors contains the list of editors""" - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py index b193d660..02c45aab 100644 --- a/src/gitpod/types/environment_list_response.py +++ b/src/gitpod/types/environment_list_response.py @@ -10,47 +10,45 @@ __all__ = [ "EnvironmentListResponse", - "Environment", - "EnvironmentMetadata", - "EnvironmentMetadataCreator", - "EnvironmentSpec", - "EnvironmentSpecAutomationsFile", - "EnvironmentSpecContent", - "EnvironmentSpecContentInitializer", - "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecContextURL", - "EnvironmentSpecContentInitializerSpecContextURLContextURL", - "EnvironmentSpecContentInitializerSpecGit", - "EnvironmentSpecContentInitializerSpecGitGit", - "EnvironmentSpecDevcontainer", - "EnvironmentSpecMachine", - "EnvironmentSpecPort", - "EnvironmentSpecSecret", - "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", - "EnvironmentSpecSecretUnionMember2", - "EnvironmentSpecSSHPublicKey", - "EnvironmentSpecTimeout", - "EnvironmentStatus", - "EnvironmentStatusActivitySignal", - "EnvironmentStatusAutomationsFile", - "EnvironmentStatusContent", - "EnvironmentStatusContentGit", - "EnvironmentStatusContentGitChangedFile", - "EnvironmentStatusDevcontainer", - "EnvironmentStatusEnvironmentURLs", - "EnvironmentStatusEnvironmentURLsPort", - "EnvironmentStatusEnvironmentURLsSSH", - "EnvironmentStatusMachine", - "EnvironmentStatusMachineVersions", - "EnvironmentStatusRunnerAck", - "EnvironmentStatusSecret", - "EnvironmentStatusSSHPublicKey", - "Pagination", + "Metadata", + "MetadataCreator", + "Spec", + "SpecAutomationsFile", + "SpecContent", + "SpecContentInitializer", + "SpecContentInitializerSpec", + "SpecContentInitializerSpecContextURL", + "SpecContentInitializerSpecContextURLContextURL", + "SpecContentInitializerSpecGit", + "SpecContentInitializerSpecGitGit", + "SpecDevcontainer", + "SpecMachine", + "SpecPort", + "SpecSecret", + "SpecSecretUnionMember0", + "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", + "SpecSecretUnionMember2", + "SpecSSHPublicKey", + "SpecTimeout", + "Status", + "StatusActivitySignal", + "StatusAutomationsFile", + "StatusContent", + "StatusContentGit", + "StatusContentGitChangedFile", + "StatusDevcontainer", + "StatusEnvironmentURLs", + "StatusEnvironmentURLsPort", + "StatusEnvironmentURLsSSH", + "StatusMachine", + "StatusMachineVersions", + "StatusRunnerAck", + "StatusSecret", + "StatusSSHPublicKey", ] -class EnvironmentMetadataCreator(BaseModel): +class MetadataCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -67,7 +65,7 @@ class EnvironmentMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class EnvironmentMetadata(BaseModel): +class Metadata(BaseModel): annotations: Optional[Dict[str, str]] = None """ annotations are key/value pairs that gets attached to the environment. @@ -166,7 +164,7 @@ class EnvironmentMetadata(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[EnvironmentMetadataCreator] = None + creator: Optional[MetadataCreator] = None """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) @@ -283,7 +281,7 @@ class EnvironmentMetadata(BaseModel): """Runner is the ID of the runner that runs this environment.""" -class EnvironmentSpecAutomationsFile(BaseModel): +class SpecAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the @@ -298,16 +296,16 @@ class EnvironmentSpecAutomationsFile(BaseModel): session: Optional[str] = None -class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): +class SpecContentInitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class SpecContentInitializerSpecContextURL(BaseModel): + context_url: SpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") -class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): +class SpecContentInitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """ a path relative to the environment root in which the code will be checked out to @@ -334,33 +332,31 @@ class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class EnvironmentSpecContentInitializerSpecGit(BaseModel): - git: EnvironmentSpecContentInitializerSpecGitGit +class SpecContentInitializerSpecGit(BaseModel): + git: SpecContentInitializerSpecGitGit -EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit -] +SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] -class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None +class SpecContentInitializer(BaseModel): + specs: Optional[List[SpecContentInitializerSpec]] = None -class EnvironmentSpecContent(BaseModel): +class SpecContent(BaseModel): git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) """The Git email address""" git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) """The Git username""" - initializer: Optional[EnvironmentSpecContentInitializer] = None + initializer: Optional[SpecContentInitializer] = None """EnvironmentInitializer specifies how an environment is to be initialized""" session: Optional[str] = None -class EnvironmentSpecDevcontainer(BaseModel): +class SpecDevcontainer(BaseModel): devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo @@ -374,14 +370,14 @@ class EnvironmentSpecDevcontainer(BaseModel): session: Optional[str] = None -class EnvironmentSpecMachine(BaseModel): +class SpecMachine(BaseModel): class_: Optional[str] = FieldInfo(alias="class", default=None) """Class denotes the class of the environment we ought to start""" session: Optional[str] = None -class EnvironmentSpecPort(BaseModel): +class SpecPort(BaseModel): admission: Optional[ Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] ] = None @@ -394,7 +390,7 @@ class EnvironmentSpecPort(BaseModel): """port number""" -class EnvironmentSpecSecretUnionMember0(BaseModel): +class SpecSecretUnionMember0(BaseModel): environment_variable: str = FieldInfo(alias="environmentVariable") name: Optional[str] = None @@ -413,7 +409,7 @@ class EnvironmentSpecSecretUnionMember0(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): +class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """file_path is the path inside the devcontainer where the secret is mounted""" @@ -433,7 +429,7 @@ class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretI """source_ref into the source, in case of control-plane this is uuid of the secret""" -class EnvironmentSpecSecretUnionMember2(BaseModel): +class SpecSecretUnionMember2(BaseModel): git_credential_host: str = FieldInfo(alias="gitCredentialHost") name: Optional[str] = None @@ -452,14 +448,14 @@ class EnvironmentSpecSecretUnionMember2(BaseModel): """source_ref into the source, in case of control-plane this is uuid of the secret""" -EnvironmentSpecSecret: TypeAlias = Union[ - EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, - EnvironmentSpecSecretUnionMember2, +SpecSecret: TypeAlias = Union[ + SpecSecretUnionMember0, + SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, + SpecSecretUnionMember2, ] -class EnvironmentSpecSSHPublicKey(BaseModel): +class SpecSSHPublicKey(BaseModel): id: Optional[str] = None """id is the unique identifier of the public key""" @@ -467,7 +463,7 @@ class EnvironmentSpecSSHPublicKey(BaseModel): """value is the actual public key in the public key file format""" -class EnvironmentSpecTimeout(BaseModel): +class SpecTimeout(BaseModel): disconnected: Optional[str] = None """ A Duration represents a signed, fixed-length span of time represented as a count @@ -530,16 +526,16 @@ class EnvironmentSpecTimeout(BaseModel): """ -class EnvironmentSpec(BaseModel): +class Spec(BaseModel): admission: Optional[ Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] ] = None """Admission level describes who can access an environment instance and its ports.""" - automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + automations_file: Optional[SpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) """automations_file is the automations file spec of the environment""" - content: Optional[EnvironmentSpecContent] = None + content: Optional[SpecContent] = None """content is the content spec of the environment""" desired_phase: Optional[ @@ -557,16 +553,16 @@ class EnvironmentSpec(BaseModel): ] = FieldInfo(alias="desiredPhase", default=None) """Phase is the desired phase of the environment""" - devcontainer: Optional[EnvironmentSpecDevcontainer] = None + devcontainer: Optional[SpecDevcontainer] = None """devcontainer is the devcontainer spec of the environment""" - machine: Optional[EnvironmentSpecMachine] = None + machine: Optional[SpecMachine] = None """machine is the machine spec of the environment""" - ports: Optional[List[EnvironmentSpecPort]] = None + ports: Optional[List[SpecPort]] = None """ports is the set of ports which ought to be exposed to the internet""" - secrets: Optional[List[EnvironmentSpecSecret]] = None + secrets: Optional[List[SpecSecret]] = None """secrets are confidential data that is mounted into the environment""" spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) @@ -577,14 +573,14 @@ class EnvironmentSpec(BaseModel): b.spec_version then a was the spec before b. """ - ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + ssh_public_keys: Optional[List[SpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys are the public keys used to ssh into the environment""" - timeout: Optional[EnvironmentSpecTimeout] = None + timeout: Optional[SpecTimeout] = None """Timeout configures the environment timeout""" -class EnvironmentStatusActivitySignal(BaseModel): +class StatusActivitySignal(BaseModel): source: Optional[str] = None """ source of the activity signal, such as "VS Code", "SSH", or "Automations". It @@ -685,7 +681,7 @@ class EnvironmentStatusActivitySignal(BaseModel): """ -class EnvironmentStatusAutomationsFile(BaseModel): +class StatusAutomationsFile(BaseModel): automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file relative to the repo @@ -725,7 +721,7 @@ class EnvironmentStatusAutomationsFile(BaseModel): """ -class EnvironmentStatusContentGitChangedFile(BaseModel): +class StatusContentGitChangedFile(BaseModel): change_type: Optional[ Literal[ "CHANGE_TYPE_UNSPECIFIED", @@ -744,13 +740,11 @@ class EnvironmentStatusContentGitChangedFile(BaseModel): """path is the path of the file""" -class EnvironmentStatusContentGit(BaseModel): +class StatusContentGit(BaseModel): branch: Optional[str] = None """branch is branch we're currently on""" - changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( - alias="changedFiles", default=None - ) + changed_files: Optional[List[StatusContentGitChangedFile]] = FieldInfo(alias="changedFiles", default=None) """ changed_files is an array of changed files in the environment, possibly truncated @@ -777,14 +771,14 @@ class EnvironmentStatusContentGit(BaseModel): """ -class EnvironmentStatusContent(BaseModel): +class StatusContent(BaseModel): content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) """content_location_in_machine is the location of the content in the machine""" failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message contains the reason the content initialization failed.""" - git: Optional[EnvironmentStatusContentGit] = None + git: Optional[StatusContentGit] = None """ git is the Git working copy status of the environment. Note: this is a best-effort field and more often than not will not be present. Its absence does @@ -813,7 +807,7 @@ class EnvironmentStatusContent(BaseModel): """ -class EnvironmentStatusDevcontainer(BaseModel): +class StatusDevcontainer(BaseModel): container_id: Optional[str] = FieldInfo(alias="containerId", default=None) """container_id is the ID of the container.""" @@ -876,7 +870,7 @@ class EnvironmentStatusDevcontainer(BaseModel): """ -class EnvironmentStatusEnvironmentURLsPort(BaseModel): +class StatusEnvironmentURLsPort(BaseModel): port: Optional[int] = None """port is the port number of the environment port""" @@ -884,27 +878,27 @@ class EnvironmentStatusEnvironmentURLsPort(BaseModel): """url is the URL at which the environment port can be accessed""" -class EnvironmentStatusEnvironmentURLsSSH(BaseModel): +class StatusEnvironmentURLsSSH(BaseModel): url: Optional[str] = None -class EnvironmentStatusEnvironmentURLs(BaseModel): +class StatusEnvironmentURLs(BaseModel): logs: Optional[str] = None """logs is the URL at which the environment logs can be accessed.""" - ports: Optional[List[EnvironmentStatusEnvironmentURLsPort]] = None + ports: Optional[List[StatusEnvironmentURLsPort]] = None - ssh: Optional[EnvironmentStatusEnvironmentURLsSSH] = None + ssh: Optional[StatusEnvironmentURLsSSH] = None """SSH is the URL at which the environment can be accessed via SSH.""" -class EnvironmentStatusMachineVersions(BaseModel): +class StatusMachineVersions(BaseModel): supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) -class EnvironmentStatusMachine(BaseModel): +class StatusMachine(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message contains the reason the machine failed to operate.""" @@ -931,7 +925,7 @@ class EnvironmentStatusMachine(BaseModel): If this field is empty, the environment has not timed out. """ - versions: Optional[EnvironmentStatusMachineVersions] = None + versions: Optional[StatusMachineVersions] = None """versions contains the versions of components in the machine.""" warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) @@ -941,7 +935,7 @@ class EnvironmentStatusMachine(BaseModel): """ -class EnvironmentStatusRunnerAck(BaseModel): +class StatusRunnerAck(BaseModel): message: Optional[str] = None spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) @@ -956,7 +950,7 @@ class EnvironmentStatusRunnerAck(BaseModel): ] = FieldInfo(alias="statusCode", default=None) -class EnvironmentStatusSecret(BaseModel): +class StatusSecret(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message contains the reason the secret failed to be materialize.""" @@ -983,7 +977,7 @@ class EnvironmentStatusSecret(BaseModel): """ -class EnvironmentStatusSSHPublicKey(BaseModel): +class StatusSSHPublicKey(BaseModel): id: Optional[str] = None """id is the unique identifier of the public key""" @@ -1000,20 +994,20 @@ class EnvironmentStatusSSHPublicKey(BaseModel): """phase is the current phase of the public key""" -class EnvironmentStatus(BaseModel): - activity_signal: Optional[EnvironmentStatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) +class Status(BaseModel): + activity_signal: Optional[StatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) """EnvironmentActivitySignal used to signal activity for an environment.""" - automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) + automations_file: Optional[StatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) """automations_file contains the status of the automations file.""" - content: Optional[EnvironmentStatusContent] = None + content: Optional[StatusContent] = None """content contains the status of the environment content.""" - devcontainer: Optional[EnvironmentStatusDevcontainer] = None + devcontainer: Optional[StatusDevcontainer] = None """devcontainer contains the status of the devcontainer.""" - environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) + environment_urls: Optional[StatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) """ environment_url contains the URL at which the environment can be accessed. This field is only set if the environment is running. @@ -1026,7 +1020,7 @@ class EnvironmentStatus(BaseModel): transition to a stopped state. """ - machine: Optional[EnvironmentStatusMachine] = None + machine: Optional[StatusMachine] = None """machine contains the status of the environment machine""" phase: Optional[ @@ -1047,16 +1041,16 @@ class EnvironmentStatus(BaseModel): environment is in its lifecycle """ - runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) + runner_ack: Optional[StatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) """ RunnerACK is the acknowledgement from the runner that is has received the environment spec. """ - secrets: Optional[List[EnvironmentStatusSecret]] = None + secrets: Optional[List[StatusSecret]] = None """secrets contains the status of the environment secrets""" - ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + ssh_public_keys: Optional[List[StatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) """ssh_public_keys contains the status of the environment ssh public keys""" status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) @@ -1075,7 +1069,7 @@ class EnvironmentStatus(BaseModel): """ -class Environment(BaseModel): +class EnvironmentListResponse(BaseModel): id: Optional[str] = None """ID is a unique identifier of this environment. @@ -1083,33 +1077,17 @@ class Environment(BaseModel): manager """ - metadata: Optional[EnvironmentMetadata] = None + metadata: Optional[Metadata] = None """ EnvironmentMetadata is data associated with an environment that's required for other parts of the system to function """ - spec: Optional[EnvironmentSpec] = None + spec: Optional[Spec] = None """ EnvironmentSpec specifies the configuration of an environment for an environment start """ - status: Optional[EnvironmentStatus] = None + status: Optional[Status] = None """EnvironmentStatus describes an environment status""" - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class EnvironmentListResponse(BaseModel): - environments: Optional[List[Environment]] = None - """environments are the environments that matched the query""" - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/environments/automations/service_list_response.py b/src/gitpod/types/environments/automations/service_list_response.py index 6eb25a7c..e4366982 100644 --- a/src/gitpod/types/environments/automations/service_list_response.py +++ b/src/gitpod/types/environments/automations/service_list_response.py @@ -10,31 +10,21 @@ __all__ = [ "ServiceListResponse", - "Pagination", - "Service", - "ServiceMetadata", - "ServiceMetadataCreator", - "ServiceMetadataTriggeredBy", - "ServiceMetadataTriggeredByManual", - "ServiceMetadataTriggeredByPostDevcontainerStart", - "ServiceMetadataTriggeredByPostEnvironmentStart", - "ServiceSpec", - "ServiceSpecCommands", - "ServiceSpecRunsOn", - "ServiceSpecRunsOnDocker", - "ServiceStatus", + "Metadata", + "MetadataCreator", + "MetadataTriggeredBy", + "MetadataTriggeredByManual", + "MetadataTriggeredByPostDevcontainerStart", + "MetadataTriggeredByPostEnvironmentStart", + "Spec", + "SpecCommands", + "SpecRunsOn", + "SpecRunsOnDocker", + "Status", ] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class ServiceMetadataCreator(BaseModel): +class MetadataCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -51,26 +41,24 @@ class ServiceMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class ServiceMetadataTriggeredByManual(BaseModel): +class MetadataTriggeredByManual(BaseModel): manual: bool -class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): +class MetadataTriggeredByPostDevcontainerStart(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") -class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): +class MetadataTriggeredByPostEnvironmentStart(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") -ServiceMetadataTriggeredBy: TypeAlias = Union[ - ServiceMetadataTriggeredByManual, - ServiceMetadataTriggeredByPostDevcontainerStart, - ServiceMetadataTriggeredByPostEnvironmentStart, +MetadataTriggeredBy: TypeAlias = Union[ + MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart ] -class ServiceMetadata(BaseModel): +class Metadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local @@ -163,7 +151,7 @@ class ServiceMetadata(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[ServiceMetadataCreator] = None + creator: Optional[MetadataCreator] = None """creator describes the principal who created the service.""" description: Optional[str] = None @@ -186,11 +174,11 @@ class ServiceMetadata(BaseModel): identify the service in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[MetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the service.""" -class ServiceSpecCommands(BaseModel): +class SpecCommands(BaseModel): ready: Optional[str] = None """ ready is an optional command that is run repeatedly until it exits with a zero @@ -220,18 +208,18 @@ class ServiceSpecCommands(BaseModel): """ -class ServiceSpecRunsOnDocker(BaseModel): +class SpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class ServiceSpecRunsOn(BaseModel): - docker: ServiceSpecRunsOnDocker +class SpecRunsOn(BaseModel): + docker: SpecRunsOnDocker -class ServiceSpec(BaseModel): - commands: Optional[ServiceSpecCommands] = None +class Spec(BaseModel): + commands: Optional[SpecCommands] = None """ commands contains the commands to start, stop and check the readiness of the service @@ -253,7 +241,7 @@ class ServiceSpec(BaseModel): Used to start or stop the service. """ - runs_on: Optional[ServiceSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[SpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the service should run on.""" session: Optional[str] = None @@ -271,7 +259,7 @@ class ServiceSpec(BaseModel): """ -class ServiceStatus(BaseModel): +class Status(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the service failed to operate. @@ -308,19 +296,13 @@ class ServiceStatus(BaseModel): """ -class Service(BaseModel): +class ServiceListResponse(BaseModel): id: Optional[str] = None environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - metadata: Optional[ServiceMetadata] = None + metadata: Optional[Metadata] = None - spec: Optional[ServiceSpec] = None - - status: Optional[ServiceStatus] = None - - -class ServiceListResponse(BaseModel): - pagination: Optional[Pagination] = None + spec: Optional[Spec] = None - services: Optional[List[Service]] = None + status: Optional[Status] = None diff --git a/src/gitpod/types/environments/automations/task_list_response.py b/src/gitpod/types/environments/automations/task_list_response.py index e27ba172..cd4131ae 100644 --- a/src/gitpod/types/environments/automations/task_list_response.py +++ b/src/gitpod/types/environments/automations/task_list_response.py @@ -10,29 +10,19 @@ __all__ = [ "TaskListResponse", - "Pagination", - "Task", - "TaskMetadata", - "TaskMetadataCreator", - "TaskMetadataTriggeredBy", - "TaskMetadataTriggeredByManual", - "TaskMetadataTriggeredByPostDevcontainerStart", - "TaskMetadataTriggeredByPostEnvironmentStart", - "TaskSpec", - "TaskSpecRunsOn", - "TaskSpecRunsOnDocker", + "Metadata", + "MetadataCreator", + "MetadataTriggeredBy", + "MetadataTriggeredByManual", + "MetadataTriggeredByPostDevcontainerStart", + "MetadataTriggeredByPostEnvironmentStart", + "Spec", + "SpecRunsOn", + "SpecRunsOnDocker", ] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class TaskMetadataCreator(BaseModel): +class MetadataCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -49,26 +39,24 @@ class TaskMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskMetadataTriggeredByManual(BaseModel): +class MetadataTriggeredByManual(BaseModel): manual: bool -class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): +class MetadataTriggeredByPostDevcontainerStart(BaseModel): post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") -class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): +class MetadataTriggeredByPostEnvironmentStart(BaseModel): post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") -TaskMetadataTriggeredBy: TypeAlias = Union[ - TaskMetadataTriggeredByManual, - TaskMetadataTriggeredByPostDevcontainerStart, - TaskMetadataTriggeredByPostEnvironmentStart, +MetadataTriggeredBy: TypeAlias = Union[ + MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart ] -class TaskMetadata(BaseModel): +class Metadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local @@ -161,7 +149,7 @@ class TaskMetadata(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[TaskMetadataCreator] = None + creator: Optional[MetadataCreator] = None """creator describes the principal who created the task.""" description: Optional[str] = None @@ -184,29 +172,29 @@ class TaskMetadata(BaseModel): the task in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[MetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the task.""" -class TaskSpecRunsOnDocker(BaseModel): +class SpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskSpecRunsOn(BaseModel): - docker: TaskSpecRunsOnDocker +class SpecRunsOn(BaseModel): + docker: SpecRunsOnDocker -class TaskSpec(BaseModel): +class Spec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Optional[TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[SpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" -class Task(BaseModel): +class TaskListResponse(BaseModel): id: Optional[str] = None depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) @@ -214,12 +202,6 @@ class Task(BaseModel): environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - metadata: Optional[TaskMetadata] = None - - spec: Optional[TaskSpec] = None - - -class TaskListResponse(BaseModel): - pagination: Optional[Pagination] = None + metadata: Optional[Metadata] = None - tasks: Optional[List[Task]] = None + spec: Optional[Spec] = None diff --git a/src/gitpod/types/event_list_response.py b/src/gitpod/types/event_list_response.py index 58f31f1a..b49844ca 100644 --- a/src/gitpod/types/event_list_response.py +++ b/src/gitpod/types/event_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -8,10 +8,10 @@ from .._models import BaseModel -__all__ = ["EventListResponse", "Entry", "Pagination"] +__all__ = ["EventListResponse"] -class Entry(BaseModel): +class EventListResponse(BaseModel): id: Optional[str] = None action: Optional[str] = None @@ -145,18 +145,3 @@ class Entry(BaseModel): "RESOURCE_TYPE_SSO_CONFIG", ] ] = FieldInfo(alias="subjectType", default=None) - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class EventListResponse(BaseModel): - entries: Optional[List[Entry]] = None - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/group_list_response.py b/src/gitpod/types/group_list_response.py index 7a6ab457..3a44f28a 100644 --- a/src/gitpod/types/group_list_response.py +++ b/src/gitpod/types/group_list_response.py @@ -1,16 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["GroupListResponse", "Group", "Pagination"] +__all__ = ["GroupListResponse"] -class Group(BaseModel): +class GroupListResponse(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) @@ -203,17 +203,3 @@ class Group(BaseModel): [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. """ - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class GroupListResponse(BaseModel): - groups: Optional[List[Group]] = None - - pagination: Optional[Pagination] = None diff --git a/src/gitpod/types/organization_list_members_response.py b/src/gitpod/types/organization_list_members_response.py index 5fce990c..f95c22a0 100644 --- a/src/gitpod/types/organization_list_members_response.py +++ b/src/gitpod/types/organization_list_members_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -8,10 +8,10 @@ from .._models import BaseModel -__all__ = ["OrganizationListMembersResponse", "Member", "Pagination"] +__all__ = ["OrganizationListMembersResponse"] -class Member(BaseModel): +class OrganizationListMembersResponse(BaseModel): avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) email: Optional[str] = None @@ -122,19 +122,3 @@ class Member(BaseModel): ] = None user_id: Optional[str] = FieldInfo(alias="userId", default=None) - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class OrganizationListMembersResponse(BaseModel): - members: Optional[List[Member]] = None - """members are the members of the organization""" - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing members""" diff --git a/src/gitpod/types/organization_list_response.py b/src/gitpod/types/organization_list_response.py index 753f469a..1bb91db6 100644 --- a/src/gitpod/types/organization_list_response.py +++ b/src/gitpod/types/organization_list_response.py @@ -7,15 +7,15 @@ from .._models import BaseModel -__all__ = ["OrganizationListResponse", "Organization", "OrganizationInviteDomains", "Pagination"] +__all__ = ["OrganizationListResponse", "InviteDomains"] -class OrganizationInviteDomains(BaseModel): +class InviteDomains(BaseModel): domains: Optional[List[str]] = None """domains is the list of domains that are allowed to join the organization""" -class Organization(BaseModel): +class OrganizationListResponse(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) @@ -110,7 +110,7 @@ class Organization(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - invite_domains: Optional[OrganizationInviteDomains] = FieldInfo(alias="inviteDomains", default=None) + invite_domains: Optional[InviteDomains] = FieldInfo(alias="inviteDomains", default=None) name: Optional[str] = None @@ -205,19 +205,3 @@ class Organization(BaseModel): [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. """ - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class OrganizationListResponse(BaseModel): - organizations: Optional[List[Organization]] = None - """organizations are the organizations that matched the query""" - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing organizations""" diff --git a/src/gitpod/types/project_list_response.py b/src/gitpod/types/project_list_response.py index 4516741c..8f42ed79 100644 --- a/src/gitpod/types/project_list_response.py +++ b/src/gitpod/types/project_list_response.py @@ -10,35 +10,23 @@ __all__ = [ "ProjectListResponse", - "Pagination", - "Project", - "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", - "ProjectInitializer", - "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", - "ProjectMetadata", - "ProjectMetadataCreator", - "ProjectUsedBy", - "ProjectUsedBySubject", + "EnvironmentClass", + "EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", + "EnvironmentClassUseALocalRunnerForTheUser", + "Initializer", + "InitializerSpec", + "InitializerSpecContextURL", + "InitializerSpecContextURLContextURL", + "InitializerSpecGit", + "InitializerSpecGitGit", + "Metadata", + "MetadataCreator", + "UsedBy", + "UsedBySubject", ] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): +class EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass(BaseModel): environment_class_id: str = FieldInfo(alias="environmentClassId") """Use a fixed environment class on a given Runner. @@ -46,27 +34,27 @@ class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBe """ -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): +class EnvironmentClassUseALocalRunnerForTheUser(BaseModel): local_runner: bool = FieldInfo(alias="localRunner") """Use a local runner for the user""" -ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, +EnvironmentClass: TypeAlias = Union[ + EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, + EnvironmentClassUseALocalRunnerForTheUser, ] -class ProjectInitializerSpecContextURLContextURL(BaseModel): +class InitializerSpecContextURLContextURL(BaseModel): url: Optional[str] = None """url is the URL from which the environment is created""" -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") +class InitializerSpecContextURL(BaseModel): + context_url: InitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") -class ProjectInitializerSpecGitGit(BaseModel): +class InitializerSpecGitGit(BaseModel): checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) """ a path relative to the environment root in which the code will be checked out to @@ -93,18 +81,18 @@ class ProjectInitializerSpecGitGit(BaseModel): """upstream_Remote_uri is the fork upstream of a repository""" -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit +class InitializerSpecGit(BaseModel): + git: InitializerSpecGitGit -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] +InitializerSpec: TypeAlias = Union[InitializerSpecContextURL, InitializerSpecGit] -class ProjectInitializer(BaseModel): - specs: Optional[List[ProjectInitializerSpec]] = None +class Initializer(BaseModel): + specs: Optional[List[InitializerSpec]] = None -class ProjectMetadataCreator(BaseModel): +class MetadataCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -121,7 +109,7 @@ class ProjectMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class ProjectMetadata(BaseModel): +class Metadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local @@ -214,7 +202,7 @@ class ProjectMetadata(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[ProjectMetadataCreator] = None + creator: Optional[MetadataCreator] = None """creator is the identity of the project creator""" name: Optional[str] = None @@ -316,7 +304,7 @@ class ProjectMetadata(BaseModel): """ -class ProjectUsedBySubject(BaseModel): +class UsedBySubject(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -333,8 +321,8 @@ class ProjectUsedBySubject(BaseModel): """Principal is the principal of the subject""" -class ProjectUsedBy(BaseModel): - subjects: Optional[List[ProjectUsedBySubject]] = None +class UsedBy(BaseModel): + subjects: Optional[List[UsedBySubject]] = None """ Subjects are the 10 most recent subjects who have used the project to create an environment @@ -344,8 +332,8 @@ class ProjectUsedBy(BaseModel): """Total number of unique subjects who have used the project""" -class Project(BaseModel): - environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") +class ProjectListResponse(BaseModel): + environment_class: EnvironmentClass = FieldInfo(alias="environmentClass") id: Optional[str] = None """id is the unique identifier for the project""" @@ -362,16 +350,9 @@ class Project(BaseModel): root """ - initializer: Optional[ProjectInitializer] = None + initializer: Optional[Initializer] = None """EnvironmentInitializer specifies how an environment is to be initialized""" - metadata: Optional[ProjectMetadata] = None - - used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) - - -class ProjectListResponse(BaseModel): - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing organizations""" + metadata: Optional[Metadata] = None - projects: Optional[List[Project]] = None + used_by: Optional[UsedBy] = FieldInfo(alias="usedBy", default=None) diff --git a/src/gitpod/types/projects/policy_list_response.py b/src/gitpod/types/projects/policy_list_response.py index 5f642f6b..12ef5fd0 100644 --- a/src/gitpod/types/projects/policy_list_response.py +++ b/src/gitpod/types/projects/policy_list_response.py @@ -1,31 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel -__all__ = ["PolicyListResponse", "Pagination", "Policy"] +__all__ = ["PolicyListResponse"] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class Policy(BaseModel): +class PolicyListResponse(BaseModel): group_id: Optional[str] = FieldInfo(alias="groupId", default=None) role: Optional[Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"]] = None """role is the role assigned to the group""" - - -class PolicyListResponse(BaseModel): - pagination: Optional[Pagination] = None - - policies: Optional[List[Policy]] = None diff --git a/src/gitpod/types/runner_list_response.py b/src/gitpod/types/runner_list_response.py index 18c54019..a3029d6f 100644 --- a/src/gitpod/types/runner_list_response.py +++ b/src/gitpod/types/runner_list_response.py @@ -8,27 +8,10 @@ from .._models import BaseModel -__all__ = [ - "RunnerListResponse", - "Pagination", - "Runner", - "RunnerCreator", - "RunnerSpec", - "RunnerSpecConfiguration", - "RunnerStatus", - "RunnerStatusAdditionalInfo", -] - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ +__all__ = ["RunnerListResponse", "Creator", "Spec", "SpecConfiguration", "Status", "StatusAdditionalInfo"] -class RunnerCreator(BaseModel): +class Creator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -45,7 +28,7 @@ class RunnerCreator(BaseModel): """Principal is the principal of the subject""" -class RunnerSpecConfiguration(BaseModel): +class SpecConfiguration(BaseModel): auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) """auto_update indicates whether the runner should automatically update itself.""" @@ -62,8 +45,8 @@ class RunnerSpecConfiguration(BaseModel): """The release channel the runner is on""" -class RunnerSpec(BaseModel): - configuration: Optional[RunnerSpecConfiguration] = None +class Spec(BaseModel): + configuration: Optional[SpecConfiguration] = None """The runner's configuration""" desired_phase: Optional[ @@ -80,14 +63,14 @@ class RunnerSpec(BaseModel): """RunnerPhase represents the phase a runner is in""" -class RunnerStatusAdditionalInfo(BaseModel): +class StatusAdditionalInfo(BaseModel): key: Optional[str] = None value: Optional[str] = None -class RunnerStatus(BaseModel): - additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) +class Status(BaseModel): + additional_info: Optional[List[StatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) """additional_info contains additional information about the runner, e.g. a CloudFormation stack URL. @@ -219,7 +202,7 @@ class RunnerStatus(BaseModel): version: Optional[str] = None -class Runner(BaseModel): +class RunnerListResponse(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local @@ -312,7 +295,7 @@ class Runner(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[RunnerCreator] = None + creator: Optional[Creator] = None """creator is the identity of the creator of the environment""" kind: Optional[ @@ -339,10 +322,10 @@ class Runner(BaseModel): runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - spec: Optional[RunnerSpec] = None + spec: Optional[Spec] = None """The runner's specification""" - status: Optional[RunnerStatus] = None + status: Optional[Status] = None """RunnerStatus represents the status of a runner""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) @@ -436,11 +419,3 @@ class Runner(BaseModel): [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. """ - - -class RunnerListResponse(BaseModel): - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing runners""" - - runners: Optional[List[Runner]] = None - """The runners registered in the scope""" diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py index 7e7b78a5..03cdca9d 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -8,18 +8,10 @@ from ...._models import BaseModel -__all__ = ["HostAuthenticationTokenListResponse", "Pagination", "Token"] +__all__ = ["HostAuthenticationTokenListResponse"] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class Token(BaseModel): +class HostAuthenticationTokenListResponse(BaseModel): id: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) @@ -127,9 +119,3 @@ class Token(BaseModel): ] = None user_id: Optional[str] = FieldInfo(alias="userId", default=None) - - -class HostAuthenticationTokenListResponse(BaseModel): - pagination: Optional[Pagination] = None - - tokens: Optional[List[Token]] = None diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_response.py b/src/gitpod/types/runners/configurations/scm_integration_list_response.py index e7e6b3e4..50b11109 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_list_response.py +++ b/src/gitpod/types/runners/configurations/scm_integration_list_response.py @@ -1,15 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["ScmIntegrationListResponse", "Integration", "IntegrationOAuth", "Pagination"] +__all__ = ["ScmIntegrationListResponse", "OAuth"] -class IntegrationOAuth(BaseModel): +class OAuth(BaseModel): client_id: Optional[str] = FieldInfo(alias="clientId", default=None) """client_id is the OAuth app's client ID in clear text.""" @@ -20,8 +20,8 @@ class IntegrationOAuth(BaseModel): """ -class Integration(BaseModel): - oauth: IntegrationOAuth +class ScmIntegrationListResponse(BaseModel): + oauth: OAuth id: Optional[str] = None """id is the unique identifier of the SCM integration""" @@ -37,18 +37,3 @@ class Integration(BaseModel): scm_id references the scm_id in the runner's configuration schema that this integration is for """ - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class ScmIntegrationListResponse(BaseModel): - integrations: Optional[List[Integration]] = None - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing scm integrations""" diff --git a/src/gitpod/types/runners/policy_list_response.py b/src/gitpod/types/runners/policy_list_response.py index 730960cb..e69b114a 100644 --- a/src/gitpod/types/runners/policy_list_response.py +++ b/src/gitpod/types/runners/policy_list_response.py @@ -1,31 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel -__all__ = ["PolicyListResponse", "Pagination", "Policy"] +__all__ = ["PolicyListResponse"] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class Policy(BaseModel): +class PolicyListResponse(BaseModel): group_id: Optional[str] = FieldInfo(alias="groupId", default=None) role: Optional[Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"]] = None """role is the role assigned to the group""" - - -class PolicyListResponse(BaseModel): - pagination: Optional[Pagination] = None - - policies: Optional[List[Policy]] = None diff --git a/src/gitpod/types/secret_list_response.py b/src/gitpod/types/secret_list_response.py index 6fd44ba5..ab945270 100644 --- a/src/gitpod/types/secret_list_response.py +++ b/src/gitpod/types/secret_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import Union, Optional from datetime import datetime from typing_extensions import Literal, TypeAlias @@ -10,24 +10,14 @@ __all__ = [ "SecretListResponse", - "Pagination", - "Secret", - "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", - "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator", - "SecretAbsolutePathToTheFileWhereTheSecretIsMounted", - "SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator", + "SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", + "SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator", + "AbsolutePathToTheFileWhereTheSecretIsMounted", + "AbsolutePathToTheFileWhereTheSecretIsMountedCreator", ] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator(BaseModel): +class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -44,7 +34,7 @@ class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret """Principal is the principal of the subject""" -class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): +class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): environment_variable: bool = FieldInfo(alias="environmentVariable") """ secret will be created as an Environment Variable with the same name as the @@ -145,7 +135,7 @@ class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator] = None + creator: Optional[SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator] = None """creator is the identity of the creator of the secret""" name: Optional[str] = None @@ -247,7 +237,7 @@ class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret """ -class SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator(BaseModel): +class AbsolutePathToTheFileWhereTheSecretIsMountedCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -264,7 +254,7 @@ class SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator(BaseModel): """Principal is the principal of the subject""" -class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): +class AbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): file_path: str = FieldInfo(alias="filePath") """absolute path to the file where the secret is mounted""" @@ -362,7 +352,7 @@ class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[SecretAbsolutePathToTheFileWhereTheSecretIsMountedCreator] = None + creator: Optional[AbsolutePathToTheFileWhereTheSecretIsMountedCreator] = None """creator is the identity of the creator of the secret""" name: Optional[str] = None @@ -464,14 +454,6 @@ class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): """ -Secret: TypeAlias = Union[ - SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, - SecretAbsolutePathToTheFileWhereTheSecretIsMounted, +SecretListResponse: TypeAlias = Union[ + SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, AbsolutePathToTheFileWhereTheSecretIsMounted ] - - -class SecretListResponse(BaseModel): - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing secrets""" - - secrets: Optional[List[Secret]] = None diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index cae56ad7..e86f5b20 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -9,7 +9,6 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.environments.automations.tasks import ( ExecutionListResponse, ExecutionRetrieveResponse, @@ -56,7 +55,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list() - assert_matches_type(SyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -74,7 +73,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -83,7 +82,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -92,7 +91,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) assert cast(Any, response.is_closed) is True @@ -169,7 +168,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list() - assert_matches_type(AsyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -187,7 +186,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -196,7 +195,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -205,7 +204,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(ExecutionListResponse, execution, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index e88629c4..40f9a7bd 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod._utils import parse_datetime -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncServicesPage, AsyncServicesPage from gitpod.types.environments.automations import ( ServiceListResponse, ServiceCreateResponse, @@ -152,7 +152,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: service = client.environments.automations.services.list() - assert_matches_type(SyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -169,7 +169,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -178,7 +178,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -187,7 +187,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) assert cast(Any, response.is_closed) is True @@ -421,7 +421,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list() - assert_matches_type(AsyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -438,7 +438,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -447,7 +447,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -456,7 +456,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 13a3270a..3138f430 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod._utils import parse_datetime -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncTasksPage, AsyncTasksPage from gitpod.types.environments.automations import ( TaskListResponse, TaskStartResponse, @@ -147,7 +147,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list() - assert_matches_type(SyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) + assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -164,7 +164,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) + assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -173,7 +173,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) + assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -182,7 +182,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) + assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) assert cast(Any, response.is_closed) is True @@ -377,7 +377,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list() - assert_matches_type(AsyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) + assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -394,7 +394,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) + assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -403,7 +403,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) + assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -412,7 +412,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[TaskListResponse], task, path=["response"]) + assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index 490d4f8c..0cb6b9d1 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -9,7 +9,6 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.environments import ClassListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,7 +20,7 @@ class TestClasses: @parametrize def test_method_list(self, client: Gitpod) -> None: class_ = client.environments.classes.list() - assert_matches_type(SyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -34,7 +33,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -43,7 +42,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -52,7 +51,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -63,7 +62,7 @@ class TestAsyncClasses: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list() - assert_matches_type(AsyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -76,7 +75,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -85,7 +84,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -94,6 +93,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(ClassListResponse, class_, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 66627b91..d25686d0 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -9,7 +9,6 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.organizations import ( SSOConfigurationListResponse, SSOConfigurationCreateResponse, @@ -248,9 +247,7 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list() - assert_matches_type( - SyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -263,9 +260,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type( - SyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -274,9 +269,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = response.parse() - assert_matches_type( - SyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -285,9 +278,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = response.parse() - assert_matches_type( - SyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) assert cast(Any, response.is_closed) is True @@ -553,9 +544,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list() - assert_matches_type( - AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -568,9 +557,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type( - AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -579,9 +566,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -590,9 +575,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index 88f5b1f7..84f3f9a4 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -9,7 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncPoliciesPage, AsyncPoliciesPage from gitpod.types.projects import ( PolicyListResponse, PolicyCreateResponse, @@ -93,7 +93,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.projects.policies.list() - assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -106,7 +106,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -115,7 +115,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -124,7 +124,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -236,7 +236,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list() - assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -249,7 +249,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -258,7 +258,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -267,7 +267,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 5e1d3dfa..437a54d5 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -9,7 +9,6 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.runners.configurations import ( EnvironmentClassListResponse, EnvironmentClassCreateResponse, @@ -190,9 +189,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list() - assert_matches_type( - SyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -205,9 +202,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type( - SyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -216,9 +211,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = response.parse() - assert_matches_type( - SyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -227,9 +220,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = response.parse() - assert_matches_type( - SyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) assert cast(Any, response.is_closed) is True @@ -407,9 +398,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list() - assert_matches_type( - AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -422,9 +411,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type( - AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -433,9 +420,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -444,8 +429,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index a827e1a9..6e1752bf 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod._utils import parse_datetime -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncTokensPage, AsyncTokensPage from gitpod.types.runners.configurations import ( HostAuthenticationTokenListResponse, HostAuthenticationTokenCreateResponse, @@ -190,9 +190,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: def test_method_list(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list() assert_matches_type( - SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], - host_authentication_token, - path=["response"], + SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) @parametrize @@ -207,9 +205,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, ) assert_matches_type( - SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], - host_authentication_token, - path=["response"], + SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) @parametrize @@ -220,9 +216,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = response.parse() assert_matches_type( - SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], - host_authentication_token, - path=["response"], + SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) @parametrize @@ -233,9 +227,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type( - SyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], - host_authentication_token, - path=["response"], + SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -447,9 +439,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit async def test_method_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list() assert_matches_type( - AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], - host_authentication_token, - path=["response"], + AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) @parametrize @@ -464,9 +454,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, ) assert_matches_type( - AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], - host_authentication_token, - path=["response"], + AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) @parametrize @@ -477,9 +465,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = await response.parse() assert_matches_type( - AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], - host_authentication_token, - path=["response"], + AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) @parametrize @@ -492,9 +478,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type( - AsyncPersonalAccessTokensPage[HostAuthenticationTokenListResponse], - host_authentication_token, - path=["response"], + AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index a733f139..4f404eaa 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -9,7 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncIntegrationsPage, AsyncIntegrationsPage from gitpod.types.runners.configurations import ( ScmIntegrationListResponse, ScmIntegrationCreateResponse, @@ -212,9 +212,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list() - assert_matches_type( - SyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] - ) + assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -227,9 +225,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type( - SyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] - ) + assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -238,9 +234,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = response.parse() - assert_matches_type( - SyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] - ) + assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -249,9 +243,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = response.parse() - assert_matches_type( - SyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] - ) + assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) assert cast(Any, response.is_closed) is True @@ -481,9 +473,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list() - assert_matches_type( - AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] - ) + assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -496,9 +486,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type( - AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] - ) + assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -507,9 +495,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] - ) + assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -518,9 +504,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[ScmIntegrationListResponse], scm_integration, path=["response"] - ) + assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index 2d35e44a..11a2f953 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -9,7 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncPoliciesPage, AsyncPoliciesPage from gitpod.types.runners import ( PolicyListResponse, PolicyCreateResponse, @@ -93,7 +93,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.runners.policies.list() - assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -106,7 +106,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -115,7 +115,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -124,7 +124,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -236,7 +236,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list() - assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -249,7 +249,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -258,7 +258,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -267,7 +267,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index cccf5660..f68516db 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -14,7 +14,6 @@ AccountGetSSOLoginURLResponse, AccountListLoginProvidersResponse, ) -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -127,7 +126,7 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: account = client.accounts.list_login_providers() - assert_matches_type(SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) @parametrize def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> None: @@ -140,7 +139,7 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) @parametrize def test_raw_response_list_login_providers(self, client: Gitpod) -> None: @@ -149,7 +148,7 @@ def test_raw_response_list_login_providers(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) @parametrize def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: @@ -158,9 +157,7 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type( - SyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] - ) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) assert cast(Any, response.is_closed) is True @@ -273,9 +270,7 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers() - assert_matches_type( - AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] - ) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) @parametrize async def test_method_list_login_providers_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -288,9 +283,7 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A "page_size": 100, }, ) - assert_matches_type( - AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] - ) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) @parametrize async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod) -> None: @@ -299,9 +292,7 @@ async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] - ) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) @parametrize async def test_streaming_response_list_login_providers(self, async_client: AsyncGitpod) -> None: @@ -310,8 +301,6 @@ async def test_streaming_response_list_login_providers(self, async_client: Async assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[AccountListLoginProvidersResponse], account, path=["response"] - ) + assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 1b71aa29..10f3a757 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -14,7 +14,7 @@ EditorRetrieveResponse, EditorResolveURLResponse, ) -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncEditorsPage, AsyncEditorsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -57,7 +57,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: editor = client.editors.list() - assert_matches_type(SyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -69,7 +69,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -78,7 +78,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -87,7 +87,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -164,7 +164,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list() - assert_matches_type(AsyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -176,7 +176,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -185,7 +185,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -194,7 +194,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 13b033fd..60087985 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -17,7 +17,7 @@ EnvironmentCreateFromProjectResponse, ) from gitpod._utils import parse_datetime -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncEnvironmentsPage, AsyncEnvironmentsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -199,7 +199,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: environment = client.environments.list() - assert_matches_type(SyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -219,7 +219,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -228,7 +228,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -237,7 +237,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) assert cast(Any, response.is_closed) is True @@ -662,7 +662,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list() - assert_matches_type(AsyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -682,7 +682,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -691,7 +691,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -700,7 +700,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index ad43b458..975597b5 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import EventListResponse, EventWatchResponse -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncEntriesPage, AsyncEntriesPage from gitpod._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ class TestEvents: @parametrize def test_method_list(self, client: Gitpod) -> None: event = client.events.list() - assert_matches_type(SyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) + assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -40,7 +40,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) + assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -49,7 +49,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) + assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -58,7 +58,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) + assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -137,7 +137,7 @@ class TestAsyncEvents: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list() - assert_matches_type(AsyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) + assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -155,7 +155,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) + assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -164,7 +164,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) + assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -173,7 +173,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[EventListResponse], event, path=["response"]) + assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index 449a34fe..bf2e4b16 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import GroupListResponse -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncGroupsPage, AsyncGroupsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,7 +21,7 @@ class TestGroups: @parametrize def test_method_list(self, client: Gitpod) -> None: group = client.groups.list() - assert_matches_type(SyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) + assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -33,7 +33,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) + assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -42,7 +42,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) + assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -51,7 +51,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) + assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -62,7 +62,7 @@ class TestAsyncGroups: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list() - assert_matches_type(AsyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) + assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -74,7 +74,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) + assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -83,7 +83,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) + assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -92,6 +92,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[GroupListResponse], group, path=["response"]) + assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index cbb26052..3a017473 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -17,7 +17,7 @@ OrganizationRetrieveResponse, OrganizationListMembersResponse, ) -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncMembersPage, AsyncMembersPage, SyncOrganizationsPage, AsyncOrganizationsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -163,7 +163,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: organization = client.organizations.list() - assert_matches_type(SyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -176,7 +176,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, scope="SCOPE_UNSPECIFIED", ) - assert_matches_type(SyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -185,7 +185,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -194,7 +194,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -327,9 +327,7 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: @parametrize def test_method_list_members(self, client: Gitpod) -> None: organization = client.organizations.list_members() - assert_matches_type( - SyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] - ) + assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: @@ -342,9 +340,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type( - SyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] - ) + assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: @@ -353,9 +349,7 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type( - SyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] - ) + assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: @@ -364,9 +358,7 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type( - SyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] - ) + assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -546,7 +538,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list() - assert_matches_type(AsyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -559,7 +551,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, scope="SCOPE_UNSPECIFIED", ) - assert_matches_type(AsyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -568,7 +560,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -577,9 +569,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[OrganizationListResponse], organization, path=["response"] - ) + assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -712,9 +702,7 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members() - assert_matches_type( - AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] - ) + assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -727,9 +715,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp "page_size": 100, }, ) - assert_matches_type( - AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] - ) + assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: @@ -738,9 +724,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] - ) + assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: @@ -749,9 +733,7 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type( - AsyncPersonalAccessTokensPage[OrganizationListMembersResponse], organization, path=["response"] - ) + assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 869f880e..ea12d993 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -16,7 +16,7 @@ ProjectRetrieveResponse, ProjectCreateFromEnvironmentResponse, ) -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncProjectsPage, AsyncProjectsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -266,7 +266,7 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: project = client.projects.list() - assert_matches_type(SyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -278,7 +278,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -287,7 +287,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -296,7 +296,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) assert cast(Any, response.is_closed) is True @@ -611,7 +611,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list() - assert_matches_type(AsyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -623,7 +623,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -632,7 +632,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -641,7 +641,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index b752f186..cf3bc974 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -17,7 +17,7 @@ RunnerCreateRunnerTokenResponse, RunnerCheckAuthenticationForHostResponse, ) -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncRunnersPage, AsyncRunnersPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -164,7 +164,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: runner = client.runners.list() - assert_matches_type(SyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -181,7 +181,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -190,7 +190,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -199,7 +199,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) assert cast(Any, response.is_closed) is True @@ -477,7 +477,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list() - assert_matches_type(AsyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -494,7 +494,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -503,7 +503,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -512,7 +512,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 8d14e621..2ffe8167 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -14,7 +14,7 @@ SecretCreateResponse, SecretGetValueResponse, ) -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage +from gitpod.pagination import SyncSecretsPage, AsyncSecretsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -107,7 +107,7 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: secret = client.secrets.list() - assert_matches_type(SyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -120,7 +120,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -129,7 +129,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -138,7 +138,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) assert cast(Any, response.is_closed) is True @@ -328,7 +328,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list() - assert_matches_type(AsyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -341,7 +341,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -350,7 +350,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -359,7 +359,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index c0fa515b..600b29f6 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -9,7 +9,6 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.users import PatGetResponse, PatListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,7 +20,7 @@ class TestPats: @parametrize def test_method_list(self, client: Gitpod) -> None: pat = client.users.pats.list() - assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(PatListResponse, pat, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -34,7 +33,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(PatListResponse, pat, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -43,7 +42,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(PatListResponse, pat, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -52,7 +51,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(PatListResponse, pat, path=["response"]) assert cast(Any, response.is_closed) is True @@ -127,7 +126,7 @@ class TestAsyncPats: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list() - assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(PatListResponse, pat, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -140,7 +139,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(PatListResponse, pat, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -149,7 +148,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(PatListResponse, pat, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -158,7 +157,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(PatListResponse, pat, path=["response"]) assert cast(Any, response.is_closed) is True From b3a2ea8d3196dcaf5859af28e01b95636ee3eaf4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:46:48 +0000 Subject: [PATCH 073/505] feat(api): dedupe paginations --- src/gitpod/pagination.py | 92 ---------------------------------------- 1 file changed, 92 deletions(-) diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 9bf11c1e..14f58567 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -221,52 +221,6 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] - pagination: Optional[EnvironmentClassesPagePagination] = None - - @override - def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes - if not environment_classes: - return [] - return environment_classes - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = None - if self.pagination is not None: - if self.pagination.next_token is not None: - next_token = self.pagination.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] - pagination: Optional[EnvironmentClassesPagePagination] = None - - @override - def _get_page_items(self) -> List[_T]: - environment_classes = self.environment_classes - if not environment_classes: - return [] - return environment_classes - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = None - if self.pagination is not None: - if self.pagination.next_token is not None: - next_token = self.pagination.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - class EnvironmentsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -667,52 +621,6 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SyncPoliciesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PoliciesPagePagination] = None - policies: List[_T] - - @override - def _get_page_items(self) -> List[_T]: - policies = self.policies - if not policies: - return [] - return policies - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = None - if self.pagination is not None: - if self.pagination.next_token is not None: - next_token = self.pagination.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncPoliciesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[PoliciesPagePagination] = None - policies: List[_T] - - @override - def _get_page_items(self) -> List[_T]: - policies = self.policies - if not policies: - return [] - return policies - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = None - if self.pagination is not None: - if self.pagination.next_token is not None: - next_token = self.pagination.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - class ProjectsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) From 576cd1e83c112280159305c465342415e0c2d218 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:54:00 +0000 Subject: [PATCH 074/505] feat(api): fix pagination field names --- api.md | 12 +-- src/gitpod/pagination.py | 20 ++-- src/gitpod/resources/accounts.py | 25 +++-- .../automations/tasks/executions.py | 25 +++-- src/gitpod/resources/environments/classes.py | 30 +++--- .../organizations/sso_configurations.py | 25 +++-- .../configurations/environment_classes.py | 25 +++-- src/gitpod/resources/users/pats.py | 25 +++-- .../account_list_login_providers_response.py | 20 +--- .../tasks/execution_list_response.py | 94 ++++++++----------- .../types/environments/class_list_response.py | 23 +---- .../sso_configuration_list_response.py | 21 +---- .../environment_class_list_response.py | 23 +---- src/gitpod/types/users/pat_list_response.py | 24 +---- .../automations/tasks/test_executions.py | 17 ++-- .../environments/test_classes.py | 17 ++-- .../organizations/test_sso_configurations.py | 33 +++++-- .../test_environment_classes.py | 33 +++++-- tests/api_resources/test_accounts.py | 17 ++-- tests/api_resources/users/test_pats.py | 17 ++-- 20 files changed, 250 insertions(+), 276 deletions(-) diff --git a/api.md b/api.md index 4732300c..b6305519 100644 --- a/api.md +++ b/api.md @@ -16,7 +16,7 @@ Methods: - client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse - client.accounts.delete(\*\*params) -> object - client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse -- client.accounts.list_login_providers(\*\*params) -> AccountListLoginProvidersResponse +- client.accounts.list_login_providers(\*\*params) -> SyncLoginProvidersPage[AccountListLoginProvidersResponse] # Editors @@ -141,7 +141,7 @@ from gitpod.types.environments.automations.tasks import ( Methods: - client.environments.automations.tasks.executions.retrieve(\*\*params) -> ExecutionRetrieveResponse -- client.environments.automations.tasks.executions.list(\*\*params) -> ExecutionListResponse +- client.environments.automations.tasks.executions.list(\*\*params) -> SyncTaskExecutionsPage[ExecutionListResponse] - client.environments.automations.tasks.executions.stop(\*\*params) -> object ## Classes @@ -154,7 +154,7 @@ from gitpod.types.environments import ClassListResponse Methods: -- client.environments.classes.list(\*\*params) -> ClassListResponse +- client.environments.classes.list(\*\*params) -> SyncEnvironmentClassesPage[ClassListResponse] # Events @@ -266,7 +266,7 @@ Methods: - client.organizations.sso_configurations.create(\*\*params) -> SSOConfigurationCreateResponse - client.organizations.sso_configurations.retrieve(\*\*params) -> SSOConfigurationRetrieveResponse - client.organizations.sso_configurations.update(\*\*params) -> object -- client.organizations.sso_configurations.list(\*\*params) -> SSOConfigurationListResponse +- client.organizations.sso_configurations.list(\*\*params) -> SyncSSOConfigurationsPage[SSOConfigurationListResponse] - client.organizations.sso_configurations.delete(\*\*params) -> object # Projects @@ -371,7 +371,7 @@ Methods: - client.runners.configurations.environment_classes.create(\*\*params) -> EnvironmentClassCreateResponse - client.runners.configurations.environment_classes.retrieve(\*\*params) -> EnvironmentClassRetrieveResponse - client.runners.configurations.environment_classes.update(\*\*params) -> object -- client.runners.configurations.environment_classes.list(\*\*params) -> EnvironmentClassListResponse +- client.runners.configurations.environment_classes.list(\*\*params) -> SyncEnvironmentClassesPage[EnvironmentClassListResponse] ### HostAuthenticationTokens @@ -494,6 +494,6 @@ from gitpod.types.users import PatListResponse, PatDeleteResponse, PatGetRespons Methods: -- client.users.pats.list(\*\*params) -> PatListResponse +- client.users.pats.list(\*\*params) -> SyncPersonalAccessTokensPage[PatListResponse] - client.users.pats.delete(\*\*params) -> object - client.users.pats.get(\*\*params) -> PatGetResponse diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 14f58567..393e2f83 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -176,7 +176,7 @@ class EnvironmentClassesPagePagination(BaseModel): class SyncEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") pagination: Optional[EnvironmentClassesPagePagination] = None @override @@ -199,7 +199,7 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - environment_classes: List[_T] + environment_classes: List[_T] = FieldInfo(alias="environmentClasses") pagination: Optional[EnvironmentClassesPagePagination] = None @override @@ -376,7 +376,7 @@ class LoginProvidersPagePagination(BaseModel): class SyncLoginProvidersPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - login_providers: List[_T] + login_providers: List[_T] = FieldInfo(alias="loginProviders") pagination: Optional[LoginProvidersPagePagination] = None @override @@ -399,7 +399,7 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncLoginProvidersPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - login_providers: List[_T] + login_providers: List[_T] = FieldInfo(alias="loginProviders") pagination: Optional[LoginProvidersPagePagination] = None @override @@ -527,7 +527,7 @@ class PersonalAccessTokensPagePagination(BaseModel): class SyncPersonalAccessTokensPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): pagination: Optional[PersonalAccessTokensPagePagination] = None - personal_access_tokens: List[_T] + personal_access_tokens: List[_T] = FieldInfo(alias="personalAccessTokens") @override def _get_page_items(self) -> List[_T]: @@ -550,7 +550,7 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncPersonalAccessTokensPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): pagination: Optional[PersonalAccessTokensPagePagination] = None - personal_access_tokens: List[_T] + personal_access_tokens: List[_T] = FieldInfo(alias="personalAccessTokens") @override def _get_page_items(self) -> List[_T]: @@ -827,7 +827,7 @@ class SSOConfigurationsPagePagination(BaseModel): class SyncSSOConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): pagination: Optional[SSOConfigurationsPagePagination] = None - sso_configurations: List[_T] + sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") @override def _get_page_items(self) -> List[_T]: @@ -850,7 +850,7 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncSSOConfigurationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): pagination: Optional[SSOConfigurationsPagePagination] = None - sso_configurations: List[_T] + sso_configurations: List[_T] = FieldInfo(alias="ssoConfigurations") @override def _get_page_items(self) -> List[_T]: @@ -877,7 +877,7 @@ class TaskExecutionsPagePagination(BaseModel): class SyncTaskExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): pagination: Optional[TaskExecutionsPagePagination] = None - task_executions: List[_T] + task_executions: List[_T] = FieldInfo(alias="taskExecutions") @override def _get_page_items(self) -> List[_T]: @@ -900,7 +900,7 @@ def next_page_info(self) -> Optional[PageInfo]: class AsyncTaskExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): pagination: Optional[TaskExecutionsPagePagination] = None - task_executions: List[_T] + task_executions: List[_T] = FieldInfo(alias="taskExecutions") @override def _get_page_items(self) -> List[_T]: diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index b8493950..4fde3b35 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -23,7 +23,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options +from ..pagination import SyncLoginProvidersPage, AsyncLoginProvidersPage +from .._base_client import AsyncPaginator, make_request_options from ..types.account_retrieve_response import AccountRetrieveResponse from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse from ..types.account_list_login_providers_response import AccountListLoginProvidersResponse @@ -173,7 +174,7 @@ def list_login_providers( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AccountListLoginProvidersResponse: + ) -> SyncLoginProvidersPage[AccountListLoginProvidersResponse]: """ ListLoginProviders returns the list of login providers matching the provided filters. @@ -191,8 +192,9 @@ def list_login_providers( timeout: Override the client-level default timeout for this request, in seconds """ - return self._post( + return self._get_api_list( "/gitpod.v1.AccountService/ListLoginProviders", + page=SyncLoginProvidersPage[AccountListLoginProvidersResponse], body=maybe_transform( { "filter": filter, @@ -213,7 +215,8 @@ def list_login_providers( account_list_login_providers_params.AccountListLoginProvidersParams, ), ), - cast_to=AccountListLoginProvidersResponse, + model=AccountListLoginProvidersResponse, + method="post", ) @@ -346,7 +349,7 @@ async def get_sso_login_url( cast_to=AccountGetSSOLoginURLResponse, ) - async def list_login_providers( + def list_login_providers( self, *, token: str | NotGiven = NOT_GIVEN, @@ -359,7 +362,7 @@ async def list_login_providers( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AccountListLoginProvidersResponse: + ) -> AsyncPaginator[AccountListLoginProvidersResponse, AsyncLoginProvidersPage[AccountListLoginProvidersResponse]]: """ ListLoginProviders returns the list of login providers matching the provided filters. @@ -377,9 +380,10 @@ async def list_login_providers( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._post( + return self._get_api_list( "/gitpod.v1.AccountService/ListLoginProviders", - body=await async_maybe_transform( + page=AsyncLoginProvidersPage[AccountListLoginProvidersResponse], + body=maybe_transform( { "filter": filter, "pagination": pagination, @@ -391,7 +395,7 @@ async def list_login_providers( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "token": token, "page_size": page_size, @@ -399,7 +403,8 @@ async def list_login_providers( account_list_login_providers_params.AccountListLoginProvidersParams, ), ), - cast_to=AccountListLoginProvidersResponse, + model=AccountListLoginProvidersResponse, + method="post", ) diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index 4b0defae..796bc06a 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -17,7 +17,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....._base_client import make_request_options +from .....pagination import SyncTaskExecutionsPage, AsyncTaskExecutionsPage +from ....._base_client import AsyncPaginator, make_request_options from .....types.environments.automations.tasks import ( execution_list_params, execution_stop_params, @@ -94,7 +95,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ExecutionListResponse: + ) -> SyncTaskExecutionsPage[ExecutionListResponse]: """ ListTaskExecutions @@ -111,8 +112,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._post( + return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", + page=SyncTaskExecutionsPage[ExecutionListResponse], body=maybe_transform( { "filter": filter, @@ -133,7 +135,8 @@ def list( execution_list_params.ExecutionListParams, ), ), - cast_to=ExecutionListResponse, + model=ExecutionListResponse, + method="post", ) def stop( @@ -221,7 +224,7 @@ async def retrieve( cast_to=ExecutionRetrieveResponse, ) - async def list( + def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -234,7 +237,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ExecutionListResponse: + ) -> AsyncPaginator[ExecutionListResponse, AsyncTaskExecutionsPage[ExecutionListResponse]]: """ ListTaskExecutions @@ -251,9 +254,10 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._post( + return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", - body=await async_maybe_transform( + page=AsyncTaskExecutionsPage[ExecutionListResponse], + body=maybe_transform( { "filter": filter, "pagination": pagination, @@ -265,7 +269,7 @@ async def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "token": token, "page_size": page_size, @@ -273,7 +277,8 @@ async def list( execution_list_params.ExecutionListParams, ), ), - cast_to=ExecutionListResponse, + model=ExecutionListResponse, + method="post", ) async def stop( diff --git a/src/gitpod/resources/environments/classes.py b/src/gitpod/resources/environments/classes.py index 99c3428c..7b9cebdf 100644 --- a/src/gitpod/resources/environments/classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -17,7 +14,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncEnvironmentClassesPage, AsyncEnvironmentClassesPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.environments import class_list_params from ...types.environments.class_list_response import ClassListResponse @@ -57,7 +55,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClassListResponse: + ) -> SyncEnvironmentClassesPage[ClassListResponse]: """ ListEnvironmentClasses returns the list of environment classes with runner details a user is able to use based on the query buf:lint:ignore @@ -74,8 +72,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._post( + return self._get_api_list( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", + page=SyncEnvironmentClassesPage[ClassListResponse], body=maybe_transform( { "filter": filter, @@ -96,7 +95,8 @@ def list( class_list_params.ClassListParams, ), ), - cast_to=ClassListResponse, + model=ClassListResponse, + method="post", ) @@ -120,7 +120,7 @@ def with_streaming_response(self) -> AsyncClassesResourceWithStreamingResponse: """ return AsyncClassesResourceWithStreamingResponse(self) - async def list( + def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -133,7 +133,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClassListResponse: + ) -> AsyncPaginator[ClassListResponse, AsyncEnvironmentClassesPage[ClassListResponse]]: """ ListEnvironmentClasses returns the list of environment classes with runner details a user is able to use based on the query buf:lint:ignore @@ -150,9 +150,10 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._post( + return self._get_api_list( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", - body=await async_maybe_transform( + page=AsyncEnvironmentClassesPage[ClassListResponse], + body=maybe_transform( { "filter": filter, "pagination": pagination, @@ -164,7 +165,7 @@ async def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "token": token, "page_size": page_size, @@ -172,7 +173,8 @@ async def list( class_list_params.ClassListParams, ), ), - cast_to=ClassListResponse, + model=ClassListResponse, + method="post", ) diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 54b6e3c5..aadadb22 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -20,7 +20,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncSSOConfigurationsPage, AsyncSSOConfigurationsPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.organizations import ( sso_configuration_list_params, sso_configuration_create_params, @@ -335,7 +336,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SSOConfigurationListResponse: + ) -> SyncSSOConfigurationsPage[SSOConfigurationListResponse]: """ ListSSOConfigurations lists all SSO configurations matching provided filters. @@ -350,8 +351,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._post( + return self._get_api_list( "/gitpod.v1.OrganizationService/ListSSOConfigurations", + page=SyncSSOConfigurationsPage[SSOConfigurationListResponse], body=maybe_transform( { "organization_id": organization_id, @@ -372,7 +374,8 @@ def list( sso_configuration_list_params.SSOConfigurationListParams, ), ), - cast_to=SSOConfigurationListResponse, + model=SSOConfigurationListResponse, + method="post", ) def delete( @@ -698,7 +701,7 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -711,7 +714,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SSOConfigurationListResponse: + ) -> AsyncPaginator[SSOConfigurationListResponse, AsyncSSOConfigurationsPage[SSOConfigurationListResponse]]: """ ListSSOConfigurations lists all SSO configurations matching provided filters. @@ -726,9 +729,10 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._post( + return self._get_api_list( "/gitpod.v1.OrganizationService/ListSSOConfigurations", - body=await async_maybe_transform( + page=AsyncSSOConfigurationsPage[SSOConfigurationListResponse], + body=maybe_transform( { "organization_id": organization_id, "pagination": pagination, @@ -740,7 +744,7 @@ async def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "token": token, "page_size": page_size, @@ -748,7 +752,8 @@ async def list( sso_configuration_list_params.SSOConfigurationListParams, ), ), - cast_to=SSOConfigurationListResponse, + model=SSOConfigurationListResponse, + method="post", ) async def delete( diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index 915532fb..eacd5403 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -21,7 +21,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._base_client import make_request_options +from ....pagination import SyncEnvironmentClassesPage, AsyncEnvironmentClassesPage +from ...._base_client import AsyncPaginator, make_request_options from ....types.runners.configurations import ( environment_class_list_params, environment_class_create_params, @@ -254,7 +255,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentClassListResponse: + ) -> SyncEnvironmentClassesPage[EnvironmentClassListResponse]: """ ListEnvironmentClasses returns all environment classes configured for a runner. buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE @@ -270,8 +271,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._post( + return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", + page=SyncEnvironmentClassesPage[EnvironmentClassListResponse], body=maybe_transform( { "filter": filter, @@ -292,7 +294,8 @@ def list( environment_class_list_params.EnvironmentClassListParams, ), ), - cast_to=EnvironmentClassListResponse, + model=EnvironmentClassListResponse, + method="post", ) @@ -502,7 +505,7 @@ async def update( cast_to=object, ) - async def list( + def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -515,7 +518,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EnvironmentClassListResponse: + ) -> AsyncPaginator[EnvironmentClassListResponse, AsyncEnvironmentClassesPage[EnvironmentClassListResponse]]: """ ListEnvironmentClasses returns all environment classes configured for a runner. buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE @@ -531,9 +534,10 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._post( + return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", - body=await async_maybe_transform( + page=AsyncEnvironmentClassesPage[EnvironmentClassListResponse], + body=maybe_transform( { "filter": filter, "pagination": pagination, @@ -545,7 +549,7 @@ async def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "token": token, "page_size": page_size, @@ -553,7 +557,8 @@ async def list( environment_class_list_params.EnvironmentClassListParams, ), ), - cast_to=EnvironmentClassListResponse, + model=EnvironmentClassListResponse, + method="post", ) diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 53e07a76..17474a15 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -17,8 +17,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from ...pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from ...types.users import pat_get_params, pat_list_params, pat_delete_params -from ..._base_client import make_request_options +from ..._base_client import AsyncPaginator, make_request_options from ...types.users.pat_get_response import PatGetResponse from ...types.users.pat_list_response import PatListResponse @@ -58,7 +59,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PatListResponse: + ) -> SyncPersonalAccessTokensPage[PatListResponse]: """ ListPersonalAccessTokens @@ -71,8 +72,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._post( + return self._get_api_list( "/gitpod.v1.UserService/ListPersonalAccessTokens", + page=SyncPersonalAccessTokensPage[PatListResponse], body=maybe_transform( { "filter": filter, @@ -93,7 +95,8 @@ def list( pat_list_params.PatListParams, ), ), - cast_to=PatListResponse, + model=PatListResponse, + method="post", ) def delete( @@ -183,7 +186,7 @@ def with_streaming_response(self) -> AsyncPatsResourceWithStreamingResponse: """ return AsyncPatsResourceWithStreamingResponse(self) - async def list( + def list( self, *, token: str | NotGiven = NOT_GIVEN, @@ -196,7 +199,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PatListResponse: + ) -> AsyncPaginator[PatListResponse, AsyncPersonalAccessTokensPage[PatListResponse]]: """ ListPersonalAccessTokens @@ -209,9 +212,10 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._post( + return self._get_api_list( "/gitpod.v1.UserService/ListPersonalAccessTokens", - body=await async_maybe_transform( + page=AsyncPersonalAccessTokensPage[PatListResponse], + body=maybe_transform( { "filter": filter, "pagination": pagination, @@ -223,7 +227,7 @@ async def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "token": token, "page_size": page_size, @@ -231,7 +235,8 @@ async def list( pat_list_params.PatListParams, ), ), - cast_to=PatListResponse, + model=PatListResponse, + method="post", ) async def delete( diff --git a/src/gitpod/types/account_list_login_providers_response.py b/src/gitpod/types/account_list_login_providers_response.py index 231fb827..825d9872 100644 --- a/src/gitpod/types/account_list_login_providers_response.py +++ b/src/gitpod/types/account_list_login_providers_response.py @@ -1,15 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["AccountListLoginProvidersResponse", "LoginProvider", "Pagination"] +__all__ = ["AccountListLoginProvidersResponse"] -class LoginProvider(BaseModel): +class AccountListLoginProvidersResponse(BaseModel): login_url: Optional[str] = FieldInfo(alias="loginUrl", default=None) """login_url is the URL to redirect the browser agent to for login""" @@ -18,17 +18,3 @@ class LoginProvider(BaseModel): "github", "google", "custom" """ - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class AccountListLoginProvidersResponse(BaseModel): - login_providers: Optional[List[LoginProvider]] = FieldInfo(alias="loginProviders", default=None) - - pagination: Optional[Pagination] = None diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_response.py b/src/gitpod/types/environments/automations/tasks/execution_list_response.py index 74fc66a3..cc11074d 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_list_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_list_response.py @@ -10,33 +10,23 @@ __all__ = [ "ExecutionListResponse", - "Pagination", - "TaskExecution", - "TaskExecutionMetadata", - "TaskExecutionMetadataCreator", - "TaskExecutionSpec", - "TaskExecutionSpecPlan", - "TaskExecutionSpecPlanStep", - "TaskExecutionSpecPlanStepUnionMember0", - "TaskExecutionSpecPlanStepUnionMember1", - "TaskExecutionSpecPlanStepUnionMember1Task", - "TaskExecutionSpecPlanStepUnionMember1TaskSpec", - "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", - "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", - "TaskExecutionStatus", - "TaskExecutionStatusStep", + "Metadata", + "MetadataCreator", + "Spec", + "SpecPlan", + "SpecPlanStep", + "SpecPlanStepUnionMember0", + "SpecPlanStepUnionMember1", + "SpecPlanStepUnionMember1Task", + "SpecPlanStepUnionMember1TaskSpec", + "SpecPlanStepUnionMember1TaskSpecRunsOn", + "SpecPlanStepUnionMember1TaskSpecRunsOnDocker", + "Status", + "StatusStep", ] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class TaskExecutionMetadataCreator(BaseModel): +class MetadataCreator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -53,7 +43,7 @@ class TaskExecutionMetadataCreator(BaseModel): """Principal is the principal of the subject""" -class TaskExecutionMetadata(BaseModel): +class Metadata(BaseModel): completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local @@ -238,7 +228,7 @@ class TaskExecutionMetadata(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[TaskExecutionMetadataCreator] = None + creator: Optional[MetadataCreator] = None """creator describes the principal who created/started the task run.""" environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) @@ -343,7 +333,7 @@ class TaskExecutionMetadata(BaseModel): """task_id is the ID of the main task being executed.""" -class TaskExecutionSpecPlanStepUnionMember0(BaseModel): +class SpecPlanStepUnionMember0(BaseModel): service_id: str = FieldInfo(alias="serviceId") id: Optional[str] = None @@ -354,32 +344,32 @@ class TaskExecutionSpecPlanStepUnionMember0(BaseModel): label: Optional[str] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): +class SpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): environment: Optional[List[str]] = None image: Optional[str] = None -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker +class SpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): + docker: SpecPlanStepUnionMember1TaskSpecRunsOnDocker -class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): +class SpecPlanStepUnionMember1TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" - runs_on: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) + runs_on: Optional[SpecPlanStepUnionMember1TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" -class TaskExecutionSpecPlanStepUnionMember1Task(BaseModel): +class SpecPlanStepUnionMember1Task(BaseModel): id: Optional[str] = None - spec: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpec] = None + spec: Optional[SpecPlanStepUnionMember1TaskSpec] = None -class TaskExecutionSpecPlanStepUnionMember1(BaseModel): - task: TaskExecutionSpecPlanStepUnionMember1Task +class SpecPlanStepUnionMember1(BaseModel): + task: SpecPlanStepUnionMember1Task id: Optional[str] = None """ID is the ID of the execution step""" @@ -389,16 +379,14 @@ class TaskExecutionSpecPlanStepUnionMember1(BaseModel): label: Optional[str] = None -TaskExecutionSpecPlanStep: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 -] +SpecPlanStep: TypeAlias = Union[SpecPlanStepUnionMember0, SpecPlanStepUnionMember1] -class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[TaskExecutionSpecPlanStep]] = None +class SpecPlan(BaseModel): + steps: Optional[List[SpecPlanStep]] = None -class TaskExecutionSpec(BaseModel): +class Spec(BaseModel): desired_phase: Optional[ Literal[ "TASK_EXECUTION_PHASE_UNSPECIFIED", @@ -414,7 +402,7 @@ class TaskExecutionSpec(BaseModel): Used to stop a running task execution early. """ - plan: Optional[List[TaskExecutionSpecPlan]] = None + plan: Optional[List[SpecPlan]] = None """plan is a list of groups of steps. The steps in a group are executed concurrently, while the groups are executed @@ -422,7 +410,7 @@ class TaskExecutionSpec(BaseModel): """ -class TaskExecutionStatusStep(BaseModel): +class StatusStep(BaseModel): id: Optional[str] = None """ID is the ID of the execution step""" @@ -446,7 +434,7 @@ class TaskExecutionStatusStep(BaseModel): """phase is the current phase of the execution step""" -class TaskExecutionStatus(BaseModel): +class Status(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message summarises why the task execution failed to operate. @@ -481,24 +469,18 @@ class TaskExecutionStatus(BaseModel): a.status_version < b.status_version then a was the status before b. """ - steps: Optional[List[TaskExecutionStatusStep]] = None + steps: Optional[List[StatusStep]] = None """steps provides the status for each individual step of the task execution. If a step is missing it has not yet started. """ -class TaskExecution(BaseModel): +class ExecutionListResponse(BaseModel): id: Optional[str] = None - metadata: Optional[TaskExecutionMetadata] = None - - spec: Optional[TaskExecutionSpec] = None - - status: Optional[TaskExecutionStatus] = None + metadata: Optional[Metadata] = None + spec: Optional[Spec] = None -class ExecutionListResponse(BaseModel): - pagination: Optional[Pagination] = None - - task_executions: Optional[List[TaskExecution]] = FieldInfo(alias="taskExecutions", default=None) + status: Optional[Status] = None diff --git a/src/gitpod/types/environments/class_list_response.py b/src/gitpod/types/environments/class_list_response.py index 3152499a..59606af6 100644 --- a/src/gitpod/types/environments/class_list_response.py +++ b/src/gitpod/types/environments/class_list_response.py @@ -6,20 +6,20 @@ from ..._models import BaseModel -__all__ = ["ClassListResponse", "EnvironmentClass", "EnvironmentClassConfiguration", "Pagination"] +__all__ = ["ClassListResponse", "Configuration"] -class EnvironmentClassConfiguration(BaseModel): +class Configuration(BaseModel): key: Optional[str] = None value: Optional[str] = None -class EnvironmentClass(BaseModel): +class ClassListResponse(BaseModel): id: Optional[str] = None """id is the unique identifier of the environment class""" - configuration: Optional[List[EnvironmentClassConfiguration]] = None + configuration: Optional[List[Configuration]] = None """configuration describes the configuration of the environment class""" description: Optional[str] = None @@ -39,18 +39,3 @@ class EnvironmentClass(BaseModel): runner_id is the unique identifier of the runner the environment class belongs to """ - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class ClassListResponse(BaseModel): - environment_classes: Optional[List[EnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing environment classes""" diff --git a/src/gitpod/types/organizations/sso_configuration_list_response.py b/src/gitpod/types/organizations/sso_configuration_list_response.py index 149af0b8..92917a10 100644 --- a/src/gitpod/types/organizations/sso_configuration_list_response.py +++ b/src/gitpod/types/organizations/sso_configuration_list_response.py @@ -1,24 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel -__all__ = ["SSOConfigurationListResponse", "Pagination", "SSOConfiguration"] +__all__ = ["SSOConfigurationListResponse"] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class SSOConfiguration(BaseModel): +class SSOConfigurationListResponse(BaseModel): id: Optional[str] = None """id is the unique identifier of the SSO configuration""" @@ -46,10 +38,3 @@ class SSOConfiguration(BaseModel): ] ] = None """state is the state of the SSO configuration""" - - -class SSOConfigurationListResponse(BaseModel): - pagination: Optional[Pagination] = None - - sso_configurations: Optional[List[SSOConfiguration]] = FieldInfo(alias="ssoConfigurations", default=None) - """sso_configurations are the SSO configurations for the organization""" diff --git a/src/gitpod/types/runners/configurations/environment_class_list_response.py b/src/gitpod/types/runners/configurations/environment_class_list_response.py index 81eb2d66..a5d220db 100644 --- a/src/gitpod/types/runners/configurations/environment_class_list_response.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_response.py @@ -6,20 +6,20 @@ from ...._models import BaseModel -__all__ = ["EnvironmentClassListResponse", "EnvironmentClass", "EnvironmentClassConfiguration", "Pagination"] +__all__ = ["EnvironmentClassListResponse", "Configuration"] -class EnvironmentClassConfiguration(BaseModel): +class Configuration(BaseModel): key: Optional[str] = None value: Optional[str] = None -class EnvironmentClass(BaseModel): +class EnvironmentClassListResponse(BaseModel): id: Optional[str] = None """id is the unique identifier of the environment class""" - configuration: Optional[List[EnvironmentClassConfiguration]] = None + configuration: Optional[List[Configuration]] = None """configuration describes the configuration of the environment class""" description: Optional[str] = None @@ -39,18 +39,3 @@ class EnvironmentClass(BaseModel): runner_id is the unique identifier of the runner the environment class belongs to """ - - -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class EnvironmentClassListResponse(BaseModel): - environment_classes: Optional[List[EnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) - - pagination: Optional[Pagination] = None - """pagination contains the pagination options for listing environment classes""" diff --git a/src/gitpod/types/users/pat_list_response.py b/src/gitpod/types/users/pat_list_response.py index aaf9d279..ec1e95ba 100644 --- a/src/gitpod/types/users/pat_list_response.py +++ b/src/gitpod/types/users/pat_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -8,18 +8,10 @@ from ..._models import BaseModel -__all__ = ["PatListResponse", "Pagination", "PersonalAccessToken", "PersonalAccessTokenCreator"] +__all__ = ["PatListResponse", "Creator"] -class Pagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - """Token passed for retreiving the next set of results. - - Empty if there are no more results - """ - - -class PersonalAccessTokenCreator(BaseModel): +class Creator(BaseModel): id: Optional[str] = None """id is the UUID of the subject""" @@ -36,7 +28,7 @@ class PersonalAccessTokenCreator(BaseModel): """Principal is the principal of the subject""" -class PersonalAccessToken(BaseModel): +class PatListResponse(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) @@ -131,7 +123,7 @@ class PersonalAccessToken(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[PersonalAccessTokenCreator] = None + creator: Optional[Creator] = None description: Optional[str] = None @@ -320,9 +312,3 @@ class PersonalAccessToken(BaseModel): """ user_id: Optional[str] = FieldInfo(alias="userId", default=None) - - -class PatListResponse(BaseModel): - pagination: Optional[Pagination] = None - - personal_access_tokens: Optional[List[PersonalAccessToken]] = FieldInfo(alias="personalAccessTokens", default=None) diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index e86f5b20..43dc6d00 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncTaskExecutionsPage, AsyncTaskExecutionsPage from gitpod.types.environments.automations.tasks import ( ExecutionListResponse, ExecutionRetrieveResponse, @@ -55,7 +56,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -73,7 +74,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -82,7 +83,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -91,7 +92,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) assert cast(Any, response.is_closed) is True @@ -168,7 +169,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -186,7 +187,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -195,7 +196,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -204,7 +205,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(ExecutionListResponse, execution, path=["response"]) + assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index 0cb6b9d1..7ef88fab 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncEnvironmentClassesPage, AsyncEnvironmentClassesPage from gitpod.types.environments import ClassListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,7 +21,7 @@ class TestClasses: @parametrize def test_method_list(self, client: Gitpod) -> None: class_ = client.environments.classes.list() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -33,7 +34,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -42,7 +43,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = response.parse() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -51,7 +52,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = response.parse() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -62,7 +63,7 @@ class TestAsyncClasses: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -75,7 +76,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -84,7 +85,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = await response.parse() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -93,6 +94,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = await response.parse() - assert_matches_type(ClassListResponse, class_, path=["response"]) + assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index d25686d0..e23cf090 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncSSOConfigurationsPage, AsyncSSOConfigurationsPage from gitpod.types.organizations import ( SSOConfigurationListResponse, SSOConfigurationCreateResponse, @@ -247,7 +248,9 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -260,7 +263,9 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -269,7 +274,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = response.parse() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -278,7 +285,9 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = response.parse() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -544,7 +553,9 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -557,7 +568,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -566,7 +579,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = await response.parse() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -575,7 +590,9 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = await response.parse() - assert_matches_type(SSOConfigurationListResponse, sso_configuration, path=["response"]) + assert_matches_type( + AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] + ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 437a54d5..50c85989 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncEnvironmentClassesPage, AsyncEnvironmentClassesPage from gitpod.types.runners.configurations import ( EnvironmentClassListResponse, EnvironmentClassCreateResponse, @@ -189,7 +190,9 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -202,7 +205,9 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -211,7 +216,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -220,7 +227,9 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -398,7 +407,9 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -411,7 +422,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -420,7 +433,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = await response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -429,6 +444,8 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = await response.parse() - assert_matches_type(EnvironmentClassListResponse, environment_class, path=["response"]) + assert_matches_type( + AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] + ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index f68516db..93aa7797 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -14,6 +14,7 @@ AccountGetSSOLoginURLResponse, AccountListLoginProvidersResponse, ) +from gitpod.pagination import SyncLoginProvidersPage, AsyncLoginProvidersPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -126,7 +127,7 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: account = client.accounts.list_login_providers() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) @parametrize def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> None: @@ -139,7 +140,7 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No "page_size": 100, }, ) - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) @parametrize def test_raw_response_list_login_providers(self, client: Gitpod) -> None: @@ -148,7 +149,7 @@ def test_raw_response_list_login_providers(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) @parametrize def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: @@ -157,7 +158,7 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) assert cast(Any, response.is_closed) is True @@ -270,7 +271,7 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) @parametrize async def test_method_list_login_providers_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -283,7 +284,7 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A "page_size": 100, }, ) - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) @parametrize async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod) -> None: @@ -292,7 +293,7 @@ async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) @parametrize async def test_streaming_response_list_login_providers(self, async_client: AsyncGitpod) -> None: @@ -301,6 +302,6 @@ async def test_streaming_response_list_login_providers(self, async_client: Async assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AccountListLoginProvidersResponse, account, path=["response"]) + assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index 600b29f6..c0fa515b 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -9,6 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type +from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage from gitpod.types.users import PatGetResponse, PatListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,7 +21,7 @@ class TestPats: @parametrize def test_method_list(self, client: Gitpod) -> None: pat = client.users.pats.list() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: @@ -33,7 +34,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize def test_raw_response_list(self, client: Gitpod) -> None: @@ -42,7 +43,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = response.parse() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: @@ -51,7 +52,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = response.parse() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) assert cast(Any, response.is_closed) is True @@ -126,7 +127,7 @@ class TestAsyncPats: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: @@ -139,7 +140,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @@ -148,7 +149,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = await response.parse() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @@ -157,7 +158,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = await response.parse() - assert_matches_type(PatListResponse, pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) assert cast(Any, response.is_closed) is True From 9d0498a1afd3b6e49787c16e17f896f839b27e16 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:37:09 +0000 Subject: [PATCH 075/505] chore: go live (#1) --- .github/workflows/publish-pypi.yml | 31 +++++++++ .github/workflows/release-doctor.yml | 21 ++++++ .release-please-manifest.json | 3 + CONTRIBUTING.md | 4 +- README.md | 10 +-- bin/check-release-environment | 21 ++++++ pyproject.toml | 6 +- release-please-config.json | 66 +++++++++++++++++++ src/gitpod/_version.py | 2 +- src/gitpod/resources/accounts.py | 8 +-- src/gitpod/resources/editors.py | 8 +-- .../environments/automations/automations.py | 8 +-- .../environments/automations/services.py | 8 +-- .../automations/tasks/executions.py | 8 +-- .../environments/automations/tasks/tasks.py | 8 +-- src/gitpod/resources/environments/classes.py | 8 +-- .../resources/environments/environments.py | 8 +-- src/gitpod/resources/events.py | 8 +-- src/gitpod/resources/groups.py | 8 +-- src/gitpod/resources/identity.py | 8 +-- src/gitpod/resources/organizations/invites.py | 8 +-- .../resources/organizations/organizations.py | 8 +-- .../organizations/sso_configurations.py | 8 +-- src/gitpod/resources/projects/policies.py | 8 +-- src/gitpod/resources/projects/projects.py | 8 +-- .../runners/configurations/configurations.py | 8 +-- .../configurations/environment_classes.py | 8 +-- .../host_authentication_tokens.py | 8 +-- .../runners/configurations/schema.py | 8 +-- .../configurations/scm_integrations.py | 8 +-- src/gitpod/resources/runners/policies.py | 8 +-- src/gitpod/resources/runners/runners.py | 8 +-- src/gitpod/resources/secrets.py | 8 +-- src/gitpod/resources/users/pats.py | 8 +-- src/gitpod/resources/users/users.py | 8 +-- 35 files changed, 257 insertions(+), 115 deletions(-) create mode 100644 .github/workflows/publish-pypi.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .release-please-manifest.json create mode 100644 bin/check-release-environment create mode 100644 release-please-config.json diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 00000000..9ac94126 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,31 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to PyPI in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/gitpod-io/flex-sdk-python/actions/workflows/publish-pypi.yml +name: Publish PyPI +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.35.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Publish to PyPI + run: | + bash ./bin/publish-pypi + env: + PYPI_TOKEN: ${{ secrets.GITPOD_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 00000000..7def838e --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,21 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'gitpod-io/flex-sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + PYPI_TOKEN: ${{ secrets.GITPOD_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..c4762802 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1-alpha.0" +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 42c71aa0..bf30b351 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```sh -$ pip install git+ssh://git@github.com/stainless-sdks/gitpod-python.git +$ pip install git+ssh://git@github.com/gitpod-io/flex-sdk-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -121,7 +121,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/gitpod-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/gitpod-io/flex-sdk-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index c3987aaa..d4f6ef5c 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ The REST API documentation can be found on [docs.gitpod.com](https://docs.gitpod ## Installation ```sh -# install from this staging repo -pip install git+ssh://git@github.com/stainless-sdks/gitpod-python.git +# install from the production repo +pip install git+ssh://git@github.com/gitpod-io/flex-sdk-python.git ``` > [!NOTE] @@ -269,9 +269,9 @@ runner = response.parse() # get the object that `runners.create()` would have r print(runner.access_token) ``` -These methods return an [`APIResponse`](https://github.com/stainless-sdks/gitpod-python/tree/main/src/gitpod/_response.py) object. +These methods return an [`APIResponse`](https://github.com/gitpod-io/flex-sdk-python/tree/main/src/gitpod/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/gitpod-python/tree/main/src/gitpod/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/gitpod-io/flex-sdk-python/tree/main/src/gitpod/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -375,7 +375,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/gitpod-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/gitpod-io/flex-sdk-python/issues) with questions, bugs, or suggestions. ### Determining the installed version diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 00000000..374fdaea --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${PYPI_TOKEN}" ]; then + errors+=("The GITPOD_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/pyproject.toml b/pyproject.toml index 4fb1f51f..d6cb8e71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,8 +34,8 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/stainless-sdks/gitpod-python" -Repository = "https://github.com/stainless-sdks/gitpod-python" +Homepage = "https://github.com/gitpod-io/flex-sdk-python" +Repository = "https://github.com/gitpod-io/flex-sdk-python" @@ -122,7 +122,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/stainless-sdks/gitpod-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/gitpod-io/flex-sdk-python/tree/main/\g<2>)' [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..024bdf6a --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,66 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "python", + "extra-files": [ + "src/gitpod/_version.py" + ] +} \ No newline at end of file diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index e706ccbe..47f502d2 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.0.1-alpha.0" +__version__ = "0.0.1-alpha.0" # x-release-please-version diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 4fde3b35..5035b3a5 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -39,7 +39,7 @@ def with_raw_response(self) -> AccountsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AccountsResourceWithRawResponse(self) @@ -48,7 +48,7 @@ def with_streaming_response(self) -> AccountsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AccountsResourceWithStreamingResponse(self) @@ -227,7 +227,7 @@ def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncAccountsResourceWithRawResponse(self) @@ -236,7 +236,7 @@ def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncAccountsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 46537391..19cfc8a7 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -34,7 +34,7 @@ def with_raw_response(self) -> EditorsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return EditorsResourceWithRawResponse(self) @@ -43,7 +43,7 @@ def with_streaming_response(self) -> EditorsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return EditorsResourceWithStreamingResponse(self) @@ -184,7 +184,7 @@ def with_raw_response(self) -> AsyncEditorsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncEditorsResourceWithRawResponse(self) @@ -193,7 +193,7 @@ def with_streaming_response(self) -> AsyncEditorsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncEditorsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index 92069a01..ea521a1b 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -55,7 +55,7 @@ def with_raw_response(self) -> AutomationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AutomationsResourceWithRawResponse(self) @@ -64,7 +64,7 @@ def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AutomationsResourceWithStreamingResponse(self) @@ -128,7 +128,7 @@ def with_raw_response(self) -> AsyncAutomationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncAutomationsResourceWithRawResponse(self) @@ -137,7 +137,7 @@ def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingRespon """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncAutomationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index ecd36130..f958352c 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -42,7 +42,7 @@ def with_raw_response(self) -> ServicesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return ServicesResourceWithRawResponse(self) @@ -51,7 +51,7 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return ServicesResourceWithStreamingResponse(self) @@ -355,7 +355,7 @@ def with_raw_response(self) -> AsyncServicesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncServicesResourceWithRawResponse(self) @@ -364,7 +364,7 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncServicesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index 796bc06a..d34f9ecb 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -37,7 +37,7 @@ def with_raw_response(self) -> ExecutionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return ExecutionsResourceWithRawResponse(self) @@ -46,7 +46,7 @@ def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return ExecutionsResourceWithStreamingResponse(self) @@ -179,7 +179,7 @@ def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncExecutionsResourceWithRawResponse(self) @@ -188,7 +188,7 @@ def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingRespons """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncExecutionsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 29d9e18e..f3e00a6e 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -56,7 +56,7 @@ def with_raw_response(self) -> TasksResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return TasksResourceWithRawResponse(self) @@ -65,7 +65,7 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return TasksResourceWithStreamingResponse(self) @@ -324,7 +324,7 @@ def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncTasksResourceWithRawResponse(self) @@ -333,7 +333,7 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncTasksResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/classes.py b/src/gitpod/resources/environments/classes.py index 7b9cebdf..c4289d4c 100644 --- a/src/gitpod/resources/environments/classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -29,7 +29,7 @@ def with_raw_response(self) -> ClassesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return ClassesResourceWithRawResponse(self) @@ -38,7 +38,7 @@ def with_streaming_response(self) -> ClassesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return ClassesResourceWithStreamingResponse(self) @@ -107,7 +107,7 @@ def with_raw_response(self) -> AsyncClassesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncClassesResourceWithRawResponse(self) @@ -116,7 +116,7 @@ def with_streaming_response(self) -> AsyncClassesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncClassesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 4b1b3661..6d9d991f 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -74,7 +74,7 @@ def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return EnvironmentsResourceWithRawResponse(self) @@ -83,7 +83,7 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return EnvironmentsResourceWithStreamingResponse(self) @@ -565,7 +565,7 @@ def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncEnvironmentsResourceWithRawResponse(self) @@ -574,7 +574,7 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncEnvironmentsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index 2293eac3..df67d31f 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -37,7 +37,7 @@ def with_raw_response(self) -> EventsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return EventsResourceWithRawResponse(self) @@ -46,7 +46,7 @@ def with_streaming_response(self) -> EventsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return EventsResourceWithStreamingResponse(self) @@ -203,7 +203,7 @@ def with_raw_response(self) -> AsyncEventsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncEventsResourceWithRawResponse(self) @@ -212,7 +212,7 @@ def with_streaming_response(self) -> AsyncEventsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncEventsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py index 42b262f7..bf614f1c 100644 --- a/src/gitpod/resources/groups.py +++ b/src/gitpod/resources/groups.py @@ -29,7 +29,7 @@ def with_raw_response(self) -> GroupsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return GroupsResourceWithRawResponse(self) @@ -38,7 +38,7 @@ def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return GroupsResourceWithStreamingResponse(self) @@ -98,7 +98,7 @@ def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncGroupsResourceWithRawResponse(self) @@ -107,7 +107,7 @@ def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncGroupsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 893f759b..07b9632e 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -39,7 +39,7 @@ def with_raw_response(self) -> IdentityResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return IdentityResourceWithRawResponse(self) @@ -48,7 +48,7 @@ def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return IdentityResourceWithStreamingResponse(self) @@ -163,7 +163,7 @@ def with_raw_response(self) -> AsyncIdentityResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncIdentityResourceWithRawResponse(self) @@ -172,7 +172,7 @@ def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncIdentityResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/organizations/invites.py b/src/gitpod/resources/organizations/invites.py index 872373da..8475f639 100644 --- a/src/gitpod/resources/organizations/invites.py +++ b/src/gitpod/resources/organizations/invites.py @@ -33,7 +33,7 @@ def with_raw_response(self) -> InvitesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return InvitesResourceWithRawResponse(self) @@ -42,7 +42,7 @@ def with_streaming_response(self) -> InvitesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return InvitesResourceWithStreamingResponse(self) @@ -155,7 +155,7 @@ def with_raw_response(self) -> AsyncInvitesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncInvitesResourceWithRawResponse(self) @@ -164,7 +164,7 @@ def with_streaming_response(self) -> AsyncInvitesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncInvitesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 9323dc35..afd94cb3 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -74,7 +74,7 @@ def with_raw_response(self) -> OrganizationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return OrganizationsResourceWithRawResponse(self) @@ -83,7 +83,7 @@ def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return OrganizationsResourceWithStreamingResponse(self) @@ -581,7 +581,7 @@ def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncOrganizationsResourceWithRawResponse(self) @@ -590,7 +590,7 @@ def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResp """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncOrganizationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index aadadb22..cb3b97ce 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -43,7 +43,7 @@ def with_raw_response(self) -> SSOConfigurationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return SSOConfigurationsResourceWithRawResponse(self) @@ -52,7 +52,7 @@ def with_streaming_response(self) -> SSOConfigurationsResourceWithStreamingRespo """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return SSOConfigurationsResourceWithStreamingResponse(self) @@ -421,7 +421,7 @@ def with_raw_response(self) -> AsyncSSOConfigurationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncSSOConfigurationsResourceWithRawResponse(self) @@ -430,7 +430,7 @@ def with_streaming_response(self) -> AsyncSSOConfigurationsResourceWithStreaming """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncSSOConfigurationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index d1a008fd..5c51df7a 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -36,7 +36,7 @@ def with_raw_response(self) -> PoliciesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return PoliciesResourceWithRawResponse(self) @@ -45,7 +45,7 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return PoliciesResourceWithStreamingResponse(self) @@ -247,7 +247,7 @@ def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncPoliciesResourceWithRawResponse(self) @@ -256,7 +256,7 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncPoliciesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 90dab12b..a87ec1a8 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -58,7 +58,7 @@ def with_raw_response(self) -> ProjectsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return ProjectsResourceWithRawResponse(self) @@ -67,7 +67,7 @@ def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return ProjectsResourceWithStreamingResponse(self) @@ -483,7 +483,7 @@ def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncProjectsResourceWithRawResponse(self) @@ -492,7 +492,7 @@ def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncProjectsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index d5317a15..a9a8500f 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -83,7 +83,7 @@ def with_raw_response(self) -> ConfigurationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return ConfigurationsResourceWithRawResponse(self) @@ -92,7 +92,7 @@ def with_streaming_response(self) -> ConfigurationsResourceWithStreamingResponse """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return ConfigurationsResourceWithStreamingResponse(self) @@ -213,7 +213,7 @@ def with_raw_response(self) -> AsyncConfigurationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncConfigurationsResourceWithRawResponse(self) @@ -222,7 +222,7 @@ def with_streaming_response(self) -> AsyncConfigurationsResourceWithStreamingRes """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncConfigurationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index eacd5403..8594abc9 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -43,7 +43,7 @@ def with_raw_response(self) -> EnvironmentClassesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return EnvironmentClassesResourceWithRawResponse(self) @@ -52,7 +52,7 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return EnvironmentClassesResourceWithStreamingResponse(self) @@ -306,7 +306,7 @@ def with_raw_response(self) -> AsyncEnvironmentClassesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncEnvironmentClassesResourceWithRawResponse(self) @@ -315,7 +315,7 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncEnvironmentClassesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 8321f34d..b12a7602 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -49,7 +49,7 @@ def with_raw_response(self) -> HostAuthenticationTokensResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return HostAuthenticationTokensResourceWithRawResponse(self) @@ -58,7 +58,7 @@ def with_streaming_response(self) -> HostAuthenticationTokensResourceWithStreami """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return HostAuthenticationTokensResourceWithStreamingResponse(self) @@ -531,7 +531,7 @@ def with_raw_response(self) -> AsyncHostAuthenticationTokensResourceWithRawRespo This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncHostAuthenticationTokensResourceWithRawResponse(self) @@ -540,7 +540,7 @@ def with_streaming_response(self) -> AsyncHostAuthenticationTokensResourceWithSt """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncHostAuthenticationTokensResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/schema.py b/src/gitpod/resources/runners/configurations/schema.py index c1f555cb..76f4a913 100644 --- a/src/gitpod/resources/runners/configurations/schema.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -31,7 +31,7 @@ def with_raw_response(self) -> SchemaResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return SchemaResourceWithRawResponse(self) @@ -40,7 +40,7 @@ def with_streaming_response(self) -> SchemaResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return SchemaResourceWithStreamingResponse(self) @@ -84,7 +84,7 @@ def with_raw_response(self) -> AsyncSchemaResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncSchemaResourceWithRawResponse(self) @@ -93,7 +93,7 @@ def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncSchemaResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 51596137..a7be1d25 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -43,7 +43,7 @@ def with_raw_response(self) -> ScmIntegrationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return ScmIntegrationsResourceWithRawResponse(self) @@ -52,7 +52,7 @@ def with_streaming_response(self) -> ScmIntegrationsResourceWithStreamingRespons """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return ScmIntegrationsResourceWithStreamingResponse(self) @@ -394,7 +394,7 @@ def with_raw_response(self) -> AsyncScmIntegrationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncScmIntegrationsResourceWithRawResponse(self) @@ -403,7 +403,7 @@ def with_streaming_response(self) -> AsyncScmIntegrationsResourceWithStreamingRe """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncScmIntegrationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 4f703c1a..c303ce41 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -36,7 +36,7 @@ def with_raw_response(self) -> PoliciesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return PoliciesResourceWithRawResponse(self) @@ -45,7 +45,7 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return PoliciesResourceWithStreamingResponse(self) @@ -247,7 +247,7 @@ def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncPoliciesResourceWithRawResponse(self) @@ -256,7 +256,7 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncPoliciesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 85b041d4..e41444af 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -73,7 +73,7 @@ def with_raw_response(self) -> RunnersResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return RunnersResourceWithRawResponse(self) @@ -82,7 +82,7 @@ def with_streaming_response(self) -> RunnersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return RunnersResourceWithStreamingResponse(self) @@ -507,7 +507,7 @@ def with_raw_response(self) -> AsyncRunnersResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncRunnersResourceWithRawResponse(self) @@ -516,7 +516,7 @@ def with_streaming_response(self) -> AsyncRunnersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncRunnersResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 8740065f..bc2b8585 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -44,7 +44,7 @@ def with_raw_response(self) -> SecretsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return SecretsResourceWithRawResponse(self) @@ -53,7 +53,7 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return SecretsResourceWithStreamingResponse(self) @@ -336,7 +336,7 @@ def with_raw_response(self) -> AsyncSecretsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncSecretsResourceWithRawResponse(self) @@ -345,7 +345,7 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncSecretsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 17474a15..3165c3b2 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -33,7 +33,7 @@ def with_raw_response(self) -> PatsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return PatsResourceWithRawResponse(self) @@ -42,7 +42,7 @@ def with_streaming_response(self) -> PatsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return PatsResourceWithStreamingResponse(self) @@ -173,7 +173,7 @@ def with_raw_response(self) -> AsyncPatsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncPatsResourceWithRawResponse(self) @@ -182,7 +182,7 @@ def with_streaming_response(self) -> AsyncPatsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncPatsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index e79311c0..e6f29697 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -43,7 +43,7 @@ def with_raw_response(self) -> UsersResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return UsersResourceWithRawResponse(self) @@ -52,7 +52,7 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return UsersResourceWithStreamingResponse(self) @@ -139,7 +139,7 @@ def with_raw_response(self) -> AsyncUsersResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncUsersResourceWithRawResponse(self) @@ -148,7 +148,7 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/gitpod-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response """ return AsyncUsersResourceWithStreamingResponse(self) From 305f90ba4fe1bd638bfa61a9d4c4b02842e59802 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 19:14:45 +0000 Subject: [PATCH 076/505] fix(tests): disable test mocks (#3) --- .../automations/tasks/test_executions.py | 24 ++++++ .../environments/automations/test_services.py | 56 +++++++++++++ .../environments/automations/test_tasks.py | 48 +++++++++++ .../environments/test_automations.py | 8 ++ .../environments/test_classes.py | 8 ++ .../organizations/test_invites.py | 24 ++++++ .../organizations/test_sso_configurations.py | 62 ++++++++++++++ tests/api_resources/projects/test_policies.py | 32 +++++++ .../test_environment_classes.py | 42 ++++++++++ .../test_host_authentication_tokens.py | 50 +++++++++++ .../runners/configurations/test_schema.py | 8 ++ .../configurations/test_scm_integrations.py | 54 ++++++++++++ .../runners/test_configurations.py | 16 ++++ tests/api_resources/runners/test_policies.py | 32 +++++++ tests/api_resources/test_accounts.py | 30 +++++++ tests/api_resources/test_editors.py | 24 ++++++ tests/api_resources/test_environments.py | 84 +++++++++++++++++++ tests/api_resources/test_events.py | 8 ++ tests/api_resources/test_groups.py | 8 ++ tests/api_resources/test_identity.py | 22 +++++ tests/api_resources/test_organizations.py | 82 ++++++++++++++++++ tests/api_resources/test_projects.py | 72 ++++++++++++++++ tests/api_resources/test_runners.py | 68 +++++++++++++++ tests/api_resources/test_secrets.py | 48 +++++++++++ tests/api_resources/test_users.py | 14 ++++ tests/api_resources/users/test_pats.py | 24 ++++++ 26 files changed, 948 insertions(+) diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index 43dc6d00..136a0117 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -21,11 +21,13 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve( @@ -33,6 +35,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -42,6 +45,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.retrieve() as response: @@ -53,11 +57,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list() assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list( @@ -76,6 +82,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.list() @@ -85,6 +92,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -96,11 +104,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_stop(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop( @@ -108,6 +118,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.stop() @@ -117,6 +128,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.stop() as response: @@ -132,11 +144,13 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve( @@ -144,6 +158,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -153,6 +168,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -166,11 +182,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list() assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list( @@ -189,6 +207,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.list() @@ -198,6 +217,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -209,11 +229,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop( @@ -221,6 +243,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.stop() @@ -230,6 +253,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 40f9a7bd..f6a1893c 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -23,11 +23,13 @@ class TestServices: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: service = client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.create( @@ -62,6 +64,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.create() @@ -71,6 +74,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.create() as response: @@ -82,11 +86,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve( @@ -94,6 +100,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.retrieve() @@ -103,6 +110,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -114,11 +122,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: service = client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( @@ -129,6 +139,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.update() @@ -138,6 +149,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.update() as response: @@ -149,11 +161,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: service = client.environments.automations.services.list() assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.list( @@ -171,6 +185,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.list() @@ -180,6 +195,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.list() as response: @@ -191,11 +207,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: service = client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.delete( @@ -204,6 +222,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.delete() @@ -213,6 +232,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.delete() as response: @@ -224,11 +244,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_start(self, client: Gitpod) -> None: service = client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.start( @@ -236,6 +258,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.start() @@ -245,6 +268,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.start() as response: @@ -256,11 +280,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_stop(self, client: Gitpod) -> None: service = client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.stop( @@ -268,6 +294,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.stop() @@ -277,6 +304,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.stop() as response: @@ -292,11 +320,13 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncServices: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create( @@ -331,6 +361,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.create() @@ -340,6 +371,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.create() as response: @@ -351,11 +383,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve( @@ -363,6 +397,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.retrieve() @@ -372,6 +407,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -383,11 +419,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( @@ -398,6 +436,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.update() @@ -407,6 +446,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.update() as response: @@ -418,11 +458,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list() assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( @@ -440,6 +482,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.list() @@ -449,6 +492,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.list() as response: @@ -460,11 +504,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete( @@ -473,6 +519,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.delete() @@ -482,6 +529,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.delete() as response: @@ -493,11 +541,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start( @@ -505,6 +555,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.start() @@ -514,6 +565,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.start() as response: @@ -525,11 +577,13 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop( @@ -537,6 +591,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.stop() @@ -546,6 +601,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 3138f430..381d28f5 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -24,11 +24,13 @@ class TestTasks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create( @@ -57,6 +59,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.create() @@ -66,6 +69,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.create() as response: @@ -77,11 +81,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( @@ -89,6 +95,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.retrieve() @@ -98,6 +105,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -109,11 +117,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( @@ -124,6 +134,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.update() @@ -133,6 +144,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.update() as response: @@ -144,11 +156,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list() assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( @@ -166,6 +180,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.list() @@ -175,6 +190,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.list() as response: @@ -186,11 +202,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete( @@ -198,6 +216,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.delete() @@ -207,6 +226,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -218,11 +238,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_start(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start( @@ -230,6 +252,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.start() @@ -239,6 +262,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.start() as response: @@ -254,11 +278,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: class TestAsyncTasks: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create( @@ -287,6 +313,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.create() @@ -296,6 +323,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.create() as response: @@ -307,11 +335,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( @@ -319,6 +349,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.retrieve() @@ -328,6 +359,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -339,11 +371,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( @@ -354,6 +388,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.update() @@ -363,6 +398,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.update() as response: @@ -374,11 +410,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list() assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( @@ -396,6 +434,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.list() @@ -405,6 +444,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.list() as response: @@ -416,11 +456,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete( @@ -428,6 +470,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.delete() @@ -437,6 +480,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -448,11 +492,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start( @@ -460,6 +506,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.start() @@ -469,6 +516,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.start() as response: diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 5b0f7c20..e4c8ffdb 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -17,11 +17,13 @@ class TestAutomations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_upsert(self, client: Gitpod) -> None: automation = client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_upsert_with_all_params(self, client: Gitpod) -> None: automation = client.environments.automations.upsert( @@ -64,6 +66,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_upsert(self, client: Gitpod) -> None: response = client.environments.automations.with_raw_response.upsert() @@ -73,6 +76,7 @@ def test_raw_response_upsert(self, client: Gitpod) -> None: automation = response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_upsert(self, client: Gitpod) -> None: with client.environments.automations.with_streaming_response.upsert() as response: @@ -88,11 +92,13 @@ def test_streaming_response_upsert(self, client: Gitpod) -> None: class TestAsyncAutomations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_upsert(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert( @@ -135,6 +141,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.with_raw_response.upsert() @@ -144,6 +151,7 @@ async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: automation = await response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.with_streaming_response.upsert() as response: diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index 7ef88fab..3b525f3e 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -18,11 +18,13 @@ class TestClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: class_ = client.environments.classes.list() assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: class_ = client.environments.classes.list( @@ -36,6 +38,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.classes.with_raw_response.list() @@ -45,6 +48,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: class_ = response.parse() assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.classes.with_streaming_response.list() as response: @@ -60,11 +64,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncClasses: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list() assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list( @@ -78,6 +84,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.classes.with_raw_response.list() @@ -87,6 +94,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: class_ = await response.parse() assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index 0f80a2a1..b158bc41 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -21,11 +21,13 @@ class TestInvites: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: invite = client.organizations.invites.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.create( @@ -33,6 +35,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.create() @@ -42,6 +45,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.create() as response: @@ -53,11 +57,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve( @@ -65,6 +71,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.retrieve() @@ -74,6 +81,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.retrieve() as response: @@ -85,11 +93,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_summary(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( @@ -97,6 +107,7 @@ def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_summary(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.get_summary() @@ -106,6 +117,7 @@ def test_raw_response_get_summary(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_summary(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.get_summary() as response: @@ -121,11 +133,13 @@ def test_streaming_response_get_summary(self, client: Gitpod) -> None: class TestAsyncInvites: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create( @@ -133,6 +147,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.create() @@ -142,6 +157,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.create() as response: @@ -153,11 +169,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve( @@ -165,6 +183,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.retrieve() @@ -174,6 +193,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.retrieve() as response: @@ -185,11 +205,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( @@ -197,6 +219,7 @@ async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.get_summary() @@ -206,6 +229,7 @@ async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None invite = await response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.get_summary() as response: diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index e23cf090..04d19db3 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -22,11 +22,13 @@ class TestSSOConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( @@ -38,6 +40,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.create() @@ -47,6 +50,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.create() as response: @@ -58,11 +62,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( @@ -70,6 +76,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.retrieve() @@ -79,6 +86,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.retrieve() as response: @@ -90,6 +98,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -97,6 +106,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -108,6 +118,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -121,6 +132,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -128,6 +140,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -139,6 +152,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -152,6 +166,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -159,6 +174,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -170,6 +186,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -183,6 +200,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_4(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -190,6 +208,7 @@ def test_method_update_overload_4(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_4(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -201,6 +220,7 @@ def test_raw_response_update_overload_4(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -214,6 +234,7 @@ def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_5(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -221,6 +242,7 @@ def test_method_update_overload_5(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -232,6 +254,7 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -245,6 +268,7 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list() @@ -252,6 +276,7 @@ def test_method_list(self, client: Gitpod) -> None: SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( @@ -267,6 +292,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.list() @@ -278,6 +304,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.list() as response: @@ -291,11 +318,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete( @@ -303,6 +332,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.delete() @@ -312,6 +342,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.delete() as response: @@ -327,11 +358,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncSSOConfigurations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( @@ -343,6 +376,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.create() @@ -352,6 +386,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.create() as response: @@ -363,11 +398,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( @@ -375,6 +412,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.retrieve() @@ -384,6 +422,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.retrieve() as response: @@ -395,6 +434,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -402,6 +442,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -413,6 +454,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -426,6 +468,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -433,6 +476,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -444,6 +488,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -457,6 +502,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -464,6 +510,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -475,6 +522,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -488,6 +536,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -495,6 +544,7 @@ async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -506,6 +556,7 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -519,6 +570,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -526,6 +578,7 @@ async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -537,6 +590,7 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -550,6 +604,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list() @@ -557,6 +612,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( @@ -572,6 +628,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.list() @@ -583,6 +640,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.list() as response: @@ -596,11 +654,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete( @@ -608,6 +668,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.delete() @@ -617,6 +678,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.delete() as response: diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index 84f3f9a4..c066dcbb 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -22,11 +22,13 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( @@ -36,6 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.create() @@ -45,6 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.create() as response: @@ -56,11 +60,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( @@ -70,6 +76,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.update() @@ -79,6 +86,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.update() as response: @@ -90,11 +98,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.projects.policies.list() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.list( @@ -108,6 +118,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.list() @@ -117,6 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.list() as response: @@ -128,11 +140,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.delete( @@ -141,6 +155,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.delete() @@ -150,6 +165,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.delete() as response: @@ -165,11 +181,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncPolicies: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create( @@ -179,6 +197,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.create() @@ -188,6 +207,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.create() as response: @@ -199,11 +219,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update( @@ -213,6 +235,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.update() @@ -222,6 +245,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.update() as response: @@ -233,11 +257,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list( @@ -251,6 +277,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.list() @@ -260,6 +287,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.list() as response: @@ -271,11 +299,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete( @@ -284,6 +314,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.delete() @@ -293,6 +324,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 50c85989..d08bb882 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -22,11 +22,13 @@ class TestEnvironmentClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create( @@ -42,6 +44,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.create() @@ -51,6 +54,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -62,11 +66,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( @@ -74,6 +80,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -83,6 +90,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.retrieve() as response: @@ -94,6 +102,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -101,6 +110,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( @@ -112,6 +122,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( @@ -125,6 +136,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -132,6 +144,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( @@ -143,6 +156,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( @@ -156,6 +170,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -163,6 +178,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( @@ -174,6 +190,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( @@ -187,6 +204,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list() @@ -194,6 +212,7 @@ def test_method_list(self, client: Gitpod) -> None: SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list( @@ -209,6 +228,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.list() @@ -220,6 +240,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.list() as response: @@ -237,11 +258,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncEnvironmentClasses: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create( @@ -257,6 +280,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.create() @@ -266,6 +290,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -277,11 +302,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( @@ -289,6 +316,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -298,6 +326,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -311,6 +340,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -318,6 +348,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( @@ -329,6 +360,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( @@ -342,6 +374,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -349,6 +382,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( @@ -360,6 +394,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( @@ -373,6 +408,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -380,6 +416,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( @@ -391,6 +428,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( @@ -404,6 +442,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list() @@ -411,6 +450,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list( @@ -426,6 +466,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.list() @@ -437,6 +478,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 6e1752bf..1520b2ae 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -23,11 +23,13 @@ class TestHostAuthenticationTokens: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create( @@ -41,6 +43,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -50,6 +53,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.create() as response: @@ -61,11 +65,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( @@ -73,6 +79,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -82,6 +89,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: @@ -93,6 +101,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -100,6 +109,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -111,6 +121,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -124,6 +135,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -131,6 +143,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -142,6 +155,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -155,6 +169,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -162,6 +177,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -173,6 +189,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -186,6 +203,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list() @@ -193,6 +211,7 @@ def test_method_list(self, client: Gitpod) -> None: SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list( @@ -208,6 +227,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -219,6 +239,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.list() as response: @@ -232,11 +253,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( @@ -244,6 +267,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -253,6 +277,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.delete() as response: @@ -268,11 +293,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncHostAuthenticationTokens: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( @@ -286,6 +313,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -295,6 +323,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with ( @@ -308,11 +337,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( @@ -320,6 +351,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -329,6 +361,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -342,6 +375,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -349,6 +383,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -360,6 +395,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -373,6 +409,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -380,6 +417,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -391,6 +429,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -404,6 +443,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -411,6 +451,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -422,6 +463,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -435,6 +477,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list() @@ -442,6 +485,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( @@ -457,6 +501,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -468,6 +513,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with ( @@ -483,11 +529,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( @@ -495,6 +543,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -504,6 +553,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with ( diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index 47601189..3fce8e32 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -17,11 +17,13 @@ class TestSchema: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( @@ -29,6 +31,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.schema.with_raw_response.retrieve() @@ -38,6 +41,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: schema = response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.schema.with_streaming_response.retrieve() as response: @@ -53,11 +57,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: class TestAsyncSchema: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( @@ -65,6 +71,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.schema.with_raw_response.retrieve() @@ -74,6 +81,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: schema = await response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.schema.with_streaming_response.retrieve() as response: diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index 4f404eaa..e827e39b 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -22,6 +22,7 @@ class TestScmIntegrations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( @@ -29,6 +30,7 @@ def test_method_create_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( @@ -40,6 +42,7 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -53,6 +56,7 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_overload_2(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( @@ -60,6 +64,7 @@ def test_method_create_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( @@ -71,6 +76,7 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -84,11 +90,13 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( @@ -96,6 +104,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -105,6 +114,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -116,6 +126,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -123,6 +134,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( @@ -134,6 +146,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -147,6 +160,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -154,6 +168,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( @@ -165,6 +180,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -178,6 +194,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -185,6 +202,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( @@ -196,6 +214,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -209,11 +228,13 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list() assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list( @@ -227,6 +248,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.list() @@ -236,6 +258,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -247,11 +270,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete( @@ -259,6 +284,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -268,6 +294,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: @@ -283,6 +310,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncScmIntegrations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( @@ -290,6 +318,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( @@ -301,6 +330,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -314,6 +344,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( @@ -321,6 +352,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( @@ -332,6 +364,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -345,11 +378,13 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( @@ -357,6 +392,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -366,6 +402,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -377,6 +414,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -384,6 +422,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( @@ -395,6 +434,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -408,6 +448,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -415,6 +456,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( @@ -426,6 +468,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -439,6 +482,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -446,6 +490,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( @@ -457,6 +502,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -470,11 +516,13 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list() assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list( @@ -488,6 +536,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.list() @@ -497,6 +546,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -508,11 +558,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete( @@ -520,6 +572,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -529,6 +582,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index b64232aa..833058db 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -17,6 +17,7 @@ class TestConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_validate_overload_1(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -24,6 +25,7 @@ def test_method_validate_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -44,6 +46,7 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( @@ -55,6 +58,7 @@ def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: configuration = response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( @@ -68,6 +72,7 @@ def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_validate_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -75,6 +80,7 @@ def test_method_validate_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -83,6 +89,7 @@ def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> Non ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( @@ -94,6 +101,7 @@ def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: configuration = response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( @@ -111,6 +119,7 @@ def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: class TestAsyncConfigurations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -118,6 +127,7 @@ async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> No ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_validate_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -138,6 +148,7 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( @@ -149,6 +160,7 @@ async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) configuration = await response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( @@ -162,6 +174,7 @@ async def test_streaming_response_validate_overload_1(self, async_client: AsyncG assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -169,6 +182,7 @@ async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> No ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -177,6 +191,7 @@ async def test_method_validate_with_all_params_overload_2(self, async_client: As ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( @@ -188,6 +203,7 @@ async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) configuration = await response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index 11a2f953..bd75557f 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -22,11 +22,13 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( @@ -36,6 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.create() @@ -45,6 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.create() as response: @@ -56,11 +60,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( @@ -70,6 +76,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.update() @@ -79,6 +86,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.update() as response: @@ -90,11 +98,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.runners.policies.list() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.list( @@ -108,6 +118,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.list() @@ -117,6 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.list() as response: @@ -128,11 +140,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.delete( @@ -141,6 +155,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.delete() @@ -150,6 +165,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.delete() as response: @@ -165,11 +181,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncPolicies: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( @@ -179,6 +197,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.create() @@ -188,6 +207,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.create() as response: @@ -199,11 +219,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( @@ -213,6 +235,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.update() @@ -222,6 +245,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.update() as response: @@ -233,11 +257,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( @@ -251,6 +277,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.list() @@ -260,6 +287,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.list() as response: @@ -271,11 +299,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete( @@ -284,6 +314,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.delete() @@ -293,6 +324,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 93aa7797..ab0d94f9 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -22,6 +22,7 @@ class TestAccounts: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: account = client.accounts.retrieve( @@ -29,6 +30,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.retrieve( @@ -40,6 +42,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.retrieve( @@ -53,11 +56,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: account = client.accounts.delete() assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: account = client.accounts.delete( @@ -65,6 +70,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.delete() @@ -74,6 +80,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.delete() as response: @@ -85,6 +92,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -92,6 +100,7 @@ def test_method_get_sso_login_url(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -100,6 +109,7 @@ def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.get_sso_login_url( @@ -111,6 +121,7 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.get_sso_login_url( @@ -124,11 +135,13 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: account = client.accounts.list_login_providers() assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> None: account = client.accounts.list_login_providers( @@ -142,6 +155,7 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No ) assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list_login_providers(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.list_login_providers() @@ -151,6 +165,7 @@ def test_raw_response_list_login_providers(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.list_login_providers() as response: @@ -166,6 +181,7 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: class TestAsyncAccounts: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve( @@ -173,6 +189,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.retrieve( @@ -184,6 +201,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: account = await response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.retrieve( @@ -197,11 +215,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete() assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete( @@ -209,6 +229,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.delete() @@ -218,6 +239,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: account = await response.parse() assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.delete() as response: @@ -229,6 +251,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -236,6 +259,7 @@ async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -244,6 +268,7 @@ async def test_method_get_sso_login_url_with_all_params(self, async_client: Asyn ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.get_sso_login_url( @@ -255,6 +280,7 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - account = await response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.get_sso_login_url( @@ -268,11 +294,13 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers() assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_login_providers_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers( @@ -286,6 +314,7 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A ) assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.list_login_providers() @@ -295,6 +324,7 @@ async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod account = await response.parse() assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list_login_providers(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.list_login_providers() as response: diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 10f3a757..d3de3026 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -22,11 +22,13 @@ class TestEditors: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: editor = client.editors.retrieve() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: editor = client.editors.retrieve( @@ -34,6 +36,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.editors.with_raw_response.retrieve() @@ -43,6 +46,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.editors.with_streaming_response.retrieve() as response: @@ -54,11 +58,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: editor = client.editors.list() assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: editor = client.editors.list( @@ -71,6 +77,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.editors.with_raw_response.list() @@ -80,6 +87,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.editors.with_streaming_response.list() as response: @@ -91,11 +99,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_resolve_url(self, client: Gitpod) -> None: editor = client.editors.resolve_url() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: editor = client.editors.resolve_url( @@ -105,6 +115,7 @@ def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: response = client.editors.with_raw_response.resolve_url() @@ -114,6 +125,7 @@ def test_raw_response_resolve_url(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_resolve_url(self, client: Gitpod) -> None: with client.editors.with_streaming_response.resolve_url() as response: @@ -129,11 +141,13 @@ def test_streaming_response_resolve_url(self, client: Gitpod) -> None: class TestAsyncEditors: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( @@ -141,6 +155,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.retrieve() @@ -150,6 +165,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.retrieve() as response: @@ -161,11 +177,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list() assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list( @@ -178,6 +196,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.list() @@ -187,6 +206,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.list() as response: @@ -198,11 +218,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( @@ -212,6 +234,7 @@ async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.resolve_url() @@ -221,6 +244,7 @@ async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None editor = await response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.resolve_url() as response: diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 60087985..08dc4635 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -25,11 +25,13 @@ class TestEnvironments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: environment = client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( @@ -82,6 +84,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create() @@ -91,6 +94,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create() as response: @@ -102,11 +106,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment = client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment = client.environments.retrieve( @@ -114,6 +120,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.with_raw_response.retrieve() @@ -123,6 +130,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.with_streaming_response.retrieve() as response: @@ -134,6 +142,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: environment = client.environments.update( @@ -141,6 +150,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( @@ -152,6 +162,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( @@ -165,6 +176,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: environment = client.environments.update( @@ -172,6 +184,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( @@ -183,6 +196,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( @@ -196,11 +210,13 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: environment = client.environments.list() assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( @@ -221,6 +237,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.with_raw_response.list() @@ -230,6 +247,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.with_streaming_response.list() as response: @@ -241,11 +259,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: environment = client.environments.delete() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: environment = client.environments.delete( @@ -254,6 +274,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.with_raw_response.delete() @@ -263,6 +284,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.with_streaming_response.delete() as response: @@ -274,11 +296,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: environment = client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( @@ -332,6 +356,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_from_project(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_from_project() @@ -341,6 +366,7 @@ def test_raw_response_create_from_project(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_from_project(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_from_project() as response: @@ -352,11 +378,13 @@ def test_streaming_response_create_from_project(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_logs_token(self, client: Gitpod) -> None: environment = client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_logs_token( @@ -364,6 +392,7 @@ def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_logs_token(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_logs_token() @@ -373,6 +402,7 @@ def test_raw_response_create_logs_token(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_logs_token() as response: @@ -384,11 +414,13 @@ def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_mark_active(self, client: Gitpod) -> None: environment = client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: environment = client.environments.mark_active( @@ -400,6 +432,7 @@ def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_mark_active(self, client: Gitpod) -> None: response = client.environments.with_raw_response.mark_active() @@ -409,6 +442,7 @@ def test_raw_response_mark_active(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_mark_active(self, client: Gitpod) -> None: with client.environments.with_streaming_response.mark_active() as response: @@ -420,11 +454,13 @@ def test_streaming_response_mark_active(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_start(self, client: Gitpod) -> None: environment = client.environments.start() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( @@ -432,6 +468,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.with_raw_response.start() @@ -441,6 +478,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.with_streaming_response.start() as response: @@ -452,11 +490,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_stop(self, client: Gitpod) -> None: environment = client.environments.stop() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: environment = client.environments.stop( @@ -464,6 +504,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.with_raw_response.stop() @@ -473,6 +514,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.with_streaming_response.stop() as response: @@ -488,11 +530,13 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncEnvironments: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( @@ -545,6 +589,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create() @@ -554,6 +599,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create() as response: @@ -565,11 +611,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( @@ -577,6 +625,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.retrieve() @@ -586,6 +635,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.retrieve() as response: @@ -597,6 +647,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( @@ -604,6 +655,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( @@ -615,6 +667,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( @@ -628,6 +681,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( @@ -635,6 +689,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( @@ -646,6 +701,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( @@ -659,11 +715,13 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list() assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( @@ -684,6 +742,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.list() @@ -693,6 +752,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.list() as response: @@ -704,11 +764,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete( @@ -717,6 +779,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.delete() @@ -726,6 +789,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.delete() as response: @@ -737,11 +801,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( @@ -795,6 +861,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_from_project() @@ -804,6 +871,7 @@ async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) environment = await response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_from_project(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_from_project() as response: @@ -815,11 +883,13 @@ async def test_streaming_response_create_from_project(self, async_client: AsyncG assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token( @@ -827,6 +897,7 @@ async def test_method_create_logs_token_with_all_params(self, async_client: Asyn ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_logs_token() @@ -836,6 +907,7 @@ async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_logs_token() as response: @@ -847,11 +919,13 @@ async def test_streaming_response_create_logs_token(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active( @@ -863,6 +937,7 @@ async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.mark_active() @@ -872,6 +947,7 @@ async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.mark_active() as response: @@ -883,11 +959,13 @@ async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( @@ -895,6 +973,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.start() @@ -904,6 +983,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.start() as response: @@ -915,11 +995,13 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop( @@ -927,6 +1009,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.stop() @@ -936,6 +1019,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.stop() as response: diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 975597b5..b3fdfdd5 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -19,11 +19,13 @@ class TestEvents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: event = client.events.list() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: event = client.events.list( @@ -42,6 +44,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.events.with_raw_response.list() @@ -51,6 +54,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: event = response.parse() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.events.with_streaming_response.list() as response: @@ -134,11 +138,13 @@ def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: class TestAsyncEvents: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list( @@ -157,6 +163,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.list() @@ -166,6 +173,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: event = await response.parse() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index bf2e4b16..2d4abe98 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -18,11 +18,13 @@ class TestGroups: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: group = client.groups.list() assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: group = client.groups.list( @@ -35,6 +37,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.groups.with_raw_response.list() @@ -44,6 +47,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: group = response.parse() assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.groups.with_streaming_response.list() as response: @@ -59,11 +63,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncGroups: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list() assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list( @@ -76,6 +82,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.with_raw_response.list() @@ -85,6 +92,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: group = await response.parse() assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.groups.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index bdd08d3e..e5021da3 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -21,11 +21,13 @@ class TestIdentity: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_exchange_token(self, client: Gitpod) -> None: identity = client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.exchange_token( @@ -33,6 +35,7 @@ def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_exchange_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.exchange_token() @@ -42,6 +45,7 @@ def test_raw_response_exchange_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_exchange_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.exchange_token() as response: @@ -53,6 +57,7 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_authenticated_identity(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( @@ -60,6 +65,7 @@ def test_method_get_authenticated_identity(self, client: Gitpod) -> None: ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_authenticated_identity( @@ -71,6 +77,7 @@ def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_authenticated_identity( @@ -84,11 +91,13 @@ def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_id_token(self, client: Gitpod) -> None: identity = client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( @@ -96,6 +105,7 @@ def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_id_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_id_token() @@ -105,6 +115,7 @@ def test_raw_response_get_id_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_id_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_id_token() as response: @@ -120,11 +131,13 @@ def test_streaming_response_get_id_token(self, client: Gitpod) -> None: class TestAsyncIdentity: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token( @@ -132,6 +145,7 @@ async def test_method_exchange_token_with_all_params(self, async_client: AsyncGi ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.exchange_token() @@ -141,6 +155,7 @@ async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> N identity = await response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.exchange_token() as response: @@ -152,6 +167,7 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( @@ -159,6 +175,7 @@ async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_authenticated_identity( @@ -170,6 +187,7 @@ async def test_raw_response_get_authenticated_identity(self, async_client: Async identity = await response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_authenticated_identity( @@ -183,11 +201,13 @@ async def test_streaming_response_get_authenticated_identity(self, async_client: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( @@ -195,6 +215,7 @@ async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_id_token() @@ -204,6 +225,7 @@ async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> Non identity = await response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_id_token() as response: diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 3a017473..1c0c5afc 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -25,11 +25,13 @@ class TestOrganizations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: organization = client.organizations.create() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.create( @@ -39,6 +41,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.create() @@ -48,6 +51,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.create() as response: @@ -59,11 +63,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: organization = client.organizations.retrieve() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.retrieve( @@ -71,6 +77,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.retrieve() @@ -80,6 +87,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.retrieve() as response: @@ -91,6 +99,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -98,6 +107,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -105,6 +115,7 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( @@ -116,6 +127,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( @@ -129,6 +141,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -136,6 +149,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( @@ -147,6 +161,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( @@ -160,11 +175,13 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: organization = client.organizations.list() assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list( @@ -178,6 +195,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list() @@ -187,6 +205,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list() as response: @@ -198,11 +217,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: organization = client.organizations.delete() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.delete( @@ -210,6 +231,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.delete() @@ -219,6 +241,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.delete() as response: @@ -230,6 +253,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_join_overload_1(self, client: Gitpod) -> None: organization = client.organizations.join( @@ -237,6 +261,7 @@ def test_method_join_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_join_overload_1(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join( @@ -248,6 +273,7 @@ def test_raw_response_join_overload_1(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join( @@ -261,6 +287,7 @@ def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_join_overload_2(self, client: Gitpod) -> None: organization = client.organizations.join( @@ -268,6 +295,7 @@ def test_method_join_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_join_overload_2(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join( @@ -279,6 +307,7 @@ def test_raw_response_join_overload_2(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join( @@ -292,11 +321,13 @@ def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_leave(self, client: Gitpod) -> None: organization = client.organizations.leave() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_leave_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.leave( @@ -304,6 +335,7 @@ def test_method_leave_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.leave() @@ -313,6 +345,7 @@ def test_raw_response_leave(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.leave() as response: @@ -324,11 +357,13 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list_members(self, client: Gitpod) -> None: organization = client.organizations.list_members() assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( @@ -342,6 +377,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list_members() @@ -351,6 +387,7 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list_members() as response: @@ -362,11 +399,13 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_set_role(self, client: Gitpod) -> None: organization = client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( @@ -376,6 +415,7 @@ def test_method_set_role_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.set_role() @@ -385,6 +425,7 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.set_role() as response: @@ -400,11 +441,13 @@ def test_streaming_response_set_role(self, client: Gitpod) -> None: class TestAsyncOrganizations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( @@ -414,6 +457,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.create() @@ -423,6 +467,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.create() as response: @@ -434,11 +479,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( @@ -446,6 +493,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.retrieve() @@ -455,6 +503,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.retrieve() as response: @@ -466,6 +515,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -473,6 +523,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -480,6 +531,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( @@ -491,6 +543,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - organization = await response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( @@ -504,6 +557,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -511,6 +565,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( @@ -522,6 +577,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - organization = await response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( @@ -535,11 +591,13 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list() assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list( @@ -553,6 +611,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list() @@ -562,6 +621,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list() as response: @@ -573,11 +633,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete( @@ -585,6 +647,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.delete() @@ -594,6 +657,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.delete() as response: @@ -605,6 +669,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_join_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( @@ -612,6 +677,7 @@ async def test_method_join_overload_1(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join( @@ -623,6 +689,7 @@ async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> organization = await response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join( @@ -636,6 +703,7 @@ async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_join_overload_2(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( @@ -643,6 +711,7 @@ async def test_method_join_overload_2(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join( @@ -654,6 +723,7 @@ async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> organization = await response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join( @@ -667,11 +737,13 @@ async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( @@ -679,6 +751,7 @@ async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.leave() @@ -688,6 +761,7 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.leave() as response: @@ -699,11 +773,13 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members() assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( @@ -717,6 +793,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list_members() @@ -726,6 +803,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non organization = await response.parse() assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list_members() as response: @@ -737,11 +815,13 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( @@ -751,6 +831,7 @@ async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.set_role() @@ -760,6 +841,7 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.set_role() as response: diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index ea12d993..754f4395 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -24,6 +24,7 @@ class TestProjects: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( @@ -32,6 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( @@ -43,6 +45,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( @@ -55,6 +58,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( @@ -69,11 +73,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: project = client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( @@ -81,6 +87,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.projects.with_raw_response.retrieve() @@ -90,6 +97,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.projects.with_streaming_response.retrieve() as response: @@ -101,6 +109,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: project = client.projects.update( @@ -108,6 +117,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -119,6 +129,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -132,6 +143,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: project = client.projects.update( @@ -139,6 +151,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -150,6 +163,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -163,6 +177,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: project = client.projects.update( @@ -170,6 +185,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -181,6 +197,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -194,6 +211,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_4(self, client: Gitpod) -> None: project = client.projects.update( @@ -201,6 +219,7 @@ def test_method_update_overload_4(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: project = client.projects.update( @@ -208,6 +227,7 @@ def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_4(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -219,6 +239,7 @@ def test_raw_response_update_overload_4(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -232,6 +253,7 @@ def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_5(self, client: Gitpod) -> None: project = client.projects.update( @@ -239,6 +261,7 @@ def test_method_update_overload_5(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -250,6 +273,7 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -263,11 +287,13 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: project = client.projects.list() assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: project = client.projects.list( @@ -280,6 +306,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.with_raw_response.list() @@ -289,6 +316,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.with_streaming_response.list() as response: @@ -300,11 +328,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: project = client.projects.delete() assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: project = client.projects.delete( @@ -312,6 +342,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.with_raw_response.delete() @@ -321,6 +352,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.with_streaming_response.delete() as response: @@ -332,11 +364,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: project = client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( @@ -345,6 +379,7 @@ def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_from_environment(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create_from_environment() @@ -354,6 +389,7 @@ def test_raw_response_create_from_environment(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_from_environment(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create_from_environment() as response: @@ -369,6 +405,7 @@ def test_streaming_response_create_from_environment(self, client: Gitpod) -> Non class TestAsyncProjects: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -377,6 +414,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -388,6 +426,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( @@ -400,6 +439,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create( @@ -414,11 +454,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( @@ -426,6 +468,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.retrieve() @@ -435,6 +478,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.retrieve() as response: @@ -446,6 +490,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -453,6 +498,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -464,6 +510,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -477,6 +524,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -484,6 +532,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -495,6 +544,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -508,6 +558,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -515,6 +566,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -526,6 +578,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -539,6 +592,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -546,6 +600,7 @@ async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -553,6 +608,7 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -564,6 +620,7 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -577,6 +634,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -584,6 +642,7 @@ async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -595,6 +654,7 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -608,11 +668,13 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list() assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list( @@ -625,6 +687,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.list() @@ -634,6 +697,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.list() as response: @@ -645,11 +709,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete() assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete( @@ -657,6 +723,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.delete() @@ -666,6 +733,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.delete() as response: @@ -677,11 +745,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( @@ -690,6 +760,7 @@ async def test_method_create_from_environment_with_all_params(self, async_client ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_from_environment(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create_from_environment() @@ -699,6 +770,7 @@ async def test_raw_response_create_from_environment(self, async_client: AsyncGit project = await response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_from_environment(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create_from_environment() as response: diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index cf3bc974..6c510f24 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -25,11 +25,13 @@ class TestRunners: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: runner = client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( @@ -47,6 +49,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create() @@ -56,6 +59,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create() as response: @@ -67,11 +71,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: runner = client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( @@ -79,6 +85,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.with_raw_response.retrieve() @@ -88,6 +95,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.with_streaming_response.retrieve() as response: @@ -99,6 +107,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: runner = client.runners.update( @@ -106,6 +115,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( @@ -117,6 +127,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( @@ -130,6 +141,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: runner = client.runners.update( @@ -137,6 +149,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( @@ -148,6 +161,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( @@ -161,11 +175,13 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: runner = client.runners.list() assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list( @@ -183,6 +199,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.with_raw_response.list() @@ -192,6 +209,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.with_streaming_response.list() as response: @@ -203,11 +221,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: runner = client.runners.delete() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete( @@ -216,6 +236,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.with_raw_response.delete() @@ -225,6 +246,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.with_streaming_response.delete() as response: @@ -236,11 +258,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_check_authentication_for_host(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( @@ -249,6 +273,7 @@ def test_method_check_authentication_for_host_with_all_params(self, client: Gitp ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: response = client.runners.with_raw_response.check_authentication_for_host() @@ -258,6 +283,7 @@ def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> Non runner = response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: with client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -269,11 +295,13 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: runner = client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( @@ -281,6 +309,7 @@ def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_runner_token(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create_runner_token() @@ -290,6 +319,7 @@ def test_raw_response_create_runner_token(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create_runner_token() as response: @@ -301,11 +331,13 @@ def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_parse_context_url(self, client: Gitpod) -> None: runner = client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( @@ -314,6 +346,7 @@ def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_parse_context_url(self, client: Gitpod) -> None: response = client.runners.with_raw_response.parse_context_url() @@ -323,6 +356,7 @@ def test_raw_response_parse_context_url(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: with client.runners.with_streaming_response.parse_context_url() as response: @@ -338,11 +372,13 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: class TestAsyncRunners: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( @@ -360,6 +396,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create() @@ -369,6 +406,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create() as response: @@ -380,11 +418,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( @@ -392,6 +432,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.retrieve() @@ -401,6 +442,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.retrieve() as response: @@ -412,6 +454,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( @@ -419,6 +462,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( @@ -430,6 +474,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( @@ -443,6 +488,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( @@ -450,6 +496,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( @@ -461,6 +508,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( @@ -474,11 +522,13 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list() assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( @@ -496,6 +546,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.list() @@ -505,6 +556,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.list() as response: @@ -516,11 +568,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete( @@ -529,6 +583,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.delete() @@ -538,6 +593,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.delete() as response: @@ -549,11 +605,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( @@ -562,6 +620,7 @@ async def test_method_check_authentication_for_host_with_all_params(self, async_ ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.check_authentication_for_host() @@ -571,6 +630,7 @@ async def test_raw_response_check_authentication_for_host(self, async_client: As runner = await response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -582,11 +642,13 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( @@ -594,6 +656,7 @@ async def test_method_create_runner_token_with_all_params(self, async_client: As ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create_runner_token() @@ -603,6 +666,7 @@ async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) runner = await response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create_runner_token() as response: @@ -614,11 +678,13 @@ async def test_streaming_response_create_runner_token(self, async_client: AsyncG assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( @@ -627,6 +693,7 @@ async def test_method_parse_context_url_with_all_params(self, async_client: Asyn ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.parse_context_url() @@ -636,6 +703,7 @@ async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.parse_context_url() as response: diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 2ffe8167..07fd383f 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -22,6 +22,7 @@ class TestSecrets: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -29,6 +30,7 @@ def test_method_create_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -39,6 +41,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create( @@ -50,6 +53,7 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create( @@ -63,6 +67,7 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -70,6 +75,7 @@ def test_method_create_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -80,6 +86,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create( @@ -91,6 +98,7 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create( @@ -104,11 +112,13 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: secret = client.secrets.list() assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.list( @@ -122,6 +132,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.list() @@ -131,6 +142,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.list() as response: @@ -142,11 +154,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: secret = client.secrets.delete() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.delete( @@ -154,6 +168,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.delete() @@ -163,6 +178,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.delete() as response: @@ -174,11 +190,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_value(self, client: Gitpod) -> None: secret = client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.get_value( @@ -186,6 +204,7 @@ def test_method_get_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.get_value() @@ -195,6 +214,7 @@ def test_raw_response_get_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.get_value() as response: @@ -206,11 +226,13 @@ def test_streaming_response_get_value(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_value(self, client: Gitpod) -> None: secret = client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.update_value( @@ -219,6 +241,7 @@ def test_method_update_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.update_value() @@ -228,6 +251,7 @@ def test_raw_response_update_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.update_value() as response: @@ -243,6 +267,7 @@ def test_streaming_response_update_value(self, client: Gitpod) -> None: class TestAsyncSecrets: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -250,6 +275,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -260,6 +286,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create( @@ -271,6 +298,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - secret = await response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create( @@ -284,6 +312,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -291,6 +320,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -301,6 +331,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create( @@ -312,6 +343,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - secret = await response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create( @@ -325,11 +357,13 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list() assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list( @@ -343,6 +377,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.list() @@ -352,6 +387,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.list() as response: @@ -363,11 +399,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete( @@ -375,6 +413,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.delete() @@ -384,6 +423,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.delete() as response: @@ -395,11 +435,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value( @@ -407,6 +449,7 @@ async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.get_value() @@ -416,6 +459,7 @@ async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.get_value() as response: @@ -427,11 +471,13 @@ async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value( @@ -440,6 +486,7 @@ async def test_method_update_value_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.update_value() @@ -449,6 +496,7 @@ async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> Non secret = await response.parse() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.update_value() as response: diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index a358d838..cd94f2b4 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -17,6 +17,7 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_get_authenticated_user(self, client: Gitpod) -> None: user = client.users.get_authenticated_user( @@ -24,6 +25,7 @@ def test_method_get_authenticated_user(self, client: Gitpod) -> None: ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: response = client.users.with_raw_response.get_authenticated_user( @@ -35,6 +37,7 @@ def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None: with client.users.with_streaming_response.get_authenticated_user( @@ -48,11 +51,13 @@ def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_set_suspended(self, client: Gitpod) -> None: user = client.users.set_suspended() assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: user = client.users.set_suspended( @@ -61,6 +66,7 @@ def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_set_suspended(self, client: Gitpod) -> None: response = client.users.with_raw_response.set_suspended() @@ -70,6 +76,7 @@ def test_raw_response_set_suspended(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_set_suspended(self, client: Gitpod) -> None: with client.users.with_streaming_response.set_suspended() as response: @@ -85,6 +92,7 @@ def test_streaming_response_set_suspended(self, client: Gitpod) -> None: class TestAsyncUsers: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user( @@ -92,6 +100,7 @@ async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.get_authenticated_user( @@ -103,6 +112,7 @@ async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitp user = await response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.get_authenticated_user( @@ -116,11 +126,13 @@ async def test_streaming_response_get_authenticated_user(self, async_client: Asy assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended() assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_set_suspended_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended( @@ -129,6 +141,7 @@ async def test_method_set_suspended_with_all_params(self, async_client: AsyncGit ) assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.set_suspended() @@ -138,6 +151,7 @@ async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> No user = await response.parse() assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_set_suspended(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.set_suspended() as response: diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index c0fa515b..d20704e8 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -18,11 +18,13 @@ class TestPats: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: pat = client.users.pats.list() assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.list( @@ -36,6 +38,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.list() @@ -45,6 +48,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.list() as response: @@ -56,11 +60,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: pat = client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.delete( @@ -68,6 +74,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.delete() @@ -77,6 +84,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.delete() as response: @@ -88,11 +96,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get(self, client: Gitpod) -> None: pat = client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.get( @@ -100,6 +110,7 @@ def test_method_get_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.get() @@ -109,6 +120,7 @@ def test_raw_response_get(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.get() as response: @@ -124,11 +136,13 @@ def test_streaming_response_get(self, client: Gitpod) -> None: class TestAsyncPats: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list() assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list( @@ -142,6 +156,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.list() @@ -151,6 +166,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.list() as response: @@ -162,11 +178,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete( @@ -174,6 +192,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.delete() @@ -183,6 +202,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.delete() as response: @@ -194,11 +214,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get( @@ -206,6 +228,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> No ) assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.get() @@ -215,6 +238,7 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.get() as response: From edefa462122d1f5a0d8a5b38b82270a92e9ec7f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 19:16:35 +0000 Subject: [PATCH 077/505] feat(api): properly produce empty request bodies (#4) --- .stats.yml | 2 +- src/gitpod/resources/accounts.py | 8 +- src/gitpod/resources/identity.py | 8 +- src/gitpod/resources/users/users.py | 10 ++- src/gitpod/types/account_retrieve_params.py | 4 +- ...ntity_get_authenticated_identity_params.py | 4 +- .../user_get_authenticated_user_params.py | 4 +- .../automations/tasks/test_executions.py | 24 ------ .../environments/automations/test_services.py | 56 ------------- .../environments/automations/test_tasks.py | 48 ----------- .../environments/test_automations.py | 8 -- .../environments/test_classes.py | 8 -- .../organizations/test_invites.py | 24 ------ .../organizations/test_sso_configurations.py | 62 -------------- tests/api_resources/projects/test_policies.py | 32 ------- .../test_environment_classes.py | 42 ---------- .../test_host_authentication_tokens.py | 50 ----------- .../runners/configurations/test_schema.py | 8 -- .../configurations/test_scm_integrations.py | 54 ------------ .../runners/test_configurations.py | 16 ---- tests/api_resources/runners/test_policies.py | 32 ------- tests/api_resources/test_accounts.py | 60 ++++--------- tests/api_resources/test_editors.py | 24 ------ tests/api_resources/test_environments.py | 84 ------------------- tests/api_resources/test_events.py | 8 -- tests/api_resources/test_groups.py | 8 -- tests/api_resources/test_identity.py | 52 ++++-------- tests/api_resources/test_organizations.py | 82 ------------------ tests/api_resources/test_projects.py | 72 ---------------- tests/api_resources/test_runners.py | 68 --------------- tests/api_resources/test_secrets.py | 48 ----------- tests/api_resources/test_users.py | 44 ++++------ tests/api_resources/users/test_pats.py | 24 ------ 33 files changed, 69 insertions(+), 1009 deletions(-) diff --git a/.stats.yml b/.stats.yml index 54b5007f..a1528690 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-63491b1baa3dbc60caaec79becdece3854356b354909e4bb3f1ccaab80a6be20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e2df4ddd41d8f2552c00f0f93c8b655c7bfb039bd62e654dd7ace9cdd8f9a9f.yml diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 5035b3a5..71a9da1e 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -55,7 +55,7 @@ def with_streaming_response(self) -> AccountsResourceWithStreamingResponse: def retrieve( self, *, - body: object, + empty: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,7 +77,7 @@ def retrieve( """ return self._post( "/gitpod.v1.AccountService/GetAccount", - body=maybe_transform(body, account_retrieve_params.AccountRetrieveParams), + body=maybe_transform({"empty": empty}, account_retrieve_params.AccountRetrieveParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -243,7 +243,7 @@ def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse: async def retrieve( self, *, - body: object, + empty: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -265,7 +265,7 @@ async def retrieve( """ return await self._post( "/gitpod.v1.AccountService/GetAccount", - body=await async_maybe_transform(body, account_retrieve_params.AccountRetrieveParams), + body=await async_maybe_transform({"empty": empty}, account_retrieve_params.AccountRetrieveParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 07b9632e..f5b4f0d5 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -91,7 +91,7 @@ def exchange_token( def get_authenticated_identity( self, *, - body: object, + empty: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -114,7 +114,7 @@ def get_authenticated_identity( return self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=maybe_transform( - body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams + {"empty": empty}, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -215,7 +215,7 @@ async def exchange_token( async def get_authenticated_identity( self, *, - body: object, + empty: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -238,7 +238,7 @@ async def get_authenticated_identity( return await self._post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=await async_maybe_transform( - body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams + {"empty": empty}, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index e6f29697..f9294b70 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -59,7 +59,7 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: def get_authenticated_user( self, *, - body: object, + empty: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -81,7 +81,7 @@ def get_authenticated_user( """ return self._post( "/gitpod.v1.UserService/GetAuthenticatedUser", - body=maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams), + body=maybe_transform({"empty": empty}, user_get_authenticated_user_params.UserGetAuthenticatedUserParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -155,7 +155,7 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: async def get_authenticated_user( self, *, - body: object, + empty: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -177,7 +177,9 @@ async def get_authenticated_user( """ return await self._post( "/gitpod.v1.UserService/GetAuthenticatedUser", - body=await async_maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams), + body=await async_maybe_transform( + {"empty": empty}, user_get_authenticated_user_params.UserGetAuthenticatedUserParams + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/types/account_retrieve_params.py b/src/gitpod/types/account_retrieve_params.py index ad9497e8..68642eb9 100644 --- a/src/gitpod/types/account_retrieve_params.py +++ b/src/gitpod/types/account_retrieve_params.py @@ -2,10 +2,10 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["AccountRetrieveParams"] class AccountRetrieveParams(TypedDict, total=False): - body: Required[object] + empty: bool diff --git a/src/gitpod/types/identity_get_authenticated_identity_params.py b/src/gitpod/types/identity_get_authenticated_identity_params.py index 43dd9519..2ed3b1f1 100644 --- a/src/gitpod/types/identity_get_authenticated_identity_params.py +++ b/src/gitpod/types/identity_get_authenticated_identity_params.py @@ -2,10 +2,10 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["IdentityGetAuthenticatedIdentityParams"] class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False): - body: Required[object] + empty: bool diff --git a/src/gitpod/types/user_get_authenticated_user_params.py b/src/gitpod/types/user_get_authenticated_user_params.py index 0f1f105f..2b65cbbf 100644 --- a/src/gitpod/types/user_get_authenticated_user_params.py +++ b/src/gitpod/types/user_get_authenticated_user_params.py @@ -2,10 +2,10 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["UserGetAuthenticatedUserParams"] class UserGetAuthenticatedUserParams(TypedDict, total=False): - body: Required[object] + empty: bool diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index 136a0117..43dc6d00 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -21,13 +21,11 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve( @@ -35,7 +33,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -45,7 +42,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.retrieve() as response: @@ -57,13 +53,11 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list() assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list( @@ -82,7 +76,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.list() @@ -92,7 +85,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -104,13 +96,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_stop(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop( @@ -118,7 +108,6 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.stop() @@ -128,7 +117,6 @@ def test_raw_response_stop(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.stop() as response: @@ -144,13 +132,11 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve( @@ -158,7 +144,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -168,7 +153,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -182,13 +166,11 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list() assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list( @@ -207,7 +189,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.list() @@ -217,7 +198,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -229,13 +209,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop( @@ -243,7 +221,6 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.stop() @@ -253,7 +230,6 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index f6a1893c..40f9a7bd 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -23,13 +23,11 @@ class TestServices: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: service = client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.create( @@ -64,7 +62,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.create() @@ -74,7 +71,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.create() as response: @@ -86,13 +82,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve( @@ -100,7 +94,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.retrieve() @@ -110,7 +103,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -122,13 +114,11 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: service = client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( @@ -139,7 +129,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.update() @@ -149,7 +138,6 @@ def test_raw_response_update(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.update() as response: @@ -161,13 +149,11 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: service = client.environments.automations.services.list() assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.list( @@ -185,7 +171,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.list() @@ -195,7 +180,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.list() as response: @@ -207,13 +191,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: service = client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.delete( @@ -222,7 +204,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.delete() @@ -232,7 +213,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.delete() as response: @@ -244,13 +224,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_start(self, client: Gitpod) -> None: service = client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.start( @@ -258,7 +236,6 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.start() @@ -268,7 +245,6 @@ def test_raw_response_start(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.start() as response: @@ -280,13 +256,11 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_stop(self, client: Gitpod) -> None: service = client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.stop( @@ -294,7 +268,6 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.stop() @@ -304,7 +277,6 @@ def test_raw_response_stop(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.stop() as response: @@ -320,13 +292,11 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncServices: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create( @@ -361,7 +331,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.create() @@ -371,7 +340,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.create() as response: @@ -383,13 +351,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve( @@ -397,7 +363,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.retrieve() @@ -407,7 +372,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -419,13 +383,11 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( @@ -436,7 +398,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.update() @@ -446,7 +407,6 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.update() as response: @@ -458,13 +418,11 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list() assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( @@ -482,7 +440,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.list() @@ -492,7 +449,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.list() as response: @@ -504,13 +460,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete( @@ -519,7 +473,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.delete() @@ -529,7 +482,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.delete() as response: @@ -541,13 +493,11 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start( @@ -555,7 +505,6 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.start() @@ -565,7 +514,6 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.start() as response: @@ -577,13 +525,11 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop( @@ -591,7 +537,6 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.stop() @@ -601,7 +546,6 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 381d28f5..3138f430 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -24,13 +24,11 @@ class TestTasks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create( @@ -59,7 +57,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.create() @@ -69,7 +66,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.create() as response: @@ -81,13 +77,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( @@ -95,7 +89,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.retrieve() @@ -105,7 +98,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -117,13 +109,11 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( @@ -134,7 +124,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.update() @@ -144,7 +133,6 @@ def test_raw_response_update(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.update() as response: @@ -156,13 +144,11 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list() assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( @@ -180,7 +166,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.list() @@ -190,7 +175,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.list() as response: @@ -202,13 +186,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete( @@ -216,7 +198,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.delete() @@ -226,7 +207,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -238,13 +218,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_start(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start( @@ -252,7 +230,6 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.start() @@ -262,7 +239,6 @@ def test_raw_response_start(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.start() as response: @@ -278,13 +254,11 @@ def test_streaming_response_start(self, client: Gitpod) -> None: class TestAsyncTasks: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create( @@ -313,7 +287,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.create() @@ -323,7 +296,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.create() as response: @@ -335,13 +307,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( @@ -349,7 +319,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.retrieve() @@ -359,7 +328,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -371,13 +339,11 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( @@ -388,7 +354,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.update() @@ -398,7 +363,6 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.update() as response: @@ -410,13 +374,11 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list() assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( @@ -434,7 +396,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.list() @@ -444,7 +405,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.list() as response: @@ -456,13 +416,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete( @@ -470,7 +428,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.delete() @@ -480,7 +437,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -492,13 +448,11 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start( @@ -506,7 +460,6 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.start() @@ -516,7 +469,6 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.start() as response: diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index e4c8ffdb..5b0f7c20 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -17,13 +17,11 @@ class TestAutomations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_upsert(self, client: Gitpod) -> None: automation = client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_upsert_with_all_params(self, client: Gitpod) -> None: automation = client.environments.automations.upsert( @@ -66,7 +64,6 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_upsert(self, client: Gitpod) -> None: response = client.environments.automations.with_raw_response.upsert() @@ -76,7 +73,6 @@ def test_raw_response_upsert(self, client: Gitpod) -> None: automation = response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_upsert(self, client: Gitpod) -> None: with client.environments.automations.with_streaming_response.upsert() as response: @@ -92,13 +88,11 @@ def test_streaming_response_upsert(self, client: Gitpod) -> None: class TestAsyncAutomations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_upsert(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert( @@ -141,7 +135,6 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.with_raw_response.upsert() @@ -151,7 +144,6 @@ async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: automation = await response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.with_streaming_response.upsert() as response: diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index 3b525f3e..7ef88fab 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -18,13 +18,11 @@ class TestClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: class_ = client.environments.classes.list() assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: class_ = client.environments.classes.list( @@ -38,7 +36,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.classes.with_raw_response.list() @@ -48,7 +45,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: class_ = response.parse() assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.classes.with_streaming_response.list() as response: @@ -64,13 +60,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncClasses: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list() assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list( @@ -84,7 +78,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.classes.with_raw_response.list() @@ -94,7 +87,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: class_ = await response.parse() assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index b158bc41..0f80a2a1 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -21,13 +21,11 @@ class TestInvites: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: invite = client.organizations.invites.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.create( @@ -35,7 +33,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.create() @@ -45,7 +42,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.create() as response: @@ -57,13 +53,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve( @@ -71,7 +65,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.retrieve() @@ -81,7 +74,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.retrieve() as response: @@ -93,13 +85,11 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_get_summary(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( @@ -107,7 +97,6 @@ def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_get_summary(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.get_summary() @@ -117,7 +106,6 @@ def test_raw_response_get_summary(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_get_summary(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.get_summary() as response: @@ -133,13 +121,11 @@ def test_streaming_response_get_summary(self, client: Gitpod) -> None: class TestAsyncInvites: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create( @@ -147,7 +133,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.create() @@ -157,7 +142,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.create() as response: @@ -169,13 +153,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve( @@ -183,7 +165,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.retrieve() @@ -193,7 +174,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.retrieve() as response: @@ -205,13 +185,11 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( @@ -219,7 +197,6 @@ async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.get_summary() @@ -229,7 +206,6 @@ async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None invite = await response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.get_summary() as response: diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 04d19db3..e23cf090 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -22,13 +22,11 @@ class TestSSOConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( @@ -40,7 +38,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.create() @@ -50,7 +47,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.create() as response: @@ -62,13 +58,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( @@ -76,7 +70,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.retrieve() @@ -86,7 +79,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.retrieve() as response: @@ -98,7 +90,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -106,7 +97,6 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -118,7 +108,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -132,7 +121,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -140,7 +128,6 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -152,7 +139,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -166,7 +152,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -174,7 +159,6 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -186,7 +170,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -200,7 +183,6 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_4(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -208,7 +190,6 @@ def test_method_update_overload_4(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_4(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -220,7 +201,6 @@ def test_raw_response_update_overload_4(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -234,7 +214,6 @@ def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_5(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -242,7 +221,6 @@ def test_method_update_overload_5(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -254,7 +232,6 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -268,7 +245,6 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list() @@ -276,7 +252,6 @@ def test_method_list(self, client: Gitpod) -> None: SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( @@ -292,7 +267,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.list() @@ -304,7 +278,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.list() as response: @@ -318,13 +291,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete( @@ -332,7 +303,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.delete() @@ -342,7 +312,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.delete() as response: @@ -358,13 +327,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncSSOConfigurations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( @@ -376,7 +343,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.create() @@ -386,7 +352,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.create() as response: @@ -398,13 +363,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( @@ -412,7 +375,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.retrieve() @@ -422,7 +384,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.retrieve() as response: @@ -434,7 +395,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -442,7 +402,6 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -454,7 +413,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -468,7 +426,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -476,7 +433,6 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -488,7 +444,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -502,7 +457,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -510,7 +464,6 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -522,7 +475,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -536,7 +488,6 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -544,7 +495,6 @@ async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -556,7 +506,6 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -570,7 +519,6 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -578,7 +526,6 @@ async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -590,7 +537,6 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -604,7 +550,6 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list() @@ -612,7 +557,6 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( @@ -628,7 +572,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.list() @@ -640,7 +583,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.list() as response: @@ -654,13 +596,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete( @@ -668,7 +608,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.delete() @@ -678,7 +617,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.delete() as response: diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index c066dcbb..84f3f9a4 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -22,13 +22,11 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( @@ -38,7 +36,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.create() @@ -48,7 +45,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.create() as response: @@ -60,13 +56,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( @@ -76,7 +70,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.update() @@ -86,7 +79,6 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.update() as response: @@ -98,13 +90,11 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.projects.policies.list() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.list( @@ -118,7 +108,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.list() @@ -128,7 +117,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.list() as response: @@ -140,13 +128,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.delete( @@ -155,7 +141,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.delete() @@ -165,7 +150,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.delete() as response: @@ -181,13 +165,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncPolicies: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create( @@ -197,7 +179,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.create() @@ -207,7 +188,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.create() as response: @@ -219,13 +199,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update( @@ -235,7 +213,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.update() @@ -245,7 +222,6 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.update() as response: @@ -257,13 +233,11 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list( @@ -277,7 +251,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.list() @@ -287,7 +260,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.list() as response: @@ -299,13 +271,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete( @@ -314,7 +284,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.delete() @@ -324,7 +293,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index d08bb882..50c85989 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -22,13 +22,11 @@ class TestEnvironmentClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create( @@ -44,7 +42,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.create() @@ -54,7 +51,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -66,13 +62,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( @@ -80,7 +74,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -90,7 +83,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.retrieve() as response: @@ -102,7 +94,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -110,7 +101,6 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( @@ -122,7 +112,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( @@ -136,7 +125,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -144,7 +132,6 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( @@ -156,7 +143,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( @@ -170,7 +156,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -178,7 +163,6 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( @@ -190,7 +174,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( @@ -204,7 +187,6 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list() @@ -212,7 +194,6 @@ def test_method_list(self, client: Gitpod) -> None: SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list( @@ -228,7 +209,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.list() @@ -240,7 +220,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.list() as response: @@ -258,13 +237,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncEnvironmentClasses: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create( @@ -280,7 +257,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.create() @@ -290,7 +266,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -302,13 +277,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( @@ -316,7 +289,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -326,7 +298,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -340,7 +311,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -348,7 +318,6 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( @@ -360,7 +329,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( @@ -374,7 +342,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -382,7 +349,6 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( @@ -394,7 +360,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( @@ -408,7 +373,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -416,7 +380,6 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( @@ -428,7 +391,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( @@ -442,7 +404,6 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list() @@ -450,7 +411,6 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list( @@ -466,7 +426,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.list() @@ -478,7 +437,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 1520b2ae..6e1752bf 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -23,13 +23,11 @@ class TestHostAuthenticationTokens: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create( @@ -43,7 +41,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -53,7 +50,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.create() as response: @@ -65,13 +61,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( @@ -79,7 +73,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -89,7 +82,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: @@ -101,7 +93,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -109,7 +100,6 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -121,7 +111,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -135,7 +124,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -143,7 +131,6 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -155,7 +142,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -169,7 +155,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -177,7 +162,6 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -189,7 +173,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -203,7 +186,6 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list() @@ -211,7 +193,6 @@ def test_method_list(self, client: Gitpod) -> None: SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list( @@ -227,7 +208,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -239,7 +219,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.list() as response: @@ -253,13 +232,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( @@ -267,7 +244,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -277,7 +253,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.delete() as response: @@ -293,13 +268,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncHostAuthenticationTokens: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( @@ -313,7 +286,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -323,7 +295,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with ( @@ -337,13 +308,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( @@ -351,7 +320,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -361,7 +329,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -375,7 +342,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -383,7 +349,6 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -395,7 +360,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -409,7 +373,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -417,7 +380,6 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -429,7 +391,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -443,7 +404,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -451,7 +411,6 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -463,7 +422,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -477,7 +435,6 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list() @@ -485,7 +442,6 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( @@ -501,7 +457,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -513,7 +468,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with ( @@ -529,13 +483,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( @@ -543,7 +495,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -553,7 +504,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with ( diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index 3fce8e32..47601189 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -17,13 +17,11 @@ class TestSchema: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( @@ -31,7 +29,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.schema.with_raw_response.retrieve() @@ -41,7 +38,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: schema = response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.schema.with_streaming_response.retrieve() as response: @@ -57,13 +53,11 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: class TestAsyncSchema: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( @@ -71,7 +65,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.schema.with_raw_response.retrieve() @@ -81,7 +74,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: schema = await response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.schema.with_streaming_response.retrieve() as response: diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index e827e39b..4f404eaa 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -22,7 +22,6 @@ class TestScmIntegrations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( @@ -30,7 +29,6 @@ def test_method_create_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( @@ -42,7 +40,6 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -56,7 +53,6 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_create_overload_2(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( @@ -64,7 +60,6 @@ def test_method_create_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( @@ -76,7 +71,6 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -90,13 +84,11 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( @@ -104,7 +96,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -114,7 +105,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -126,7 +116,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -134,7 +123,6 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( @@ -146,7 +134,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -160,7 +147,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -168,7 +154,6 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( @@ -180,7 +165,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -194,7 +178,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -202,7 +185,6 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( @@ -214,7 +196,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -228,13 +209,11 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list() assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list( @@ -248,7 +227,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.list() @@ -258,7 +236,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -270,13 +247,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete( @@ -284,7 +259,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -294,7 +268,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: @@ -310,7 +283,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncScmIntegrations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( @@ -318,7 +290,6 @@ async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( @@ -330,7 +301,6 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -344,7 +314,6 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( @@ -352,7 +321,6 @@ async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( @@ -364,7 +332,6 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -378,13 +345,11 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( @@ -392,7 +357,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -402,7 +366,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -414,7 +377,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -422,7 +384,6 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( @@ -434,7 +395,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -448,7 +408,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -456,7 +415,6 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( @@ -468,7 +426,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -482,7 +439,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -490,7 +446,6 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( @@ -502,7 +457,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -516,13 +470,11 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list() assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list( @@ -536,7 +488,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.list() @@ -546,7 +497,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -558,13 +508,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete( @@ -572,7 +520,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -582,7 +529,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 833058db..b64232aa 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -17,7 +17,6 @@ class TestConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_validate_overload_1(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -25,7 +24,6 @@ def test_method_validate_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -46,7 +44,6 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( @@ -58,7 +55,6 @@ def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: configuration = response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( @@ -72,7 +68,6 @@ def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_validate_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -80,7 +75,6 @@ def test_method_validate_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -89,7 +83,6 @@ def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> Non ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( @@ -101,7 +94,6 @@ def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: configuration = response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( @@ -119,7 +111,6 @@ def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: class TestAsyncConfigurations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -127,7 +118,6 @@ async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> No ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_validate_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -148,7 +138,6 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( @@ -160,7 +149,6 @@ async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) configuration = await response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( @@ -174,7 +162,6 @@ async def test_streaming_response_validate_overload_1(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -182,7 +169,6 @@ async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> No ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -191,7 +177,6 @@ async def test_method_validate_with_all_params_overload_2(self, async_client: As ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( @@ -203,7 +188,6 @@ async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) configuration = await response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index bd75557f..11a2f953 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -22,13 +22,11 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( @@ -38,7 +36,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.create() @@ -48,7 +45,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.create() as response: @@ -60,13 +56,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( @@ -76,7 +70,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.update() @@ -86,7 +79,6 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.update() as response: @@ -98,13 +90,11 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.runners.policies.list() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.list( @@ -118,7 +108,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.list() @@ -128,7 +117,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.list() as response: @@ -140,13 +128,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.delete( @@ -155,7 +141,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.delete() @@ -165,7 +150,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.delete() as response: @@ -181,13 +165,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncPolicies: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( @@ -197,7 +179,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.create() @@ -207,7 +188,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.create() as response: @@ -219,13 +199,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( @@ -235,7 +213,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.update() @@ -245,7 +222,6 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.update() as response: @@ -257,13 +233,11 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( @@ -277,7 +251,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.list() @@ -287,7 +260,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.list() as response: @@ -299,13 +271,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete( @@ -314,7 +284,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.delete() @@ -324,7 +293,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index ab0d94f9..485ed4f0 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -22,32 +22,30 @@ class TestAccounts: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: + account = client.accounts.retrieve() + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: account = client.accounts.retrieve( - body={}, + empty=True, ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.accounts.with_raw_response.retrieve( - body={}, - ) + response = client.accounts.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.accounts.with_streaming_response.retrieve( - body={}, - ) as response: + with client.accounts.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -56,13 +54,11 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: account = client.accounts.delete() assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: account = client.accounts.delete( @@ -70,7 +66,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.delete() @@ -80,7 +75,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.delete() as response: @@ -92,7 +86,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -100,7 +93,6 @@ def test_method_get_sso_login_url(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -109,7 +101,6 @@ def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.get_sso_login_url( @@ -121,7 +112,6 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.get_sso_login_url( @@ -135,13 +125,11 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: account = client.accounts.list_login_providers() assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> None: account = client.accounts.list_login_providers( @@ -155,7 +143,6 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No ) assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list_login_providers(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.list_login_providers() @@ -165,7 +152,6 @@ def test_raw_response_list_login_providers(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.list_login_providers() as response: @@ -181,32 +167,30 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: class TestAsyncAccounts: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.retrieve() + assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve( - body={}, + empty=True, ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.accounts.with_raw_response.retrieve( - body={}, - ) + response = await async_client.accounts.with_raw_response.retrieve() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.accounts.with_streaming_response.retrieve( - body={}, - ) as response: + async with async_client.accounts.with_streaming_response.retrieve() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -215,13 +199,11 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete() assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete( @@ -229,7 +211,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.delete() @@ -239,7 +220,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: account = await response.parse() assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.delete() as response: @@ -251,7 +231,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -259,7 +238,6 @@ async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -268,7 +246,6 @@ async def test_method_get_sso_login_url_with_all_params(self, async_client: Asyn ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.get_sso_login_url( @@ -280,7 +257,6 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - account = await response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.get_sso_login_url( @@ -294,13 +270,11 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers() assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_login_providers_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers( @@ -314,7 +288,6 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A ) assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.list_login_providers() @@ -324,7 +297,6 @@ async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod account = await response.parse() assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list_login_providers(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.list_login_providers() as response: diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index d3de3026..10f3a757 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -22,13 +22,11 @@ class TestEditors: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: editor = client.editors.retrieve() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: editor = client.editors.retrieve( @@ -36,7 +34,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.editors.with_raw_response.retrieve() @@ -46,7 +43,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.editors.with_streaming_response.retrieve() as response: @@ -58,13 +54,11 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: editor = client.editors.list() assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: editor = client.editors.list( @@ -77,7 +71,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.editors.with_raw_response.list() @@ -87,7 +80,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.editors.with_streaming_response.list() as response: @@ -99,13 +91,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_resolve_url(self, client: Gitpod) -> None: editor = client.editors.resolve_url() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: editor = client.editors.resolve_url( @@ -115,7 +105,6 @@ def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: response = client.editors.with_raw_response.resolve_url() @@ -125,7 +114,6 @@ def test_raw_response_resolve_url(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_resolve_url(self, client: Gitpod) -> None: with client.editors.with_streaming_response.resolve_url() as response: @@ -141,13 +129,11 @@ def test_streaming_response_resolve_url(self, client: Gitpod) -> None: class TestAsyncEditors: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( @@ -155,7 +141,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.retrieve() @@ -165,7 +150,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.retrieve() as response: @@ -177,13 +161,11 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list() assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list( @@ -196,7 +178,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.list() @@ -206,7 +187,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.list() as response: @@ -218,13 +198,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( @@ -234,7 +212,6 @@ async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.resolve_url() @@ -244,7 +221,6 @@ async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None editor = await response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.resolve_url() as response: diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 08dc4635..60087985 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -25,13 +25,11 @@ class TestEnvironments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: environment = client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( @@ -84,7 +82,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create() @@ -94,7 +91,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create() as response: @@ -106,13 +102,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment = client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment = client.environments.retrieve( @@ -120,7 +114,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.with_raw_response.retrieve() @@ -130,7 +123,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.with_streaming_response.retrieve() as response: @@ -142,7 +134,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: environment = client.environments.update( @@ -150,7 +141,6 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( @@ -162,7 +152,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( @@ -176,7 +165,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: environment = client.environments.update( @@ -184,7 +172,6 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( @@ -196,7 +183,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( @@ -210,13 +196,11 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: environment = client.environments.list() assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( @@ -237,7 +221,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.with_raw_response.list() @@ -247,7 +230,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.with_streaming_response.list() as response: @@ -259,13 +241,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: environment = client.environments.delete() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: environment = client.environments.delete( @@ -274,7 +254,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.with_raw_response.delete() @@ -284,7 +263,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.with_streaming_response.delete() as response: @@ -296,13 +274,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: environment = client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( @@ -356,7 +332,6 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create_from_project(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_from_project() @@ -366,7 +341,6 @@ def test_raw_response_create_from_project(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create_from_project(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_from_project() as response: @@ -378,13 +352,11 @@ def test_streaming_response_create_from_project(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_create_logs_token(self, client: Gitpod) -> None: environment = client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_logs_token( @@ -392,7 +364,6 @@ def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create_logs_token(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_logs_token() @@ -402,7 +373,6 @@ def test_raw_response_create_logs_token(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_logs_token() as response: @@ -414,13 +384,11 @@ def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_mark_active(self, client: Gitpod) -> None: environment = client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: environment = client.environments.mark_active( @@ -432,7 +400,6 @@ def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_mark_active(self, client: Gitpod) -> None: response = client.environments.with_raw_response.mark_active() @@ -442,7 +409,6 @@ def test_raw_response_mark_active(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_mark_active(self, client: Gitpod) -> None: with client.environments.with_streaming_response.mark_active() as response: @@ -454,13 +420,11 @@ def test_streaming_response_mark_active(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_start(self, client: Gitpod) -> None: environment = client.environments.start() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( @@ -468,7 +432,6 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.with_raw_response.start() @@ -478,7 +441,6 @@ def test_raw_response_start(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.with_streaming_response.start() as response: @@ -490,13 +452,11 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_stop(self, client: Gitpod) -> None: environment = client.environments.stop() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: environment = client.environments.stop( @@ -504,7 +464,6 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.with_raw_response.stop() @@ -514,7 +473,6 @@ def test_raw_response_stop(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.with_streaming_response.stop() as response: @@ -530,13 +488,11 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncEnvironments: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( @@ -589,7 +545,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create() @@ -599,7 +554,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create() as response: @@ -611,13 +565,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( @@ -625,7 +577,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.retrieve() @@ -635,7 +586,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.retrieve() as response: @@ -647,7 +597,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( @@ -655,7 +604,6 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( @@ -667,7 +615,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( @@ -681,7 +628,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( @@ -689,7 +635,6 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( @@ -701,7 +646,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( @@ -715,13 +659,11 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list() assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( @@ -742,7 +684,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.list() @@ -752,7 +693,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.list() as response: @@ -764,13 +704,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete( @@ -779,7 +717,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.delete() @@ -789,7 +726,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.delete() as response: @@ -801,13 +737,11 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( @@ -861,7 +795,6 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_from_project() @@ -871,7 +804,6 @@ async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) environment = await response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create_from_project(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_from_project() as response: @@ -883,13 +815,11 @@ async def test_streaming_response_create_from_project(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token( @@ -897,7 +827,6 @@ async def test_method_create_logs_token_with_all_params(self, async_client: Asyn ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_logs_token() @@ -907,7 +836,6 @@ async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_logs_token() as response: @@ -919,13 +847,11 @@ async def test_streaming_response_create_logs_token(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active( @@ -937,7 +863,6 @@ async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.mark_active() @@ -947,7 +872,6 @@ async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.mark_active() as response: @@ -959,13 +883,11 @@ async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( @@ -973,7 +895,6 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.start() @@ -983,7 +904,6 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.start() as response: @@ -995,13 +915,11 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop( @@ -1009,7 +927,6 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.stop() @@ -1019,7 +936,6 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.stop() as response: diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index b3fdfdd5..975597b5 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -19,13 +19,11 @@ class TestEvents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: event = client.events.list() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: event = client.events.list( @@ -44,7 +42,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.events.with_raw_response.list() @@ -54,7 +51,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: event = response.parse() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.events.with_streaming_response.list() as response: @@ -138,13 +134,11 @@ def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: class TestAsyncEvents: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list( @@ -163,7 +157,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.list() @@ -173,7 +166,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: event = await response.parse() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index 2d4abe98..bf2e4b16 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -18,13 +18,11 @@ class TestGroups: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: group = client.groups.list() assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: group = client.groups.list( @@ -37,7 +35,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.groups.with_raw_response.list() @@ -47,7 +44,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: group = response.parse() assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.groups.with_streaming_response.list() as response: @@ -63,13 +59,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncGroups: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list() assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list( @@ -82,7 +76,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.with_raw_response.list() @@ -92,7 +85,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: group = await response.parse() assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.groups.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index e5021da3..e17719de 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -21,13 +21,11 @@ class TestIdentity: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_exchange_token(self, client: Gitpod) -> None: identity = client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.exchange_token( @@ -35,7 +33,6 @@ def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_exchange_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.exchange_token() @@ -45,7 +42,6 @@ def test_raw_response_exchange_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_exchange_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.exchange_token() as response: @@ -57,32 +53,30 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_get_authenticated_identity(self, client: Gitpod) -> None: + identity = client.identity.get_authenticated_identity() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( - body={}, + empty=True, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: - response = client.identity.with_raw_response.get_authenticated_identity( - body={}, - ) + response = client.identity.with_raw_response.get_authenticated_identity() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity = response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: - with client.identity.with_streaming_response.get_authenticated_identity( - body={}, - ) as response: + with client.identity.with_streaming_response.get_authenticated_identity() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -91,13 +85,11 @@ def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_get_id_token(self, client: Gitpod) -> None: identity = client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( @@ -105,7 +97,6 @@ def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_get_id_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_id_token() @@ -115,7 +106,6 @@ def test_raw_response_get_id_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_get_id_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_id_token() as response: @@ -131,13 +121,11 @@ def test_streaming_response_get_id_token(self, client: Gitpod) -> None: class TestAsyncIdentity: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token( @@ -145,7 +133,6 @@ async def test_method_exchange_token_with_all_params(self, async_client: AsyncGi ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.exchange_token() @@ -155,7 +142,6 @@ async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> N identity = await response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.exchange_token() as response: @@ -167,32 +153,30 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: + identity = await async_client.identity.get_authenticated_identity() + assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + + @parametrize + async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( - body={}, + empty=True, ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: - response = await async_client.identity.with_raw_response.get_authenticated_identity( - body={}, - ) + response = await async_client.identity.with_raw_response.get_authenticated_identity() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity = await response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: - async with async_client.identity.with_streaming_response.get_authenticated_identity( - body={}, - ) as response: + async with async_client.identity.with_streaming_response.get_authenticated_identity() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -201,13 +185,11 @@ async def test_streaming_response_get_authenticated_identity(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( @@ -215,7 +197,6 @@ async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_id_token() @@ -225,7 +206,6 @@ async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> Non identity = await response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_id_token() as response: diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 1c0c5afc..3a017473 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -25,13 +25,11 @@ class TestOrganizations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: organization = client.organizations.create() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.create( @@ -41,7 +39,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.create() @@ -51,7 +48,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.create() as response: @@ -63,13 +59,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: organization = client.organizations.retrieve() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.retrieve( @@ -77,7 +71,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.retrieve() @@ -87,7 +80,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.retrieve() as response: @@ -99,7 +91,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -107,7 +98,6 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -115,7 +105,6 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( @@ -127,7 +116,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( @@ -141,7 +129,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -149,7 +136,6 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( @@ -161,7 +147,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( @@ -175,13 +160,11 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: organization = client.organizations.list() assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list( @@ -195,7 +178,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list() @@ -205,7 +187,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list() as response: @@ -217,13 +198,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: organization = client.organizations.delete() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.delete( @@ -231,7 +210,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.delete() @@ -241,7 +219,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.delete() as response: @@ -253,7 +230,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_join_overload_1(self, client: Gitpod) -> None: organization = client.organizations.join( @@ -261,7 +237,6 @@ def test_method_join_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_join_overload_1(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join( @@ -273,7 +248,6 @@ def test_raw_response_join_overload_1(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join( @@ -287,7 +261,6 @@ def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_join_overload_2(self, client: Gitpod) -> None: organization = client.organizations.join( @@ -295,7 +268,6 @@ def test_method_join_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_join_overload_2(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join( @@ -307,7 +279,6 @@ def test_raw_response_join_overload_2(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join( @@ -321,13 +292,11 @@ def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_leave(self, client: Gitpod) -> None: organization = client.organizations.leave() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_leave_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.leave( @@ -335,7 +304,6 @@ def test_method_leave_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.leave() @@ -345,7 +313,6 @@ def test_raw_response_leave(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.leave() as response: @@ -357,13 +324,11 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list_members(self, client: Gitpod) -> None: organization = client.organizations.list_members() assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( @@ -377,7 +342,6 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list_members() @@ -387,7 +351,6 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list_members() as response: @@ -399,13 +362,11 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_set_role(self, client: Gitpod) -> None: organization = client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( @@ -415,7 +376,6 @@ def test_method_set_role_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.set_role() @@ -425,7 +385,6 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.set_role() as response: @@ -441,13 +400,11 @@ def test_streaming_response_set_role(self, client: Gitpod) -> None: class TestAsyncOrganizations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( @@ -457,7 +414,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.create() @@ -467,7 +423,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.create() as response: @@ -479,13 +434,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( @@ -493,7 +446,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.retrieve() @@ -503,7 +455,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.retrieve() as response: @@ -515,7 +466,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -523,7 +473,6 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -531,7 +480,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( @@ -543,7 +491,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - organization = await response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( @@ -557,7 +504,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -565,7 +511,6 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( @@ -577,7 +522,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - organization = await response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( @@ -591,13 +535,11 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list() assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list( @@ -611,7 +553,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list() @@ -621,7 +562,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list() as response: @@ -633,13 +573,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete( @@ -647,7 +585,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.delete() @@ -657,7 +594,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.delete() as response: @@ -669,7 +605,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_join_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( @@ -677,7 +612,6 @@ async def test_method_join_overload_1(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join( @@ -689,7 +623,6 @@ async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> organization = await response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join( @@ -703,7 +636,6 @@ async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_join_overload_2(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( @@ -711,7 +643,6 @@ async def test_method_join_overload_2(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join( @@ -723,7 +654,6 @@ async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> organization = await response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join( @@ -737,13 +667,11 @@ async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( @@ -751,7 +679,6 @@ async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.leave() @@ -761,7 +688,6 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.leave() as response: @@ -773,13 +699,11 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members() assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( @@ -793,7 +717,6 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list_members() @@ -803,7 +726,6 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non organization = await response.parse() assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list_members() as response: @@ -815,13 +737,11 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( @@ -831,7 +751,6 @@ async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.set_role() @@ -841,7 +760,6 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.set_role() as response: diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 754f4395..ea12d993 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -24,7 +24,6 @@ class TestProjects: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( @@ -33,7 +32,6 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( @@ -45,7 +43,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( @@ -58,7 +55,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( @@ -73,13 +69,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: project = client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( @@ -87,7 +81,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.projects.with_raw_response.retrieve() @@ -97,7 +90,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.projects.with_streaming_response.retrieve() as response: @@ -109,7 +101,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: project = client.projects.update( @@ -117,7 +108,6 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -129,7 +119,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -143,7 +132,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: project = client.projects.update( @@ -151,7 +139,6 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -163,7 +150,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -177,7 +163,6 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: project = client.projects.update( @@ -185,7 +170,6 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -197,7 +181,6 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -211,7 +194,6 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_4(self, client: Gitpod) -> None: project = client.projects.update( @@ -219,7 +201,6 @@ def test_method_update_overload_4(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: project = client.projects.update( @@ -227,7 +208,6 @@ def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_4(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -239,7 +219,6 @@ def test_raw_response_update_overload_4(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -253,7 +232,6 @@ def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_5(self, client: Gitpod) -> None: project = client.projects.update( @@ -261,7 +239,6 @@ def test_method_update_overload_5(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -273,7 +250,6 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -287,13 +263,11 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: project = client.projects.list() assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: project = client.projects.list( @@ -306,7 +280,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.with_raw_response.list() @@ -316,7 +289,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.with_streaming_response.list() as response: @@ -328,13 +300,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: project = client.projects.delete() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: project = client.projects.delete( @@ -342,7 +312,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.with_raw_response.delete() @@ -352,7 +321,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.with_streaming_response.delete() as response: @@ -364,13 +332,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: project = client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( @@ -379,7 +345,6 @@ def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create_from_environment(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create_from_environment() @@ -389,7 +354,6 @@ def test_raw_response_create_from_environment(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create_from_environment(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create_from_environment() as response: @@ -405,7 +369,6 @@ def test_streaming_response_create_from_environment(self, client: Gitpod) -> Non class TestAsyncProjects: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -414,7 +377,6 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -426,7 +388,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( @@ -439,7 +400,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create( @@ -454,13 +414,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( @@ -468,7 +426,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.retrieve() @@ -478,7 +435,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.retrieve() as response: @@ -490,7 +446,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -498,7 +453,6 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -510,7 +464,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -524,7 +477,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -532,7 +484,6 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -544,7 +495,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -558,7 +508,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -566,7 +515,6 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -578,7 +526,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -592,7 +539,6 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -600,7 +546,6 @@ async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -608,7 +553,6 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -620,7 +564,6 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -634,7 +577,6 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -642,7 +584,6 @@ async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -654,7 +595,6 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -668,13 +608,11 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list() assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list( @@ -687,7 +625,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.list() @@ -697,7 +634,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.list() as response: @@ -709,13 +645,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete( @@ -723,7 +657,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.delete() @@ -733,7 +666,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.delete() as response: @@ -745,13 +677,11 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( @@ -760,7 +690,6 @@ async def test_method_create_from_environment_with_all_params(self, async_client ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create_from_environment(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create_from_environment() @@ -770,7 +699,6 @@ async def test_raw_response_create_from_environment(self, async_client: AsyncGit project = await response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create_from_environment(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create_from_environment() as response: diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 6c510f24..cf3bc974 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -25,13 +25,11 @@ class TestRunners: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: runner = client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( @@ -49,7 +47,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create() @@ -59,7 +56,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create() as response: @@ -71,13 +67,11 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: runner = client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( @@ -85,7 +79,6 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.with_raw_response.retrieve() @@ -95,7 +88,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.with_streaming_response.retrieve() as response: @@ -107,7 +99,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: runner = client.runners.update( @@ -115,7 +106,6 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( @@ -127,7 +117,6 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( @@ -141,7 +130,6 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: runner = client.runners.update( @@ -149,7 +137,6 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( @@ -161,7 +148,6 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( @@ -175,13 +161,11 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: runner = client.runners.list() assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list( @@ -199,7 +183,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.with_raw_response.list() @@ -209,7 +192,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.with_streaming_response.list() as response: @@ -221,13 +203,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: runner = client.runners.delete() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete( @@ -236,7 +216,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.with_raw_response.delete() @@ -246,7 +225,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.with_streaming_response.delete() as response: @@ -258,13 +236,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_check_authentication_for_host(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( @@ -273,7 +249,6 @@ def test_method_check_authentication_for_host_with_all_params(self, client: Gitp ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: response = client.runners.with_raw_response.check_authentication_for_host() @@ -283,7 +258,6 @@ def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> Non runner = response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: with client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -295,13 +269,11 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: runner = client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( @@ -309,7 +281,6 @@ def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create_runner_token(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create_runner_token() @@ -319,7 +290,6 @@ def test_raw_response_create_runner_token(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create_runner_token() as response: @@ -331,13 +301,11 @@ def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_parse_context_url(self, client: Gitpod) -> None: runner = client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( @@ -346,7 +314,6 @@ def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_parse_context_url(self, client: Gitpod) -> None: response = client.runners.with_raw_response.parse_context_url() @@ -356,7 +323,6 @@ def test_raw_response_parse_context_url(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: with client.runners.with_streaming_response.parse_context_url() as response: @@ -372,13 +338,11 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: class TestAsyncRunners: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( @@ -396,7 +360,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create() @@ -406,7 +369,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create() as response: @@ -418,13 +380,11 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( @@ -432,7 +392,6 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.retrieve() @@ -442,7 +401,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.retrieve() as response: @@ -454,7 +412,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( @@ -462,7 +419,6 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( @@ -474,7 +430,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( @@ -488,7 +443,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( @@ -496,7 +450,6 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( @@ -508,7 +461,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( @@ -522,13 +474,11 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list() assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( @@ -546,7 +496,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.list() @@ -556,7 +505,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.list() as response: @@ -568,13 +516,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete( @@ -583,7 +529,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.delete() @@ -593,7 +538,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.delete() as response: @@ -605,13 +549,11 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( @@ -620,7 +562,6 @@ async def test_method_check_authentication_for_host_with_all_params(self, async_ ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.check_authentication_for_host() @@ -630,7 +571,6 @@ async def test_raw_response_check_authentication_for_host(self, async_client: As runner = await response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -642,13 +582,11 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( @@ -656,7 +594,6 @@ async def test_method_create_runner_token_with_all_params(self, async_client: As ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create_runner_token() @@ -666,7 +603,6 @@ async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) runner = await response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create_runner_token() as response: @@ -678,13 +614,11 @@ async def test_streaming_response_create_runner_token(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( @@ -693,7 +627,6 @@ async def test_method_parse_context_url_with_all_params(self, async_client: Asyn ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.parse_context_url() @@ -703,7 +636,6 @@ async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.parse_context_url() as response: diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 07fd383f..2ffe8167 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -22,7 +22,6 @@ class TestSecrets: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_create_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -30,7 +29,6 @@ def test_method_create_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -41,7 +39,6 @@ def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create( @@ -53,7 +50,6 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create( @@ -67,7 +63,6 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_create_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -75,7 +70,6 @@ def test_method_create_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -86,7 +80,6 @@ def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create( @@ -98,7 +91,6 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create( @@ -112,13 +104,11 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: secret = client.secrets.list() assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.list( @@ -132,7 +122,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.list() @@ -142,7 +131,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.list() as response: @@ -154,13 +142,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: secret = client.secrets.delete() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.delete( @@ -168,7 +154,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.delete() @@ -178,7 +163,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.delete() as response: @@ -190,13 +174,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_get_value(self, client: Gitpod) -> None: secret = client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_get_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.get_value( @@ -204,7 +186,6 @@ def test_method_get_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_get_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.get_value() @@ -214,7 +195,6 @@ def test_raw_response_get_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_get_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.get_value() as response: @@ -226,13 +206,11 @@ def test_streaming_response_get_value(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_update_value(self, client: Gitpod) -> None: secret = client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_update_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.update_value( @@ -241,7 +219,6 @@ def test_method_update_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_update_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.update_value() @@ -251,7 +228,6 @@ def test_raw_response_update_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_update_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.update_value() as response: @@ -267,7 +243,6 @@ def test_streaming_response_update_value(self, client: Gitpod) -> None: class TestAsyncSecrets: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -275,7 +250,6 @@ async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -286,7 +260,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create( @@ -298,7 +271,6 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - secret = await response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create( @@ -312,7 +284,6 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -320,7 +291,6 @@ async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -331,7 +301,6 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create( @@ -343,7 +312,6 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - secret = await response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create( @@ -357,13 +325,11 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list() assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list( @@ -377,7 +343,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.list() @@ -387,7 +352,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.list() as response: @@ -399,13 +363,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete( @@ -413,7 +375,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.delete() @@ -423,7 +384,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.delete() as response: @@ -435,13 +395,11 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_get_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value( @@ -449,7 +407,6 @@ async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.get_value() @@ -459,7 +416,6 @@ async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.get_value() as response: @@ -471,13 +427,11 @@ async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_update_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_update_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value( @@ -486,7 +440,6 @@ async def test_method_update_value_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.update_value() @@ -496,7 +449,6 @@ async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> Non secret = await response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_update_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.update_value() as response: diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index cd94f2b4..13a6e565 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -17,32 +17,30 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_get_authenticated_user(self, client: Gitpod) -> None: + user = client.users.get_authenticated_user() + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + @parametrize + def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> None: user = client.users.get_authenticated_user( - body={}, + empty=True, ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: - response = client.users.with_raw_response.get_authenticated_user( - body={}, - ) + response = client.users.with_raw_response.get_authenticated_user() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None: - with client.users.with_streaming_response.get_authenticated_user( - body={}, - ) as response: + with client.users.with_streaming_response.get_authenticated_user() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,13 +49,11 @@ def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_set_suspended(self, client: Gitpod) -> None: user = client.users.set_suspended() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: user = client.users.set_suspended( @@ -66,7 +62,6 @@ def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_set_suspended(self, client: Gitpod) -> None: response = client.users.with_raw_response.set_suspended() @@ -76,7 +71,6 @@ def test_raw_response_set_suspended(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_set_suspended(self, client: Gitpod) -> None: with client.users.with_streaming_response.set_suspended() as response: @@ -92,32 +86,30 @@ def test_streaming_response_set_suspended(self, client: Gitpod) -> None: class TestAsyncUsers: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.get_authenticated_user() + assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + + @parametrize + async def test_method_get_authenticated_user_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user( - body={}, + empty=True, ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: - response = await async_client.users.with_raw_response.get_authenticated_user( - body={}, - ) + response = await async_client.users.with_raw_response.get_authenticated_user() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: - async with async_client.users.with_streaming_response.get_authenticated_user( - body={}, - ) as response: + async with async_client.users.with_streaming_response.get_authenticated_user() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -126,13 +118,11 @@ async def test_streaming_response_get_authenticated_user(self, async_client: Asy assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_set_suspended_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended( @@ -141,7 +131,6 @@ async def test_method_set_suspended_with_all_params(self, async_client: AsyncGit ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.set_suspended() @@ -151,7 +140,6 @@ async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> No user = await response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_set_suspended(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.set_suspended() as response: diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index d20704e8..c0fa515b 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -18,13 +18,11 @@ class TestPats: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: pat = client.users.pats.list() assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.list( @@ -38,7 +36,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.list() @@ -48,7 +45,6 @@ def test_raw_response_list(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.list() as response: @@ -60,13 +56,11 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: pat = client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.delete( @@ -74,7 +68,6 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.delete() @@ -84,7 +77,6 @@ def test_raw_response_delete(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.delete() as response: @@ -96,13 +88,11 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_get(self, client: Gitpod) -> None: pat = client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.get( @@ -110,7 +100,6 @@ def test_method_get_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() @parametrize def test_raw_response_get(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.get() @@ -120,7 +109,6 @@ def test_raw_response_get(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.get() as response: @@ -136,13 +124,11 @@ def test_streaming_response_get(self, client: Gitpod) -> None: class TestAsyncPats: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list() assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list( @@ -156,7 +142,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.list() @@ -166,7 +151,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.list() as response: @@ -178,13 +162,11 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete( @@ -192,7 +174,6 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.delete() @@ -202,7 +183,6 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.delete() as response: @@ -214,13 +194,11 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get( @@ -228,7 +206,6 @@ async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> No ) assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.get() @@ -238,7 +215,6 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.get() as response: From 3c81bd0a10883395b450ff0a7555d20c201698a7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 19:24:37 +0000 Subject: [PATCH 078/505] fix(tests): disable mock tests (#5) --- .../automations/tasks/test_executions.py | 24 ++++++ .../environments/automations/test_services.py | 56 +++++++++++++ .../environments/automations/test_tasks.py | 48 +++++++++++ .../environments/test_automations.py | 8 ++ .../environments/test_classes.py | 8 ++ .../organizations/test_invites.py | 24 ++++++ .../organizations/test_sso_configurations.py | 62 ++++++++++++++ tests/api_resources/projects/test_policies.py | 32 +++++++ .../test_environment_classes.py | 42 ++++++++++ .../test_host_authentication_tokens.py | 50 +++++++++++ .../runners/configurations/test_schema.py | 8 ++ .../configurations/test_scm_integrations.py | 54 ++++++++++++ .../runners/test_configurations.py | 16 ++++ tests/api_resources/runners/test_policies.py | 32 +++++++ tests/api_resources/test_accounts.py | 32 +++++++ tests/api_resources/test_editors.py | 24 ++++++ tests/api_resources/test_environments.py | 84 +++++++++++++++++++ tests/api_resources/test_events.py | 8 ++ tests/api_resources/test_groups.py | 8 ++ tests/api_resources/test_identity.py | 24 ++++++ tests/api_resources/test_organizations.py | 82 ++++++++++++++++++ tests/api_resources/test_projects.py | 72 ++++++++++++++++ tests/api_resources/test_runners.py | 68 +++++++++++++++ tests/api_resources/test_secrets.py | 48 +++++++++++ tests/api_resources/test_users.py | 16 ++++ tests/api_resources/users/test_pats.py | 24 ++++++ 26 files changed, 954 insertions(+) diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index 43dc6d00..136a0117 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -21,11 +21,13 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve( @@ -33,6 +35,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -42,6 +45,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.retrieve() as response: @@ -53,11 +57,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list() assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list( @@ -76,6 +82,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.list() @@ -85,6 +92,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -96,11 +104,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_stop(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop( @@ -108,6 +118,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.stop() @@ -117,6 +128,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.stop() as response: @@ -132,11 +144,13 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve( @@ -144,6 +158,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -153,6 +168,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -166,11 +182,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list() assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list( @@ -189,6 +207,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.list() @@ -198,6 +217,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -209,11 +229,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop( @@ -221,6 +243,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.stop() @@ -230,6 +253,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(object, execution, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 40f9a7bd..f6a1893c 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -23,11 +23,13 @@ class TestServices: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: service = client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.create( @@ -62,6 +64,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.create() @@ -71,6 +74,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.create() as response: @@ -82,11 +86,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve( @@ -94,6 +100,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.retrieve() @@ -103,6 +110,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -114,11 +122,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: service = client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( @@ -129,6 +139,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.update() @@ -138,6 +149,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.update() as response: @@ -149,11 +161,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: service = client.environments.automations.services.list() assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.list( @@ -171,6 +185,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.list() @@ -180,6 +195,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.list() as response: @@ -191,11 +207,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: service = client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.delete( @@ -204,6 +222,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.delete() @@ -213,6 +232,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.delete() as response: @@ -224,11 +244,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_start(self, client: Gitpod) -> None: service = client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.start( @@ -236,6 +258,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.start() @@ -245,6 +268,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.start() as response: @@ -256,11 +280,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_stop(self, client: Gitpod) -> None: service = client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.stop( @@ -268,6 +294,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.stop() @@ -277,6 +304,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.stop() as response: @@ -292,11 +320,13 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncServices: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create( @@ -331,6 +361,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.create() @@ -340,6 +371,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.create() as response: @@ -351,11 +383,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve( @@ -363,6 +397,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.retrieve() @@ -372,6 +407,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -383,11 +419,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( @@ -398,6 +436,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.update() @@ -407,6 +446,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.update() as response: @@ -418,11 +458,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list() assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( @@ -440,6 +482,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.list() @@ -449,6 +492,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.list() as response: @@ -460,11 +504,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete( @@ -473,6 +519,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.delete() @@ -482,6 +529,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.delete() as response: @@ -493,11 +541,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start( @@ -505,6 +555,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.start() @@ -514,6 +565,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.start() as response: @@ -525,11 +577,13 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop( @@ -537,6 +591,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.stop() @@ -546,6 +601,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 3138f430..381d28f5 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -24,11 +24,13 @@ class TestTasks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create( @@ -57,6 +59,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.create() @@ -66,6 +69,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.create() as response: @@ -77,11 +81,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( @@ -89,6 +95,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.retrieve() @@ -98,6 +105,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -109,11 +117,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( @@ -124,6 +134,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.update() @@ -133,6 +144,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.update() as response: @@ -144,11 +156,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list() assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( @@ -166,6 +180,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.list() @@ -175,6 +190,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.list() as response: @@ -186,11 +202,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete( @@ -198,6 +216,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.delete() @@ -207,6 +226,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -218,11 +238,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_start(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start( @@ -230,6 +252,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.start() @@ -239,6 +262,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.start() as response: @@ -254,11 +278,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: class TestAsyncTasks: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create( @@ -287,6 +313,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.create() @@ -296,6 +323,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.create() as response: @@ -307,11 +335,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( @@ -319,6 +349,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.retrieve() @@ -328,6 +359,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -339,11 +371,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( @@ -354,6 +388,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.update() @@ -363,6 +398,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.update() as response: @@ -374,11 +410,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list() assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( @@ -396,6 +434,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.list() @@ -405,6 +444,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.list() as response: @@ -416,11 +456,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete( @@ -428,6 +470,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.delete() @@ -437,6 +480,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -448,11 +492,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start( @@ -460,6 +506,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.start() @@ -469,6 +516,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.start() as response: diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 5b0f7c20..e4c8ffdb 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -17,11 +17,13 @@ class TestAutomations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_upsert(self, client: Gitpod) -> None: automation = client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_upsert_with_all_params(self, client: Gitpod) -> None: automation = client.environments.automations.upsert( @@ -64,6 +66,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_upsert(self, client: Gitpod) -> None: response = client.environments.automations.with_raw_response.upsert() @@ -73,6 +76,7 @@ def test_raw_response_upsert(self, client: Gitpod) -> None: automation = response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_upsert(self, client: Gitpod) -> None: with client.environments.automations.with_streaming_response.upsert() as response: @@ -88,11 +92,13 @@ def test_streaming_response_upsert(self, client: Gitpod) -> None: class TestAsyncAutomations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_upsert(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert( @@ -135,6 +141,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.with_raw_response.upsert() @@ -144,6 +151,7 @@ async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: automation = await response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.with_streaming_response.upsert() as response: diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index 7ef88fab..3b525f3e 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -18,11 +18,13 @@ class TestClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: class_ = client.environments.classes.list() assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: class_ = client.environments.classes.list( @@ -36,6 +38,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.classes.with_raw_response.list() @@ -45,6 +48,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: class_ = response.parse() assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.classes.with_streaming_response.list() as response: @@ -60,11 +64,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncClasses: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list() assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list( @@ -78,6 +84,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.classes.with_raw_response.list() @@ -87,6 +94,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: class_ = await response.parse() assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index 0f80a2a1..b158bc41 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -21,11 +21,13 @@ class TestInvites: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: invite = client.organizations.invites.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.create( @@ -33,6 +35,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.create() @@ -42,6 +45,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.create() as response: @@ -53,11 +57,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve( @@ -65,6 +71,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.retrieve() @@ -74,6 +81,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.retrieve() as response: @@ -85,11 +93,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_summary(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( @@ -97,6 +107,7 @@ def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_summary(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.get_summary() @@ -106,6 +117,7 @@ def test_raw_response_get_summary(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_summary(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.get_summary() as response: @@ -121,11 +133,13 @@ def test_streaming_response_get_summary(self, client: Gitpod) -> None: class TestAsyncInvites: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create() assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create( @@ -133,6 +147,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.create() @@ -142,6 +157,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.create() as response: @@ -153,11 +169,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve( @@ -165,6 +183,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.retrieve() @@ -174,6 +193,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.retrieve() as response: @@ -185,11 +205,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( @@ -197,6 +219,7 @@ async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.get_summary() @@ -206,6 +229,7 @@ async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None invite = await response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.get_summary() as response: diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index e23cf090..04d19db3 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -22,11 +22,13 @@ class TestSSOConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( @@ -38,6 +40,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.create() @@ -47,6 +50,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.create() as response: @@ -58,11 +62,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( @@ -70,6 +76,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.retrieve() @@ -79,6 +86,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.retrieve() as response: @@ -90,6 +98,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -97,6 +106,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -108,6 +118,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -121,6 +132,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -128,6 +140,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -139,6 +152,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -152,6 +166,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -159,6 +174,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -170,6 +186,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -183,6 +200,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_4(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -190,6 +208,7 @@ def test_method_update_overload_4(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_4(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -201,6 +220,7 @@ def test_raw_response_update_overload_4(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -214,6 +234,7 @@ def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_5(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -221,6 +242,7 @@ def test_method_update_overload_5(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -232,6 +254,7 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -245,6 +268,7 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list() @@ -252,6 +276,7 @@ def test_method_list(self, client: Gitpod) -> None: SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( @@ -267,6 +292,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.list() @@ -278,6 +304,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.list() as response: @@ -291,11 +318,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete( @@ -303,6 +332,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.delete() @@ -312,6 +342,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.delete() as response: @@ -327,11 +358,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncSSOConfigurations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( @@ -343,6 +376,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.create() @@ -352,6 +386,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.create() as response: @@ -363,11 +398,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( @@ -375,6 +412,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.retrieve() @@ -384,6 +422,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.retrieve() as response: @@ -395,6 +434,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -402,6 +442,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -413,6 +454,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -426,6 +468,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -433,6 +476,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -444,6 +488,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -457,6 +502,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -464,6 +510,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -475,6 +522,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -488,6 +536,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -495,6 +544,7 @@ async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -506,6 +556,7 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -519,6 +570,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -526,6 +578,7 @@ async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -537,6 +590,7 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -550,6 +604,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list() @@ -557,6 +612,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( @@ -572,6 +628,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.list() @@ -583,6 +640,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.list() as response: @@ -596,11 +654,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete( @@ -608,6 +668,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.delete() @@ -617,6 +678,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.delete() as response: diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index 84f3f9a4..c066dcbb 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -22,11 +22,13 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( @@ -36,6 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.create() @@ -45,6 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.create() as response: @@ -56,11 +60,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( @@ -70,6 +76,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.update() @@ -79,6 +86,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.update() as response: @@ -90,11 +98,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.projects.policies.list() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.list( @@ -108,6 +118,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.list() @@ -117,6 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.list() as response: @@ -128,11 +140,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.delete( @@ -141,6 +155,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.delete() @@ -150,6 +165,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.delete() as response: @@ -165,11 +181,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncPolicies: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create( @@ -179,6 +197,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.create() @@ -188,6 +207,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.create() as response: @@ -199,11 +219,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update( @@ -213,6 +235,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.update() @@ -222,6 +245,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.update() as response: @@ -233,11 +257,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list( @@ -251,6 +277,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.list() @@ -260,6 +287,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.list() as response: @@ -271,11 +299,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete( @@ -284,6 +314,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.delete() @@ -293,6 +324,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 50c85989..d08bb882 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -22,11 +22,13 @@ class TestEnvironmentClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create( @@ -42,6 +44,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.create() @@ -51,6 +54,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -62,11 +66,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( @@ -74,6 +80,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -83,6 +90,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.retrieve() as response: @@ -94,6 +102,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -101,6 +110,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( @@ -112,6 +122,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( @@ -125,6 +136,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -132,6 +144,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( @@ -143,6 +156,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( @@ -156,6 +170,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -163,6 +178,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update( @@ -174,6 +190,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update( @@ -187,6 +204,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list() @@ -194,6 +212,7 @@ def test_method_list(self, client: Gitpod) -> None: SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list( @@ -209,6 +228,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.list() @@ -220,6 +240,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.list() as response: @@ -237,11 +258,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncEnvironmentClasses: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create( @@ -257,6 +280,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.create() @@ -266,6 +290,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -277,11 +302,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( @@ -289,6 +316,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -298,6 +326,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -311,6 +340,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -318,6 +348,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( @@ -329,6 +360,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( @@ -342,6 +374,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -349,6 +382,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( @@ -360,6 +394,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( @@ -373,6 +408,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -380,6 +416,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update( @@ -391,6 +428,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update( @@ -404,6 +442,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list() @@ -411,6 +450,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list( @@ -426,6 +466,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.list() @@ -437,6 +478,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 6e1752bf..1520b2ae 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -23,11 +23,13 @@ class TestHostAuthenticationTokens: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create( @@ -41,6 +43,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -50,6 +53,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.create() as response: @@ -61,11 +65,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( @@ -73,6 +79,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -82,6 +89,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: @@ -93,6 +101,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -100,6 +109,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -111,6 +121,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -124,6 +135,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -131,6 +143,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -142,6 +155,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -155,6 +169,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -162,6 +177,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -173,6 +189,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -186,6 +203,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list() @@ -193,6 +211,7 @@ def test_method_list(self, client: Gitpod) -> None: SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list( @@ -208,6 +227,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -219,6 +239,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.list() as response: @@ -232,11 +253,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( @@ -244,6 +267,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -253,6 +277,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.delete() as response: @@ -268,11 +293,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncHostAuthenticationTokens: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( @@ -286,6 +313,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -295,6 +323,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with ( @@ -308,11 +337,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( @@ -320,6 +351,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -329,6 +361,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -342,6 +375,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -349,6 +383,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -360,6 +395,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -373,6 +409,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -380,6 +417,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -391,6 +429,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -404,6 +443,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -411,6 +451,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( @@ -422,6 +463,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( @@ -435,6 +477,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list() @@ -442,6 +485,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( @@ -457,6 +501,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -468,6 +513,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] ) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with ( @@ -483,11 +529,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( @@ -495,6 +543,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -504,6 +553,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with ( diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index 47601189..3fce8e32 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -17,11 +17,13 @@ class TestSchema: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( @@ -29,6 +31,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.schema.with_raw_response.retrieve() @@ -38,6 +41,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: schema = response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.schema.with_streaming_response.retrieve() as response: @@ -53,11 +57,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: class TestAsyncSchema: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( @@ -65,6 +71,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.schema.with_raw_response.retrieve() @@ -74,6 +81,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: schema = await response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.schema.with_streaming_response.retrieve() as response: diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index 4f404eaa..e827e39b 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -22,6 +22,7 @@ class TestScmIntegrations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( @@ -29,6 +30,7 @@ def test_method_create_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( @@ -40,6 +42,7 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -53,6 +56,7 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_overload_2(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( @@ -60,6 +64,7 @@ def test_method_create_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create( @@ -71,6 +76,7 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -84,11 +90,13 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( @@ -96,6 +104,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -105,6 +114,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -116,6 +126,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -123,6 +134,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( @@ -134,6 +146,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -147,6 +160,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -154,6 +168,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( @@ -165,6 +180,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -178,6 +194,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -185,6 +202,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update( @@ -196,6 +214,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -209,11 +228,13 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list() assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list( @@ -227,6 +248,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.list() @@ -236,6 +258,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -247,11 +270,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete( @@ -259,6 +284,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -268,6 +294,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: @@ -283,6 +310,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncScmIntegrations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( @@ -290,6 +318,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( @@ -301,6 +330,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -314,6 +344,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( @@ -321,6 +352,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( @@ -332,6 +364,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( @@ -345,11 +378,13 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( @@ -357,6 +392,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -366,6 +402,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -377,6 +414,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -384,6 +422,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( @@ -395,6 +434,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -408,6 +448,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -415,6 +456,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( @@ -426,6 +468,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -439,6 +482,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -446,6 +490,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( @@ -457,6 +502,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( @@ -470,11 +516,13 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list() assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list( @@ -488,6 +536,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.list() @@ -497,6 +546,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -508,11 +558,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete( @@ -520,6 +572,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -529,6 +582,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index b64232aa..833058db 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -17,6 +17,7 @@ class TestConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_validate_overload_1(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -24,6 +25,7 @@ def test_method_validate_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -44,6 +46,7 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( @@ -55,6 +58,7 @@ def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: configuration = response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( @@ -68,6 +72,7 @@ def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_validate_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -75,6 +80,7 @@ def test_method_validate_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -83,6 +89,7 @@ def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> Non ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate( @@ -94,6 +101,7 @@ def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: configuration = response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate( @@ -111,6 +119,7 @@ def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: class TestAsyncConfigurations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -118,6 +127,7 @@ async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> No ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_validate_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -138,6 +148,7 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( @@ -149,6 +160,7 @@ async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) configuration = await response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( @@ -162,6 +174,7 @@ async def test_streaming_response_validate_overload_1(self, async_client: AsyncG assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -169,6 +182,7 @@ async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> No ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -177,6 +191,7 @@ async def test_method_validate_with_all_params_overload_2(self, async_client: As ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate( @@ -188,6 +203,7 @@ async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) configuration = await response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate( diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index 11a2f953..bd75557f 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -22,11 +22,13 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( @@ -36,6 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.create() @@ -45,6 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.create() as response: @@ -56,11 +60,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( @@ -70,6 +76,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.update() @@ -79,6 +86,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.update() as response: @@ -90,11 +98,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.runners.policies.list() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.list( @@ -108,6 +118,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.list() @@ -117,6 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.list() as response: @@ -128,11 +140,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.delete( @@ -141,6 +155,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.delete() @@ -150,6 +165,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.delete() as response: @@ -165,11 +181,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncPolicies: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( @@ -179,6 +197,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.create() @@ -188,6 +207,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.create() as response: @@ -199,11 +219,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( @@ -213,6 +235,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.update() @@ -222,6 +245,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.update() as response: @@ -233,11 +257,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( @@ -251,6 +277,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.list() @@ -260,6 +287,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.list() as response: @@ -271,11 +299,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete( @@ -284,6 +314,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.delete() @@ -293,6 +324,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 485ed4f0..54d712eb 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -22,11 +22,13 @@ class TestAccounts: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: account = client.accounts.retrieve() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: account = client.accounts.retrieve( @@ -34,6 +36,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.retrieve() @@ -43,6 +46,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.retrieve() as response: @@ -54,11 +58,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: account = client.accounts.delete() assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: account = client.accounts.delete( @@ -66,6 +72,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.delete() @@ -75,6 +82,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.delete() as response: @@ -86,6 +94,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -93,6 +102,7 @@ def test_method_get_sso_login_url(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -101,6 +111,7 @@ def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.get_sso_login_url( @@ -112,6 +123,7 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.get_sso_login_url( @@ -125,11 +137,13 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: account = client.accounts.list_login_providers() assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> None: account = client.accounts.list_login_providers( @@ -143,6 +157,7 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No ) assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list_login_providers(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.list_login_providers() @@ -152,6 +167,7 @@ def test_raw_response_list_login_providers(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.list_login_providers() as response: @@ -167,11 +183,13 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: class TestAsyncAccounts: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve( @@ -179,6 +197,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.retrieve() @@ -188,6 +207,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: account = await response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.retrieve() as response: @@ -199,11 +219,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete() assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete( @@ -211,6 +233,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.delete() @@ -220,6 +243,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: account = await response.parse() assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.delete() as response: @@ -231,6 +255,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -238,6 +263,7 @@ async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -246,6 +272,7 @@ async def test_method_get_sso_login_url_with_all_params(self, async_client: Asyn ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.get_sso_login_url( @@ -257,6 +284,7 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - account = await response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.get_sso_login_url( @@ -270,11 +298,13 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers() assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_login_providers_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers( @@ -288,6 +318,7 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A ) assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.list_login_providers() @@ -297,6 +328,7 @@ async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod account = await response.parse() assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list_login_providers(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.list_login_providers() as response: diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 10f3a757..d3de3026 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -22,11 +22,13 @@ class TestEditors: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: editor = client.editors.retrieve() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: editor = client.editors.retrieve( @@ -34,6 +36,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.editors.with_raw_response.retrieve() @@ -43,6 +46,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.editors.with_streaming_response.retrieve() as response: @@ -54,11 +58,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: editor = client.editors.list() assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: editor = client.editors.list( @@ -71,6 +77,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.editors.with_raw_response.list() @@ -80,6 +87,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.editors.with_streaming_response.list() as response: @@ -91,11 +99,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_resolve_url(self, client: Gitpod) -> None: editor = client.editors.resolve_url() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: editor = client.editors.resolve_url( @@ -105,6 +115,7 @@ def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: response = client.editors.with_raw_response.resolve_url() @@ -114,6 +125,7 @@ def test_raw_response_resolve_url(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_resolve_url(self, client: Gitpod) -> None: with client.editors.with_streaming_response.resolve_url() as response: @@ -129,11 +141,13 @@ def test_streaming_response_resolve_url(self, client: Gitpod) -> None: class TestAsyncEditors: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( @@ -141,6 +155,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.retrieve() @@ -150,6 +165,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.retrieve() as response: @@ -161,11 +177,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list() assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list( @@ -178,6 +196,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.list() @@ -187,6 +206,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.list() as response: @@ -198,11 +218,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( @@ -212,6 +234,7 @@ async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.resolve_url() @@ -221,6 +244,7 @@ async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None editor = await response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.resolve_url() as response: diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 60087985..08dc4635 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -25,11 +25,13 @@ class TestEnvironments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: environment = client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( @@ -82,6 +84,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create() @@ -91,6 +94,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create() as response: @@ -102,11 +106,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment = client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment = client.environments.retrieve( @@ -114,6 +120,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.with_raw_response.retrieve() @@ -123,6 +130,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.with_streaming_response.retrieve() as response: @@ -134,6 +142,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: environment = client.environments.update( @@ -141,6 +150,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( @@ -152,6 +162,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( @@ -165,6 +176,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: environment = client.environments.update( @@ -172,6 +184,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update( @@ -183,6 +196,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update( @@ -196,11 +210,13 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: environment = client.environments.list() assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( @@ -221,6 +237,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.with_raw_response.list() @@ -230,6 +247,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.with_streaming_response.list() as response: @@ -241,11 +259,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: environment = client.environments.delete() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: environment = client.environments.delete( @@ -254,6 +274,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.with_raw_response.delete() @@ -263,6 +284,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.with_streaming_response.delete() as response: @@ -274,11 +296,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: environment = client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( @@ -332,6 +356,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_from_project(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_from_project() @@ -341,6 +366,7 @@ def test_raw_response_create_from_project(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_from_project(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_from_project() as response: @@ -352,11 +378,13 @@ def test_streaming_response_create_from_project(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_logs_token(self, client: Gitpod) -> None: environment = client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_logs_token( @@ -364,6 +392,7 @@ def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_logs_token(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_logs_token() @@ -373,6 +402,7 @@ def test_raw_response_create_logs_token(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_logs_token() as response: @@ -384,11 +414,13 @@ def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_mark_active(self, client: Gitpod) -> None: environment = client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: environment = client.environments.mark_active( @@ -400,6 +432,7 @@ def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_mark_active(self, client: Gitpod) -> None: response = client.environments.with_raw_response.mark_active() @@ -409,6 +442,7 @@ def test_raw_response_mark_active(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_mark_active(self, client: Gitpod) -> None: with client.environments.with_streaming_response.mark_active() as response: @@ -420,11 +454,13 @@ def test_streaming_response_mark_active(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_start(self, client: Gitpod) -> None: environment = client.environments.start() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( @@ -432,6 +468,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.with_raw_response.start() @@ -441,6 +478,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.with_streaming_response.start() as response: @@ -452,11 +490,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_stop(self, client: Gitpod) -> None: environment = client.environments.stop() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: environment = client.environments.stop( @@ -464,6 +504,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.with_raw_response.stop() @@ -473,6 +514,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.with_streaming_response.stop() as response: @@ -488,11 +530,13 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncEnvironments: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( @@ -545,6 +589,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create() @@ -554,6 +599,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create() as response: @@ -565,11 +611,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( @@ -577,6 +625,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.retrieve() @@ -586,6 +635,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.retrieve() as response: @@ -597,6 +647,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( @@ -604,6 +655,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( @@ -615,6 +667,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( @@ -628,6 +681,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( @@ -635,6 +689,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update( @@ -646,6 +701,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update( @@ -659,11 +715,13 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list() assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( @@ -684,6 +742,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.list() @@ -693,6 +752,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.list() as response: @@ -704,11 +764,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete( @@ -717,6 +779,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.delete() @@ -726,6 +789,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.delete() as response: @@ -737,11 +801,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( @@ -795,6 +861,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_from_project() @@ -804,6 +871,7 @@ async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) environment = await response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_from_project(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_from_project() as response: @@ -815,11 +883,13 @@ async def test_streaming_response_create_from_project(self, async_client: AsyncG assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token( @@ -827,6 +897,7 @@ async def test_method_create_logs_token_with_all_params(self, async_client: Asyn ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_logs_token() @@ -836,6 +907,7 @@ async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_logs_token() as response: @@ -847,11 +919,13 @@ async def test_streaming_response_create_logs_token(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active( @@ -863,6 +937,7 @@ async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.mark_active() @@ -872,6 +947,7 @@ async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.mark_active() as response: @@ -883,11 +959,13 @@ async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( @@ -895,6 +973,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.start() @@ -904,6 +983,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.start() as response: @@ -915,11 +995,13 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop( @@ -927,6 +1009,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.stop() @@ -936,6 +1019,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.stop() as response: diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 975597b5..b3fdfdd5 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -19,11 +19,13 @@ class TestEvents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: event = client.events.list() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: event = client.events.list( @@ -42,6 +44,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.events.with_raw_response.list() @@ -51,6 +54,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: event = response.parse() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.events.with_streaming_response.list() as response: @@ -134,11 +138,13 @@ def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: class TestAsyncEvents: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list( @@ -157,6 +163,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.list() @@ -166,6 +173,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: event = await response.parse() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index bf2e4b16..2d4abe98 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -18,11 +18,13 @@ class TestGroups: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: group = client.groups.list() assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: group = client.groups.list( @@ -35,6 +37,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.groups.with_raw_response.list() @@ -44,6 +47,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: group = response.parse() assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.groups.with_streaming_response.list() as response: @@ -59,11 +63,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncGroups: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list() assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list( @@ -76,6 +82,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.with_raw_response.list() @@ -85,6 +92,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: group = await response.parse() assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.groups.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index e17719de..2991dc8d 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -21,11 +21,13 @@ class TestIdentity: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_exchange_token(self, client: Gitpod) -> None: identity = client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.exchange_token( @@ -33,6 +35,7 @@ def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_exchange_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.exchange_token() @@ -42,6 +45,7 @@ def test_raw_response_exchange_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_exchange_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.exchange_token() as response: @@ -53,11 +57,13 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_authenticated_identity(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( @@ -65,6 +71,7 @@ def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_authenticated_identity() @@ -74,6 +81,7 @@ def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_authenticated_identity() as response: @@ -85,11 +93,13 @@ def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_id_token(self, client: Gitpod) -> None: identity = client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( @@ -97,6 +107,7 @@ def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_id_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_id_token() @@ -106,6 +117,7 @@ def test_raw_response_get_id_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_id_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_id_token() as response: @@ -121,11 +133,13 @@ def test_streaming_response_get_id_token(self, client: Gitpod) -> None: class TestAsyncIdentity: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token( @@ -133,6 +147,7 @@ async def test_method_exchange_token_with_all_params(self, async_client: AsyncGi ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.exchange_token() @@ -142,6 +157,7 @@ async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> N identity = await response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.exchange_token() as response: @@ -153,11 +169,13 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( @@ -165,6 +183,7 @@ async def test_method_get_authenticated_identity_with_all_params(self, async_cli ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_authenticated_identity() @@ -174,6 +193,7 @@ async def test_raw_response_get_authenticated_identity(self, async_client: Async identity = await response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_authenticated_identity() as response: @@ -185,11 +205,13 @@ async def test_streaming_response_get_authenticated_identity(self, async_client: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( @@ -197,6 +219,7 @@ async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_id_token() @@ -206,6 +229,7 @@ async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> Non identity = await response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_id_token() as response: diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 3a017473..1c0c5afc 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -25,11 +25,13 @@ class TestOrganizations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: organization = client.organizations.create() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.create( @@ -39,6 +41,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.create() @@ -48,6 +51,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.create() as response: @@ -59,11 +63,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: organization = client.organizations.retrieve() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.retrieve( @@ -71,6 +77,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.retrieve() @@ -80,6 +87,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.retrieve() as response: @@ -91,6 +99,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -98,6 +107,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -105,6 +115,7 @@ def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( @@ -116,6 +127,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( @@ -129,6 +141,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -136,6 +149,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( @@ -147,6 +161,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( @@ -160,11 +175,13 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: organization = client.organizations.list() assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list( @@ -178,6 +195,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list() @@ -187,6 +205,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list() as response: @@ -198,11 +217,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: organization = client.organizations.delete() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.delete( @@ -210,6 +231,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.delete() @@ -219,6 +241,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.delete() as response: @@ -230,6 +253,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_join_overload_1(self, client: Gitpod) -> None: organization = client.organizations.join( @@ -237,6 +261,7 @@ def test_method_join_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_join_overload_1(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join( @@ -248,6 +273,7 @@ def test_raw_response_join_overload_1(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join( @@ -261,6 +287,7 @@ def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_join_overload_2(self, client: Gitpod) -> None: organization = client.organizations.join( @@ -268,6 +295,7 @@ def test_method_join_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_join_overload_2(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join( @@ -279,6 +307,7 @@ def test_raw_response_join_overload_2(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join( @@ -292,11 +321,13 @@ def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_leave(self, client: Gitpod) -> None: organization = client.organizations.leave() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_leave_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.leave( @@ -304,6 +335,7 @@ def test_method_leave_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.leave() @@ -313,6 +345,7 @@ def test_raw_response_leave(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.leave() as response: @@ -324,11 +357,13 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list_members(self, client: Gitpod) -> None: organization = client.organizations.list_members() assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( @@ -342,6 +377,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list_members() @@ -351,6 +387,7 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list_members() as response: @@ -362,11 +399,13 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_set_role(self, client: Gitpod) -> None: organization = client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( @@ -376,6 +415,7 @@ def test_method_set_role_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.set_role() @@ -385,6 +425,7 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.set_role() as response: @@ -400,11 +441,13 @@ def test_streaming_response_set_role(self, client: Gitpod) -> None: class TestAsyncOrganizations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( @@ -414,6 +457,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.create() @@ -423,6 +467,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.create() as response: @@ -434,11 +479,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( @@ -446,6 +493,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.retrieve() @@ -455,6 +503,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.retrieve() as response: @@ -466,6 +515,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -473,6 +523,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -480,6 +531,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( @@ -491,6 +543,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - organization = await response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( @@ -504,6 +557,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -511,6 +565,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( @@ -522,6 +577,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - organization = await response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( @@ -535,11 +591,13 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list() assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list( @@ -553,6 +611,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list() @@ -562,6 +621,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list() as response: @@ -573,11 +633,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete( @@ -585,6 +647,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.delete() @@ -594,6 +657,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.delete() as response: @@ -605,6 +669,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_join_overload_1(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( @@ -612,6 +677,7 @@ async def test_method_join_overload_1(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join( @@ -623,6 +689,7 @@ async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> organization = await response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join( @@ -636,6 +703,7 @@ async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_join_overload_2(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( @@ -643,6 +711,7 @@ async def test_method_join_overload_2(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join( @@ -654,6 +723,7 @@ async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> organization = await response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join( @@ -667,11 +737,13 @@ async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( @@ -679,6 +751,7 @@ async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.leave() @@ -688,6 +761,7 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.leave() as response: @@ -699,11 +773,13 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members() assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( @@ -717,6 +793,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list_members() @@ -726,6 +803,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non organization = await response.parse() assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list_members() as response: @@ -737,11 +815,13 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( @@ -751,6 +831,7 @@ async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.set_role() @@ -760,6 +841,7 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.set_role() as response: diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index ea12d993..754f4395 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -24,6 +24,7 @@ class TestProjects: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( @@ -32,6 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( @@ -43,6 +45,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( @@ -55,6 +58,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( @@ -69,11 +73,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: project = client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( @@ -81,6 +87,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.projects.with_raw_response.retrieve() @@ -90,6 +97,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.projects.with_streaming_response.retrieve() as response: @@ -101,6 +109,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: project = client.projects.update( @@ -108,6 +117,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -119,6 +129,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -132,6 +143,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: project = client.projects.update( @@ -139,6 +151,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -150,6 +163,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -163,6 +177,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_3(self, client: Gitpod) -> None: project = client.projects.update( @@ -170,6 +185,7 @@ def test_method_update_overload_3(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_3(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -181,6 +197,7 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -194,6 +211,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_4(self, client: Gitpod) -> None: project = client.projects.update( @@ -201,6 +219,7 @@ def test_method_update_overload_4(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: project = client.projects.update( @@ -208,6 +227,7 @@ def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_4(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -219,6 +239,7 @@ def test_raw_response_update_overload_4(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -232,6 +253,7 @@ def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_5(self, client: Gitpod) -> None: project = client.projects.update( @@ -239,6 +261,7 @@ def test_method_update_overload_5(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_5(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update( @@ -250,6 +273,7 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update( @@ -263,11 +287,13 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: project = client.projects.list() assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: project = client.projects.list( @@ -280,6 +306,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.with_raw_response.list() @@ -289,6 +316,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.with_streaming_response.list() as response: @@ -300,11 +328,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: project = client.projects.delete() assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: project = client.projects.delete( @@ -312,6 +342,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.with_raw_response.delete() @@ -321,6 +352,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.with_streaming_response.delete() as response: @@ -332,11 +364,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: project = client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( @@ -345,6 +379,7 @@ def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_from_environment(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create_from_environment() @@ -354,6 +389,7 @@ def test_raw_response_create_from_environment(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_from_environment(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create_from_environment() as response: @@ -369,6 +405,7 @@ def test_streaming_response_create_from_environment(self, client: Gitpod) -> Non class TestAsyncProjects: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -377,6 +414,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -388,6 +426,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( @@ -400,6 +439,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create( @@ -414,11 +454,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( @@ -426,6 +468,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.retrieve() @@ -435,6 +478,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.retrieve() as response: @@ -446,6 +490,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -453,6 +498,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -464,6 +510,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -477,6 +524,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -484,6 +532,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -495,6 +544,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -508,6 +558,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -515,6 +566,7 @@ async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -526,6 +578,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -539,6 +592,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -546,6 +600,7 @@ async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -553,6 +608,7 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -564,6 +620,7 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -577,6 +634,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -584,6 +642,7 @@ async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update( @@ -595,6 +654,7 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update( @@ -608,11 +668,13 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list() assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list( @@ -625,6 +687,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.list() @@ -634,6 +697,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.list() as response: @@ -645,11 +709,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete() assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete( @@ -657,6 +723,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.delete() @@ -666,6 +733,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(object, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.delete() as response: @@ -677,11 +745,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( @@ -690,6 +760,7 @@ async def test_method_create_from_environment_with_all_params(self, async_client ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_from_environment(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create_from_environment() @@ -699,6 +770,7 @@ async def test_raw_response_create_from_environment(self, async_client: AsyncGit project = await response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_from_environment(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create_from_environment() as response: diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index cf3bc974..6c510f24 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -25,11 +25,13 @@ class TestRunners: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: runner = client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( @@ -47,6 +49,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create() @@ -56,6 +59,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create() as response: @@ -67,11 +71,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: runner = client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( @@ -79,6 +85,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.with_raw_response.retrieve() @@ -88,6 +95,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.with_streaming_response.retrieve() as response: @@ -99,6 +107,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_1(self, client: Gitpod) -> None: runner = client.runners.update( @@ -106,6 +115,7 @@ def test_method_update_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_1(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( @@ -117,6 +127,7 @@ def test_raw_response_update_overload_1(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( @@ -130,6 +141,7 @@ def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_overload_2(self, client: Gitpod) -> None: runner = client.runners.update( @@ -137,6 +149,7 @@ def test_method_update_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_overload_2(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update( @@ -148,6 +161,7 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update( @@ -161,11 +175,13 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: runner = client.runners.list() assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list( @@ -183,6 +199,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.with_raw_response.list() @@ -192,6 +209,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.with_streaming_response.list() as response: @@ -203,11 +221,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: runner = client.runners.delete() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete( @@ -216,6 +236,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.with_raw_response.delete() @@ -225,6 +246,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.with_streaming_response.delete() as response: @@ -236,11 +258,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_check_authentication_for_host(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( @@ -249,6 +273,7 @@ def test_method_check_authentication_for_host_with_all_params(self, client: Gitp ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: response = client.runners.with_raw_response.check_authentication_for_host() @@ -258,6 +283,7 @@ def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> Non runner = response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: with client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -269,11 +295,13 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: runner = client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( @@ -281,6 +309,7 @@ def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_runner_token(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create_runner_token() @@ -290,6 +319,7 @@ def test_raw_response_create_runner_token(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create_runner_token() as response: @@ -301,11 +331,13 @@ def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_parse_context_url(self, client: Gitpod) -> None: runner = client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( @@ -314,6 +346,7 @@ def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_parse_context_url(self, client: Gitpod) -> None: response = client.runners.with_raw_response.parse_context_url() @@ -323,6 +356,7 @@ def test_raw_response_parse_context_url(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: with client.runners.with_streaming_response.parse_context_url() as response: @@ -338,11 +372,13 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: class TestAsyncRunners: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( @@ -360,6 +396,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create() @@ -369,6 +406,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create() as response: @@ -380,11 +418,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( @@ -392,6 +432,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.retrieve() @@ -401,6 +442,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.retrieve() as response: @@ -412,6 +454,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( @@ -419,6 +462,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( @@ -430,6 +474,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( @@ -443,6 +488,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( @@ -450,6 +496,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update( @@ -461,6 +508,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update( @@ -474,11 +522,13 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list() assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( @@ -496,6 +546,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.list() @@ -505,6 +556,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.list() as response: @@ -516,11 +568,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete( @@ -529,6 +583,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.delete() @@ -538,6 +593,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(object, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.delete() as response: @@ -549,11 +605,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( @@ -562,6 +620,7 @@ async def test_method_check_authentication_for_host_with_all_params(self, async_ ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.check_authentication_for_host() @@ -571,6 +630,7 @@ async def test_raw_response_check_authentication_for_host(self, async_client: As runner = await response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -582,11 +642,13 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( @@ -594,6 +656,7 @@ async def test_method_create_runner_token_with_all_params(self, async_client: As ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create_runner_token() @@ -603,6 +666,7 @@ async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) runner = await response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create_runner_token() as response: @@ -614,11 +678,13 @@ async def test_streaming_response_create_runner_token(self, async_client: AsyncG assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( @@ -627,6 +693,7 @@ async def test_method_parse_context_url_with_all_params(self, async_client: Asyn ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.parse_context_url() @@ -636,6 +703,7 @@ async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.parse_context_url() as response: diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 2ffe8167..07fd383f 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -22,6 +22,7 @@ class TestSecrets: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_create_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -29,6 +30,7 @@ def test_method_create_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -39,6 +41,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_overload_1(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create( @@ -50,6 +53,7 @@ def test_raw_response_create_overload_1(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create( @@ -63,6 +67,7 @@ def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -70,6 +75,7 @@ def test_method_create_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -80,6 +86,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_create_overload_2(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create( @@ -91,6 +98,7 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create( @@ -104,11 +112,13 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: secret = client.secrets.list() assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.list( @@ -122,6 +132,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.list() @@ -131,6 +142,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.list() as response: @@ -142,11 +154,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: secret = client.secrets.delete() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.delete( @@ -154,6 +168,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.delete() @@ -163,6 +178,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.delete() as response: @@ -174,11 +190,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get_value(self, client: Gitpod) -> None: secret = client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.get_value( @@ -186,6 +204,7 @@ def test_method_get_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.get_value() @@ -195,6 +214,7 @@ def test_raw_response_get_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.get_value() as response: @@ -206,11 +226,13 @@ def test_streaming_response_get_value(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_update_value(self, client: Gitpod) -> None: secret = client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_update_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.update_value( @@ -219,6 +241,7 @@ def test_method_update_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_update_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.update_value() @@ -228,6 +251,7 @@ def test_raw_response_update_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_update_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.update_value() as response: @@ -243,6 +267,7 @@ def test_streaming_response_update_value(self, client: Gitpod) -> None: class TestAsyncSecrets: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -250,6 +275,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -260,6 +286,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create( @@ -271,6 +298,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) - secret = await response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create( @@ -284,6 +312,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -291,6 +320,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -301,6 +331,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create( @@ -312,6 +343,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - secret = await response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create( @@ -325,11 +357,13 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list() assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list( @@ -343,6 +377,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.list() @@ -352,6 +387,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.list() as response: @@ -363,11 +399,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete( @@ -375,6 +413,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.delete() @@ -384,6 +423,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.delete() as response: @@ -395,11 +435,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value( @@ -407,6 +449,7 @@ async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.get_value() @@ -416,6 +459,7 @@ async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.get_value() as response: @@ -427,11 +471,13 @@ async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_update_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_update_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value( @@ -440,6 +486,7 @@ async def test_method_update_value_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.update_value() @@ -449,6 +496,7 @@ async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> Non secret = await response.parse() assert_matches_type(object, secret, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_update_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.update_value() as response: diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index 13a6e565..f3707ef5 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -17,11 +17,13 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_get_authenticated_user(self, client: Gitpod) -> None: user = client.users.get_authenticated_user() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> None: user = client.users.get_authenticated_user( @@ -29,6 +31,7 @@ def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: response = client.users.with_raw_response.get_authenticated_user() @@ -38,6 +41,7 @@ def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None: with client.users.with_streaming_response.get_authenticated_user() as response: @@ -49,11 +53,13 @@ def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_set_suspended(self, client: Gitpod) -> None: user = client.users.set_suspended() assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: user = client.users.set_suspended( @@ -62,6 +68,7 @@ def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_set_suspended(self, client: Gitpod) -> None: response = client.users.with_raw_response.set_suspended() @@ -71,6 +78,7 @@ def test_raw_response_set_suspended(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_set_suspended(self, client: Gitpod) -> None: with client.users.with_streaming_response.set_suspended() as response: @@ -86,11 +94,13 @@ def test_streaming_response_set_suspended(self, client: Gitpod) -> None: class TestAsyncUsers: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_authenticated_user_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user( @@ -98,6 +108,7 @@ async def test_method_get_authenticated_user_with_all_params(self, async_client: ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.get_authenticated_user() @@ -107,6 +118,7 @@ async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitp user = await response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.get_authenticated_user() as response: @@ -118,11 +130,13 @@ async def test_streaming_response_get_authenticated_user(self, async_client: Asy assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended() assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_set_suspended_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended( @@ -131,6 +145,7 @@ async def test_method_set_suspended_with_all_params(self, async_client: AsyncGit ) assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.set_suspended() @@ -140,6 +155,7 @@ async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> No user = await response.parse() assert_matches_type(object, user, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_set_suspended(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.set_suspended() as response: diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index c0fa515b..d20704e8 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -18,11 +18,13 @@ class TestPats: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: pat = client.users.pats.list() assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.list( @@ -36,6 +38,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.list() @@ -45,6 +48,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.list() as response: @@ -56,11 +60,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: pat = client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.delete( @@ -68,6 +74,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.delete() @@ -77,6 +84,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.delete() as response: @@ -88,11 +96,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_get(self, client: Gitpod) -> None: pat = client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.get( @@ -100,6 +110,7 @@ def test_method_get_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_get(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.get() @@ -109,6 +120,7 @@ def test_raw_response_get(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.get() as response: @@ -124,11 +136,13 @@ def test_streaming_response_get(self, client: Gitpod) -> None: class TestAsyncPats: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list() assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list( @@ -142,6 +156,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.list() @@ -151,6 +166,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.list() as response: @@ -162,11 +178,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete( @@ -174,6 +192,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.delete() @@ -183,6 +202,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(object, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.delete() as response: @@ -194,11 +214,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get( @@ -206,6 +228,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> No ) assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.get() @@ -215,6 +238,7 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) + @pytest.mark.skip() @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.get() as response: From eb6ca63d5b0e2e001ae308b4f3511b3b01514d7b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 03:19:47 +0000 Subject: [PATCH 079/505] feat(client): send `X-Stainless-Read-Timeout` header (#6) --- src/gitpod/_base_client.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 6e59c860..eb601ba0 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -418,10 +418,17 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: headers[idempotency_header] = options.idempotency_key or self._idempotency_key() - # Don't set the retry count header if it was already set or removed by the caller. We check + # Don't set these headers if they were already set or removed by the caller. We check # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case. - if "x-stainless-retry-count" not in (header.lower() for header in custom_headers): + lower_custom_headers = [header.lower() for header in custom_headers] + if "x-stainless-retry-count" not in lower_custom_headers: headers["x-stainless-retry-count"] = str(retries_taken) + if "x-stainless-read-timeout" not in lower_custom_headers: + timeout = self.timeout if isinstance(options.timeout, NotGiven) else options.timeout + if isinstance(timeout, Timeout): + timeout = timeout.read + if timeout is not None: + headers["x-stainless-read-timeout"] = str(timeout) return headers From 8e02210e8428a095be1f95692447fd4309e73f4c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 13:53:16 +0000 Subject: [PATCH 080/505] chore(internal): fix type traversing dictionary params (#7) --- src/gitpod/_utils/_transform.py | 12 +++++++++++- tests/test_transform.py | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index a6b62cad..18afd9d8 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -25,7 +25,7 @@ is_annotated_type, strip_annotated_type, ) -from .._compat import model_dump, is_typeddict +from .._compat import get_origin, model_dump, is_typeddict _T = TypeVar("_T") @@ -164,9 +164,14 @@ def _transform_recursive( inner_type = annotation stripped_type = strip_annotated_type(inner_type) + origin = get_origin(stripped_type) or stripped_type if is_typeddict(stripped_type) and is_mapping(data): return _transform_typeddict(data, stripped_type) + if origin == dict and is_mapping(data): + items_type = get_args(stripped_type)[1] + return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()} + if ( # List[T] (is_list_type(stripped_type) and is_list(data)) @@ -307,9 +312,14 @@ async def _async_transform_recursive( inner_type = annotation stripped_type = strip_annotated_type(inner_type) + origin = get_origin(stripped_type) or stripped_type if is_typeddict(stripped_type) and is_mapping(data): return await _async_transform_typeddict(data, stripped_type) + if origin == dict and is_mapping(data): + items_type = get_args(stripped_type)[1] + return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()} + if ( # List[T] (is_list_type(stripped_type) and is_list(data)) diff --git a/tests/test_transform.py b/tests/test_transform.py index 6382db3f..816139f0 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -2,7 +2,7 @@ import io import pathlib -from typing import Any, List, Union, TypeVar, Iterable, Optional, cast +from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict @@ -388,6 +388,15 @@ def my_iter() -> Iterable[Baz8]: } +@parametrize +@pytest.mark.asyncio +async def test_dictionary_items(use_async: bool) -> None: + class DictItems(TypedDict): + foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + + assert await transform({"foo": {"foo_baz": "bar"}}, Dict[str, DictItems], use_async) == {"foo": {"fooBaz": "bar"}} + + class TypedDictIterableUnionStr(TypedDict): foo: Annotated[Union[str, Iterable[Baz8]], PropertyInfo(alias="FOO")] From e6334fa33c7d01b8397935ab58dd8e91d4204bc6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 21:45:20 +0000 Subject: [PATCH 081/505] feat(api): try to fix updateenvironmentrequest (#8) --- .stats.yml | 2 +- .../resources/environments/environments.py | 97 ++--------- src/gitpod/types/environment_update_params.py | 158 +++++++++--------- tests/api_resources/test_environments.py | 96 ++--------- 4 files changed, 109 insertions(+), 244 deletions(-) diff --git a/.stats.yml b/.stats.yml index a1528690..d135c04b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e2df4ddd41d8f2552c00f0f93c8b655c7bfb039bd62e654dd7ace9cdd8f9a9f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2410f189970eeb715e79976f13eeca7259b602809e27a84820da8c794dcf00cb.yml diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 6d9d991f..c63cbbfb 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import overload +from typing import Optional import httpx @@ -28,7 +28,6 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -161,11 +160,12 @@ def retrieve( cast_to=EnvironmentRetrieveResponse, ) - @overload def update( self, *, - metadata: object, + environment_id: str | NotGiven = NOT_GIVEN, + metadata: Optional[object] | NotGiven = NOT_GIVEN, + spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -177,32 +177,10 @@ def update( UpdateEnvironment updates the environment partially. Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... + environment_id: environment_id specifies which environment should be updated. - @overload - def update( - self, - *, - spec: environment_update_params.Variant1Spec, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironment updates the environment partially. + +required - Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -211,25 +189,11 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["metadata"], ["spec"]) - def update( - self, - *, - metadata: object | NotGiven = NOT_GIVEN, - spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return self._post( "/gitpod.v1.EnvironmentService/UpdateEnvironment", body=maybe_transform( { + "environment_id": environment_id, "metadata": metadata, "spec": spec, }, @@ -652,11 +616,12 @@ async def retrieve( cast_to=EnvironmentRetrieveResponse, ) - @overload async def update( self, *, - metadata: object, + environment_id: str | NotGiven = NOT_GIVEN, + metadata: Optional[object] | NotGiven = NOT_GIVEN, + spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -668,32 +633,10 @@ async def update( UpdateEnvironment updates the environment partially. Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... + environment_id: environment_id specifies which environment should be updated. - @overload - async def update( - self, - *, - spec: environment_update_params.Variant1Spec, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironment updates the environment partially. + +required - Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -702,25 +645,11 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["metadata"], ["spec"]) - async def update( - self, - *, - metadata: object | NotGiven = NOT_GIVEN, - spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return await self._post( "/gitpod.v1.EnvironmentService/UpdateEnvironment", body=await async_maybe_transform( { + "environment_id": environment_id, "metadata": metadata, "spec": spec, }, diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index 332cd62a..7d936272 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -2,50 +2,52 @@ from __future__ import annotations -from typing import Union, Iterable +from typing import Union, Iterable, Optional from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo __all__ = [ "EnvironmentUpdateParams", - "Variant0", - "Variant1", - "Variant1Spec", - "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment", - "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile", - "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot", - "Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession", - "Variant1SpecContent", - "Variant1SpecContentContent", - "Variant1SpecContentContentTheGitEmailAddress", - "Variant1SpecContentContentTheGitUsername", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit", - "Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit", - "Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization", - "Variant1SpecDevcontainer", - "Variant1SpecDevcontainerDevcontainer", - "Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", - "Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild", - "Variant1SpecTimeoutConfiguresTheEnvironmentTimeout", - "Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout", + "Spec", + "SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment", + "SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile", + "SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot", + "SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession", + "SpecContent", + "SpecContentContent", + "SpecContentContentTheGitEmailAddress", + "SpecContentContentTheGitUsername", + "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized", + "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer", + "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec", + "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL", + "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL", + "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit", + "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit", + "SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization", + "SpecDevcontainer", + "SpecDevcontainerDevcontainer", + "SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", + "SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild", + "SpecTimeoutConfiguresTheEnvironmentTimeout", + "SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout", ] -class Variant0(TypedDict, total=False): - metadata: Required[object] +class EnvironmentUpdateParams(TypedDict, total=False): + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environment_id specifies which environment should be updated. + +required + """ + + metadata: Optional[object] -class Variant1(TypedDict, total=False): - spec: Required[Variant1Spec] + spec: Optional[Spec] -class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot( +class SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot( TypedDict, total=False ): automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] @@ -60,55 +62,55 @@ class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomat """ -class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession(TypedDict, total=False): +class SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession(TypedDict, total=False): session: Required[str] -Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile: TypeAlias = Union[ - Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot, - Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession, +SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile: TypeAlias = Union[ + SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot, + SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession, ] -class Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment(TypedDict, total=False): +class SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment(TypedDict, total=False): automations_file: Required[ Annotated[ - Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile, + SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile, PropertyInfo(alias="automationsFile"), ] ] """automations_file is the automations file spec of the environment""" -class Variant1SpecContentContentTheGitEmailAddress(TypedDict, total=False): +class SpecContentContentTheGitEmailAddress(TypedDict, total=False): git_email: Required[Annotated[str, PropertyInfo(alias="gitEmail")]] """The Git email address""" -class Variant1SpecContentContentTheGitUsername(TypedDict, total=False): +class SpecContentContentTheGitUsername(TypedDict, total=False): git_username: Required[Annotated[str, PropertyInfo(alias="gitUsername")]] """The Git username""" -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL( +class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL( TypedDict, total=False ): url: str """url is the URL from which the environment is created""" -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL( +class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL( TypedDict, total=False ): context_url: Required[ Annotated[ - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL, + SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl"), ] ] -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit( +class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit( TypedDict, total=False ): checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] @@ -138,49 +140,45 @@ class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInit """upstream_Remote_uri is the fork upstream of a repository""" -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit( +class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit( TypedDict, total=False ): - git: Required[ - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit - ] + git: Required[SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit] -Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec: TypeAlias = Union[ - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL, - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit, +SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec: TypeAlias = Union[ + SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL, + SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit, ] -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer( - TypedDict, total=False -): - specs: Iterable[Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec] +class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer(TypedDict, total=False): + specs: Iterable[SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec] -class Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized(TypedDict, total=False): - initializer: Required[Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer] +class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized(TypedDict, total=False): + initializer: Required[SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer] """EnvironmentInitializer specifies how an environment is to be initialized""" -class Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization(TypedDict, total=False): +class SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization(TypedDict, total=False): session: Required[str] """session should be changed to trigger a content reinitialization""" -Variant1SpecContentContent: TypeAlias = Union[ - Variant1SpecContentContentTheGitEmailAddress, - Variant1SpecContentContentTheGitUsername, - Variant1SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized, - Variant1SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization, +SpecContentContent: TypeAlias = Union[ + SpecContentContentTheGitEmailAddress, + SpecContentContentTheGitUsername, + SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized, + SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization, ] -class Variant1SpecContent(TypedDict, total=False): - content: Required[Variant1SpecContentContent] +class SpecContent(TypedDict, total=False): + content: Required[SpecContentContent] -class Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot( +class SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot( TypedDict, total=False ): devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] @@ -194,22 +192,22 @@ class Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevc """ -class Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild(TypedDict, total=False): +class SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild(TypedDict, total=False): session: Required[str] """session should be changed to trigger a devcontainer rebuild""" -Variant1SpecDevcontainerDevcontainer: TypeAlias = Union[ - Variant1SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, - Variant1SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild, +SpecDevcontainerDevcontainer: TypeAlias = Union[ + SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, + SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild, ] -class Variant1SpecDevcontainer(TypedDict, total=False): - devcontainer: Required[Variant1SpecDevcontainerDevcontainer] +class SpecDevcontainer(TypedDict, total=False): + devcontainer: Required[SpecDevcontainerDevcontainer] -class Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout(TypedDict, total=False): +class SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout(TypedDict, total=False): disconnected: Required[str] """ A Duration represents a signed, fixed-length span of time represented as a count @@ -272,16 +270,14 @@ class Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout(TypedDict, total """ -class Variant1SpecTimeoutConfiguresTheEnvironmentTimeout(TypedDict, total=False): - timeout: Required[Variant1SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout] +class SpecTimeoutConfiguresTheEnvironmentTimeout(TypedDict, total=False): + timeout: Required[SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout] """Timeout configures the environment timeout""" -Variant1Spec: TypeAlias = Union[ - Variant1SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment, - Variant1SpecContent, - Variant1SpecDevcontainer, - Variant1SpecTimeoutConfiguresTheEnvironmentTimeout, +Spec: TypeAlias = Union[ + SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment, + SpecContent, + SpecDevcontainer, + SpecTimeoutConfiguresTheEnvironmentTimeout, ] - -EnvironmentUpdateParams: TypeAlias = Union[Variant0, Variant1] diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 08dc4635..b954bf53 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -144,52 +144,24 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - environment = client.environments.update( - metadata={}, - ) + def test_method_update(self, client: Gitpod) -> None: + environment = client.environments.update() assert_matches_type(object, environment, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.update( - metadata={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = response.parse() - assert_matches_type(object, environment, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.update( - metadata={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = response.parse() - assert_matches_type(object, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: environment = client.environments.update( + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={}, spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, ) assert_matches_type(object, environment, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - ) + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -198,10 +170,8 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - ) as response: + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -649,52 +619,24 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.update( - metadata={}, - ) + async def test_method_update(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.update() assert_matches_type(object, environment, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.update( - metadata={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment = await response.parse() - assert_matches_type(object, environment, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.update( - metadata={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment = await response.parse() - assert_matches_type(object, environment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + metadata={}, spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, ) assert_matches_type(object, environment, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - ) + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -703,10 +645,8 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.update( - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, - ) as response: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" From 88d295e11edbbced2f11c4a982e530b6e7a87fd5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 03:18:17 +0000 Subject: [PATCH 082/505] chore(internal): minor type handling changes (#9) --- src/gitpod/_models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 12c34b7d..c4401ff8 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -426,10 +426,16 @@ def construct_type(*, value: object, type_: object) -> object: If the given value does not match the expected type then it is returned as-is. """ + + # store a reference to the original type we were given before we extract any inner + # types so that we can properly resolve forward references in `TypeAliasType` annotations + original_type = None + # we allow `object` as the input type because otherwise, passing things like # `Literal['value']` will be reported as a type error by type checkers type_ = cast("type[object]", type_) if is_type_alias_type(type_): + original_type = type_ # type: ignore[unreachable] type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` @@ -446,7 +452,7 @@ def construct_type(*, value: object, type_: object) -> object: if is_union(origin): try: - return validate_type(type_=cast("type[object]", type_), value=value) + return validate_type(type_=cast("type[object]", original_type or type_), value=value) except Exception: pass From fffe7e589cc5005d6ca98cec11de024203d7eb08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:11:27 +0000 Subject: [PATCH 083/505] feat(api): update to latest changes (#10) --- .stats.yml | 2 +- api.md | 152 ++- src/gitpod/resources/accounts.py | 32 +- src/gitpod/resources/editors.py | 14 +- .../environments/automations/automations.py | 5 +- .../environments/automations/services.py | 24 +- .../automations/tasks/executions.py | 14 +- .../environments/automations/tasks/tasks.py | 24 +- src/gitpod/resources/environments/classes.py | 14 +- .../resources/environments/environments.py | 110 +- src/gitpod/resources/events.py | 93 +- src/gitpod/resources/groups.py | 14 +- .../resources/organizations/organizations.py | 235 +--- .../organizations/sso_configurations.py | 299 +---- src/gitpod/resources/projects/policies.py | 33 +- src/gitpod/resources/projects/projects.py | 293 +---- .../runners/configurations/configurations.py | 165 +-- .../configurations/environment_classes.py | 173 +-- .../host_authentication_tokens.py | 188 +-- .../configurations/scm_integrations.py | 279 +---- src/gitpod/resources/runners/policies.py | 33 +- src/gitpod/resources/runners/runners.py | 150 +-- src/gitpod/resources/secrets.py | 132 +- src/gitpod/resources/users/pats.py | 14 +- src/gitpod/types/__init__.py | 67 +- src/gitpod/types/account.py | 222 ++++ .../types/account_get_sso_login_url_params.py | 9 +- src/gitpod/types/account_membership.py | 30 + src/gitpod/types/account_retrieve_response.py | 13 +- src/gitpod/types/admission_level.py | 9 + .../{editor_list_response.py => editor.py} | 4 +- src/gitpod/types/editor_retrieve_response.py | 21 +- src/gitpod/types/environment.py | 34 + .../types/environment_activity_signal.py | 109 ++ .../environment_activity_signal_param.py | 112 ++ .../environment_create_from_project_params.py | 331 +---- ...nvironment_create_from_project_response.py | 1096 +---------------- src/gitpod/types/environment_create_params.py | 332 +---- .../types/environment_create_response.py | 1096 +---------------- src/gitpod/types/environment_initializer.py | 52 + .../types/environment_initializer_param.py | 53 + src/gitpod/types/environment_list_params.py | 30 +- src/gitpod/types/environment_list_response.py | 1093 ---------------- .../types/environment_mark_active_params.py | 108 +- src/gitpod/types/environment_metadata.py | 227 ++++ src/gitpod/types/environment_phase.py | 17 + .../types/environment_retrieve_response.py | 1096 +---------------- src/gitpod/types/environment_spec.py | 217 ++++ src/gitpod/types/environment_spec_param.py | 224 ++++ src/gitpod/types/environment_status.py | 403 ++++++ src/gitpod/types/environment_update_params.py | 212 +--- src/gitpod/types/environments/__init__.py | 2 +- .../environments/automation_upsert_params.py | 104 +- .../environments/automations/__init__.py | 14 +- .../types/environments/automations/service.py | 24 + .../automations/service_create_params.py | 258 +--- .../automations/service_create_response.py | 309 +---- .../automations/service_list_response.py | 308 ----- .../automations/service_metadata.py | 132 ++ .../automations/service_metadata_param.py | 133 ++ .../environments/automations/service_phase.py | 15 + .../automations/service_retrieve_response.py | 309 +---- .../environments/automations/service_spec.py | 72 ++ .../automations/service_spec_param.py | 72 ++ .../automations/service_status.py | 37 + .../automations/service_update_params.py | 133 +- .../types/environments/automations/task.py | 24 + .../automations/task_create_params.py | 194 +-- .../automations/task_create_response.py | 208 +--- ...task_list_response.py => task_metadata.py} | 89 +- .../automations/task_metadata_param.py | 133 ++ .../automations/task_retrieve_response.py | 208 +--- .../environments/automations/task_spec.py | 18 + .../automations/task_spec_param.py | 18 + .../automations/task_start_response.py | 485 +------- .../automations/task_update_params.py | 81 +- .../automations/tasks/__init__.py | 1 - .../tasks/execution_list_params.py | 14 +- .../tasks/execution_list_response.py | 486 -------- .../tasks/execution_retrieve_response.py | 485 +------- .../environments/automations_file_param.py | 77 ++ .../types/environments/class_list_params.py | 8 +- src/gitpod/types/event_list_params.py | 44 +- src/gitpod/types/event_list_response.py | 37 +- src/gitpod/types/event_watch_params.py | 27 +- src/gitpod/types/event_watch_response.py | 36 +- .../{group_list_response.py => group.py} | 4 +- ...ity_get_authenticated_identity_response.py | 21 +- src/gitpod/types/invite_domains.py | 12 + src/gitpod/types/invite_domains_param.py | 13 + src/gitpod/types/joinable_organization.py | 23 + ...roviders_response.py => login_provider.py} | 4 +- ...ation_list_response.py => organization.py} | 12 +- .../types/organization_create_response.py | 322 +---- src/gitpod/types/organization_join_params.py | 23 +- .../types/organization_join_response.py | 122 +- src/gitpod/types/organization_list_params.py | 5 +- ...ers_response.py => organization_member.py} | 15 +- .../types/organization_retrieve_response.py | 205 +-- .../types/organization_set_role_params.py | 5 +- .../types/organization_update_params.py | 33 +- .../types/organization_update_response.py | 205 +-- src/gitpod/types/organizations/__init__.py | 5 +- .../organizations/invite_create_response.py | 15 +- .../organizations/invite_retrieve_response.py | 15 +- .../organizations/organization_invite.py | 17 + .../types/organizations/provider_type.py | 7 + ..._list_response.py => sso_configuration.py} | 17 +- .../sso_configuration_create_response.py | 36 +- .../sso_configuration_retrieve_response.py | 36 +- .../organizations/sso_configuration_state.py | 9 + .../sso_configuration_update_params.py | 51 +- src/gitpod/types/project.py | 50 + ...roject_create_from_environment_response.py | 359 +----- src/gitpod/types/project_create_params.py | 91 +- src/gitpod/types/project_create_response.py | 359 +----- src/gitpod/types/project_environment_class.py | 20 + .../types/project_environment_class_param.py | 20 + ...t_list_response.py => project_metadata.py} | 162 +-- src/gitpod/types/project_retrieve_response.py | 359 +----- src/gitpod/types/project_update_params.py | 129 +- src/gitpod/types/project_update_response.py | 359 +----- src/gitpod/types/projects/__init__.py | 3 +- .../types/projects/policy_create_params.py | 5 +- .../types/projects/policy_create_response.py | 15 +- .../types/projects/policy_update_params.py | 5 +- .../types/projects/policy_update_response.py | 15 +- .../project_policy.py} | 8 +- src/gitpod/types/projects/project_role.py | 7 + src/gitpod/types/resource_operation.py | 13 + src/gitpod/types/resource_type.py | 26 + src/gitpod/types/runner.py | 225 ++++ src/gitpod/types/runner_capability.py | 7 + src/gitpod/types/runner_configuration.py | 25 + .../types/runner_configuration_param.py | 25 + src/gitpod/types/runner_create_params.py | 58 +- src/gitpod/types/runner_create_response.py | 431 +------ .../runner_create_runner_token_response.py | 8 + src/gitpod/types/runner_kind.py | 9 + src/gitpod/types/runner_list_params.py | 17 +- src/gitpod/types/runner_phase.py | 15 + src/gitpod/types/runner_provider.py | 12 + src/gitpod/types/runner_release_channel.py | 9 + src/gitpod/types/runner_retrieve_response.py | 427 +------ src/gitpod/types/runner_spec.py | 19 + src/gitpod/types/runner_spec_param.py | 19 + src/gitpod/types/runner_status.py | 134 ++ src/gitpod/types/runner_update_params.py | 84 +- src/gitpod/types/runners/__init__.py | 6 +- .../runners/configuration_validate_params.py | 98 +- .../configuration_validate_response.py | 67 +- .../types/runners/configurations/__init__.py | 10 +- .../environment_class_create_params.py | 11 +- .../environment_class_list_params.py | 8 +- .../environment_class_list_response.py | 41 - .../environment_class_retrieve_response.py | 37 +- .../environment_class_update_params.py | 21 +- ...sponse.py => host_authentication_token.py} | 14 +- ...host_authentication_token_create_params.py | 9 +- ...st_authentication_token_create_response.py | 119 +- .../host_authentication_token_list_params.py | 17 +- ..._authentication_token_retrieve_response.py | 119 +- .../host_authentication_token_source.py | 11 + ...host_authentication_token_update_params.py | 25 +- .../runner_configuration_schema.py | 169 +++ .../schema_retrieve_response.py | 293 +---- ...on_list_response.py => scm_integration.py} | 20 +- .../scm_integration_create_params.py | 36 +- .../scm_integration_oauth_config.py | 20 + .../scm_integration_retrieve_response.py | 22 +- .../scm_integration_update_params.py | 38 +- .../environment_class_validation_result.py | 20 + .../types/runners/field_validation_error.py | 13 + .../types/runners/policy_create_params.py | 5 +- .../types/runners/policy_create_response.py | 15 +- .../types/runners/policy_update_params.py | 5 +- .../types/runners/policy_update_response.py | 15 +- .../runner_policy.py} | 8 +- src/gitpod/types/runners/runner_role.py | 7 + .../scm_integration_validation_result.py | 21 + src/gitpod/types/scope.py | 7 + src/gitpod/types/secret.py | 217 ++++ src/gitpod/types/secret_create_params.py | 30 +- src/gitpod/types/secret_create_response.py | 32 +- src/gitpod/types/secret_list_response.py | 459 ------- src/gitpod/types/shared/__init__.py | 15 + src/gitpod/types/shared/automation_trigger.py | 17 + .../environment_class.py} | 13 +- src/gitpod/types/shared/field_value.py | 13 + src/gitpod/types/shared/organization_role.py | 9 + src/gitpod/types/shared/principal.py | 14 + src/gitpod/types/shared/runs_on.py | 17 + src/gitpod/types/shared/subject.py | 16 + src/gitpod/types/shared/task_execution.py | 20 + .../task_execution_metadata.py} | 154 +-- .../types/shared/task_execution_phase.py | 14 + .../types/shared/task_execution_spec.py | 49 + .../types/shared/task_execution_status.py | 58 + src/gitpod/types/shared/user_status.py | 9 + src/gitpod/types/shared_params/__init__.py | 10 + .../types/shared_params/automation_trigger.py | 17 + .../types/shared_params/environment_class.py | 37 + src/gitpod/types/shared_params/field_value.py | 13 + .../types/shared_params/organization_role.py | 11 + src/gitpod/types/shared_params/principal.py | 16 + src/gitpod/types/shared_params/runs_on.py | 18 + src/gitpod/types/shared_params/subject.py | 17 + .../shared_params/task_execution_phase.py | 16 + src/gitpod/types/user.py | 123 ++ .../user_get_authenticated_user_response.py | 121 +- src/gitpod/types/users/__init__.py | 2 +- src/gitpod/types/users/pat_get_response.py | 312 +---- ...t_response.py => personal_access_token.py} | 25 +- .../automations/tasks/test_executions.py | 18 +- .../environments/automations/test_services.py | 104 +- .../environments/automations/test_tasks.py | 82 +- .../environments/test_classes.py | 28 +- .../organizations/test_sso_configurations.py | 330 +---- tests/api_resources/projects/test_policies.py | 18 +- .../test_environment_classes.py | 206 +--- .../test_host_authentication_tokens.py | 210 +--- .../configurations/test_scm_integrations.py | 282 +---- .../runners/test_configurations.py | 144 +-- tests/api_resources/runners/test_policies.py | 18 +- tests/api_resources/test_accounts.py | 46 +- tests/api_resources/test_editors.py | 18 +- tests/api_resources/test_environments.py | 178 ++- tests/api_resources/test_events.py | 94 +- tests/api_resources/test_groups.py | 18 +- tests/api_resources/test_organizations.py | 238 +--- tests/api_resources/test_projects.py | 420 ++----- tests/api_resources/test_runners.py | 130 +- tests/api_resources/test_secrets.py | 146 +-- tests/api_resources/users/test_pats.py | 18 +- 234 files changed, 6242 insertions(+), 18790 deletions(-) create mode 100644 src/gitpod/types/account.py create mode 100644 src/gitpod/types/account_membership.py create mode 100644 src/gitpod/types/admission_level.py rename src/gitpod/types/{editor_list_response.py => editor.py} (90%) create mode 100644 src/gitpod/types/environment.py create mode 100644 src/gitpod/types/environment_activity_signal.py create mode 100644 src/gitpod/types/environment_activity_signal_param.py create mode 100644 src/gitpod/types/environment_initializer.py create mode 100644 src/gitpod/types/environment_initializer_param.py delete mode 100644 src/gitpod/types/environment_list_response.py create mode 100644 src/gitpod/types/environment_metadata.py create mode 100644 src/gitpod/types/environment_phase.py create mode 100644 src/gitpod/types/environment_spec.py create mode 100644 src/gitpod/types/environment_spec_param.py create mode 100644 src/gitpod/types/environment_status.py create mode 100644 src/gitpod/types/environments/automations/service.py delete mode 100644 src/gitpod/types/environments/automations/service_list_response.py create mode 100644 src/gitpod/types/environments/automations/service_metadata.py create mode 100644 src/gitpod/types/environments/automations/service_metadata_param.py create mode 100644 src/gitpod/types/environments/automations/service_phase.py create mode 100644 src/gitpod/types/environments/automations/service_spec.py create mode 100644 src/gitpod/types/environments/automations/service_spec_param.py create mode 100644 src/gitpod/types/environments/automations/service_status.py create mode 100644 src/gitpod/types/environments/automations/task.py rename src/gitpod/types/environments/automations/{task_list_response.py => task_metadata.py} (68%) create mode 100644 src/gitpod/types/environments/automations/task_metadata_param.py create mode 100644 src/gitpod/types/environments/automations/task_spec.py create mode 100644 src/gitpod/types/environments/automations/task_spec_param.py delete mode 100644 src/gitpod/types/environments/automations/tasks/execution_list_response.py create mode 100644 src/gitpod/types/environments/automations_file_param.py rename src/gitpod/types/{group_list_response.py => group.py} (99%) create mode 100644 src/gitpod/types/invite_domains.py create mode 100644 src/gitpod/types/invite_domains_param.py create mode 100644 src/gitpod/types/joinable_organization.py rename src/gitpod/types/{account_list_login_providers_response.py => login_provider.py} (82%) rename src/gitpod/types/{organization_list_response.py => organization.py} (96%) rename src/gitpod/types/{organization_list_members_response.py => organization_member.py} (91%) create mode 100644 src/gitpod/types/organizations/organization_invite.py create mode 100644 src/gitpod/types/organizations/provider_type.py rename src/gitpod/types/organizations/{sso_configuration_list_response.py => sso_configuration.py} (66%) create mode 100644 src/gitpod/types/organizations/sso_configuration_state.py create mode 100644 src/gitpod/types/project.py create mode 100644 src/gitpod/types/project_environment_class.py create mode 100644 src/gitpod/types/project_environment_class_param.py rename src/gitpod/types/{project_list_response.py => project_metadata.py} (63%) rename src/gitpod/types/{runners/policy_list_response.py => projects/project_policy.py} (59%) create mode 100644 src/gitpod/types/projects/project_role.py create mode 100644 src/gitpod/types/resource_operation.py create mode 100644 src/gitpod/types/resource_type.py create mode 100644 src/gitpod/types/runner.py create mode 100644 src/gitpod/types/runner_capability.py create mode 100644 src/gitpod/types/runner_configuration.py create mode 100644 src/gitpod/types/runner_configuration_param.py create mode 100644 src/gitpod/types/runner_kind.py create mode 100644 src/gitpod/types/runner_phase.py create mode 100644 src/gitpod/types/runner_provider.py create mode 100644 src/gitpod/types/runner_release_channel.py create mode 100644 src/gitpod/types/runner_spec.py create mode 100644 src/gitpod/types/runner_spec_param.py create mode 100644 src/gitpod/types/runner_status.py delete mode 100644 src/gitpod/types/runners/configurations/environment_class_list_response.py rename src/gitpod/types/runners/configurations/{host_authentication_token_list_response.py => host_authentication_token.py} (92%) create mode 100644 src/gitpod/types/runners/configurations/host_authentication_token_source.py create mode 100644 src/gitpod/types/runners/configurations/runner_configuration_schema.py rename src/gitpod/types/runners/configurations/{scm_integration_list_response.py => scm_integration.py} (55%) create mode 100644 src/gitpod/types/runners/configurations/scm_integration_oauth_config.py create mode 100644 src/gitpod/types/runners/environment_class_validation_result.py create mode 100644 src/gitpod/types/runners/field_validation_error.py rename src/gitpod/types/{projects/policy_list_response.py => runners/runner_policy.py} (59%) create mode 100644 src/gitpod/types/runners/runner_role.py create mode 100644 src/gitpod/types/runners/scm_integration_validation_result.py create mode 100644 src/gitpod/types/scope.py create mode 100644 src/gitpod/types/secret.py delete mode 100644 src/gitpod/types/secret_list_response.py create mode 100644 src/gitpod/types/shared/__init__.py create mode 100644 src/gitpod/types/shared/automation_trigger.py rename src/gitpod/types/{environments/class_list_response.py => shared/environment_class.py} (80%) create mode 100644 src/gitpod/types/shared/field_value.py create mode 100644 src/gitpod/types/shared/organization_role.py create mode 100644 src/gitpod/types/shared/principal.py create mode 100644 src/gitpod/types/shared/runs_on.py create mode 100644 src/gitpod/types/shared/subject.py create mode 100644 src/gitpod/types/shared/task_execution.py rename src/gitpod/types/{runner_list_response.py => shared/task_execution_metadata.py} (72%) create mode 100644 src/gitpod/types/shared/task_execution_phase.py create mode 100644 src/gitpod/types/shared/task_execution_spec.py create mode 100644 src/gitpod/types/shared/task_execution_status.py create mode 100644 src/gitpod/types/shared/user_status.py create mode 100644 src/gitpod/types/shared_params/__init__.py create mode 100644 src/gitpod/types/shared_params/automation_trigger.py create mode 100644 src/gitpod/types/shared_params/environment_class.py create mode 100644 src/gitpod/types/shared_params/field_value.py create mode 100644 src/gitpod/types/shared_params/organization_role.py create mode 100644 src/gitpod/types/shared_params/principal.py create mode 100644 src/gitpod/types/shared_params/runs_on.py create mode 100644 src/gitpod/types/shared_params/subject.py create mode 100644 src/gitpod/types/shared_params/task_execution_phase.py create mode 100644 src/gitpod/types/user.py rename src/gitpod/types/users/{pat_list_response.py => personal_access_token.py} (95%) diff --git a/.stats.yml b/.stats.yml index d135c04b..1b7c9868 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2410f189970eeb715e79976f13eeca7259b602809e27a84820da8c794dcf00cb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da4c36c6b1d973f481abb8eefdeb085d88eaf37eeaba30d276cb3daa405b6f0c.yml diff --git a/api.md b/api.md index b6305519..40b1aeab 100644 --- a/api.md +++ b/api.md @@ -1,13 +1,36 @@ +# Shared Types + +```python +from gitpod.types import ( + AutomationTrigger, + EnvironmentClass, + FieldValue, + OrganizationRole, + Principal, + RunsOn, + Subject, + TaskExecution, + TaskExecutionMetadata, + TaskExecutionPhase, + TaskExecutionSpec, + TaskExecutionStatus, + UserStatus, +) +``` + # Accounts Types: ```python from gitpod.types import ( + Account, + AccountMembership, + JoinableOrganization, + LoginProvider, AccountRetrieveResponse, AccountDeleteResponse, AccountGetSSOLoginURLResponse, - AccountListLoginProvidersResponse, ) ``` @@ -16,20 +39,20 @@ Methods: - client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse - client.accounts.delete(\*\*params) -> object - client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse -- client.accounts.list_login_providers(\*\*params) -> SyncLoginProvidersPage[AccountListLoginProvidersResponse] +- client.accounts.list_login_providers(\*\*params) -> SyncLoginProvidersPage[LoginProvider] # Editors Types: ```python -from gitpod.types import EditorRetrieveResponse, EditorListResponse, EditorResolveURLResponse +from gitpod.types import Editor, EditorRetrieveResponse, EditorResolveURLResponse ``` Methods: - client.editors.retrieve(\*\*params) -> EditorRetrieveResponse -- client.editors.list(\*\*params) -> SyncEditorsPage[EditorListResponse] +- client.editors.list(\*\*params) -> SyncEditorsPage[Editor] - client.editors.resolve_url(\*\*params) -> EditorResolveURLResponse # Environments @@ -38,10 +61,16 @@ Types: ```python from gitpod.types import ( + AdmissionLevel, + Environment, + EnvironmentActivitySignal, + EnvironmentMetadata, + EnvironmentPhase, + EnvironmentSpec, + EnvironmentStatus, EnvironmentCreateResponse, EnvironmentRetrieveResponse, EnvironmentUpdateResponse, - EnvironmentListResponse, EnvironmentDeleteResponse, EnvironmentCreateFromProjectResponse, EnvironmentCreateLogsTokenResponse, @@ -56,7 +85,7 @@ Methods: - client.environments.create(\*\*params) -> EnvironmentCreateResponse - client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse - client.environments.update(\*\*params) -> object -- client.environments.list(\*\*params) -> SyncEnvironmentsPage[EnvironmentListResponse] +- client.environments.list(\*\*params) -> SyncEnvironmentsPage[Environment] - client.environments.delete(\*\*params) -> object - client.environments.create_from_project(\*\*params) -> EnvironmentCreateFromProjectResponse - client.environments.create_logs_token(\*\*params) -> EnvironmentCreateLogsTokenResponse @@ -69,7 +98,7 @@ Methods: Types: ```python -from gitpod.types.environments import AutomationUpsertResponse +from gitpod.types.environments import AutomationsFile, AutomationUpsertResponse ``` Methods: @@ -82,10 +111,14 @@ Types: ```python from gitpod.types.environments.automations import ( + Service, + ServiceMetadata, + ServicePhase, + ServiceSpec, + ServiceStatus, ServiceCreateResponse, ServiceRetrieveResponse, ServiceUpdateResponse, - ServiceListResponse, ServiceDeleteResponse, ServiceStartResponse, ServiceStopResponse, @@ -97,7 +130,7 @@ Methods: - client.environments.automations.services.create(\*\*params) -> ServiceCreateResponse - client.environments.automations.services.retrieve(\*\*params) -> ServiceRetrieveResponse - client.environments.automations.services.update(\*\*params) -> object -- client.environments.automations.services.list(\*\*params) -> SyncServicesPage[ServiceListResponse] +- client.environments.automations.services.list(\*\*params) -> SyncServicesPage[Service] - client.environments.automations.services.delete(\*\*params) -> object - client.environments.automations.services.start(\*\*params) -> object - client.environments.automations.services.stop(\*\*params) -> object @@ -108,10 +141,12 @@ Types: ```python from gitpod.types.environments.automations import ( + Task, + TaskMetadata, + TaskSpec, TaskCreateResponse, TaskRetrieveResponse, TaskUpdateResponse, - TaskListResponse, TaskDeleteResponse, TaskStartResponse, ) @@ -122,7 +157,7 @@ Methods: - client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse - client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse - client.environments.automations.tasks.update(\*\*params) -> object -- client.environments.automations.tasks.list(\*\*params) -> SyncTasksPage[TaskListResponse] +- client.environments.automations.tasks.list(\*\*params) -> SyncTasksPage[Task] - client.environments.automations.tasks.delete(\*\*params) -> object - client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse @@ -133,7 +168,6 @@ Types: ```python from gitpod.types.environments.automations.tasks import ( ExecutionRetrieveResponse, - ExecutionListResponse, ExecutionStopResponse, ) ``` @@ -141,27 +175,21 @@ from gitpod.types.environments.automations.tasks import ( Methods: - client.environments.automations.tasks.executions.retrieve(\*\*params) -> ExecutionRetrieveResponse -- client.environments.automations.tasks.executions.list(\*\*params) -> SyncTaskExecutionsPage[ExecutionListResponse] +- client.environments.automations.tasks.executions.list(\*\*params) -> SyncTaskExecutionsPage[TaskExecution] - client.environments.automations.tasks.executions.stop(\*\*params) -> object ## Classes -Types: - -```python -from gitpod.types.environments import ClassListResponse -``` - Methods: -- client.environments.classes.list(\*\*params) -> SyncEnvironmentClassesPage[ClassListResponse] +- client.environments.classes.list(\*\*params) -> SyncEnvironmentClassesPage[EnvironmentClass] # Events Types: ```python -from gitpod.types import EventListResponse, EventWatchResponse +from gitpod.types import ResourceOperation, ResourceType, EventListResponse, EventWatchResponse ``` Methods: @@ -174,12 +202,12 @@ Methods: Types: ```python -from gitpod.types import GroupListResponse +from gitpod.types import Group ``` Methods: -- client.groups.list(\*\*params) -> SyncGroupsPage[GroupListResponse] +- client.groups.list(\*\*params) -> SyncGroupsPage[Group] # Identity @@ -205,14 +233,16 @@ Types: ```python from gitpod.types import ( + InviteDomains, + Organization, + OrganizationMember, + Scope, OrganizationCreateResponse, OrganizationRetrieveResponse, OrganizationUpdateResponse, - OrganizationListResponse, OrganizationDeleteResponse, OrganizationJoinResponse, OrganizationLeaveResponse, - OrganizationListMembersResponse, OrganizationSetRoleResponse, ) ``` @@ -222,11 +252,11 @@ Methods: - client.organizations.create(\*\*params) -> OrganizationCreateResponse - client.organizations.retrieve(\*\*params) -> OrganizationRetrieveResponse - client.organizations.update(\*\*params) -> OrganizationUpdateResponse -- client.organizations.list(\*\*params) -> SyncOrganizationsPage[OrganizationListResponse] +- client.organizations.list(\*\*params) -> SyncOrganizationsPage[Organization] - client.organizations.delete(\*\*params) -> object - client.organizations.join(\*\*params) -> OrganizationJoinResponse - client.organizations.leave(\*\*params) -> object -- client.organizations.list_members(\*\*params) -> SyncMembersPage[OrganizationListMembersResponse] +- client.organizations.list_members(\*\*params) -> SyncMembersPage[OrganizationMember] - client.organizations.set_role(\*\*params) -> object ## Invites @@ -235,6 +265,7 @@ Types: ```python from gitpod.types.organizations import ( + OrganizationInvite, InviteCreateResponse, InviteRetrieveResponse, InviteGetSummaryResponse, @@ -253,10 +284,12 @@ Types: ```python from gitpod.types.organizations import ( + ProviderType, + SSOConfiguration, + SSOConfigurationState, SSOConfigurationCreateResponse, SSOConfigurationRetrieveResponse, SSOConfigurationUpdateResponse, - SSOConfigurationListResponse, SSOConfigurationDeleteResponse, ) ``` @@ -266,7 +299,7 @@ Methods: - client.organizations.sso_configurations.create(\*\*params) -> SSOConfigurationCreateResponse - client.organizations.sso_configurations.retrieve(\*\*params) -> SSOConfigurationRetrieveResponse - client.organizations.sso_configurations.update(\*\*params) -> object -- client.organizations.sso_configurations.list(\*\*params) -> SyncSSOConfigurationsPage[SSOConfigurationListResponse] +- client.organizations.sso_configurations.list(\*\*params) -> SyncSSOConfigurationsPage[SSOConfiguration] - client.organizations.sso_configurations.delete(\*\*params) -> object # Projects @@ -275,10 +308,13 @@ Types: ```python from gitpod.types import ( + EnvironmentInitializer, + Project, + ProjectEnvironmentClass, + ProjectMetadata, ProjectCreateResponse, ProjectRetrieveResponse, ProjectUpdateResponse, - ProjectListResponse, ProjectDeleteResponse, ProjectCreateFromEnvironmentResponse, ) @@ -289,7 +325,7 @@ Methods: - client.projects.create(\*\*params) -> ProjectCreateResponse - client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse - client.projects.update(\*\*params) -> ProjectUpdateResponse -- client.projects.list(\*\*params) -> SyncProjectsPage[ProjectListResponse] +- client.projects.list(\*\*params) -> SyncProjectsPage[Project] - client.projects.delete(\*\*params) -> object - client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse @@ -299,9 +335,10 @@ Types: ```python from gitpod.types.projects import ( + ProjectPolicy, + ProjectRole, PolicyCreateResponse, PolicyUpdateResponse, - PolicyListResponse, PolicyDeleteResponse, ) ``` @@ -310,7 +347,7 @@ Methods: - client.projects.policies.create(\*\*params) -> PolicyCreateResponse - client.projects.policies.update(\*\*params) -> PolicyUpdateResponse -- client.projects.policies.list(\*\*params) -> SyncPoliciesPage[PolicyListResponse] +- client.projects.policies.list(\*\*params) -> SyncPoliciesPage[ProjectPolicy] - client.projects.policies.delete(\*\*params) -> object # Runners @@ -319,10 +356,18 @@ Types: ```python from gitpod.types import ( + Runner, + RunnerCapability, + RunnerConfiguration, + RunnerKind, + RunnerPhase, + RunnerProvider, + RunnerReleaseChannel, + RunnerSpec, + RunnerStatus, RunnerCreateResponse, RunnerRetrieveResponse, RunnerUpdateResponse, - RunnerListResponse, RunnerDeleteResponse, RunnerCheckAuthenticationForHostResponse, RunnerCreateRunnerTokenResponse, @@ -335,7 +380,7 @@ Methods: - client.runners.create(\*\*params) -> RunnerCreateResponse - client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse - client.runners.update(\*\*params) -> object -- client.runners.list(\*\*params) -> SyncRunnersPage[RunnerListResponse] +- client.runners.list(\*\*params) -> SyncRunnersPage[Runner] - client.runners.delete(\*\*params) -> object - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse @@ -346,7 +391,12 @@ Methods: Types: ```python -from gitpod.types.runners import ConfigurationValidateResponse +from gitpod.types.runners import ( + EnvironmentClassValidationResult, + FieldValidationError, + ScmIntegrationValidationResult, + ConfigurationValidateResponse, +) ``` Methods: @@ -362,7 +412,6 @@ from gitpod.types.runners.configurations import ( EnvironmentClassCreateResponse, EnvironmentClassRetrieveResponse, EnvironmentClassUpdateResponse, - EnvironmentClassListResponse, ) ``` @@ -371,7 +420,7 @@ Methods: - client.runners.configurations.environment_classes.create(\*\*params) -> EnvironmentClassCreateResponse - client.runners.configurations.environment_classes.retrieve(\*\*params) -> EnvironmentClassRetrieveResponse - client.runners.configurations.environment_classes.update(\*\*params) -> object -- client.runners.configurations.environment_classes.list(\*\*params) -> SyncEnvironmentClassesPage[EnvironmentClassListResponse] +- client.runners.configurations.environment_classes.list(\*\*params) -> SyncEnvironmentClassesPage[EnvironmentClass] ### HostAuthenticationTokens @@ -379,10 +428,11 @@ Types: ```python from gitpod.types.runners.configurations import ( + HostAuthenticationToken, + HostAuthenticationTokenSource, HostAuthenticationTokenCreateResponse, HostAuthenticationTokenRetrieveResponse, HostAuthenticationTokenUpdateResponse, - HostAuthenticationTokenListResponse, HostAuthenticationTokenDeleteResponse, ) ``` @@ -392,7 +442,7 @@ Methods: - client.runners.configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse - client.runners.configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse - client.runners.configurations.host_authentication_tokens.update(\*\*params) -> object -- client.runners.configurations.host_authentication_tokens.list(\*\*params) -> SyncTokensPage[HostAuthenticationTokenListResponse] +- client.runners.configurations.host_authentication_tokens.list(\*\*params) -> SyncTokensPage[HostAuthenticationToken] - client.runners.configurations.host_authentication_tokens.delete(\*\*params) -> object ### Schema @@ -400,7 +450,7 @@ Methods: Types: ```python -from gitpod.types.runners.configurations import SchemaRetrieveResponse +from gitpod.types.runners.configurations import RunnerConfigurationSchema, SchemaRetrieveResponse ``` Methods: @@ -413,10 +463,11 @@ Types: ```python from gitpod.types.runners.configurations import ( + ScmIntegration, + ScmIntegrationOAuthConfig, ScmIntegrationCreateResponse, ScmIntegrationRetrieveResponse, ScmIntegrationUpdateResponse, - ScmIntegrationListResponse, ScmIntegrationDeleteResponse, ) ``` @@ -426,7 +477,7 @@ Methods: - client.runners.configurations.scm_integrations.create(\*\*params) -> ScmIntegrationCreateResponse - client.runners.configurations.scm_integrations.retrieve(\*\*params) -> ScmIntegrationRetrieveResponse - client.runners.configurations.scm_integrations.update(\*\*params) -> object -- client.runners.configurations.scm_integrations.list(\*\*params) -> SyncIntegrationsPage[ScmIntegrationListResponse] +- client.runners.configurations.scm_integrations.list(\*\*params) -> SyncIntegrationsPage[ScmIntegration] - client.runners.configurations.scm_integrations.delete(\*\*params) -> object ## Policies @@ -435,9 +486,10 @@ Types: ```python from gitpod.types.runners import ( + RunnerPolicy, + RunnerRole, PolicyCreateResponse, PolicyUpdateResponse, - PolicyListResponse, PolicyDeleteResponse, ) ``` @@ -446,7 +498,7 @@ Methods: - client.runners.policies.create(\*\*params) -> PolicyCreateResponse - client.runners.policies.update(\*\*params) -> PolicyUpdateResponse -- client.runners.policies.list(\*\*params) -> SyncPoliciesPage[PolicyListResponse] +- client.runners.policies.list(\*\*params) -> SyncPoliciesPage[RunnerPolicy] - client.runners.policies.delete(\*\*params) -> object # Secrets @@ -455,8 +507,8 @@ Types: ```python from gitpod.types import ( + Secret, SecretCreateResponse, - SecretListResponse, SecretDeleteResponse, SecretGetValueResponse, SecretUpdateValueResponse, @@ -466,7 +518,7 @@ from gitpod.types import ( Methods: - client.secrets.create(\*\*params) -> SecretCreateResponse -- client.secrets.list(\*\*params) -> SyncSecretsPage[SecretListResponse] +- client.secrets.list(\*\*params) -> SyncSecretsPage[Secret] - client.secrets.delete(\*\*params) -> object - client.secrets.get_value(\*\*params) -> SecretGetValueResponse - client.secrets.update_value(\*\*params) -> object @@ -476,7 +528,7 @@ Methods: Types: ```python -from gitpod.types import UserGetAuthenticatedUserResponse, UserSetSuspendedResponse +from gitpod.types import User, UserGetAuthenticatedUserResponse, UserSetSuspendedResponse ``` Methods: @@ -489,11 +541,11 @@ Methods: Types: ```python -from gitpod.types.users import PatListResponse, PatDeleteResponse, PatGetResponse +from gitpod.types.users import PersonalAccessToken, PatDeleteResponse, PatGetResponse ``` Methods: -- client.users.pats.list(\*\*params) -> SyncPersonalAccessTokensPage[PatListResponse] +- client.users.pats.list(\*\*params) -> SyncPersonalAccessTokensPage[PersonalAccessToken] - client.users.pats.delete(\*\*params) -> object - client.users.pats.get(\*\*params) -> PatGetResponse diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 71a9da1e..e344dc9e 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Optional + import httpx from ..types import ( @@ -25,9 +27,9 @@ ) from ..pagination import SyncLoginProvidersPage, AsyncLoginProvidersPage from .._base_client import AsyncPaginator, make_request_options +from ..types.login_provider import LoginProvider from ..types.account_retrieve_response import AccountRetrieveResponse from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse -from ..types.account_list_login_providers_response import AccountListLoginProvidersResponse __all__ = ["AccountsResource", "AsyncAccountsResource"] @@ -121,8 +123,8 @@ def delete( def get_sso_login_url( self, *, - return_to: str, email: str | NotGiven = NOT_GIVEN, + return_to: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -134,10 +136,10 @@ def get_sso_login_url( GetSSOLoginURL returns the URL to redirect the user to for SSO login. Args: - return_to: return_to is the URL the user will be redirected to after login - email: email is the email the user wants to login with + return_to: return_to is the URL the user will be redirected to after login + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -150,8 +152,8 @@ def get_sso_login_url( "/gitpod.v1.AccountService/GetSSOLoginURL", body=maybe_transform( { - "return_to": return_to, "email": email, + "return_to": return_to, }, account_get_sso_login_url_params.AccountGetSSOLoginURLParams, ), @@ -174,7 +176,7 @@ def list_login_providers( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncLoginProvidersPage[AccountListLoginProvidersResponse]: + ) -> SyncLoginProvidersPage[LoginProvider]: """ ListLoginProviders returns the list of login providers matching the provided filters. @@ -194,7 +196,7 @@ def list_login_providers( """ return self._get_api_list( "/gitpod.v1.AccountService/ListLoginProviders", - page=SyncLoginProvidersPage[AccountListLoginProvidersResponse], + page=SyncLoginProvidersPage[LoginProvider], body=maybe_transform( { "filter": filter, @@ -215,7 +217,7 @@ def list_login_providers( account_list_login_providers_params.AccountListLoginProvidersParams, ), ), - model=AccountListLoginProvidersResponse, + model=LoginProvider, method="post", ) @@ -309,8 +311,8 @@ async def delete( async def get_sso_login_url( self, *, - return_to: str, email: str | NotGiven = NOT_GIVEN, + return_to: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -322,10 +324,10 @@ async def get_sso_login_url( GetSSOLoginURL returns the URL to redirect the user to for SSO login. Args: - return_to: return_to is the URL the user will be redirected to after login - email: email is the email the user wants to login with + return_to: return_to is the URL the user will be redirected to after login + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -338,8 +340,8 @@ async def get_sso_login_url( "/gitpod.v1.AccountService/GetSSOLoginURL", body=await async_maybe_transform( { - "return_to": return_to, "email": email, + "return_to": return_to, }, account_get_sso_login_url_params.AccountGetSSOLoginURLParams, ), @@ -362,7 +364,7 @@ def list_login_providers( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AccountListLoginProvidersResponse, AsyncLoginProvidersPage[AccountListLoginProvidersResponse]]: + ) -> AsyncPaginator[LoginProvider, AsyncLoginProvidersPage[LoginProvider]]: """ ListLoginProviders returns the list of login providers matching the provided filters. @@ -382,7 +384,7 @@ def list_login_providers( """ return self._get_api_list( "/gitpod.v1.AccountService/ListLoginProviders", - page=AsyncLoginProvidersPage[AccountListLoginProvidersResponse], + page=AsyncLoginProvidersPage[LoginProvider], body=maybe_transform( { "filter": filter, @@ -403,7 +405,7 @@ def list_login_providers( account_list_login_providers_params.AccountListLoginProvidersParams, ), ), - model=AccountListLoginProvidersResponse, + model=LoginProvider, method="post", ) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 19cfc8a7..17733f69 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -20,7 +20,7 @@ ) from ..pagination import SyncEditorsPage, AsyncEditorsPage from .._base_client import AsyncPaginator, make_request_options -from ..types.editor_list_response import EditorListResponse +from ..types.editor import Editor from ..types.editor_retrieve_response import EditorRetrieveResponse from ..types.editor_resolve_url_response import EditorResolveURLResponse @@ -93,7 +93,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncEditorsPage[EditorListResponse]: + ) -> SyncEditorsPage[Editor]: """ ListEditors lists all editors available to the caller @@ -110,7 +110,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EditorService/ListEditors", - page=SyncEditorsPage[EditorListResponse], + page=SyncEditorsPage[Editor], body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), options=make_request_options( extra_headers=extra_headers, @@ -125,7 +125,7 @@ def list( editor_list_params.EditorListParams, ), ), - model=EditorListResponse, + model=Editor, method="post", ) @@ -243,7 +243,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[EditorListResponse, AsyncEditorsPage[EditorListResponse]]: + ) -> AsyncPaginator[Editor, AsyncEditorsPage[Editor]]: """ ListEditors lists all editors available to the caller @@ -260,7 +260,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EditorService/ListEditors", - page=AsyncEditorsPage[EditorListResponse], + page=AsyncEditorsPage[Editor], body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), options=make_request_options( extra_headers=extra_headers, @@ -275,7 +275,7 @@ def list( editor_list_params.EditorListParams, ), ), - model=EditorListResponse, + model=Editor, method="post", ) diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index ea521a1b..f9c6d9b3 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -35,6 +35,7 @@ ) from ...._base_client import make_request_options from ....types.environments import automation_upsert_params +from ....types.environments.automations_file_param import AutomationsFileParam from ....types.environments.automation_upsert_response import AutomationUpsertResponse __all__ = ["AutomationsResource", "AsyncAutomationsResource"] @@ -71,7 +72,7 @@ def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: def upsert( self, *, - automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, + automations_file: AutomationsFileParam | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -144,7 +145,7 @@ def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingRespon async def upsert( self, *, - automations_file: automation_upsert_params.AutomationsFile | NotGiven = NOT_GIVEN, + automations_file: AutomationsFileParam | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index f958352c..adea3c29 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -28,7 +28,9 @@ service_update_params, service_retrieve_params, ) -from ....types.environments.automations.service_list_response import ServiceListResponse +from ....types.environments.automations.service import Service +from ....types.environments.automations.service_spec_param import ServiceSpecParam +from ....types.environments.automations.service_metadata_param import ServiceMetadataParam from ....types.environments.automations.service_create_response import ServiceCreateResponse from ....types.environments.automations.service_retrieve_response import ServiceRetrieveResponse @@ -59,8 +61,8 @@ def create( self, *, environment_id: str | NotGiven = NOT_GIVEN, - metadata: service_create_params.Metadata | NotGiven = NOT_GIVEN, - spec: service_create_params.Spec | NotGiven = NOT_GIVEN, + metadata: ServiceMetadataParam | NotGiven = NOT_GIVEN, + spec: ServiceSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -192,7 +194,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncServicesPage[ServiceListResponse]: + ) -> SyncServicesPage[Service]: """ ListServices @@ -211,7 +213,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListServices", - page=SyncServicesPage[ServiceListResponse], + page=SyncServicesPage[Service], body=maybe_transform( { "filter": filter, @@ -232,7 +234,7 @@ def list( service_list_params.ServiceListParams, ), ), - model=ServiceListResponse, + model=Service, method="post", ) @@ -372,8 +374,8 @@ async def create( self, *, environment_id: str | NotGiven = NOT_GIVEN, - metadata: service_create_params.Metadata | NotGiven = NOT_GIVEN, - spec: service_create_params.Spec | NotGiven = NOT_GIVEN, + metadata: ServiceMetadataParam | NotGiven = NOT_GIVEN, + spec: ServiceSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -505,7 +507,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ServiceListResponse, AsyncServicesPage[ServiceListResponse]]: + ) -> AsyncPaginator[Service, AsyncServicesPage[Service]]: """ ListServices @@ -524,7 +526,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListServices", - page=AsyncServicesPage[ServiceListResponse], + page=AsyncServicesPage[Service], body=maybe_transform( { "filter": filter, @@ -545,7 +547,7 @@ def list( service_list_params.ServiceListParams, ), ), - model=ServiceListResponse, + model=Service, method="post", ) diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index d34f9ecb..7b831a78 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -19,12 +19,12 @@ ) from .....pagination import SyncTaskExecutionsPage, AsyncTaskExecutionsPage from ....._base_client import AsyncPaginator, make_request_options +from .....types.shared.task_execution import TaskExecution from .....types.environments.automations.tasks import ( execution_list_params, execution_stop_params, execution_retrieve_params, ) -from .....types.environments.automations.tasks.execution_list_response import ExecutionListResponse from .....types.environments.automations.tasks.execution_retrieve_response import ExecutionRetrieveResponse __all__ = ["ExecutionsResource", "AsyncExecutionsResource"] @@ -95,7 +95,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncTaskExecutionsPage[ExecutionListResponse]: + ) -> SyncTaskExecutionsPage[TaskExecution]: """ ListTaskExecutions @@ -114,7 +114,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", - page=SyncTaskExecutionsPage[ExecutionListResponse], + page=SyncTaskExecutionsPage[TaskExecution], body=maybe_transform( { "filter": filter, @@ -135,7 +135,7 @@ def list( execution_list_params.ExecutionListParams, ), ), - model=ExecutionListResponse, + model=TaskExecution, method="post", ) @@ -237,7 +237,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ExecutionListResponse, AsyncTaskExecutionsPage[ExecutionListResponse]]: + ) -> AsyncPaginator[TaskExecution, AsyncTaskExecutionsPage[TaskExecution]]: """ ListTaskExecutions @@ -256,7 +256,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions", - page=AsyncTaskExecutionsPage[ExecutionListResponse], + page=AsyncTaskExecutionsPage[TaskExecution], body=maybe_transform( { "filter": filter, @@ -277,7 +277,7 @@ def list( execution_list_params.ExecutionListParams, ), ), - model=ExecutionListResponse, + model=TaskExecution, method="post", ) diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index f3e00a6e..2687f1bc 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -37,7 +37,9 @@ task_update_params, task_retrieve_params, ) -from .....types.environments.automations.task_list_response import TaskListResponse +from .....types.environments.automations.task import Task +from .....types.environments.automations.task_spec_param import TaskSpecParam +from .....types.environments.automations.task_metadata_param import TaskMetadataParam from .....types.environments.automations.task_start_response import TaskStartResponse from .....types.environments.automations.task_create_response import TaskCreateResponse from .....types.environments.automations.task_retrieve_response import TaskRetrieveResponse @@ -74,8 +76,8 @@ def create( *, depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, - spec: task_create_params.Spec | NotGiven = NOT_GIVEN, + metadata: TaskMetadataParam | NotGiven = NOT_GIVEN, + spec: TaskSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -202,7 +204,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncTasksPage[TaskListResponse]: + ) -> SyncTasksPage[Task]: """ ListTasks @@ -221,7 +223,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListTasks", - page=SyncTasksPage[TaskListResponse], + page=SyncTasksPage[Task], body=maybe_transform( { "filter": filter, @@ -242,7 +244,7 @@ def list( task_list_params.TaskListParams, ), ), - model=TaskListResponse, + model=Task, method="post", ) @@ -342,8 +344,8 @@ async def create( *, depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - metadata: task_create_params.Metadata | NotGiven = NOT_GIVEN, - spec: task_create_params.Spec | NotGiven = NOT_GIVEN, + metadata: TaskMetadataParam | NotGiven = NOT_GIVEN, + spec: TaskSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -470,7 +472,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[TaskListResponse, AsyncTasksPage[TaskListResponse]]: + ) -> AsyncPaginator[Task, AsyncTasksPage[Task]]: """ ListTasks @@ -489,7 +491,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentAutomationService/ListTasks", - page=AsyncTasksPage[TaskListResponse], + page=AsyncTasksPage[Task], body=maybe_transform( { "filter": filter, @@ -510,7 +512,7 @@ def list( task_list_params.TaskListParams, ), ), - model=TaskListResponse, + model=Task, method="post", ) diff --git a/src/gitpod/resources/environments/classes.py b/src/gitpod/resources/environments/classes.py index c4289d4c..a68c661b 100644 --- a/src/gitpod/resources/environments/classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -17,7 +17,7 @@ from ...pagination import SyncEnvironmentClassesPage, AsyncEnvironmentClassesPage from ..._base_client import AsyncPaginator, make_request_options from ...types.environments import class_list_params -from ...types.environments.class_list_response import ClassListResponse +from ...types.shared.environment_class import EnvironmentClass __all__ = ["ClassesResource", "AsyncClassesResource"] @@ -55,7 +55,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncEnvironmentClassesPage[ClassListResponse]: + ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ ListEnvironmentClasses returns the list of environment classes with runner details a user is able to use based on the query buf:lint:ignore @@ -74,7 +74,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", - page=SyncEnvironmentClassesPage[ClassListResponse], + page=SyncEnvironmentClassesPage[EnvironmentClass], body=maybe_transform( { "filter": filter, @@ -95,7 +95,7 @@ def list( class_list_params.ClassListParams, ), ), - model=ClassListResponse, + model=EnvironmentClass, method="post", ) @@ -133,7 +133,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ClassListResponse, AsyncEnvironmentClassesPage[ClassListResponse]]: + ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ ListEnvironmentClasses returns the list of environment classes with runner details a user is able to use based on the query buf:lint:ignore @@ -152,7 +152,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentService/ListEnvironmentClasses", - page=AsyncEnvironmentClassesPage[ClassListResponse], + page=AsyncEnvironmentClassesPage[EnvironmentClass], body=maybe_transform( { "filter": filter, @@ -173,7 +173,7 @@ def list( class_list_params.ClassListParams, ), ), - model=ClassListResponse, + model=EnvironmentClass, method="post", ) diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index c63cbbfb..13c6fec6 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -41,6 +41,7 @@ ) from ...pagination import SyncEnvironmentsPage, AsyncEnvironmentsPage from ..._base_client import AsyncPaginator, make_request_options +from ...types.environment import Environment from .automations.automations import ( AutomationsResource, AsyncAutomationsResource, @@ -49,9 +50,10 @@ AutomationsResourceWithStreamingResponse, AsyncAutomationsResourceWithStreamingResponse, ) -from ...types.environment_list_response import EnvironmentListResponse +from ...types.environment_spec_param import EnvironmentSpecParam from ...types.environment_create_response import EnvironmentCreateResponse from ...types.environment_retrieve_response import EnvironmentRetrieveResponse +from ...types.environment_activity_signal_param import EnvironmentActivitySignalParam from ...types.environment_create_logs_token_response import EnvironmentCreateLogsTokenResponse from ...types.environment_create_from_project_response import EnvironmentCreateFromProjectResponse @@ -89,7 +91,7 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: def create( self, *, - spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, + spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -100,6 +102,44 @@ def create( """ CreateEnvironment creates a new environment and starts it. + The `class` field must be a valid environment class ID. You can find a list of + available environment classes with the `ListEnvironmentClasses` method. + + ### Examples + + - from context URL: + + Creates an environment from a context URL, e.g. a GitHub repository. + + ```yaml + spec: + machine: + class: "61000000-0000-0000-0000-000000000000" + content: + initializer: + specs: + - contextUrl: + url: "https://github.com/gitpod-io/gitpod" + ``` + + - from Git repository: + + Creates an environment from a Git repository directly. While less convenient, + this is useful if you want to specify a specific branch, commit, etc. + + ```yaml + spec: + machine: + class: "61000000-0000-0000-0000-000000000000" + content: + initializer: + specs: + - git: + remoteUri: "https://github.com/gitpod-io/gitpod" + cloneTarget: "main" + targetMode: "CLONE_TARGET_MODE_REMOTE_BRANCH" + ``` + Args: spec: EnvironmentSpec specifies the configuration of an environment for an environment start @@ -135,9 +175,6 @@ def retrieve( """ GetEnvironment returns a single environment. - +return NOT_FOUND User does not have access to an environment with the given ID - +return NOT_FOUND Environment does not exist - Args: environment_id: environment_id specifies the environment to get @@ -219,7 +256,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncEnvironmentsPage[EnvironmentListResponse]: + ) -> SyncEnvironmentsPage[Environment]: """ ListEnvironments returns a list of environments that match the query. @@ -238,7 +275,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentService/ListEnvironments", - page=SyncEnvironmentsPage[EnvironmentListResponse], + page=SyncEnvironmentsPage[Environment], body=maybe_transform( { "filter": filter, @@ -260,7 +297,7 @@ def list( environment_list_params.EnvironmentListParams, ), ), - model=EnvironmentListResponse, + model=Environment, method="post", ) @@ -318,7 +355,7 @@ def create_from_project( self, *, project_id: str | NotGiven = NOT_GIVEN, - spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, + spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -401,7 +438,7 @@ def create_logs_token( def mark_active( self, *, - activity_signal: environment_mark_active_params.ActivitySignal | NotGiven = NOT_GIVEN, + activity_signal: EnvironmentActivitySignalParam | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -545,7 +582,7 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo async def create( self, *, - spec: environment_create_params.Spec | NotGiven = NOT_GIVEN, + spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -556,6 +593,44 @@ async def create( """ CreateEnvironment creates a new environment and starts it. + The `class` field must be a valid environment class ID. You can find a list of + available environment classes with the `ListEnvironmentClasses` method. + + ### Examples + + - from context URL: + + Creates an environment from a context URL, e.g. a GitHub repository. + + ```yaml + spec: + machine: + class: "61000000-0000-0000-0000-000000000000" + content: + initializer: + specs: + - contextUrl: + url: "https://github.com/gitpod-io/gitpod" + ``` + + - from Git repository: + + Creates an environment from a Git repository directly. While less convenient, + this is useful if you want to specify a specific branch, commit, etc. + + ```yaml + spec: + machine: + class: "61000000-0000-0000-0000-000000000000" + content: + initializer: + specs: + - git: + remoteUri: "https://github.com/gitpod-io/gitpod" + cloneTarget: "main" + targetMode: "CLONE_TARGET_MODE_REMOTE_BRANCH" + ``` + Args: spec: EnvironmentSpec specifies the configuration of an environment for an environment start @@ -591,9 +666,6 @@ async def retrieve( """ GetEnvironment returns a single environment. - +return NOT_FOUND User does not have access to an environment with the given ID - +return NOT_FOUND Environment does not exist - Args: environment_id: environment_id specifies the environment to get @@ -675,7 +747,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[EnvironmentListResponse, AsyncEnvironmentsPage[EnvironmentListResponse]]: + ) -> AsyncPaginator[Environment, AsyncEnvironmentsPage[Environment]]: """ ListEnvironments returns a list of environments that match the query. @@ -694,7 +766,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.EnvironmentService/ListEnvironments", - page=AsyncEnvironmentsPage[EnvironmentListResponse], + page=AsyncEnvironmentsPage[Environment], body=maybe_transform( { "filter": filter, @@ -716,7 +788,7 @@ def list( environment_list_params.EnvironmentListParams, ), ), - model=EnvironmentListResponse, + model=Environment, method="post", ) @@ -774,7 +846,7 @@ async def create_from_project( self, *, project_id: str | NotGiven = NOT_GIVEN, - spec: environment_create_from_project_params.Spec | NotGiven = NOT_GIVEN, + spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -857,7 +929,7 @@ async def create_logs_token( async def mark_active( self, *, - activity_signal: environment_mark_active_params.ActivitySignal | NotGiven = NOT_GIVEN, + activity_signal: EnvironmentActivitySignalParam | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index df67d31f..b1539f7d 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -2,14 +2,11 @@ from __future__ import annotations -from typing_extensions import overload - import httpx from ..types import event_list_params, event_watch_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -106,11 +103,11 @@ def list( method="post", ) - @overload def watch( self, *, - environment_id: str, + environment_id: str | NotGiven = NOT_GIVEN, + organization: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -125,32 +122,6 @@ def watch( environment_id: Environment scope produces events for the environment itself, all tasks, task executions, and services associated with that environment. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def watch( - self, - *, - organization: bool, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> JSONLDecoder[EventWatchResponse]: - """ - WatchEvents streams all requests events to the client - - Args: organization: Organization scope produces events for all projects, runners and environments the caller can see within their organization. No task, task execution or service events are produed. @@ -163,21 +134,6 @@ def watch( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["environment_id"], ["organization"]) - def watch( - self, - *, - environment_id: str | NotGiven = NOT_GIVEN, - organization: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> JSONLDecoder[EventWatchResponse]: extra_headers = {"Accept": "application/jsonl", **(extra_headers or {})} return self._post( "/gitpod.v1.EventService/WatchEvents", @@ -272,11 +228,11 @@ def list( method="post", ) - @overload async def watch( self, *, - environment_id: str, + environment_id: str | NotGiven = NOT_GIVEN, + organization: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -291,32 +247,6 @@ async def watch( environment_id: Environment scope produces events for the environment itself, all tasks, task executions, and services associated with that environment. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def watch( - self, - *, - organization: bool, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncJSONLDecoder[EventWatchResponse]: - """ - WatchEvents streams all requests events to the client - - Args: organization: Organization scope produces events for all projects, runners and environments the caller can see within their organization. No task, task execution or service events are produed. @@ -329,21 +259,6 @@ async def watch( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["environment_id"], ["organization"]) - async def watch( - self, - *, - environment_id: str | NotGiven = NOT_GIVEN, - organization: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncJSONLDecoder[EventWatchResponse]: extra_headers = {"Accept": "application/jsonl", **(extra_headers or {})} return await self._post( "/gitpod.v1.EventService/WatchEvents", diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py index bf614f1c..9b6f47bc 100644 --- a/src/gitpod/resources/groups.py +++ b/src/gitpod/resources/groups.py @@ -16,8 +16,8 @@ async_to_streamed_response_wrapper, ) from ..pagination import SyncGroupsPage, AsyncGroupsPage +from ..types.group import Group from .._base_client import AsyncPaginator, make_request_options -from ..types.group_list_response import GroupListResponse __all__ = ["GroupsResource", "AsyncGroupsResource"] @@ -54,7 +54,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncGroupsPage[GroupListResponse]: + ) -> SyncGroupsPage[Group]: """ ListGroups lists groups @@ -71,7 +71,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.GroupService/ListGroups", - page=SyncGroupsPage[GroupListResponse], + page=SyncGroupsPage[Group], body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), options=make_request_options( extra_headers=extra_headers, @@ -86,7 +86,7 @@ def list( group_list_params.GroupListParams, ), ), - model=GroupListResponse, + model=Group, method="post", ) @@ -123,7 +123,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[GroupListResponse, AsyncGroupsPage[GroupListResponse]]: + ) -> AsyncPaginator[Group, AsyncGroupsPage[Group]]: """ ListGroups lists groups @@ -140,7 +140,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.GroupService/ListGroups", - page=AsyncGroupsPage[GroupListResponse], + page=AsyncGroupsPage[Group], body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), options=make_request_options( extra_headers=extra_headers, @@ -155,7 +155,7 @@ def list( group_list_params.GroupListParams, ), ), - model=GroupListResponse, + model=Group, method="post", ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index afd94cb3..65326134 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing import Optional import httpx from ...types import ( + Scope, organization_join_params, organization_list_params, organization_leave_params, @@ -27,7 +28,6 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -40,6 +40,7 @@ async_to_streamed_response_wrapper, ) from ...pagination import SyncMembersPage, AsyncMembersPage, SyncOrganizationsPage, AsyncOrganizationsPage +from ...types.scope import Scope from ..._base_client import AsyncPaginator, make_request_options from .sso_configurations import ( SSOConfigurationsResource, @@ -49,12 +50,14 @@ SSOConfigurationsResourceWithStreamingResponse, AsyncSSOConfigurationsResourceWithStreamingResponse, ) +from ...types.organization import Organization +from ...types.organization_member import OrganizationMember +from ...types.invite_domains_param import InviteDomainsParam +from ...types.shared.organization_role import OrganizationRole from ...types.organization_join_response import OrganizationJoinResponse -from ...types.organization_list_response import OrganizationListResponse from ...types.organization_create_response import OrganizationCreateResponse from ...types.organization_update_response import OrganizationUpdateResponse from ...types.organization_retrieve_response import OrganizationRetrieveResponse -from ...types.organization_list_members_response import OrganizationListMembersResponse __all__ = ["OrganizationsResource", "AsyncOrganizationsResource"] @@ -172,11 +175,12 @@ def retrieve( cast_to=OrganizationRetrieveResponse, ) - @overload def update( self, *, - invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, + invite_domains: Optional[InviteDomainsParam] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -190,34 +194,10 @@ def update( Args: invite_domains: invite_domains is the domain allowlist of the organization - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - name: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationUpdateResponse: - """ - UpdateOrganization updates the properties of an Organization. - - Args: name: name is the new name of the organization + organization_id: organization_id is the ID of the organization to update the settings for. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -226,28 +206,13 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["invite_domains"], ["name"]) - def update( - self, - *, - invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains - | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationUpdateResponse: return self._post( "/gitpod.v1.OrganizationService/UpdateOrganization", body=maybe_transform( { "invite_domains": invite_domains, "name": name, + "organization_id": organization_id, }, organization_update_params.OrganizationUpdateParams, ), @@ -263,14 +228,14 @@ def list( token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, pagination: organization_list_params.Pagination | NotGiven = NOT_GIVEN, - scope: Literal["SCOPE_UNSPECIFIED", "SCOPE_MEMBER", "SCOPE_ALL"] | NotGiven = NOT_GIVEN, + scope: Scope | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncOrganizationsPage[OrganizationListResponse]: + ) -> SyncOrganizationsPage[Organization]: """ ListOrganizations lists all organization the caller has access to. @@ -289,7 +254,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListOrganizations", - page=SyncOrganizationsPage[OrganizationListResponse], + page=SyncOrganizationsPage[Organization], body=maybe_transform( { "pagination": pagination, @@ -310,7 +275,7 @@ def list( organization_list_params.OrganizationListParams, ), ), - model=OrganizationListResponse, + model=Organization, method="post", ) @@ -350,11 +315,11 @@ def delete( cast_to=object, ) - @overload def join( self, *, - invite_id: str, + invite_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -368,32 +333,6 @@ def join( Args: invite_id: invite_id is the unique identifier of the invite to join the organization. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def join( - self, - *, - organization_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationJoinResponse: - """ - JoinOrganization lets accounts join an Organization. - - Args: organization_id: organization_id is the unique identifier of the Organization to join. extra_headers: Send extra headers @@ -404,21 +343,6 @@ def join( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["invite_id"], ["organization_id"]) - def join( - self, - *, - invite_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationJoinResponse: return self._post( "/gitpod.v1.OrganizationService/JoinOrganization", body=maybe_transform( @@ -479,7 +403,7 @@ def list_members( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncMembersPage[OrganizationListMembersResponse]: + ) -> SyncMembersPage[OrganizationMember]: """ ListMembers lists all members of the specified organization. @@ -498,7 +422,7 @@ def list_members( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListMembers", - page=SyncMembersPage[OrganizationListMembersResponse], + page=SyncMembersPage[OrganizationMember], body=maybe_transform( { "organization_id": organization_id, @@ -519,7 +443,7 @@ def list_members( organization_list_members_params.OrganizationListMembersParams, ), ), - model=OrganizationListMembersResponse, + model=OrganizationMember, method="post", ) @@ -527,8 +451,7 @@ def set_role( self, *, organization_id: str | NotGiven = NOT_GIVEN, - role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] - | NotGiven = NOT_GIVEN, + role: OrganizationRole | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -679,11 +602,12 @@ async def retrieve( cast_to=OrganizationRetrieveResponse, ) - @overload async def update( self, *, - invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, + invite_domains: Optional[InviteDomainsParam] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -697,34 +621,10 @@ async def update( Args: invite_domains: invite_domains is the domain allowlist of the organization - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - name: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationUpdateResponse: - """ - UpdateOrganization updates the properties of an Organization. - - Args: name: name is the new name of the organization + organization_id: organization_id is the ID of the organization to update the settings for. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -733,28 +633,13 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["invite_domains"], ["name"]) - async def update( - self, - *, - invite_domains: organization_update_params.InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains - | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationUpdateResponse: return await self._post( "/gitpod.v1.OrganizationService/UpdateOrganization", body=await async_maybe_transform( { "invite_domains": invite_domains, "name": name, + "organization_id": organization_id, }, organization_update_params.OrganizationUpdateParams, ), @@ -770,14 +655,14 @@ def list( token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, pagination: organization_list_params.Pagination | NotGiven = NOT_GIVEN, - scope: Literal["SCOPE_UNSPECIFIED", "SCOPE_MEMBER", "SCOPE_ALL"] | NotGiven = NOT_GIVEN, + scope: Scope | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[OrganizationListResponse, AsyncOrganizationsPage[OrganizationListResponse]]: + ) -> AsyncPaginator[Organization, AsyncOrganizationsPage[Organization]]: """ ListOrganizations lists all organization the caller has access to. @@ -796,7 +681,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListOrganizations", - page=AsyncOrganizationsPage[OrganizationListResponse], + page=AsyncOrganizationsPage[Organization], body=maybe_transform( { "pagination": pagination, @@ -817,7 +702,7 @@ def list( organization_list_params.OrganizationListParams, ), ), - model=OrganizationListResponse, + model=Organization, method="post", ) @@ -857,11 +742,11 @@ async def delete( cast_to=object, ) - @overload async def join( self, *, - invite_id: str, + invite_id: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -875,32 +760,6 @@ async def join( Args: invite_id: invite_id is the unique identifier of the invite to join the organization. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def join( - self, - *, - organization_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationJoinResponse: - """ - JoinOrganization lets accounts join an Organization. - - Args: organization_id: organization_id is the unique identifier of the Organization to join. extra_headers: Send extra headers @@ -911,21 +770,6 @@ async def join( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["invite_id"], ["organization_id"]) - async def join( - self, - *, - invite_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrganizationJoinResponse: return await self._post( "/gitpod.v1.OrganizationService/JoinOrganization", body=await async_maybe_transform( @@ -986,7 +830,7 @@ def list_members( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[OrganizationListMembersResponse, AsyncMembersPage[OrganizationListMembersResponse]]: + ) -> AsyncPaginator[OrganizationMember, AsyncMembersPage[OrganizationMember]]: """ ListMembers lists all members of the specified organization. @@ -1005,7 +849,7 @@ def list_members( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListMembers", - page=AsyncMembersPage[OrganizationListMembersResponse], + page=AsyncMembersPage[OrganizationMember], body=maybe_transform( { "organization_id": organization_id, @@ -1026,7 +870,7 @@ def list_members( organization_list_members_params.OrganizationListMembersParams, ), ), - model=OrganizationListMembersResponse, + model=OrganizationMember, method="post", ) @@ -1034,8 +878,7 @@ async def set_role( self, *, organization_id: str | NotGiven = NOT_GIVEN, - role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] - | NotGiven = NOT_GIVEN, + role: OrganizationRole | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index cb3b97ce..62a4197f 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -2,13 +2,12 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing import Dict, Optional import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -23,13 +22,15 @@ from ...pagination import SyncSSOConfigurationsPage, AsyncSSOConfigurationsPage from ..._base_client import AsyncPaginator, make_request_options from ...types.organizations import ( + SSOConfigurationState, sso_configuration_list_params, sso_configuration_create_params, sso_configuration_delete_params, sso_configuration_update_params, sso_configuration_retrieve_params, ) -from ...types.organizations.sso_configuration_list_response import SSOConfigurationListResponse +from ...types.organizations.sso_configuration import SSOConfiguration +from ...types.organizations.sso_configuration_state import SSOConfigurationState from ...types.organizations.sso_configuration_create_response import SSOConfigurationCreateResponse from ...types.organizations.sso_configuration_retrieve_response import SSOConfigurationRetrieveResponse @@ -146,11 +147,16 @@ def retrieve( cast_to=SSOConfigurationRetrieveResponse, ) - @overload def update( self, *, - client_id: str, + claims: Dict[str, str] | NotGiven = NOT_GIVEN, + client_id: Optional[str] | NotGiven = NOT_GIVEN, + client_secret: Optional[str] | NotGiven = NOT_GIVEN, + email_domain: Optional[str] | NotGiven = NOT_GIVEN, + issuer_url: Optional[str] | NotGiven = NOT_GIVEN, + sso_configuration_id: str | NotGiven = NOT_GIVEN, + state: Optional[SSOConfigurationState] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -162,118 +168,16 @@ def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: - client_id: client_id is the client ID of the SSO provider - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... + claims: claims are key/value pairs that defines a mapping of claims issued by the IdP. - @overload - def update( - self, - *, - client_secret: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. + client_id: client_id is the client ID of the SSO provider - Args: client_secret: client_secret is the client secret of the SSO provider - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - email_domain: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - issuer_url: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: issuer_url: issuer_url is the URL of the IdP issuer - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - state: Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. + sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update - Args: state: state is the state of the SSO configuration extra_headers: Send extra headers @@ -284,35 +188,16 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["client_id"], ["client_secret"], ["email_domain"], ["issuer_url"], ["state"]) - def update( - self, - *, - client_id: str | NotGiven = NOT_GIVEN, - client_secret: str | NotGiven = NOT_GIVEN, - email_domain: str | NotGiven = NOT_GIVEN, - issuer_url: str | NotGiven = NOT_GIVEN, - state: Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ] - | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return self._post( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", body=maybe_transform( { + "claims": claims, "client_id": client_id, "client_secret": client_secret, "email_domain": email_domain, "issuer_url": issuer_url, + "sso_configuration_id": sso_configuration_id, "state": state, }, sso_configuration_update_params.SSOConfigurationUpdateParams, @@ -336,7 +221,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSSOConfigurationsPage[SSOConfigurationListResponse]: + ) -> SyncSSOConfigurationsPage[SSOConfiguration]: """ ListSSOConfigurations lists all SSO configurations matching provided filters. @@ -353,7 +238,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListSSOConfigurations", - page=SyncSSOConfigurationsPage[SSOConfigurationListResponse], + page=SyncSSOConfigurationsPage[SSOConfiguration], body=maybe_transform( { "organization_id": organization_id, @@ -374,7 +259,7 @@ def list( sso_configuration_list_params.SSOConfigurationListParams, ), ), - model=SSOConfigurationListResponse, + model=SSOConfiguration, method="post", ) @@ -524,11 +409,16 @@ async def retrieve( cast_to=SSOConfigurationRetrieveResponse, ) - @overload async def update( self, *, - client_id: str, + claims: Dict[str, str] | NotGiven = NOT_GIVEN, + client_id: Optional[str] | NotGiven = NOT_GIVEN, + client_secret: Optional[str] | NotGiven = NOT_GIVEN, + email_domain: Optional[str] | NotGiven = NOT_GIVEN, + issuer_url: Optional[str] | NotGiven = NOT_GIVEN, + sso_configuration_id: str | NotGiven = NOT_GIVEN, + state: Optional[SSOConfigurationState] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -540,118 +430,16 @@ async def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: - client_id: client_id is the client ID of the SSO provider - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... + claims: claims are key/value pairs that defines a mapping of claims issued by the IdP. - @overload - async def update( - self, - *, - client_secret: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. + client_id: client_id is the client ID of the SSO provider - Args: client_secret: client_secret is the client secret of the SSO provider - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - email_domain: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - issuer_url: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. - - Args: issuer_url: issuer_url is the URL of the IdP issuer - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - state: Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSSOConfiguration updates the SSO configuration for the organization. + sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update - Args: state: state is the state of the SSO configuration extra_headers: Send extra headers @@ -662,35 +450,16 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["client_id"], ["client_secret"], ["email_domain"], ["issuer_url"], ["state"]) - async def update( - self, - *, - client_id: str | NotGiven = NOT_GIVEN, - client_secret: str | NotGiven = NOT_GIVEN, - email_domain: str | NotGiven = NOT_GIVEN, - issuer_url: str | NotGiven = NOT_GIVEN, - state: Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ] - | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return await self._post( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", body=await async_maybe_transform( { + "claims": claims, "client_id": client_id, "client_secret": client_secret, "email_domain": email_domain, "issuer_url": issuer_url, + "sso_configuration_id": sso_configuration_id, "state": state, }, sso_configuration_update_params.SSOConfigurationUpdateParams, @@ -714,7 +483,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[SSOConfigurationListResponse, AsyncSSOConfigurationsPage[SSOConfigurationListResponse]]: + ) -> AsyncPaginator[SSOConfiguration, AsyncSSOConfigurationsPage[SSOConfiguration]]: """ ListSSOConfigurations lists all SSO configurations matching provided filters. @@ -731,7 +500,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.OrganizationService/ListSSOConfigurations", - page=AsyncSSOConfigurationsPage[SSOConfigurationListResponse], + page=AsyncSSOConfigurationsPage[SSOConfiguration], body=maybe_transform( { "organization_id": organization_id, @@ -752,7 +521,7 @@ def list( sso_configuration_list_params.SSOConfigurationListParams, ), ), - model=SSOConfigurationListResponse, + model=SSOConfiguration, method="post", ) diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index 5c51df7a..b856a2d5 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -21,8 +19,15 @@ ) from ...pagination import SyncPoliciesPage, AsyncPoliciesPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.projects import policy_list_params, policy_create_params, policy_delete_params, policy_update_params -from ...types.projects.policy_list_response import PolicyListResponse +from ...types.projects import ( + ProjectRole, + policy_list_params, + policy_create_params, + policy_delete_params, + policy_update_params, +) +from ...types.projects.project_role import ProjectRole +from ...types.projects.project_policy import ProjectPolicy from ...types.projects.policy_create_response import PolicyCreateResponse from ...types.projects.policy_update_response import PolicyUpdateResponse @@ -54,7 +59,7 @@ def create( *, group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, - role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, + role: ProjectRole | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -99,7 +104,7 @@ def update( *, group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, - role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, + role: ProjectRole | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -152,7 +157,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPoliciesPage[PolicyListResponse]: + ) -> SyncPoliciesPage[ProjectPolicy]: """ ListProjectPolicies lists policies for a project. @@ -171,7 +176,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.ProjectService/ListProjectPolicies", - page=SyncPoliciesPage[PolicyListResponse], + page=SyncPoliciesPage[ProjectPolicy], body=maybe_transform( { "pagination": pagination, @@ -192,7 +197,7 @@ def list( policy_list_params.PolicyListParams, ), ), - model=PolicyListResponse, + model=ProjectPolicy, method="post", ) @@ -265,7 +270,7 @@ async def create( *, group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, - role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, + role: ProjectRole | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -310,7 +315,7 @@ async def update( *, group_id: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, - role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] | NotGiven = NOT_GIVEN, + role: ProjectRole | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -363,7 +368,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PolicyListResponse, AsyncPoliciesPage[PolicyListResponse]]: + ) -> AsyncPaginator[ProjectPolicy, AsyncPoliciesPage[ProjectPolicy]]: """ ListProjectPolicies lists policies for a project. @@ -382,7 +387,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.ProjectService/ListProjectPolicies", - page=AsyncPoliciesPage[PolicyListResponse], + page=AsyncPoliciesPage[ProjectPolicy], body=maybe_transform( { "pagination": pagination, @@ -403,7 +408,7 @@ def list( policy_list_params.PolicyListParams, ), ), - model=PolicyListResponse, + model=ProjectPolicy, method="post", ) diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index a87ec1a8..08571627 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import overload +from typing import Optional import httpx @@ -16,7 +16,6 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -38,10 +37,12 @@ ) from ...pagination import SyncProjectsPage, AsyncProjectsPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.project_list_response import ProjectListResponse +from ...types.project import Project from ...types.project_create_response import ProjectCreateResponse from ...types.project_update_response import ProjectUpdateResponse from ...types.project_retrieve_response import ProjectRetrieveResponse +from ...types.environment_initializer_param import EnvironmentInitializerParam +from ...types.project_environment_class_param import ProjectEnvironmentClassParam from ...types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse __all__ = ["ProjectsResource", "AsyncProjectsResource"] @@ -74,8 +75,8 @@ def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: def create( self, *, - environment_class: project_create_params.EnvironmentClass, - initializer: project_create_params.Initializer, + environment_class: ProjectEnvironmentClassParam, + initializer: EnvironmentInitializerParam, automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -166,11 +167,15 @@ def retrieve( cast_to=ProjectRetrieveResponse, ) - @overload def update( self, *, - automations_file_path: str, + automations_file_path: Optional[str] | NotGiven = NOT_GIVEN, + devcontainer_file_path: Optional[str] | NotGiven = NOT_GIVEN, + environment_class: Optional[ProjectEnvironmentClassParam] | NotGiven = NOT_GIVEN, + initializer: Optional[EnvironmentInitializerParam] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -189,32 +194,6 @@ def update( this.matches("^$|^[^/].*") ``` - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - devcontainer_file_path: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo root path must not be absolute (start with a /): @@ -222,86 +201,10 @@ def update( this.matches("^$|^[^/].*") ``` - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - environment_class: project_update_params.Variant2EnvironmentClass, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - initializer: project_update_params.InitializerIsTheContentInitializerInitializer, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - name: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. + project_id: project_id specifies the project identifier - Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -310,26 +213,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args( - ["automations_file_path"], ["devcontainer_file_path"], ["environment_class"], ["initializer"], ["name"] - ) - def update( - self, - *, - automations_file_path: str | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, - initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: return self._post( "/gitpod.v1.ProjectService/UpdateProject", body=maybe_transform( @@ -339,6 +222,7 @@ def update( "environment_class": environment_class, "initializer": initializer, "name": name, + "project_id": project_id, }, project_update_params.ProjectUpdateParams, ), @@ -360,7 +244,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncProjectsPage[ProjectListResponse]: + ) -> SyncProjectsPage[Project]: """ ListProjects lists all projects the caller has access to. @@ -377,7 +261,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.ProjectService/ListProjects", - page=SyncProjectsPage[ProjectListResponse], + page=SyncProjectsPage[Project], body=maybe_transform({"pagination": pagination}, project_list_params.ProjectListParams), options=make_request_options( extra_headers=extra_headers, @@ -392,7 +276,7 @@ def list( project_list_params.ProjectListParams, ), ), - model=ProjectListResponse, + model=Project, method="post", ) @@ -499,8 +383,8 @@ def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: async def create( self, *, - environment_class: project_create_params.EnvironmentClass, - initializer: project_create_params.Initializer, + environment_class: ProjectEnvironmentClassParam, + initializer: EnvironmentInitializerParam, automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -591,11 +475,15 @@ async def retrieve( cast_to=ProjectRetrieveResponse, ) - @overload async def update( self, *, - automations_file_path: str, + automations_file_path: Optional[str] | NotGiven = NOT_GIVEN, + devcontainer_file_path: Optional[str] | NotGiven = NOT_GIVEN, + environment_class: Optional[ProjectEnvironmentClassParam] | NotGiven = NOT_GIVEN, + initializer: Optional[EnvironmentInitializerParam] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + project_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -614,32 +502,6 @@ async def update( this.matches("^$|^[^/].*") ``` - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - devcontainer_file_path: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: devcontainer_file_path: devcontainer_file_path is the path to the devcontainer file relative to the repo root path must not be absolute (start with a /): @@ -647,86 +509,10 @@ async def update( this.matches("^$|^[^/].*") ``` - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - environment_class: project_update_params.Variant2EnvironmentClass, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - initializer: project_update_params.InitializerIsTheContentInitializerInitializer, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. - - Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - name: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: - """ - UpdateProject updates the properties of a Project. + project_id: project_id specifies the project identifier - Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -735,26 +521,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args( - ["automations_file_path"], ["devcontainer_file_path"], ["environment_class"], ["initializer"], ["name"] - ) - async def update( - self, - *, - automations_file_path: str | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - environment_class: project_update_params.Variant2EnvironmentClass | NotGiven = NOT_GIVEN, - initializer: project_update_params.InitializerIsTheContentInitializerInitializer | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectUpdateResponse: return await self._post( "/gitpod.v1.ProjectService/UpdateProject", body=await async_maybe_transform( @@ -764,6 +530,7 @@ async def update( "environment_class": environment_class, "initializer": initializer, "name": name, + "project_id": project_id, }, project_update_params.ProjectUpdateParams, ), @@ -785,7 +552,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ProjectListResponse, AsyncProjectsPage[ProjectListResponse]]: + ) -> AsyncPaginator[Project, AsyncProjectsPage[Project]]: """ ListProjects lists all projects the caller has access to. @@ -802,7 +569,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.ProjectService/ListProjects", - page=AsyncProjectsPage[ProjectListResponse], + page=AsyncProjectsPage[Project], body=maybe_transform({"pagination": pagination}, project_list_params.ProjectListParams), options=make_request_options( extra_headers=extra_headers, @@ -817,7 +584,7 @@ def list( project_list_params.ProjectListParams, ), ), - model=ProjectListResponse, + model=Project, method="post", ) diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index a9a8500f..68b2e38d 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -2,9 +2,6 @@ from __future__ import annotations -from typing import Any, cast -from typing_extensions import overload - import httpx from .schema import ( @@ -17,7 +14,6 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -55,6 +51,7 @@ HostAuthenticationTokensResourceWithStreamingResponse, AsyncHostAuthenticationTokensResourceWithStreamingResponse, ) +from ....types.shared_params.environment_class import EnvironmentClass from ....types.runners.configuration_validate_response import ConfigurationValidateResponse __all__ = ["ConfigurationsResource", "AsyncConfigurationsResource"] @@ -96,41 +93,12 @@ def with_streaming_response(self) -> ConfigurationsResourceWithStreamingResponse """ return ConfigurationsResourceWithStreamingResponse(self) - @overload - def validate( - self, - *, - environment_class: configuration_validate_params.Variant0EnvironmentClass, - runner_id: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. - - environment - class, SCM integration) with the runner. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload def validate( self, *, - scm_integration: configuration_validate_params.Variant1ScmIntegration, + environment_class: EnvironmentClass | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -152,41 +120,20 @@ def validate( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["environment_class"], ["scm_integration"]) - def validate( - self, - *, - environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationValidateResponse: - return cast( - ConfigurationValidateResponse, - self._post( - "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", - body=maybe_transform( - { - "environment_class": environment_class, - "runner_id": runner_id, - "scm_integration": scm_integration, - }, - configuration_validate_params.ConfigurationValidateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast( - Any, ConfigurationValidateResponse - ), # Union types cannot be passed in as arguments in the type system + return self._post( + "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", + body=maybe_transform( + { + "environment_class": environment_class, + "runner_id": runner_id, + "scm_integration": scm_integration, + }, + configuration_validate_params.ConfigurationValidateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + cast_to=ConfigurationValidateResponse, ) @@ -226,12 +173,12 @@ def with_streaming_response(self) -> AsyncConfigurationsResourceWithStreamingRes """ return AsyncConfigurationsResourceWithStreamingResponse(self) - @overload async def validate( self, *, - environment_class: configuration_validate_params.Variant0EnvironmentClass, + environment_class: EnvironmentClass | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, + scm_integration: configuration_validate_params.ScmIntegration | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -253,70 +200,20 @@ async def validate( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def validate( - self, - *, - scm_integration: configuration_validate_params.Variant1ScmIntegration, - runner_id: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. - - environment - class, SCM integration) with the runner. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["environment_class"], ["scm_integration"]) - async def validate( - self, - *, - environment_class: configuration_validate_params.Variant0EnvironmentClass | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.Variant1ScmIntegration | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationValidateResponse: - return cast( - ConfigurationValidateResponse, - await self._post( - "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", - body=await async_maybe_transform( - { - "environment_class": environment_class, - "runner_id": runner_id, - "scm_integration": scm_integration, - }, - configuration_validate_params.ConfigurationValidateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast( - Any, ConfigurationValidateResponse - ), # Union types cannot be passed in as arguments in the type system + return await self._post( + "/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration", + body=await async_maybe_transform( + { + "environment_class": environment_class, + "runner_id": runner_id, + "scm_integration": scm_integration, + }, + configuration_validate_params.ConfigurationValidateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + cast_to=ConfigurationValidateResponse, ) diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index 8594abc9..5c416956 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -2,14 +2,12 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import overload +from typing import Iterable, Optional import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -29,7 +27,8 @@ environment_class_update_params, environment_class_retrieve_params, ) -from ....types.runners.configurations.environment_class_list_response import EnvironmentClassListResponse +from ....types.shared.environment_class import EnvironmentClass +from ....types.shared_params.field_value import FieldValue from ....types.runners.configurations.environment_class_create_response import EnvironmentClassCreateResponse from ....types.runners.configurations.environment_class_retrieve_response import EnvironmentClassRetrieveResponse @@ -59,7 +58,7 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp def create( self, *, - configuration: Iterable[environment_class_create_params.Configuration] | NotGiven = NOT_GIVEN, + configuration: Iterable[FieldValue] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, @@ -134,63 +133,13 @@ def retrieve( cast_to=EnvironmentClassRetrieveResponse, ) - @overload def update( self, *, - description: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironmentClass updates an existing environment class on a runner. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - display_name: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironmentClass updates an existing environment class on a runner. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - enabled: bool, + description: Optional[str] | NotGiven = NOT_GIVEN, + display_name: Optional[str] | NotGiven = NOT_GIVEN, + enabled: Optional[bool] | NotGiven = NOT_GIVEN, + environment_class_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -210,22 +159,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["description"], ["display_name"], ["enabled"]) - def update( - self, - *, - description: str | NotGiven = NOT_GIVEN, - display_name: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", body=maybe_transform( @@ -233,6 +166,7 @@ def update( "description": description, "display_name": display_name, "enabled": enabled, + "environment_class_id": environment_class_id, }, environment_class_update_params.EnvironmentClassUpdateParams, ), @@ -255,7 +189,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncEnvironmentClassesPage[EnvironmentClassListResponse]: + ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ ListEnvironmentClasses returns all environment classes configured for a runner. buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE @@ -273,7 +207,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", - page=SyncEnvironmentClassesPage[EnvironmentClassListResponse], + page=SyncEnvironmentClassesPage[EnvironmentClass], body=maybe_transform( { "filter": filter, @@ -294,7 +228,7 @@ def list( environment_class_list_params.EnvironmentClassListParams, ), ), - model=EnvironmentClassListResponse, + model=EnvironmentClass, method="post", ) @@ -322,7 +256,7 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin async def create( self, *, - configuration: Iterable[environment_class_create_params.Configuration] | NotGiven = NOT_GIVEN, + configuration: Iterable[FieldValue] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, display_name: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, @@ -397,63 +331,13 @@ async def retrieve( cast_to=EnvironmentClassRetrieveResponse, ) - @overload async def update( self, *, - description: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironmentClass updates an existing environment class on a runner. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - display_name: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateEnvironmentClass updates an existing environment class on a runner. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - enabled: bool, + description: Optional[str] | NotGiven = NOT_GIVEN, + display_name: Optional[str] | NotGiven = NOT_GIVEN, + enabled: Optional[bool] | NotGiven = NOT_GIVEN, + environment_class_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -473,22 +357,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["description"], ["display_name"], ["enabled"]) - async def update( - self, - *, - description: str | NotGiven = NOT_GIVEN, - display_name: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateEnvironmentClass", body=await async_maybe_transform( @@ -496,6 +364,7 @@ async def update( "description": description, "display_name": display_name, "enabled": enabled, + "environment_class_id": environment_class_id, }, environment_class_update_params.EnvironmentClassUpdateParams, ), @@ -518,7 +387,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[EnvironmentClassListResponse, AsyncEnvironmentClassesPage[EnvironmentClassListResponse]]: + ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ ListEnvironmentClasses returns all environment classes configured for a runner. buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE @@ -536,7 +405,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses", - page=AsyncEnvironmentClassesPage[EnvironmentClassListResponse], + page=AsyncEnvironmentClassesPage[EnvironmentClass], body=maybe_transform( { "filter": filter, @@ -557,7 +426,7 @@ def list( environment_class_list_params.EnvironmentClassListParams, ), ), - model=EnvironmentClassListResponse, + model=EnvironmentClass, method="post", ) diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index b12a7602..74bb2513 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -2,15 +2,13 @@ from __future__ import annotations -from typing import Union +from typing import Union, Optional from datetime import datetime -from typing_extensions import Literal, overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -25,13 +23,15 @@ from ....pagination import SyncTokensPage, AsyncTokensPage from ...._base_client import AsyncPaginator, make_request_options from ....types.runners.configurations import ( + HostAuthenticationTokenSource, host_authentication_token_list_params, host_authentication_token_create_params, host_authentication_token_delete_params, host_authentication_token_update_params, host_authentication_token_retrieve_params, ) -from ....types.runners.configurations.host_authentication_token_list_response import HostAuthenticationTokenListResponse +from ....types.runners.configurations.host_authentication_token import HostAuthenticationToken +from ....types.runners.configurations.host_authentication_token_source import HostAuthenticationTokenSource from ....types.runners.configurations.host_authentication_token_create_response import ( HostAuthenticationTokenCreateResponse, ) @@ -70,12 +70,7 @@ def create( host: str | NotGiven = NOT_GIVEN, refresh_token: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - source: Literal[ - "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", - "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", - ] - | NotGiven = NOT_GIVEN, + source: HostAuthenticationTokenSource | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -239,11 +234,13 @@ def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) - @overload def update( self, *, - expires_at: Union[str, datetime], + id: str | NotGiven = NOT_GIVEN, + token: Optional[str] | NotGiven = NOT_GIVEN, + expires_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + refresh_token: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -352,81 +349,14 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - *, - refresh_token: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - token: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["expires_at"], ["refresh_token"], ["token"]) - def update( - self, - *, - expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - refresh_token: str | NotGiven = NOT_GIVEN, - token: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=maybe_transform( { + "id": id, + "token": token, "expires_at": expires_at, "refresh_token": refresh_token, - "token": token, }, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, ), @@ -449,7 +379,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncTokensPage[HostAuthenticationTokenListResponse]: + ) -> SyncTokensPage[HostAuthenticationToken]: """ ListHostAuthenticationTokens @@ -464,7 +394,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", - page=SyncTokensPage[HostAuthenticationTokenListResponse], + page=SyncTokensPage[HostAuthenticationToken], body=maybe_transform( { "filter": filter, @@ -485,7 +415,7 @@ def list( host_authentication_token_list_params.HostAuthenticationTokenListParams, ), ), - model=HostAuthenticationTokenListResponse, + model=HostAuthenticationToken, method="post", ) @@ -552,12 +482,7 @@ async def create( host: str | NotGiven = NOT_GIVEN, refresh_token: str | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, - source: Literal[ - "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", - "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", - ] - | NotGiven = NOT_GIVEN, + source: HostAuthenticationTokenSource | NotGiven = NOT_GIVEN, user_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -721,11 +646,13 @@ async def retrieve( cast_to=HostAuthenticationTokenRetrieveResponse, ) - @overload async def update( self, *, - expires_at: Union[str, datetime], + id: str | NotGiven = NOT_GIVEN, + token: Optional[str] | NotGiven = NOT_GIVEN, + expires_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + refresh_token: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -834,81 +761,14 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - *, - refresh_token: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - token: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateHostAuthenticationToken - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["expires_at"], ["refresh_token"], ["token"]) - async def update( - self, - *, - expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - refresh_token: str | NotGiven = NOT_GIVEN, - token: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateHostAuthenticationToken", body=await async_maybe_transform( { + "id": id, + "token": token, "expires_at": expires_at, "refresh_token": refresh_token, - "token": token, }, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, ), @@ -931,7 +791,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[HostAuthenticationTokenListResponse, AsyncTokensPage[HostAuthenticationTokenListResponse]]: + ) -> AsyncPaginator[HostAuthenticationToken, AsyncTokensPage[HostAuthenticationToken]]: """ ListHostAuthenticationTokens @@ -946,7 +806,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens", - page=AsyncTokensPage[HostAuthenticationTokenListResponse], + page=AsyncTokensPage[HostAuthenticationToken], body=maybe_transform( { "filter": filter, @@ -967,7 +827,7 @@ def list( host_authentication_token_list_params.HostAuthenticationTokenListParams, ), ), - model=HostAuthenticationTokenListResponse, + model=HostAuthenticationToken, method="post", ) diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index a7be1d25..36a4bbcd 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -2,13 +2,12 @@ from __future__ import annotations -from typing_extensions import overload +from typing import Optional import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -29,7 +28,7 @@ scm_integration_update_params, scm_integration_retrieve_params, ) -from ....types.runners.configurations.scm_integration_list_response import ScmIntegrationListResponse +from ....types.runners.configurations.scm_integration import ScmIntegration from ....types.runners.configurations.scm_integration_create_response import ScmIntegrationCreateResponse from ....types.runners.configurations.scm_integration_retrieve_response import ScmIntegrationRetrieveResponse @@ -56,11 +55,15 @@ def with_streaming_response(self) -> ScmIntegrationsResourceWithStreamingRespons """ return ScmIntegrationsResourceWithStreamingResponse(self) - @overload def create( self, *, - oauth_client_id: str, + host: str | NotGiven = NOT_GIVEN, + oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, + pat: bool | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + scm_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -75,35 +78,12 @@ def create( oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If configured, oauth_plaintext_client_secret must also be set. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def create( - self, - *, - oauth_plaintext_client_secret: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - """ - CreateSCMIntegration creates a new SCM integration on a runner. - - Args: oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. This will first be encrypted with the runner's public key before being stored. + scm_id: scm_id references the scm_id in the runner's configuration schema that this + integration is for + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -112,27 +92,16 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"]) - def create( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: return self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", body=maybe_transform( { + "host": host, "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + "pat": pat, + "runner_id": runner_id, + "scm_id": scm_id, }, scm_integration_create_params.ScmIntegrationCreateParams, ), @@ -174,11 +143,13 @@ def retrieve( cast_to=ScmIntegrationRetrieveResponse, ) - @overload def update( self, *, - oauth_client_id: str, + id: str | NotGiven = NOT_GIVEN, + oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, + pat: Optional[bool] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -197,62 +168,10 @@ def update( deleted. This might lead to users being unable to access their repositories until they re-authenticate. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - oauth_plaintext_client_secret: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSCMIntegration updates an existing SCM integration on a runner. - - Args: oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client secret. The cleartext secret will be encrypted with the runner's public key before being stored. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - pat: bool, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSCMIntegration updates an existing SCM integration on a runner. - - Args: pat: pat can be set to enable or disable Personal Access Tokens support. When disabling PATs, any existing Host Authentication Tokens for the SCM integration's runner and host that were created using a PAT will be deleted. @@ -267,26 +186,11 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"], ["pat"]) - def update( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - pat: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return self._post( "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", body=maybe_transform( { + "id": id, "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, @@ -312,7 +216,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncIntegrationsPage[ScmIntegrationListResponse]: + ) -> SyncIntegrationsPage[ScmIntegration]: """ ListSCMIntegrations returns all SCM integrations configured for a runner. @@ -329,7 +233,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", - page=SyncIntegrationsPage[ScmIntegrationListResponse], + page=SyncIntegrationsPage[ScmIntegration], body=maybe_transform( { "filter": filter, @@ -350,7 +254,7 @@ def list( scm_integration_list_params.ScmIntegrationListParams, ), ), - model=ScmIntegrationListResponse, + model=ScmIntegration, method="post", ) @@ -407,11 +311,15 @@ def with_streaming_response(self) -> AsyncScmIntegrationsResourceWithStreamingRe """ return AsyncScmIntegrationsResourceWithStreamingResponse(self) - @overload async def create( self, *, - oauth_client_id: str, + host: str | NotGiven = NOT_GIVEN, + oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, + pat: bool | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + scm_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -426,35 +334,12 @@ async def create( oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If configured, oauth_plaintext_client_secret must also be set. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def create( - self, - *, - oauth_plaintext_client_secret: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: - """ - CreateSCMIntegration creates a new SCM integration on a runner. - - Args: oauth_plaintext_client_secret: oauth_plaintext_client_secret is the OAuth app's client secret in clear text. This will first be encrypted with the runner's public key before being stored. + scm_id: scm_id references the scm_id in the runner's configuration schema that this + integration is for + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -463,27 +348,16 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"]) - async def create( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScmIntegrationCreateResponse: return await self._post( "/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration", body=await async_maybe_transform( { + "host": host, "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, + "pat": pat, + "runner_id": runner_id, + "scm_id": scm_id, }, scm_integration_create_params.ScmIntegrationCreateParams, ), @@ -525,11 +399,13 @@ async def retrieve( cast_to=ScmIntegrationRetrieveResponse, ) - @overload async def update( self, *, - oauth_client_id: str, + id: str | NotGiven = NOT_GIVEN, + oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, + oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, + pat: Optional[bool] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -548,62 +424,10 @@ async def update( deleted. This might lead to users being unable to access their repositories until they re-authenticate. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - oauth_plaintext_client_secret: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSCMIntegration updates an existing SCM integration on a runner. - - Args: oauth_plaintext_client_secret: oauth_plaintext_client_secret can be set to update the OAuth app's client secret. The cleartext secret will be encrypted with the runner's public key before being stored. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - pat: bool, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateSCMIntegration updates an existing SCM integration on a runner. - - Args: pat: pat can be set to enable or disable Personal Access Tokens support. When disabling PATs, any existing Host Authentication Tokens for the SCM integration's runner and host that were created using a PAT will be deleted. @@ -618,26 +442,11 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["oauth_client_id"], ["oauth_plaintext_client_secret"], ["pat"]) - async def update( - self, - *, - oauth_client_id: str | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: str | NotGiven = NOT_GIVEN, - pat: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return await self._post( "/gitpod.v1.RunnerConfigurationService/UpdateSCMIntegration", body=await async_maybe_transform( { + "id": id, "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, @@ -663,7 +472,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ScmIntegrationListResponse, AsyncIntegrationsPage[ScmIntegrationListResponse]]: + ) -> AsyncPaginator[ScmIntegration, AsyncIntegrationsPage[ScmIntegration]]: """ ListSCMIntegrations returns all SCM integrations configured for a runner. @@ -680,7 +489,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerConfigurationService/ListSCMIntegrations", - page=AsyncIntegrationsPage[ScmIntegrationListResponse], + page=AsyncIntegrationsPage[ScmIntegration], body=maybe_transform( { "filter": filter, @@ -701,7 +510,7 @@ def list( scm_integration_list_params.ScmIntegrationListParams, ), ), - model=ScmIntegrationListResponse, + model=ScmIntegration, method="post", ) diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index c303ce41..28bd0787 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -21,8 +19,15 @@ ) from ...pagination import SyncPoliciesPage, AsyncPoliciesPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.runners import policy_list_params, policy_create_params, policy_delete_params, policy_update_params -from ...types.runners.policy_list_response import PolicyListResponse +from ...types.runners import ( + RunnerRole, + policy_list_params, + policy_create_params, + policy_delete_params, + policy_update_params, +) +from ...types.runners.runner_role import RunnerRole +from ...types.runners.runner_policy import RunnerPolicy from ...types.runners.policy_create_response import PolicyCreateResponse from ...types.runners.policy_update_response import PolicyUpdateResponse @@ -53,7 +58,7 @@ def create( self, *, group_id: str | NotGiven = NOT_GIVEN, - role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, + role: RunnerRole | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -98,7 +103,7 @@ def update( self, *, group_id: str | NotGiven = NOT_GIVEN, - role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, + role: RunnerRole | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -152,7 +157,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPoliciesPage[PolicyListResponse]: + ) -> SyncPoliciesPage[RunnerPolicy]: """ ListRunnerPolicies lists runner policies. @@ -171,7 +176,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerService/ListRunnerPolicies", - page=SyncPoliciesPage[PolicyListResponse], + page=SyncPoliciesPage[RunnerPolicy], body=maybe_transform( { "pagination": pagination, @@ -192,7 +197,7 @@ def list( policy_list_params.PolicyListParams, ), ), - model=PolicyListResponse, + model=RunnerPolicy, method="post", ) @@ -264,7 +269,7 @@ async def create( self, *, group_id: str | NotGiven = NOT_GIVEN, - role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, + role: RunnerRole | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -309,7 +314,7 @@ async def update( self, *, group_id: str | NotGiven = NOT_GIVEN, - role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] | NotGiven = NOT_GIVEN, + role: RunnerRole | NotGiven = NOT_GIVEN, runner_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -363,7 +368,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PolicyListResponse, AsyncPoliciesPage[PolicyListResponse]]: + ) -> AsyncPaginator[RunnerPolicy, AsyncPoliciesPage[RunnerPolicy]]: """ ListRunnerPolicies lists runner policies. @@ -382,7 +387,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerService/ListRunnerPolicies", - page=AsyncPoliciesPage[PolicyListResponse], + page=AsyncPoliciesPage[RunnerPolicy], body=maybe_transform( { "pagination": pagination, @@ -403,7 +408,7 @@ def list( policy_list_params.PolicyListParams, ), ), - model=PolicyListResponse, + model=RunnerPolicy, method="post", ) diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index e41444af..1757c10c 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -2,11 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, overload +from typing import Optional import httpx from ...types import ( + RunnerKind, + RunnerProvider, runner_list_params, runner_create_params, runner_delete_params, @@ -18,7 +20,6 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -40,7 +41,10 @@ ) from ...pagination import SyncRunnersPage, AsyncRunnersPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.runner_list_response import RunnerListResponse +from ...types.runner import Runner +from ...types.runner_kind import RunnerKind +from ...types.runner_provider import RunnerProvider +from ...types.runner_spec_param import RunnerSpecParam from .configurations.configurations import ( ConfigurationsResource, AsyncConfigurationsResource, @@ -89,19 +93,10 @@ def with_streaming_response(self) -> RunnersResourceWithStreamingResponse: def create( self, *, - kind: Literal[ - "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" - ] - | NotGiven = NOT_GIVEN, + kind: RunnerKind | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - provider: Literal[ - "RUNNER_PROVIDER_UNSPECIFIED", - "RUNNER_PROVIDER_AWS_EC2", - "RUNNER_PROVIDER_LINUX_HOST", - "RUNNER_PROVIDER_DESKTOP_MAC", - ] - | NotGiven = NOT_GIVEN, - spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, + provider: RunnerProvider | NotGiven = NOT_GIVEN, + spec: RunnerSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -181,11 +176,12 @@ def retrieve( cast_to=RunnerRetrieveResponse, ) - @overload def update( self, *, - name: str, + name: Optional[str] | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + spec: Optional[runner_update_params.Spec] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -199,32 +195,10 @@ def update( Args: name: The runner's name which is shown to users - extra_headers: Send extra headers + runner_id: runner_id specifies which runner to be updated. - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request + +required - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - *, - spec: runner_update_params.Variant1Spec, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunner updates an environment runner. - - Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -233,26 +207,12 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["name"], ["spec"]) - def update( - self, - *, - name: str | NotGiven = NOT_GIVEN, - spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return self._post( "/gitpod.v1.RunnerService/UpdateRunner", body=maybe_transform( { "name": name, + "runner_id": runner_id, "spec": spec, }, runner_update_params.RunnerUpdateParams, @@ -276,7 +236,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncRunnersPage[RunnerListResponse]: + ) -> SyncRunnersPage[Runner]: """ ListRunners returns all runners registered in the scope. @@ -293,7 +253,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerService/ListRunners", - page=SyncRunnersPage[RunnerListResponse], + page=SyncRunnersPage[Runner], body=maybe_transform( { "filter": filter, @@ -314,7 +274,7 @@ def list( runner_list_params.RunnerListParams, ), ), - model=RunnerListResponse, + model=Runner, method="post", ) @@ -419,7 +379,7 @@ def create_runner_token( runner. Use this call to renew an outdated token - this does not expire any - previouly issued tokens. + previously issued tokens. Args: extra_headers: Send extra headers @@ -523,19 +483,10 @@ def with_streaming_response(self) -> AsyncRunnersResourceWithStreamingResponse: async def create( self, *, - kind: Literal[ - "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" - ] - | NotGiven = NOT_GIVEN, + kind: RunnerKind | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - provider: Literal[ - "RUNNER_PROVIDER_UNSPECIFIED", - "RUNNER_PROVIDER_AWS_EC2", - "RUNNER_PROVIDER_LINUX_HOST", - "RUNNER_PROVIDER_DESKTOP_MAC", - ] - | NotGiven = NOT_GIVEN, - spec: runner_create_params.Spec | NotGiven = NOT_GIVEN, + provider: RunnerProvider | NotGiven = NOT_GIVEN, + spec: RunnerSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -615,11 +566,12 @@ async def retrieve( cast_to=RunnerRetrieveResponse, ) - @overload async def update( self, *, - name: str, + name: Optional[str] | NotGiven = NOT_GIVEN, + runner_id: str | NotGiven = NOT_GIVEN, + spec: Optional[runner_update_params.Spec] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -633,32 +585,10 @@ async def update( Args: name: The runner's name which is shown to users - extra_headers: Send extra headers + runner_id: runner_id specifies which runner to be updated. - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request + +required - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - *, - spec: runner_update_params.Variant1Spec, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - UpdateRunner updates an environment runner. - - Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -667,26 +597,12 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["name"], ["spec"]) - async def update( - self, - *, - name: str | NotGiven = NOT_GIVEN, - spec: runner_update_params.Variant1Spec | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: return await self._post( "/gitpod.v1.RunnerService/UpdateRunner", body=await async_maybe_transform( { "name": name, + "runner_id": runner_id, "spec": spec, }, runner_update_params.RunnerUpdateParams, @@ -710,7 +626,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RunnerListResponse, AsyncRunnersPage[RunnerListResponse]]: + ) -> AsyncPaginator[Runner, AsyncRunnersPage[Runner]]: """ ListRunners returns all runners registered in the scope. @@ -727,7 +643,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.RunnerService/ListRunners", - page=AsyncRunnersPage[RunnerListResponse], + page=AsyncRunnersPage[Runner], body=maybe_transform( { "filter": filter, @@ -748,7 +664,7 @@ def list( runner_list_params.RunnerListParams, ), ), - model=RunnerListResponse, + model=Runner, method="post", ) @@ -853,7 +769,7 @@ async def create_runner_token( runner. Use this call to renew an outdated token - this does not expire any - previouly issued tokens. + previously issued tokens. Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index bc2b8585..c335a991 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -2,9 +2,6 @@ from __future__ import annotations -from typing import Any, cast -from typing_extensions import overload - import httpx from ..types import ( @@ -16,7 +13,6 @@ ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -30,7 +26,7 @@ ) from ..pagination import SyncSecretsPage, AsyncSecretsPage from .._base_client import AsyncPaginator, make_request_options -from ..types.secret_list_response import SecretListResponse +from ..types.secret import Secret from ..types.secret_create_response import SecretCreateResponse from ..types.secret_get_value_response import SecretGetValueResponse @@ -57,11 +53,11 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: """ return SecretsResourceWithStreamingResponse(self) - @overload def create( self, *, - environment_variable: bool, + environment_variable: bool | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -79,39 +75,6 @@ def create( environment_variable: secret will be created as an Environment Variable with the same name as the secret - project_id: project_id is the ProjectID this Secret belongs to - - value: value is the plaintext value of the secret - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def create( - self, - *, - file_path: str, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SecretCreateResponse: - """ - CreateSecret creates a new secret. - - Args: file_path: absolute path to the file where the secret is mounted value must be an absolute path (start with a /): @@ -131,33 +94,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["environment_variable"], ["file_path"]) - def create( - self, - *, - environment_variable: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SecretCreateResponse: return self._post( "/gitpod.v1.SecretService/CreateSecret", body=maybe_transform( { "environment_variable": environment_variable, + "file_path": file_path, "name": name, "project_id": project_id, "value": value, - "file_path": file_path, }, secret_create_params.SecretCreateParams, ), @@ -180,7 +125,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSecretsPage[SecretListResponse]: + ) -> SyncSecretsPage[Secret]: """ ListSecrets lists secrets. @@ -197,7 +142,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.SecretService/ListSecrets", - page=SyncSecretsPage[SecretListResponse], + page=SyncSecretsPage[Secret], body=maybe_transform( { "filter": filter, @@ -218,7 +163,7 @@ def list( secret_list_params.SecretListParams, ), ), - model=cast(Any, SecretListResponse), # Union types cannot be passed in as arguments in the type system + model=Secret, method="post", ) @@ -349,11 +294,11 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: """ return AsyncSecretsResourceWithStreamingResponse(self) - @overload async def create( self, *, - environment_variable: bool, + environment_variable: bool | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, @@ -371,39 +316,6 @@ async def create( environment_variable: secret will be created as an Environment Variable with the same name as the secret - project_id: project_id is the ProjectID this Secret belongs to - - value: value is the plaintext value of the secret - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def create( - self, - *, - file_path: str, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SecretCreateResponse: - """ - CreateSecret creates a new secret. - - Args: file_path: absolute path to the file where the secret is mounted value must be an absolute path (start with a /): @@ -423,33 +335,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["environment_variable"], ["file_path"]) - async def create( - self, - *, - environment_variable: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SecretCreateResponse: return await self._post( "/gitpod.v1.SecretService/CreateSecret", body=await async_maybe_transform( { "environment_variable": environment_variable, + "file_path": file_path, "name": name, "project_id": project_id, "value": value, - "file_path": file_path, }, secret_create_params.SecretCreateParams, ), @@ -472,7 +366,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[SecretListResponse, AsyncSecretsPage[SecretListResponse]]: + ) -> AsyncPaginator[Secret, AsyncSecretsPage[Secret]]: """ ListSecrets lists secrets. @@ -489,7 +383,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.SecretService/ListSecrets", - page=AsyncSecretsPage[SecretListResponse], + page=AsyncSecretsPage[Secret], body=maybe_transform( { "filter": filter, @@ -510,7 +404,7 @@ def list( secret_list_params.SecretListParams, ), ), - model=cast(Any, SecretListResponse), # Union types cannot be passed in as arguments in the type system + model=Secret, method="post", ) diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 3165c3b2..1632e338 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -21,7 +21,7 @@ from ...types.users import pat_get_params, pat_list_params, pat_delete_params from ..._base_client import AsyncPaginator, make_request_options from ...types.users.pat_get_response import PatGetResponse -from ...types.users.pat_list_response import PatListResponse +from ...types.users.personal_access_token import PersonalAccessToken __all__ = ["PatsResource", "AsyncPatsResource"] @@ -59,7 +59,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPersonalAccessTokensPage[PatListResponse]: + ) -> SyncPersonalAccessTokensPage[PersonalAccessToken]: """ ListPersonalAccessTokens @@ -74,7 +74,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.UserService/ListPersonalAccessTokens", - page=SyncPersonalAccessTokensPage[PatListResponse], + page=SyncPersonalAccessTokensPage[PersonalAccessToken], body=maybe_transform( { "filter": filter, @@ -95,7 +95,7 @@ def list( pat_list_params.PatListParams, ), ), - model=PatListResponse, + model=PersonalAccessToken, method="post", ) @@ -199,7 +199,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PatListResponse, AsyncPersonalAccessTokensPage[PatListResponse]]: + ) -> AsyncPaginator[PersonalAccessToken, AsyncPersonalAccessTokensPage[PersonalAccessToken]]: """ ListPersonalAccessTokens @@ -214,7 +214,7 @@ def list( """ return self._get_api_list( "/gitpod.v1.UserService/ListPersonalAccessTokens", - page=AsyncPersonalAccessTokensPage[PatListResponse], + page=AsyncPersonalAccessTokensPage[PersonalAccessToken], body=maybe_transform( { "filter": filter, @@ -235,7 +235,7 @@ def list( pat_list_params.PatListParams, ), ), - model=PatListResponse, + model=PersonalAccessToken, method="post", ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 9644e1c4..1ff00e1c 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -2,34 +2,79 @@ from __future__ import annotations +from .user import User as User +from .group import Group as Group +from .scope import Scope as Scope +from .editor import Editor as Editor +from .runner import Runner as Runner +from .secret import Secret as Secret +from .shared import ( + RunsOn as RunsOn, + Subject as Subject, + Principal as Principal, + FieldValue as FieldValue, + UserStatus as UserStatus, + TaskExecution as TaskExecution, + EnvironmentClass as EnvironmentClass, + OrganizationRole as OrganizationRole, + AutomationTrigger as AutomationTrigger, + TaskExecutionSpec as TaskExecutionSpec, + TaskExecutionPhase as TaskExecutionPhase, + TaskExecutionStatus as TaskExecutionStatus, + TaskExecutionMetadata as TaskExecutionMetadata, +) +from .account import Account as Account +from .project import Project as Project +from .environment import Environment as Environment +from .runner_kind import RunnerKind as RunnerKind +from .runner_spec import RunnerSpec as RunnerSpec +from .organization import Organization as Organization +from .runner_phase import RunnerPhase as RunnerPhase +from .resource_type import ResourceType as ResourceType +from .runner_status import RunnerStatus as RunnerStatus +from .invite_domains import InviteDomains as InviteDomains +from .login_provider import LoginProvider as LoginProvider +from .admission_level import AdmissionLevel as AdmissionLevel +from .runner_provider import RunnerProvider as RunnerProvider +from .environment_spec import EnvironmentSpec as EnvironmentSpec +from .project_metadata import ProjectMetadata as ProjectMetadata +from .environment_phase import EnvironmentPhase as EnvironmentPhase from .event_list_params import EventListParams as EventListParams from .group_list_params import GroupListParams as GroupListParams +from .runner_capability import RunnerCapability as RunnerCapability +from .runner_spec_param import RunnerSpecParam as RunnerSpecParam +from .account_membership import AccountMembership as AccountMembership from .editor_list_params import EditorListParams as EditorListParams +from .environment_status import EnvironmentStatus as EnvironmentStatus from .event_watch_params import EventWatchParams as EventWatchParams +from .resource_operation import ResourceOperation as ResourceOperation from .runner_list_params import RunnerListParams as RunnerListParams from .secret_list_params import SecretListParams as SecretListParams from .event_list_response import EventListResponse as EventListResponse -from .group_list_response import GroupListResponse as GroupListResponse +from .organization_member import OrganizationMember as OrganizationMember from .project_list_params import ProjectListParams as ProjectListParams -from .editor_list_response import EditorListResponse as EditorListResponse +from .environment_metadata import EnvironmentMetadata as EnvironmentMetadata from .event_watch_response import EventWatchResponse as EventWatchResponse +from .invite_domains_param import InviteDomainsParam as InviteDomainsParam +from .runner_configuration import RunnerConfiguration as RunnerConfiguration from .runner_create_params import RunnerCreateParams as RunnerCreateParams from .runner_delete_params import RunnerDeleteParams as RunnerDeleteParams -from .runner_list_response import RunnerListResponse as RunnerListResponse from .runner_update_params import RunnerUpdateParams as RunnerUpdateParams from .secret_create_params import SecretCreateParams as SecretCreateParams from .secret_delete_params import SecretDeleteParams as SecretDeleteParams -from .secret_list_response import SecretListResponse as SecretListResponse from .account_delete_params import AccountDeleteParams as AccountDeleteParams +from .joinable_organization import JoinableOrganization as JoinableOrganization from .project_create_params import ProjectCreateParams as ProjectCreateParams from .project_delete_params import ProjectDeleteParams as ProjectDeleteParams -from .project_list_response import ProjectListResponse as ProjectListResponse from .project_update_params import ProjectUpdateParams as ProjectUpdateParams from .editor_retrieve_params import EditorRetrieveParams as EditorRetrieveParams +from .environment_spec_param import EnvironmentSpecParam as EnvironmentSpecParam from .runner_create_response import RunnerCreateResponse as RunnerCreateResponse +from .runner_release_channel import RunnerReleaseChannel as RunnerReleaseChannel from .runner_retrieve_params import RunnerRetrieveParams as RunnerRetrieveParams from .secret_create_response import SecretCreateResponse as SecretCreateResponse from .account_retrieve_params import AccountRetrieveParams as AccountRetrieveParams +from .environment_initializer import EnvironmentInitializer as EnvironmentInitializer from .environment_list_params import EnvironmentListParams as EnvironmentListParams from .environment_stop_params import EnvironmentStopParams as EnvironmentStopParams from .project_create_response import ProjectCreateResponse as ProjectCreateResponse @@ -45,19 +90,20 @@ from .editor_resolve_url_params import EditorResolveURLParams as EditorResolveURLParams from .environment_create_params import EnvironmentCreateParams as EnvironmentCreateParams from .environment_delete_params import EnvironmentDeleteParams as EnvironmentDeleteParams -from .environment_list_response import EnvironmentListResponse as EnvironmentListResponse from .environment_update_params import EnvironmentUpdateParams as EnvironmentUpdateParams from .organization_leave_params import OrganizationLeaveParams as OrganizationLeaveParams +from .project_environment_class import ProjectEnvironmentClass as ProjectEnvironmentClass from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse from .secret_get_value_response import SecretGetValueResponse as SecretGetValueResponse from .user_set_suspended_params import UserSetSuspendedParams as UserSetSuspendedParams from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams from .organization_delete_params import OrganizationDeleteParams as OrganizationDeleteParams from .organization_join_response import OrganizationJoinResponse as OrganizationJoinResponse -from .organization_list_response import OrganizationListResponse as OrganizationListResponse from .organization_update_params import OrganizationUpdateParams as OrganizationUpdateParams +from .runner_configuration_param import RunnerConfigurationParam as RunnerConfigurationParam from .secret_update_value_params import SecretUpdateValueParams as SecretUpdateValueParams from .editor_resolve_url_response import EditorResolveURLResponse as EditorResolveURLResponse +from .environment_activity_signal import EnvironmentActivitySignal as EnvironmentActivitySignal from .environment_create_response import EnvironmentCreateResponse as EnvironmentCreateResponse from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams @@ -65,27 +111,26 @@ from .organization_retrieve_params import OrganizationRetrieveParams as OrganizationRetrieveParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams from .organization_update_response import OrganizationUpdateResponse as OrganizationUpdateResponse +from .environment_initializer_param import EnvironmentInitializerParam as EnvironmentInitializerParam from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse from .environment_mark_active_params import EnvironmentMarkActiveParams as EnvironmentMarkActiveParams from .identity_exchange_token_params import IdentityExchangeTokenParams as IdentityExchangeTokenParams from .identity_get_id_token_response import IdentityGetIDTokenResponse as IdentityGetIDTokenResponse from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse +from .project_environment_class_param import ProjectEnvironmentClassParam as ProjectEnvironmentClassParam from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams from .account_get_sso_login_url_params import AccountGetSSOLoginURLParams as AccountGetSSOLoginURLParams from .identity_exchange_token_response import IdentityExchangeTokenResponse as IdentityExchangeTokenResponse from .organization_list_members_params import OrganizationListMembersParams as OrganizationListMembersParams +from .environment_activity_signal_param import EnvironmentActivitySignalParam as EnvironmentActivitySignalParam from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse from .account_get_sso_login_url_response import AccountGetSSOLoginURLResponse as AccountGetSSOLoginURLResponse -from .organization_list_members_response import OrganizationListMembersResponse as OrganizationListMembersResponse from .user_get_authenticated_user_params import UserGetAuthenticatedUserParams as UserGetAuthenticatedUserParams from .account_list_login_providers_params import AccountListLoginProvidersParams as AccountListLoginProvidersParams from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse from .environment_create_logs_token_params import EnvironmentCreateLogsTokenParams as EnvironmentCreateLogsTokenParams from .user_get_authenticated_user_response import UserGetAuthenticatedUserResponse as UserGetAuthenticatedUserResponse -from .account_list_login_providers_response import ( - AccountListLoginProvidersResponse as AccountListLoginProvidersResponse, -) from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, ) diff --git a/src/gitpod/types/account.py b/src/gitpod/types/account.py new file mode 100644 index 00000000..417f6c88 --- /dev/null +++ b/src/gitpod/types/account.py @@ -0,0 +1,222 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .account_membership import AccountMembership +from .joinable_organization import JoinableOrganization + +__all__ = ["Account"] + + +class Account(BaseModel): + id: Optional[str] = None + + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + email: Optional[str] = None + + joinables: Optional[List[JoinableOrganization]] = None + + memberships: Optional[List[AccountMembership]] = None + + name: Optional[str] = None + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """ + organization_id is the ID of the organization the account is owned by if it's + created through custom SSO + """ + + public_email_provider: Optional[bool] = FieldInfo(alias="publicEmailProvider", default=None) + """ + public_email_provider is true if the email for the Account matches a known + public email provider + """ + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ diff --git a/src/gitpod/types/account_get_sso_login_url_params.py b/src/gitpod/types/account_get_sso_login_url_params.py index 5c5f85d7..7689a8d3 100644 --- a/src/gitpod/types/account_get_sso_login_url_params.py +++ b/src/gitpod/types/account_get_sso_login_url_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing import Optional +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -10,8 +11,8 @@ class AccountGetSSOLoginURLParams(TypedDict, total=False): - return_to: Required[Annotated[str, PropertyInfo(alias="returnTo")]] - """return_to is the URL the user will be redirected to after login""" - email: str """email is the email the user wants to login with""" + + return_to: Annotated[Optional[str], PropertyInfo(alias="returnTo")] + """return_to is the URL the user will be redirected to after login""" diff --git a/src/gitpod/types/account_membership.py b/src/gitpod/types/account_membership.py new file mode 100644 index 00000000..c0e606db --- /dev/null +++ b/src/gitpod/types/account_membership.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.organization_role import OrganizationRole + +__all__ = ["AccountMembership"] + + +class AccountMembership(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the id of the organization the user is a member of""" + + organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + """ + organization_name is the member count of the organization the user is a member + of + """ + + organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) + """organization_name is the name of the organization the user is a member of""" + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + """user_id is the ID the user has in the organization""" + + user_role: Optional[OrganizationRole] = FieldInfo(alias="userRole", default=None) + """user_role is the role the user has in the organization""" diff --git a/src/gitpod/types/account_retrieve_response.py b/src/gitpod/types/account_retrieve_response.py index d0dffe2e..529e42b1 100644 --- a/src/gitpod/types/account_retrieve_response.py +++ b/src/gitpod/types/account_retrieve_response.py @@ -2,19 +2,10 @@ from typing import Optional -from pydantic import Field as FieldInfo - +from .account import Account from .._models import BaseModel -__all__ = ["AccountRetrieveResponse", "Account"] - - -class Account(BaseModel): - organization_id: str = FieldInfo(alias="organizationId") - """ - organization_id is the ID of the organization the account is owned by if it's - created through custom SSO - """ +__all__ = ["AccountRetrieveResponse"] class AccountRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/admission_level.py b/src/gitpod/types/admission_level.py new file mode 100644 index 00000000..40ee48da --- /dev/null +++ b/src/gitpod/types/admission_level.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["AdmissionLevel"] + +AdmissionLevel: TypeAlias = Literal[ + "ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE" +] diff --git a/src/gitpod/types/editor_list_response.py b/src/gitpod/types/editor.py similarity index 90% rename from src/gitpod/types/editor_list_response.py rename to src/gitpod/types/editor.py index d9482a8b..b5ea9d04 100644 --- a/src/gitpod/types/editor_list_response.py +++ b/src/gitpod/types/editor.py @@ -6,10 +6,10 @@ from .._models import BaseModel -__all__ = ["EditorListResponse"] +__all__ = ["Editor"] -class EditorListResponse(BaseModel): +class Editor(BaseModel): id: Optional[str] = None alias: Optional[str] = None diff --git a/src/gitpod/types/editor_retrieve_response.py b/src/gitpod/types/editor_retrieve_response.py index a6896cec..4f962cd7 100644 --- a/src/gitpod/types/editor_retrieve_response.py +++ b/src/gitpod/types/editor_retrieve_response.py @@ -2,27 +2,10 @@ from typing import Optional -from pydantic import Field as FieldInfo - +from .editor import Editor from .._models import BaseModel -__all__ = ["EditorRetrieveResponse", "Editor"] - - -class Editor(BaseModel): - id: Optional[str] = None - - alias: Optional[str] = None - - icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) - - installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) - - name: Optional[str] = None - - short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) - - url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) +__all__ = ["EditorRetrieveResponse"] class EditorRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/environment.py b/src/gitpod/types/environment.py new file mode 100644 index 00000000..0be34ff2 --- /dev/null +++ b/src/gitpod/types/environment.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .environment_spec import EnvironmentSpec +from .environment_status import EnvironmentStatus +from .environment_metadata import EnvironmentMetadata + +__all__ = ["Environment"] + + +class Environment(BaseModel): + id: Optional[str] = None + """ID is a unique identifier of this environment. + + No other environment with the same name must be managed by this environment + manager + """ + + metadata: Optional[EnvironmentMetadata] = None + """ + EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function + """ + + spec: Optional[EnvironmentSpec] = None + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + + status: Optional[EnvironmentStatus] = None + """EnvironmentStatus describes an environment status""" diff --git a/src/gitpod/types/environment_activity_signal.py b/src/gitpod/types/environment_activity_signal.py new file mode 100644 index 00000000..ea825be1 --- /dev/null +++ b/src/gitpod/types/environment_activity_signal.py @@ -0,0 +1,109 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from .._models import BaseModel + +__all__ = ["EnvironmentActivitySignal"] + + +class EnvironmentActivitySignal(BaseModel): + source: Optional[str] = None + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Optional[datetime] = None + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ diff --git a/src/gitpod/types/environment_activity_signal_param.py b/src/gitpod/types/environment_activity_signal_param.py new file mode 100644 index 00000000..d097493c --- /dev/null +++ b/src/gitpod/types/environment_activity_signal_param.py @@ -0,0 +1,112 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentActivitySignalParam"] + + +class EnvironmentActivitySignalParam(TypedDict, total=False): + source: str + """ + source of the activity signal, such as "VS Code", "SSH", or "Automations". It + should be a human-readable string that describes the source of the activity + signal. + """ + + timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index 819fea64..d8d60921 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -2,342 +2,19 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .environment_spec_param import EnvironmentSpecParam -__all__ = [ - "EnvironmentCreateFromProjectParams", - "Spec", - "SpecAutomationsFile", - "SpecContent", - "SpecContentInitializer", - "SpecContentInitializerSpec", - "SpecContentInitializerSpecContextURL", - "SpecContentInitializerSpecContextURLContextURL", - "SpecContentInitializerSpecGit", - "SpecContentInitializerSpecGitGit", - "SpecDevcontainer", - "SpecMachine", - "SpecPort", - "SpecSecret", - "SpecSecretUnionMember0", - "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", - "SpecSecretUnionMember2", - "SpecSSHPublicKey", - "SpecTimeout", -] +__all__ = ["EnvironmentCreateFromProjectParams"] class EnvironmentCreateFromProjectParams(TypedDict, total=False): project_id: Annotated[str, PropertyInfo(alias="projectId")] - spec: Spec + spec: EnvironmentSpecParam """ EnvironmentSpec specifies the configuration of an environment for an environment start """ - - -class SpecAutomationsFile(TypedDict, total=False): - automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] - """ - automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: str - - -class SpecContentInitializerSpecContextURLContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - - -class SpecContentInitializerSpecContextURL(TypedDict, total=False): - context_url: Required[Annotated[SpecContentInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] - - -class SpecContentInitializerSpecGitGit(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class SpecContentInitializerSpecGit(TypedDict, total=False): - git: Required[SpecContentInitializerSpecGitGit] - - -SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] - - -class SpecContentInitializer(TypedDict, total=False): - specs: Iterable[SpecContentInitializerSpec] - - -class SpecContent(TypedDict, total=False): - git_email: Annotated[str, PropertyInfo(alias="gitEmail")] - """The Git email address""" - - git_username: Annotated[str, PropertyInfo(alias="gitUsername")] - """The Git username""" - - initializer: SpecContentInitializer - """EnvironmentInitializer specifies how an environment is to be initialized""" - - session: str - - -class SpecDevcontainer(TypedDict, total=False): - devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: str - - -_SpecMachineReservedKeywords = TypedDict( - "_SpecMachineReservedKeywords", - { - "class": str, - }, - total=False, -) - - -class SpecMachine(_SpecMachineReservedKeywords, total=False): - session: str - - -class SpecPort(TypedDict, total=False): - admission: Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - """Admission level describes who can access an environment instance and its ports.""" - - name: str - """name of this port""" - - port: int - """port number""" - - -class SpecSecretUnionMember0(TypedDict, total=False): - environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] - - name: str - """name is the human readable description of the secret""" - - session: str - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: str - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(TypedDict, total=False): - file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: str - """name is the human readable description of the secret""" - - session: str - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: str - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class SpecSecretUnionMember2(TypedDict, total=False): - git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] - - name: str - """name is the human readable description of the secret""" - - session: str - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: str - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -SpecSecret: TypeAlias = Union[ - SpecSecretUnionMember0, - SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, - SpecSecretUnionMember2, -] - - -class SpecSSHPublicKey(TypedDict, total=False): - id: str - """id is the unique identifier of the public key""" - - value: str - """value is the actual public key in the public key file format""" - - -class SpecTimeout(TypedDict, total=False): - disconnected: str - """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". - """ - - -class Spec(TypedDict, total=False): - admission: Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - """Admission level describes who can access an environment instance and its ports.""" - - automations_file: Annotated[SpecAutomationsFile, PropertyInfo(alias="automationsFile")] - """automations_file is the automations file spec of the environment""" - - content: SpecContent - """content is the content spec of the environment""" - - desired_phase: Annotated[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ], - PropertyInfo(alias="desiredPhase"), - ] - """Phase is the desired phase of the environment""" - - devcontainer: SpecDevcontainer - """devcontainer is the devcontainer spec of the environment""" - - machine: SpecMachine - """machine is the machine spec of the environment""" - - ports: Iterable[SpecPort] - """ports is the set of ports which ought to be exposed to the internet""" - - secrets: Iterable[SpecSecret] - """secrets are confidential data that is mounted into the environment""" - - spec_version: Annotated[str, PropertyInfo(alias="specVersion")] - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - ssh_public_keys: Annotated[Iterable[SpecSSHPublicKey], PropertyInfo(alias="sshPublicKeys")] - """ssh_public_keys are the public keys used to ssh into the environment""" - - timeout: SpecTimeout - """Timeout configures the environment timeout""" diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index b4ab8c64..55275c10 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -1,1101 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional from .._models import BaseModel +from .environment import Environment -__all__ = [ - "EnvironmentCreateFromProjectResponse", - "Environment", - "EnvironmentMetadata", - "EnvironmentMetadataCreator", - "EnvironmentSpec", - "EnvironmentSpecAutomationsFile", - "EnvironmentSpecContent", - "EnvironmentSpecContentInitializer", - "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecContextURL", - "EnvironmentSpecContentInitializerSpecContextURLContextURL", - "EnvironmentSpecContentInitializerSpecGit", - "EnvironmentSpecContentInitializerSpecGitGit", - "EnvironmentSpecDevcontainer", - "EnvironmentSpecMachine", - "EnvironmentSpecPort", - "EnvironmentSpecSecret", - "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", - "EnvironmentSpecSecretUnionMember2", - "EnvironmentSpecSSHPublicKey", - "EnvironmentSpecTimeout", - "EnvironmentStatus", - "EnvironmentStatusActivitySignal", - "EnvironmentStatusAutomationsFile", - "EnvironmentStatusContent", - "EnvironmentStatusContentGit", - "EnvironmentStatusContentGitChangedFile", - "EnvironmentStatusDevcontainer", - "EnvironmentStatusEnvironmentURLs", - "EnvironmentStatusEnvironmentURLsPort", - "EnvironmentStatusEnvironmentURLsSSH", - "EnvironmentStatusMachine", - "EnvironmentStatusMachineVersions", - "EnvironmentStatusRunnerAck", - "EnvironmentStatusSecret", - "EnvironmentStatusSSHPublicKey", -] - - -class EnvironmentMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class EnvironmentMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. - +internal - not yet implemented - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[EnvironmentMetadataCreator] = None - """creator is the identity of the creator of the environment""" - - last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - name: Optional[str] = None - """name is the name of the environment as specified by the user""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was - created - """ - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """ - If the Environment was started from a project, the project_id will reference the - project. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """Runner is the ID of the runner that runs this environment.""" - - -class EnvironmentSpecAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - - -class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class EnvironmentSpecContentInitializerSpecGit(BaseModel): - git: EnvironmentSpecContentInitializerSpecGitGit - - -EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit -] - - -class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None - - -class EnvironmentSpecContent(BaseModel): - git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) - """The Git email address""" - - git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) - """The Git username""" - - initializer: Optional[EnvironmentSpecContentInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - session: Optional[str] = None - - -class EnvironmentSpecDevcontainer(BaseModel): - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecMachine(BaseModel): - class_: Optional[str] = FieldInfo(alias="class", default=None) - """Class denotes the class of the environment we ought to start""" - - session: Optional[str] = None - - -class EnvironmentSpecPort(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - name: Optional[str] = None - """name of this port""" - - port: Optional[int] = None - """port number""" - - -class EnvironmentSpecSecretUnionMember0(BaseModel): - environment_variable: str = FieldInfo(alias="environmentVariable") - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): - file_path: str = FieldInfo(alias="filePath") - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretUnionMember2(BaseModel): - git_credential_host: str = FieldInfo(alias="gitCredentialHost") - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -EnvironmentSpecSecret: TypeAlias = Union[ - EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, - EnvironmentSpecSecretUnionMember2, -] - - -class EnvironmentSpecSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - value: Optional[str] = None - """value is the actual public key in the public key file format""" - - -class EnvironmentSpecTimeout(BaseModel): - disconnected: Optional[str] = None - """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". - """ - - -class EnvironmentSpec(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file is the automations file spec of the environment""" - - content: Optional[EnvironmentSpecContent] = None - """content is the content spec of the environment""" - - desired_phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """Phase is the desired phase of the environment""" - - devcontainer: Optional[EnvironmentSpecDevcontainer] = None - """devcontainer is the devcontainer spec of the environment""" - - machine: Optional[EnvironmentSpecMachine] = None - """machine is the machine spec of the environment""" - - ports: Optional[List[EnvironmentSpecPort]] = None - """ports is the set of ports which ought to be exposed to the internet""" - - secrets: Optional[List[EnvironmentSpecSecret]] = None - """secrets are confidential data that is mounted into the environment""" - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys are the public keys used to ssh into the environment""" - - timeout: Optional[EnvironmentSpecTimeout] = None - """Timeout configures the environment timeout""" - - -class EnvironmentStatusActivitySignal(BaseModel): - source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity - signal. - """ - - timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class EnvironmentStatusAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root. - """ - - automations_file_presence: Optional[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] - ] = FieldInfo(alias="automationsFilePresence", default=None) - """ - automations_file_presence indicates how an automations file is present in the - environment. - """ - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """ - failure_message contains the reason the automations file failed to be applied. - This is only set if the phase is FAILED. - """ - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the automations file.""" - - session: Optional[str] = None - """ - session is the automations file session that is currently applied in the - environment. - """ - - -class EnvironmentStatusContentGitChangedFile(BaseModel): - change_type: Optional[ - Literal[ - "CHANGE_TYPE_UNSPECIFIED", - "CHANGE_TYPE_ADDED", - "CHANGE_TYPE_MODIFIED", - "CHANGE_TYPE_DELETED", - "CHANGE_TYPE_RENAMED", - "CHANGE_TYPE_COPIED", - "CHANGE_TYPE_UPDATED_BUT_UNMERGED", - "CHANGE_TYPE_UNTRACKED", - ] - ] = FieldInfo(alias="changeType", default=None) - """ChangeType is the type of change that happened to the file""" - - path: Optional[str] = None - """path is the path of the file""" - - -class EnvironmentStatusContentGit(BaseModel): - branch: Optional[str] = None - """branch is branch we're currently on""" - - changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( - alias="changedFiles", default=None - ) - """ - changed_files is an array of changed files in the environment, possibly - truncated - """ - - clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) - """ - clone_url is the repository url as you would pass it to "git clone". Only HTTPS - clone URLs are supported. - """ - - latest_commit: Optional[str] = FieldInfo(alias="latestCommit", default=None) - """latest_commit is the most recent commit on the current branch""" - - total_changed_files: Optional[int] = FieldInfo(alias="totalChangedFiles", default=None) - - total_unpushed_commits: Optional[int] = FieldInfo(alias="totalUnpushedCommits", default=None) - """the total number of unpushed changes""" - - unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """ - unpushed_commits is an array of unpushed changes in the environment, possibly - truncated - """ - - -class EnvironmentStatusContent(BaseModel): - content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) - """content_location_in_machine is the location of the content in the machine""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the content initialization failed.""" - - git: Optional[EnvironmentStatusContentGit] = None - """ - git is the Git working copy status of the environment. Note: this is a - best-effort field and more often than not will not be present. Its absence does - not indicate the absence of a working copy. - """ - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the environment content""" - - session: Optional[str] = None - """session is the session that is currently active in the environment.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the content is present but not in the expected state. - """ - - -class EnvironmentStatusDevcontainer(BaseModel): - container_id: Optional[str] = FieldInfo(alias="containerId", default=None) - """container_id is the ID of the container.""" - - container_name: Optional[str] = FieldInfo(alias="containerName", default=None) - """ - container_name is the name of the container that is used to connect to the - devcontainer - """ - - devcontainerconfig_in_sync: Optional[bool] = FieldInfo(alias="devcontainerconfigInSync", default=None) - """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. - - the devcontainer config file. - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - devcontainer_file_presence: Optional[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] - ] = FieldInfo(alias="devcontainerFilePresence", default=None) - """ - devcontainer_file_presence indicates how the devcontainer file is present in the - repo. - """ - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the devcontainer failed to operate.""" - - phase: Optional[ - Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] - ] = None - """phase is the current phase of the devcontainer""" - - remote_user: Optional[str] = FieldInfo(alias="remoteUser", default=None) - """remote_user is the user that is used to connect to the devcontainer""" - - remote_workspace_folder: Optional[str] = FieldInfo(alias="remoteWorkspaceFolder", default=None) - """ - remote_workspace_folder is the folder that is used to connect to the - devcontainer - """ - - secrets_in_sync: Optional[bool] = FieldInfo(alias="secretsInSync", default=None) - """secrets_in_sync indicates if the secrets are up to date w.r.t. - - the running devcontainer. - """ - - session: Optional[str] = None - """session is the session that is currently active in the devcontainer.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the devcontainer is present but not in the expected state. - """ - - -class EnvironmentStatusEnvironmentURLsPort(BaseModel): - port: Optional[int] = None - """port is the port number of the environment port""" - - url: Optional[str] = None - """url is the URL at which the environment port can be accessed""" - - -class EnvironmentStatusEnvironmentURLsSSH(BaseModel): - url: Optional[str] = None - - -class EnvironmentStatusEnvironmentURLs(BaseModel): - logs: Optional[str] = None - """logs is the URL at which the environment logs can be accessed.""" - - ports: Optional[List[EnvironmentStatusEnvironmentURLsPort]] = None - - ssh: Optional[EnvironmentStatusEnvironmentURLsSSH] = None - """SSH is the URL at which the environment can be accessed via SSH.""" - - -class EnvironmentStatusMachineVersions(BaseModel): - supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) - - supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) - - -class EnvironmentStatusMachine(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the machine failed to operate.""" - - phase: Optional[ - Literal[ - "PHASE_UNSPECIFIED", - "PHASE_CREATING", - "PHASE_STARTING", - "PHASE_RUNNING", - "PHASE_STOPPING", - "PHASE_STOPPED", - "PHASE_DELETING", - "PHASE_DELETED", - ] - ] = None - """phase is the current phase of the environment machine""" - - session: Optional[str] = None - """session is the session that is currently active in the machine.""" - - timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. - - If this field is empty, the environment has not timed out. - """ - - versions: Optional[EnvironmentStatusMachineVersions] = None - """versions contains the versions of components in the machine.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the machine is present but not in the expected state. - """ - - -class EnvironmentStatusRunnerAck(BaseModel): - message: Optional[str] = None - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - - status_code: Optional[ - Literal[ - "STATUS_CODE_UNSPECIFIED", - "STATUS_CODE_OK", - "STATUS_CODE_INVALID_RESOURCE", - "STATUS_CODE_FAILED_PRECONDITION", - ] - ] = FieldInfo(alias="statusCode", default=None) - - -class EnvironmentStatusSecret(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the secret failed to be materialize.""" - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - - secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) - - session: Optional[str] = None - """session is the session that is currently active in the environment.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the secret is present but not in the expected state. - """ - - -class EnvironmentStatusSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the public key""" - - -class EnvironmentStatus(BaseModel): - activity_signal: Optional[EnvironmentStatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) - """EnvironmentActivitySignal used to signal activity for an environment.""" - - automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file contains the status of the automations file.""" - - content: Optional[EnvironmentStatusContent] = None - """content contains the status of the environment content.""" - - devcontainer: Optional[EnvironmentStatusDevcontainer] = None - """devcontainer contains the status of the devcontainer.""" - - environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. - """ - - failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. - - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. - """ - - machine: Optional[EnvironmentStatusMachine] = None - """machine contains the status of the environment machine""" - - phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = None - """ - the phase of an environment is a simple, high-level summary of where the - environment is in its lifecycle - """ - - runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """ - RunnerACK is the acknowledgement from the runner that is has received the - environment spec. - """ - - secrets: Optional[List[EnvironmentStatusSecret]] = None - """secrets contains the status of the environment secrets""" - - ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys contains the status of the environment ssh public keys""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Environment instances themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the environment is present but not in the expected state. - """ - - -class Environment(BaseModel): - id: Optional[str] = None - """ID is a unique identifier of this environment. - - No other environment with the same name must be managed by this environment - manager - """ - - metadata: Optional[EnvironmentMetadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for - other parts of the system to function - """ - - spec: Optional[EnvironmentSpec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment - start - """ - - status: Optional[EnvironmentStatus] = None - """EnvironmentStatus describes an environment status""" +__all__ = ["EnvironmentCreateFromProjectResponse"] class EnvironmentCreateFromProjectResponse(BaseModel): diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index ee192d90..33e65d81 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -2,340 +2,16 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import TypedDict -from .._utils import PropertyInfo +from .environment_spec_param import EnvironmentSpecParam -__all__ = [ - "EnvironmentCreateParams", - "Spec", - "SpecAutomationsFile", - "SpecContent", - "SpecContentInitializer", - "SpecContentInitializerSpec", - "SpecContentInitializerSpecContextURL", - "SpecContentInitializerSpecContextURLContextURL", - "SpecContentInitializerSpecGit", - "SpecContentInitializerSpecGitGit", - "SpecDevcontainer", - "SpecMachine", - "SpecPort", - "SpecSecret", - "SpecSecretUnionMember0", - "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", - "SpecSecretUnionMember2", - "SpecSSHPublicKey", - "SpecTimeout", -] +__all__ = ["EnvironmentCreateParams"] class EnvironmentCreateParams(TypedDict, total=False): - spec: Spec + spec: EnvironmentSpecParam """ EnvironmentSpec specifies the configuration of an environment for an environment start """ - - -class SpecAutomationsFile(TypedDict, total=False): - automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] - """ - automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: str - - -class SpecContentInitializerSpecContextURLContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - - -class SpecContentInitializerSpecContextURL(TypedDict, total=False): - context_url: Required[Annotated[SpecContentInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] - - -class SpecContentInitializerSpecGitGit(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class SpecContentInitializerSpecGit(TypedDict, total=False): - git: Required[SpecContentInitializerSpecGitGit] - - -SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] - - -class SpecContentInitializer(TypedDict, total=False): - specs: Iterable[SpecContentInitializerSpec] - - -class SpecContent(TypedDict, total=False): - git_email: Annotated[str, PropertyInfo(alias="gitEmail")] - """The Git email address""" - - git_username: Annotated[str, PropertyInfo(alias="gitUsername")] - """The Git username""" - - initializer: SpecContentInitializer - """EnvironmentInitializer specifies how an environment is to be initialized""" - - session: str - - -class SpecDevcontainer(TypedDict, total=False): - devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: str - - -_SpecMachineReservedKeywords = TypedDict( - "_SpecMachineReservedKeywords", - { - "class": str, - }, - total=False, -) - - -class SpecMachine(_SpecMachineReservedKeywords, total=False): - session: str - - -class SpecPort(TypedDict, total=False): - admission: Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - """Admission level describes who can access an environment instance and its ports.""" - - name: str - """name of this port""" - - port: int - """port number""" - - -class SpecSecretUnionMember0(TypedDict, total=False): - environment_variable: Required[Annotated[str, PropertyInfo(alias="environmentVariable")]] - - name: str - """name is the human readable description of the secret""" - - session: str - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: str - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(TypedDict, total=False): - file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: str - """name is the human readable description of the secret""" - - session: str - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: str - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class SpecSecretUnionMember2(TypedDict, total=False): - git_credential_host: Required[Annotated[str, PropertyInfo(alias="gitCredentialHost")]] - - name: str - """name is the human readable description of the secret""" - - session: str - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: str - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -SpecSecret: TypeAlias = Union[ - SpecSecretUnionMember0, - SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, - SpecSecretUnionMember2, -] - - -class SpecSSHPublicKey(TypedDict, total=False): - id: str - """id is the unique identifier of the public key""" - - value: str - """value is the actual public key in the public key file format""" - - -class SpecTimeout(TypedDict, total=False): - disconnected: str - """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". - """ - - -class Spec(TypedDict, total=False): - admission: Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - """Admission level describes who can access an environment instance and its ports.""" - - automations_file: Annotated[SpecAutomationsFile, PropertyInfo(alias="automationsFile")] - """automations_file is the automations file spec of the environment""" - - content: SpecContent - """content is the content spec of the environment""" - - desired_phase: Annotated[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ], - PropertyInfo(alias="desiredPhase"), - ] - """Phase is the desired phase of the environment""" - - devcontainer: SpecDevcontainer - """devcontainer is the devcontainer spec of the environment""" - - machine: SpecMachine - """machine is the machine spec of the environment""" - - ports: Iterable[SpecPort] - """ports is the set of ports which ought to be exposed to the internet""" - - secrets: Iterable[SpecSecret] - """secrets are confidential data that is mounted into the environment""" - - spec_version: Annotated[str, PropertyInfo(alias="specVersion")] - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - ssh_public_keys: Annotated[Iterable[SpecSSHPublicKey], PropertyInfo(alias="sshPublicKeys")] - """ssh_public_keys are the public keys used to ssh into the environment""" - - timeout: SpecTimeout - """Timeout configures the environment timeout""" diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index 22377c6e..3fb02bb9 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -1,1101 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional from .._models import BaseModel +from .environment import Environment -__all__ = [ - "EnvironmentCreateResponse", - "Environment", - "EnvironmentMetadata", - "EnvironmentMetadataCreator", - "EnvironmentSpec", - "EnvironmentSpecAutomationsFile", - "EnvironmentSpecContent", - "EnvironmentSpecContentInitializer", - "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecContextURL", - "EnvironmentSpecContentInitializerSpecContextURLContextURL", - "EnvironmentSpecContentInitializerSpecGit", - "EnvironmentSpecContentInitializerSpecGitGit", - "EnvironmentSpecDevcontainer", - "EnvironmentSpecMachine", - "EnvironmentSpecPort", - "EnvironmentSpecSecret", - "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", - "EnvironmentSpecSecretUnionMember2", - "EnvironmentSpecSSHPublicKey", - "EnvironmentSpecTimeout", - "EnvironmentStatus", - "EnvironmentStatusActivitySignal", - "EnvironmentStatusAutomationsFile", - "EnvironmentStatusContent", - "EnvironmentStatusContentGit", - "EnvironmentStatusContentGitChangedFile", - "EnvironmentStatusDevcontainer", - "EnvironmentStatusEnvironmentURLs", - "EnvironmentStatusEnvironmentURLsPort", - "EnvironmentStatusEnvironmentURLsSSH", - "EnvironmentStatusMachine", - "EnvironmentStatusMachineVersions", - "EnvironmentStatusRunnerAck", - "EnvironmentStatusSecret", - "EnvironmentStatusSSHPublicKey", -] - - -class EnvironmentMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class EnvironmentMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. - +internal - not yet implemented - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[EnvironmentMetadataCreator] = None - """creator is the identity of the creator of the environment""" - - last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - name: Optional[str] = None - """name is the name of the environment as specified by the user""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was - created - """ - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """ - If the Environment was started from a project, the project_id will reference the - project. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """Runner is the ID of the runner that runs this environment.""" - - -class EnvironmentSpecAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - - -class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class EnvironmentSpecContentInitializerSpecGit(BaseModel): - git: EnvironmentSpecContentInitializerSpecGitGit - - -EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit -] - - -class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None - - -class EnvironmentSpecContent(BaseModel): - git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) - """The Git email address""" - - git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) - """The Git username""" - - initializer: Optional[EnvironmentSpecContentInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - session: Optional[str] = None - - -class EnvironmentSpecDevcontainer(BaseModel): - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecMachine(BaseModel): - class_: Optional[str] = FieldInfo(alias="class", default=None) - """Class denotes the class of the environment we ought to start""" - - session: Optional[str] = None - - -class EnvironmentSpecPort(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - name: Optional[str] = None - """name of this port""" - - port: Optional[int] = None - """port number""" - - -class EnvironmentSpecSecretUnionMember0(BaseModel): - environment_variable: str = FieldInfo(alias="environmentVariable") - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): - file_path: str = FieldInfo(alias="filePath") - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretUnionMember2(BaseModel): - git_credential_host: str = FieldInfo(alias="gitCredentialHost") - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -EnvironmentSpecSecret: TypeAlias = Union[ - EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, - EnvironmentSpecSecretUnionMember2, -] - - -class EnvironmentSpecSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - value: Optional[str] = None - """value is the actual public key in the public key file format""" - - -class EnvironmentSpecTimeout(BaseModel): - disconnected: Optional[str] = None - """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". - """ - - -class EnvironmentSpec(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file is the automations file spec of the environment""" - - content: Optional[EnvironmentSpecContent] = None - """content is the content spec of the environment""" - - desired_phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """Phase is the desired phase of the environment""" - - devcontainer: Optional[EnvironmentSpecDevcontainer] = None - """devcontainer is the devcontainer spec of the environment""" - - machine: Optional[EnvironmentSpecMachine] = None - """machine is the machine spec of the environment""" - - ports: Optional[List[EnvironmentSpecPort]] = None - """ports is the set of ports which ought to be exposed to the internet""" - - secrets: Optional[List[EnvironmentSpecSecret]] = None - """secrets are confidential data that is mounted into the environment""" - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys are the public keys used to ssh into the environment""" - - timeout: Optional[EnvironmentSpecTimeout] = None - """Timeout configures the environment timeout""" - - -class EnvironmentStatusActivitySignal(BaseModel): - source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity - signal. - """ - - timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class EnvironmentStatusAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root. - """ - - automations_file_presence: Optional[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] - ] = FieldInfo(alias="automationsFilePresence", default=None) - """ - automations_file_presence indicates how an automations file is present in the - environment. - """ - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """ - failure_message contains the reason the automations file failed to be applied. - This is only set if the phase is FAILED. - """ - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the automations file.""" - - session: Optional[str] = None - """ - session is the automations file session that is currently applied in the - environment. - """ - - -class EnvironmentStatusContentGitChangedFile(BaseModel): - change_type: Optional[ - Literal[ - "CHANGE_TYPE_UNSPECIFIED", - "CHANGE_TYPE_ADDED", - "CHANGE_TYPE_MODIFIED", - "CHANGE_TYPE_DELETED", - "CHANGE_TYPE_RENAMED", - "CHANGE_TYPE_COPIED", - "CHANGE_TYPE_UPDATED_BUT_UNMERGED", - "CHANGE_TYPE_UNTRACKED", - ] - ] = FieldInfo(alias="changeType", default=None) - """ChangeType is the type of change that happened to the file""" - - path: Optional[str] = None - """path is the path of the file""" - - -class EnvironmentStatusContentGit(BaseModel): - branch: Optional[str] = None - """branch is branch we're currently on""" - - changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( - alias="changedFiles", default=None - ) - """ - changed_files is an array of changed files in the environment, possibly - truncated - """ - - clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) - """ - clone_url is the repository url as you would pass it to "git clone". Only HTTPS - clone URLs are supported. - """ - - latest_commit: Optional[str] = FieldInfo(alias="latestCommit", default=None) - """latest_commit is the most recent commit on the current branch""" - - total_changed_files: Optional[int] = FieldInfo(alias="totalChangedFiles", default=None) - - total_unpushed_commits: Optional[int] = FieldInfo(alias="totalUnpushedCommits", default=None) - """the total number of unpushed changes""" - - unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """ - unpushed_commits is an array of unpushed changes in the environment, possibly - truncated - """ - - -class EnvironmentStatusContent(BaseModel): - content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) - """content_location_in_machine is the location of the content in the machine""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the content initialization failed.""" - - git: Optional[EnvironmentStatusContentGit] = None - """ - git is the Git working copy status of the environment. Note: this is a - best-effort field and more often than not will not be present. Its absence does - not indicate the absence of a working copy. - """ - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the environment content""" - - session: Optional[str] = None - """session is the session that is currently active in the environment.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the content is present but not in the expected state. - """ - - -class EnvironmentStatusDevcontainer(BaseModel): - container_id: Optional[str] = FieldInfo(alias="containerId", default=None) - """container_id is the ID of the container.""" - - container_name: Optional[str] = FieldInfo(alias="containerName", default=None) - """ - container_name is the name of the container that is used to connect to the - devcontainer - """ - - devcontainerconfig_in_sync: Optional[bool] = FieldInfo(alias="devcontainerconfigInSync", default=None) - """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. - - the devcontainer config file. - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - devcontainer_file_presence: Optional[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] - ] = FieldInfo(alias="devcontainerFilePresence", default=None) - """ - devcontainer_file_presence indicates how the devcontainer file is present in the - repo. - """ - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the devcontainer failed to operate.""" - - phase: Optional[ - Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] - ] = None - """phase is the current phase of the devcontainer""" - - remote_user: Optional[str] = FieldInfo(alias="remoteUser", default=None) - """remote_user is the user that is used to connect to the devcontainer""" - - remote_workspace_folder: Optional[str] = FieldInfo(alias="remoteWorkspaceFolder", default=None) - """ - remote_workspace_folder is the folder that is used to connect to the - devcontainer - """ - - secrets_in_sync: Optional[bool] = FieldInfo(alias="secretsInSync", default=None) - """secrets_in_sync indicates if the secrets are up to date w.r.t. - - the running devcontainer. - """ - - session: Optional[str] = None - """session is the session that is currently active in the devcontainer.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the devcontainer is present but not in the expected state. - """ - - -class EnvironmentStatusEnvironmentURLsPort(BaseModel): - port: Optional[int] = None - """port is the port number of the environment port""" - - url: Optional[str] = None - """url is the URL at which the environment port can be accessed""" - - -class EnvironmentStatusEnvironmentURLsSSH(BaseModel): - url: Optional[str] = None - - -class EnvironmentStatusEnvironmentURLs(BaseModel): - logs: Optional[str] = None - """logs is the URL at which the environment logs can be accessed.""" - - ports: Optional[List[EnvironmentStatusEnvironmentURLsPort]] = None - - ssh: Optional[EnvironmentStatusEnvironmentURLsSSH] = None - """SSH is the URL at which the environment can be accessed via SSH.""" - - -class EnvironmentStatusMachineVersions(BaseModel): - supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) - - supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) - - -class EnvironmentStatusMachine(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the machine failed to operate.""" - - phase: Optional[ - Literal[ - "PHASE_UNSPECIFIED", - "PHASE_CREATING", - "PHASE_STARTING", - "PHASE_RUNNING", - "PHASE_STOPPING", - "PHASE_STOPPED", - "PHASE_DELETING", - "PHASE_DELETED", - ] - ] = None - """phase is the current phase of the environment machine""" - - session: Optional[str] = None - """session is the session that is currently active in the machine.""" - - timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. - - If this field is empty, the environment has not timed out. - """ - - versions: Optional[EnvironmentStatusMachineVersions] = None - """versions contains the versions of components in the machine.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the machine is present but not in the expected state. - """ - - -class EnvironmentStatusRunnerAck(BaseModel): - message: Optional[str] = None - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - - status_code: Optional[ - Literal[ - "STATUS_CODE_UNSPECIFIED", - "STATUS_CODE_OK", - "STATUS_CODE_INVALID_RESOURCE", - "STATUS_CODE_FAILED_PRECONDITION", - ] - ] = FieldInfo(alias="statusCode", default=None) - - -class EnvironmentStatusSecret(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the secret failed to be materialize.""" - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - - secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) - - session: Optional[str] = None - """session is the session that is currently active in the environment.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the secret is present but not in the expected state. - """ - - -class EnvironmentStatusSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the public key""" - - -class EnvironmentStatus(BaseModel): - activity_signal: Optional[EnvironmentStatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) - """EnvironmentActivitySignal used to signal activity for an environment.""" - - automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file contains the status of the automations file.""" - - content: Optional[EnvironmentStatusContent] = None - """content contains the status of the environment content.""" - - devcontainer: Optional[EnvironmentStatusDevcontainer] = None - """devcontainer contains the status of the devcontainer.""" - - environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. - """ - - failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. - - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. - """ - - machine: Optional[EnvironmentStatusMachine] = None - """machine contains the status of the environment machine""" - - phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = None - """ - the phase of an environment is a simple, high-level summary of where the - environment is in its lifecycle - """ - - runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """ - RunnerACK is the acknowledgement from the runner that is has received the - environment spec. - """ - - secrets: Optional[List[EnvironmentStatusSecret]] = None - """secrets contains the status of the environment secrets""" - - ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys contains the status of the environment ssh public keys""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Environment instances themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the environment is present but not in the expected state. - """ - - -class Environment(BaseModel): - id: Optional[str] = None - """ID is a unique identifier of this environment. - - No other environment with the same name must be managed by this environment - manager - """ - - metadata: Optional[EnvironmentMetadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for - other parts of the system to function - """ - - spec: Optional[EnvironmentSpec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment - start - """ - - status: Optional[EnvironmentStatus] = None - """EnvironmentStatus describes an environment status""" +__all__ = ["EnvironmentCreateResponse"] class EnvironmentCreateResponse(BaseModel): diff --git a/src/gitpod/types/environment_initializer.py b/src/gitpod/types/environment_initializer.py new file mode 100644 index 00000000..8630b153 --- /dev/null +++ b/src/gitpod/types/environment_initializer.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EnvironmentInitializer", "Spec", "SpecContextURL", "SpecGit"] + + +class SpecContextURL(BaseModel): + url: Optional[str] = None + """url is the URL from which the environment is created""" + + +class SpecGit(BaseModel): + checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) + """ + a path relative to the environment root in which the code will be checked out to + """ + + clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) + """remote_uri is the Git remote origin""" + + target_mode: Optional[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ] + ] = FieldInfo(alias="targetMode", default=None) + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) + """upstream_Remote_uri is the fork upstream of a repository""" + + +class Spec(BaseModel): + context_url: Optional[SpecContextURL] = FieldInfo(alias="contextUrl", default=None) + + git: Optional[SpecGit] = None + + +class EnvironmentInitializer(BaseModel): + specs: Optional[List[Spec]] = None diff --git a/src/gitpod/types/environment_initializer_param.py b/src/gitpod/types/environment_initializer_param.py new file mode 100644 index 00000000..32b0a649 --- /dev/null +++ b/src/gitpod/types/environment_initializer_param.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentInitializerParam", "Spec", "SpecContextURL", "SpecGit"] + + +class SpecContextURL(TypedDict, total=False): + url: str + """url is the URL from which the environment is created""" + + +class SpecGit(TypedDict, total=False): + checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] + """ + a path relative to the environment root in which the code will be checked out to + """ + + clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] + """the value for the clone target mode - use depends on the target mode""" + + remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] + """remote_uri is the Git remote origin""" + + target_mode: Annotated[ + Literal[ + "CLONE_TARGET_MODE_UNSPECIFIED", + "CLONE_TARGET_MODE_REMOTE_HEAD", + "CLONE_TARGET_MODE_REMOTE_COMMIT", + "CLONE_TARGET_MODE_REMOTE_BRANCH", + "CLONE_TARGET_MODE_LOCAL_BRANCH", + ], + PropertyInfo(alias="targetMode"), + ] + """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + + upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] + """upstream_Remote_uri is the fork upstream of a repository""" + + +class Spec(TypedDict, total=False): + context_url: Annotated[SpecContextURL, PropertyInfo(alias="contextUrl")] + + git: SpecGit + + +class EnvironmentInitializerParam(TypedDict, total=False): + specs: Iterable[Spec] diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index 29a26013..90bd40b4 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -3,9 +3,11 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .runner_kind import RunnerKind +from .environment_phase import EnvironmentPhase __all__ = ["EnvironmentListParams", "Filter", "Pagination"] @@ -42,35 +44,13 @@ class Filter(TypedDict, total=False): runner_ids filters the response to only Environments running on these Runner IDs """ - runner_kinds: Annotated[ - List[ - Literal[ - "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" - ] - ], - PropertyInfo(alias="runnerKinds"), - ] + runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] """ runner_kinds filters the response to only Environments running on these Runner Kinds """ - status_phases: Annotated[ - List[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ], - PropertyInfo(alias="statusPhases"), - ] + status_phases: Annotated[List[EnvironmentPhase], PropertyInfo(alias="statusPhases")] """ actual_phases is a list of phases the environment must be in for it to be returned in the API call diff --git a/src/gitpod/types/environment_list_response.py b/src/gitpod/types/environment_list_response.py deleted file mode 100644 index 02c45aab..00000000 --- a/src/gitpod/types/environment_list_response.py +++ /dev/null @@ -1,1093 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = [ - "EnvironmentListResponse", - "Metadata", - "MetadataCreator", - "Spec", - "SpecAutomationsFile", - "SpecContent", - "SpecContentInitializer", - "SpecContentInitializerSpec", - "SpecContentInitializerSpecContextURL", - "SpecContentInitializerSpecContextURLContextURL", - "SpecContentInitializerSpecGit", - "SpecContentInitializerSpecGitGit", - "SpecDevcontainer", - "SpecMachine", - "SpecPort", - "SpecSecret", - "SpecSecretUnionMember0", - "SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", - "SpecSecretUnionMember2", - "SpecSSHPublicKey", - "SpecTimeout", - "Status", - "StatusActivitySignal", - "StatusAutomationsFile", - "StatusContent", - "StatusContentGit", - "StatusContentGitChangedFile", - "StatusDevcontainer", - "StatusEnvironmentURLs", - "StatusEnvironmentURLsPort", - "StatusEnvironmentURLsSSH", - "StatusMachine", - "StatusMachineVersions", - "StatusRunnerAck", - "StatusSecret", - "StatusSSHPublicKey", -] - - -class MetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class Metadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. - +internal - not yet implemented - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[MetadataCreator] = None - """creator is the identity of the creator of the environment""" - - last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - name: Optional[str] = None - """name is the name of the environment as specified by the user""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was - created - """ - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """ - If the Environment was started from a project, the project_id will reference the - project. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """Runner is the ID of the runner that runs this environment.""" - - -class SpecAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class SpecContentInitializerSpecContextURLContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class SpecContentInitializerSpecContextURL(BaseModel): - context_url: SpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - - -class SpecContentInitializerSpecGitGit(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class SpecContentInitializerSpecGit(BaseModel): - git: SpecContentInitializerSpecGitGit - - -SpecContentInitializerSpec: TypeAlias = Union[SpecContentInitializerSpecContextURL, SpecContentInitializerSpecGit] - - -class SpecContentInitializer(BaseModel): - specs: Optional[List[SpecContentInitializerSpec]] = None - - -class SpecContent(BaseModel): - git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) - """The Git email address""" - - git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) - """The Git username""" - - initializer: Optional[SpecContentInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - session: Optional[str] = None - - -class SpecDevcontainer(BaseModel): - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class SpecMachine(BaseModel): - class_: Optional[str] = FieldInfo(alias="class", default=None) - """Class denotes the class of the environment we ought to start""" - - session: Optional[str] = None - - -class SpecPort(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - name: Optional[str] = None - """name of this port""" - - port: Optional[int] = None - """port number""" - - -class SpecSecretUnionMember0(BaseModel): - environment_variable: str = FieldInfo(alias="environmentVariable") - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): - file_path: str = FieldInfo(alias="filePath") - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class SpecSecretUnionMember2(BaseModel): - git_credential_host: str = FieldInfo(alias="gitCredentialHost") - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -SpecSecret: TypeAlias = Union[ - SpecSecretUnionMember0, - SpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, - SpecSecretUnionMember2, -] - - -class SpecSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - value: Optional[str] = None - """value is the actual public key in the public key file format""" - - -class SpecTimeout(BaseModel): - disconnected: Optional[str] = None - """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". - """ - - -class Spec(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - automations_file: Optional[SpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file is the automations file spec of the environment""" - - content: Optional[SpecContent] = None - """content is the content spec of the environment""" - - desired_phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """Phase is the desired phase of the environment""" - - devcontainer: Optional[SpecDevcontainer] = None - """devcontainer is the devcontainer spec of the environment""" - - machine: Optional[SpecMachine] = None - """machine is the machine spec of the environment""" - - ports: Optional[List[SpecPort]] = None - """ports is the set of ports which ought to be exposed to the internet""" - - secrets: Optional[List[SpecSecret]] = None - """secrets are confidential data that is mounted into the environment""" - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - ssh_public_keys: Optional[List[SpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys are the public keys used to ssh into the environment""" - - timeout: Optional[SpecTimeout] = None - """Timeout configures the environment timeout""" - - -class StatusActivitySignal(BaseModel): - source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity - signal. - """ - - timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class StatusAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root. - """ - - automations_file_presence: Optional[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] - ] = FieldInfo(alias="automationsFilePresence", default=None) - """ - automations_file_presence indicates how an automations file is present in the - environment. - """ - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """ - failure_message contains the reason the automations file failed to be applied. - This is only set if the phase is FAILED. - """ - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the automations file.""" - - session: Optional[str] = None - """ - session is the automations file session that is currently applied in the - environment. - """ - - -class StatusContentGitChangedFile(BaseModel): - change_type: Optional[ - Literal[ - "CHANGE_TYPE_UNSPECIFIED", - "CHANGE_TYPE_ADDED", - "CHANGE_TYPE_MODIFIED", - "CHANGE_TYPE_DELETED", - "CHANGE_TYPE_RENAMED", - "CHANGE_TYPE_COPIED", - "CHANGE_TYPE_UPDATED_BUT_UNMERGED", - "CHANGE_TYPE_UNTRACKED", - ] - ] = FieldInfo(alias="changeType", default=None) - """ChangeType is the type of change that happened to the file""" - - path: Optional[str] = None - """path is the path of the file""" - - -class StatusContentGit(BaseModel): - branch: Optional[str] = None - """branch is branch we're currently on""" - - changed_files: Optional[List[StatusContentGitChangedFile]] = FieldInfo(alias="changedFiles", default=None) - """ - changed_files is an array of changed files in the environment, possibly - truncated - """ - - clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) - """ - clone_url is the repository url as you would pass it to "git clone". Only HTTPS - clone URLs are supported. - """ - - latest_commit: Optional[str] = FieldInfo(alias="latestCommit", default=None) - """latest_commit is the most recent commit on the current branch""" - - total_changed_files: Optional[int] = FieldInfo(alias="totalChangedFiles", default=None) - - total_unpushed_commits: Optional[int] = FieldInfo(alias="totalUnpushedCommits", default=None) - """the total number of unpushed changes""" - - unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """ - unpushed_commits is an array of unpushed changes in the environment, possibly - truncated - """ - - -class StatusContent(BaseModel): - content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) - """content_location_in_machine is the location of the content in the machine""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the content initialization failed.""" - - git: Optional[StatusContentGit] = None - """ - git is the Git working copy status of the environment. Note: this is a - best-effort field and more often than not will not be present. Its absence does - not indicate the absence of a working copy. - """ - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the environment content""" - - session: Optional[str] = None - """session is the session that is currently active in the environment.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the content is present but not in the expected state. - """ - - -class StatusDevcontainer(BaseModel): - container_id: Optional[str] = FieldInfo(alias="containerId", default=None) - """container_id is the ID of the container.""" - - container_name: Optional[str] = FieldInfo(alias="containerName", default=None) - """ - container_name is the name of the container that is used to connect to the - devcontainer - """ - - devcontainerconfig_in_sync: Optional[bool] = FieldInfo(alias="devcontainerconfigInSync", default=None) - """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. - - the devcontainer config file. - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - devcontainer_file_presence: Optional[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] - ] = FieldInfo(alias="devcontainerFilePresence", default=None) - """ - devcontainer_file_presence indicates how the devcontainer file is present in the - repo. - """ - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the devcontainer failed to operate.""" - - phase: Optional[ - Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] - ] = None - """phase is the current phase of the devcontainer""" - - remote_user: Optional[str] = FieldInfo(alias="remoteUser", default=None) - """remote_user is the user that is used to connect to the devcontainer""" - - remote_workspace_folder: Optional[str] = FieldInfo(alias="remoteWorkspaceFolder", default=None) - """ - remote_workspace_folder is the folder that is used to connect to the - devcontainer - """ - - secrets_in_sync: Optional[bool] = FieldInfo(alias="secretsInSync", default=None) - """secrets_in_sync indicates if the secrets are up to date w.r.t. - - the running devcontainer. - """ - - session: Optional[str] = None - """session is the session that is currently active in the devcontainer.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the devcontainer is present but not in the expected state. - """ - - -class StatusEnvironmentURLsPort(BaseModel): - port: Optional[int] = None - """port is the port number of the environment port""" - - url: Optional[str] = None - """url is the URL at which the environment port can be accessed""" - - -class StatusEnvironmentURLsSSH(BaseModel): - url: Optional[str] = None - - -class StatusEnvironmentURLs(BaseModel): - logs: Optional[str] = None - """logs is the URL at which the environment logs can be accessed.""" - - ports: Optional[List[StatusEnvironmentURLsPort]] = None - - ssh: Optional[StatusEnvironmentURLsSSH] = None - """SSH is the URL at which the environment can be accessed via SSH.""" - - -class StatusMachineVersions(BaseModel): - supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) - - supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) - - -class StatusMachine(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the machine failed to operate.""" - - phase: Optional[ - Literal[ - "PHASE_UNSPECIFIED", - "PHASE_CREATING", - "PHASE_STARTING", - "PHASE_RUNNING", - "PHASE_STOPPING", - "PHASE_STOPPED", - "PHASE_DELETING", - "PHASE_DELETED", - ] - ] = None - """phase is the current phase of the environment machine""" - - session: Optional[str] = None - """session is the session that is currently active in the machine.""" - - timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. - - If this field is empty, the environment has not timed out. - """ - - versions: Optional[StatusMachineVersions] = None - """versions contains the versions of components in the machine.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the machine is present but not in the expected state. - """ - - -class StatusRunnerAck(BaseModel): - message: Optional[str] = None - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - - status_code: Optional[ - Literal[ - "STATUS_CODE_UNSPECIFIED", - "STATUS_CODE_OK", - "STATUS_CODE_INVALID_RESOURCE", - "STATUS_CODE_FAILED_PRECONDITION", - ] - ] = FieldInfo(alias="statusCode", default=None) - - -class StatusSecret(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the secret failed to be materialize.""" - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - - secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) - - session: Optional[str] = None - """session is the session that is currently active in the environment.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the secret is present but not in the expected state. - """ - - -class StatusSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the public key""" - - -class Status(BaseModel): - activity_signal: Optional[StatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) - """EnvironmentActivitySignal used to signal activity for an environment.""" - - automations_file: Optional[StatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file contains the status of the automations file.""" - - content: Optional[StatusContent] = None - """content contains the status of the environment content.""" - - devcontainer: Optional[StatusDevcontainer] = None - """devcontainer contains the status of the devcontainer.""" - - environment_urls: Optional[StatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. - """ - - failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. - - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. - """ - - machine: Optional[StatusMachine] = None - """machine contains the status of the environment machine""" - - phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = None - """ - the phase of an environment is a simple, high-level summary of where the - environment is in its lifecycle - """ - - runner_ack: Optional[StatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """ - RunnerACK is the acknowledgement from the runner that is has received the - environment spec. - """ - - secrets: Optional[List[StatusSecret]] = None - """secrets contains the status of the environment secrets""" - - ssh_public_keys: Optional[List[StatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys contains the status of the environment ssh public keys""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Environment instances themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the environment is present but not in the expected state. - """ - - -class EnvironmentListResponse(BaseModel): - id: Optional[str] = None - """ID is a unique identifier of this environment. - - No other environment with the same name must be managed by this environment - manager - """ - - metadata: Optional[Metadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for - other parts of the system to function - """ - - spec: Optional[Spec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment - start - """ - - status: Optional[Status] = None - """EnvironmentStatus describes an environment status""" diff --git a/src/gitpod/types/environment_mark_active_params.py b/src/gitpod/types/environment_mark_active_params.py index c88cd10d..8e2cbce5 100644 --- a/src/gitpod/types/environment_mark_active_params.py +++ b/src/gitpod/types/environment_mark_active_params.py @@ -2,119 +2,17 @@ from __future__ import annotations -from typing import Union -from datetime import datetime from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .environment_activity_signal_param import EnvironmentActivitySignalParam -__all__ = ["EnvironmentMarkActiveParams", "ActivitySignal"] +__all__ = ["EnvironmentMarkActiveParams"] class EnvironmentMarkActiveParams(TypedDict, total=False): - activity_signal: Annotated[ActivitySignal, PropertyInfo(alias="activitySignal")] + activity_signal: Annotated[EnvironmentActivitySignalParam, PropertyInfo(alias="activitySignal")] """EnvironmentActivitySignal used to signal activity for an environment.""" environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """The ID of the environment to update activity for.""" - - -class ActivitySignal(TypedDict, total=False): - source: str - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity - signal. - """ - - timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ diff --git a/src/gitpod/types/environment_metadata.py b/src/gitpod/types/environment_metadata.py new file mode 100644 index 00000000..412b7ae7 --- /dev/null +++ b/src/gitpod/types/environment_metadata.py @@ -0,0 +1,227 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject + +__all__ = ["EnvironmentMetadata"] + + +class EnvironmentMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + annotations are key/value pairs that gets attached to the environment. + +internal - not yet implemented + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[Subject] = None + """creator is the identity of the creator of the environment""" + + last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + name: Optional[str] = None + """name is the name of the environment as specified by the user""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the environment""" + + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + """ + original_context_url is the normalized URL from which the environment was + created + """ + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """ + If the Environment was started from a project, the project_id will reference the + project. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """Runner is the ID of the runner that runs this environment.""" diff --git a/src/gitpod/types/environment_phase.py b/src/gitpod/types/environment_phase.py new file mode 100644 index 00000000..817644db --- /dev/null +++ b/src/gitpod/types/environment_phase.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["EnvironmentPhase"] + +EnvironmentPhase: TypeAlias = Literal[ + "ENVIRONMENT_PHASE_UNSPECIFIED", + "ENVIRONMENT_PHASE_CREATING", + "ENVIRONMENT_PHASE_STARTING", + "ENVIRONMENT_PHASE_RUNNING", + "ENVIRONMENT_PHASE_UPDATING", + "ENVIRONMENT_PHASE_STOPPING", + "ENVIRONMENT_PHASE_STOPPED", + "ENVIRONMENT_PHASE_DELETING", + "ENVIRONMENT_PHASE_DELETED", +] diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index 5c40baec..1c55b33c 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -1,1101 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional from .._models import BaseModel +from .environment import Environment -__all__ = [ - "EnvironmentRetrieveResponse", - "Environment", - "EnvironmentMetadata", - "EnvironmentMetadataCreator", - "EnvironmentSpec", - "EnvironmentSpecAutomationsFile", - "EnvironmentSpecContent", - "EnvironmentSpecContentInitializer", - "EnvironmentSpecContentInitializerSpec", - "EnvironmentSpecContentInitializerSpecContextURL", - "EnvironmentSpecContentInitializerSpecContextURLContextURL", - "EnvironmentSpecContentInitializerSpecGit", - "EnvironmentSpecContentInitializerSpecGitGit", - "EnvironmentSpecDevcontainer", - "EnvironmentSpecMachine", - "EnvironmentSpecPort", - "EnvironmentSpecSecret", - "EnvironmentSpecSecretUnionMember0", - "EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted", - "EnvironmentSpecSecretUnionMember2", - "EnvironmentSpecSSHPublicKey", - "EnvironmentSpecTimeout", - "EnvironmentStatus", - "EnvironmentStatusActivitySignal", - "EnvironmentStatusAutomationsFile", - "EnvironmentStatusContent", - "EnvironmentStatusContentGit", - "EnvironmentStatusContentGitChangedFile", - "EnvironmentStatusDevcontainer", - "EnvironmentStatusEnvironmentURLs", - "EnvironmentStatusEnvironmentURLsPort", - "EnvironmentStatusEnvironmentURLsSSH", - "EnvironmentStatusMachine", - "EnvironmentStatusMachineVersions", - "EnvironmentStatusRunnerAck", - "EnvironmentStatusSecret", - "EnvironmentStatusSSHPublicKey", -] - - -class EnvironmentMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class EnvironmentMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - """ - annotations are key/value pairs that gets attached to the environment. - +internal - not yet implemented - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[EnvironmentMetadataCreator] = None - """creator is the identity of the creator of the environment""" - - last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - name: Optional[str] = None - """name is the name of the environment as specified by the user""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) - """ - original_context_url is the normalized URL from which the environment was - created - """ - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """ - If the Environment was started from a project, the project_id will reference the - project. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """Runner is the ID of the runner that runs this environment.""" - - -class EnvironmentSpecAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file that is applied in the - environment, relative to the repo root. path must not be absolute (start with a - /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecContentInitializerSpecContextURLContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class EnvironmentSpecContentInitializerSpecContextURL(BaseModel): - context_url: EnvironmentSpecContentInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - - -class EnvironmentSpecContentInitializerSpecGitGit(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class EnvironmentSpecContentInitializerSpecGit(BaseModel): - git: EnvironmentSpecContentInitializerSpecGitGit - - -EnvironmentSpecContentInitializerSpec: TypeAlias = Union[ - EnvironmentSpecContentInitializerSpecContextURL, EnvironmentSpecContentInitializerSpecGit -] - - -class EnvironmentSpecContentInitializer(BaseModel): - specs: Optional[List[EnvironmentSpecContentInitializerSpec]] = None - - -class EnvironmentSpecContent(BaseModel): - git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) - """The Git email address""" - - git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) - """The Git username""" - - initializer: Optional[EnvironmentSpecContentInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - session: Optional[str] = None - - -class EnvironmentSpecDevcontainer(BaseModel): - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root path must not be absolute (start with a /): - - ``` - this.matches('^$|^[^/].*') - ``` - """ - - session: Optional[str] = None - - -class EnvironmentSpecMachine(BaseModel): - class_: Optional[str] = FieldInfo(alias="class", default=None) - """Class denotes the class of the environment we ought to start""" - - session: Optional[str] = None - - -class EnvironmentSpecPort(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - name: Optional[str] = None - """name of this port""" - - port: Optional[int] = None - """port number""" - - -class EnvironmentSpecSecretUnionMember0(BaseModel): - environment_variable: str = FieldInfo(alias="environmentVariable") - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted(BaseModel): - file_path: str = FieldInfo(alias="filePath") - """file_path is the path inside the devcontainer where the secret is mounted""" - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -class EnvironmentSpecSecretUnionMember2(BaseModel): - git_credential_host: str = FieldInfo(alias="gitCredentialHost") - - name: Optional[str] = None - """name is the human readable description of the secret""" - - session: Optional[str] = None - """ - session indicated the current session of the secret. When the session does not - change, secrets are not reloaded in the environment. - """ - - source: Optional[str] = None - """source is the source of the secret, for now control-plane or runner""" - - source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) - """source_ref into the source, in case of control-plane this is uuid of the secret""" - - -EnvironmentSpecSecret: TypeAlias = Union[ - EnvironmentSpecSecretUnionMember0, - EnvironmentSpecSecretFilePathIsThePathInsideTheDevcontainerWhereTheSecretIsMounted, - EnvironmentSpecSecretUnionMember2, -] - - -class EnvironmentSpecSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - value: Optional[str] = None - """value is the actual public key in the public key file format""" - - -class EnvironmentSpecTimeout(BaseModel): - disconnected: Optional[str] = None - """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". - """ - - -class EnvironmentSpec(BaseModel): - admission: Optional[ - Literal["ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE"] - ] = None - """Admission level describes who can access an environment instance and its ports.""" - - automations_file: Optional[EnvironmentSpecAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file is the automations file spec of the environment""" - - content: Optional[EnvironmentSpecContent] = None - """content is the content spec of the environment""" - - desired_phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """Phase is the desired phase of the environment""" - - devcontainer: Optional[EnvironmentSpecDevcontainer] = None - """devcontainer is the devcontainer spec of the environment""" - - machine: Optional[EnvironmentSpecMachine] = None - """machine is the machine spec of the environment""" - - ports: Optional[List[EnvironmentSpecPort]] = None - """ports is the set of ports which ought to be exposed to the internet""" - - secrets: Optional[List[EnvironmentSpecSecret]] = None - """secrets are confidential data that is mounted into the environment""" - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - ssh_public_keys: Optional[List[EnvironmentSpecSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys are the public keys used to ssh into the environment""" - - timeout: Optional[EnvironmentSpecTimeout] = None - """Timeout configures the environment timeout""" - - -class EnvironmentStatusActivitySignal(BaseModel): - source: Optional[str] = None - """ - source of the activity signal, such as "VS Code", "SSH", or "Automations". It - should be a human-readable string that describes the source of the activity - signal. - """ - - timestamp: Optional[datetime] = None - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class EnvironmentStatusAutomationsFile(BaseModel): - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root. - """ - - automations_file_presence: Optional[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] - ] = FieldInfo(alias="automationsFilePresence", default=None) - """ - automations_file_presence indicates how an automations file is present in the - environment. - """ - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """ - failure_message contains the reason the automations file failed to be applied. - This is only set if the phase is FAILED. - """ - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the automations file.""" - - session: Optional[str] = None - """ - session is the automations file session that is currently applied in the - environment. - """ - - -class EnvironmentStatusContentGitChangedFile(BaseModel): - change_type: Optional[ - Literal[ - "CHANGE_TYPE_UNSPECIFIED", - "CHANGE_TYPE_ADDED", - "CHANGE_TYPE_MODIFIED", - "CHANGE_TYPE_DELETED", - "CHANGE_TYPE_RENAMED", - "CHANGE_TYPE_COPIED", - "CHANGE_TYPE_UPDATED_BUT_UNMERGED", - "CHANGE_TYPE_UNTRACKED", - ] - ] = FieldInfo(alias="changeType", default=None) - """ChangeType is the type of change that happened to the file""" - - path: Optional[str] = None - """path is the path of the file""" - - -class EnvironmentStatusContentGit(BaseModel): - branch: Optional[str] = None - """branch is branch we're currently on""" - - changed_files: Optional[List[EnvironmentStatusContentGitChangedFile]] = FieldInfo( - alias="changedFiles", default=None - ) - """ - changed_files is an array of changed files in the environment, possibly - truncated - """ - - clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) - """ - clone_url is the repository url as you would pass it to "git clone". Only HTTPS - clone URLs are supported. - """ - - latest_commit: Optional[str] = FieldInfo(alias="latestCommit", default=None) - """latest_commit is the most recent commit on the current branch""" - - total_changed_files: Optional[int] = FieldInfo(alias="totalChangedFiles", default=None) - - total_unpushed_commits: Optional[int] = FieldInfo(alias="totalUnpushedCommits", default=None) - """the total number of unpushed changes""" - - unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) - """ - unpushed_commits is an array of unpushed changes in the environment, possibly - truncated - """ - - -class EnvironmentStatusContent(BaseModel): - content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) - """content_location_in_machine is the location of the content in the machine""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the content initialization failed.""" - - git: Optional[EnvironmentStatusContentGit] = None - """ - git is the Git working copy status of the environment. Note: this is a - best-effort field and more often than not will not be present. Its absence does - not indicate the absence of a working copy. - """ - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the environment content""" - - session: Optional[str] = None - """session is the session that is currently active in the environment.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the content is present but not in the expected state. - """ - - -class EnvironmentStatusDevcontainer(BaseModel): - container_id: Optional[str] = FieldInfo(alias="containerId", default=None) - """container_id is the ID of the container.""" - - container_name: Optional[str] = FieldInfo(alias="containerName", default=None) - """ - container_name is the name of the container that is used to connect to the - devcontainer - """ - - devcontainerconfig_in_sync: Optional[bool] = FieldInfo(alias="devcontainerconfigInSync", default=None) - """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. - - the devcontainer config file. - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - devcontainer_file_presence: Optional[ - Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] - ] = FieldInfo(alias="devcontainerFilePresence", default=None) - """ - devcontainer_file_presence indicates how the devcontainer file is present in the - repo. - """ - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the devcontainer failed to operate.""" - - phase: Optional[ - Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] - ] = None - """phase is the current phase of the devcontainer""" - - remote_user: Optional[str] = FieldInfo(alias="remoteUser", default=None) - """remote_user is the user that is used to connect to the devcontainer""" - - remote_workspace_folder: Optional[str] = FieldInfo(alias="remoteWorkspaceFolder", default=None) - """ - remote_workspace_folder is the folder that is used to connect to the - devcontainer - """ - - secrets_in_sync: Optional[bool] = FieldInfo(alias="secretsInSync", default=None) - """secrets_in_sync indicates if the secrets are up to date w.r.t. - - the running devcontainer. - """ - - session: Optional[str] = None - """session is the session that is currently active in the devcontainer.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the devcontainer is present but not in the expected state. - """ - - -class EnvironmentStatusEnvironmentURLsPort(BaseModel): - port: Optional[int] = None - """port is the port number of the environment port""" - - url: Optional[str] = None - """url is the URL at which the environment port can be accessed""" - - -class EnvironmentStatusEnvironmentURLsSSH(BaseModel): - url: Optional[str] = None - - -class EnvironmentStatusEnvironmentURLs(BaseModel): - logs: Optional[str] = None - """logs is the URL at which the environment logs can be accessed.""" - - ports: Optional[List[EnvironmentStatusEnvironmentURLsPort]] = None - - ssh: Optional[EnvironmentStatusEnvironmentURLsSSH] = None - """SSH is the URL at which the environment can be accessed via SSH.""" - - -class EnvironmentStatusMachineVersions(BaseModel): - supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) - - supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) - - -class EnvironmentStatusMachine(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the machine failed to operate.""" - - phase: Optional[ - Literal[ - "PHASE_UNSPECIFIED", - "PHASE_CREATING", - "PHASE_STARTING", - "PHASE_RUNNING", - "PHASE_STOPPING", - "PHASE_STOPPED", - "PHASE_DELETING", - "PHASE_DELETED", - ] - ] = None - """phase is the current phase of the environment machine""" - - session: Optional[str] = None - """session is the session that is currently active in the machine.""" - - timeout: Optional[str] = None - """timeout contains the reason the environment has timed out. - - If this field is empty, the environment has not timed out. - """ - - versions: Optional[EnvironmentStatusMachineVersions] = None - """versions contains the versions of components in the machine.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the machine is present but not in the expected state. - """ - - -class EnvironmentStatusRunnerAck(BaseModel): - message: Optional[str] = None - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - - status_code: Optional[ - Literal[ - "STATUS_CODE_UNSPECIFIED", - "STATUS_CODE_OK", - "STATUS_CODE_INVALID_RESOURCE", - "STATUS_CODE_FAILED_PRECONDITION", - ] - ] = FieldInfo(alias="statusCode", default=None) - - -class EnvironmentStatusSecret(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message contains the reason the secret failed to be materialize.""" - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - - secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) - - session: Optional[str] = None - """session is the session that is currently active in the environment.""" - - warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the secret is present but not in the expected state. - """ - - -class EnvironmentStatusSSHPublicKey(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the public key""" - - phase: Optional[ - Literal[ - "CONTENT_PHASE_UNSPECIFIED", - "CONTENT_PHASE_CREATING", - "CONTENT_PHASE_INITIALIZING", - "CONTENT_PHASE_READY", - "CONTENT_PHASE_UPDATING", - "CONTENT_PHASE_FAILED", - ] - ] = None - """phase is the current phase of the public key""" - - -class EnvironmentStatus(BaseModel): - activity_signal: Optional[EnvironmentStatusActivitySignal] = FieldInfo(alias="activitySignal", default=None) - """EnvironmentActivitySignal used to signal activity for an environment.""" - - automations_file: Optional[EnvironmentStatusAutomationsFile] = FieldInfo(alias="automationsFile", default=None) - """automations_file contains the status of the automations file.""" - - content: Optional[EnvironmentStatusContent] = None - """content contains the status of the environment content.""" - - devcontainer: Optional[EnvironmentStatusDevcontainer] = None - """devcontainer contains the status of the devcontainer.""" - - environment_urls: Optional[EnvironmentStatusEnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) - """ - environment_url contains the URL at which the environment can be accessed. This - field is only set if the environment is running. - """ - - failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the environment failed to operate. - - If this is non-empty the environment has failed to operate and will likely - transition to a stopped state. - """ - - machine: Optional[EnvironmentStatusMachine] = None - """machine contains the status of the environment machine""" - - phase: Optional[ - Literal[ - "ENVIRONMENT_PHASE_UNSPECIFIED", - "ENVIRONMENT_PHASE_CREATING", - "ENVIRONMENT_PHASE_STARTING", - "ENVIRONMENT_PHASE_RUNNING", - "ENVIRONMENT_PHASE_UPDATING", - "ENVIRONMENT_PHASE_STOPPING", - "ENVIRONMENT_PHASE_STOPPED", - "ENVIRONMENT_PHASE_DELETING", - "ENVIRONMENT_PHASE_DELETED", - ] - ] = None - """ - the phase of an environment is a simple, high-level summary of where the - environment is in its lifecycle - """ - - runner_ack: Optional[EnvironmentStatusRunnerAck] = FieldInfo(alias="runnerAck", default=None) - """ - RunnerACK is the acknowledgement from the runner that is has received the - environment spec. - """ - - secrets: Optional[List[EnvironmentStatusSecret]] = None - """secrets contains the status of the environment secrets""" - - ssh_public_keys: Optional[List[EnvironmentStatusSSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) - """ssh_public_keys contains the status of the environment ssh public keys""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Environment instances themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) - """warning_message contains warnings, e.g. - - when the environment is present but not in the expected state. - """ - - -class Environment(BaseModel): - id: Optional[str] = None - """ID is a unique identifier of this environment. - - No other environment with the same name must be managed by this environment - manager - """ - - metadata: Optional[EnvironmentMetadata] = None - """ - EnvironmentMetadata is data associated with an environment that's required for - other parts of the system to function - """ - - spec: Optional[EnvironmentSpec] = None - """ - EnvironmentSpec specifies the configuration of an environment for an environment - start - """ - - status: Optional[EnvironmentStatus] = None - """EnvironmentStatus describes an environment status""" +__all__ = ["EnvironmentRetrieveResponse"] class EnvironmentRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py new file mode 100644 index 00000000..96ea0496 --- /dev/null +++ b/src/gitpod/types/environment_spec.py @@ -0,0 +1,217 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .admission_level import AdmissionLevel +from .environment_phase import EnvironmentPhase +from .environment_initializer import EnvironmentInitializer + +__all__ = [ + "EnvironmentSpec", + "AutomationsFile", + "Content", + "Devcontainer", + "Machine", + "Port", + "Secret", + "SSHPublicKey", + "Timeout", +] + + +class AutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + session: Optional[str] = None + + +class Content(BaseModel): + git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) + """The Git email address""" + + git_username: Optional[str] = FieldInfo(alias="gitUsername", default=None) + """The Git username""" + + initializer: Optional[EnvironmentInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: Optional[str] = None + + +class Devcontainer(BaseModel): + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + session: Optional[str] = None + + +class Machine(BaseModel): + class_: Optional[str] = FieldInfo(alias="class", default=None) + """Class denotes the class of the environment we ought to start""" + + session: Optional[str] = None + + +class Port(BaseModel): + admission: Optional[AdmissionLevel] = None + """Admission level describes who can access an environment instance and its ports.""" + + name: Optional[str] = None + """name of this port""" + + port: Optional[int] = None + """port number""" + + +class Secret(BaseModel): + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Optional[str] = FieldInfo(alias="gitCredentialHost", default=None) + + name: Optional[str] = None + """name is the human readable description of the secret""" + + session: Optional[str] = None + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: Optional[str] = None + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Optional[str] = FieldInfo(alias="sourceRef", default=None) + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class SSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + value: Optional[str] = None + """value is the actual public key in the public key file format""" + + +class Timeout(BaseModel): + disconnected: Optional[str] = None + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class EnvironmentSpec(BaseModel): + admission: Optional[AdmissionLevel] = None + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Optional[AutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file is the automations file spec of the environment""" + + content: Optional[Content] = None + """content is the content spec of the environment""" + + desired_phase: Optional[EnvironmentPhase] = FieldInfo(alias="desiredPhase", default=None) + """Phase is the desired phase of the environment""" + + devcontainer: Optional[Devcontainer] = None + """devcontainer is the devcontainer spec of the environment""" + + machine: Optional[Machine] = None + """machine is the machine spec of the environment""" + + ports: Optional[List[Port]] = None + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Optional[List[Secret]] = None + """secrets are confidential data that is mounted into the environment""" + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Optional[List[SSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: Optional[Timeout] = None + """Timeout configures the environment timeout""" diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py new file mode 100644 index 00000000..2c1d714e --- /dev/null +++ b/src/gitpod/types/environment_spec_param.py @@ -0,0 +1,224 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .admission_level import AdmissionLevel +from .environment_phase import EnvironmentPhase +from .environment_initializer_param import EnvironmentInitializerParam + +__all__ = [ + "EnvironmentSpecParam", + "AutomationsFile", + "Content", + "Devcontainer", + "Machine", + "Port", + "Secret", + "SSHPublicKey", + "Timeout", +] + + +class AutomationsFile(TypedDict, total=False): + automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] + """ + automations_file_path is the path to the automations file that is applied in the + environment, relative to the repo root. path must not be absolute (start with a + /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + session: str + + +class Content(TypedDict, total=False): + git_email: Annotated[str, PropertyInfo(alias="gitEmail")] + """The Git email address""" + + git_username: Annotated[str, PropertyInfo(alias="gitUsername")] + """The Git username""" + + initializer: EnvironmentInitializerParam + """EnvironmentInitializer specifies how an environment is to be initialized""" + + session: str + + +class Devcontainer(TypedDict, total=False): + devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + session: str + + +_MachineReservedKeywords = TypedDict( + "_MachineReservedKeywords", + { + "class": str, + }, + total=False, +) + + +class Machine(_MachineReservedKeywords, total=False): + session: str + + +class Port(TypedDict, total=False): + admission: AdmissionLevel + """Admission level describes who can access an environment instance and its ports.""" + + name: str + """name of this port""" + + port: int + """port number""" + + +class Secret(TypedDict, total=False): + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] + + file_path: Annotated[str, PropertyInfo(alias="filePath")] + """file_path is the path inside the devcontainer where the secret is mounted""" + + git_credential_host: Annotated[str, PropertyInfo(alias="gitCredentialHost")] + + name: str + """name is the human readable description of the secret""" + + session: str + """ + session indicated the current session of the secret. When the session does not + change, secrets are not reloaded in the environment. + """ + + source: str + """source is the source of the secret, for now control-plane or runner""" + + source_ref: Annotated[str, PropertyInfo(alias="sourceRef")] + """source_ref into the source, in case of control-plane this is uuid of the secret""" + + +class SSHPublicKey(TypedDict, total=False): + id: str + """id is the unique identifier of the public key""" + + value: str + """value is the actual public key in the public key file format""" + + +class Timeout(TypedDict, total=False): + disconnected: str + """ + A Duration represents a signed, fixed-length span of time represented as a count + of seconds and fractions of seconds at nanosecond resolution. It is independent + of any calendar and concepts like "day" or "month". It is related to Timestamp + in that the difference between two Timestamp values is a Duration and it can be + added or subtracted from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an object, + where the string ends in the suffix "s" (indicating seconds) and is preceded by + the number of seconds, with nanoseconds expressed as fractional seconds. For + example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + while 3 seconds and 1 nanosecond should be expressed in JSON format as + "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + format as "3.000001s". + """ + + +class EnvironmentSpecParam(TypedDict, total=False): + admission: AdmissionLevel + """Admission level describes who can access an environment instance and its ports.""" + + automations_file: Annotated[AutomationsFile, PropertyInfo(alias="automationsFile")] + """automations_file is the automations file spec of the environment""" + + content: Content + """content is the content spec of the environment""" + + desired_phase: Annotated[EnvironmentPhase, PropertyInfo(alias="desiredPhase")] + """Phase is the desired phase of the environment""" + + devcontainer: Devcontainer + """devcontainer is the devcontainer spec of the environment""" + + machine: Machine + """machine is the machine spec of the environment""" + + ports: Iterable[Port] + """ports is the set of ports which ought to be exposed to the internet""" + + secrets: Iterable[Secret] + """secrets are confidential data that is mounted into the environment""" + + spec_version: Annotated[str, PropertyInfo(alias="specVersion")] + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + ssh_public_keys: Annotated[Iterable[SSHPublicKey], PropertyInfo(alias="sshPublicKeys")] + """ssh_public_keys are the public keys used to ssh into the environment""" + + timeout: Timeout + """Timeout configures the environment timeout""" diff --git a/src/gitpod/types/environment_status.py b/src/gitpod/types/environment_status.py new file mode 100644 index 00000000..6fd1a830 --- /dev/null +++ b/src/gitpod/types/environment_status.py @@ -0,0 +1,403 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .environment_phase import EnvironmentPhase +from .environment_activity_signal import EnvironmentActivitySignal + +__all__ = [ + "EnvironmentStatus", + "AutomationsFile", + "Content", + "ContentGit", + "ContentGitChangedFile", + "Devcontainer", + "EnvironmentURLs", + "EnvironmentURLsPort", + "EnvironmentURLsSSH", + "Machine", + "MachineVersions", + "RunnerAck", + "Secret", + "SSHPublicKey", +] + + +class AutomationsFile(BaseModel): + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root. + """ + + automations_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_ABSENT", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="automationsFilePresence", default=None) + """ + automations_file_presence indicates how an automations file is present in the + environment. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """ + failure_message contains the reason the automations file failed to be applied. + This is only set if the phase is FAILED. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the automations file.""" + + session: Optional[str] = None + """ + session is the automations file session that is currently applied in the + environment. + """ + + +class ContentGitChangedFile(BaseModel): + change_type: Optional[ + Literal[ + "CHANGE_TYPE_UNSPECIFIED", + "CHANGE_TYPE_ADDED", + "CHANGE_TYPE_MODIFIED", + "CHANGE_TYPE_DELETED", + "CHANGE_TYPE_RENAMED", + "CHANGE_TYPE_COPIED", + "CHANGE_TYPE_UPDATED_BUT_UNMERGED", + "CHANGE_TYPE_UNTRACKED", + ] + ] = FieldInfo(alias="changeType", default=None) + """ChangeType is the type of change that happened to the file""" + + path: Optional[str] = None + """path is the path of the file""" + + +class ContentGit(BaseModel): + branch: Optional[str] = None + """branch is branch we're currently on""" + + changed_files: Optional[List[ContentGitChangedFile]] = FieldInfo(alias="changedFiles", default=None) + """ + changed_files is an array of changed files in the environment, possibly + truncated + """ + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + """ + clone_url is the repository url as you would pass it to "git clone". Only HTTPS + clone URLs are supported. + """ + + latest_commit: Optional[str] = FieldInfo(alias="latestCommit", default=None) + """latest_commit is the most recent commit on the current branch""" + + total_changed_files: Optional[int] = FieldInfo(alias="totalChangedFiles", default=None) + + total_unpushed_commits: Optional[int] = FieldInfo(alias="totalUnpushedCommits", default=None) + """the total number of unpushed changes""" + + unpushed_commits: Optional[List[str]] = FieldInfo(alias="unpushedCommits", default=None) + """ + unpushed_commits is an array of unpushed changes in the environment, possibly + truncated + """ + + +class Content(BaseModel): + content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) + """content_location_in_machine is the location of the content in the machine""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the content initialization failed.""" + + git: Optional[ContentGit] = None + """ + git is the Git working copy status of the environment. Note: this is a + best-effort field and more often than not will not be present. Its absence does + not indicate the absence of a working copy. + """ + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the environment content""" + + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the content is present but not in the expected state. + """ + + +class Devcontainer(BaseModel): + container_id: Optional[str] = FieldInfo(alias="containerId", default=None) + """container_id is the ID of the container.""" + + container_name: Optional[str] = FieldInfo(alias="containerName", default=None) + """ + container_name is the name of the container that is used to connect to the + devcontainer + """ + + devcontainerconfig_in_sync: Optional[bool] = FieldInfo(alias="devcontainerconfigInSync", default=None) + """devcontainerconfig_in_sync indicates if the devcontainer is up to date w.r.t. + + the devcontainer config file. + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + devcontainer_file_presence: Optional[ + Literal["PRESENCE_UNSPECIFIED", "PRESENCE_GENERATED", "PRESENCE_DISCOVERED", "PRESENCE_SPECIFIED"] + ] = FieldInfo(alias="devcontainerFilePresence", default=None) + """ + devcontainer_file_presence indicates how the devcontainer file is present in the + repo. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the devcontainer failed to operate.""" + + phase: Optional[ + Literal["PHASE_UNSPECIFIED", "PHASE_CREATING", "PHASE_RUNNING", "PHASE_STOPPED", "PHASE_FAILED"] + ] = None + """phase is the current phase of the devcontainer""" + + remote_user: Optional[str] = FieldInfo(alias="remoteUser", default=None) + """remote_user is the user that is used to connect to the devcontainer""" + + remote_workspace_folder: Optional[str] = FieldInfo(alias="remoteWorkspaceFolder", default=None) + """ + remote_workspace_folder is the folder that is used to connect to the + devcontainer + """ + + secrets_in_sync: Optional[bool] = FieldInfo(alias="secretsInSync", default=None) + """secrets_in_sync indicates if the secrets are up to date w.r.t. + + the running devcontainer. + """ + + session: Optional[str] = None + """session is the session that is currently active in the devcontainer.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the devcontainer is present but not in the expected state. + """ + + +class EnvironmentURLsPort(BaseModel): + port: Optional[int] = None + """port is the port number of the environment port""" + + url: Optional[str] = None + """url is the URL at which the environment port can be accessed""" + + +class EnvironmentURLsSSH(BaseModel): + url: Optional[str] = None + + +class EnvironmentURLs(BaseModel): + logs: Optional[str] = None + """logs is the URL at which the environment logs can be accessed.""" + + ports: Optional[List[EnvironmentURLsPort]] = None + + ssh: Optional[EnvironmentURLsSSH] = None + """SSH is the URL at which the environment can be accessed via SSH.""" + + +class MachineVersions(BaseModel): + supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) + + supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) + + +class Machine(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the machine failed to operate.""" + + phase: Optional[ + Literal[ + "PHASE_UNSPECIFIED", + "PHASE_CREATING", + "PHASE_STARTING", + "PHASE_RUNNING", + "PHASE_STOPPING", + "PHASE_STOPPED", + "PHASE_DELETING", + "PHASE_DELETED", + ] + ] = None + """phase is the current phase of the environment machine""" + + session: Optional[str] = None + """session is the session that is currently active in the machine.""" + + timeout: Optional[str] = None + """timeout contains the reason the environment has timed out. + + If this field is empty, the environment has not timed out. + """ + + versions: Optional[MachineVersions] = None + """versions contains the versions of components in the machine.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the machine is present but not in the expected state. + """ + + +class RunnerAck(BaseModel): + message: Optional[str] = None + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + + status_code: Optional[ + Literal[ + "STATUS_CODE_UNSPECIFIED", + "STATUS_CODE_OK", + "STATUS_CODE_INVALID_RESOURCE", + "STATUS_CODE_FAILED_PRECONDITION", + ] + ] = FieldInfo(alias="statusCode", default=None) + + +class Secret(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the secret failed to be materialize.""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + + secret_name: Optional[str] = FieldInfo(alias="secretName", default=None) + + session: Optional[str] = None + """session is the session that is currently active in the environment.""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the secret is present but not in the expected state. + """ + + +class SSHPublicKey(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the public key""" + + phase: Optional[ + Literal[ + "CONTENT_PHASE_UNSPECIFIED", + "CONTENT_PHASE_CREATING", + "CONTENT_PHASE_INITIALIZING", + "CONTENT_PHASE_READY", + "CONTENT_PHASE_UPDATING", + "CONTENT_PHASE_FAILED", + ] + ] = None + """phase is the current phase of the public key""" + + +class EnvironmentStatus(BaseModel): + activity_signal: Optional[EnvironmentActivitySignal] = FieldInfo(alias="activitySignal", default=None) + """EnvironmentActivitySignal used to signal activity for an environment.""" + + automations_file: Optional[AutomationsFile] = FieldInfo(alias="automationsFile", default=None) + """automations_file contains the status of the automations file.""" + + content: Optional[Content] = None + """content contains the status of the environment content.""" + + devcontainer: Optional[Devcontainer] = None + """devcontainer contains the status of the devcontainer.""" + + environment_urls: Optional[EnvironmentURLs] = FieldInfo(alias="environmentUrls", default=None) + """ + environment_url contains the URL at which the environment can be accessed. This + field is only set if the environment is running. + """ + + failure_message: Optional[List[str]] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the environment failed to operate. + + If this is non-empty the environment has failed to operate and will likely + transition to a stopped state. + """ + + machine: Optional[Machine] = None + """machine contains the status of the environment machine""" + + phase: Optional[EnvironmentPhase] = None + """ + the phase of an environment is a simple, high-level summary of where the + environment is in its lifecycle + """ + + runner_ack: Optional[RunnerAck] = FieldInfo(alias="runnerAck", default=None) + """ + RunnerACK is the acknowledgement from the runner that is has received the + environment spec. + """ + + secrets: Optional[List[Secret]] = None + """secrets contains the status of the environment secrets""" + + ssh_public_keys: Optional[List[SSHPublicKey]] = FieldInfo(alias="sshPublicKeys", default=None) + """ssh_public_keys contains the status of the environment ssh public keys""" + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Environment instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. + """ + + warning_message: Optional[List[str]] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when the environment is present but not in the expected state. + """ diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index 7d936272..9768d6ba 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -2,36 +2,22 @@ from __future__ import annotations -from typing import Union, Iterable, Optional -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing import Iterable, Optional +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .admission_level import AdmissionLevel +from .environment_initializer_param import EnvironmentInitializerParam __all__ = [ "EnvironmentUpdateParams", "Spec", - "SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment", - "SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile", - "SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot", - "SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession", + "SpecAutomationsFile", "SpecContent", - "SpecContentContent", - "SpecContentContentTheGitEmailAddress", - "SpecContentContentTheGitUsername", - "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized", - "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer", - "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec", - "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL", - "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL", - "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit", - "SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit", - "SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization", "SpecDevcontainer", - "SpecDevcontainerDevcontainer", - "SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", - "SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild", - "SpecTimeoutConfiguresTheEnvironmentTimeout", - "SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout", + "SpecPort", + "SpecSSHPublicKey", + "SpecTimeout", ] @@ -47,10 +33,8 @@ class EnvironmentUpdateParams(TypedDict, total=False): spec: Optional[Spec] -class SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot( - TypedDict, total=False -): - automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] +class SpecAutomationsFile(TypedDict, total=False): + automations_file_path: Annotated[Optional[str], PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file that is applied in the environment, relative to the repo root. path must not be absolute (start with a @@ -61,127 +45,25 @@ class SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile ``` """ + session: Optional[str] -class SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession(TypedDict, total=False): - session: Required[str] - -SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile: TypeAlias = Union[ - SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileAutomationsFilePathIsThePathToTheAutomationsFileThatIsAppliedInTheEnvironmentRelativeToTheRepoRoot, - SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFileSession, -] - - -class SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment(TypedDict, total=False): - automations_file: Required[ - Annotated[ - SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironmentAutomationsFile, - PropertyInfo(alias="automationsFile"), - ] - ] - """automations_file is the automations file spec of the environment""" - - -class SpecContentContentTheGitEmailAddress(TypedDict, total=False): - git_email: Required[Annotated[str, PropertyInfo(alias="gitEmail")]] +class SpecContent(TypedDict, total=False): + git_email: Annotated[Optional[str], PropertyInfo(alias="gitEmail")] """The Git email address""" - -class SpecContentContentTheGitUsername(TypedDict, total=False): - git_username: Required[Annotated[str, PropertyInfo(alias="gitUsername")]] + git_username: Annotated[Optional[str], PropertyInfo(alias="gitUsername")] """The Git username""" - -class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL( - TypedDict, total=False -): - url: str - """url is the URL from which the environment is created""" - - -class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL( - TypedDict, total=False -): - context_url: Required[ - Annotated[ - SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURLContextURL, - PropertyInfo(alias="contextUrl"), - ] - ] - - -class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit( - TypedDict, total=False -): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit( - TypedDict, total=False -): - git: Required[SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGitGit] - - -SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec: TypeAlias = Union[ - SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecContextURL, - SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpecGit, -] - - -class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer(TypedDict, total=False): - specs: Iterable[SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializerSpec] - - -class SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized(TypedDict, total=False): - initializer: Required[SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitializedInitializer] + initializer: Optional[EnvironmentInitializerParam] """EnvironmentInitializer specifies how an environment is to be initialized""" - -class SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization(TypedDict, total=False): - session: Required[str] + session: Optional[str] """session should be changed to trigger a content reinitialization""" -SpecContentContent: TypeAlias = Union[ - SpecContentContentTheGitEmailAddress, - SpecContentContentTheGitUsername, - SpecContentContentInitializerConfiguresHowTheEnvironmentIsToBeInitialized, - SpecContentContentSessionShouldBeChangedToTriggerAContentReinitialization, -] - - -class SpecContent(TypedDict, total=False): - content: Required[SpecContentContent] - - -class SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot( - TypedDict, total=False -): - devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] +class SpecDevcontainer(TypedDict, total=False): + devcontainer_file_path: Annotated[Optional[str], PropertyInfo(alias="devcontainerFilePath")] """ devcontainer_file_path is the path to the devcontainer file relative to the repo root path must not be absolute (start with a /): @@ -191,24 +73,34 @@ class SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainer ``` """ - -class SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild(TypedDict, total=False): - session: Required[str] + session: Optional[str] """session should be changed to trigger a devcontainer rebuild""" -SpecDevcontainerDevcontainer: TypeAlias = Union[ - SpecDevcontainerDevcontainerDevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, - SpecDevcontainerDevcontainerSessionShouldBeChangedToTriggerADevcontainerRebuild, -] +class SpecPort(TypedDict, total=False): + admission: AdmissionLevel + """Admission level describes who can access an environment instance and its ports.""" + name: str + """name of this port""" + + port: int + """port number""" -class SpecDevcontainer(TypedDict, total=False): - devcontainer: Required[SpecDevcontainerDevcontainer] +class SpecSSHPublicKey(TypedDict, total=False): + id: str + """id is the unique identifier of the public key""" -class SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout(TypedDict, total=False): - disconnected: Required[str] + value: Optional[str] + """ + value is the actual public key in the public key file format if not provided, + the public key will be removed + """ + + +class SpecTimeout(TypedDict, total=False): + disconnected: Optional[str] """ A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent @@ -270,14 +162,22 @@ class SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout(TypedDict, total=False): """ -class SpecTimeoutConfiguresTheEnvironmentTimeout(TypedDict, total=False): - timeout: Required[SpecTimeoutConfiguresTheEnvironmentTimeoutTimeout] - """Timeout configures the environment timeout""" +class Spec(TypedDict, total=False): + automations_file: Annotated[Optional[SpecAutomationsFile], PropertyInfo(alias="automationsFile")] + """automations_file is the automations file spec of the environment""" + content: Optional[SpecContent] -Spec: TypeAlias = Union[ - SpecAutomationsFileIsTheAutomationsFileSpecOfTheEnvironment, - SpecContent, - SpecDevcontainer, - SpecTimeoutConfiguresTheEnvironmentTimeout, -] + devcontainer: Optional[SpecDevcontainer] + + ports: Iterable[SpecPort] + """ports controls port sharing""" + + ssh_public_keys: Annotated[Iterable[SpecSSHPublicKey], PropertyInfo(alias="sshPublicKeys")] + """ + ssh_public_keys are the public keys to update empty array means nothing to + update + """ + + timeout: Optional[SpecTimeout] + """Timeout configures the environment timeout""" diff --git a/src/gitpod/types/environments/__init__.py b/src/gitpod/types/environments/__init__.py index 240da5ec..2a0fe22c 100644 --- a/src/gitpod/types/environments/__init__.py +++ b/src/gitpod/types/environments/__init__.py @@ -3,6 +3,6 @@ from __future__ import annotations from .class_list_params import ClassListParams as ClassListParams -from .class_list_response import ClassListResponse as ClassListResponse +from .automations_file_param import AutomationsFileParam as AutomationsFileParam from .automation_upsert_params import AutomationUpsertParams as AutomationUpsertParams from .automation_upsert_response import AutomationUpsertResponse as AutomationUpsertResponse diff --git a/src/gitpod/types/environments/automation_upsert_params.py b/src/gitpod/types/environments/automation_upsert_params.py index 6c32b865..754ae89a 100644 --- a/src/gitpod/types/environments/automation_upsert_params.py +++ b/src/gitpod/types/environments/automation_upsert_params.py @@ -2,26 +2,16 @@ from __future__ import annotations -from typing import Dict, List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from .automations_file_param import AutomationsFileParam -__all__ = [ - "AutomationUpsertParams", - "AutomationsFile", - "AutomationsFileServices", - "AutomationsFileServicesCommands", - "AutomationsFileServicesRunsOn", - "AutomationsFileServicesRunsOnDocker", - "AutomationsFileTasks", - "AutomationsFileTasksRunsOn", - "AutomationsFileTasksRunsOnDocker", -] +__all__ = ["AutomationUpsertParams"] class AutomationUpsertParams(TypedDict, total=False): - automations_file: Annotated[AutomationsFile, PropertyInfo(alias="automationsFile")] + automations_file: Annotated[AutomationsFileParam, PropertyInfo(alias="automationsFile")] """ WARN: Do not remove any field here, as it will break reading automation yaml files. We error if there are any unknown fields in the yaml (to ensure the yaml @@ -30,89 +20,3 @@ class AutomationUpsertParams(TypedDict, total=False): """ environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - - -class AutomationsFileServicesCommands(TypedDict, total=False): - ready: str - """ - ready is an optional command that is run repeatedly until it exits with a zero - exit code. If set, the service will first go into a Starting phase, and then - into a Running phase once the ready command exits with a zero exit code. - """ - - start: str - """ - start is the command to start and run the service. If start exits, the service - will transition to the following phase: - - - Stopped: if the exit code is 0 - - Failed: if the exit code is not 0 If the stop command is not set, the start - command will receive a SIGTERM signal when the service is requested to stop. - If it does not exit within 2 minutes, it will receive a SIGKILL signal. - """ - - stop: str - """ - stop is an optional command that runs when the service is requested to stop. If - set, instead of sending a SIGTERM signal to the start command, the stop command - will be run. Once the stop command exits, the start command will receive a - SIGKILL signal. If the stop command exits with a non-zero exit code, the service - will transition to the Failed phase. If the stop command does not exit within 2 - minutes, a SIGKILL signal will be sent to both the start and stop commands. - """ - - -class AutomationsFileServicesRunsOnDocker(TypedDict, total=False): - environment: List[str] - - image: str - - -class AutomationsFileServicesRunsOn(TypedDict, total=False): - docker: Required[AutomationsFileServicesRunsOnDocker] - - -class AutomationsFileServices(TypedDict, total=False): - commands: AutomationsFileServicesCommands - - description: str - - name: str - - runs_on: Annotated[AutomationsFileServicesRunsOn, PropertyInfo(alias="runsOn")] - - triggered_by: Annotated[ - List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart"]], PropertyInfo(alias="triggeredBy") - ] - - -class AutomationsFileTasksRunsOnDocker(TypedDict, total=False): - environment: List[str] - - image: str - - -class AutomationsFileTasksRunsOn(TypedDict, total=False): - docker: Required[AutomationsFileTasksRunsOnDocker] - - -class AutomationsFileTasks(TypedDict, total=False): - command: str - - depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] - - description: str - - name: str - - runs_on: Annotated[AutomationsFileTasksRunsOn, PropertyInfo(alias="runsOn")] - - triggered_by: Annotated[ - List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart"]], PropertyInfo(alias="triggeredBy") - ] - - -class AutomationsFile(TypedDict, total=False): - services: Dict[str, AutomationsFileServices] - - tasks: Dict[str, AutomationsFileTasks] diff --git a/src/gitpod/types/environments/automations/__init__.py b/src/gitpod/types/environments/automations/__init__.py index 58ee02d6..11a40e65 100644 --- a/src/gitpod/types/environments/automations/__init__.py +++ b/src/gitpod/types/environments/automations/__init__.py @@ -2,22 +2,32 @@ from __future__ import annotations +from .task import Task as Task +from .service import Service as Service +from .task_spec import TaskSpec as TaskSpec +from .service_spec import ServiceSpec as ServiceSpec +from .service_phase import ServicePhase as ServicePhase +from .task_metadata import TaskMetadata as TaskMetadata +from .service_status import ServiceStatus as ServiceStatus +from .task_spec_param import TaskSpecParam as TaskSpecParam +from .service_metadata import ServiceMetadata as ServiceMetadata from .task_list_params import TaskListParams as TaskListParams from .task_start_params import TaskStartParams as TaskStartParams +from .service_spec_param import ServiceSpecParam as ServiceSpecParam from .task_create_params import TaskCreateParams as TaskCreateParams from .task_delete_params import TaskDeleteParams as TaskDeleteParams -from .task_list_response import TaskListResponse as TaskListResponse from .task_update_params import TaskUpdateParams as TaskUpdateParams from .service_list_params import ServiceListParams as ServiceListParams from .service_stop_params import ServiceStopParams as ServiceStopParams +from .task_metadata_param import TaskMetadataParam as TaskMetadataParam from .task_start_response import TaskStartResponse as TaskStartResponse from .service_start_params import ServiceStartParams as ServiceStartParams from .task_create_response import TaskCreateResponse as TaskCreateResponse from .task_retrieve_params import TaskRetrieveParams as TaskRetrieveParams from .service_create_params import ServiceCreateParams as ServiceCreateParams from .service_delete_params import ServiceDeleteParams as ServiceDeleteParams -from .service_list_response import ServiceListResponse as ServiceListResponse from .service_update_params import ServiceUpdateParams as ServiceUpdateParams +from .service_metadata_param import ServiceMetadataParam as ServiceMetadataParam from .task_retrieve_response import TaskRetrieveResponse as TaskRetrieveResponse from .service_create_response import ServiceCreateResponse as ServiceCreateResponse from .service_retrieve_params import ServiceRetrieveParams as ServiceRetrieveParams diff --git a/src/gitpod/types/environments/automations/service.py b/src/gitpod/types/environments/automations/service.py new file mode 100644 index 00000000..337562b2 --- /dev/null +++ b/src/gitpod/types/environments/automations/service.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel +from .service_spec import ServiceSpec +from .service_status import ServiceStatus +from .service_metadata import ServiceMetadata + +__all__ = ["Service"] + + +class Service(BaseModel): + id: Optional[str] = None + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[ServiceMetadata] = None + + spec: Optional[ServiceSpec] = None + + status: Optional[ServiceStatus] = None diff --git a/src/gitpod/types/environments/automations/service_create_params.py b/src/gitpod/types/environments/automations/service_create_params.py index 5b503270..248cd55a 100644 --- a/src/gitpod/types/environments/automations/service_create_params.py +++ b/src/gitpod/types/environments/automations/service_create_params.py @@ -2,264 +2,18 @@ from __future__ import annotations -from typing import List, Union, Iterable -from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from .service_spec_param import ServiceSpecParam +from .service_metadata_param import ServiceMetadataParam -__all__ = [ - "ServiceCreateParams", - "Metadata", - "MetadataCreator", - "MetadataTriggeredBy", - "MetadataTriggeredByManual", - "MetadataTriggeredByPostDevcontainerStart", - "MetadataTriggeredByPostEnvironmentStart", - "Spec", - "SpecCommands", - "SpecRunsOn", - "SpecRunsOnDocker", -] +__all__ = ["ServiceCreateParams"] class ServiceCreateParams(TypedDict, total=False): environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - metadata: Metadata + metadata: ServiceMetadataParam - spec: Spec - - -class MetadataCreator(TypedDict, total=False): - id: str - """id is the UUID of the subject""" - - principal: Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - """Principal is the principal of the subject""" - - -class MetadataTriggeredByManual(TypedDict, total=False): - manual: Required[bool] - - -class MetadataTriggeredByPostDevcontainerStart(TypedDict, total=False): - post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] - - -class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): - post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] - - -MetadataTriggeredBy: TypeAlias = Union[ - MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart -] - - -class Metadata(TypedDict, total=False): - created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: MetadataCreator - """creator describes the principal who created the service.""" - - description: str - """description is a user-facing description for the service. - - It can be used to provide context and documentation for the service. - """ - - name: str - """name is a user-facing name for the service. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the service. - """ - - reference: str - """ - reference is a user-facing identifier for the service which must be unique on - the environment. It is used to express dependencies between services, and to - identify the service in user interactions (e.g. the CLI). - """ - - triggered_by: Annotated[Iterable[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] - """triggered_by is a list of trigger that start the service.""" - - -class SpecCommands(TypedDict, total=False): - ready: str - """ - ready is an optional command that is run repeatedly until it exits with a zero - exit code. If set, the service will first go into a Starting phase, and then - into a Running phase once the ready command exits with a zero exit code. - """ - - start: str - """ - start is the command to start and run the service. If start exits, the service - will transition to the following phase: - - - Stopped: if the exit code is 0 - - Failed: if the exit code is not 0 If the stop command is not set, the start - command will receive a SIGTERM signal when the service is requested to stop. - If it does not exit within 2 minutes, it will receive a SIGKILL signal. - """ - - stop: str - """ - stop is an optional command that runs when the service is requested to stop. If - set, instead of sending a SIGTERM signal to the start command, the stop command - will be run. Once the stop command exits, the start command will receive a - SIGKILL signal. If the stop command exits with a non-zero exit code, the service - will transition to the Failed phase. If the stop command does not exit within 2 - minutes, a SIGKILL signal will be sent to both the start and stop commands. - """ - - -class SpecRunsOnDocker(TypedDict, total=False): - environment: List[str] - - image: str - - -class SpecRunsOn(TypedDict, total=False): - docker: Required[SpecRunsOnDocker] - - -class Spec(TypedDict, total=False): - commands: SpecCommands - """ - commands contains the commands to start, stop and check the readiness of the - service - """ - - desired_phase: Annotated[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ], - PropertyInfo(alias="desiredPhase"), - ] - """desired_phase is the phase the service should be in. - - Used to start or stop the service. - """ - - runs_on: Annotated[SpecRunsOn, PropertyInfo(alias="runsOn")] - """runs_on specifies the environment the service should run on.""" - - session: str - """session should be changed to trigger a restart of the service. - - If a service exits it will not be restarted until the session is changed. - """ - - spec_version: Annotated[str, PropertyInfo(alias="specVersion")] - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ + spec: ServiceSpecParam diff --git a/src/gitpod/types/environments/automations/service_create_response.py b/src/gitpod/types/environments/automations/service_create_response.py index 5e01ca64..1242a11b 100644 --- a/src/gitpod/types/environments/automations/service_create_response.py +++ b/src/gitpod/types/environments/automations/service_create_response.py @@ -1,314 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional +from .service import Service from ...._models import BaseModel -__all__ = [ - "ServiceCreateResponse", - "Service", - "ServiceMetadata", - "ServiceMetadataCreator", - "ServiceMetadataTriggeredBy", - "ServiceMetadataTriggeredByManual", - "ServiceMetadataTriggeredByPostDevcontainerStart", - "ServiceMetadataTriggeredByPostEnvironmentStart", - "ServiceSpec", - "ServiceSpecCommands", - "ServiceSpecRunsOn", - "ServiceSpecRunsOnDocker", - "ServiceStatus", -] - - -class ServiceMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ServiceMetadataTriggeredByManual(BaseModel): - manual: bool - - -class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): - post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - - -class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): - post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - - -ServiceMetadataTriggeredBy: TypeAlias = Union[ - ServiceMetadataTriggeredByManual, - ServiceMetadataTriggeredByPostDevcontainerStart, - ServiceMetadataTriggeredByPostEnvironmentStart, -] - - -class ServiceMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[ServiceMetadataCreator] = None - """creator describes the principal who created the service.""" - - description: Optional[str] = None - """description is a user-facing description for the service. - - It can be used to provide context and documentation for the service. - """ - - name: Optional[str] = None - """name is a user-facing name for the service. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the service. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the service which must be unique on - the environment. It is used to express dependencies between services, and to - identify the service in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the service.""" - - -class ServiceSpecCommands(BaseModel): - ready: Optional[str] = None - """ - ready is an optional command that is run repeatedly until it exits with a zero - exit code. If set, the service will first go into a Starting phase, and then - into a Running phase once the ready command exits with a zero exit code. - """ - - start: Optional[str] = None - """ - start is the command to start and run the service. If start exits, the service - will transition to the following phase: - - - Stopped: if the exit code is 0 - - Failed: if the exit code is not 0 If the stop command is not set, the start - command will receive a SIGTERM signal when the service is requested to stop. - If it does not exit within 2 minutes, it will receive a SIGKILL signal. - """ - - stop: Optional[str] = None - """ - stop is an optional command that runs when the service is requested to stop. If - set, instead of sending a SIGTERM signal to the start command, the stop command - will be run. Once the stop command exits, the start command will receive a - SIGKILL signal. If the stop command exits with a non-zero exit code, the service - will transition to the Failed phase. If the stop command does not exit within 2 - minutes, a SIGKILL signal will be sent to both the start and stop commands. - """ - - -class ServiceSpecRunsOnDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class ServiceSpecRunsOn(BaseModel): - docker: ServiceSpecRunsOnDocker - - -class ServiceSpec(BaseModel): - commands: Optional[ServiceSpecCommands] = None - """ - commands contains the commands to start, stop and check the readiness of the - service - """ - - desired_phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the service should be in. - - Used to start or stop the service. - """ - - runs_on: Optional[ServiceSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the service should run on.""" - - session: Optional[str] = None - """session should be changed to trigger a restart of the service. - - If a service exits it will not be restarted until the session is changed. - """ - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - -class ServiceStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the service failed to operate. - - If this is non-empty the service has failed to operate and will likely - transition to a failed state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url contains the URL at which the service logs can be accessed.""" - - phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = None - """phase is the current phase of the service.""" - - session: Optional[str] = None - """session is the current session of the service.""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Service instances themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - -class Service(BaseModel): - id: Optional[str] = None - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[ServiceMetadata] = None - - spec: Optional[ServiceSpec] = None - - status: Optional[ServiceStatus] = None +__all__ = ["ServiceCreateResponse"] class ServiceCreateResponse(BaseModel): diff --git a/src/gitpod/types/environments/automations/service_list_response.py b/src/gitpod/types/environments/automations/service_list_response.py deleted file mode 100644 index e4366982..00000000 --- a/src/gitpod/types/environments/automations/service_list_response.py +++ /dev/null @@ -1,308 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = [ - "ServiceListResponse", - "Metadata", - "MetadataCreator", - "MetadataTriggeredBy", - "MetadataTriggeredByManual", - "MetadataTriggeredByPostDevcontainerStart", - "MetadataTriggeredByPostEnvironmentStart", - "Spec", - "SpecCommands", - "SpecRunsOn", - "SpecRunsOnDocker", - "Status", -] - - -class MetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class MetadataTriggeredByManual(BaseModel): - manual: bool - - -class MetadataTriggeredByPostDevcontainerStart(BaseModel): - post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - - -class MetadataTriggeredByPostEnvironmentStart(BaseModel): - post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - - -MetadataTriggeredBy: TypeAlias = Union[ - MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart -] - - -class Metadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[MetadataCreator] = None - """creator describes the principal who created the service.""" - - description: Optional[str] = None - """description is a user-facing description for the service. - - It can be used to provide context and documentation for the service. - """ - - name: Optional[str] = None - """name is a user-facing name for the service. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the service. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the service which must be unique on - the environment. It is used to express dependencies between services, and to - identify the service in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[MetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the service.""" - - -class SpecCommands(BaseModel): - ready: Optional[str] = None - """ - ready is an optional command that is run repeatedly until it exits with a zero - exit code. If set, the service will first go into a Starting phase, and then - into a Running phase once the ready command exits with a zero exit code. - """ - - start: Optional[str] = None - """ - start is the command to start and run the service. If start exits, the service - will transition to the following phase: - - - Stopped: if the exit code is 0 - - Failed: if the exit code is not 0 If the stop command is not set, the start - command will receive a SIGTERM signal when the service is requested to stop. - If it does not exit within 2 minutes, it will receive a SIGKILL signal. - """ - - stop: Optional[str] = None - """ - stop is an optional command that runs when the service is requested to stop. If - set, instead of sending a SIGTERM signal to the start command, the stop command - will be run. Once the stop command exits, the start command will receive a - SIGKILL signal. If the stop command exits with a non-zero exit code, the service - will transition to the Failed phase. If the stop command does not exit within 2 - minutes, a SIGKILL signal will be sent to both the start and stop commands. - """ - - -class SpecRunsOnDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class SpecRunsOn(BaseModel): - docker: SpecRunsOnDocker - - -class Spec(BaseModel): - commands: Optional[SpecCommands] = None - """ - commands contains the commands to start, stop and check the readiness of the - service - """ - - desired_phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the service should be in. - - Used to start or stop the service. - """ - - runs_on: Optional[SpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the service should run on.""" - - session: Optional[str] = None - """session should be changed to trigger a restart of the service. - - If a service exits it will not be restarted until the session is changed. - """ - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - -class Status(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the service failed to operate. - - If this is non-empty the service has failed to operate and will likely - transition to a failed state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url contains the URL at which the service logs can be accessed.""" - - phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = None - """phase is the current phase of the service.""" - - session: Optional[str] = None - """session is the current session of the service.""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Service instances themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - -class ServiceListResponse(BaseModel): - id: Optional[str] = None - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[Metadata] = None - - spec: Optional[Spec] = None - - status: Optional[Status] = None diff --git a/src/gitpod/types/environments/automations/service_metadata.py b/src/gitpod/types/environments/automations/service_metadata.py new file mode 100644 index 00000000..b21e2c66 --- /dev/null +++ b/src/gitpod/types/environments/automations/service_metadata.py @@ -0,0 +1,132 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel +from ...shared.subject import Subject +from ...shared.automation_trigger import AutomationTrigger + +__all__ = ["ServiceMetadata"] + + +class ServiceMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[Subject] = None + """creator describes the principal who created the service.""" + + description: Optional[str] = None + """description is a user-facing description for the service. + + It can be used to provide context and documentation for the service. + """ + + name: Optional[str] = None + """name is a user-facing name for the service. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the service. + """ + + reference: Optional[str] = None + """ + reference is a user-facing identifier for the service which must be unique on + the environment. It is used to express dependencies between services, and to + identify the service in user interactions (e.g. the CLI). + """ + + triggered_by: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggeredBy", default=None) + """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_metadata_param.py b/src/gitpod/types/environments/automations/service_metadata_param.py new file mode 100644 index 00000000..8599c69e --- /dev/null +++ b/src/gitpod/types/environments/automations/service_metadata_param.py @@ -0,0 +1,133 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from ...._utils import PropertyInfo +from ...shared_params.subject import Subject +from ...shared_params.automation_trigger import AutomationTrigger + +__all__ = ["ServiceMetadataParam"] + + +class ServiceMetadataParam(TypedDict, total=False): + created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Subject + """creator describes the principal who created the service.""" + + description: str + """description is a user-facing description for the service. + + It can be used to provide context and documentation for the service. + """ + + name: str + """name is a user-facing name for the service. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the service. + """ + + reference: str + """ + reference is a user-facing identifier for the service which must be unique on + the environment. It is used to express dependencies between services, and to + identify the service in user interactions (e.g. the CLI). + """ + + triggered_by: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggeredBy")] + """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_phase.py b/src/gitpod/types/environments/automations/service_phase.py new file mode 100644 index 00000000..df4c8203 --- /dev/null +++ b/src/gitpod/types/environments/automations/service_phase.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ServicePhase"] + +ServicePhase: TypeAlias = Literal[ + "SERVICE_PHASE_UNSPECIFIED", + "SERVICE_PHASE_STARTING", + "SERVICE_PHASE_RUNNING", + "SERVICE_PHASE_STOPPING", + "SERVICE_PHASE_STOPPED", + "SERVICE_PHASE_FAILED", + "SERVICE_PHASE_DELETED", +] diff --git a/src/gitpod/types/environments/automations/service_retrieve_response.py b/src/gitpod/types/environments/automations/service_retrieve_response.py index 6a83eb94..e916c007 100644 --- a/src/gitpod/types/environments/automations/service_retrieve_response.py +++ b/src/gitpod/types/environments/automations/service_retrieve_response.py @@ -1,314 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional +from .service import Service from ...._models import BaseModel -__all__ = [ - "ServiceRetrieveResponse", - "Service", - "ServiceMetadata", - "ServiceMetadataCreator", - "ServiceMetadataTriggeredBy", - "ServiceMetadataTriggeredByManual", - "ServiceMetadataTriggeredByPostDevcontainerStart", - "ServiceMetadataTriggeredByPostEnvironmentStart", - "ServiceSpec", - "ServiceSpecCommands", - "ServiceSpecRunsOn", - "ServiceSpecRunsOnDocker", - "ServiceStatus", -] - - -class ServiceMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ServiceMetadataTriggeredByManual(BaseModel): - manual: bool - - -class ServiceMetadataTriggeredByPostDevcontainerStart(BaseModel): - post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - - -class ServiceMetadataTriggeredByPostEnvironmentStart(BaseModel): - post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - - -ServiceMetadataTriggeredBy: TypeAlias = Union[ - ServiceMetadataTriggeredByManual, - ServiceMetadataTriggeredByPostDevcontainerStart, - ServiceMetadataTriggeredByPostEnvironmentStart, -] - - -class ServiceMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[ServiceMetadataCreator] = None - """creator describes the principal who created the service.""" - - description: Optional[str] = None - """description is a user-facing description for the service. - - It can be used to provide context and documentation for the service. - """ - - name: Optional[str] = None - """name is a user-facing name for the service. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the service. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the service which must be unique on - the environment. It is used to express dependencies between services, and to - identify the service in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[ServiceMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the service.""" - - -class ServiceSpecCommands(BaseModel): - ready: Optional[str] = None - """ - ready is an optional command that is run repeatedly until it exits with a zero - exit code. If set, the service will first go into a Starting phase, and then - into a Running phase once the ready command exits with a zero exit code. - """ - - start: Optional[str] = None - """ - start is the command to start and run the service. If start exits, the service - will transition to the following phase: - - - Stopped: if the exit code is 0 - - Failed: if the exit code is not 0 If the stop command is not set, the start - command will receive a SIGTERM signal when the service is requested to stop. - If it does not exit within 2 minutes, it will receive a SIGKILL signal. - """ - - stop: Optional[str] = None - """ - stop is an optional command that runs when the service is requested to stop. If - set, instead of sending a SIGTERM signal to the start command, the stop command - will be run. Once the stop command exits, the start command will receive a - SIGKILL signal. If the stop command exits with a non-zero exit code, the service - will transition to the Failed phase. If the stop command does not exit within 2 - minutes, a SIGKILL signal will be sent to both the start and stop commands. - """ - - -class ServiceSpecRunsOnDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class ServiceSpecRunsOn(BaseModel): - docker: ServiceSpecRunsOnDocker - - -class ServiceSpec(BaseModel): - commands: Optional[ServiceSpecCommands] = None - """ - commands contains the commands to start, stop and check the readiness of the - service - """ - - desired_phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the service should be in. - - Used to start or stop the service. - """ - - runs_on: Optional[ServiceSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the service should run on.""" - - session: Optional[str] = None - """session should be changed to trigger a restart of the service. - - If a service exits it will not be restarted until the session is changed. - """ - - spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) - """version of the spec. - - The value of this field has no semantic meaning (e.g. don't interpret it as as a - timestamp), but it can be used to impose a partial order. If a.spec_version < - b.spec_version then a was the spec before b. - """ - - -class ServiceStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the service failed to operate. - - If this is non-empty the service has failed to operate and will likely - transition to a failed state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url contains the URL at which the service logs can be accessed.""" - - phase: Optional[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] = None - """phase is the current phase of the service.""" - - session: Optional[str] = None - """session is the current session of the service.""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Service instances themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - -class Service(BaseModel): - id: Optional[str] = None - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[ServiceMetadata] = None - - spec: Optional[ServiceSpec] = None - - status: Optional[ServiceStatus] = None +__all__ = ["ServiceRetrieveResponse"] class ServiceRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/environments/automations/service_spec.py b/src/gitpod/types/environments/automations/service_spec.py new file mode 100644 index 00000000..7e160fe3 --- /dev/null +++ b/src/gitpod/types/environments/automations/service_spec.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel +from .service_phase import ServicePhase +from ...shared.runs_on import RunsOn + +__all__ = ["ServiceSpec", "Commands"] + + +class Commands(BaseModel): + ready: Optional[str] = None + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. + """ + + start: Optional[str] = None + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: Optional[str] = None + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. + """ + + +class ServiceSpec(BaseModel): + commands: Optional[Commands] = None + """ + commands contains the commands to start, stop and check the readiness of the + service + """ + + desired_phase: Optional[ServicePhase] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the service should be in. + + Used to start or stop the service. + """ + + runs_on: Optional[RunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the service should run on.""" + + session: Optional[str] = None + """session should be changed to trigger a restart of the service. + + If a service exits it will not be restarted until the session is changed. + """ + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ diff --git a/src/gitpod/types/environments/automations/service_spec_param.py b/src/gitpod/types/environments/automations/service_spec_param.py new file mode 100644 index 00000000..469be0e2 --- /dev/null +++ b/src/gitpod/types/environments/automations/service_spec_param.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ...._utils import PropertyInfo +from .service_phase import ServicePhase +from ...shared_params.runs_on import RunsOn + +__all__ = ["ServiceSpecParam", "Commands"] + + +class Commands(TypedDict, total=False): + ready: str + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. + """ + + start: str + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: str + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. + """ + + +class ServiceSpecParam(TypedDict, total=False): + commands: Commands + """ + commands contains the commands to start, stop and check the readiness of the + service + """ + + desired_phase: Annotated[ServicePhase, PropertyInfo(alias="desiredPhase")] + """desired_phase is the phase the service should be in. + + Used to start or stop the service. + """ + + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] + """runs_on specifies the environment the service should run on.""" + + session: str + """session should be changed to trigger a restart of the service. + + If a service exits it will not be restarted until the session is changed. + """ + + spec_version: Annotated[str, PropertyInfo(alias="specVersion")] + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ diff --git a/src/gitpod/types/environments/automations/service_status.py b/src/gitpod/types/environments/automations/service_status.py new file mode 100644 index 00000000..cfda3ec2 --- /dev/null +++ b/src/gitpod/types/environments/automations/service_status.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel +from .service_phase import ServicePhase + +__all__ = ["ServiceStatus"] + + +class ServiceStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the service failed to operate. + + If this is non-empty the service has failed to operate and will likely + transition to a failed state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url contains the URL at which the service logs can be accessed.""" + + phase: Optional[ServicePhase] = None + """phase is the current phase of the service.""" + + session: Optional[str] = None + """session is the current session of the service.""" + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Service instances themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. + """ diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index d45d4ce5..80a22fbf 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -2,37 +2,15 @@ from __future__ import annotations -from typing import List, Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing import Iterable, Optional +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from .service_phase import ServicePhase +from ...shared_params.runs_on import RunsOn +from ...shared_params.automation_trigger import AutomationTrigger -__all__ = [ - "ServiceUpdateParams", - "Metadata", - "MetadataDescription", - "MetadataName", - "MetadataTriggeredBy", - "MetadataTriggeredByTriggeredBy", - "MetadataTriggeredByTriggeredByTrigger", - "MetadataTriggeredByTriggeredByTriggerManual", - "MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart", - "MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart", - "Spec", - "SpecCommands", - "SpecCommandsCommands", - "SpecCommandsCommandsReady", - "SpecCommandsCommandsStart", - "SpecCommandsCommandsStop", - "SpecRunsOn", - "SpecRunsOnRunsOn", - "SpecRunsOnRunsOnDocker", - "Status", - "StatusFailureMessage", - "StatusLogURL", - "StatusPhase", - "StatusSession", -] +__all__ = ["ServiceUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec", "SpecCommands", "Status"] class ServiceUpdateParams(TypedDict, total=False): @@ -55,104 +33,37 @@ class ServiceUpdateParams(TypedDict, total=False): """ -class MetadataDescription(TypedDict, total=False): - description: Required[str] - - -class MetadataName(TypedDict, total=False): - name: Required[str] - - -class MetadataTriggeredByTriggeredByTriggerManual(TypedDict, total=False): - manual: Required[bool] - - -class MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart(TypedDict, total=False): - post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] - - -class MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart(TypedDict, total=False): - post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] - - -MetadataTriggeredByTriggeredByTrigger: TypeAlias = Union[ - MetadataTriggeredByTriggeredByTriggerManual, - MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart, - MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart, -] - - -class MetadataTriggeredByTriggeredBy(TypedDict, total=False): - trigger: Iterable[MetadataTriggeredByTriggeredByTrigger] - - class MetadataTriggeredBy(TypedDict, total=False): - triggered_by: Required[Annotated[MetadataTriggeredByTriggeredBy, PropertyInfo(alias="triggeredBy")]] - + trigger: Iterable[AutomationTrigger] -Metadata: TypeAlias = Union[MetadataDescription, MetadataName, MetadataTriggeredBy] +class Metadata(TypedDict, total=False): + description: Optional[str] -class SpecCommandsCommandsReady(TypedDict, total=False): - ready: Required[str] + name: Optional[str] - -class SpecCommandsCommandsStart(TypedDict, total=False): - start: Required[str] - - -class SpecCommandsCommandsStop(TypedDict, total=False): - stop: Required[str] - - -SpecCommandsCommands: TypeAlias = Union[SpecCommandsCommandsReady, SpecCommandsCommandsStart, SpecCommandsCommandsStop] + triggered_by: Annotated[Optional[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] class SpecCommands(TypedDict, total=False): - commands: Required[SpecCommandsCommands] - - -class SpecRunsOnRunsOnDocker(TypedDict, total=False): - environment: List[str] - - image: str - - -class SpecRunsOnRunsOn(TypedDict, total=False): - docker: Required[SpecRunsOnRunsOnDocker] - - -class SpecRunsOn(TypedDict, total=False): - runs_on: Required[Annotated[SpecRunsOnRunsOn, PropertyInfo(alias="runsOn")]] - - -Spec: TypeAlias = Union[SpecCommands, SpecRunsOn] + ready: Optional[str] + start: Optional[str] -class StatusFailureMessage(TypedDict, total=False): - failure_message: Required[Annotated[str, PropertyInfo(alias="failureMessage")]] + stop: Optional[str] -class StatusLogURL(TypedDict, total=False): - log_url: Required[Annotated[str, PropertyInfo(alias="logUrl")]] +class Spec(TypedDict, total=False): + commands: Optional[SpecCommands] + runs_on: Annotated[Optional[RunsOn], PropertyInfo(alias="runsOn")] -class StatusPhase(TypedDict, total=False): - phase: Required[ - Literal[ - "SERVICE_PHASE_UNSPECIFIED", - "SERVICE_PHASE_STARTING", - "SERVICE_PHASE_RUNNING", - "SERVICE_PHASE_STOPPING", - "SERVICE_PHASE_STOPPED", - "SERVICE_PHASE_FAILED", - "SERVICE_PHASE_DELETED", - ] - ] +class Status(TypedDict, total=False): + failure_message: Annotated[Optional[str], PropertyInfo(alias="failureMessage")] -class StatusSession(TypedDict, total=False): - session: Required[str] + log_url: Annotated[Optional[str], PropertyInfo(alias="logUrl")] + phase: Optional[ServicePhase] -Status: TypeAlias = Union[StatusFailureMessage, StatusLogURL, StatusPhase, StatusSession] + session: Optional[str] diff --git a/src/gitpod/types/environments/automations/task.py b/src/gitpod/types/environments/automations/task.py new file mode 100644 index 00000000..01d91d11 --- /dev/null +++ b/src/gitpod/types/environments/automations/task.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .task_spec import TaskSpec +from ...._models import BaseModel +from .task_metadata import TaskMetadata + +__all__ = ["Task"] + + +class Task(BaseModel): + id: Optional[str] = None + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + """dependencies specifies the IDs of the automations this task depends on.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + metadata: Optional[TaskMetadata] = None + + spec: Optional[TaskSpec] = None diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index f7454900..331519ba 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -2,24 +2,14 @@ from __future__ import annotations -from typing import List, Union, Iterable -from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing import List +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from .task_spec_param import TaskSpecParam +from .task_metadata_param import TaskMetadataParam -__all__ = [ - "TaskCreateParams", - "Metadata", - "MetadataCreator", - "MetadataTriggeredBy", - "MetadataTriggeredByManual", - "MetadataTriggeredByPostDevcontainerStart", - "MetadataTriggeredByPostEnvironmentStart", - "Spec", - "SpecRunsOn", - "SpecRunsOnDocker", -] +__all__ = ["TaskCreateParams"] class TaskCreateParams(TypedDict, total=False): @@ -27,176 +17,6 @@ class TaskCreateParams(TypedDict, total=False): environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - metadata: Metadata + metadata: TaskMetadataParam - spec: Spec - - -class MetadataCreator(TypedDict, total=False): - id: str - """id is the UUID of the subject""" - - principal: Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - """Principal is the principal of the subject""" - - -class MetadataTriggeredByManual(TypedDict, total=False): - manual: Required[bool] - - -class MetadataTriggeredByPostDevcontainerStart(TypedDict, total=False): - post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] - - -class MetadataTriggeredByPostEnvironmentStart(TypedDict, total=False): - post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] - - -MetadataTriggeredBy: TypeAlias = Union[ - MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart -] - - -class Metadata(TypedDict, total=False): - created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: MetadataCreator - """creator describes the principal who created the task.""" - - description: str - """description is a user-facing description for the task. - - It can be used to provide context and documentation for the task. - """ - - name: str - """name is a user-facing name for the task. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the task. - """ - - reference: str - """ - reference is a user-facing identifier for the task which must be unique on the - environment. It is used to express dependencies between tasks, and to identify - the task in user interactions (e.g. the CLI). - """ - - triggered_by: Annotated[Iterable[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] - """triggered_by is a list of trigger that start the task.""" - - -class SpecRunsOnDocker(TypedDict, total=False): - environment: List[str] - - image: str - - -class SpecRunsOn(TypedDict, total=False): - docker: Required[SpecRunsOnDocker] - - -class Spec(TypedDict, total=False): - command: str - """command contains the command the task should execute""" - - runs_on: Annotated[SpecRunsOn, PropertyInfo(alias="runsOn")] - """runs_on specifies the environment the task should run on.""" + spec: TaskSpecParam diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index 22c1db51..511677b1 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -1,213 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional +from .task import Task from ...._models import BaseModel -__all__ = [ - "TaskCreateResponse", - "Task", - "TaskMetadata", - "TaskMetadataCreator", - "TaskMetadataTriggeredBy", - "TaskMetadataTriggeredByManual", - "TaskMetadataTriggeredByPostDevcontainerStart", - "TaskMetadataTriggeredByPostEnvironmentStart", - "TaskSpec", - "TaskSpecRunsOn", - "TaskSpecRunsOnDocker", -] - - -class TaskMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskMetadataTriggeredByManual(BaseModel): - manual: bool - - -class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): - post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - - -class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): - post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - - -TaskMetadataTriggeredBy: TypeAlias = Union[ - TaskMetadataTriggeredByManual, - TaskMetadataTriggeredByPostDevcontainerStart, - TaskMetadataTriggeredByPostEnvironmentStart, -] - - -class TaskMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskMetadataCreator] = None - """creator describes the principal who created the task.""" - - description: Optional[str] = None - """description is a user-facing description for the task. - - It can be used to provide context and documentation for the task. - """ - - name: Optional[str] = None - """name is a user-facing name for the task. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the task. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the task which must be unique on the - environment. It is used to express dependencies between tasks, and to identify - the task in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the task.""" - - -class TaskSpecRunsOnDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskSpecRunsOn(BaseModel): - docker: TaskSpecRunsOnDocker - - -class TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class Task(BaseModel): - id: Optional[str] = None - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - """dependencies specifies the IDs of the automations this task depends on.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[TaskMetadata] = None - - spec: Optional[TaskSpec] = None +__all__ = ["TaskCreateResponse"] class TaskCreateResponse(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_list_response.py b/src/gitpod/types/environments/automations/task_metadata.py similarity index 68% rename from src/gitpod/types/environments/automations/task_list_response.py rename to src/gitpod/types/environments/automations/task_metadata.py index cd4131ae..f99f98ee 100644 --- a/src/gitpod/types/environments/automations/task_list_response.py +++ b/src/gitpod/types/environments/automations/task_metadata.py @@ -1,62 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime -from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo from ...._models import BaseModel +from ...shared.subject import Subject +from ...shared.automation_trigger import AutomationTrigger -__all__ = [ - "TaskListResponse", - "Metadata", - "MetadataCreator", - "MetadataTriggeredBy", - "MetadataTriggeredByManual", - "MetadataTriggeredByPostDevcontainerStart", - "MetadataTriggeredByPostEnvironmentStart", - "Spec", - "SpecRunsOn", - "SpecRunsOnDocker", -] +__all__ = ["TaskMetadata"] -class MetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class MetadataTriggeredByManual(BaseModel): - manual: bool - - -class MetadataTriggeredByPostDevcontainerStart(BaseModel): - post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - - -class MetadataTriggeredByPostEnvironmentStart(BaseModel): - post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - - -MetadataTriggeredBy: TypeAlias = Union[ - MetadataTriggeredByManual, MetadataTriggeredByPostDevcontainerStart, MetadataTriggeredByPostEnvironmentStart -] - - -class Metadata(BaseModel): +class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local @@ -149,7 +105,7 @@ class Metadata(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[MetadataCreator] = None + creator: Optional[Subject] = None """creator describes the principal who created the task.""" description: Optional[str] = None @@ -172,36 +128,5 @@ class Metadata(BaseModel): the task in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[MetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the task.""" - - -class SpecRunsOnDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class SpecRunsOn(BaseModel): - docker: SpecRunsOnDocker - - -class Spec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[SpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class TaskListResponse(BaseModel): - id: Optional[str] = None - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - """dependencies specifies the IDs of the automations this task depends on.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[Metadata] = None - - spec: Optional[Spec] = None diff --git a/src/gitpod/types/environments/automations/task_metadata_param.py b/src/gitpod/types/environments/automations/task_metadata_param.py new file mode 100644 index 00000000..9331c97e --- /dev/null +++ b/src/gitpod/types/environments/automations/task_metadata_param.py @@ -0,0 +1,133 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from ...._utils import PropertyInfo +from ...shared_params.subject import Subject +from ...shared_params.automation_trigger import AutomationTrigger + +__all__ = ["TaskMetadataParam"] + + +class TaskMetadataParam(TypedDict, total=False): + created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Subject + """creator describes the principal who created the task.""" + + description: str + """description is a user-facing description for the task. + + It can be used to provide context and documentation for the task. + """ + + name: str + """name is a user-facing name for the task. + + Unlike the reference, this field is not unique, and not referenced by the + system. This is a short descriptive name for the task. + """ + + reference: str + """ + reference is a user-facing identifier for the task which must be unique on the + environment. It is used to express dependencies between tasks, and to identify + the task in user interactions (e.g. the CLI). + """ + + triggered_by: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggeredBy")] + """triggered_by is a list of trigger that start the task.""" diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index cd0c4d61..557cccee 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -1,213 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional +from .task import Task from ...._models import BaseModel -__all__ = [ - "TaskRetrieveResponse", - "Task", - "TaskMetadata", - "TaskMetadataCreator", - "TaskMetadataTriggeredBy", - "TaskMetadataTriggeredByManual", - "TaskMetadataTriggeredByPostDevcontainerStart", - "TaskMetadataTriggeredByPostEnvironmentStart", - "TaskSpec", - "TaskSpecRunsOn", - "TaskSpecRunsOnDocker", -] - - -class TaskMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskMetadataTriggeredByManual(BaseModel): - manual: bool - - -class TaskMetadataTriggeredByPostDevcontainerStart(BaseModel): - post_devcontainer_start: bool = FieldInfo(alias="postDevcontainerStart") - - -class TaskMetadataTriggeredByPostEnvironmentStart(BaseModel): - post_environment_start: bool = FieldInfo(alias="postEnvironmentStart") - - -TaskMetadataTriggeredBy: TypeAlias = Union[ - TaskMetadataTriggeredByManual, - TaskMetadataTriggeredByPostDevcontainerStart, - TaskMetadataTriggeredByPostEnvironmentStart, -] - - -class TaskMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskMetadataCreator] = None - """creator describes the principal who created the task.""" - - description: Optional[str] = None - """description is a user-facing description for the task. - - It can be used to provide context and documentation for the task. - """ - - name: Optional[str] = None - """name is a user-facing name for the task. - - Unlike the reference, this field is not unique, and not referenced by the - system. This is a short descriptive name for the task. - """ - - reference: Optional[str] = None - """ - reference is a user-facing identifier for the task which must be unique on the - environment. It is used to express dependencies between tasks, and to identify - the task in user interactions (e.g. the CLI). - """ - - triggered_by: Optional[List[TaskMetadataTriggeredBy]] = FieldInfo(alias="triggeredBy", default=None) - """triggered_by is a list of trigger that start the task.""" - - -class TaskSpecRunsOnDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskSpecRunsOn(BaseModel): - docker: TaskSpecRunsOnDocker - - -class TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class Task(BaseModel): - id: Optional[str] = None - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - """dependencies specifies the IDs of the automations this task depends on.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - - metadata: Optional[TaskMetadata] = None - - spec: Optional[TaskSpec] = None +__all__ = ["TaskRetrieveResponse"] class TaskRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_spec.py b/src/gitpod/types/environments/automations/task_spec.py new file mode 100644 index 00000000..3d1d0f13 --- /dev/null +++ b/src/gitpod/types/environments/automations/task_spec.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel +from ...shared.runs_on import RunsOn + +__all__ = ["TaskSpec"] + + +class TaskSpec(BaseModel): + command: Optional[str] = None + """command contains the command the task should execute""" + + runs_on: Optional[RunsOn] = FieldInfo(alias="runsOn", default=None) + """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/environments/automations/task_spec_param.py b/src/gitpod/types/environments/automations/task_spec_param.py new file mode 100644 index 00000000..bf0c6294 --- /dev/null +++ b/src/gitpod/types/environments/automations/task_spec_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ...._utils import PropertyInfo +from ...shared_params.runs_on import RunsOn + +__all__ = ["TaskSpecParam"] + + +class TaskSpecParam(TypedDict, total=False): + command: str + """command contains the command the task should execute""" + + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] + """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/environments/automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py index 9aee77c7..3b7caf23 100644 --- a/src/gitpod/types/environments/automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -1,492 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias +from typing import Optional from pydantic import Field as FieldInfo from ...._models import BaseModel +from ...shared.task_execution import TaskExecution -__all__ = [ - "TaskStartResponse", - "TaskExecution", - "TaskExecutionMetadata", - "TaskExecutionMetadataCreator", - "TaskExecutionSpec", - "TaskExecutionSpecPlan", - "TaskExecutionSpecPlanStep", - "TaskExecutionSpecPlanStepUnionMember0", - "TaskExecutionSpecPlanStepUnionMember1", - "TaskExecutionSpecPlanStepUnionMember1Task", - "TaskExecutionSpecPlanStepUnionMember1TaskSpec", - "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", - "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", - "TaskExecutionStatus", - "TaskExecutionStatusStep", -] - - -class TaskExecutionMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskExecutionMetadata(BaseModel): - completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskExecutionMetadataCreator] = None - """creator describes the principal who created/started the task run.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - """environment_id is the ID of the environment in which the task run is executed.""" - - started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) - """started_by describes the trigger that started the task execution.""" - - task_id: Optional[str] = FieldInfo(alias="taskId", default=None) - """task_id is the ID of the main task being executed.""" - - -class TaskExecutionSpecPlanStepUnionMember0(BaseModel): - service_id: str = FieldInfo(alias="serviceId") - - id: Optional[str] = None - """ID is the ID of the execution step""" - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - - label: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker - - -class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class TaskExecutionSpecPlanStepUnionMember1Task(BaseModel): - id: Optional[str] = None - - spec: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpec] = None - - -class TaskExecutionSpecPlanStepUnionMember1(BaseModel): - task: TaskExecutionSpecPlanStepUnionMember1Task - - id: Optional[str] = None - """ID is the ID of the execution step""" - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - - label: Optional[str] = None - - -TaskExecutionSpecPlanStep: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 -] - - -class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[TaskExecutionSpecPlanStep]] = None - - -class TaskExecutionSpec(BaseModel): - desired_phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the task execution should be in. - - Used to stop a running task execution early. - """ - - plan: Optional[List[TaskExecutionSpecPlan]] = None - """plan is a list of groups of steps. - - The steps in a group are executed concurrently, while the groups are executed - sequentially. The order of the groups is the order in which they are executed. - """ - - -class TaskExecutionStatusStep(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. - - If this is non-empty the step has failed to operate and will likely transition - to a failed state. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """phase is the current phase of the execution step""" - - -class TaskExecutionStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the task execution failed to operate. - - If this is non-empty the task execution has failed to operate and will likely - transition to a failed state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url is the URL to the logs of the task's steps. - - If this is empty, the task either has no logs or has not yet started. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """the phase of a task execution represents the aggregated phase of all steps.""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Task executions themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - steps: Optional[List[TaskExecutionStatusStep]] = None - """steps provides the status for each individual step of the task execution. - - If a step is missing it has not yet started. - """ - - -class TaskExecution(BaseModel): - id: Optional[str] = None - - metadata: Optional[TaskExecutionMetadata] = None - - spec: Optional[TaskExecutionSpec] = None - - status: Optional[TaskExecutionStatus] = None +__all__ = ["TaskStartResponse"] class TaskStartResponse(BaseModel): diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index 8ac5aae1..4b0d59a9 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -2,28 +2,14 @@ from __future__ import annotations -from typing import List, Union, Iterable -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing import List, Iterable, Optional +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from ...shared_params.runs_on import RunsOn +from ...shared_params.automation_trigger import AutomationTrigger -__all__ = [ - "TaskUpdateParams", - "Metadata", - "MetadataDescription", - "MetadataName", - "MetadataTriggeredBy", - "MetadataTriggeredByTriggeredBy", - "MetadataTriggeredByTriggeredByTrigger", - "MetadataTriggeredByTriggeredByTriggerManual", - "MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart", - "MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart", - "Spec", - "SpecCommand", - "SpecRunsOn", - "SpecRunsOnRunsOn", - "SpecRunsOnRunsOnDocker", -] +__all__ = ["TaskUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec"] class TaskUpdateParams(TypedDict, total=False): @@ -37,60 +23,19 @@ class TaskUpdateParams(TypedDict, total=False): spec: Spec -class MetadataDescription(TypedDict, total=False): - description: Required[str] - - -class MetadataName(TypedDict, total=False): - name: Required[str] - - -class MetadataTriggeredByTriggeredByTriggerManual(TypedDict, total=False): - manual: Required[bool] - - -class MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart(TypedDict, total=False): - post_devcontainer_start: Required[Annotated[bool, PropertyInfo(alias="postDevcontainerStart")]] - - -class MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart(TypedDict, total=False): - post_environment_start: Required[Annotated[bool, PropertyInfo(alias="postEnvironmentStart")]] - - -MetadataTriggeredByTriggeredByTrigger: TypeAlias = Union[ - MetadataTriggeredByTriggeredByTriggerManual, - MetadataTriggeredByTriggeredByTriggerPostDevcontainerStart, - MetadataTriggeredByTriggeredByTriggerPostEnvironmentStart, -] - - -class MetadataTriggeredByTriggeredBy(TypedDict, total=False): - trigger: Iterable[MetadataTriggeredByTriggeredByTrigger] - - class MetadataTriggeredBy(TypedDict, total=False): - triggered_by: Required[Annotated[MetadataTriggeredByTriggeredBy, PropertyInfo(alias="triggeredBy")]] - - -Metadata: TypeAlias = Union[MetadataDescription, MetadataName, MetadataTriggeredBy] - - -class SpecCommand(TypedDict, total=False): - command: Required[str] - - -class SpecRunsOnRunsOnDocker(TypedDict, total=False): - environment: List[str] + trigger: Iterable[AutomationTrigger] - image: str +class Metadata(TypedDict, total=False): + description: Optional[str] -class SpecRunsOnRunsOn(TypedDict, total=False): - docker: Required[SpecRunsOnRunsOnDocker] + name: Optional[str] + triggered_by: Annotated[Optional[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] -class SpecRunsOn(TypedDict, total=False): - runs_on: Required[Annotated[SpecRunsOnRunsOn, PropertyInfo(alias="runsOn")]] +class Spec(TypedDict, total=False): + command: Optional[str] -Spec: TypeAlias = Union[SpecCommand, SpecRunsOn] + runs_on: Annotated[Optional[RunsOn], PropertyInfo(alias="runsOn")] diff --git a/src/gitpod/types/environments/automations/tasks/__init__.py b/src/gitpod/types/environments/automations/tasks/__init__.py index fd373323..f6dd9ac1 100644 --- a/src/gitpod/types/environments/automations/tasks/__init__.py +++ b/src/gitpod/types/environments/automations/tasks/__init__.py @@ -4,6 +4,5 @@ from .execution_list_params import ExecutionListParams as ExecutionListParams from .execution_stop_params import ExecutionStopParams as ExecutionStopParams -from .execution_list_response import ExecutionListResponse as ExecutionListResponse from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .execution_retrieve_response import ExecutionRetrieveResponse as ExecutionRetrieveResponse diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_params.py b/src/gitpod/types/environments/automations/tasks/execution_list_params.py index 37ad2559..0441fb52 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_list_params.py +++ b/src/gitpod/types/environments/automations/tasks/execution_list_params.py @@ -3,9 +3,10 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ....._utils import PropertyInfo +from ....shared.task_execution_phase import TaskExecutionPhase __all__ = ["ExecutionListParams", "Filter", "Pagination"] @@ -26,16 +27,7 @@ class Filter(TypedDict, total=False): environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] """environment_ids filters the response to only task runs of these environments""" - phases: List[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] + phases: List[TaskExecutionPhase] """phases filters the response to only task runs in these phases""" task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_response.py b/src/gitpod/types/environments/automations/tasks/execution_list_response.py deleted file mode 100644 index cc11074d..00000000 --- a/src/gitpod/types/environments/automations/tasks/execution_list_response.py +++ /dev/null @@ -1,486 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo - -from ....._models import BaseModel - -__all__ = [ - "ExecutionListResponse", - "Metadata", - "MetadataCreator", - "Spec", - "SpecPlan", - "SpecPlanStep", - "SpecPlanStepUnionMember0", - "SpecPlanStepUnionMember1", - "SpecPlanStepUnionMember1Task", - "SpecPlanStepUnionMember1TaskSpec", - "SpecPlanStepUnionMember1TaskSpecRunsOn", - "SpecPlanStepUnionMember1TaskSpecRunsOnDocker", - "Status", - "StatusStep", -] - - -class MetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class Metadata(BaseModel): - completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[MetadataCreator] = None - """creator describes the principal who created/started the task run.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - """environment_id is the ID of the environment in which the task run is executed.""" - - started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) - """started_by describes the trigger that started the task execution.""" - - task_id: Optional[str] = FieldInfo(alias="taskId", default=None) - """task_id is the ID of the main task being executed.""" - - -class SpecPlanStepUnionMember0(BaseModel): - service_id: str = FieldInfo(alias="serviceId") - - id: Optional[str] = None - """ID is the ID of the execution step""" - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - - label: Optional[str] = None - - -class SpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class SpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): - docker: SpecPlanStepUnionMember1TaskSpecRunsOnDocker - - -class SpecPlanStepUnionMember1TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[SpecPlanStepUnionMember1TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class SpecPlanStepUnionMember1Task(BaseModel): - id: Optional[str] = None - - spec: Optional[SpecPlanStepUnionMember1TaskSpec] = None - - -class SpecPlanStepUnionMember1(BaseModel): - task: SpecPlanStepUnionMember1Task - - id: Optional[str] = None - """ID is the ID of the execution step""" - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - - label: Optional[str] = None - - -SpecPlanStep: TypeAlias = Union[SpecPlanStepUnionMember0, SpecPlanStepUnionMember1] - - -class SpecPlan(BaseModel): - steps: Optional[List[SpecPlanStep]] = None - - -class Spec(BaseModel): - desired_phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the task execution should be in. - - Used to stop a running task execution early. - """ - - plan: Optional[List[SpecPlan]] = None - """plan is a list of groups of steps. - - The steps in a group are executed concurrently, while the groups are executed - sequentially. The order of the groups is the order in which they are executed. - """ - - -class StatusStep(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. - - If this is non-empty the step has failed to operate and will likely transition - to a failed state. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """phase is the current phase of the execution step""" - - -class Status(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the task execution failed to operate. - - If this is non-empty the task execution has failed to operate and will likely - transition to a failed state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url is the URL to the logs of the task's steps. - - If this is empty, the task either has no logs or has not yet started. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """the phase of a task execution represents the aggregated phase of all steps.""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Task executions themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - steps: Optional[List[StatusStep]] = None - """steps provides the status for each individual step of the task execution. - - If a step is missing it has not yet started. - """ - - -class ExecutionListResponse(BaseModel): - id: Optional[str] = None - - metadata: Optional[Metadata] = None - - spec: Optional[Spec] = None - - status: Optional[Status] = None diff --git a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py index 99ff0295..40f3dc48 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py @@ -1,492 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias +from typing import Optional from pydantic import Field as FieldInfo from ....._models import BaseModel +from ....shared.task_execution import TaskExecution -__all__ = [ - "ExecutionRetrieveResponse", - "TaskExecution", - "TaskExecutionMetadata", - "TaskExecutionMetadataCreator", - "TaskExecutionSpec", - "TaskExecutionSpecPlan", - "TaskExecutionSpecPlanStep", - "TaskExecutionSpecPlanStepUnionMember0", - "TaskExecutionSpecPlanStepUnionMember1", - "TaskExecutionSpecPlanStepUnionMember1Task", - "TaskExecutionSpecPlanStepUnionMember1TaskSpec", - "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn", - "TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker", - "TaskExecutionStatus", - "TaskExecutionStatusStep", -] - - -class TaskExecutionMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class TaskExecutionMetadata(BaseModel): - completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[TaskExecutionMetadataCreator] = None - """creator describes the principal who created/started the task run.""" - - environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - """environment_id is the ID of the environment in which the task run is executed.""" - - started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) - """started_by describes the trigger that started the task execution.""" - - task_id: Optional[str] = FieldInfo(alias="taskId", default=None) - """task_id is the ID of the main task being executed.""" - - -class TaskExecutionSpecPlanStepUnionMember0(BaseModel): - service_id: str = FieldInfo(alias="serviceId") - - id: Optional[str] = None - """ID is the ID of the execution step""" - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - - label: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker(BaseModel): - environment: Optional[List[str]] = None - - image: Optional[str] = None - - -class TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn(BaseModel): - docker: TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOnDocker - - -class TaskExecutionSpecPlanStepUnionMember1TaskSpec(BaseModel): - command: Optional[str] = None - """command contains the command the task should execute""" - - runs_on: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpecRunsOn] = FieldInfo(alias="runsOn", default=None) - """runs_on specifies the environment the task should run on.""" - - -class TaskExecutionSpecPlanStepUnionMember1Task(BaseModel): - id: Optional[str] = None - - spec: Optional[TaskExecutionSpecPlanStepUnionMember1TaskSpec] = None - - -class TaskExecutionSpecPlanStepUnionMember1(BaseModel): - task: TaskExecutionSpecPlanStepUnionMember1Task - - id: Optional[str] = None - """ID is the ID of the execution step""" - - depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) - - label: Optional[str] = None - - -TaskExecutionSpecPlanStep: TypeAlias = Union[ - TaskExecutionSpecPlanStepUnionMember0, TaskExecutionSpecPlanStepUnionMember1 -] - - -class TaskExecutionSpecPlan(BaseModel): - steps: Optional[List[TaskExecutionSpecPlanStep]] = None - - -class TaskExecutionSpec(BaseModel): - desired_phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """desired_phase is the phase the task execution should be in. - - Used to stop a running task execution early. - """ - - plan: Optional[List[TaskExecutionSpecPlan]] = None - """plan is a list of groups of steps. - - The steps in a group are executed concurrently, while the groups are executed - sequentially. The order of the groups is the order in which they are executed. - """ - - -class TaskExecutionStatusStep(BaseModel): - id: Optional[str] = None - """ID is the ID of the execution step""" - - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the step failed to operate. - - If this is non-empty the step has failed to operate and will likely transition - to a failed state. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """phase is the current phase of the execution step""" - - -class TaskExecutionStatus(BaseModel): - failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) - """failure_message summarises why the task execution failed to operate. - - If this is non-empty the task execution has failed to operate and will likely - transition to a failed state. - """ - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - """log_url is the URL to the logs of the task's steps. - - If this is empty, the task either has no logs or has not yet started. - """ - - phase: Optional[ - Literal[ - "TASK_EXECUTION_PHASE_UNSPECIFIED", - "TASK_EXECUTION_PHASE_PENDING", - "TASK_EXECUTION_PHASE_RUNNING", - "TASK_EXECUTION_PHASE_SUCCEEDED", - "TASK_EXECUTION_PHASE_FAILED", - "TASK_EXECUTION_PHASE_STOPPED", - ] - ] = None - """the phase of a task execution represents the aggregated phase of all steps.""" - - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) - """version of the status update. - - Task executions themselves are unversioned, but their status has different - versions. The value of this field has no semantic meaning (e.g. don't interpret - it as as a timestamp), but it can be used to impose a partial order. If - a.status_version < b.status_version then a was the status before b. - """ - - steps: Optional[List[TaskExecutionStatusStep]] = None - """steps provides the status for each individual step of the task execution. - - If a step is missing it has not yet started. - """ - - -class TaskExecution(BaseModel): - id: Optional[str] = None - - metadata: Optional[TaskExecutionMetadata] = None - - spec: Optional[TaskExecutionSpec] = None - - status: Optional[TaskExecutionStatus] = None +__all__ = ["ExecutionRetrieveResponse"] class ExecutionRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/environments/automations_file_param.py b/src/gitpod/types/environments/automations_file_param.py new file mode 100644 index 00000000..e2c0a7e3 --- /dev/null +++ b/src/gitpod/types/environments/automations_file_param.py @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List +from typing_extensions import Literal, Annotated, TypedDict + +from ..._utils import PropertyInfo +from ..shared_params.runs_on import RunsOn + +__all__ = ["AutomationsFileParam", "Services", "ServicesCommands", "Tasks"] + + +class ServicesCommands(TypedDict, total=False): + ready: str + """ + ready is an optional command that is run repeatedly until it exits with a zero + exit code. If set, the service will first go into a Starting phase, and then + into a Running phase once the ready command exits with a zero exit code. + """ + + start: str + """ + start is the command to start and run the service. If start exits, the service + will transition to the following phase: + + - Stopped: if the exit code is 0 + - Failed: if the exit code is not 0 If the stop command is not set, the start + command will receive a SIGTERM signal when the service is requested to stop. + If it does not exit within 2 minutes, it will receive a SIGKILL signal. + """ + + stop: str + """ + stop is an optional command that runs when the service is requested to stop. If + set, instead of sending a SIGTERM signal to the start command, the stop command + will be run. Once the stop command exits, the start command will receive a + SIGKILL signal. If the stop command exits with a non-zero exit code, the service + will transition to the Failed phase. If the stop command does not exit within 2 + minutes, a SIGKILL signal will be sent to both the start and stop commands. + """ + + +class Services(TypedDict, total=False): + commands: ServicesCommands + + description: str + + name: str + + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] + + triggered_by: Annotated[ + List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart"]], PropertyInfo(alias="triggeredBy") + ] + + +class Tasks(TypedDict, total=False): + command: str + + depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] + + description: str + + name: str + + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] + + triggered_by: Annotated[ + List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart"]], PropertyInfo(alias="triggeredBy") + ] + + +class AutomationsFileParam(TypedDict, total=False): + services: Dict[str, Services] + + tasks: Dict[str, Tasks] diff --git a/src/gitpod/types/environments/class_list_params.py b/src/gitpod/types/environments/class_list_params.py index ca0eaf4c..046d982c 100644 --- a/src/gitpod/types/environments/class_list_params.py +++ b/src/gitpod/types/environments/class_list_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing import List, Optional +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo @@ -21,12 +22,15 @@ class ClassListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - enabled: Required[bool] + enabled: Optional[bool] """ enabled filters the response to only enabled or disabled environment classes. If not set, all environment classes are returned. """ + runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] + """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/event_list_params.py b/src/gitpod/types/event_list_params.py index 7339620d..f444df68 100644 --- a/src/gitpod/types/event_list_params.py +++ b/src/gitpod/types/event_list_params.py @@ -3,9 +3,11 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .resource_type import ResourceType +from .shared.principal import Principal __all__ = ["EventListParams", "Filter", "Pagination"] @@ -24,47 +26,11 @@ class EventListParams(TypedDict, total=False): class Filter(TypedDict, total=False): actor_ids: Annotated[List[str], PropertyInfo(alias="actorIds")] - actor_principals: Annotated[ - List[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ], - PropertyInfo(alias="actorPrincipals"), - ] + actor_principals: Annotated[List[Principal], PropertyInfo(alias="actorPrincipals")] subject_ids: Annotated[List[str], PropertyInfo(alias="subjectIds")] - subject_types: Annotated[ - List[ - Literal[ - "RESOURCE_TYPE_UNSPECIFIED", - "RESOURCE_TYPE_ENVIRONMENT", - "RESOURCE_TYPE_RUNNER", - "RESOURCE_TYPE_PROJECT", - "RESOURCE_TYPE_TASK", - "RESOURCE_TYPE_TASK_EXECUTION", - "RESOURCE_TYPE_SERVICE", - "RESOURCE_TYPE_ORGANIZATION", - "RESOURCE_TYPE_USER", - "RESOURCE_TYPE_ENVIRONMENT_CLASS", - "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION", - "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN", - "RESOURCE_TYPE_GROUP", - "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN", - "RESOURCE_TYPE_USER_PREFERENCE", - "RESOURCE_TYPE_SERVICE_ACCOUNT", - "RESOURCE_TYPE_SECRET", - "RESOURCE_TYPE_SSO_CONFIG", - ] - ], - PropertyInfo(alias="subjectTypes"), - ] + subject_types: Annotated[List[ResourceType], PropertyInfo(alias="subjectTypes")] class Pagination(TypedDict, total=False): diff --git a/src/gitpod/types/event_list_response.py b/src/gitpod/types/event_list_response.py index b49844ca..ce8fb8b2 100644 --- a/src/gitpod/types/event_list_response.py +++ b/src/gitpod/types/event_list_response.py @@ -2,11 +2,12 @@ from typing import Optional from datetime import datetime -from typing_extensions import Literal from pydantic import Field as FieldInfo from .._models import BaseModel +from .resource_type import ResourceType +from .shared.principal import Principal __all__ = ["EventListResponse"] @@ -18,16 +19,7 @@ class EventListResponse(BaseModel): actor_id: Optional[str] = FieldInfo(alias="actorId", default=None) - actor_principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = FieldInfo(alias="actorPrincipal", default=None) + actor_principal: Optional[Principal] = FieldInfo(alias="actorPrincipal", default=None) created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ @@ -123,25 +115,4 @@ class EventListResponse(BaseModel): subject_id: Optional[str] = FieldInfo(alias="subjectId", default=None) - subject_type: Optional[ - Literal[ - "RESOURCE_TYPE_UNSPECIFIED", - "RESOURCE_TYPE_ENVIRONMENT", - "RESOURCE_TYPE_RUNNER", - "RESOURCE_TYPE_PROJECT", - "RESOURCE_TYPE_TASK", - "RESOURCE_TYPE_TASK_EXECUTION", - "RESOURCE_TYPE_SERVICE", - "RESOURCE_TYPE_ORGANIZATION", - "RESOURCE_TYPE_USER", - "RESOURCE_TYPE_ENVIRONMENT_CLASS", - "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION", - "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN", - "RESOURCE_TYPE_GROUP", - "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN", - "RESOURCE_TYPE_USER_PREFERENCE", - "RESOURCE_TYPE_SERVICE_ACCOUNT", - "RESOURCE_TYPE_SECRET", - "RESOURCE_TYPE_SSO_CONFIG", - ] - ] = FieldInfo(alias="subjectType", default=None) + subject_type: Optional[ResourceType] = FieldInfo(alias="subjectType", default=None) diff --git a/src/gitpod/types/event_watch_params.py b/src/gitpod/types/event_watch_params.py index 77d30929..0465a094 100644 --- a/src/gitpod/types/event_watch_params.py +++ b/src/gitpod/types/event_watch_params.py @@ -2,40 +2,23 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = [ - "EventWatchParams", - "EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment", - "OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued", -] +__all__ = ["EventWatchParams"] -class EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment( - TypedDict, total=False -): - environment_id: Required[Annotated[str, PropertyInfo(alias="environmentId")]] +class EventWatchParams(TypedDict, total=False): + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """ Environment scope produces events for the environment itself, all tasks, task executions, and services associated with that environment. """ - -class OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued( - TypedDict, total=False -): - organization: Required[bool] + organization: bool """ Organization scope produces events for all projects, runners and environments the caller can see within their organization. No task, task execution or service events are produed. """ - - -EventWatchParams: TypeAlias = Union[ - EnvironmentScopeProducesEventsForTheEnvironmentItselfAllTasksTaskExecutionsAndServicesAssociatedWithThatEnvironment, - OrganizationScopeProducesEventsForAllProjectsRunnersAndEnvironmentsTheCallerCanSeeWithinTheirOrganizationNoTaskTaskExecutionOrServiceEventsAreProdued, -] diff --git a/src/gitpod/types/event_watch_response.py b/src/gitpod/types/event_watch_response.py index ec289a8d..9780ee13 100644 --- a/src/gitpod/types/event_watch_response.py +++ b/src/gitpod/types/event_watch_response.py @@ -1,47 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal from pydantic import Field as FieldInfo from .._models import BaseModel +from .resource_type import ResourceType +from .resource_operation import ResourceOperation __all__ = ["EventWatchResponse"] class EventWatchResponse(BaseModel): - operation: Optional[ - Literal[ - "RESOURCE_OPERATION_UNSPECIFIED", - "RESOURCE_OPERATION_CREATE", - "RESOURCE_OPERATION_UPDATE", - "RESOURCE_OPERATION_DELETE", - "RESOURCE_OPERATION_UPDATE_STATUS", - ] - ] = None + operation: Optional[ResourceOperation] = None resource_id: Optional[str] = FieldInfo(alias="resourceId", default=None) - resource_type: Optional[ - Literal[ - "RESOURCE_TYPE_UNSPECIFIED", - "RESOURCE_TYPE_ENVIRONMENT", - "RESOURCE_TYPE_RUNNER", - "RESOURCE_TYPE_PROJECT", - "RESOURCE_TYPE_TASK", - "RESOURCE_TYPE_TASK_EXECUTION", - "RESOURCE_TYPE_SERVICE", - "RESOURCE_TYPE_ORGANIZATION", - "RESOURCE_TYPE_USER", - "RESOURCE_TYPE_ENVIRONMENT_CLASS", - "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION", - "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN", - "RESOURCE_TYPE_GROUP", - "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN", - "RESOURCE_TYPE_USER_PREFERENCE", - "RESOURCE_TYPE_SERVICE_ACCOUNT", - "RESOURCE_TYPE_SECRET", - "RESOURCE_TYPE_SSO_CONFIG", - ] - ] = FieldInfo(alias="resourceType", default=None) + resource_type: Optional[ResourceType] = FieldInfo(alias="resourceType", default=None) diff --git a/src/gitpod/types/group_list_response.py b/src/gitpod/types/group.py similarity index 99% rename from src/gitpod/types/group_list_response.py rename to src/gitpod/types/group.py index 3a44f28a..a98b80b7 100644 --- a/src/gitpod/types/group_list_response.py +++ b/src/gitpod/types/group.py @@ -7,10 +7,10 @@ from .._models import BaseModel -__all__ = ["GroupListResponse"] +__all__ = ["Group"] -class GroupListResponse(BaseModel): +class Group(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) diff --git a/src/gitpod/types/identity_get_authenticated_identity_response.py b/src/gitpod/types/identity_get_authenticated_identity_response.py index fb9635ba..f04ad098 100644 --- a/src/gitpod/types/identity_get_authenticated_identity_response.py +++ b/src/gitpod/types/identity_get_authenticated_identity_response.py @@ -1,30 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal from pydantic import Field as FieldInfo from .._models import BaseModel +from .shared.subject import Subject -__all__ = ["IdentityGetAuthenticatedIdentityResponse", "Subject"] - - -class Subject(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" +__all__ = ["IdentityGetAuthenticatedIdentityResponse"] class IdentityGetAuthenticatedIdentityResponse(BaseModel): diff --git a/src/gitpod/types/invite_domains.py b/src/gitpod/types/invite_domains.py new file mode 100644 index 00000000..32a0c7f0 --- /dev/null +++ b/src/gitpod/types/invite_domains.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = ["InviteDomains"] + + +class InviteDomains(BaseModel): + domains: Optional[List[str]] = None + """domains is the list of domains that are allowed to join the organization""" diff --git a/src/gitpod/types/invite_domains_param.py b/src/gitpod/types/invite_domains_param.py new file mode 100644 index 00000000..d38601a1 --- /dev/null +++ b/src/gitpod/types/invite_domains_param.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import TypedDict + +__all__ = ["InviteDomainsParam"] + + +class InviteDomainsParam(TypedDict, total=False): + domains: List[str] + """domains is the list of domains that are allowed to join the organization""" diff --git a/src/gitpod/types/joinable_organization.py b/src/gitpod/types/joinable_organization.py new file mode 100644 index 00000000..f2fa9574 --- /dev/null +++ b/src/gitpod/types/joinable_organization.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["JoinableOrganization"] + + +class JoinableOrganization(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the id of the organization the user can join""" + + organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + """ + organization_member_count is the member count of the organization the user can + join + """ + + organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) + """organization_name is the name of the organization the user can join""" diff --git a/src/gitpod/types/account_list_login_providers_response.py b/src/gitpod/types/login_provider.py similarity index 82% rename from src/gitpod/types/account_list_login_providers_response.py rename to src/gitpod/types/login_provider.py index 825d9872..1a3b194c 100644 --- a/src/gitpod/types/account_list_login_providers_response.py +++ b/src/gitpod/types/login_provider.py @@ -6,10 +6,10 @@ from .._models import BaseModel -__all__ = ["AccountListLoginProvidersResponse"] +__all__ = ["LoginProvider"] -class AccountListLoginProvidersResponse(BaseModel): +class LoginProvider(BaseModel): login_url: Optional[str] = FieldInfo(alias="loginUrl", default=None) """login_url is the URL to redirect the browser agent to for login""" diff --git a/src/gitpod/types/organization_list_response.py b/src/gitpod/types/organization.py similarity index 96% rename from src/gitpod/types/organization_list_response.py rename to src/gitpod/types/organization.py index 1bb91db6..4fd832bd 100644 --- a/src/gitpod/types/organization_list_response.py +++ b/src/gitpod/types/organization.py @@ -1,21 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from pydantic import Field as FieldInfo from .._models import BaseModel +from .invite_domains import InviteDomains -__all__ = ["OrganizationListResponse", "InviteDomains"] +__all__ = ["Organization"] -class InviteDomains(BaseModel): - domains: Optional[List[str]] = None - """domains is the list of domains that are allowed to join the organization""" - - -class OrganizationListResponse(BaseModel): +class Organization(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) diff --git a/src/gitpod/types/organization_create_response.py b/src/gitpod/types/organization_create_response.py index c4ff11e4..a716cae1 100644 --- a/src/gitpod/types/organization_create_response.py +++ b/src/gitpod/types/organization_create_response.py @@ -1,328 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo +from typing import Optional from .._models import BaseModel +from .organization import Organization +from .organization_member import OrganizationMember -__all__ = ["OrganizationCreateResponse", "Member", "Organization", "OrganizationInviteDomains"] - - -class Member(BaseModel): - avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) - - email: Optional[str] = None - - full_name: Optional[str] = FieldInfo(alias="fullName", default=None) - - login_provider: Optional[str] = FieldInfo(alias="loginProvider", default=None) - """login_provider is the login provider the user uses to sign in""" - - member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - role: Optional[Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"]] = ( - None - ) - - status: Optional[ - Literal["USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT"] - ] = None - - user_id: Optional[str] = FieldInfo(alias="userId", default=None) - - -class OrganizationInviteDomains(BaseModel): - domains: Optional[List[str]] = None - """domains is the list of domains that are allowed to join the organization""" - - -class Organization(BaseModel): - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - invite_domains: Optional[OrganizationInviteDomains] = FieldInfo(alias="inviteDomains", default=None) - - name: Optional[str] = None - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ +__all__ = ["OrganizationCreateResponse"] class OrganizationCreateResponse(BaseModel): - member: Optional[Member] = None + member: Optional[OrganizationMember] = None """member is the member that joined the org on creation. Only set if specified "join_organization" is "true" in the request. diff --git a/src/gitpod/types/organization_join_params.py b/src/gitpod/types/organization_join_params.py index f70703f5..25f8223b 100644 --- a/src/gitpod/types/organization_join_params.py +++ b/src/gitpod/types/organization_join_params.py @@ -2,29 +2,16 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = [ - "OrganizationJoinParams", - "InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization", - "OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin", -] +__all__ = ["OrganizationJoinParams"] -class InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization(TypedDict, total=False): - invite_id: Required[Annotated[str, PropertyInfo(alias="inviteId")]] +class OrganizationJoinParams(TypedDict, total=False): + invite_id: Annotated[str, PropertyInfo(alias="inviteId")] """invite_id is the unique identifier of the invite to join the organization.""" - -class OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin(TypedDict, total=False): - organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] """organization_id is the unique identifier of the Organization to join.""" - - -OrganizationJoinParams: TypeAlias = Union[ - InviteIDIsTheUniqueIdentifierOfTheInviteToJoinTheOrganization, - OrganizationIDIsTheUniqueIdentifierOfTheOrganizationToJoin, -] diff --git a/src/gitpod/types/organization_join_response.py b/src/gitpod/types/organization_join_response.py index da8cff5d..880a93de 100644 --- a/src/gitpod/types/organization_join_response.py +++ b/src/gitpod/types/organization_join_response.py @@ -1,129 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo from .._models import BaseModel +from .organization_member import OrganizationMember -__all__ = ["OrganizationJoinResponse", "Member"] - - -class Member(BaseModel): - avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) - - email: Optional[str] = None - - full_name: Optional[str] = FieldInfo(alias="fullName", default=None) - - login_provider: Optional[str] = FieldInfo(alias="loginProvider", default=None) - """login_provider is the login provider the user uses to sign in""" - - member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - role: Optional[Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"]] = ( - None - ) - - status: Optional[ - Literal["USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT"] - ] = None - - user_id: Optional[str] = FieldInfo(alias="userId", default=None) +__all__ = ["OrganizationJoinResponse"] class OrganizationJoinResponse(BaseModel): - member: Optional[Member] = None + member: Optional[OrganizationMember] = None """member is the member that was created by joining the organization.""" diff --git a/src/gitpod/types/organization_list_params.py b/src/gitpod/types/organization_list_params.py index 34b6434c..edecdc21 100644 --- a/src/gitpod/types/organization_list_params.py +++ b/src/gitpod/types/organization_list_params.py @@ -2,8 +2,9 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict +from .scope import Scope from .._utils import PropertyInfo __all__ = ["OrganizationListParams", "Pagination"] @@ -17,7 +18,7 @@ class OrganizationListParams(TypedDict, total=False): pagination: Pagination """pagination contains the pagination options for listing organizations""" - scope: Literal["SCOPE_UNSPECIFIED", "SCOPE_MEMBER", "SCOPE_ALL"] + scope: Scope """scope is the scope of the organizations to list""" diff --git a/src/gitpod/types/organization_list_members_response.py b/src/gitpod/types/organization_member.py similarity index 91% rename from src/gitpod/types/organization_list_members_response.py rename to src/gitpod/types/organization_member.py index f95c22a0..b1a0109b 100644 --- a/src/gitpod/types/organization_list_members_response.py +++ b/src/gitpod/types/organization_member.py @@ -2,16 +2,17 @@ from typing import Optional from datetime import datetime -from typing_extensions import Literal from pydantic import Field as FieldInfo from .._models import BaseModel +from .shared.user_status import UserStatus +from .shared.organization_role import OrganizationRole -__all__ = ["OrganizationListMembersResponse"] +__all__ = ["OrganizationMember"] -class OrganizationListMembersResponse(BaseModel): +class OrganizationMember(BaseModel): avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) email: Optional[str] = None @@ -113,12 +114,8 @@ class OrganizationListMembersResponse(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - role: Optional[Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"]] = ( - None - ) + role: Optional[OrganizationRole] = None - status: Optional[ - Literal["USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT"] - ] = None + status: Optional[UserStatus] = None user_id: Optional[str] = FieldInfo(alias="userId", default=None) diff --git a/src/gitpod/types/organization_retrieve_response.py b/src/gitpod/types/organization_retrieve_response.py index b6457360..4cb085e4 100644 --- a/src/gitpod/types/organization_retrieve_response.py +++ b/src/gitpod/types/organization_retrieve_response.py @@ -1,210 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime - -from pydantic import Field as FieldInfo +from typing import Optional from .._models import BaseModel +from .organization import Organization -__all__ = ["OrganizationRetrieveResponse", "Organization", "OrganizationInviteDomains"] - - -class OrganizationInviteDomains(BaseModel): - domains: Optional[List[str]] = None - """domains is the list of domains that are allowed to join the organization""" - - -class Organization(BaseModel): - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - invite_domains: Optional[OrganizationInviteDomains] = FieldInfo(alias="inviteDomains", default=None) - - name: Optional[str] = None - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ +__all__ = ["OrganizationRetrieveResponse"] class OrganizationRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/organization_set_role_params.py b/src/gitpod/types/organization_set_role_params.py index 1a81fb4a..fd565ece 100644 --- a/src/gitpod/types/organization_set_role_params.py +++ b/src/gitpod/types/organization_set_role_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .shared.organization_role import OrganizationRole __all__ = ["OrganizationSetRoleParams"] @@ -12,6 +13,6 @@ class OrganizationSetRoleParams(TypedDict, total=False): organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - role: Literal["ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER"] + role: OrganizationRole user_id: Annotated[str, PropertyInfo(alias="userId")] diff --git a/src/gitpod/types/organization_update_params.py b/src/gitpod/types/organization_update_params.py index 096c5942..90e4d514 100644 --- a/src/gitpod/types/organization_update_params.py +++ b/src/gitpod/types/organization_update_params.py @@ -2,36 +2,21 @@ from __future__ import annotations -from typing import List, Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .invite_domains_param import InviteDomainsParam -__all__ = [ - "OrganizationUpdateParams", - "InviteDomainsIsTheDomainAllowlistOfTheOrganization", - "InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains", - "NameIsTheNewNameOfTheOrganization", -] +__all__ = ["OrganizationUpdateParams"] -class InviteDomainsIsTheDomainAllowlistOfTheOrganization(TypedDict, total=False): - invite_domains: Required[ - Annotated[InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains, PropertyInfo(alias="inviteDomains")] - ] +class OrganizationUpdateParams(TypedDict, total=False): + invite_domains: Annotated[Optional[InviteDomainsParam], PropertyInfo(alias="inviteDomains")] """invite_domains is the domain allowlist of the organization""" - -class InviteDomainsIsTheDomainAllowlistOfTheOrganizationInviteDomains(TypedDict, total=False): - domains: List[str] - """domains is the list of domains that are allowed to join the organization""" - - -class NameIsTheNewNameOfTheOrganization(TypedDict, total=False): - name: Required[str] + name: Optional[str] """name is the new name of the organization""" - -OrganizationUpdateParams: TypeAlias = Union[ - InviteDomainsIsTheDomainAllowlistOfTheOrganization, NameIsTheNewNameOfTheOrganization -] + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the ID of the organization to update the settings for.""" diff --git a/src/gitpod/types/organization_update_response.py b/src/gitpod/types/organization_update_response.py index c3a2f977..fed05e61 100644 --- a/src/gitpod/types/organization_update_response.py +++ b/src/gitpod/types/organization_update_response.py @@ -1,210 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime - -from pydantic import Field as FieldInfo +from typing import Optional from .._models import BaseModel +from .organization import Organization -__all__ = ["OrganizationUpdateResponse", "Organization", "OrganizationInviteDomains"] - - -class OrganizationInviteDomains(BaseModel): - domains: Optional[List[str]] = None - """domains is the list of domains that are allowed to join the organization""" - - -class Organization(BaseModel): - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - invite_domains: Optional[OrganizationInviteDomains] = FieldInfo(alias="inviteDomains", default=None) - - name: Optional[str] = None - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ +__all__ = ["OrganizationUpdateResponse"] class OrganizationUpdateResponse(BaseModel): diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index 0cc2d0e9..ce9a3996 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -2,16 +2,19 @@ from __future__ import annotations +from .provider_type import ProviderType as ProviderType +from .sso_configuration import SSOConfiguration as SSOConfiguration +from .organization_invite import OrganizationInvite as OrganizationInvite from .invite_create_params import InviteCreateParams as InviteCreateParams from .invite_create_response import InviteCreateResponse as InviteCreateResponse from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams +from .sso_configuration_state import SSOConfigurationState as SSOConfigurationState from .invite_retrieve_response import InviteRetrieveResponse as InviteRetrieveResponse from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams from .invite_get_summary_response import InviteGetSummaryResponse as InviteGetSummaryResponse from .sso_configuration_list_params import SSOConfigurationListParams as SSOConfigurationListParams from .sso_configuration_create_params import SSOConfigurationCreateParams as SSOConfigurationCreateParams from .sso_configuration_delete_params import SSOConfigurationDeleteParams as SSOConfigurationDeleteParams -from .sso_configuration_list_response import SSOConfigurationListResponse as SSOConfigurationListResponse from .sso_configuration_update_params import SSOConfigurationUpdateParams as SSOConfigurationUpdateParams from .sso_configuration_create_response import SSOConfigurationCreateResponse as SSOConfigurationCreateResponse from .sso_configuration_retrieve_params import SSOConfigurationRetrieveParams as SSOConfigurationRetrieveParams diff --git a/src/gitpod/types/organizations/invite_create_response.py b/src/gitpod/types/organizations/invite_create_response.py index fb0cbbae..95c8bd76 100644 --- a/src/gitpod/types/organizations/invite_create_response.py +++ b/src/gitpod/types/organizations/invite_create_response.py @@ -2,20 +2,11 @@ from typing import Optional -from pydantic import Field as FieldInfo - from ..._models import BaseModel +from .organization_invite import OrganizationInvite -__all__ = ["InviteCreateResponse", "Invite"] - - -class Invite(BaseModel): - invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) - """ - invite_id is the unique identifier of the invite to join the organization. Use - JoinOrganization with this ID to join the organization. - """ +__all__ = ["InviteCreateResponse"] class InviteCreateResponse(BaseModel): - invite: Optional[Invite] = None + invite: Optional[OrganizationInvite] = None diff --git a/src/gitpod/types/organizations/invite_retrieve_response.py b/src/gitpod/types/organizations/invite_retrieve_response.py index ea2cbb09..bbdcdc8d 100644 --- a/src/gitpod/types/organizations/invite_retrieve_response.py +++ b/src/gitpod/types/organizations/invite_retrieve_response.py @@ -2,20 +2,11 @@ from typing import Optional -from pydantic import Field as FieldInfo - from ..._models import BaseModel +from .organization_invite import OrganizationInvite -__all__ = ["InviteRetrieveResponse", "Invite"] - - -class Invite(BaseModel): - invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) - """ - invite_id is the unique identifier of the invite to join the organization. Use - JoinOrganization with this ID to join the organization. - """ +__all__ = ["InviteRetrieveResponse"] class InviteRetrieveResponse(BaseModel): - invite: Optional[Invite] = None + invite: Optional[OrganizationInvite] = None diff --git a/src/gitpod/types/organizations/organization_invite.py b/src/gitpod/types/organizations/organization_invite.py new file mode 100644 index 00000000..d31f882d --- /dev/null +++ b/src/gitpod/types/organizations/organization_invite.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["OrganizationInvite"] + + +class OrganizationInvite(BaseModel): + invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) + """ + invite_id is the unique identifier of the invite to join the organization. Use + JoinOrganization with this ID to join the organization. + """ diff --git a/src/gitpod/types/organizations/provider_type.py b/src/gitpod/types/organizations/provider_type.py new file mode 100644 index 00000000..a5691eb8 --- /dev/null +++ b/src/gitpod/types/organizations/provider_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ProviderType"] + +ProviderType: TypeAlias = Literal["PROVIDER_TYPE_UNSPECIFIED", "PROVIDER_TYPE_BUILTIN", "PROVIDER_TYPE_CUSTOM"] diff --git a/src/gitpod/types/organizations/sso_configuration_list_response.py b/src/gitpod/types/organizations/sso_configuration.py similarity index 66% rename from src/gitpod/types/organizations/sso_configuration_list_response.py rename to src/gitpod/types/organizations/sso_configuration.py index 92917a10..fec9955d 100644 --- a/src/gitpod/types/organizations/sso_configuration_list_response.py +++ b/src/gitpod/types/organizations/sso_configuration.py @@ -1,16 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, Optional -from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel +from .provider_type import ProviderType +from .sso_configuration_state import SSOConfigurationState -__all__ = ["SSOConfigurationListResponse"] +__all__ = ["SSOConfiguration"] -class SSOConfigurationListResponse(BaseModel): +class SSOConfiguration(BaseModel): id: Optional[str] = None """id is the unique identifier of the SSO configuration""" @@ -27,14 +28,8 @@ class SSOConfigurationListResponse(BaseModel): organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - provider_type: Optional[Literal["PROVIDER_TYPE_UNSPECIFIED", "PROVIDER_TYPE_BUILTIN", "PROVIDER_TYPE_CUSTOM"]] = ( - FieldInfo(alias="providerType", default=None) - ) + provider_type: Optional[ProviderType] = FieldInfo(alias="providerType", default=None) """provider_type defines the type of the SSO configuration""" - state: Optional[ - Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ] - ] = None + state: Optional[SSOConfigurationState] = None """state is the state of the SSO configuration""" diff --git a/src/gitpod/types/organizations/sso_configuration_create_response.py b/src/gitpod/types/organizations/sso_configuration_create_response.py index 6909b0e4..962038c4 100644 --- a/src/gitpod/types/organizations/sso_configuration_create_response.py +++ b/src/gitpod/types/organizations/sso_configuration_create_response.py @@ -1,43 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional -from typing_extensions import Literal +from typing import Optional from pydantic import Field as FieldInfo from ..._models import BaseModel +from .sso_configuration import SSOConfiguration -__all__ = ["SSOConfigurationCreateResponse", "SSOConfiguration"] - - -class SSOConfiguration(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the SSO configuration""" - - claims: Optional[Dict[str, str]] = None - """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" - - client_id: Optional[str] = FieldInfo(alias="clientId", default=None) - """client_id is the client ID of the OIDC application set on the IdP""" - - email_domain: Optional[str] = FieldInfo(alias="emailDomain", default=None) - - issuer_url: Optional[str] = FieldInfo(alias="issuerUrl", default=None) - """issuer_url is the URL of the IdP issuer""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - - provider_type: Optional[Literal["PROVIDER_TYPE_UNSPECIFIED", "PROVIDER_TYPE_BUILTIN", "PROVIDER_TYPE_CUSTOM"]] = ( - FieldInfo(alias="providerType", default=None) - ) - """provider_type defines the type of the SSO configuration""" - - state: Optional[ - Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ] - ] = None - """state is the state of the SSO configuration""" +__all__ = ["SSOConfigurationCreateResponse"] class SSOConfigurationCreateResponse(BaseModel): diff --git a/src/gitpod/types/organizations/sso_configuration_retrieve_response.py b/src/gitpod/types/organizations/sso_configuration_retrieve_response.py index c5b31cfd..20aa1285 100644 --- a/src/gitpod/types/organizations/sso_configuration_retrieve_response.py +++ b/src/gitpod/types/organizations/sso_configuration_retrieve_response.py @@ -1,43 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional -from typing_extensions import Literal +from typing import Optional from pydantic import Field as FieldInfo from ..._models import BaseModel +from .sso_configuration import SSOConfiguration -__all__ = ["SSOConfigurationRetrieveResponse", "SSOConfiguration"] - - -class SSOConfiguration(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the SSO configuration""" - - claims: Optional[Dict[str, str]] = None - """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" - - client_id: Optional[str] = FieldInfo(alias="clientId", default=None) - """client_id is the client ID of the OIDC application set on the IdP""" - - email_domain: Optional[str] = FieldInfo(alias="emailDomain", default=None) - - issuer_url: Optional[str] = FieldInfo(alias="issuerUrl", default=None) - """issuer_url is the URL of the IdP issuer""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - - provider_type: Optional[Literal["PROVIDER_TYPE_UNSPECIFIED", "PROVIDER_TYPE_BUILTIN", "PROVIDER_TYPE_CUSTOM"]] = ( - FieldInfo(alias="providerType", default=None) - ) - """provider_type defines the type of the SSO configuration""" - - state: Optional[ - Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ] - ] = None - """state is the state of the SSO configuration""" +__all__ = ["SSOConfigurationRetrieveResponse"] class SSOConfigurationRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/organizations/sso_configuration_state.py b/src/gitpod/types/organizations/sso_configuration_state.py new file mode 100644 index 00000000..e866445e --- /dev/null +++ b/src/gitpod/types/organizations/sso_configuration_state.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SSOConfigurationState"] + +SSOConfigurationState: TypeAlias = Literal[ + "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" +] diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py index 47698ca7..129ce2c1 100644 --- a/src/gitpod/types/organizations/sso_configuration_update_params.py +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -2,53 +2,32 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing import Dict, Optional +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from .sso_configuration_state import SSOConfigurationState -__all__ = [ - "SSOConfigurationUpdateParams", - "ClientIDIsTheClientIDOfTheSSOProvider", - "ClientSecretIsTheClientSecretOfTheSSOProvider", - "Variant2", - "IssuerURLIsTheURLOfTheIDPIssuer", - "StateIsTheStateOfTheSSOConfiguration", -] +__all__ = ["SSOConfigurationUpdateParams"] -class ClientIDIsTheClientIDOfTheSSOProvider(TypedDict, total=False): - client_id: Required[Annotated[str, PropertyInfo(alias="clientId")]] - """client_id is the client ID of the SSO provider""" +class SSOConfigurationUpdateParams(TypedDict, total=False): + claims: Dict[str, str] + """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" + client_id: Annotated[Optional[str], PropertyInfo(alias="clientId")] + """client_id is the client ID of the SSO provider""" -class ClientSecretIsTheClientSecretOfTheSSOProvider(TypedDict, total=False): - client_secret: Required[Annotated[str, PropertyInfo(alias="clientSecret")]] + client_secret: Annotated[Optional[str], PropertyInfo(alias="clientSecret")] """client_secret is the client secret of the SSO provider""" + email_domain: Annotated[Optional[str], PropertyInfo(alias="emailDomain")] -class Variant2(TypedDict, total=False): - email_domain: Required[Annotated[str, PropertyInfo(alias="emailDomain")]] - - -class IssuerURLIsTheURLOfTheIDPIssuer(TypedDict, total=False): - issuer_url: Required[Annotated[str, PropertyInfo(alias="issuerUrl")]] + issuer_url: Annotated[Optional[str], PropertyInfo(alias="issuerUrl")] """issuer_url is the URL of the IdP issuer""" + sso_configuration_id: Annotated[str, PropertyInfo(alias="ssoConfigurationId")] + """sso_configuration_id is the ID of the SSO configuration to update""" -class StateIsTheStateOfTheSSOConfiguration(TypedDict, total=False): - state: Required[ - Literal[ - "SSO_CONFIGURATION_STATE_UNSPECIFIED", "SSO_CONFIGURATION_STATE_INACTIVE", "SSO_CONFIGURATION_STATE_ACTIVE" - ] - ] + state: Optional[SSOConfigurationState] """state is the state of the SSO configuration""" - - -SSOConfigurationUpdateParams: TypeAlias = Union[ - ClientIDIsTheClientIDOfTheSSOProvider, - ClientSecretIsTheClientSecretOfTheSSOProvider, - Variant2, - IssuerURLIsTheURLOfTheIDPIssuer, - StateIsTheStateOfTheSSOConfiguration, -] diff --git a/src/gitpod/types/project.py b/src/gitpod/types/project.py new file mode 100644 index 00000000..9fc31a92 --- /dev/null +++ b/src/gitpod/types/project.py @@ -0,0 +1,50 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject +from .project_metadata import ProjectMetadata +from .environment_initializer import EnvironmentInitializer +from .project_environment_class import ProjectEnvironmentClass + +__all__ = ["Project", "UsedBy"] + + +class UsedBy(BaseModel): + subjects: Optional[List[Subject]] = None + """ + Subjects are the 10 most recent subjects who have used the project to create an + environment + """ + + total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) + """Total number of unique subjects who have used the project""" + + +class Project(BaseModel): + environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") + + id: Optional[str] = None + """id is the unique identifier for the project""" + + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) + """ + automations_file_path is the path to the automations file relative to the repo + root + """ + + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root + """ + + initializer: Optional[EnvironmentInitializer] = None + """EnvironmentInitializer specifies how an environment is to be initialized""" + + metadata: Optional[ProjectMetadata] = None + + used_by: Optional[UsedBy] = FieldInfo(alias="usedBy", default=None) diff --git a/src/gitpod/types/project_create_from_environment_response.py b/src/gitpod/types/project_create_from_environment_response.py index 5fc8cf4f..5076ce21 100644 --- a/src/gitpod/types/project_create_from_environment_response.py +++ b/src/gitpod/types/project_create_from_environment_response.py @@ -1,364 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional +from .project import Project from .._models import BaseModel -__all__ = [ - "ProjectCreateFromEnvironmentResponse", - "Project", - "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", - "ProjectInitializer", - "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", - "ProjectMetadata", - "ProjectMetadataCreator", - "ProjectUsedBy", - "ProjectUsedBySubject", -] - - -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): - environment_class_id: str = FieldInfo(alias="environmentClassId") - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): - local_runner: bool = FieldInfo(alias="localRunner") - """Use a local runner for the user""" - - -ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, -] - - -class ProjectInitializerSpecContextURLContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - - -class ProjectInitializerSpecGitGit(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit - - -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] - - -class ProjectInitializer(BaseModel): - specs: Optional[List[ProjectInitializerSpec]] = None - - -class ProjectMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[ProjectMetadataCreator] = None - """creator is the identity of the project creator""" - - name: Optional[str] = None - """name is the human readable name of the project""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class ProjectUsedBySubject(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectUsedBy(BaseModel): - subjects: Optional[List[ProjectUsedBySubject]] = None - """ - Subjects are the 10 most recent subjects who have used the project to create an - environment - """ - - total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) - """Total number of unique subjects who have used the project""" - - -class Project(BaseModel): - environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") - - id: Optional[str] = None - """id is the unique identifier for the project""" - - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - initializer: Optional[ProjectInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - metadata: Optional[ProjectMetadata] = None - - used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) +__all__ = ["ProjectCreateFromEnvironmentResponse"] class ProjectCreateFromEnvironmentResponse(BaseModel): diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index 47f1619d..cb04ea57 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -2,29 +2,19 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo +from .environment_initializer_param import EnvironmentInitializerParam +from .project_environment_class_param import ProjectEnvironmentClassParam -__all__ = [ - "ProjectCreateParams", - "EnvironmentClass", - "EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "EnvironmentClassUseALocalRunnerForTheUser", - "Initializer", - "InitializerSpec", - "InitializerSpecContextURL", - "InitializerSpecContextURLContextURL", - "InitializerSpecGit", - "InitializerSpecGitGit", -] +__all__ = ["ProjectCreateParams"] class ProjectCreateParams(TypedDict, total=False): - environment_class: Required[Annotated[EnvironmentClass, PropertyInfo(alias="environmentClass")]] + environment_class: Required[Annotated[ProjectEnvironmentClassParam, PropertyInfo(alias="environmentClass")]] - initializer: Required[Initializer] + initializer: Required[EnvironmentInitializerParam] """EnvironmentInitializer specifies how an environment is to be initialized""" automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] @@ -48,72 +38,3 @@ class ProjectCreateParams(TypedDict, total=False): """ name: str - - -class EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - TypedDict, total=False -): - environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class EnvironmentClassUseALocalRunnerForTheUser(TypedDict, total=False): - local_runner: Required[Annotated[bool, PropertyInfo(alias="localRunner")]] - """Use a local runner for the user""" - - -EnvironmentClass: TypeAlias = Union[ - EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - EnvironmentClassUseALocalRunnerForTheUser, -] - - -class InitializerSpecContextURLContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - - -class InitializerSpecContextURL(TypedDict, total=False): - context_url: Required[Annotated[InitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl")]] - - -class InitializerSpecGitGit(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class InitializerSpecGit(TypedDict, total=False): - git: Required[InitializerSpecGitGit] - - -InitializerSpec: TypeAlias = Union[InitializerSpecContextURL, InitializerSpecGit] - - -class Initializer(TypedDict, total=False): - specs: Iterable[InitializerSpec] diff --git a/src/gitpod/types/project_create_response.py b/src/gitpod/types/project_create_response.py index 06cfd52b..81a0d7e2 100644 --- a/src/gitpod/types/project_create_response.py +++ b/src/gitpod/types/project_create_response.py @@ -1,364 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional +from .project import Project from .._models import BaseModel -__all__ = [ - "ProjectCreateResponse", - "Project", - "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", - "ProjectInitializer", - "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", - "ProjectMetadata", - "ProjectMetadataCreator", - "ProjectUsedBy", - "ProjectUsedBySubject", -] - - -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): - environment_class_id: str = FieldInfo(alias="environmentClassId") - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): - local_runner: bool = FieldInfo(alias="localRunner") - """Use a local runner for the user""" - - -ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, -] - - -class ProjectInitializerSpecContextURLContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - - -class ProjectInitializerSpecGitGit(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit - - -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] - - -class ProjectInitializer(BaseModel): - specs: Optional[List[ProjectInitializerSpec]] = None - - -class ProjectMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[ProjectMetadataCreator] = None - """creator is the identity of the project creator""" - - name: Optional[str] = None - """name is the human readable name of the project""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class ProjectUsedBySubject(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectUsedBy(BaseModel): - subjects: Optional[List[ProjectUsedBySubject]] = None - """ - Subjects are the 10 most recent subjects who have used the project to create an - environment - """ - - total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) - """Total number of unique subjects who have used the project""" - - -class Project(BaseModel): - environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") - - id: Optional[str] = None - """id is the unique identifier for the project""" - - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - initializer: Optional[ProjectInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - metadata: Optional[ProjectMetadata] = None - - used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) +__all__ = ["ProjectCreateResponse"] class ProjectCreateResponse(BaseModel): diff --git a/src/gitpod/types/project_environment_class.py b/src/gitpod/types/project_environment_class.py new file mode 100644 index 00000000..a969845a --- /dev/null +++ b/src/gitpod/types/project_environment_class.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["ProjectEnvironmentClass"] + + +class ProjectEnvironmentClass(BaseModel): + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) + """Use a local runner for the user""" diff --git a/src/gitpod/types/project_environment_class_param.py b/src/gitpod/types/project_environment_class_param.py new file mode 100644 index 00000000..c6e29185 --- /dev/null +++ b/src/gitpod/types/project_environment_class_param.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["ProjectEnvironmentClassParam"] + + +class ProjectEnvironmentClassParam(TypedDict, total=False): + environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] + """Use a fixed environment class on a given Runner. + + This cannot be a local runner's environment class. + """ + + local_runner: Annotated[bool, PropertyInfo(alias="localRunner")] + """Use a local runner for the user""" diff --git a/src/gitpod/types/project_list_response.py b/src/gitpod/types/project_metadata.py similarity index 63% rename from src/gitpod/types/project_list_response.py rename to src/gitpod/types/project_metadata.py index 8f42ed79..5a39bdaf 100644 --- a/src/gitpod/types/project_list_response.py +++ b/src/gitpod/types/project_metadata.py @@ -1,115 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import Optional from datetime import datetime -from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo from .._models import BaseModel +from .shared.subject import Subject -__all__ = [ - "ProjectListResponse", - "EnvironmentClass", - "EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "EnvironmentClassUseALocalRunnerForTheUser", - "Initializer", - "InitializerSpec", - "InitializerSpecContextURL", - "InitializerSpecContextURLContextURL", - "InitializerSpecGit", - "InitializerSpecGitGit", - "Metadata", - "MetadataCreator", - "UsedBy", - "UsedBySubject", -] - - -class EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass(BaseModel): - environment_class_id: str = FieldInfo(alias="environmentClassId") - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class EnvironmentClassUseALocalRunnerForTheUser(BaseModel): - local_runner: bool = FieldInfo(alias="localRunner") - """Use a local runner for the user""" - - -EnvironmentClass: TypeAlias = Union[ - EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - EnvironmentClassUseALocalRunnerForTheUser, -] - - -class InitializerSpecContextURLContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class InitializerSpecContextURL(BaseModel): - context_url: InitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - - -class InitializerSpecGitGit(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class InitializerSpecGit(BaseModel): - git: InitializerSpecGitGit - - -InitializerSpec: TypeAlias = Union[InitializerSpecContextURL, InitializerSpecGit] - - -class Initializer(BaseModel): - specs: Optional[List[InitializerSpec]] = None +__all__ = ["ProjectMetadata"] -class MetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class Metadata(BaseModel): +class ProjectMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local @@ -202,7 +104,7 @@ class Metadata(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[MetadataCreator] = None + creator: Optional[Subject] = None """creator is the identity of the project creator""" name: Optional[str] = None @@ -302,57 +204,3 @@ class Metadata(BaseModel): [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. """ - - -class UsedBySubject(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class UsedBy(BaseModel): - subjects: Optional[List[UsedBySubject]] = None - """ - Subjects are the 10 most recent subjects who have used the project to create an - environment - """ - - total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) - """Total number of unique subjects who have used the project""" - - -class ProjectListResponse(BaseModel): - environment_class: EnvironmentClass = FieldInfo(alias="environmentClass") - - id: Optional[str] = None - """id is the unique identifier for the project""" - - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - initializer: Optional[Initializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - metadata: Optional[Metadata] = None - - used_by: Optional[UsedBy] = FieldInfo(alias="usedBy", default=None) diff --git a/src/gitpod/types/project_retrieve_response.py b/src/gitpod/types/project_retrieve_response.py index 788d1eb6..066a7218 100644 --- a/src/gitpod/types/project_retrieve_response.py +++ b/src/gitpod/types/project_retrieve_response.py @@ -1,364 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional +from .project import Project from .._models import BaseModel -__all__ = [ - "ProjectRetrieveResponse", - "Project", - "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", - "ProjectInitializer", - "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", - "ProjectMetadata", - "ProjectMetadataCreator", - "ProjectUsedBy", - "ProjectUsedBySubject", -] - - -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): - environment_class_id: str = FieldInfo(alias="environmentClassId") - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): - local_runner: bool = FieldInfo(alias="localRunner") - """Use a local runner for the user""" - - -ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, -] - - -class ProjectInitializerSpecContextURLContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - - -class ProjectInitializerSpecGitGit(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit - - -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] - - -class ProjectInitializer(BaseModel): - specs: Optional[List[ProjectInitializerSpec]] = None - - -class ProjectMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[ProjectMetadataCreator] = None - """creator is the identity of the project creator""" - - name: Optional[str] = None - """name is the human readable name of the project""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class ProjectUsedBySubject(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectUsedBy(BaseModel): - subjects: Optional[List[ProjectUsedBySubject]] = None - """ - Subjects are the 10 most recent subjects who have used the project to create an - environment - """ - - total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) - """Total number of unique subjects who have used the project""" - - -class Project(BaseModel): - environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") - - id: Optional[str] = None - """id is the unique identifier for the project""" - - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - initializer: Optional[ProjectInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - metadata: Optional[ProjectMetadata] = None - - used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) +__all__ = ["ProjectRetrieveResponse"] class ProjectRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py index e8264524..c22d35e0 100644 --- a/src/gitpod/types/project_update_params.py +++ b/src/gitpod/types/project_update_params.py @@ -2,32 +2,18 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .environment_initializer_param import EnvironmentInitializerParam +from .project_environment_class_param import ProjectEnvironmentClassParam -__all__ = [ - "ProjectUpdateParams", - "AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot", - "DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot", - "Variant2", - "Variant2EnvironmentClass", - "Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "Variant2EnvironmentClassUseALocalRunnerForTheUser", - "InitializerIsTheContentInitializer", - "InitializerIsTheContentInitializerInitializer", - "InitializerIsTheContentInitializerInitializerSpec", - "InitializerIsTheContentInitializerInitializerSpecContextURL", - "InitializerIsTheContentInitializerInitializerSpecContextURLContextURL", - "InitializerIsTheContentInitializerInitializerSpecGit", - "InitializerIsTheContentInitializerInitializerSpecGitGit", - "Variant4", -] +__all__ = ["ProjectUpdateParams"] -class AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot(TypedDict, total=False): - automations_file_path: Required[Annotated[str, PropertyInfo(alias="automationsFilePath")]] +class ProjectUpdateParams(TypedDict, total=False): + automations_file_path: Annotated[Optional[str], PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): @@ -37,9 +23,7 @@ class AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot(Type ``` """ - -class DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot(TypedDict, total=False): - devcontainer_file_path: Required[Annotated[str, PropertyInfo(alias="devcontainerFilePath")]] + devcontainer_file_path: Annotated[Optional[str], PropertyInfo(alias="devcontainerFilePath")] """ devcontainer_file_path is the path to the devcontainer file relative to the repo root path must not be absolute (start with a /): @@ -49,99 +33,12 @@ class DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot(Ty ``` """ + environment_class: Annotated[Optional[ProjectEnvironmentClassParam], PropertyInfo(alias="environmentClass")] -class Variant2(TypedDict, total=False): - environment_class: Required[Annotated[Variant2EnvironmentClass, PropertyInfo(alias="environmentClass")]] - - -class Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - TypedDict, total=False -): - environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class Variant2EnvironmentClassUseALocalRunnerForTheUser(TypedDict, total=False): - local_runner: Required[Annotated[bool, PropertyInfo(alias="localRunner")]] - """Use a local runner for the user""" - - -Variant2EnvironmentClass: TypeAlias = Union[ - Variant2EnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - Variant2EnvironmentClassUseALocalRunnerForTheUser, -] - - -class InitializerIsTheContentInitializer(TypedDict, total=False): - initializer: Required[InitializerIsTheContentInitializerInitializer] + initializer: Optional[EnvironmentInitializerParam] """EnvironmentInitializer specifies how an environment is to be initialized""" + name: Optional[str] -class InitializerIsTheContentInitializerInitializerSpecContextURLContextURL(TypedDict, total=False): - url: str - """url is the URL from which the environment is created""" - - -class InitializerIsTheContentInitializerInitializerSpecContextURL(TypedDict, total=False): - context_url: Required[ - Annotated[ - InitializerIsTheContentInitializerInitializerSpecContextURLContextURL, PropertyInfo(alias="contextUrl") - ] - ] - - -class InitializerIsTheContentInitializerInitializerSpecGitGit(TypedDict, total=False): - checkout_location: Annotated[str, PropertyInfo(alias="checkoutLocation")] - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Annotated[str, PropertyInfo(alias="cloneTarget")] - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Annotated[str, PropertyInfo(alias="remoteUri")] - """remote_uri is the Git remote origin""" - - target_mode: Annotated[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ], - PropertyInfo(alias="targetMode"), - ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] - """upstream_Remote_uri is the fork upstream of a repository""" - - -class InitializerIsTheContentInitializerInitializerSpecGit(TypedDict, total=False): - git: Required[InitializerIsTheContentInitializerInitializerSpecGitGit] - - -InitializerIsTheContentInitializerInitializerSpec: TypeAlias = Union[ - InitializerIsTheContentInitializerInitializerSpecContextURL, InitializerIsTheContentInitializerInitializerSpecGit -] - - -class InitializerIsTheContentInitializerInitializer(TypedDict, total=False): - specs: Iterable[InitializerIsTheContentInitializerInitializerSpec] - - -class Variant4(TypedDict, total=False): - name: Required[str] - - -ProjectUpdateParams: TypeAlias = Union[ - AutomationsFilePathIsThePathToTheAutomationsFileRelativeToTheRepoRoot, - DevcontainerFilePathIsThePathToTheDevcontainerFileRelativeToTheRepoRoot, - Variant2, - InitializerIsTheContentInitializer, - Variant4, -] + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" diff --git a/src/gitpod/types/project_update_response.py b/src/gitpod/types/project_update_response.py index c01a5020..b4267232 100644 --- a/src/gitpod/types/project_update_response.py +++ b/src/gitpod/types/project_update_response.py @@ -1,364 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional +from .project import Project from .._models import BaseModel -__all__ = [ - "ProjectUpdateResponse", - "Project", - "ProjectEnvironmentClass", - "ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass", - "ProjectEnvironmentClassUseALocalRunnerForTheUser", - "ProjectInitializer", - "ProjectInitializerSpec", - "ProjectInitializerSpecContextURL", - "ProjectInitializerSpecContextURLContextURL", - "ProjectInitializerSpecGit", - "ProjectInitializerSpecGitGit", - "ProjectMetadata", - "ProjectMetadataCreator", - "ProjectUsedBy", - "ProjectUsedBySubject", -] - - -class ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass( - BaseModel -): - environment_class_id: str = FieldInfo(alias="environmentClassId") - """Use a fixed environment class on a given Runner. - - This cannot be a local runner's environment class. - """ - - -class ProjectEnvironmentClassUseALocalRunnerForTheUser(BaseModel): - local_runner: bool = FieldInfo(alias="localRunner") - """Use a local runner for the user""" - - -ProjectEnvironmentClass: TypeAlias = Union[ - ProjectEnvironmentClassUseAFixedEnvironmentClassOnAGivenRunnerThisCannotBeALocalRunnerSEnvironmentClass, - ProjectEnvironmentClassUseALocalRunnerForTheUser, -] - - -class ProjectInitializerSpecContextURLContextURL(BaseModel): - url: Optional[str] = None - """url is the URL from which the environment is created""" - - -class ProjectInitializerSpecContextURL(BaseModel): - context_url: ProjectInitializerSpecContextURLContextURL = FieldInfo(alias="contextUrl") - - -class ProjectInitializerSpecGitGit(BaseModel): - checkout_location: Optional[str] = FieldInfo(alias="checkoutLocation", default=None) - """ - a path relative to the environment root in which the code will be checked out to - """ - - clone_target: Optional[str] = FieldInfo(alias="cloneTarget", default=None) - """the value for the clone target mode - use depends on the target mode""" - - remote_uri: Optional[str] = FieldInfo(alias="remoteUri", default=None) - """remote_uri is the Git remote origin""" - - target_mode: Optional[ - Literal[ - "CLONE_TARGET_MODE_UNSPECIFIED", - "CLONE_TARGET_MODE_REMOTE_HEAD", - "CLONE_TARGET_MODE_REMOTE_COMMIT", - "CLONE_TARGET_MODE_REMOTE_BRANCH", - "CLONE_TARGET_MODE_LOCAL_BRANCH", - ] - ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" - - upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) - """upstream_Remote_uri is the fork upstream of a repository""" - - -class ProjectInitializerSpecGit(BaseModel): - git: ProjectInitializerSpecGitGit - - -ProjectInitializerSpec: TypeAlias = Union[ProjectInitializerSpecContextURL, ProjectInitializerSpecGit] - - -class ProjectInitializer(BaseModel): - specs: Optional[List[ProjectInitializerSpec]] = None - - -class ProjectMetadataCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectMetadata(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[ProjectMetadataCreator] = None - """creator is the identity of the project creator""" - - name: Optional[str] = None - """name is the human readable name of the project""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the ID of the organization that contains the environment""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class ProjectUsedBySubject(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class ProjectUsedBy(BaseModel): - subjects: Optional[List[ProjectUsedBySubject]] = None - """ - Subjects are the 10 most recent subjects who have used the project to create an - environment - """ - - total_subjects: Optional[int] = FieldInfo(alias="totalSubjects", default=None) - """Total number of unique subjects who have used the project""" - - -class Project(BaseModel): - environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") - - id: Optional[str] = None - """id is the unique identifier for the project""" - - automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) - """ - automations_file_path is the path to the automations file relative to the repo - root - """ - - devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) - """ - devcontainer_file_path is the path to the devcontainer file relative to the repo - root - """ - - initializer: Optional[ProjectInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" - - metadata: Optional[ProjectMetadata] = None - - used_by: Optional[ProjectUsedBy] = FieldInfo(alias="usedBy", default=None) +__all__ = ["ProjectUpdateResponse"] class ProjectUpdateResponse(BaseModel): diff --git a/src/gitpod/types/projects/__init__.py b/src/gitpod/types/projects/__init__.py index 7bea3a68..f6f8d0b8 100644 --- a/src/gitpod/types/projects/__init__.py +++ b/src/gitpod/types/projects/__init__.py @@ -2,10 +2,11 @@ from __future__ import annotations +from .project_role import ProjectRole as ProjectRole +from .project_policy import ProjectPolicy as ProjectPolicy from .policy_list_params import PolicyListParams as PolicyListParams from .policy_create_params import PolicyCreateParams as PolicyCreateParams from .policy_delete_params import PolicyDeleteParams as PolicyDeleteParams -from .policy_list_response import PolicyListResponse as PolicyListResponse from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse from .policy_update_response import PolicyUpdateResponse as PolicyUpdateResponse diff --git a/src/gitpod/types/projects/policy_create_params.py b/src/gitpod/types/projects/policy_create_params.py index fb0bdf29..1b72ad6c 100644 --- a/src/gitpod/types/projects/policy_create_params.py +++ b/src/gitpod/types/projects/policy_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from .project_role import ProjectRole __all__ = ["PolicyCreateParams"] @@ -16,4 +17,4 @@ class PolicyCreateParams(TypedDict, total=False): project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" - role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] + role: ProjectRole diff --git a/src/gitpod/types/projects/policy_create_response.py b/src/gitpod/types/projects/policy_create_response.py index 217faeb4..0d79a485 100644 --- a/src/gitpod/types/projects/policy_create_response.py +++ b/src/gitpod/types/projects/policy_create_response.py @@ -1,21 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo from ..._models import BaseModel +from .project_policy import ProjectPolicy -__all__ = ["PolicyCreateResponse", "Policy"] - - -class Policy(BaseModel): - group_id: Optional[str] = FieldInfo(alias="groupId", default=None) - - role: Optional[Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"]] = None - """role is the role assigned to the group""" +__all__ = ["PolicyCreateResponse"] class PolicyCreateResponse(BaseModel): - policy: Optional[Policy] = None + policy: Optional[ProjectPolicy] = None diff --git a/src/gitpod/types/projects/policy_update_params.py b/src/gitpod/types/projects/policy_update_params.py index e9b4348d..c53cb50e 100644 --- a/src/gitpod/types/projects/policy_update_params.py +++ b/src/gitpod/types/projects/policy_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from .project_role import ProjectRole __all__ = ["PolicyUpdateParams"] @@ -16,4 +17,4 @@ class PolicyUpdateParams(TypedDict, total=False): project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" - role: Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] + role: ProjectRole diff --git a/src/gitpod/types/projects/policy_update_response.py b/src/gitpod/types/projects/policy_update_response.py index 5a5a9c81..96b4cce5 100644 --- a/src/gitpod/types/projects/policy_update_response.py +++ b/src/gitpod/types/projects/policy_update_response.py @@ -1,21 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo from ..._models import BaseModel +from .project_policy import ProjectPolicy -__all__ = ["PolicyUpdateResponse", "Policy"] - - -class Policy(BaseModel): - group_id: Optional[str] = FieldInfo(alias="groupId", default=None) - - role: Optional[Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"]] = None - """role is the role assigned to the group""" +__all__ = ["PolicyUpdateResponse"] class PolicyUpdateResponse(BaseModel): - policy: Optional[Policy] = None + policy: Optional[ProjectPolicy] = None diff --git a/src/gitpod/types/runners/policy_list_response.py b/src/gitpod/types/projects/project_policy.py similarity index 59% rename from src/gitpod/types/runners/policy_list_response.py rename to src/gitpod/types/projects/project_policy.py index e69b114a..dfeb4e95 100644 --- a/src/gitpod/types/runners/policy_list_response.py +++ b/src/gitpod/types/projects/project_policy.py @@ -1,17 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel +from .project_role import ProjectRole -__all__ = ["PolicyListResponse"] +__all__ = ["ProjectPolicy"] -class PolicyListResponse(BaseModel): +class ProjectPolicy(BaseModel): group_id: Optional[str] = FieldInfo(alias="groupId", default=None) - role: Optional[Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"]] = None + role: Optional[ProjectRole] = None """role is the role assigned to the group""" diff --git a/src/gitpod/types/projects/project_role.py b/src/gitpod/types/projects/project_role.py new file mode 100644 index 00000000..b2a6261c --- /dev/null +++ b/src/gitpod/types/projects/project_role.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ProjectRole"] + +ProjectRole: TypeAlias = Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] diff --git a/src/gitpod/types/resource_operation.py b/src/gitpod/types/resource_operation.py new file mode 100644 index 00000000..3527c790 --- /dev/null +++ b/src/gitpod/types/resource_operation.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResourceOperation"] + +ResourceOperation: TypeAlias = Literal[ + "RESOURCE_OPERATION_UNSPECIFIED", + "RESOURCE_OPERATION_CREATE", + "RESOURCE_OPERATION_UPDATE", + "RESOURCE_OPERATION_DELETE", + "RESOURCE_OPERATION_UPDATE_STATUS", +] diff --git a/src/gitpod/types/resource_type.py b/src/gitpod/types/resource_type.py new file mode 100644 index 00000000..c34eaea7 --- /dev/null +++ b/src/gitpod/types/resource_type.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResourceType"] + +ResourceType: TypeAlias = Literal[ + "RESOURCE_TYPE_UNSPECIFIED", + "RESOURCE_TYPE_ENVIRONMENT", + "RESOURCE_TYPE_RUNNER", + "RESOURCE_TYPE_PROJECT", + "RESOURCE_TYPE_TASK", + "RESOURCE_TYPE_TASK_EXECUTION", + "RESOURCE_TYPE_SERVICE", + "RESOURCE_TYPE_ORGANIZATION", + "RESOURCE_TYPE_USER", + "RESOURCE_TYPE_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION", + "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN", + "RESOURCE_TYPE_GROUP", + "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN", + "RESOURCE_TYPE_USER_PREFERENCE", + "RESOURCE_TYPE_SERVICE_ACCOUNT", + "RESOURCE_TYPE_SECRET", + "RESOURCE_TYPE_SSO_CONFIG", +] diff --git a/src/gitpod/types/runner.py b/src/gitpod/types/runner.py new file mode 100644 index 00000000..505ab368 --- /dev/null +++ b/src/gitpod/types/runner.py @@ -0,0 +1,225 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .runner_kind import RunnerKind +from .runner_spec import RunnerSpec +from .runner_status import RunnerStatus +from .shared.subject import Subject +from .runner_provider import RunnerProvider + +__all__ = ["Runner"] + + +class Runner(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[Subject] = None + """creator is the identity of the creator of the environment""" + + kind: Optional[RunnerKind] = None + """RunnerKind represents the kind of a runner""" + + name: Optional[str] = None + """The runner's name which is shown to users""" + + provider: Optional[RunnerProvider] = None + """ + RunnerProvider identifies the specific implementation type of a runner. Each + provider maps to a specific kind of runner (local or remote), as specified below + for each provider. + """ + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + + spec: Optional[RunnerSpec] = None + """The runner's specification""" + + status: Optional[RunnerStatus] = None + """RunnerStatus represents the status of a runner""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py new file mode 100644 index 00000000..256e893d --- /dev/null +++ b/src/gitpod/types/runner_capability.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["RunnerCapability"] + +RunnerCapability: TypeAlias = Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"] diff --git a/src/gitpod/types/runner_configuration.py b/src/gitpod/types/runner_configuration.py new file mode 100644 index 00000000..ebb33363 --- /dev/null +++ b/src/gitpod/types/runner_configuration.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .runner_release_channel import RunnerReleaseChannel + +__all__ = ["RunnerConfiguration"] + + +class RunnerConfiguration(BaseModel): + auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) + """auto_update indicates whether the runner should automatically update itself.""" + + region: Optional[str] = None + """ + Region to deploy the runner in, if applicable. This is mainly used for remote + runners, and is only a hint. The runner may be deployed in a different region. + See the runner's status for the actual region. + """ + + release_channel: Optional[RunnerReleaseChannel] = FieldInfo(alias="releaseChannel", default=None) + """The release channel the runner is on""" diff --git a/src/gitpod/types/runner_configuration_param.py b/src/gitpod/types/runner_configuration_param.py new file mode 100644 index 00000000..3f3b95b7 --- /dev/null +++ b/src/gitpod/types/runner_configuration_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .runner_release_channel import RunnerReleaseChannel + +__all__ = ["RunnerConfigurationParam"] + + +class RunnerConfigurationParam(TypedDict, total=False): + auto_update: Annotated[bool, PropertyInfo(alias="autoUpdate")] + """auto_update indicates whether the runner should automatically update itself.""" + + region: str + """ + Region to deploy the runner in, if applicable. This is mainly used for remote + runners, and is only a hint. The runner may be deployed in a different region. + See the runner's status for the actual region. + """ + + release_channel: Annotated[RunnerReleaseChannel, PropertyInfo(alias="releaseChannel")] + """The release channel the runner is on""" diff --git a/src/gitpod/types/runner_create_params.py b/src/gitpod/types/runner_create_params.py index 787f46ba..fc5580ff 100644 --- a/src/gitpod/types/runner_create_params.py +++ b/src/gitpod/types/runner_create_params.py @@ -2,69 +2,27 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import TypedDict -from .._utils import PropertyInfo +from .runner_kind import RunnerKind +from .runner_provider import RunnerProvider +from .runner_spec_param import RunnerSpecParam -__all__ = ["RunnerCreateParams", "Spec", "SpecConfiguration"] +__all__ = ["RunnerCreateParams"] class RunnerCreateParams(TypedDict, total=False): - kind: Literal[ - "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" - ] + kind: RunnerKind """RunnerKind represents the kind of a runner""" name: str """The runner name for humans""" - provider: Literal[ - "RUNNER_PROVIDER_UNSPECIFIED", - "RUNNER_PROVIDER_AWS_EC2", - "RUNNER_PROVIDER_LINUX_HOST", - "RUNNER_PROVIDER_DESKTOP_MAC", - ] + provider: RunnerProvider """ RunnerProvider identifies the specific implementation type of a runner. Each provider maps to a specific kind of runner (local or remote), as specified below for each provider. """ - spec: Spec - - -class SpecConfiguration(TypedDict, total=False): - auto_update: Annotated[bool, PropertyInfo(alias="autoUpdate")] - """auto_update indicates whether the runner should automatically update itself.""" - - region: str - """ - Region to deploy the runner in, if applicable. This is mainly used for remote - runners, and is only a hint. The runner may be deployed in a different region. - See the runner's status for the actual region. - """ - - release_channel: Annotated[ - Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"], - PropertyInfo(alias="releaseChannel"), - ] - """The release channel the runner is on""" - - -class Spec(TypedDict, total=False): - configuration: SpecConfiguration - """The runner's configuration""" - - desired_phase: Annotated[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ], - PropertyInfo(alias="desiredPhase"), - ] - """RunnerPhase represents the phase a runner is in""" + spec: RunnerSpecParam diff --git a/src/gitpod/types/runner_create_response.py b/src/gitpod/types/runner_create_response.py index 35c86786..7a2bbd47 100644 --- a/src/gitpod/types/runner_create_response.py +++ b/src/gitpod/types/runner_create_response.py @@ -1,435 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import Optional from pydantic import Field as FieldInfo +from .runner import Runner from .._models import BaseModel -__all__ = [ - "RunnerCreateResponse", - "Runner", - "RunnerCreator", - "RunnerSpec", - "RunnerSpecConfiguration", - "RunnerStatus", - "RunnerStatusAdditionalInfo", -] +__all__ = ["RunnerCreateResponse"] -class RunnerCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class RunnerSpecConfiguration(BaseModel): - auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) - """auto_update indicates whether the runner should automatically update itself.""" - - region: Optional[str] = None - """ - Region to deploy the runner in, if applicable. This is mainly used for remote - runners, and is only a hint. The runner may be deployed in a different region. - See the runner's status for the actual region. - """ - - release_channel: Optional[ - Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] - ] = FieldInfo(alias="releaseChannel", default=None) - """The release channel the runner is on""" - - -class RunnerSpec(BaseModel): - configuration: Optional[RunnerSpecConfiguration] = None - """The runner's configuration""" - - desired_phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """RunnerPhase represents the phase a runner is in""" - - -class RunnerStatusAdditionalInfo(BaseModel): - key: Optional[str] = None - - value: Optional[str] = None - - -class RunnerStatus(BaseModel): - additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) - """additional_info contains additional information about the runner, e.g. - - a CloudFormation stack URL. - """ - - capabilities: Optional[ - List[Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"]] - ] = None - """capabilities is a list of capabilities the runner supports.""" - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - - message: Optional[str] = None - """ - The runner's reported message which is shown to users. This message adds more - context to the runner's phase. - """ - - phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = None - """RunnerPhase represents the phase a runner is in""" - - region: Optional[str] = None - """region is the region the runner is running in, if applicable.""" - - system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - version: Optional[str] = None - - -class Runner(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[RunnerCreator] = None - """creator is the identity of the creator of the environment""" - - kind: Optional[ - Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] - ] = None - """RunnerKind represents the kind of a runner""" - - name: Optional[str] = None - """The runner's name which is shown to users""" - - provider: Optional[ - Literal[ - "RUNNER_PROVIDER_UNSPECIFIED", - "RUNNER_PROVIDER_AWS_EC2", - "RUNNER_PROVIDER_LINUX_HOST", - "RUNNER_PROVIDER_DESKTOP_MAC", - ] - ] = None - """ - RunnerProvider identifies the specific implementation type of a runner. Each - provider maps to a specific kind of runner (local or remote), as specified below - for each provider. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - spec: Optional[RunnerSpec] = None - """The runner's specification""" - - status: Optional[RunnerStatus] = None - """RunnerStatus represents the status of a runner""" +class RunnerCreateResponse(BaseModel): + access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) + """deprecated, will be removed. Use exchange_token instead.""" - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + exchange_token: Optional[str] = FieldInfo(alias="exchangeToken", default=None) """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. + exchange_token is a one-time use token that should be exchanged by the runner + for an access token, using the IdentityService.ExchangeToken rpc. The token + expires after 24 hours. """ - -class RunnerCreateResponse(BaseModel): - access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) - runner: Optional[Runner] = None diff --git a/src/gitpod/types/runner_create_runner_token_response.py b/src/gitpod/types/runner_create_runner_token_response.py index c74f5780..0f793a38 100644 --- a/src/gitpod/types/runner_create_runner_token_response.py +++ b/src/gitpod/types/runner_create_runner_token_response.py @@ -11,3 +11,11 @@ class RunnerCreateRunnerTokenResponse(BaseModel): access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) + """deprecated, will be removed. Use exchange_token instead.""" + + exchange_token: Optional[str] = FieldInfo(alias="exchangeToken", default=None) + """ + exchange_token is a one-time use token that should be exchanged by the runner + for an access token, using the IdentityService.ExchangeToken rpc. The token + expires after 24 hours. + """ diff --git a/src/gitpod/types/runner_kind.py b/src/gitpod/types/runner_kind.py new file mode 100644 index 00000000..2302dbe7 --- /dev/null +++ b/src/gitpod/types/runner_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["RunnerKind"] + +RunnerKind: TypeAlias = Literal[ + "RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION" +] diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py index 8963496b..7d2a9864 100644 --- a/src/gitpod/types/runner_list_params.py +++ b/src/gitpod/types/runner_list_params.py @@ -3,9 +3,11 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .runner_kind import RunnerKind +from .runner_provider import RunnerProvider __all__ = ["RunnerListParams", "Filter", "Pagination"] @@ -25,19 +27,10 @@ class Filter(TypedDict, total=False): creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] """creator_ids filters the response to only runner created by specified users""" - kinds: List[ - Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] - ] + kinds: List[RunnerKind] """kinds filters the response to only runners of the specified kinds""" - providers: List[ - Literal[ - "RUNNER_PROVIDER_UNSPECIFIED", - "RUNNER_PROVIDER_AWS_EC2", - "RUNNER_PROVIDER_LINUX_HOST", - "RUNNER_PROVIDER_DESKTOP_MAC", - ] - ] + providers: List[RunnerProvider] """providers filters the response to only runners of the specified providers""" diff --git a/src/gitpod/types/runner_phase.py b/src/gitpod/types/runner_phase.py new file mode 100644 index 00000000..b7cd3e98 --- /dev/null +++ b/src/gitpod/types/runner_phase.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["RunnerPhase"] + +RunnerPhase: TypeAlias = Literal[ + "RUNNER_PHASE_UNSPECIFIED", + "RUNNER_PHASE_CREATED", + "RUNNER_PHASE_INACTIVE", + "RUNNER_PHASE_ACTIVE", + "RUNNER_PHASE_DELETING", + "RUNNER_PHASE_DELETED", + "RUNNER_PHASE_DEGRADED", +] diff --git a/src/gitpod/types/runner_provider.py b/src/gitpod/types/runner_provider.py new file mode 100644 index 00000000..371260b1 --- /dev/null +++ b/src/gitpod/types/runner_provider.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["RunnerProvider"] + +RunnerProvider: TypeAlias = Literal[ + "RUNNER_PROVIDER_UNSPECIFIED", + "RUNNER_PROVIDER_AWS_EC2", + "RUNNER_PROVIDER_LINUX_HOST", + "RUNNER_PROVIDER_DESKTOP_MAC", +] diff --git a/src/gitpod/types/runner_release_channel.py b/src/gitpod/types/runner_release_channel.py new file mode 100644 index 00000000..c85e07ae --- /dev/null +++ b/src/gitpod/types/runner_release_channel.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["RunnerReleaseChannel"] + +RunnerReleaseChannel: TypeAlias = Literal[ + "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST" +] diff --git a/src/gitpod/types/runner_retrieve_response.py b/src/gitpod/types/runner_retrieve_response.py index c2f7320a..6877822c 100644 --- a/src/gitpod/types/runner_retrieve_response.py +++ b/src/gitpod/types/runner_retrieve_response.py @@ -1,432 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo +from typing import Optional +from .runner import Runner from .._models import BaseModel -__all__ = [ - "RunnerRetrieveResponse", - "Runner", - "RunnerCreator", - "RunnerSpec", - "RunnerSpecConfiguration", - "RunnerStatus", - "RunnerStatusAdditionalInfo", -] - - -class RunnerCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class RunnerSpecConfiguration(BaseModel): - auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) - """auto_update indicates whether the runner should automatically update itself.""" - - region: Optional[str] = None - """ - Region to deploy the runner in, if applicable. This is mainly used for remote - runners, and is only a hint. The runner may be deployed in a different region. - See the runner's status for the actual region. - """ - - release_channel: Optional[ - Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] - ] = FieldInfo(alias="releaseChannel", default=None) - """The release channel the runner is on""" - - -class RunnerSpec(BaseModel): - configuration: Optional[RunnerSpecConfiguration] = None - """The runner's configuration""" - - desired_phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """RunnerPhase represents the phase a runner is in""" - - -class RunnerStatusAdditionalInfo(BaseModel): - key: Optional[str] = None - - value: Optional[str] = None - - -class RunnerStatus(BaseModel): - additional_info: Optional[List[RunnerStatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) - """additional_info contains additional information about the runner, e.g. - - a CloudFormation stack URL. - """ - - capabilities: Optional[ - List[Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"]] - ] = None - """capabilities is a list of capabilities the runner supports.""" - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - - message: Optional[str] = None - """ - The runner's reported message which is shown to users. This message adds more - context to the runner's phase. - """ - - phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = None - """RunnerPhase represents the phase a runner is in""" - - region: Optional[str] = None - """region is the region the runner is running in, if applicable.""" - - system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - version: Optional[str] = None - - -class Runner(BaseModel): - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[RunnerCreator] = None - """creator is the identity of the creator of the environment""" - - kind: Optional[ - Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] - ] = None - """RunnerKind represents the kind of a runner""" - - name: Optional[str] = None - """The runner's name which is shown to users""" - - provider: Optional[ - Literal[ - "RUNNER_PROVIDER_UNSPECIFIED", - "RUNNER_PROVIDER_AWS_EC2", - "RUNNER_PROVIDER_LINUX_HOST", - "RUNNER_PROVIDER_DESKTOP_MAC", - ] - ] = None - """ - RunnerProvider identifies the specific implementation type of a runner. Each - provider maps to a specific kind of runner (local or remote), as specified below - for each provider. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - spec: Optional[RunnerSpec] = None - """The runner's specification""" - - status: Optional[RunnerStatus] = None - """RunnerStatus represents the status of a runner""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ +__all__ = ["RunnerRetrieveResponse"] class RunnerRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/runner_spec.py b/src/gitpod/types/runner_spec.py new file mode 100644 index 00000000..9fb48111 --- /dev/null +++ b/src/gitpod/types/runner_spec.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .runner_phase import RunnerPhase +from .runner_configuration import RunnerConfiguration + +__all__ = ["RunnerSpec"] + + +class RunnerSpec(BaseModel): + configuration: Optional[RunnerConfiguration] = None + """The runner's configuration""" + + desired_phase: Optional[RunnerPhase] = FieldInfo(alias="desiredPhase", default=None) + """RunnerPhase represents the phase a runner is in""" diff --git a/src/gitpod/types/runner_spec_param.py b/src/gitpod/types/runner_spec_param.py new file mode 100644 index 00000000..c356eb32 --- /dev/null +++ b/src/gitpod/types/runner_spec_param.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .runner_phase import RunnerPhase +from .runner_configuration_param import RunnerConfigurationParam + +__all__ = ["RunnerSpecParam"] + + +class RunnerSpecParam(TypedDict, total=False): + configuration: RunnerConfigurationParam + """The runner's configuration""" + + desired_phase: Annotated[RunnerPhase, PropertyInfo(alias="desiredPhase")] + """RunnerPhase represents the phase a runner is in""" diff --git a/src/gitpod/types/runner_status.py b/src/gitpod/types/runner_status.py new file mode 100644 index 00000000..e516dcbf --- /dev/null +++ b/src/gitpod/types/runner_status.py @@ -0,0 +1,134 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .runner_phase import RunnerPhase +from .runner_capability import RunnerCapability +from .shared.field_value import FieldValue + +__all__ = ["RunnerStatus"] + + +class RunnerStatus(BaseModel): + additional_info: Optional[List[FieldValue]] = FieldInfo(alias="additionalInfo", default=None) + """additional_info contains additional information about the runner, e.g. + + a CloudFormation stack URL. + """ + + capabilities: Optional[List[RunnerCapability]] = None + """capabilities is a list of capabilities the runner supports.""" + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + + message: Optional[str] = None + """ + The runner's reported message which is shown to users. This message adds more + context to the runner's phase. + """ + + phase: Optional[RunnerPhase] = None + """RunnerPhase represents the phase a runner is in""" + + region: Optional[str] = None + """region is the region the runner is running in, if applicable.""" + + system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + version: Optional[str] = None diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index d13d613b..975f0693 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -2,85 +2,39 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .runner_phase import RunnerPhase +from .runner_release_channel import RunnerReleaseChannel -__all__ = [ - "RunnerUpdateParams", - "TheRunnerSNameWhichIsShownToUsers", - "Variant1", - "Variant1Spec", - "Variant1SpecConfiguration", - "Variant1SpecConfigurationConfiguration", - "Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself", - "Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn", - "Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners", -] +__all__ = ["RunnerUpdateParams", "Spec", "SpecConfiguration"] -class TheRunnerSNameWhichIsShownToUsers(TypedDict, total=False): - name: Required[str] +class RunnerUpdateParams(TypedDict, total=False): + name: Optional[str] """The runner's name which is shown to users""" + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """runner_id specifies which runner to be updated. -class Variant1(TypedDict, total=False): - spec: Required[Variant1Spec] + +required + """ + spec: Optional[Spec] -class Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself( - TypedDict, total=False -): - auto_update: Required[Annotated[bool, PropertyInfo(alias="autoUpdate")]] - """auto_update indicates whether the runner should automatically update itself.""" +class SpecConfiguration(TypedDict, total=False): + auto_update: Annotated[Optional[bool], PropertyInfo(alias="autoUpdate")] + """auto_update indicates whether the runner should automatically update itself.""" -class Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn(TypedDict, total=False): - release_channel: Required[ - Annotated[ - Literal[ - "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST" - ], - PropertyInfo(alias="releaseChannel"), - ] - ] + release_channel: Annotated[Optional[RunnerReleaseChannel], PropertyInfo(alias="releaseChannel")] """The release channel the runner is on""" -Variant1SpecConfigurationConfiguration: TypeAlias = Union[ - Variant1SpecConfigurationConfigurationAutoUpdateIndicatesWhetherTheRunnerShouldAutomaticallyUpdateItself, - Variant1SpecConfigurationConfigurationTheReleaseChannelTheRunnerIsOn, -] - - -class Variant1SpecConfiguration(TypedDict, total=False): - configuration: Required[Variant1SpecConfigurationConfiguration] +class Spec(TypedDict, total=False): + configuration: Optional[SpecConfiguration] - -class Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners( - TypedDict, total=False -): - desired_phase: Required[ - Annotated[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ], - PropertyInfo(alias="desiredPhase"), - ] - ] + desired_phase: Annotated[Optional[RunnerPhase], PropertyInfo(alias="desiredPhase")] """RunnerPhase represents the phase a runner is in""" - - -Variant1Spec: TypeAlias = Union[ - Variant1SpecConfiguration, - Variant1SpecDesiredPhaseCanCurrentlyOnlyBeUpdatedOnLocalConfigurationRunnersToToggleWhetherLocalRunnersAreAllowedForRunningEnvironmentsInTheOrganizationSetToActiveToEnableLocalRunnersInactiveToDisableAllLocalRunnersExistingLocalRunnersAndTheirEnvironmentsWillStopAndCannotBeStartedAgainUntilTheDesiredPhaseIsSetToActiveUseThisCarefullyAsItWillAffectAllUsersInTheOrganizationWhoUseLocalRunners, -] - -RunnerUpdateParams: TypeAlias = Union[TheRunnerSNameWhichIsShownToUsers, Variant1] diff --git a/src/gitpod/types/runners/__init__.py b/src/gitpod/types/runners/__init__.py index aa750983..4d19ee2e 100644 --- a/src/gitpod/types/runners/__init__.py +++ b/src/gitpod/types/runners/__init__.py @@ -2,12 +2,16 @@ from __future__ import annotations +from .runner_role import RunnerRole as RunnerRole +from .runner_policy import RunnerPolicy as RunnerPolicy from .policy_list_params import PolicyListParams as PolicyListParams from .policy_create_params import PolicyCreateParams as PolicyCreateParams from .policy_delete_params import PolicyDeleteParams as PolicyDeleteParams -from .policy_list_response import PolicyListResponse as PolicyListResponse from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams +from .field_validation_error import FieldValidationError as FieldValidationError from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse from .policy_update_response import PolicyUpdateResponse as PolicyUpdateResponse from .configuration_validate_params import ConfigurationValidateParams as ConfigurationValidateParams from .configuration_validate_response import ConfigurationValidateResponse as ConfigurationValidateResponse +from .scm_integration_validation_result import ScmIntegrationValidationResult as ScmIntegrationValidationResult +from .environment_class_validation_result import EnvironmentClassValidationResult as EnvironmentClassValidationResult diff --git a/src/gitpod/types/runners/configuration_validate_params.py b/src/gitpod/types/runners/configuration_validate_params.py index 0bb99fad..df2d65e4 100644 --- a/src/gitpod/types/runners/configuration_validate_params.py +++ b/src/gitpod/types/runners/configuration_validate_params.py @@ -2,85 +2,39 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing import Union, Optional +from typing_extensions import Annotated, TypedDict from ..._types import Base64FileInput from ..._utils import PropertyInfo from ..._models import set_pydantic_config +from ..shared_params.environment_class import EnvironmentClass -__all__ = [ - "ConfigurationValidateParams", - "Variant0", - "Variant0EnvironmentClass", - "Variant0EnvironmentClassConfiguration", - "Variant1", - "Variant1ScmIntegration", - "Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet", - "Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration", - "Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner", -] +__all__ = ["ConfigurationValidateParams", "ScmIntegration"] -class Variant0(TypedDict, total=False): - environment_class: Required[Annotated[Variant0EnvironmentClass, PropertyInfo(alias="environmentClass")]] +class ConfigurationValidateParams(TypedDict, total=False): + environment_class: Annotated[EnvironmentClass, PropertyInfo(alias="environmentClass")] runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + scm_integration: Annotated[ScmIntegration, PropertyInfo(alias="scmIntegration")] -class Variant0EnvironmentClassConfiguration(TypedDict, total=False): - key: str - value: str - - -class Variant0EnvironmentClass(TypedDict, total=False): +class ScmIntegration(TypedDict, total=False): id: str - """id is the unique identifier of the environment class""" - - configuration: Iterable[Variant0EnvironmentClassConfiguration] - """configuration describes the configuration of the environment class""" + """id is the unique identifier of the SCM integration""" - description: str - """description is a human readable description of the environment class""" - - display_name: Annotated[str, PropertyInfo(alias="displayName")] - """display_name is the human readable name of the environment class""" - - enabled: bool - """ - enabled indicates whether the environment class can be used to create new - environments. - """ + host: str - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """ - runner_id is the unique identifier of the runner the environment class belongs - to - """ - - -class Variant1(TypedDict, total=False): - scm_integration: Required[Annotated[Variant1ScmIntegration, PropertyInfo(alias="scmIntegration")]] - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - -class Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet( - TypedDict, total=False -): - oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] + oauth_client_id: Annotated[Optional[str], PropertyInfo(alias="oauthClientId")] """ oauth_client_id is the OAuth app's client ID, if OAuth is configured. If configured, oauth_client_secret must also be set. """ - -class Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration( - TypedDict, total=False -): - oauth_encrypted_client_secret: Required[ - Annotated[Union[str, Base64FileInput], PropertyInfo(alias="oauthEncryptedClientSecret", format="base64")] + oauth_encrypted_client_secret: Annotated[ + Union[str, Base64FileInput], PropertyInfo(alias="oauthEncryptedClientSecret", format="base64") ] """ oauth_encrypted_client_secret is the OAuth app's client secret encrypted with @@ -88,17 +42,7 @@ class Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecret validate an already encrypted client secret of an existing SCM integration. """ - -set_pydantic_config( - Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration, - {"arbitrary_types_allowed": True}, -) - - -class Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner( - TypedDict, total=False -): - oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + oauth_plaintext_client_secret: Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")] """ oauth_plaintext_client_secret is the OAuth app's client secret in clear text, if OAuth is configured. This can be set to validate any new client secret before it @@ -106,11 +50,13 @@ class Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecret the runner's public key before passing it to the runner. """ + pat: bool + + scm_id: Annotated[str, PropertyInfo(alias="scmId")] + """ + scm_id references the scm_id in the runner's configuration schema that this + integration is for + """ -Variant1ScmIntegration: TypeAlias = Union[ - Variant1ScmIntegrationOAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthClientSecretMustAlsoBeSet, - Variant1ScmIntegrationOAuthEncryptedClientSecretIsTheOAuthAppSClientSecretEncryptedWithTheRunnerSPublicKeyIfOAuthIsConfiguredThisCanBeUsedToEGValidateAnAlreadyEncryptedClientSecretOfAnExistingScmIntegration, - Variant1ScmIntegrationOAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextIfOAuthIsConfiguredThisCanBeSetToValidateAnyNewClientSecretBeforeItIsEncryptedAndStoredThisValueWillNotBeStoredAndGetEncryptedWithTheRunnerSPublicKeyBeforePassingItToTheRunner, -] -ConfigurationValidateParams: TypeAlias = Union[Variant0, Variant1] +set_pydantic_config(ScmIntegration, {"arbitrary_types_allowed": True}) diff --git a/src/gitpod/types/runners/configuration_validate_response.py b/src/gitpod/types/runners/configuration_validate_response.py index a16f6873..30091326 100644 --- a/src/gitpod/types/runners/configuration_validate_response.py +++ b/src/gitpod/types/runners/configuration_validate_response.py @@ -1,70 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union -from typing_extensions import TypeAlias +from typing import Optional from pydantic import Field as FieldInfo from ..._models import BaseModel +from .scm_integration_validation_result import ScmIntegrationValidationResult +from .environment_class_validation_result import EnvironmentClassValidationResult -__all__ = [ - "ConfigurationValidateResponse", - "EnvironmentClass", - "EnvironmentClassEnvironmentClass", - "EnvironmentClassEnvironmentClassDescriptionError", - "EnvironmentClassEnvironmentClassDisplayNameError", - "ScmIntegration", - "ScmIntegrationScmIntegration", - "ScmIntegrationScmIntegrationHostError", - "ScmIntegrationScmIntegrationOAuthError", - "ScmIntegrationScmIntegrationPatError", - "ScmIntegrationScmIntegrationScmIDError", -] +__all__ = ["ConfigurationValidateResponse"] -class EnvironmentClassEnvironmentClassDescriptionError(BaseModel): - description_error: str = FieldInfo(alias="descriptionError") +class ConfigurationValidateResponse(BaseModel): + environment_class: Optional[EnvironmentClassValidationResult] = FieldInfo(alias="environmentClass", default=None) - -class EnvironmentClassEnvironmentClassDisplayNameError(BaseModel): - display_name_error: str = FieldInfo(alias="displayNameError") - - -EnvironmentClassEnvironmentClass: TypeAlias = Union[ - EnvironmentClassEnvironmentClassDescriptionError, EnvironmentClassEnvironmentClassDisplayNameError -] - - -class EnvironmentClass(BaseModel): - environment_class: EnvironmentClassEnvironmentClass = FieldInfo(alias="environmentClass") - - -class ScmIntegrationScmIntegrationHostError(BaseModel): - host_error: str = FieldInfo(alias="hostError") - - -class ScmIntegrationScmIntegrationOAuthError(BaseModel): - oauth_error: str = FieldInfo(alias="oauthError") - - -class ScmIntegrationScmIntegrationPatError(BaseModel): - pat_error: str = FieldInfo(alias="patError") - - -class ScmIntegrationScmIntegrationScmIDError(BaseModel): - scm_id_error: str = FieldInfo(alias="scmIdError") - - -ScmIntegrationScmIntegration: TypeAlias = Union[ - ScmIntegrationScmIntegrationHostError, - ScmIntegrationScmIntegrationOAuthError, - ScmIntegrationScmIntegrationPatError, - ScmIntegrationScmIntegrationScmIDError, -] - - -class ScmIntegration(BaseModel): - scm_integration: ScmIntegrationScmIntegration = FieldInfo(alias="scmIntegration") - - -ConfigurationValidateResponse: TypeAlias = Union[EnvironmentClass, ScmIntegration] + scm_integration: Optional[ScmIntegrationValidationResult] = FieldInfo(alias="scmIntegration", default=None) diff --git a/src/gitpod/types/runners/configurations/__init__.py b/src/gitpod/types/runners/configurations/__init__.py index d614bb27..5a36d94b 100644 --- a/src/gitpod/types/runners/configurations/__init__.py +++ b/src/gitpod/types/runners/configurations/__init__.py @@ -2,19 +2,22 @@ from __future__ import annotations +from .scm_integration import ScmIntegration as ScmIntegration from .schema_retrieve_params import SchemaRetrieveParams as SchemaRetrieveParams from .schema_retrieve_response import SchemaRetrieveResponse as SchemaRetrieveResponse +from .host_authentication_token import HostAuthenticationToken as HostAuthenticationToken +from .runner_configuration_schema import RunnerConfigurationSchema as RunnerConfigurationSchema from .scm_integration_list_params import ScmIntegrationListParams as ScmIntegrationListParams +from .scm_integration_oauth_config import ScmIntegrationOAuthConfig as ScmIntegrationOAuthConfig from .environment_class_list_params import EnvironmentClassListParams as EnvironmentClassListParams from .scm_integration_create_params import ScmIntegrationCreateParams as ScmIntegrationCreateParams from .scm_integration_delete_params import ScmIntegrationDeleteParams as ScmIntegrationDeleteParams -from .scm_integration_list_response import ScmIntegrationListResponse as ScmIntegrationListResponse from .scm_integration_update_params import ScmIntegrationUpdateParams as ScmIntegrationUpdateParams from .environment_class_create_params import EnvironmentClassCreateParams as EnvironmentClassCreateParams -from .environment_class_list_response import EnvironmentClassListResponse as EnvironmentClassListResponse from .environment_class_update_params import EnvironmentClassUpdateParams as EnvironmentClassUpdateParams from .scm_integration_create_response import ScmIntegrationCreateResponse as ScmIntegrationCreateResponse from .scm_integration_retrieve_params import ScmIntegrationRetrieveParams as ScmIntegrationRetrieveParams +from .host_authentication_token_source import HostAuthenticationTokenSource as HostAuthenticationTokenSource from .environment_class_create_response import EnvironmentClassCreateResponse as EnvironmentClassCreateResponse from .environment_class_retrieve_params import EnvironmentClassRetrieveParams as EnvironmentClassRetrieveParams from .scm_integration_retrieve_response import ScmIntegrationRetrieveResponse as ScmIntegrationRetrieveResponse @@ -28,9 +31,6 @@ from .host_authentication_token_delete_params import ( HostAuthenticationTokenDeleteParams as HostAuthenticationTokenDeleteParams, ) -from .host_authentication_token_list_response import ( - HostAuthenticationTokenListResponse as HostAuthenticationTokenListResponse, -) from .host_authentication_token_update_params import ( HostAuthenticationTokenUpdateParams as HostAuthenticationTokenUpdateParams, ) diff --git a/src/gitpod/types/runners/configurations/environment_class_create_params.py b/src/gitpod/types/runners/configurations/environment_class_create_params.py index 659e64e3..1f624b08 100644 --- a/src/gitpod/types/runners/configurations/environment_class_create_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_create_params.py @@ -6,21 +6,16 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from ...shared_params.field_value import FieldValue -__all__ = ["EnvironmentClassCreateParams", "Configuration"] +__all__ = ["EnvironmentClassCreateParams"] class EnvironmentClassCreateParams(TypedDict, total=False): - configuration: Iterable[Configuration] + configuration: Iterable[FieldValue] description: str display_name: Annotated[str, PropertyInfo(alias="displayName")] runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - - -class Configuration(TypedDict, total=False): - key: str - - value: str diff --git a/src/gitpod/types/runners/configurations/environment_class_list_params.py b/src/gitpod/types/runners/configurations/environment_class_list_params.py index ce42b415..c5c59b15 100644 --- a/src/gitpod/types/runners/configurations/environment_class_list_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing import List, Optional +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo @@ -21,12 +22,15 @@ class EnvironmentClassListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - enabled: Required[bool] + enabled: Optional[bool] """ enabled filters the response to only enabled or disabled environment classes. If not set, all environment classes are returned. """ + runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] + """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/runners/configurations/environment_class_list_response.py b/src/gitpod/types/runners/configurations/environment_class_list_response.py deleted file mode 100644 index a5d220db..00000000 --- a/src/gitpod/types/runners/configurations/environment_class_list_response.py +++ /dev/null @@ -1,41 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["EnvironmentClassListResponse", "Configuration"] - - -class Configuration(BaseModel): - key: Optional[str] = None - - value: Optional[str] = None - - -class EnvironmentClassListResponse(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the environment class""" - - configuration: Optional[List[Configuration]] = None - """configuration describes the configuration of the environment class""" - - description: Optional[str] = None - """description is a human readable description of the environment class""" - - display_name: Optional[str] = FieldInfo(alias="displayName", default=None) - """display_name is the human readable name of the environment class""" - - enabled: Optional[bool] = None - """ - enabled indicates whether the environment class can be used to create new - environments. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """ - runner_id is the unique identifier of the runner the environment class belongs - to - """ diff --git a/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py b/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py index fd91634b..36ad2504 100644 --- a/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/environment_class_retrieve_response.py @@ -1,44 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from pydantic import Field as FieldInfo from ...._models import BaseModel +from ...shared.environment_class import EnvironmentClass -__all__ = ["EnvironmentClassRetrieveResponse", "EnvironmentClass", "EnvironmentClassConfiguration"] - - -class EnvironmentClassConfiguration(BaseModel): - key: Optional[str] = None - - value: Optional[str] = None - - -class EnvironmentClass(BaseModel): - id: Optional[str] = None - """id is the unique identifier of the environment class""" - - configuration: Optional[List[EnvironmentClassConfiguration]] = None - """configuration describes the configuration of the environment class""" - - description: Optional[str] = None - """description is a human readable description of the environment class""" - - display_name: Optional[str] = FieldInfo(alias="displayName", default=None) - """display_name is the human readable name of the environment class""" - - enabled: Optional[bool] = None - """ - enabled indicates whether the environment class can be used to create new - environments. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """ - runner_id is the unique identifier of the runner the environment class belongs - to - """ +__all__ = ["EnvironmentClassRetrieveResponse"] class EnvironmentClassRetrieveResponse(BaseModel): diff --git a/src/gitpod/types/runners/configurations/environment_class_update_params.py b/src/gitpod/types/runners/configurations/environment_class_update_params.py index 53006f36..e1613618 100644 --- a/src/gitpod/types/runners/configurations/environment_class_update_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_update_params.py @@ -2,24 +2,19 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["EnvironmentClassUpdateParams", "Variant0", "Variant1", "Variant2"] +__all__ = ["EnvironmentClassUpdateParams"] -class Variant0(TypedDict, total=False): - description: Required[str] +class EnvironmentClassUpdateParams(TypedDict, total=False): + description: Optional[str] + display_name: Annotated[Optional[str], PropertyInfo(alias="displayName")] -class Variant1(TypedDict, total=False): - display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] + enabled: Optional[bool] - -class Variant2(TypedDict, total=False): - enabled: Required[bool] - - -EnvironmentClassUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] + environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py b/src/gitpod/types/runners/configurations/host_authentication_token.py similarity index 92% rename from src/gitpod/types/runners/configurations/host_authentication_token_list_response.py rename to src/gitpod/types/runners/configurations/host_authentication_token.py index 03cdca9d..6ebf74ad 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_list_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token.py @@ -2,16 +2,16 @@ from typing import Optional from datetime import datetime -from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel +from .host_authentication_token_source import HostAuthenticationTokenSource -__all__ = ["HostAuthenticationTokenListResponse"] +__all__ = ["HostAuthenticationToken"] -class HostAuthenticationTokenListResponse(BaseModel): +class HostAuthenticationToken(BaseModel): id: Optional[str] = None expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) @@ -110,12 +110,6 @@ class HostAuthenticationTokenListResponse(BaseModel): runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - source: Optional[ - Literal[ - "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", - "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", - ] - ] = None + source: Optional[HostAuthenticationTokenSource] = None user_id: Optional[str] = FieldInfo(alias="userId", default=None) diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py index ae8e98b2..f0ba68ee 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py @@ -4,9 +4,10 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from .host_authentication_token_source import HostAuthenticationTokenSource __all__ = ["HostAuthenticationTokenCreateParams"] @@ -112,10 +113,6 @@ class HostAuthenticationTokenCreateParams(TypedDict, total=False): runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - source: Literal[ - "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", - "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", - ] + source: HostAuthenticationTokenSource user_id: Annotated[str, PropertyInfo(alias="userId")] diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py index fe368a60..b351bfea 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py @@ -1,125 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo from ...._models import BaseModel +from .host_authentication_token import HostAuthenticationToken -__all__ = ["HostAuthenticationTokenCreateResponse", "Token"] - - -class Token(BaseModel): - id: Optional[str] = None - - expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - host: Optional[str] = None - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - source: Optional[ - Literal[ - "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", - "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", - ] - ] = None - - user_id: Optional[str] = FieldInfo(alias="userId", default=None) +__all__ = ["HostAuthenticationTokenCreateResponse"] class HostAuthenticationTokenCreateResponse(BaseModel): - token: Optional[Token] = None + token: Optional[HostAuthenticationToken] = None diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py index 77b971f1..2576f40c 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenListParams", "Filter", "FilterRunnerID", "FilterUserID", "Pagination"] +__all__ = ["HostAuthenticationTokenListParams", "Filter", "Pagination"] class HostAuthenticationTokenListParams(TypedDict, total=False): @@ -20,15 +20,10 @@ class HostAuthenticationTokenListParams(TypedDict, total=False): pagination: Pagination -class FilterRunnerID(TypedDict, total=False): - runner_id: Required[Annotated[str, PropertyInfo(alias="runnerId")]] +class Filter(TypedDict, total=False): + runner_id: Annotated[Optional[str], PropertyInfo(alias="runnerId")] - -class FilterUserID(TypedDict, total=False): - user_id: Required[Annotated[str, PropertyInfo(alias="userId")]] - - -Filter: TypeAlias = Union[FilterRunnerID, FilterUserID] + user_id: Annotated[Optional[str], PropertyInfo(alias="userId")] class Pagination(TypedDict, total=False): diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py index 85cb9463..50e478b1 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py @@ -1,125 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo from ...._models import BaseModel +from .host_authentication_token import HostAuthenticationToken -__all__ = ["HostAuthenticationTokenRetrieveResponse", "Token"] - - -class Token(BaseModel): - id: Optional[str] = None - - expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - host: Optional[str] = None - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - - source: Optional[ - Literal[ - "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", - "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", - ] - ] = None - - user_id: Optional[str] = FieldInfo(alias="userId", default=None) +__all__ = ["HostAuthenticationTokenRetrieveResponse"] class HostAuthenticationTokenRetrieveResponse(BaseModel): - token: Optional[Token] = None + token: Optional[HostAuthenticationToken] = None diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_source.py b/src/gitpod/types/runners/configurations/host_authentication_token_source.py new file mode 100644 index 00000000..c610d078 --- /dev/null +++ b/src/gitpod/types/runners/configurations/host_authentication_token_source.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["HostAuthenticationTokenSource"] + +HostAuthenticationTokenSource: TypeAlias = Literal[ + "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + "HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + "HOST_AUTHENTICATION_TOKEN_SOURCE_PAT", +] diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py index aea852e6..50dfcd27 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py @@ -2,17 +2,21 @@ from __future__ import annotations -from typing import Union +from typing import Union, Optional from datetime import datetime -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["HostAuthenticationTokenUpdateParams", "Variant0", "Variant1", "Variant2"] +__all__ = ["HostAuthenticationTokenUpdateParams"] -class Variant0(TypedDict, total=False): - expires_at: Required[Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")]] +class HostAuthenticationTokenUpdateParams(TypedDict, total=False): + id: str + + token: Optional[str] + + expires_at: Annotated[Union[str, datetime, None], PropertyInfo(alias="expiresAt", format="iso8601")] """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -104,13 +108,4 @@ class Variant0(TypedDict, total=False): to obtain a formatter capable of generating timestamps in this format. """ - -class Variant1(TypedDict, total=False): - refresh_token: Required[Annotated[str, PropertyInfo(alias="refreshToken")]] - - -class Variant2(TypedDict, total=False): - token: Required[str] - - -HostAuthenticationTokenUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] + refresh_token: Annotated[Optional[str], PropertyInfo(alias="refreshToken")] diff --git a/src/gitpod/types/runners/configurations/runner_configuration_schema.py b/src/gitpod/types/runners/configurations/runner_configuration_schema.py new file mode 100644 index 00000000..fff9b91a --- /dev/null +++ b/src/gitpod/types/runners/configurations/runner_configuration_schema.py @@ -0,0 +1,169 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import builtins +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "RunnerConfigurationSchema", + "EnvironmentClass", + "EnvironmentClassBool", + "EnvironmentClassDisplay", + "EnvironmentClassEnum", + "EnvironmentClassInt", + "EnvironmentClassString", + "RunnerConfig", + "RunnerConfigBool", + "RunnerConfigDisplay", + "RunnerConfigEnum", + "RunnerConfigInt", + "RunnerConfigString", + "Scm", + "ScmOAuth", + "ScmPat", +] + + +class EnvironmentClassBool(BaseModel): + default: Optional[bool] = None + + +class EnvironmentClassDisplay(BaseModel): + default: Optional[str] = None + + +class EnvironmentClassEnum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class EnvironmentClassInt(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class EnvironmentClassString(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + +class EnvironmentClass(BaseModel): + id: Optional[str] = None + + bool: Optional[EnvironmentClassBool] = None + + description: Optional[str] = None + + display: Optional[EnvironmentClassDisplay] = None + + enum: Optional[EnvironmentClassEnum] = None + + int: Optional[EnvironmentClassInt] = None + + name: Optional[str] = None + + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None + + string: Optional[EnvironmentClassString] = None + + +class RunnerConfigBool(BaseModel): + default: Optional[bool] = None + + +class RunnerConfigDisplay(BaseModel): + default: Optional[str] = None + + +class RunnerConfigEnum(BaseModel): + default: Optional[str] = None + + values: Optional[List[str]] = None + + +class RunnerConfigInt(BaseModel): + default: Optional[int] = None + + max: Optional[int] = None + + min: Optional[int] = None + + +class RunnerConfigString(BaseModel): + default: Optional[str] = None + + pattern: Optional[str] = None + + +class RunnerConfig(BaseModel): + id: Optional[str] = None + + bool: Optional[RunnerConfigBool] = None + + description: Optional[str] = None + + display: Optional[RunnerConfigDisplay] = None + + enum: Optional[RunnerConfigEnum] = None + + int: Optional[RunnerConfigInt] = None + + name: Optional[str] = None + + required: Optional[builtins.bool] = None + + secret: Optional[builtins.bool] = None + + string: Optional[RunnerConfigString] = None + + +class ScmOAuth(BaseModel): + callback_url: Optional[str] = FieldInfo(alias="callbackUrl", default=None) + """ + callback_url is the URL the OAuth app will redirect to after the user has + authenticated. + """ + + +class ScmPat(BaseModel): + description: Optional[str] = None + """description is a human-readable description of the PAT.""" + + docs_link: Optional[str] = FieldInfo(alias="docsLink", default=None) + """ + docs_link is a link to the documentation on how to create a PAT for this SCM + system. + """ + + +class Scm(BaseModel): + default_hosts: Optional[List[str]] = FieldInfo(alias="defaultHosts", default=None) + + name: Optional[str] = None + + oauth: Optional[ScmOAuth] = None + + pat: Optional[ScmPat] = None + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + + +class RunnerConfigurationSchema(BaseModel): + environment_classes: Optional[List[EnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) + + runner_config: Optional[List[RunnerConfig]] = FieldInfo(alias="runnerConfig", default=None) + + scm: Optional[List[Scm]] = None + + version: Optional[str] = None + """The schema version""" diff --git a/src/gitpod/types/runners/configurations/schema_retrieve_response.py b/src/gitpod/types/runners/configurations/schema_retrieve_response.py index 8ebcad63..64f13c7f 100644 --- a/src/gitpod/types/runners/configurations/schema_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/schema_retrieve_response.py @@ -1,299 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import builtins -from typing import List, Union, Optional -from typing_extensions import TypeAlias +from typing import Optional from pydantic import Field as FieldInfo from ...._models import BaseModel +from .runner_configuration_schema import RunnerConfigurationSchema -__all__ = [ - "SchemaRetrieveResponse", - "Schema", - "SchemaEnvironmentClass", - "SchemaEnvironmentClassUnionMember0", - "SchemaEnvironmentClassUnionMember0Bool", - "SchemaEnvironmentClassUnionMember1", - "SchemaEnvironmentClassUnionMember1Display", - "SchemaEnvironmentClassUnionMember2", - "SchemaEnvironmentClassUnionMember2Enum", - "SchemaEnvironmentClassUnionMember3", - "SchemaEnvironmentClassUnionMember3Int", - "SchemaEnvironmentClassUnionMember4", - "SchemaEnvironmentClassUnionMember4String", - "SchemaRunnerConfig", - "SchemaRunnerConfigUnionMember0", - "SchemaRunnerConfigUnionMember0Bool", - "SchemaRunnerConfigUnionMember1", - "SchemaRunnerConfigUnionMember1Display", - "SchemaRunnerConfigUnionMember2", - "SchemaRunnerConfigUnionMember2Enum", - "SchemaRunnerConfigUnionMember3", - "SchemaRunnerConfigUnionMember3Int", - "SchemaRunnerConfigUnionMember4", - "SchemaRunnerConfigUnionMember4String", - "SchemaScm", - "SchemaScmOAuth", - "SchemaScmPat", -] - - -class SchemaEnvironmentClassUnionMember0Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaEnvironmentClassUnionMember0(BaseModel): - bool: SchemaEnvironmentClassUnionMember0Bool - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None - - -class SchemaEnvironmentClassUnionMember1Display(BaseModel): - default: Optional[str] = None - - -class SchemaEnvironmentClassUnionMember1(BaseModel): - display: SchemaEnvironmentClassUnionMember1Display - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaEnvironmentClassUnionMember2Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaEnvironmentClassUnionMember2(BaseModel): - enum: SchemaEnvironmentClassUnionMember2Enum - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaEnvironmentClassUnionMember3Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaEnvironmentClassUnionMember3(BaseModel): - int: SchemaEnvironmentClassUnionMember3Int - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaEnvironmentClassUnionMember4String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - -class SchemaEnvironmentClassUnionMember4(BaseModel): - string: SchemaEnvironmentClassUnionMember4String - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -SchemaEnvironmentClass: TypeAlias = Union[ - SchemaEnvironmentClassUnionMember0, - SchemaEnvironmentClassUnionMember1, - SchemaEnvironmentClassUnionMember2, - SchemaEnvironmentClassUnionMember3, - SchemaEnvironmentClassUnionMember4, -] - - -class SchemaRunnerConfigUnionMember0Bool(BaseModel): - default: Optional[bool] = None - - -class SchemaRunnerConfigUnionMember0(BaseModel): - bool: SchemaRunnerConfigUnionMember0Bool - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[builtins.bool] = None - - secret: Optional[builtins.bool] = None - - -class SchemaRunnerConfigUnionMember1Display(BaseModel): - default: Optional[str] = None - - -class SchemaRunnerConfigUnionMember1(BaseModel): - display: SchemaRunnerConfigUnionMember1Display - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaRunnerConfigUnionMember2Enum(BaseModel): - default: Optional[str] = None - - values: Optional[List[str]] = None - - -class SchemaRunnerConfigUnionMember2(BaseModel): - enum: SchemaRunnerConfigUnionMember2Enum - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaRunnerConfigUnionMember3Int(BaseModel): - default: Optional[int] = None - - max: Optional[int] = None - - min: Optional[int] = None - - -class SchemaRunnerConfigUnionMember3(BaseModel): - int: SchemaRunnerConfigUnionMember3Int - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -class SchemaRunnerConfigUnionMember4String(BaseModel): - default: Optional[str] = None - - pattern: Optional[str] = None - - -class SchemaRunnerConfigUnionMember4(BaseModel): - string: SchemaRunnerConfigUnionMember4String - - id: Optional[str] = None - - description: Optional[str] = None - - name: Optional[str] = None - - required: Optional[bool] = None - - secret: Optional[bool] = None - - -SchemaRunnerConfig: TypeAlias = Union[ - SchemaRunnerConfigUnionMember0, - SchemaRunnerConfigUnionMember1, - SchemaRunnerConfigUnionMember2, - SchemaRunnerConfigUnionMember3, - SchemaRunnerConfigUnionMember4, -] - - -class SchemaScmOAuth(BaseModel): - callback_url: Optional[str] = FieldInfo(alias="callbackUrl", default=None) - """ - callback_url is the URL the OAuth app will redirect to after the user has - authenticated. - """ - - -class SchemaScmPat(BaseModel): - description: Optional[str] = None - """description is a human-readable description of the PAT.""" - - docs_link: Optional[str] = FieldInfo(alias="docsLink", default=None) - """ - docs_link is a link to the documentation on how to create a PAT for this SCM - system. - """ - - -class SchemaScm(BaseModel): - default_hosts: Optional[List[str]] = FieldInfo(alias="defaultHosts", default=None) - - name: Optional[str] = None - - oauth: Optional[SchemaScmOAuth] = None - - pat: Optional[SchemaScmPat] = None - - scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) - - -class Schema(BaseModel): - environment_classes: Optional[List[SchemaEnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) - - runner_config: Optional[List[SchemaRunnerConfig]] = FieldInfo(alias="runnerConfig", default=None) - - scm: Optional[List[SchemaScm]] = None - - version: Optional[str] = None - """The schema version""" +__all__ = ["SchemaRetrieveResponse"] class SchemaRetrieveResponse(BaseModel): - schema_: Optional[Schema] = FieldInfo(alias="schema", default=None) + schema_: Optional[RunnerConfigurationSchema] = FieldInfo(alias="schema", default=None) diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_response.py b/src/gitpod/types/runners/configurations/scm_integration.py similarity index 55% rename from src/gitpod/types/runners/configurations/scm_integration_list_response.py rename to src/gitpod/types/runners/configurations/scm_integration.py index 50b11109..05841dc2 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_list_response.py +++ b/src/gitpod/types/runners/configurations/scm_integration.py @@ -5,29 +5,19 @@ from pydantic import Field as FieldInfo from ...._models import BaseModel +from .scm_integration_oauth_config import ScmIntegrationOAuthConfig -__all__ = ["ScmIntegrationListResponse", "OAuth"] +__all__ = ["ScmIntegration"] -class OAuth(BaseModel): - client_id: Optional[str] = FieldInfo(alias="clientId", default=None) - """client_id is the OAuth app's client ID in clear text.""" - - encrypted_client_secret: Optional[str] = FieldInfo(alias="encryptedClientSecret", default=None) - """ - encrypted_client_secret is the OAuth app's secret encrypted with the runner's - public key. - """ - - -class ScmIntegrationListResponse(BaseModel): - oauth: OAuth - +class ScmIntegration(BaseModel): id: Optional[str] = None """id is the unique identifier of the SCM integration""" host: Optional[str] = None + oauth: Optional[ScmIntegrationOAuthConfig] = None + pat: Optional[bool] = None runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) diff --git a/src/gitpod/types/runners/configurations/scm_integration_create_params.py b/src/gitpod/types/runners/configurations/scm_integration_create_params.py index 1bbfe2b7..9713c075 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_create_params.py @@ -2,39 +2,35 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = [ - "ScmIntegrationCreateParams", - "OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet", - "OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored", -] +__all__ = ["ScmIntegrationCreateParams"] -class OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet( - TypedDict, total=False -): - oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] +class ScmIntegrationCreateParams(TypedDict, total=False): + host: str + + oauth_client_id: Annotated[Optional[str], PropertyInfo(alias="oauthClientId")] """ oauth_client_id is the OAuth app's client ID, if OAuth is configured. If configured, oauth_plaintext_client_secret must also be set. """ - -class OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( - TypedDict, total=False -): - oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + oauth_plaintext_client_secret: Annotated[Optional[str], PropertyInfo(alias="oauthPlaintextClientSecret")] """ oauth_plaintext_client_secret is the OAuth app's client secret in clear text. This will first be encrypted with the runner's public key before being stored. """ + pat: bool + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] -ScmIntegrationCreateParams: TypeAlias = Union[ - OAuthClientIDIsTheOAuthAppSClientIDIfOAuthIsConfiguredIfConfiguredOAuthPlaintextClientSecretMustAlsoBeSet, - OAuthPlaintextClientSecretIsTheOAuthAppSClientSecretInClearTextThisWillFirstBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored, -] + scm_id: Annotated[str, PropertyInfo(alias="scmId")] + """ + scm_id references the scm_id in the runner's configuration schema that this + integration is for + """ diff --git a/src/gitpod/types/runners/configurations/scm_integration_oauth_config.py b/src/gitpod/types/runners/configurations/scm_integration_oauth_config.py new file mode 100644 index 00000000..bda03c2b --- /dev/null +++ b/src/gitpod/types/runners/configurations/scm_integration_oauth_config.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["ScmIntegrationOAuthConfig"] + + +class ScmIntegrationOAuthConfig(BaseModel): + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + """client_id is the OAuth app's client ID in clear text.""" + + encrypted_client_secret: Optional[str] = FieldInfo(alias="encryptedClientSecret", default=None) + """ + encrypted_client_secret is the OAuth app's secret encrypted with the runner's + public key. + """ diff --git a/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py b/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py index 619b46da..d19d32d8 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/scm_integration_retrieve_response.py @@ -2,27 +2,11 @@ from typing import Optional -from pydantic import Field as FieldInfo - from ...._models import BaseModel +from .scm_integration import ScmIntegration -__all__ = ["ScmIntegrationRetrieveResponse", "Integration", "IntegrationOAuth"] - - -class IntegrationOAuth(BaseModel): - client_id: Optional[str] = FieldInfo(alias="clientId", default=None) - """client_id is the OAuth app's client ID in clear text.""" - - encrypted_client_secret: Optional[str] = FieldInfo(alias="encryptedClientSecret", default=None) - """ - encrypted_client_secret is the OAuth app's secret encrypted with the runner's - public key. - """ - - -class Integration(BaseModel): - oauth: IntegrationOAuth +__all__ = ["ScmIntegrationRetrieveResponse"] class ScmIntegrationRetrieveResponse(BaseModel): - integration: Optional[Integration] = None + integration: Optional[ScmIntegration] = None diff --git a/src/gitpod/types/runners/configurations/scm_integration_update_params.py b/src/gitpod/types/runners/configurations/scm_integration_update_params.py index 2732ed11..94e14e06 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_update_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_update_params.py @@ -2,23 +2,18 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = [ - "ScmIntegrationUpdateParams", - "OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate", - "OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored", - "PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate", -] +__all__ = ["ScmIntegrationUpdateParams"] -class OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate( - TypedDict, total=False -): - oauth_client_id: Required[Annotated[str, PropertyInfo(alias="oauthClientId")]] +class ScmIntegrationUpdateParams(TypedDict, total=False): + id: str + + oauth_client_id: Annotated[Optional[str], PropertyInfo(alias="oauthClientId")] """ oauth_client_id can be set to update the OAuth app's client ID. If an empty string is set, the OAuth configuration will be removed (regardless of whether a @@ -28,22 +23,14 @@ class OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOA until they re-authenticate. """ - -class OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored( - TypedDict, total=False -): - oauth_plaintext_client_secret: Required[Annotated[str, PropertyInfo(alias="oauthPlaintextClientSecret")]] + oauth_plaintext_client_secret: Annotated[Optional[str], PropertyInfo(alias="oauthPlaintextClientSecret")] """ oauth_plaintext_client_secret can be set to update the OAuth app's client secret. The cleartext secret will be encrypted with the runner's public key before being stored. """ - -class PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate( - TypedDict, total=False -): - pat: Required[bool] + pat: Optional[bool] """ pat can be set to enable or disable Personal Access Tokens support. When disabling PATs, any existing Host Authentication Tokens for the SCM @@ -51,10 +38,3 @@ class PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAn This might lead to users being unable to access their repositories until they re-authenticate. """ - - -ScmIntegrationUpdateParams: TypeAlias = Union[ - OAuthClientIDCanBeSetToUpdateTheOAuthAppSClientIDIfAnEmptyStringIsSetTheOAuthConfigurationWillBeRemovedRegardlessOfWhetherAClientSecretIsSetAndAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingTheOAuthAppWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate, - OAuthPlaintextClientSecretCanBeSetToUpdateTheOAuthAppSClientSecretTheCleartextSecretWillBeEncryptedWithTheRunnerSPublicKeyBeforeBeingStored, - PatCanBeSetToEnableOrDisablePersonalAccessTokensSupportWhenDisablingPaTsAnyExistingHostAuthenticationTokensForTheScmIntegrationSRunnerAndHostThatWereCreatedUsingAPatWillBeDeletedThisMightLeadToUsersBeingUnableToAccessTheirRepositoriesUntilTheyReAuthenticate, -] diff --git a/src/gitpod/types/runners/environment_class_validation_result.py b/src/gitpod/types/runners/environment_class_validation_result.py new file mode 100644 index 00000000..3b7e146d --- /dev/null +++ b/src/gitpod/types/runners/environment_class_validation_result.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .field_validation_error import FieldValidationError + +__all__ = ["EnvironmentClassValidationResult"] + + +class EnvironmentClassValidationResult(BaseModel): + configuration_errors: Optional[List[FieldValidationError]] = FieldInfo(alias="configurationErrors", default=None) + + description_error: Optional[str] = FieldInfo(alias="descriptionError", default=None) + + display_name_error: Optional[str] = FieldInfo(alias="displayNameError", default=None) + + valid: Optional[bool] = None diff --git a/src/gitpod/types/runners/field_validation_error.py b/src/gitpod/types/runners/field_validation_error.py new file mode 100644 index 00000000..6db05ceb --- /dev/null +++ b/src/gitpod/types/runners/field_validation_error.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["FieldValidationError"] + + +class FieldValidationError(BaseModel): + error: Optional[str] = None + + key: Optional[str] = None diff --git a/src/gitpod/types/runners/policy_create_params.py b/src/gitpod/types/runners/policy_create_params.py index c79c1ef7..53916272 100644 --- a/src/gitpod/types/runners/policy_create_params.py +++ b/src/gitpod/types/runners/policy_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from .runner_role import RunnerRole __all__ = ["PolicyCreateParams"] @@ -13,7 +14,7 @@ class PolicyCreateParams(TypedDict, total=False): group_id: Annotated[str, PropertyInfo(alias="groupId")] """group_id specifies the group_id identifier""" - role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] + role: RunnerRole runner_id: Annotated[str, PropertyInfo(alias="runnerId")] """runner_id specifies the project identifier""" diff --git a/src/gitpod/types/runners/policy_create_response.py b/src/gitpod/types/runners/policy_create_response.py index 5ab2ef21..0520b58e 100644 --- a/src/gitpod/types/runners/policy_create_response.py +++ b/src/gitpod/types/runners/policy_create_response.py @@ -1,21 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo from ..._models import BaseModel +from .runner_policy import RunnerPolicy -__all__ = ["PolicyCreateResponse", "Policy"] - - -class Policy(BaseModel): - group_id: Optional[str] = FieldInfo(alias="groupId", default=None) - - role: Optional[Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"]] = None - """role is the role assigned to the group""" +__all__ = ["PolicyCreateResponse"] class PolicyCreateResponse(BaseModel): - policy: Optional[Policy] = None + policy: Optional[RunnerPolicy] = None diff --git a/src/gitpod/types/runners/policy_update_params.py b/src/gitpod/types/runners/policy_update_params.py index 9f44d6bb..71066d20 100644 --- a/src/gitpod/types/runners/policy_update_params.py +++ b/src/gitpod/types/runners/policy_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from .runner_role import RunnerRole __all__ = ["PolicyUpdateParams"] @@ -13,7 +14,7 @@ class PolicyUpdateParams(TypedDict, total=False): group_id: Annotated[str, PropertyInfo(alias="groupId")] """group_id specifies the group_id identifier""" - role: Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] + role: RunnerRole runner_id: Annotated[str, PropertyInfo(alias="runnerId")] """runner_id specifies the project identifier""" diff --git a/src/gitpod/types/runners/policy_update_response.py b/src/gitpod/types/runners/policy_update_response.py index 15e39185..b5c96d6b 100644 --- a/src/gitpod/types/runners/policy_update_response.py +++ b/src/gitpod/types/runners/policy_update_response.py @@ -1,21 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo from ..._models import BaseModel +from .runner_policy import RunnerPolicy -__all__ = ["PolicyUpdateResponse", "Policy"] - - -class Policy(BaseModel): - group_id: Optional[str] = FieldInfo(alias="groupId", default=None) - - role: Optional[Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"]] = None - """role is the role assigned to the group""" +__all__ = ["PolicyUpdateResponse"] class PolicyUpdateResponse(BaseModel): - policy: Optional[Policy] = None + policy: Optional[RunnerPolicy] = None diff --git a/src/gitpod/types/projects/policy_list_response.py b/src/gitpod/types/runners/runner_policy.py similarity index 59% rename from src/gitpod/types/projects/policy_list_response.py rename to src/gitpod/types/runners/runner_policy.py index 12ef5fd0..c107db4e 100644 --- a/src/gitpod/types/projects/policy_list_response.py +++ b/src/gitpod/types/runners/runner_policy.py @@ -1,17 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel +from .runner_role import RunnerRole -__all__ = ["PolicyListResponse"] +__all__ = ["RunnerPolicy"] -class PolicyListResponse(BaseModel): +class RunnerPolicy(BaseModel): group_id: Optional[str] = FieldInfo(alias="groupId", default=None) - role: Optional[Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"]] = None + role: Optional[RunnerRole] = None """role is the role assigned to the group""" diff --git a/src/gitpod/types/runners/runner_role.py b/src/gitpod/types/runners/runner_role.py new file mode 100644 index 00000000..b4e95a1a --- /dev/null +++ b/src/gitpod/types/runners/runner_role.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["RunnerRole"] + +RunnerRole: TypeAlias = Literal["RUNNER_ROLE_UNSPECIFIED", "RUNNER_ROLE_ADMIN", "RUNNER_ROLE_USER"] diff --git a/src/gitpod/types/runners/scm_integration_validation_result.py b/src/gitpod/types/runners/scm_integration_validation_result.py new file mode 100644 index 00000000..3a99c80a --- /dev/null +++ b/src/gitpod/types/runners/scm_integration_validation_result.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["ScmIntegrationValidationResult"] + + +class ScmIntegrationValidationResult(BaseModel): + host_error: Optional[str] = FieldInfo(alias="hostError", default=None) + + oauth_error: Optional[str] = FieldInfo(alias="oauthError", default=None) + + pat_error: Optional[str] = FieldInfo(alias="patError", default=None) + + scm_id_error: Optional[str] = FieldInfo(alias="scmIdError", default=None) + + valid: Optional[bool] = None diff --git a/src/gitpod/types/scope.py b/src/gitpod/types/scope.py new file mode 100644 index 00000000..0f1bd71b --- /dev/null +++ b/src/gitpod/types/scope.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["Scope"] + +Scope: TypeAlias = Literal["SCOPE_UNSPECIFIED", "SCOPE_MEMBER", "SCOPE_ALL"] diff --git a/src/gitpod/types/secret.py b/src/gitpod/types/secret.py new file mode 100644 index 00000000..13e91d3a --- /dev/null +++ b/src/gitpod/types/secret.py @@ -0,0 +1,217 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject + +__all__ = ["Secret"] + + +class Secret(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[Subject] = None + """creator is the identity of the creator of the secret""" + + environment_variable: Optional[bool] = FieldInfo(alias="environmentVariable", default=None) + """ + secret will be created as an Environment Variable with the same name as the + secret + """ + + file_path: Optional[str] = FieldInfo(alias="filePath", default=None) + """absolute path to the file where the secret is mounted""" + + name: Optional[str] = None + """Name of the secret for humans.""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """The Project ID this Secret belongs to""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index b11ca479..99447e01 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -2,36 +2,21 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = [ - "SecretCreateParams", - "SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", - "AbsolutePathToTheFileWhereTheSecretIsMounted", -] +__all__ = ["SecretCreateParams"] -class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(TypedDict, total=False): - environment_variable: Required[Annotated[bool, PropertyInfo(alias="environmentVariable")]] +class SecretCreateParams(TypedDict, total=False): + environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] """ secret will be created as an Environment Variable with the same name as the secret """ - name: str - - project_id: Annotated[str, PropertyInfo(alias="projectId")] - """project_id is the ProjectID this Secret belongs to""" - - value: str - """value is the plaintext value of the secret""" - - -class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): - file_path: Required[Annotated[str, PropertyInfo(alias="filePath")]] + file_path: Annotated[str, PropertyInfo(alias="filePath")] """ absolute path to the file where the secret is mounted value must be an absolute path (start with a /): @@ -48,8 +33,3 @@ class AbsolutePathToTheFileWhereTheSecretIsMounted(TypedDict, total=False): value: str """value is the plaintext value of the secret""" - - -SecretCreateParams: TypeAlias = Union[ - SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, AbsolutePathToTheFileWhereTheSecretIsMounted -] diff --git a/src/gitpod/types/secret_create_response.py b/src/gitpod/types/secret_create_response.py index 53a103b2..bf7c768f 100644 --- a/src/gitpod/types/secret_create_response.py +++ b/src/gitpod/types/secret_create_response.py @@ -1,37 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional -from typing_extensions import TypeAlias - -from pydantic import Field as FieldInfo +from typing import Optional +from .secret import Secret from .._models import BaseModel -__all__ = [ - "SecretCreateResponse", - "Secret", - "SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", - "SecretAbsolutePathToTheFileWhereTheSecretIsMounted", -] - - -class SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): - environment_variable: bool = FieldInfo(alias="environmentVariable") - """ - secret will be created as an Environment Variable with the same name as the - secret - """ - - -class SecretAbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): - file_path: str = FieldInfo(alias="filePath") - """absolute path to the file where the secret is mounted""" - - -Secret: TypeAlias = Union[ - SecretSecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, - SecretAbsolutePathToTheFileWhereTheSecretIsMounted, -] +__all__ = ["SecretCreateResponse"] class SecretCreateResponse(BaseModel): diff --git a/src/gitpod/types/secret_list_response.py b/src/gitpod/types/secret_list_response.py deleted file mode 100644 index ab945270..00000000 --- a/src/gitpod/types/secret_list_response.py +++ /dev/null @@ -1,459 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = [ - "SecretListResponse", - "SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret", - "SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator", - "AbsolutePathToTheFileWhereTheSecretIsMounted", - "AbsolutePathToTheFileWhereTheSecretIsMountedCreator", -] - - -class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret(BaseModel): - environment_variable: bool = FieldInfo(alias="environmentVariable") - """ - secret will be created as an Environment Variable with the same name as the - secret - """ - - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecretCreator] = None - """creator is the identity of the creator of the secret""" - - name: Optional[str] = None - """Name of the secret for humans.""" - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """The Project ID this Secret belongs to""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -class AbsolutePathToTheFileWhereTheSecretIsMountedCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class AbsolutePathToTheFileWhereTheSecretIsMounted(BaseModel): - file_path: str = FieldInfo(alias="filePath") - """absolute path to the file where the secret is mounted""" - - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[AbsolutePathToTheFileWhereTheSecretIsMountedCreator] = None - """creator is the identity of the creator of the secret""" - - name: Optional[str] = None - """Name of the secret for humans.""" - - project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """The Project ID this Secret belongs to""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - -SecretListResponse: TypeAlias = Union[ - SecretWillBeCreatedAsAnEnvironmentVariableWithTheSameNameAsTheSecret, AbsolutePathToTheFileWhereTheSecretIsMounted -] diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py new file mode 100644 index 00000000..4911a8a7 --- /dev/null +++ b/src/gitpod/types/shared/__init__.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .runs_on import RunsOn as RunsOn +from .subject import Subject as Subject +from .principal import Principal as Principal +from .field_value import FieldValue as FieldValue +from .user_status import UserStatus as UserStatus +from .task_execution import TaskExecution as TaskExecution +from .environment_class import EnvironmentClass as EnvironmentClass +from .organization_role import OrganizationRole as OrganizationRole +from .automation_trigger import AutomationTrigger as AutomationTrigger +from .task_execution_spec import TaskExecutionSpec as TaskExecutionSpec +from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase +from .task_execution_status import TaskExecutionStatus as TaskExecutionStatus +from .task_execution_metadata import TaskExecutionMetadata as TaskExecutionMetadata diff --git a/src/gitpod/types/shared/automation_trigger.py b/src/gitpod/types/shared/automation_trigger.py new file mode 100644 index 00000000..2b5eba3c --- /dev/null +++ b/src/gitpod/types/shared/automation_trigger.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["AutomationTrigger"] + + +class AutomationTrigger(BaseModel): + manual: Optional[bool] = None + + post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) + + post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) diff --git a/src/gitpod/types/environments/class_list_response.py b/src/gitpod/types/shared/environment_class.py similarity index 80% rename from src/gitpod/types/environments/class_list_response.py rename to src/gitpod/types/shared/environment_class.py index 59606af6..24f66bb6 100644 --- a/src/gitpod/types/environments/class_list_response.py +++ b/src/gitpod/types/shared/environment_class.py @@ -5,21 +5,16 @@ from pydantic import Field as FieldInfo from ..._models import BaseModel +from .field_value import FieldValue -__all__ = ["ClassListResponse", "Configuration"] +__all__ = ["EnvironmentClass"] -class Configuration(BaseModel): - key: Optional[str] = None - - value: Optional[str] = None - - -class ClassListResponse(BaseModel): +class EnvironmentClass(BaseModel): id: Optional[str] = None """id is the unique identifier of the environment class""" - configuration: Optional[List[Configuration]] = None + configuration: Optional[List[FieldValue]] = None """configuration describes the configuration of the environment class""" description: Optional[str] = None diff --git a/src/gitpod/types/shared/field_value.py b/src/gitpod/types/shared/field_value.py new file mode 100644 index 00000000..90a90192 --- /dev/null +++ b/src/gitpod/types/shared/field_value.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["FieldValue"] + + +class FieldValue(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None diff --git a/src/gitpod/types/shared/organization_role.py b/src/gitpod/types/shared/organization_role.py new file mode 100644 index 00000000..202e7a39 --- /dev/null +++ b/src/gitpod/types/shared/organization_role.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["OrganizationRole"] + +OrganizationRole: TypeAlias = Literal[ + "ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER" +] diff --git a/src/gitpod/types/shared/principal.py b/src/gitpod/types/shared/principal.py new file mode 100644 index 00000000..bd0a3b97 --- /dev/null +++ b/src/gitpod/types/shared/principal.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["Principal"] + +Principal: TypeAlias = Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", +] diff --git a/src/gitpod/types/shared/runs_on.py b/src/gitpod/types/shared/runs_on.py new file mode 100644 index 00000000..7702279d --- /dev/null +++ b/src/gitpod/types/shared/runs_on.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["RunsOn", "Docker"] + + +class Docker(BaseModel): + environment: Optional[List[str]] = None + + image: Optional[str] = None + + +class RunsOn(BaseModel): + docker: Docker diff --git a/src/gitpod/types/shared/subject.py b/src/gitpod/types/shared/subject.py new file mode 100644 index 00000000..88a258cc --- /dev/null +++ b/src/gitpod/types/shared/subject.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .principal import Principal + +__all__ = ["Subject"] + + +class Subject(BaseModel): + id: Optional[str] = None + """id is the UUID of the subject""" + + principal: Optional[Principal] = None + """Principal is the principal of the subject""" diff --git a/src/gitpod/types/shared/task_execution.py b/src/gitpod/types/shared/task_execution.py new file mode 100644 index 00000000..072f66cb --- /dev/null +++ b/src/gitpod/types/shared/task_execution.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .task_execution_spec import TaskExecutionSpec +from .task_execution_status import TaskExecutionStatus +from .task_execution_metadata import TaskExecutionMetadata + +__all__ = ["TaskExecution"] + + +class TaskExecution(BaseModel): + id: Optional[str] = None + + metadata: Optional[TaskExecutionMetadata] = None + + spec: Optional[TaskExecutionSpec] = None + + status: Optional[TaskExecutionStatus] = None diff --git a/src/gitpod/types/runner_list_response.py b/src/gitpod/types/shared/task_execution_metadata.py similarity index 72% rename from src/gitpod/types/runner_list_response.py rename to src/gitpod/types/shared/task_execution_metadata.py index a3029d6f..b0e28c96 100644 --- a/src/gitpod/types/runner_list_response.py +++ b/src/gitpod/types/shared/task_execution_metadata.py @@ -1,113 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime -from typing_extensions import Literal from pydantic import Field as FieldInfo -from .._models import BaseModel +from .subject import Subject +from ..._models import BaseModel -__all__ = ["RunnerListResponse", "Creator", "Spec", "SpecConfiguration", "Status", "StatusAdditionalInfo"] +__all__ = ["TaskExecutionMetadata"] -class Creator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class SpecConfiguration(BaseModel): - auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) - """auto_update indicates whether the runner should automatically update itself.""" - - region: Optional[str] = None - """ - Region to deploy the runner in, if applicable. This is mainly used for remote - runners, and is only a hint. The runner may be deployed in a different region. - See the runner's status for the actual region. - """ - - release_channel: Optional[ - Literal["RUNNER_RELEASE_CHANNEL_UNSPECIFIED", "RUNNER_RELEASE_CHANNEL_STABLE", "RUNNER_RELEASE_CHANNEL_LATEST"] - ] = FieldInfo(alias="releaseChannel", default=None) - """The release channel the runner is on""" - - -class Spec(BaseModel): - configuration: Optional[SpecConfiguration] = None - """The runner's configuration""" - - desired_phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = FieldInfo(alias="desiredPhase", default=None) - """RunnerPhase represents the phase a runner is in""" - - -class StatusAdditionalInfo(BaseModel): - key: Optional[str] = None - - value: Optional[str] = None - - -class Status(BaseModel): - additional_info: Optional[List[StatusAdditionalInfo]] = FieldInfo(alias="additionalInfo", default=None) - """additional_info contains additional information about the runner, e.g. - - a CloudFormation stack URL. - """ - - capabilities: Optional[ - List[Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"]] - ] = None - """capabilities is a list of capabilities the runner supports.""" - - log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) - - message: Optional[str] = None - """ - The runner's reported message which is shown to users. This message adds more - context to the runner's phase. - """ - - phase: Optional[ - Literal[ - "RUNNER_PHASE_UNSPECIFIED", - "RUNNER_PHASE_CREATED", - "RUNNER_PHASE_INACTIVE", - "RUNNER_PHASE_ACTIVE", - "RUNNER_PHASE_DELETING", - "RUNNER_PHASE_DELETED", - "RUNNER_PHASE_DEGRADED", - ] - ] = None - """RunnerPhase represents the phase a runner is in""" - - region: Optional[str] = None - """region is the region the runner is running in, if applicable.""" - - system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) +class TaskExecutionMetadata(BaseModel): + completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -199,10 +104,6 @@ class Status(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - version: Optional[str] = None - - -class RunnerListResponse(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local @@ -295,40 +196,13 @@ class RunnerListResponse(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[Creator] = None - """creator is the identity of the creator of the environment""" - - kind: Optional[ - Literal["RUNNER_KIND_UNSPECIFIED", "RUNNER_KIND_LOCAL", "RUNNER_KIND_REMOTE", "RUNNER_KIND_LOCAL_CONFIGURATION"] - ] = None - """RunnerKind represents the kind of a runner""" - - name: Optional[str] = None - """The runner's name which is shown to users""" - - provider: Optional[ - Literal[ - "RUNNER_PROVIDER_UNSPECIFIED", - "RUNNER_PROVIDER_AWS_EC2", - "RUNNER_PROVIDER_LINUX_HOST", - "RUNNER_PROVIDER_DESKTOP_MAC", - ] - ] = None - """ - RunnerProvider identifies the specific implementation type of a runner. Each - provider maps to a specific kind of runner (local or remote), as specified below - for each provider. - """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + creator: Optional[Subject] = None + """creator describes the principal who created/started the task run.""" - spec: Optional[Spec] = None - """The runner's specification""" + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """environment_id is the ID of the environment in which the task run is executed.""" - status: Optional[Status] = None - """RunnerStatus represents the status of a runner""" - - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -419,3 +293,9 @@ class RunnerListResponse(BaseModel): [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. """ + + started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) + """started_by describes the trigger that started the task execution.""" + + task_id: Optional[str] = FieldInfo(alias="taskId", default=None) + """task_id is the ID of the main task being executed.""" diff --git a/src/gitpod/types/shared/task_execution_phase.py b/src/gitpod/types/shared/task_execution_phase.py new file mode 100644 index 00000000..84b6f317 --- /dev/null +++ b/src/gitpod/types/shared/task_execution_phase.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["TaskExecutionPhase"] + +TaskExecutionPhase: TypeAlias = Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", +] diff --git a/src/gitpod/types/shared/task_execution_spec.py b/src/gitpod/types/shared/task_execution_spec.py new file mode 100644 index 00000000..923f5f6d --- /dev/null +++ b/src/gitpod/types/shared/task_execution_spec.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .task_execution_phase import TaskExecutionPhase +from ..environments.automations.task_spec import TaskSpec + +__all__ = ["TaskExecutionSpec", "Plan", "PlanStep", "PlanStepTask"] + + +class PlanStepTask(BaseModel): + id: Optional[str] = None + + spec: Optional[TaskSpec] = None + + +class PlanStep(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) + + label: Optional[str] = None + + service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) + + task: Optional[PlanStepTask] = None + + +class Plan(BaseModel): + steps: Optional[List[PlanStep]] = None + + +class TaskExecutionSpec(BaseModel): + desired_phase: Optional[TaskExecutionPhase] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the phase the task execution should be in. + + Used to stop a running task execution early. + """ + + plan: Optional[List[Plan]] = None + """plan is a list of groups of steps. + + The steps in a group are executed concurrently, while the groups are executed + sequentially. The order of the groups is the order in which they are executed. + """ diff --git a/src/gitpod/types/shared/task_execution_status.py b/src/gitpod/types/shared/task_execution_status.py new file mode 100644 index 00000000..b5ab03a0 --- /dev/null +++ b/src/gitpod/types/shared/task_execution_status.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .task_execution_phase import TaskExecutionPhase + +__all__ = ["TaskExecutionStatus", "Step"] + + +class Step(BaseModel): + id: Optional[str] = None + """ID is the ID of the execution step""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the step failed to operate. + + If this is non-empty the step has failed to operate and will likely transition + to a failed state. + """ + + phase: Optional[TaskExecutionPhase] = None + """phase is the current phase of the execution step""" + + +class TaskExecutionStatus(BaseModel): + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message summarises why the task execution failed to operate. + + If this is non-empty the task execution has failed to operate and will likely + transition to a failed state. + """ + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """log_url is the URL to the logs of the task's steps. + + If this is empty, the task either has no logs or has not yet started. + """ + + phase: Optional[TaskExecutionPhase] = None + """the phase of a task execution represents the aggregated phase of all steps.""" + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """version of the status update. + + Task executions themselves are unversioned, but their status has different + versions. The value of this field has no semantic meaning (e.g. don't interpret + it as as a timestamp), but it can be used to impose a partial order. If + a.status_version < b.status_version then a was the status before b. + """ + + steps: Optional[List[Step]] = None + """steps provides the status for each individual step of the task execution. + + If a step is missing it has not yet started. + """ diff --git a/src/gitpod/types/shared/user_status.py b/src/gitpod/types/shared/user_status.py new file mode 100644 index 00000000..d13e58c7 --- /dev/null +++ b/src/gitpod/types/shared/user_status.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["UserStatus"] + +UserStatus: TypeAlias = Literal[ + "USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT" +] diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py new file mode 100644 index 00000000..d98911f7 --- /dev/null +++ b/src/gitpod/types/shared_params/__init__.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .runs_on import RunsOn as RunsOn +from .subject import Subject as Subject +from .principal import Principal as Principal +from .field_value import FieldValue as FieldValue +from .environment_class import EnvironmentClass as EnvironmentClass +from .organization_role import OrganizationRole as OrganizationRole +from .automation_trigger import AutomationTrigger as AutomationTrigger +from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase diff --git a/src/gitpod/types/shared_params/automation_trigger.py b/src/gitpod/types/shared_params/automation_trigger.py new file mode 100644 index 00000000..173dff4c --- /dev/null +++ b/src/gitpod/types/shared_params/automation_trigger.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["AutomationTrigger"] + + +class AutomationTrigger(TypedDict, total=False): + manual: bool + + post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] + + post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] diff --git a/src/gitpod/types/shared_params/environment_class.py b/src/gitpod/types/shared_params/environment_class.py new file mode 100644 index 00000000..17e43a43 --- /dev/null +++ b/src/gitpod/types/shared_params/environment_class.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from .field_value import FieldValue + +__all__ = ["EnvironmentClass"] + + +class EnvironmentClass(TypedDict, total=False): + id: str + """id is the unique identifier of the environment class""" + + configuration: Iterable[FieldValue] + """configuration describes the configuration of the environment class""" + + description: str + """description is a human readable description of the environment class""" + + display_name: Annotated[str, PropertyInfo(alias="displayName")] + """display_name is the human readable name of the environment class""" + + enabled: bool + """ + enabled indicates whether the environment class can be used to create new + environments. + """ + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ diff --git a/src/gitpod/types/shared_params/field_value.py b/src/gitpod/types/shared_params/field_value.py new file mode 100644 index 00000000..05f28c14 --- /dev/null +++ b/src/gitpod/types/shared_params/field_value.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["FieldValue"] + + +class FieldValue(TypedDict, total=False): + key: str + + value: str diff --git a/src/gitpod/types/shared_params/organization_role.py b/src/gitpod/types/shared_params/organization_role.py new file mode 100644 index 00000000..1c3d4f1c --- /dev/null +++ b/src/gitpod/types/shared_params/organization_role.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypeAlias + +__all__ = ["OrganizationRole"] + +OrganizationRole: TypeAlias = Literal[ + "ORGANIZATION_ROLE_UNSPECIFIED", "ORGANIZATION_ROLE_ADMIN", "ORGANIZATION_ROLE_MEMBER" +] diff --git a/src/gitpod/types/shared_params/principal.py b/src/gitpod/types/shared_params/principal.py new file mode 100644 index 00000000..1f2e22eb --- /dev/null +++ b/src/gitpod/types/shared_params/principal.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypeAlias + +__all__ = ["Principal"] + +Principal: TypeAlias = Literal[ + "PRINCIPAL_UNSPECIFIED", + "PRINCIPAL_ACCOUNT", + "PRINCIPAL_USER", + "PRINCIPAL_RUNNER", + "PRINCIPAL_ENVIRONMENT", + "PRINCIPAL_SERVICE_ACCOUNT", +] diff --git a/src/gitpod/types/shared_params/runs_on.py b/src/gitpod/types/shared_params/runs_on.py new file mode 100644 index 00000000..55a079f3 --- /dev/null +++ b/src/gitpod/types/shared_params/runs_on.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +__all__ = ["RunsOn", "Docker"] + + +class Docker(TypedDict, total=False): + environment: List[str] + + image: str + + +class RunsOn(TypedDict, total=False): + docker: Required[Docker] diff --git a/src/gitpod/types/shared_params/subject.py b/src/gitpod/types/shared_params/subject.py new file mode 100644 index 00000000..1c1293bb --- /dev/null +++ b/src/gitpod/types/shared_params/subject.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from ..shared.principal import Principal + +__all__ = ["Subject"] + + +class Subject(TypedDict, total=False): + id: str + """id is the UUID of the subject""" + + principal: Principal + """Principal is the principal of the subject""" diff --git a/src/gitpod/types/shared_params/task_execution_phase.py b/src/gitpod/types/shared_params/task_execution_phase.py new file mode 100644 index 00000000..60b1bc39 --- /dev/null +++ b/src/gitpod/types/shared_params/task_execution_phase.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypeAlias + +__all__ = ["TaskExecutionPhase"] + +TaskExecutionPhase: TypeAlias = Literal[ + "TASK_EXECUTION_PHASE_UNSPECIFIED", + "TASK_EXECUTION_PHASE_PENDING", + "TASK_EXECUTION_PHASE_RUNNING", + "TASK_EXECUTION_PHASE_SUCCEEDED", + "TASK_EXECUTION_PHASE_FAILED", + "TASK_EXECUTION_PHASE_STOPPED", +] diff --git a/src/gitpod/types/user.py b/src/gitpod/types/user.py new file mode 100644 index 00000000..47c3be90 --- /dev/null +++ b/src/gitpod/types/user.py @@ -0,0 +1,123 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.user_status import UserStatus + +__all__ = ["User"] + + +class User(BaseModel): + id: Optional[str] = None + """id is a UUID of the user""" + + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + """avatar_url is a link to the user avatar""" + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + name: Optional[str] = None + """name is the full name of the user""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the id of the organization this account is owned by. + + +optional if not set, this account is owned by the installation. + """ + + status: Optional[UserStatus] = None + """status is the status the user is in""" diff --git a/src/gitpod/types/user_get_authenticated_user_response.py b/src/gitpod/types/user_get_authenticated_user_response.py index 5dc0b4f0..7760c4ab 100644 --- a/src/gitpod/types/user_get_authenticated_user_response.py +++ b/src/gitpod/types/user_get_authenticated_user_response.py @@ -1,128 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo +from .user import User from .._models import BaseModel -__all__ = ["UserGetAuthenticatedUserResponse", "User"] - - -class User(BaseModel): - id: Optional[str] = None - """id is a UUID of the user""" - - avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) - """avatar_url is a link to the user avatar""" - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - name: Optional[str] = None - """name is the full name of the user""" - - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """organization_id is the id of the organization this account is owned by. - - +optional if not set, this account is owned by the installation. - """ - - status: Optional[ - Literal["USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT"] - ] = None - """status is the status the user is in""" +__all__ = ["UserGetAuthenticatedUserResponse"] class UserGetAuthenticatedUserResponse(BaseModel): diff --git a/src/gitpod/types/users/__init__.py b/src/gitpod/types/users/__init__.py index c5d40ad2..b54651e0 100644 --- a/src/gitpod/types/users/__init__.py +++ b/src/gitpod/types/users/__init__.py @@ -6,4 +6,4 @@ from .pat_list_params import PatListParams as PatListParams from .pat_get_response import PatGetResponse as PatGetResponse from .pat_delete_params import PatDeleteParams as PatDeleteParams -from .pat_list_response import PatListResponse as PatListResponse +from .personal_access_token import PersonalAccessToken as PersonalAccessToken diff --git a/src/gitpod/types/users/pat_get_response.py b/src/gitpod/types/users/pat_get_response.py index 8616d1a2..6be85d53 100644 --- a/src/gitpod/types/users/pat_get_response.py +++ b/src/gitpod/types/users/pat_get_response.py @@ -1,318 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo from ..._models import BaseModel +from .personal_access_token import PersonalAccessToken -__all__ = ["PatGetResponse", "Pat", "PatCreator"] - - -class PatCreator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class Pat(BaseModel): - id: Optional[str] = None - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - creator: Optional[PatCreator] = None - - description: Optional[str] = None - - expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - last_used: Optional[datetime] = FieldInfo(alias="lastUsed", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ - - user_id: Optional[str] = FieldInfo(alias="userId", default=None) +__all__ = ["PatGetResponse"] class PatGetResponse(BaseModel): - pat: Optional[Pat] = None + pat: Optional[PersonalAccessToken] = None diff --git a/src/gitpod/types/users/pat_list_response.py b/src/gitpod/types/users/personal_access_token.py similarity index 95% rename from src/gitpod/types/users/pat_list_response.py rename to src/gitpod/types/users/personal_access_token.py index ec1e95ba..c094c3c7 100644 --- a/src/gitpod/types/users/pat_list_response.py +++ b/src/gitpod/types/users/personal_access_token.py @@ -2,33 +2,16 @@ from typing import Optional from datetime import datetime -from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel +from ..shared.subject import Subject -__all__ = ["PatListResponse", "Creator"] +__all__ = ["PersonalAccessToken"] -class Creator(BaseModel): - id: Optional[str] = None - """id is the UUID of the subject""" - - principal: Optional[ - Literal[ - "PRINCIPAL_UNSPECIFIED", - "PRINCIPAL_ACCOUNT", - "PRINCIPAL_USER", - "PRINCIPAL_RUNNER", - "PRINCIPAL_ENVIRONMENT", - "PRINCIPAL_SERVICE_ACCOUNT", - ] - ] = None - """Principal is the principal of the subject""" - - -class PatListResponse(BaseModel): +class PersonalAccessToken(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) @@ -123,7 +106,7 @@ class PatListResponse(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - creator: Optional[Creator] = None + creator: Optional[Subject] = None description: Optional[str] = None diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index 136a0117..45ce2266 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -10,8 +10,8 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.pagination import SyncTaskExecutionsPage, AsyncTaskExecutionsPage +from gitpod.types.shared import TaskExecution from gitpod.types.environments.automations.tasks import ( - ExecutionListResponse, ExecutionRetrieveResponse, ) @@ -61,7 +61,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list() - assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) @pytest.mark.skip() @parametrize @@ -80,7 +80,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) @pytest.mark.skip() @parametrize @@ -90,7 +90,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) assert cast(Any, response.is_closed) is True @@ -186,7 +186,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list() - assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) @pytest.mark.skip() @parametrize @@ -205,7 +205,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) @pytest.mark.skip() @parametrize @@ -215,7 +215,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) @pytest.mark.skip() @parametrize @@ -225,7 +225,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"]) + assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index f6a1893c..9c90a24c 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -12,7 +12,7 @@ from gitpod._utils import parse_datetime from gitpod.pagination import SyncServicesPage, AsyncServicesPage from gitpod.types.environments.automations import ( - ServiceListResponse, + Service, ServiceCreateResponse, ServiceRetrieveResponse, ) @@ -43,7 +43,13 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{"manual": True}], + "triggered_by": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ], }, spec={ "commands": { @@ -133,9 +139,38 @@ def test_method_update(self, client: Gitpod) -> None: def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={"description": "description"}, - spec={"commands": {"ready": "ready"}}, - status={"failure_message": "failureMessage"}, + metadata={ + "description": "description", + "name": "x", + "triggered_by": { + "trigger": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ] + }, + }, + spec={ + "commands": { + "ready": "ready", + "start": "start", + "stop": "stop", + }, + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, + }, + status={ + "failure_message": "failureMessage", + "log_url": "logUrl", + "phase": "SERVICE_PHASE_UNSPECIFIED", + "session": "session", + }, ) assert_matches_type(object, service, path=["response"]) @@ -165,7 +200,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: service = client.environments.automations.services.list() - assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(SyncServicesPage[Service], service, path=["response"]) @pytest.mark.skip() @parametrize @@ -183,7 +218,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(SyncServicesPage[Service], service, path=["response"]) @pytest.mark.skip() @parametrize @@ -193,7 +228,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = response.parse() - assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(SyncServicesPage[Service], service, path=["response"]) @pytest.mark.skip() @parametrize @@ -203,7 +238,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = response.parse() - assert_matches_type(SyncServicesPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(SyncServicesPage[Service], service, path=["response"]) assert cast(Any, response.is_closed) is True @@ -340,7 +375,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{"manual": True}], + "triggered_by": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ], }, spec={ "commands": { @@ -430,9 +471,38 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - metadata={"description": "description"}, - spec={"commands": {"ready": "ready"}}, - status={"failure_message": "failureMessage"}, + metadata={ + "description": "description", + "name": "x", + "triggered_by": { + "trigger": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ] + }, + }, + spec={ + "commands": { + "ready": "ready", + "start": "start", + "stop": "stop", + }, + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, + }, + status={ + "failure_message": "failureMessage", + "log_url": "logUrl", + "phase": "SERVICE_PHASE_UNSPECIFIED", + "session": "session", + }, ) assert_matches_type(object, service, path=["response"]) @@ -462,7 +532,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list() - assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) @pytest.mark.skip() @parametrize @@ -480,7 +550,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) @pytest.mark.skip() @parametrize @@ -490,7 +560,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = await response.parse() - assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) @pytest.mark.skip() @parametrize @@ -500,7 +570,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" service = await response.parse() - assert_matches_type(AsyncServicesPage[ServiceListResponse], service, path=["response"]) + assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 381d28f5..4cee7ae4 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -12,7 +12,7 @@ from gitpod._utils import parse_datetime from gitpod.pagination import SyncTasksPage, AsyncTasksPage from gitpod.types.environments.automations import ( - TaskListResponse, + Task, TaskStartResponse, TaskCreateResponse, TaskRetrieveResponse, @@ -45,7 +45,13 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{"manual": True}], + "triggered_by": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ], }, spec={ "command": "command", @@ -129,8 +135,28 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - metadata={"description": "description"}, - spec={"command": "command"}, + metadata={ + "description": "description", + "name": "x", + "triggered_by": { + "trigger": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ] + }, + }, + spec={ + "command": "command", + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, + }, ) assert_matches_type(object, task, path=["response"]) @@ -160,7 +186,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list() - assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + assert_matches_type(SyncTasksPage[Task], task, path=["response"]) @pytest.mark.skip() @parametrize @@ -178,7 +204,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + assert_matches_type(SyncTasksPage[Task], task, path=["response"]) @pytest.mark.skip() @parametrize @@ -188,7 +214,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = response.parse() - assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + assert_matches_type(SyncTasksPage[Task], task, path=["response"]) @pytest.mark.skip() @parametrize @@ -198,7 +224,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = response.parse() - assert_matches_type(SyncTasksPage[TaskListResponse], task, path=["response"]) + assert_matches_type(SyncTasksPage[Task], task, path=["response"]) assert cast(Any, response.is_closed) is True @@ -299,7 +325,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "description": "description", "name": "x", "reference": "reference", - "triggered_by": [{"manual": True}], + "triggered_by": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ], }, spec={ "command": "command", @@ -383,8 +415,28 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> task = await async_client.environments.automations.tasks.update( id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - metadata={"description": "description"}, - spec={"command": "command"}, + metadata={ + "description": "description", + "name": "x", + "triggered_by": { + "trigger": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + } + ] + }, + }, + spec={ + "command": "command", + "runs_on": { + "docker": { + "environment": ["string"], + "image": "x", + } + }, + }, ) assert_matches_type(object, task, path=["response"]) @@ -414,7 +466,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list() - assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) @pytest.mark.skip() @parametrize @@ -432,7 +484,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) @pytest.mark.skip() @parametrize @@ -442,7 +494,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = await response.parse() - assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) @pytest.mark.skip() @parametrize @@ -452,7 +504,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" task = await response.parse() - assert_matches_type(AsyncTasksPage[TaskListResponse], task, path=["response"]) + assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index 3b525f3e..f097f89b 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.pagination import SyncEnvironmentClassesPage, AsyncEnvironmentClassesPage -from gitpod.types.environments import ClassListResponse +from gitpod.types.shared import EnvironmentClass base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ class TestClasses: @parametrize def test_method_list(self, client: Gitpod) -> None: class_ = client.environments.classes.list() - assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) @pytest.mark.skip() @parametrize @@ -30,13 +30,16 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: class_ = client.environments.classes.list( token="token", page_size=0, - filter={"enabled": True}, + filter={ + "enabled": True, + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, pagination={ "token": "token", "page_size": 100, }, ) - assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) @pytest.mark.skip() @parametrize @@ -46,7 +49,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = response.parse() - assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +59,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = response.parse() - assert_matches_type(SyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -68,7 +71,7 @@ class TestAsyncClasses: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list() - assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) @pytest.mark.skip() @parametrize @@ -76,13 +79,16 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N class_ = await async_client.environments.classes.list( token="token", page_size=0, - filter={"enabled": True}, + filter={ + "enabled": True, + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, pagination={ "token": "token", "page_size": 100, }, ) - assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) @pytest.mark.skip() @parametrize @@ -92,7 +98,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = await response.parse() - assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) @pytest.mark.skip() @parametrize @@ -102,6 +108,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" class_ = await response.parse() - assert_matches_type(AsyncEnvironmentClassesPage[ClassListResponse], class_, path=["response"]) + assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 04d19db3..c8f45ade 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from gitpod.pagination import SyncSSOConfigurationsPage, AsyncSSOConfigurationsPage from gitpod.types.organizations import ( - SSOConfigurationListResponse, + SSOConfiguration, SSOConfigurationCreateResponse, SSOConfigurationRetrieveResponse, ) @@ -100,154 +100,28 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - client_id="x", - ) + def test_method_update(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.update() assert_matches_type(object, sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update( - client_id="x", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update( - client_id="x", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( + claims={"foo": "string"}, + client_id="x", client_secret="x", - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update( - client_secret="x", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update( - client_secret="x", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( email_domain="xxxx", - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update( - email_domain="xxxx", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update( - email_domain="xxxx", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_4(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( - issuer_url="https://example.com", - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_4(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update( issuer_url="https://example.com", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update( - issuer_url="https://example.com", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_5(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", ) assert_matches_type(object, sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_5(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - ) + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.organizations.sso_configurations.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -256,10 +130,8 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - ) as response: + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.organizations.sso_configurations.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -272,9 +144,7 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list() - assert_matches_type( - SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize @@ -288,9 +158,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type( - SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize @@ -300,9 +168,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = response.parse() - assert_matches_type( - SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize @@ -312,9 +178,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = response.parse() - assert_matches_type( - SyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) assert cast(Any, response.is_closed) is True @@ -436,154 +300,28 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - client_id="x", - ) + async def test_method_update(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.update() assert_matches_type(object, sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update( - client_id="x", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update( - client_id="x", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( + claims={"foo": "string"}, + client_id="x", client_secret="x", - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update( - client_secret="x", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update( - client_secret="x", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( email_domain="xxxx", - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update( - email_domain="xxxx", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update( - email_domain="xxxx", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( - issuer_url="https://example.com", - ) - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update( issuer_url="https://example.com", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update( - issuer_url="https://example.com", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - sso_configuration = await response.parse() - assert_matches_type(object, sso_configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", ) assert_matches_type(object, sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - ) + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.sso_configurations.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -592,10 +330,8 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update( - state="SSO_CONFIGURATION_STATE_UNSPECIFIED", - ) as response: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.sso_configurations.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -608,9 +344,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list() - assert_matches_type( - AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize @@ -624,9 +358,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type( - AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize @@ -636,9 +368,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = await response.parse() - assert_matches_type( - AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize @@ -648,9 +378,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sso_configuration = await response.parse() - assert_matches_type( - AsyncSSOConfigurationsPage[SSOConfigurationListResponse], sso_configuration, path=["response"] - ) + assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index c066dcbb..cf0a4f4f 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from gitpod.pagination import SyncPoliciesPage, AsyncPoliciesPage from gitpod.types.projects import ( - PolicyListResponse, + ProjectPolicy, PolicyCreateResponse, PolicyUpdateResponse, ) @@ -102,7 +102,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.projects.policies.list() - assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -116,7 +116,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -126,7 +126,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -136,7 +136,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -261,7 +261,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list() - assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -275,7 +275,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -285,7 +285,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -295,7 +295,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index d08bb882..de30bc15 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -10,8 +10,8 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.pagination import SyncEnvironmentClassesPage, AsyncEnvironmentClassesPage +from gitpod.types.shared import EnvironmentClass from gitpod.types.runners.configurations import ( - EnvironmentClassListResponse, EnvironmentClassCreateResponse, EnvironmentClassRetrieveResponse, ) @@ -104,86 +104,25 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.update( - description="xxx", - ) - assert_matches_type(object, environment_class, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runners.configurations.environment_classes.with_raw_response.update( - description="xxx", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = response.parse() + def test_method_update(self, client: Gitpod) -> None: + environment_class = client.runners.configurations.environment_classes.update() assert_matches_type(object, environment_class, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runners.configurations.environment_classes.with_streaming_response.update( - description="xxx", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_class = response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( + description="xxx", display_name="xxx", - ) - assert_matches_type(object, environment_class, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.runners.configurations.environment_classes.with_raw_response.update( - display_name="xxx", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.runners.configurations.environment_classes.with_streaming_response.update( - display_name="xxx", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_class = response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: - environment_class = client.runners.configurations.environment_classes.update( enabled=True, + environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(object, environment_class, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: - response = client.runners.configurations.environment_classes.with_raw_response.update( - enabled=True, - ) + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.runners.configurations.environment_classes.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -192,10 +131,8 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: - with client.runners.configurations.environment_classes.with_streaming_response.update( - enabled=True, - ) as response: + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.runners.configurations.environment_classes.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -208,9 +145,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list() - assert_matches_type( - SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) @pytest.mark.skip() @parametrize @@ -218,15 +153,16 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list( token="token", page_size=0, - filter={"enabled": True}, + filter={ + "enabled": True, + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, pagination={ "token": "token", "page_size": 100, }, ) - assert_matches_type( - SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) @pytest.mark.skip() @parametrize @@ -236,9 +172,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = response.parse() - assert_matches_type( - SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) @pytest.mark.skip() @parametrize @@ -248,9 +182,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = response.parse() - assert_matches_type( - SyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) assert cast(Any, response.is_closed) is True @@ -342,86 +274,25 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.update( - description="xxx", - ) - assert_matches_type(object, environment_class, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.environment_classes.with_raw_response.update( - description="xxx", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = await response.parse() + async def test_method_update(self, async_client: AsyncGitpod) -> None: + environment_class = await async_client.runners.configurations.environment_classes.update() assert_matches_type(object, environment_class, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.environment_classes.with_streaming_response.update( - description="xxx", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_class = await response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( + description="xxx", display_name="xxx", - ) - assert_matches_type(object, environment_class, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.environment_classes.with_raw_response.update( - display_name="xxx", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - environment_class = await response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.environment_classes.with_streaming_response.update( - display_name="xxx", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - environment_class = await response.parse() - assert_matches_type(object, environment_class, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: - environment_class = await async_client.runners.configurations.environment_classes.update( enabled=True, + environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(object, environment_class, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.environment_classes.with_raw_response.update( - enabled=True, - ) + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.environment_classes.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -430,10 +301,8 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.environment_classes.with_streaming_response.update( - enabled=True, - ) as response: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.environment_classes.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -446,9 +315,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list() - assert_matches_type( - AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) @pytest.mark.skip() @parametrize @@ -456,15 +323,16 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N environment_class = await async_client.runners.configurations.environment_classes.list( token="token", page_size=0, - filter={"enabled": True}, + filter={ + "enabled": True, + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, pagination={ "token": "token", "page_size": 100, }, ) - assert_matches_type( - AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) @pytest.mark.skip() @parametrize @@ -474,9 +342,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = await response.parse() - assert_matches_type( - AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) @pytest.mark.skip() @parametrize @@ -486,8 +352,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment_class = await response.parse() - assert_matches_type( - AsyncEnvironmentClassesPage[EnvironmentClassListResponse], environment_class, path=["response"] - ) + assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 1520b2ae..27694ae4 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -12,7 +12,7 @@ from gitpod._utils import parse_datetime from gitpod.pagination import SyncTokensPage, AsyncTokensPage from gitpod.types.runners.configurations import ( - HostAuthenticationTokenListResponse, + HostAuthenticationToken, HostAuthenticationTokenCreateResponse, HostAuthenticationTokenRetrieveResponse, ) @@ -103,86 +103,25 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - ) + def test_method_update(self, client: Gitpod) -> None: + host_authentication_token = client.runners.configurations.host_authentication_tokens.update() assert_matches_type(object, host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - refresh_token="refreshToken", - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( - refresh_token="refreshToken", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - refresh_token="refreshToken", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", token="x", + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + refresh_token="refreshToken", ) assert_matches_type(object, host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: - response = client.runners.configurations.host_authentication_tokens.with_raw_response.update( - token="x", - ) + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.runners.configurations.host_authentication_tokens.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -191,10 +130,8 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: - with client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - token="x", - ) as response: + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.runners.configurations.host_authentication_tokens.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -207,9 +144,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list() - assert_matches_type( - SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] - ) + assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -217,15 +152,16 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list( token="token", page_size=0, - filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + filter={ + "runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, pagination={ "token": "token", "page_size": 100, }, ) - assert_matches_type( - SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] - ) + assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -235,9 +171,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = response.parse() - assert_matches_type( - SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] - ) + assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -247,9 +181,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = response.parse() - assert_matches_type( - SyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] - ) + assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) assert cast(Any, response.is_closed) is True @@ -377,86 +309,25 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - ) + async def test_method_update(self, async_client: AsyncGitpod) -> None: + host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update() assert_matches_type(object, host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - refresh_token="refreshToken", - ) - assert_matches_type(object, host_authentication_token, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( - refresh_token="refreshToken", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - refresh_token="refreshToken", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - host_authentication_token = await response.parse() - assert_matches_type(object, host_authentication_token, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", token="x", + expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), + refresh_token="refreshToken", ) assert_matches_type(object, host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update( - token="x", - ) + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -465,9 +336,9 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update( - token="x", + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with ( + async_client.runners.configurations.host_authentication_tokens.with_streaming_response.update() ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -481,9 +352,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list() - assert_matches_type( - AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] - ) + assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -491,15 +360,16 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( token="token", page_size=0, - filter={"runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + filter={ + "runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, pagination={ "token": "token", "page_size": 100, }, ) - assert_matches_type( - AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] - ) + assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -509,9 +379,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = await response.parse() - assert_matches_type( - AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] - ) + assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -523,9 +391,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" host_authentication_token = await response.parse() - assert_matches_type( - AsyncTokensPage[HostAuthenticationTokenListResponse], host_authentication_token, path=["response"] - ) + assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index e827e39b..41ee4a5f 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from gitpod.pagination import SyncIntegrationsPage, AsyncIntegrationsPage from gitpod.types.runners.configurations import ( - ScmIntegrationListResponse, + ScmIntegration, ScmIntegrationCreateResponse, ScmIntegrationRetrieveResponse, ) @@ -24,52 +24,27 @@ class TestScmIntegrations: @pytest.mark.skip() @parametrize - def test_method_create_overload_1(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.create( - oauth_client_id="oauthClientId", - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_create_overload_1(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.create( - oauth_client_id="oauthClientId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = response.parse() + def test_method_create(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.create() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.create( - oauth_client_id="oauthClientId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_create_overload_2(self, client: Gitpod) -> None: + def test_method_create_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( + host="host", + oauth_client_id="oauthClientId", oauth_plaintext_client_secret="oauthPlaintextClientSecret", + pat=True, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + scm_id="scmId", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create_overload_2(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -78,10 +53,8 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) as response: + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -128,86 +101,25 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.update( - oauth_client_id="oauthClientId", - ) + def test_method_update(self, client: Gitpod) -> None: + scm_integration = client.runners.configurations.scm_integrations.update() assert_matches_type(object, scm_integration, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.update( - oauth_client_id="oauthClientId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.update( - oauth_client_id="oauthClientId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + oauth_client_id="oauthClientId", oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: - scm_integration = client.runners.configurations.scm_integrations.update( pat=True, ) assert_matches_type(object, scm_integration, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: - response = client.runners.configurations.scm_integrations.with_raw_response.update( - pat=True, - ) + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.runners.configurations.scm_integrations.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -216,10 +128,8 @@ def test_raw_response_update_overload_3(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: - with client.runners.configurations.scm_integrations.with_streaming_response.update( - pat=True, - ) as response: + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.runners.configurations.scm_integrations.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -232,7 +142,7 @@ def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list() - assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @pytest.mark.skip() @parametrize @@ -246,7 +156,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @pytest.mark.skip() @parametrize @@ -256,7 +166,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = response.parse() - assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @pytest.mark.skip() @parametrize @@ -266,7 +176,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = response.parse() - assert_matches_type(SyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) assert cast(Any, response.is_closed) is True @@ -312,52 +222,27 @@ class TestAsyncScmIntegrations: @pytest.mark.skip() @parametrize - async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.create( - oauth_client_id="oauthClientId", - ) - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( - oauth_client_id="oauthClientId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = await response.parse() + async def test_method_create(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.create() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( - oauth_client_id="oauthClientId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = await response.parse() - assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( + host="host", + oauth_client_id="oauthClientId", oauth_plaintext_client_secret="oauthPlaintextClientSecret", + pat=True, + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + scm_id="scmId", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -366,10 +251,8 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.create( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) as response: + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -416,86 +299,25 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.update( - oauth_client_id="oauthClientId", - ) + async def test_method_update(self, async_client: AsyncGitpod) -> None: + scm_integration = await async_client.runners.configurations.scm_integrations.update() assert_matches_type(object, scm_integration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( - oauth_client_id="oauthClientId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = await response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( - oauth_client_id="oauthClientId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = await response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + oauth_client_id="oauthClientId", oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) - assert_matches_type(object, scm_integration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scm_integration = await response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( - oauth_plaintext_client_secret="oauthPlaintextClientSecret", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scm_integration = await response.parse() - assert_matches_type(object, scm_integration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: - scm_integration = await async_client.runners.configurations.scm_integrations.update( pat=True, ) assert_matches_type(object, scm_integration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.scm_integrations.with_raw_response.update( - pat=True, - ) + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.scm_integrations.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -504,10 +326,8 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.scm_integrations.with_streaming_response.update( - pat=True, - ) as response: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.scm_integrations.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -520,7 +340,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list() - assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @pytest.mark.skip() @parametrize @@ -534,7 +354,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @pytest.mark.skip() @parametrize @@ -544,7 +364,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = await response.parse() - assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @pytest.mark.skip() @parametrize @@ -554,7 +374,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scm_integration = await response.parse() - assert_matches_type(AsyncIntegrationsPage[ScmIntegrationListResponse], scm_integration, path=["response"]) + assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 833058db..e917ea87 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -19,15 +19,13 @@ class TestConfigurations: @pytest.mark.skip() @parametrize - def test_method_validate_overload_1(self, client: Gitpod) -> None: - configuration = client.runners.configurations.validate( - environment_class={}, - ) + def test_method_validate(self, client: Gitpod) -> None: + configuration = client.runners.configurations.validate() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> None: + def test_method_validate_with_all_params(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( environment_class={ "id": "id", @@ -43,58 +41,22 @@ def test_method_validate_with_all_params_overload_1(self, client: Gitpod) -> Non "runner_id": "runnerId", }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + scm_integration={ + "id": "id", + "host": "host", + "oauth_client_id": "oauthClientId", + "oauth_encrypted_client_secret": "U3RhaW5sZXNzIHJvY2tz", + "oauth_plaintext_client_secret": "oauthPlaintextClientSecret", + "pat": True, + "scm_id": "scmId", + }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_validate_overload_1(self, client: Gitpod) -> None: - response = client.runners.configurations.with_raw_response.validate( - environment_class={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration = response.parse() - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_validate_overload_1(self, client: Gitpod) -> None: - with client.runners.configurations.with_streaming_response.validate( - environment_class={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration = response.parse() - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_validate_overload_2(self, client: Gitpod) -> None: - configuration = client.runners.configurations.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, - ) - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_validate_with_all_params_overload_2(self, client: Gitpod) -> None: - configuration = client.runners.configurations.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: - response = client.runners.configurations.with_raw_response.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, - ) + def test_raw_response_validate(self, client: Gitpod) -> None: + response = client.runners.configurations.with_raw_response.validate() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -103,10 +65,8 @@ def test_raw_response_validate_overload_2(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_validate_overload_2(self, client: Gitpod) -> None: - with client.runners.configurations.with_streaming_response.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, - ) as response: + def test_streaming_response_validate(self, client: Gitpod) -> None: + with client.runners.configurations.with_streaming_response.validate() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -121,15 +81,13 @@ class TestAsyncConfigurations: @pytest.mark.skip() @parametrize - async def test_method_validate_overload_1(self, async_client: AsyncGitpod) -> None: - configuration = await async_client.runners.configurations.validate( - environment_class={}, - ) + async def test_method_validate(self, async_client: AsyncGitpod) -> None: + configuration = await async_client.runners.configurations.validate() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_validate_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( environment_class={ "id": "id", @@ -145,58 +103,22 @@ async def test_method_validate_with_all_params_overload_1(self, async_client: As "runner_id": "runnerId", }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + scm_integration={ + "id": "id", + "host": "host", + "oauth_client_id": "oauthClientId", + "oauth_encrypted_client_secret": "U3RhaW5sZXNzIHJvY2tz", + "oauth_plaintext_client_secret": "oauthPlaintextClientSecret", + "pat": True, + "scm_id": "scmId", + }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.with_raw_response.validate( - environment_class={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration = await response.parse() - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_validate_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.with_streaming_response.validate( - environment_class={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration = await response.parse() - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_validate_overload_2(self, async_client: AsyncGitpod) -> None: - configuration = await async_client.runners.configurations.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, - ) - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_validate_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - configuration = await async_client.runners.configurations.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.configurations.with_raw_response.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, - ) + async def test_raw_response_validate(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.configurations.with_raw_response.validate() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -205,10 +127,8 @@ async def test_raw_response_validate_overload_2(self, async_client: AsyncGitpod) @pytest.mark.skip() @parametrize - async def test_streaming_response_validate_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.configurations.with_streaming_response.validate( - scm_integration={"oauth_client_id": "oauthClientId"}, - ) as response: + async def test_streaming_response_validate(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.configurations.with_streaming_response.validate() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index bd75557f..f0bcafa7 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from gitpod.pagination import SyncPoliciesPage, AsyncPoliciesPage from gitpod.types.runners import ( - PolicyListResponse, + RunnerPolicy, PolicyCreateResponse, PolicyUpdateResponse, ) @@ -102,7 +102,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.runners.policies.list() - assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -116,7 +116,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -126,7 +126,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -136,7 +136,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -261,7 +261,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list() - assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -275,7 +275,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -285,7 +285,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -295,7 +295,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncPoliciesPage[PolicyListResponse], policy, path=["response"]) + assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 54d712eb..94b1a9f8 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -10,9 +10,9 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( + LoginProvider, AccountRetrieveResponse, AccountGetSSOLoginURLResponse, - AccountListLoginProvidersResponse, ) from gitpod.pagination import SyncLoginProvidersPage, AsyncLoginProvidersPage @@ -97,26 +97,22 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: - account = client.accounts.get_sso_login_url( - return_to="https://example.com", - ) + account = client.accounts.get_sso_login_url() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @pytest.mark.skip() @parametrize def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( - return_to="https://example.com", email="dev@stainlessapi.com", + return_to="https://example.com", ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @pytest.mark.skip() @parametrize def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: - response = client.accounts.with_raw_response.get_sso_login_url( - return_to="https://example.com", - ) + response = client.accounts.with_raw_response.get_sso_login_url() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -126,9 +122,7 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: - with client.accounts.with_streaming_response.get_sso_login_url( - return_to="https://example.com", - ) as response: + with client.accounts.with_streaming_response.get_sso_login_url() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -141,7 +135,7 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: account = client.accounts.list_login_providers() - assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) @pytest.mark.skip() @parametrize @@ -155,7 +149,7 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No "page_size": 100, }, ) - assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) @pytest.mark.skip() @parametrize @@ -165,7 +159,7 @@ def test_raw_response_list_login_providers(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) @pytest.mark.skip() @parametrize @@ -175,7 +169,7 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(SyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) assert cast(Any, response.is_closed) is True @@ -258,26 +252,22 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: - account = await async_client.accounts.get_sso_login_url( - return_to="https://example.com", - ) + account = await async_client.accounts.get_sso_login_url() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @pytest.mark.skip() @parametrize async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( - return_to="https://example.com", email="dev@stainlessapi.com", + return_to="https://example.com", ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @pytest.mark.skip() @parametrize async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.accounts.with_raw_response.get_sso_login_url( - return_to="https://example.com", - ) + response = await async_client.accounts.with_raw_response.get_sso_login_url() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -287,9 +277,7 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: - async with async_client.accounts.with_streaming_response.get_sso_login_url( - return_to="https://example.com", - ) as response: + async with async_client.accounts.with_streaming_response.get_sso_login_url() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -302,7 +290,7 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers() - assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) @pytest.mark.skip() @parametrize @@ -316,7 +304,7 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A "page_size": 100, }, ) - assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) @pytest.mark.skip() @parametrize @@ -326,7 +314,7 @@ async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) @pytest.mark.skip() @parametrize @@ -336,6 +324,6 @@ async def test_streaming_response_list_login_providers(self, async_client: Async assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AsyncLoginProvidersPage[AccountListLoginProvidersResponse], account, path=["response"]) + assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index d3de3026..9ef5526f 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( - EditorListResponse, + Editor, EditorRetrieveResponse, EditorResolveURLResponse, ) @@ -62,7 +62,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: editor = client.editors.list() - assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) @pytest.mark.skip() @parametrize @@ -75,7 +75,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) @pytest.mark.skip() @parametrize @@ -85,7 +85,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = response.parse() - assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) @pytest.mark.skip() @parametrize @@ -95,7 +95,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = response.parse() - assert_matches_type(SyncEditorsPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -181,7 +181,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list() - assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) @pytest.mark.skip() @parametrize @@ -194,7 +194,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) @pytest.mark.skip() @parametrize @@ -204,7 +204,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = await response.parse() - assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) @pytest.mark.skip() @parametrize @@ -214,7 +214,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" editor = await response.parse() - assert_matches_type(AsyncEditorsPage[EditorListResponse], editor, path=["response"]) + assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index b954bf53..992d3b26 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( - EnvironmentListResponse, + Environment, EnvironmentCreateResponse, EnvironmentRetrieveResponse, EnvironmentCreateLogsTokenResponse, @@ -44,7 +44,20 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://github.com/gitpod-io/gitpod"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -53,7 +66,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "session": "session", }, "machine": { - "class": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "class": "61000000-0000-0000-0000-000000000000", "session": "session", }, "ports": [ @@ -66,6 +79,8 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "secrets": [ { "environment_variable": "environmentVariable", + "file_path": "filePath", + "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", @@ -154,7 +169,49 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: environment = client.environments.update( environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={}, - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + spec={ + "automations_file": { + "automations_file_path": "automationsFilePath", + "session": "session", + }, + "content": { + "git_email": "gitEmail", + "git_username": "gitUsername", + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "session": "session", + }, + "devcontainer": { + "devcontainer_file_path": "devcontainerFilePath", + "session": "session", + }, + "ports": [ + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + } + ], + "ssh_public_keys": [ + { + "id": "id", + "value": "value", + } + ], + "timeout": {"disconnected": "+9125115.360s"}, + }, ) assert_matches_type(object, environment, path=["response"]) @@ -184,7 +241,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: environment = client.environments.list() - assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) @pytest.mark.skip() @parametrize @@ -205,7 +262,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) @pytest.mark.skip() @parametrize @@ -215,7 +272,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = response.parse() - assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) @pytest.mark.skip() @parametrize @@ -225,7 +282,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = response.parse() - assert_matches_type(SyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) assert cast(Any, response.is_closed) is True @@ -286,7 +343,20 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -308,6 +378,8 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "secrets": [ { "environment_variable": "environmentVariable", + "file_path": "filePath", + "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", @@ -519,7 +591,20 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://github.com/gitpod-io/gitpod"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -528,7 +613,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "session": "session", }, "machine": { - "class": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "class": "61000000-0000-0000-0000-000000000000", "session": "session", }, "ports": [ @@ -541,6 +626,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "secrets": [ { "environment_variable": "environmentVariable", + "file_path": "filePath", + "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", @@ -629,7 +716,49 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> environment = await async_client.environments.update( environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", metadata={}, - spec={"automations_file": {"automations_file_path": "automationsFilePath"}}, + spec={ + "automations_file": { + "automations_file_path": "automationsFilePath", + "session": "session", + }, + "content": { + "git_email": "gitEmail", + "git_username": "gitUsername", + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "session": "session", + }, + "devcontainer": { + "devcontainer_file_path": "devcontainerFilePath", + "session": "session", + }, + "ports": [ + { + "admission": "ADMISSION_LEVEL_UNSPECIFIED", + "name": "x", + "port": 1, + } + ], + "ssh_public_keys": [ + { + "id": "id", + "value": "value", + } + ], + "timeout": {"disconnected": "+9125115.360s"}, + }, ) assert_matches_type(object, environment, path=["response"]) @@ -659,7 +788,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list() - assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) @pytest.mark.skip() @parametrize @@ -680,7 +809,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) @pytest.mark.skip() @parametrize @@ -690,7 +819,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = await response.parse() - assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) @pytest.mark.skip() @parametrize @@ -700,7 +829,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" environment = await response.parse() - assert_matches_type(AsyncEnvironmentsPage[EnvironmentListResponse], environment, path=["response"]) + assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) assert cast(Any, response.is_closed) is True @@ -761,7 +890,20 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "content": { "git_email": "gitEmail", "git_username": "gitUsername", - "initializer": {"specs": [{"context_url": {"url": "https://example.com"}}]}, + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, "session": "session", }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", @@ -783,6 +925,8 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "secrets": [ { "environment_variable": "environmentVariable", + "file_path": "filePath", + "git_credential_host": "gitCredentialHost", "name": "name", "session": "session", "source": "source", diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index b3fdfdd5..11a2ab96 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -68,52 +68,23 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize - def test_method_watch_overload_1(self, client: Gitpod) -> None: - event = client.events.watch( - environment_id="environmentId", - ) - assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) - - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") - @parametrize - def test_raw_response_watch_overload_1(self, client: Gitpod) -> None: - response = client.events.with_raw_response.watch( - environment_id="environmentId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - event = response.parse() + def test_method_watch(self, client: Gitpod) -> None: + event = client.events.watch() assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize - def test_streaming_response_watch_overload_1(self, client: Gitpod) -> None: - with client.events.with_streaming_response.watch( - environment_id="environmentId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - event = response.parse() - assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") - @parametrize - def test_method_watch_overload_2(self, client: Gitpod) -> None: + def test_method_watch_with_all_params(self, client: Gitpod) -> None: event = client.events.watch( + environment_id="environmentId", organization=True, ) assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize - def test_raw_response_watch_overload_2(self, client: Gitpod) -> None: - response = client.events.with_raw_response.watch( - organization=True, - ) + def test_raw_response_watch(self, client: Gitpod) -> None: + response = client.events.with_raw_response.watch() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -122,10 +93,8 @@ def test_raw_response_watch_overload_2(self, client: Gitpod) -> None: @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize - def test_streaming_response_watch_overload_2(self, client: Gitpod) -> None: - with client.events.with_streaming_response.watch( - organization=True, - ) as response: + def test_streaming_response_watch(self, client: Gitpod) -> None: + with client.events.with_streaming_response.watch() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -187,52 +156,23 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize - async def test_method_watch_overload_1(self, async_client: AsyncGitpod) -> None: - event = await async_client.events.watch( - environment_id="environmentId", - ) - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) - - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") - @parametrize - async def test_raw_response_watch_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.events.with_raw_response.watch( - environment_id="environmentId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - event = await response.parse() + async def test_method_watch(self, async_client: AsyncGitpod) -> None: + event = await async_client.events.watch() assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize - async def test_streaming_response_watch_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.events.with_streaming_response.watch( - environment_id="environmentId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - event = await response.parse() - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") - @parametrize - async def test_method_watch_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> None: event = await async_client.events.watch( + environment_id="environmentId", organization=True, ) assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize - async def test_raw_response_watch_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.events.with_raw_response.watch( - organization=True, - ) + async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None: + response = await async_client.events.with_raw_response.watch() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -241,10 +181,8 @@ async def test_raw_response_watch_overload_2(self, async_client: AsyncGitpod) -> @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize - async def test_streaming_response_watch_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.events.with_streaming_response.watch( - organization=True, - ) as response: + async def test_streaming_response_watch(self, async_client: AsyncGitpod) -> None: + async with async_client.events.with_streaming_response.watch() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index 2d4abe98..00bfe68a 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -9,7 +9,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import GroupListResponse +from gitpod.types import Group from gitpod.pagination import SyncGroupsPage, AsyncGroupsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ class TestGroups: @parametrize def test_method_list(self, client: Gitpod) -> None: group = client.groups.list() - assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +45,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -55,7 +55,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(SyncGroupsPage[GroupListResponse], group, path=["response"]) + assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -67,7 +67,7 @@ class TestAsyncGroups: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list() - assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -80,7 +80,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -90,7 +90,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,6 +100,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(AsyncGroupsPage[GroupListResponse], group, path=["response"]) + assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 1c0c5afc..8dbf4512 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -10,12 +10,12 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( + Organization, + OrganizationMember, OrganizationJoinResponse, - OrganizationListResponse, OrganizationCreateResponse, OrganizationUpdateResponse, OrganizationRetrieveResponse, - OrganizationListMembersResponse, ) from gitpod.pagination import SyncMembersPage, AsyncMembersPage, SyncOrganizationsPage, AsyncOrganizationsPage @@ -101,60 +101,24 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - organization = client.organizations.update( - invite_domains={}, - ) + def test_method_update(self, client: Gitpod) -> None: + organization = client.organizations.update() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_update_with_all_params_overload_1(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.update( invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, - ) - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.update( - invite_domains={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = response.parse() - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.update( - invite_domains={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = response.parse() - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: - organization = client.organizations.update( name="name", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.update( - name="name", - ) + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -163,10 +127,8 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.update( - name="name", - ) as response: + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -179,7 +141,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: organization = client.organizations.list() - assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -193,7 +155,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, scope="SCOPE_UNSPECIFIED", ) - assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -203,7 +165,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -213,7 +175,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(SyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -255,52 +217,23 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_method_join_overload_1(self, client: Gitpod) -> None: - organization = client.organizations.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + def test_method_join(self, client: Gitpod) -> None: + organization = client.organizations.join() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_join_overload_1(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = response.parse() - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_join_overload_1(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = response.parse() - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_join_overload_2(self, client: Gitpod) -> None: + def test_method_join_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_join_overload_2(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.join( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + def test_raw_response_join(self, client: Gitpod) -> None: + response = client.organizations.with_raw_response.join() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -309,10 +242,8 @@ def test_raw_response_join_overload_2(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_join_overload_2(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.join( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: + def test_streaming_response_join(self, client: Gitpod) -> None: + with client.organizations.with_streaming_response.join() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -361,7 +292,7 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: @parametrize def test_method_list_members(self, client: Gitpod) -> None: organization = client.organizations.list_members() - assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -375,7 +306,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -385,7 +316,7 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -395,7 +326,7 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(SyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -517,60 +448,24 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.update( - invite_domains={}, - ) + async def test_method_update(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.update() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, - ) - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.update( - invite_domains={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = await response.parse() - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.update( - invite_domains={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = await response.parse() - assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.update( name="name", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.update( - name="name", - ) + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -579,10 +474,8 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.update( - name="name", - ) as response: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -595,7 +488,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list() - assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -609,7 +502,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, scope="SCOPE_UNSPECIFIED", ) - assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -619,7 +512,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -629,7 +522,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(AsyncOrganizationsPage[OrganizationListResponse], organization, path=["response"]) + assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -671,52 +564,23 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize - async def test_method_join_overload_1(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + async def test_method_join(self, async_client: AsyncGitpod) -> None: + organization = await async_client.organizations.join() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_join_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = await response.parse() - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_join_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = await response.parse() - assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_join_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_join_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.join( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) + async def test_raw_response_join(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.with_raw_response.join() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -725,10 +589,8 @@ async def test_raw_response_join_overload_2(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize - async def test_streaming_response_join_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.join( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: + async def test_streaming_response_join(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.with_streaming_response.join() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -777,7 +639,7 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members() - assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -791,7 +653,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp "page_size": 100, }, ) - assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -801,7 +663,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -811,7 +673,7 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(AsyncMembersPage[OrganizationListMembersResponse], organization, path=["response"]) + assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 754f4395..4a57297b 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( - ProjectListResponse, + Project, ProjectCreateResponse, ProjectUpdateResponse, ProjectRetrieveResponse, @@ -28,7 +28,7 @@ class TestProjects: @parametrize def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + environment_class={}, initializer={}, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -37,8 +37,24 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + environment_class={ + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + }, + initializer={ + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="x", @@ -49,7 +65,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + environment_class={}, initializer={}, ) @@ -62,7 +78,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + environment_class={}, initializer={}, ) as response: assert not response.is_closed @@ -111,162 +127,43 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - project = client.projects.update( - automations_file_path="automationsFilePath", - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.update( - automations_file_path="automationsFilePath", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() + def test_method_update(self, client: Gitpod) -> None: + project = client.projects.update() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.update( - automations_file_path="automationsFilePath", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: project = client.projects.update( + automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.update( - devcontainer_file_path="devcontainerFilePath", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.update( - devcontainer_file_path="devcontainerFilePath", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_3(self, client: Gitpod) -> None: - project = client.projects.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_3(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_3(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_4(self, client: Gitpod) -> None: - project = client.projects.update( - initializer={}, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_update_with_all_params_overload_4(self, client: Gitpod) -> None: - project = client.projects.update( - initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update_overload_4(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.update( - initializer={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_4(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.update( - initializer={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_5(self, client: Gitpod) -> None: - project = client.projects.update( + environment_class={ + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + }, + initializer={ + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, name="x", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_5(self, client: Gitpod) -> None: - response = client.projects.with_raw_response.update( - name="x", - ) + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -275,10 +172,8 @@ def test_raw_response_update_overload_5(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: - with client.projects.with_streaming_response.update( - name="x", - ) as response: + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -291,7 +186,7 @@ def test_streaming_response_update_overload_5(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: project = client.projects.list() - assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) @pytest.mark.skip() @parametrize @@ -304,7 +199,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) @pytest.mark.skip() @parametrize @@ -314,7 +209,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = response.parse() - assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) @pytest.mark.skip() @parametrize @@ -324,7 +219,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = response.parse() - assert_matches_type(SyncProjectsPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) assert cast(Any, response.is_closed) is True @@ -409,7 +304,7 @@ class TestAsyncProjects: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + environment_class={}, initializer={}, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -418,8 +313,24 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, + environment_class={ + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + }, + initializer={ + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="x", @@ -430,7 +341,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + environment_class={}, initializer={}, ) @@ -443,7 +354,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + environment_class={}, initializer={}, ) as response: assert not response.is_closed @@ -492,162 +403,43 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - automations_file_path="automationsFilePath", - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.update( - automations_file_path="automationsFilePath", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() + async def test_method_update(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.update() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.update( - automations_file_path="automationsFilePath", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( + automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.update( - devcontainer_file_path="devcontainerFilePath", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.update( - devcontainer_file_path="devcontainerFilePath", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.update( - environment_class={"environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_4(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - initializer={}, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_update_with_all_params_overload_4(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( - initializer={"specs": [{"context_url": {"url": "https://example.com"}}]}, - ) - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update_overload_4(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.update( - initializer={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_4(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.update( - initializer={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_5(self, async_client: AsyncGitpod) -> None: - project = await async_client.projects.update( + environment_class={ + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + }, + initializer={ + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, name="x", + project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) -> None: - response = await async_client.projects.with_raw_response.update( - name="x", - ) + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -656,10 +448,8 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_5(self, async_client: AsyncGitpod) -> None: - async with async_client.projects.with_streaming_response.update( - name="x", - ) as response: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -672,7 +462,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list() - assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) @pytest.mark.skip() @parametrize @@ -685,7 +475,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) @pytest.mark.skip() @parametrize @@ -695,7 +485,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = await response.parse() - assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) @pytest.mark.skip() @parametrize @@ -705,7 +495,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = await response.parse() - assert_matches_type(AsyncProjectsPage[ProjectListResponse], project, path=["response"]) + assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 6c510f24..3829f7d6 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( - RunnerListResponse, + Runner, RunnerCreateResponse, RunnerRetrieveResponse, RunnerParseContextURLResponse, @@ -109,52 +109,30 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_method_update_overload_1(self, client: Gitpod) -> None: - runner = client.runners.update( - name="xxx", - ) + def test_method_update(self, client: Gitpod) -> None: + runner = client.runners.update() assert_matches_type(object, runner, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_1(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.update( - name="xxx", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner = response.parse() - assert_matches_type(object, runner, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update_overload_1(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.update( - name="xxx", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner = response.parse() - assert_matches_type(object, runner, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_update_overload_2(self, client: Gitpod) -> None: + def test_method_update_with_all_params(self, client: Gitpod) -> None: runner = client.runners.update( - spec={"configuration": {"auto_update": True}}, + name="xxx", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + spec={ + "configuration": { + "auto_update": True, + "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + }, + "desired_phase": "RUNNER_PHASE_UNSPECIFIED", + }, ) assert_matches_type(object, runner, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update_overload_2(self, client: Gitpod) -> None: - response = client.runners.with_raw_response.update( - spec={"configuration": {"auto_update": True}}, - ) + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -163,10 +141,8 @@ def test_raw_response_update_overload_2(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: - with client.runners.with_streaming_response.update( - spec={"configuration": {"auto_update": True}}, - ) as response: + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -179,7 +155,7 @@ def test_streaming_response_update_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: runner = client.runners.list() - assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) @pytest.mark.skip() @parametrize @@ -197,7 +173,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) @pytest.mark.skip() @parametrize @@ -207,7 +183,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) @pytest.mark.skip() @parametrize @@ -217,7 +193,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = response.parse() - assert_matches_type(SyncRunnersPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) assert cast(Any, response.is_closed) is True @@ -456,52 +432,30 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize - async def test_method_update_overload_1(self, async_client: AsyncGitpod) -> None: - runner = await async_client.runners.update( - name="xxx", - ) + async def test_method_update(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.update() assert_matches_type(object, runner, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.update( - name="xxx", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - runner = await response.parse() - assert_matches_type(object, runner, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.update( - name="xxx", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - runner = await response.parse() - assert_matches_type(object, runner, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncGitpod) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( - spec={"configuration": {"auto_update": True}}, + name="xxx", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + spec={ + "configuration": { + "auto_update": True, + "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + }, + "desired_phase": "RUNNER_PHASE_UNSPECIFIED", + }, ) assert_matches_type(object, runner, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.runners.with_raw_response.update( - spec={"configuration": {"auto_update": True}}, - ) + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.update() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -510,10 +464,8 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.runners.with_streaming_response.update( - spec={"configuration": {"auto_update": True}}, - ) as response: + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.update() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -526,7 +478,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list() - assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) @pytest.mark.skip() @parametrize @@ -544,7 +496,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) @pytest.mark.skip() @parametrize @@ -554,7 +506,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) @pytest.mark.skip() @parametrize @@ -564,7 +516,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" runner = await response.parse() - assert_matches_type(AsyncRunnersPage[RunnerListResponse], runner, path=["response"]) + assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 07fd383f..ce957788 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( - SecretListResponse, + Secret, SecretCreateResponse, SecretGetValueResponse, ) @@ -24,61 +24,15 @@ class TestSecrets: @pytest.mark.skip() @parametrize - def test_method_create_overload_1(self, client: Gitpod) -> None: - secret = client.secrets.create( - environment_variable=True, - ) + def test_method_create(self, client: Gitpod) -> None: + secret = client.secrets.create() assert_matches_type(SecretCreateResponse, secret, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params_overload_1(self, client: Gitpod) -> None: + def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( environment_variable=True, - name="name", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - value="x", - ) - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_create_overload_1(self, client: Gitpod) -> None: - response = client.secrets.with_raw_response.create( - environment_variable=True, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - secret = response.parse() - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_create_overload_1(self, client: Gitpod) -> None: - with client.secrets.with_streaming_response.create( - environment_variable=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - secret = response.parse() - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_create_overload_2(self, client: Gitpod) -> None: - secret = client.secrets.create( - file_path="filePath", - ) - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: - secret = client.secrets.create( file_path="filePath", name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -88,10 +42,8 @@ def test_method_create_with_all_params_overload_2(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_create_overload_2(self, client: Gitpod) -> None: - response = client.secrets.with_raw_response.create( - file_path="filePath", - ) + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.secrets.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -100,10 +52,8 @@ def test_raw_response_create_overload_2(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: - with client.secrets.with_streaming_response.create( - file_path="filePath", - ) as response: + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.secrets.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -116,7 +66,7 @@ def test_streaming_response_create_overload_2(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: secret = client.secrets.list() - assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) @pytest.mark.skip() @parametrize @@ -130,7 +80,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) @pytest.mark.skip() @parametrize @@ -140,7 +90,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = response.parse() - assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) @pytest.mark.skip() @parametrize @@ -150,7 +100,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = response.parse() - assert_matches_type(SyncSecretsPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) assert cast(Any, response.is_closed) is True @@ -269,61 +219,15 @@ class TestAsyncSecrets: @pytest.mark.skip() @parametrize - async def test_method_create_overload_1(self, async_client: AsyncGitpod) -> None: - secret = await async_client.secrets.create( - environment_variable=True, - ) + async def test_method_create(self, async_client: AsyncGitpod) -> None: + secret = await async_client.secrets.create() assert_matches_type(SecretCreateResponse, secret, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGitpod) -> None: + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( environment_variable=True, - name="name", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - value="x", - ) - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncGitpod) -> None: - response = await async_client.secrets.with_raw_response.create( - environment_variable=True, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - secret = await response.parse() - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncGitpod) -> None: - async with async_client.secrets.with_streaming_response.create( - environment_variable=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - secret = await response.parse() - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncGitpod) -> None: - secret = await async_client.secrets.create( - file_path="filePath", - ) - assert_matches_type(SecretCreateResponse, secret, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGitpod) -> None: - secret = await async_client.secrets.create( file_path="filePath", name="name", project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -333,10 +237,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn @pytest.mark.skip() @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) -> None: - response = await async_client.secrets.with_raw_response.create( - file_path="filePath", - ) + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.secrets.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -345,10 +247,8 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncGitpod) -> None: - async with async_client.secrets.with_streaming_response.create( - file_path="filePath", - ) as response: + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.secrets.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -361,7 +261,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGit @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list() - assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) @pytest.mark.skip() @parametrize @@ -375,7 +275,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) @pytest.mark.skip() @parametrize @@ -385,7 +285,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = await response.parse() - assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) @pytest.mark.skip() @parametrize @@ -395,7 +295,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" secret = await response.parse() - assert_matches_type(AsyncSecretsPage[SecretListResponse], secret, path=["response"]) + assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index d20704e8..bf3ea017 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.pagination import SyncPersonalAccessTokensPage, AsyncPersonalAccessTokensPage -from gitpod.types.users import PatGetResponse, PatListResponse +from gitpod.types.users import PatGetResponse, PersonalAccessToken base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ class TestPats: @parametrize def test_method_list(self, client: Gitpod) -> None: pat = client.users.pats.list() - assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) @pytest.mark.skip() @parametrize @@ -36,7 +36,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "page_size": 100, }, ) - assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) @pytest.mark.skip() @parametrize @@ -46,7 +46,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +56,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = response.parse() - assert_matches_type(SyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) assert cast(Any, response.is_closed) is True @@ -140,7 +140,7 @@ class TestAsyncPats: @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list() - assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) @pytest.mark.skip() @parametrize @@ -154,7 +154,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "page_size": 100, }, ) - assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) @pytest.mark.skip() @parametrize @@ -164,7 +164,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) @pytest.mark.skip() @parametrize @@ -174,7 +174,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" pat = await response.parse() - assert_matches_type(AsyncPersonalAccessTokensPage[PatListResponse], pat, path=["response"]) + assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) assert cast(Any, response.is_closed) is True From a0b3d668b4dab0b990f48996b5f8417606d53ad3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 20:33:28 +0000 Subject: [PATCH 084/505] feat(jsonl): add .close() method (#11) --- src/gitpod/_decoders/jsonl.py | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/gitpod/_decoders/jsonl.py b/src/gitpod/_decoders/jsonl.py index e9d29a1c..ac5ac74f 100644 --- a/src/gitpod/_decoders/jsonl.py +++ b/src/gitpod/_decoders/jsonl.py @@ -17,11 +17,15 @@ class JSONLDecoder(Generic[_T]): into a given type. """ - http_response: httpx.Response | None + http_response: httpx.Response """The HTTP response this decoder was constructed from""" def __init__( - self, *, raw_iterator: Iterator[bytes], line_type: type[_T], http_response: httpx.Response | None + self, + *, + raw_iterator: Iterator[bytes], + line_type: type[_T], + http_response: httpx.Response, ) -> None: super().__init__() self.http_response = http_response @@ -29,6 +33,13 @@ def __init__( self._line_type = line_type self._iterator = self.__decode__() + def close(self) -> None: + """Close the response body stream. + + This is called automatically if you consume the entire stream. + """ + self.http_response.close() + def __decode__(self) -> Iterator[_T]: buf = b"" for chunk in self._raw_iterator: @@ -63,10 +74,14 @@ class AsyncJSONLDecoder(Generic[_T]): into a given type. """ - http_response: httpx.Response | None + http_response: httpx.Response def __init__( - self, *, raw_iterator: AsyncIterator[bytes], line_type: type[_T], http_response: httpx.Response | None + self, + *, + raw_iterator: AsyncIterator[bytes], + line_type: type[_T], + http_response: httpx.Response, ) -> None: super().__init__() self.http_response = http_response @@ -74,6 +89,13 @@ def __init__( self._line_type = line_type self._iterator = self.__decode__() + async def close(self) -> None: + """Close the response body stream. + + This is called automatically if you consume the entire stream. + """ + await self.http_response.aclose() + async def __decode__(self) -> AsyncIterator[_T]: buf = b"" async for chunk in self._raw_iterator: From a6745eda9c9cb800de803d61ba2a003c65e9b9c0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 20:33:53 +0000 Subject: [PATCH 085/505] fix(jsonl): lower chunk size --- src/gitpod/_response.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_response.py b/src/gitpod/_response.py index de6c36a6..38a11e65 100644 --- a/src/gitpod/_response.py +++ b/src/gitpod/_response.py @@ -144,7 +144,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: return cast( R, cast("type[JSONLDecoder[Any]]", cast_to)( - raw_iterator=self.http_response.iter_bytes(chunk_size=4096), + raw_iterator=self.http_response.iter_bytes(chunk_size=64), line_type=extract_type_arg(cast_to, 0), http_response=self.http_response, ), @@ -154,7 +154,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: return cast( R, cast("type[AsyncJSONLDecoder[Any]]", cast_to)( - raw_iterator=self.http_response.aiter_bytes(chunk_size=4096), + raw_iterator=self.http_response.aiter_bytes(chunk_size=64), line_type=extract_type_arg(cast_to, 0), http_response=self.http_response, ), From d1faead3e54fcad84bc4c7806284938937cbaff0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 08:29:33 +0000 Subject: [PATCH 086/505] chore: go live --- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 8 ++++---- pyproject.toml | 6 +++--- src/gitpod/resources/accounts.py | 8 ++++---- src/gitpod/resources/editors.py | 8 ++++---- .../resources/environments/automations/automations.py | 8 ++++---- src/gitpod/resources/environments/automations/services.py | 8 ++++---- .../environments/automations/tasks/executions.py | 8 ++++---- .../resources/environments/automations/tasks/tasks.py | 8 ++++---- src/gitpod/resources/environments/classes.py | 8 ++++---- src/gitpod/resources/environments/environments.py | 8 ++++---- src/gitpod/resources/events.py | 8 ++++---- src/gitpod/resources/groups.py | 8 ++++---- src/gitpod/resources/identity.py | 8 ++++---- src/gitpod/resources/organizations/invites.py | 8 ++++---- src/gitpod/resources/organizations/organizations.py | 8 ++++---- src/gitpod/resources/organizations/sso_configurations.py | 8 ++++---- src/gitpod/resources/projects/policies.py | 8 ++++---- src/gitpod/resources/projects/projects.py | 8 ++++---- .../resources/runners/configurations/configurations.py | 8 ++++---- .../runners/configurations/environment_classes.py | 8 ++++---- .../runners/configurations/host_authentication_tokens.py | 8 ++++---- src/gitpod/resources/runners/configurations/schema.py | 8 ++++---- .../resources/runners/configurations/scm_integrations.py | 8 ++++---- src/gitpod/resources/runners/policies.py | 8 ++++---- src/gitpod/resources/runners/runners.py | 8 ++++---- src/gitpod/resources/secrets.py | 8 ++++---- src/gitpod/resources/users/pats.py | 8 ++++---- src/gitpod/resources/users/users.py | 8 ++++---- 31 files changed, 115 insertions(+), 115 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 9ac94126..df62ae14 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,6 +1,6 @@ # This workflow is triggered when a GitHub release is created. # It can also be run manually to re-publish to PyPI in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/gitpod-io/flex-sdk-python/actions/workflows/publish-pypi.yml +# You can run this workflow by navigating to https://www.github.com/gitpod-io/gitpod-sdk-python/actions/workflows/publish-pypi.yml name: Publish PyPI on: workflow_dispatch: diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 7def838e..f7fa2813 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -9,7 +9,7 @@ jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'gitpod-io/flex-sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + if: github.repository == 'gitpod-io/gitpod-sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - uses: actions/checkout@v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf30b351..63af7070 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```sh -$ pip install git+ssh://git@github.com/gitpod-io/flex-sdk-python.git +$ pip install git+ssh://git@github.com/gitpod-io/gitpod-sdk-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -121,7 +121,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/gitpod-io/flex-sdk-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/gitpod-io/gitpod-sdk-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index d4f6ef5c..d093a21a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The REST API documentation can be found on [docs.gitpod.com](https://docs.gitpod ```sh # install from the production repo -pip install git+ssh://git@github.com/gitpod-io/flex-sdk-python.git +pip install git+ssh://git@github.com/gitpod-io/gitpod-sdk-python.git ``` > [!NOTE] @@ -269,9 +269,9 @@ runner = response.parse() # get the object that `runners.create()` would have r print(runner.access_token) ``` -These methods return an [`APIResponse`](https://github.com/gitpod-io/flex-sdk-python/tree/main/src/gitpod/_response.py) object. +These methods return an [`APIResponse`](https://github.com/gitpod-io/gitpod-sdk-python/tree/main/src/gitpod/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/gitpod-io/flex-sdk-python/tree/main/src/gitpod/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/gitpod-io/gitpod-sdk-python/tree/main/src/gitpod/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -375,7 +375,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/gitpod-io/flex-sdk-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/gitpod-io/gitpod-sdk-python/issues) with questions, bugs, or suggestions. ### Determining the installed version diff --git a/pyproject.toml b/pyproject.toml index d6cb8e71..90e98ed3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,8 +34,8 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/gitpod-io/flex-sdk-python" -Repository = "https://github.com/gitpod-io/flex-sdk-python" +Homepage = "https://github.com/gitpod-io/gitpod-sdk-python" +Repository = "https://github.com/gitpod-io/gitpod-sdk-python" @@ -122,7 +122,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/gitpod-io/flex-sdk-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/gitpod-io/gitpod-sdk-python/tree/main/\g<2>)' [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index e344dc9e..1712f203 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -41,7 +41,7 @@ def with_raw_response(self) -> AccountsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AccountsResourceWithRawResponse(self) @@ -50,7 +50,7 @@ def with_streaming_response(self) -> AccountsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AccountsResourceWithStreamingResponse(self) @@ -229,7 +229,7 @@ def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncAccountsResourceWithRawResponse(self) @@ -238,7 +238,7 @@ def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncAccountsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 17733f69..1a910b71 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -34,7 +34,7 @@ def with_raw_response(self) -> EditorsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return EditorsResourceWithRawResponse(self) @@ -43,7 +43,7 @@ def with_streaming_response(self) -> EditorsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return EditorsResourceWithStreamingResponse(self) @@ -184,7 +184,7 @@ def with_raw_response(self) -> AsyncEditorsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncEditorsResourceWithRawResponse(self) @@ -193,7 +193,7 @@ def with_streaming_response(self) -> AsyncEditorsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncEditorsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index f9c6d9b3..16cacc4e 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -56,7 +56,7 @@ def with_raw_response(self) -> AutomationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AutomationsResourceWithRawResponse(self) @@ -65,7 +65,7 @@ def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AutomationsResourceWithStreamingResponse(self) @@ -129,7 +129,7 @@ def with_raw_response(self) -> AsyncAutomationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncAutomationsResourceWithRawResponse(self) @@ -138,7 +138,7 @@ def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingRespon """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncAutomationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index adea3c29..9fe97160 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -44,7 +44,7 @@ def with_raw_response(self) -> ServicesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return ServicesResourceWithRawResponse(self) @@ -53,7 +53,7 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return ServicesResourceWithStreamingResponse(self) @@ -357,7 +357,7 @@ def with_raw_response(self) -> AsyncServicesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncServicesResourceWithRawResponse(self) @@ -366,7 +366,7 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncServicesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index 7b831a78..a2a887e0 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -37,7 +37,7 @@ def with_raw_response(self) -> ExecutionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return ExecutionsResourceWithRawResponse(self) @@ -46,7 +46,7 @@ def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return ExecutionsResourceWithStreamingResponse(self) @@ -179,7 +179,7 @@ def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncExecutionsResourceWithRawResponse(self) @@ -188,7 +188,7 @@ def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingRespons """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncExecutionsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 2687f1bc..1e0b197c 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -58,7 +58,7 @@ def with_raw_response(self) -> TasksResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return TasksResourceWithRawResponse(self) @@ -67,7 +67,7 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return TasksResourceWithStreamingResponse(self) @@ -326,7 +326,7 @@ def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncTasksResourceWithRawResponse(self) @@ -335,7 +335,7 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncTasksResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/classes.py b/src/gitpod/resources/environments/classes.py index a68c661b..1a64f8a6 100644 --- a/src/gitpod/resources/environments/classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -29,7 +29,7 @@ def with_raw_response(self) -> ClassesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return ClassesResourceWithRawResponse(self) @@ -38,7 +38,7 @@ def with_streaming_response(self) -> ClassesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return ClassesResourceWithStreamingResponse(self) @@ -107,7 +107,7 @@ def with_raw_response(self) -> AsyncClassesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncClassesResourceWithRawResponse(self) @@ -116,7 +116,7 @@ def with_streaming_response(self) -> AsyncClassesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncClassesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 13c6fec6..d5351884 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -75,7 +75,7 @@ def with_raw_response(self) -> EnvironmentsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return EnvironmentsResourceWithRawResponse(self) @@ -84,7 +84,7 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return EnvironmentsResourceWithStreamingResponse(self) @@ -566,7 +566,7 @@ def with_raw_response(self) -> AsyncEnvironmentsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncEnvironmentsResourceWithRawResponse(self) @@ -575,7 +575,7 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncEnvironmentsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index b1539f7d..8a7ebdda 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -34,7 +34,7 @@ def with_raw_response(self) -> EventsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return EventsResourceWithRawResponse(self) @@ -43,7 +43,7 @@ def with_streaming_response(self) -> EventsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return EventsResourceWithStreamingResponse(self) @@ -159,7 +159,7 @@ def with_raw_response(self) -> AsyncEventsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncEventsResourceWithRawResponse(self) @@ -168,7 +168,7 @@ def with_streaming_response(self) -> AsyncEventsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncEventsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py index 9b6f47bc..233e4b08 100644 --- a/src/gitpod/resources/groups.py +++ b/src/gitpod/resources/groups.py @@ -29,7 +29,7 @@ def with_raw_response(self) -> GroupsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return GroupsResourceWithRawResponse(self) @@ -38,7 +38,7 @@ def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return GroupsResourceWithStreamingResponse(self) @@ -98,7 +98,7 @@ def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncGroupsResourceWithRawResponse(self) @@ -107,7 +107,7 @@ def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncGroupsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index f5b4f0d5..6635c4b6 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -39,7 +39,7 @@ def with_raw_response(self) -> IdentityResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return IdentityResourceWithRawResponse(self) @@ -48,7 +48,7 @@ def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return IdentityResourceWithStreamingResponse(self) @@ -163,7 +163,7 @@ def with_raw_response(self) -> AsyncIdentityResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncIdentityResourceWithRawResponse(self) @@ -172,7 +172,7 @@ def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncIdentityResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/organizations/invites.py b/src/gitpod/resources/organizations/invites.py index 8475f639..131a39b0 100644 --- a/src/gitpod/resources/organizations/invites.py +++ b/src/gitpod/resources/organizations/invites.py @@ -33,7 +33,7 @@ def with_raw_response(self) -> InvitesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return InvitesResourceWithRawResponse(self) @@ -42,7 +42,7 @@ def with_streaming_response(self) -> InvitesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return InvitesResourceWithStreamingResponse(self) @@ -155,7 +155,7 @@ def with_raw_response(self) -> AsyncInvitesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncInvitesResourceWithRawResponse(self) @@ -164,7 +164,7 @@ def with_streaming_response(self) -> AsyncInvitesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncInvitesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 65326134..d10cb521 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -77,7 +77,7 @@ def with_raw_response(self) -> OrganizationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return OrganizationsResourceWithRawResponse(self) @@ -86,7 +86,7 @@ def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return OrganizationsResourceWithStreamingResponse(self) @@ -504,7 +504,7 @@ def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncOrganizationsResourceWithRawResponse(self) @@ -513,7 +513,7 @@ def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResp """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncOrganizationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 62a4197f..ab984fef 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -44,7 +44,7 @@ def with_raw_response(self) -> SSOConfigurationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return SSOConfigurationsResourceWithRawResponse(self) @@ -53,7 +53,7 @@ def with_streaming_response(self) -> SSOConfigurationsResourceWithStreamingRespo """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return SSOConfigurationsResourceWithStreamingResponse(self) @@ -306,7 +306,7 @@ def with_raw_response(self) -> AsyncSSOConfigurationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncSSOConfigurationsResourceWithRawResponse(self) @@ -315,7 +315,7 @@ def with_streaming_response(self) -> AsyncSSOConfigurationsResourceWithStreaming """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncSSOConfigurationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index b856a2d5..ffac1625 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -41,7 +41,7 @@ def with_raw_response(self) -> PoliciesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return PoliciesResourceWithRawResponse(self) @@ -50,7 +50,7 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return PoliciesResourceWithStreamingResponse(self) @@ -252,7 +252,7 @@ def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncPoliciesResourceWithRawResponse(self) @@ -261,7 +261,7 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncPoliciesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 08571627..b3cd1461 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -59,7 +59,7 @@ def with_raw_response(self) -> ProjectsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return ProjectsResourceWithRawResponse(self) @@ -68,7 +68,7 @@ def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return ProjectsResourceWithStreamingResponse(self) @@ -367,7 +367,7 @@ def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncProjectsResourceWithRawResponse(self) @@ -376,7 +376,7 @@ def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncProjectsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index 68b2e38d..135c7883 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -80,7 +80,7 @@ def with_raw_response(self) -> ConfigurationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return ConfigurationsResourceWithRawResponse(self) @@ -89,7 +89,7 @@ def with_streaming_response(self) -> ConfigurationsResourceWithStreamingResponse """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return ConfigurationsResourceWithStreamingResponse(self) @@ -160,7 +160,7 @@ def with_raw_response(self) -> AsyncConfigurationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncConfigurationsResourceWithRawResponse(self) @@ -169,7 +169,7 @@ def with_streaming_response(self) -> AsyncConfigurationsResourceWithStreamingRes """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncConfigurationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index 5c416956..50e5f95b 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -42,7 +42,7 @@ def with_raw_response(self) -> EnvironmentClassesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return EnvironmentClassesResourceWithRawResponse(self) @@ -51,7 +51,7 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return EnvironmentClassesResourceWithStreamingResponse(self) @@ -240,7 +240,7 @@ def with_raw_response(self) -> AsyncEnvironmentClassesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncEnvironmentClassesResourceWithRawResponse(self) @@ -249,7 +249,7 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncEnvironmentClassesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 74bb2513..4f49af81 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -49,7 +49,7 @@ def with_raw_response(self) -> HostAuthenticationTokensResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return HostAuthenticationTokensResourceWithRawResponse(self) @@ -58,7 +58,7 @@ def with_streaming_response(self) -> HostAuthenticationTokensResourceWithStreami """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return HostAuthenticationTokensResourceWithStreamingResponse(self) @@ -461,7 +461,7 @@ def with_raw_response(self) -> AsyncHostAuthenticationTokensResourceWithRawRespo This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncHostAuthenticationTokensResourceWithRawResponse(self) @@ -470,7 +470,7 @@ def with_streaming_response(self) -> AsyncHostAuthenticationTokensResourceWithSt """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncHostAuthenticationTokensResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/schema.py b/src/gitpod/resources/runners/configurations/schema.py index 76f4a913..4d3f3e5e 100644 --- a/src/gitpod/resources/runners/configurations/schema.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -31,7 +31,7 @@ def with_raw_response(self) -> SchemaResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return SchemaResourceWithRawResponse(self) @@ -40,7 +40,7 @@ def with_streaming_response(self) -> SchemaResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return SchemaResourceWithStreamingResponse(self) @@ -84,7 +84,7 @@ def with_raw_response(self) -> AsyncSchemaResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncSchemaResourceWithRawResponse(self) @@ -93,7 +93,7 @@ def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncSchemaResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 36a4bbcd..97aa2608 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -42,7 +42,7 @@ def with_raw_response(self) -> ScmIntegrationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return ScmIntegrationsResourceWithRawResponse(self) @@ -51,7 +51,7 @@ def with_streaming_response(self) -> ScmIntegrationsResourceWithStreamingRespons """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return ScmIntegrationsResourceWithStreamingResponse(self) @@ -298,7 +298,7 @@ def with_raw_response(self) -> AsyncScmIntegrationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncScmIntegrationsResourceWithRawResponse(self) @@ -307,7 +307,7 @@ def with_streaming_response(self) -> AsyncScmIntegrationsResourceWithStreamingRe """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncScmIntegrationsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 28bd0787..09de7ed1 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -41,7 +41,7 @@ def with_raw_response(self) -> PoliciesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return PoliciesResourceWithRawResponse(self) @@ -50,7 +50,7 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return PoliciesResourceWithStreamingResponse(self) @@ -252,7 +252,7 @@ def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncPoliciesResourceWithRawResponse(self) @@ -261,7 +261,7 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncPoliciesResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 1757c10c..66fc4e7a 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -77,7 +77,7 @@ def with_raw_response(self) -> RunnersResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return RunnersResourceWithRawResponse(self) @@ -86,7 +86,7 @@ def with_streaming_response(self) -> RunnersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return RunnersResourceWithStreamingResponse(self) @@ -467,7 +467,7 @@ def with_raw_response(self) -> AsyncRunnersResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncRunnersResourceWithRawResponse(self) @@ -476,7 +476,7 @@ def with_streaming_response(self) -> AsyncRunnersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncRunnersResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index c335a991..374b4c8f 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -40,7 +40,7 @@ def with_raw_response(self) -> SecretsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return SecretsResourceWithRawResponse(self) @@ -49,7 +49,7 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return SecretsResourceWithStreamingResponse(self) @@ -281,7 +281,7 @@ def with_raw_response(self) -> AsyncSecretsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncSecretsResourceWithRawResponse(self) @@ -290,7 +290,7 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncSecretsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 1632e338..a276f0e1 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -33,7 +33,7 @@ def with_raw_response(self) -> PatsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return PatsResourceWithRawResponse(self) @@ -42,7 +42,7 @@ def with_streaming_response(self) -> PatsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return PatsResourceWithStreamingResponse(self) @@ -173,7 +173,7 @@ def with_raw_response(self) -> AsyncPatsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncPatsResourceWithRawResponse(self) @@ -182,7 +182,7 @@ def with_streaming_response(self) -> AsyncPatsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncPatsResourceWithStreamingResponse(self) diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index f9294b70..03d30abf 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -43,7 +43,7 @@ def with_raw_response(self) -> UsersResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return UsersResourceWithRawResponse(self) @@ -52,7 +52,7 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return UsersResourceWithStreamingResponse(self) @@ -139,7 +139,7 @@ def with_raw_response(self) -> AsyncUsersResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncUsersResourceWithRawResponse(self) @@ -148,7 +148,7 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/gitpod-io/flex-sdk-python#with_streaming_response + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response """ return AsyncUsersResourceWithStreamingResponse(self) From 2f58d36c17fa9f5a9852783201cdafbfff60490c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 08:36:43 +0000 Subject: [PATCH 087/505] chore(internal): version bump (#15) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c4762802..ba6c3483 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1-alpha.0" + ".": "0.1.0-alpha.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 90e98ed3..a62739fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod" -version = "0.0.1-alpha.0" +version = "0.1.0-alpha.1" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 47f502d2..8ed99273 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.0.1-alpha.0" # x-release-please-version +__version__ = "0.1.0-alpha.1" # x-release-please-version From ca2fc8207a040b3400168d73a34901a5e6154530 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 08:51:56 +0000 Subject: [PATCH 088/505] chore: update SDK settings (#16) --- README.md | 9 +++------ pyproject.toml | 2 +- requirements-dev.lock | 12 ++++++------ requirements.lock | 12 ++++++------ 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index d093a21a..7cb4c28b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gitpod Python API library -[![PyPI version](https://img.shields.io/pypi/v/gitpod.svg)](https://pypi.org/project/gitpod/) +[![PyPI version](https://img.shields.io/pypi/v/gitpod-sdk.svg)](https://pypi.org/project/gitpod-sdk/) The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, @@ -15,13 +15,10 @@ The REST API documentation can be found on [docs.gitpod.com](https://docs.gitpod ## Installation ```sh -# install from the production repo -pip install git+ssh://git@github.com/gitpod-io/gitpod-sdk-python.git +# install from PyPI +pip install --pre gitpod-sdk ``` -> [!NOTE] -> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre gitpod` - ## Usage The full API of this library can be found in [api.md](api.md). diff --git a/pyproject.toml b/pyproject.toml index a62739fb..6c133f8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "gitpod" +name = "gitpod-sdk" version = "0.1.0-alpha.1" description = "The official Python library for the gitpod API" dynamic = ["readme"] diff --git a/requirements-dev.lock b/requirements-dev.lock index a0509181..cc60f656 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,7 +12,7 @@ annotated-types==0.6.0 # via pydantic anyio==4.4.0 - # via gitpod + # via gitpod-sdk # via httpx argcomplete==3.1.2 # via nox @@ -25,7 +25,7 @@ dirty-equals==0.6.0 distlib==0.3.7 # via virtualenv distro==1.8.0 - # via gitpod + # via gitpod-sdk exceptiongroup==1.2.2 # via anyio # via pytest @@ -36,7 +36,7 @@ h11==0.14.0 httpcore==1.0.2 # via httpx httpx==0.28.1 - # via gitpod + # via gitpod-sdk # via respx idna==3.4 # via anyio @@ -63,7 +63,7 @@ platformdirs==3.11.0 pluggy==1.5.0 # via pytest pydantic==2.10.3 - # via gitpod + # via gitpod-sdk pydantic-core==2.27.1 # via pydantic pygments==2.18.0 @@ -85,14 +85,14 @@ six==1.16.0 # via python-dateutil sniffio==1.3.0 # via anyio - # via gitpod + # via gitpod-sdk time-machine==2.9.0 tomli==2.0.2 # via mypy # via pytest typing-extensions==4.12.2 # via anyio - # via gitpod + # via gitpod-sdk # via mypy # via pydantic # via pydantic-core diff --git a/requirements.lock b/requirements.lock index 2699011b..65e76183 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,13 +12,13 @@ annotated-types==0.6.0 # via pydantic anyio==4.4.0 - # via gitpod + # via gitpod-sdk # via httpx certifi==2023.7.22 # via httpcore # via httpx distro==1.8.0 - # via gitpod + # via gitpod-sdk exceptiongroup==1.2.2 # via anyio h11==0.14.0 @@ -26,19 +26,19 @@ h11==0.14.0 httpcore==1.0.2 # via httpx httpx==0.28.1 - # via gitpod + # via gitpod-sdk idna==3.4 # via anyio # via httpx pydantic==2.10.3 - # via gitpod + # via gitpod-sdk pydantic-core==2.27.1 # via pydantic sniffio==1.3.0 # via anyio - # via gitpod + # via gitpod-sdk typing-extensions==4.12.2 # via anyio - # via gitpod + # via gitpod-sdk # via pydantic # via pydantic-core From 73c420727380a3cdf3ce035473d8fa6097a8926b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:15:20 +0000 Subject: [PATCH 089/505] feat(api): manual updates (#18) --- .stats.yml | 2 +- .../resources/environments/environments.py | 8 ------- src/gitpod/resources/secrets.py | 18 +++++++++++++++ src/gitpod/types/environment_list_params.py | 3 --- src/gitpod/types/environment_spec.py | 6 +++++ src/gitpod/types/environment_spec_param.py | 6 +++++ .../types/environments/class_list_params.py | 22 +++++++++++++++++++ src/gitpod/types/projects/project_role.py | 4 +++- src/gitpod/types/resource_type.py | 1 + .../environment_class_list_params.py | 22 +++++++++++++++++++ src/gitpod/types/secret.py | 3 +++ src/gitpod/types/secret_create_params.py | 10 +++++++++ .../environments/test_classes.py | 6 +++++ .../test_environment_classes.py | 6 +++++ tests/api_resources/test_environments.py | 6 +++-- tests/api_resources/test_secrets.py | 2 ++ 16 files changed, 110 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1b7c9868..7b2ebfa9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da4c36c6b1d973f481abb8eefdeb085d88eaf37eeaba30d276cb3daa405b6f0c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-36f9d46890bf3667f5a6529bdb156fe1560834ad8187c4271aa0b0024de1adb5.yml diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index d5351884..091b00c5 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -248,7 +248,6 @@ def list( token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -261,8 +260,6 @@ def list( ListEnvironments returns a list of environments that match the query. Args: - organization_id: organization_id is the ID of the organization that contains the environments - pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -279,7 +276,6 @@ def list( body=maybe_transform( { "filter": filter, - "organization_id": organization_id, "pagination": pagination, }, environment_list_params.EnvironmentListParams, @@ -739,7 +735,6 @@ def list( token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -752,8 +747,6 @@ def list( ListEnvironments returns a list of environments that match the query. Args: - organization_id: organization_id is the ID of the organization that contains the environments - pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -770,7 +763,6 @@ def list( body=maybe_transform( { "filter": filter, - "organization_id": organization_id, "pagination": pagination, }, environment_list_params.EnvironmentListParams, diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 374b4c8f..14c6bb4d 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -56,6 +56,7 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: def create( self, *, + container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN, environment_variable: bool | NotGiven = NOT_GIVEN, file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -72,6 +73,13 @@ def create( CreateSecret creates a new secret. Args: + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have + the docker host value must be a valid registry hostname with optional port: + + ``` + this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$") + ``` + environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -98,6 +106,7 @@ def create( "/gitpod.v1.SecretService/CreateSecret", body=maybe_transform( { + "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, "name": name, @@ -297,6 +306,7 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: async def create( self, *, + container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN, environment_variable: bool | NotGiven = NOT_GIVEN, file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -313,6 +323,13 @@ async def create( CreateSecret creates a new secret. Args: + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have + the docker host value must be a valid registry hostname with optional port: + + ``` + this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$") + ``` + environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -339,6 +356,7 @@ async def create( "/gitpod.v1.SecretService/CreateSecret", body=await async_maybe_transform( { + "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, "name": name, diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index 90bd40b4..4fe1e4c0 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -19,9 +19,6 @@ class EnvironmentListParams(TypedDict, total=False): filter: Filter - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the ID of the organization that contains the environments""" - pagination: Pagination """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index 96ea0496..d65c166f 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -83,6 +83,12 @@ class Port(BaseModel): class Secret(BaseModel): + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) + """ + container_registry_basic_auth_host is the hostname of the container registry + that supports basic auth + """ + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) file_path: Optional[str] = FieldInfo(alias="filePath", default=None) diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index 2c1d714e..cad8f657 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -90,6 +90,12 @@ class Port(TypedDict, total=False): class Secret(TypedDict, total=False): + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] + """ + container_registry_basic_auth_host is the hostname of the container registry + that supports basic auth + """ + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] file_path: Annotated[str, PropertyInfo(alias="filePath")] diff --git a/src/gitpod/types/environments/class_list_params.py b/src/gitpod/types/environments/class_list_params.py index 046d982c..1abb82c8 100644 --- a/src/gitpod/types/environments/class_list_params.py +++ b/src/gitpod/types/environments/class_list_params.py @@ -6,6 +6,8 @@ from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from ..runner_kind import RunnerKind +from ..runner_provider import RunnerProvider __all__ = ["ClassListParams", "Filter", "Pagination"] @@ -22,6 +24,14 @@ class ClassListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + can_create_environments: Annotated[Optional[bool], PropertyInfo(alias="canCreateEnvironments")] + """ + can_create_environments filters the response to only environment classes that + can be used to create new environments by the caller. Unlike enabled, which + indicates general availability, this ensures the caller only sees environment + classes they are allowed to use. + """ + enabled: Optional[bool] """ enabled filters the response to only enabled or disabled environment classes. If @@ -31,6 +41,18 @@ class Filter(TypedDict, total=False): runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" + runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] + """ + runner_kind filters the response to only environment classes from runners of + these kinds. + """ + + runner_providers: Annotated[List[RunnerProvider], PropertyInfo(alias="runnerProviders")] + """ + runner_providers filters the response to only environment classes from runners + of these providers. + """ + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/projects/project_role.py b/src/gitpod/types/projects/project_role.py index b2a6261c..e488d522 100644 --- a/src/gitpod/types/projects/project_role.py +++ b/src/gitpod/types/projects/project_role.py @@ -4,4 +4,6 @@ __all__ = ["ProjectRole"] -ProjectRole: TypeAlias = Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] +ProjectRole: TypeAlias = Literal[ + "PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER", "PROJECT_ROLE_EDITOR" +] diff --git a/src/gitpod/types/resource_type.py b/src/gitpod/types/resource_type.py index c34eaea7..ed64eeeb 100644 --- a/src/gitpod/types/resource_type.py +++ b/src/gitpod/types/resource_type.py @@ -23,4 +23,5 @@ "RESOURCE_TYPE_SERVICE_ACCOUNT", "RESOURCE_TYPE_SECRET", "RESOURCE_TYPE_SSO_CONFIG", + "RESOURCE_TYPE_DOMAIN_VERIFICATION", ] diff --git a/src/gitpod/types/runners/configurations/environment_class_list_params.py b/src/gitpod/types/runners/configurations/environment_class_list_params.py index c5c59b15..14cdf32d 100644 --- a/src/gitpod/types/runners/configurations/environment_class_list_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_params.py @@ -6,6 +6,8 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from ...runner_kind import RunnerKind +from ...runner_provider import RunnerProvider __all__ = ["EnvironmentClassListParams", "Filter", "Pagination"] @@ -22,6 +24,14 @@ class EnvironmentClassListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + can_create_environments: Annotated[Optional[bool], PropertyInfo(alias="canCreateEnvironments")] + """ + can_create_environments filters the response to only environment classes that + can be used to create new environments by the caller. Unlike enabled, which + indicates general availability, this ensures the caller only sees environment + classes they are allowed to use. + """ + enabled: Optional[bool] """ enabled filters the response to only enabled or disabled environment classes. If @@ -31,6 +41,18 @@ class Filter(TypedDict, total=False): runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" + runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] + """ + runner_kind filters the response to only environment classes from runners of + these kinds. + """ + + runner_providers: Annotated[List[RunnerProvider], PropertyInfo(alias="runnerProviders")] + """ + runner_providers filters the response to only environment classes from runners + of these providers. + """ + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/secret.py b/src/gitpod/types/secret.py index 13e91d3a..e994fa73 100644 --- a/src/gitpod/types/secret.py +++ b/src/gitpod/types/secret.py @@ -14,6 +14,9 @@ class Secret(BaseModel): id: Optional[str] = None + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) + """secret will be mounted as a registry secret""" + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index 99447e01..81da5d9f 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -10,6 +10,16 @@ class SecretCreateParams(TypedDict, total=False): + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] + """ + secret will be mounted as a docker config in the environment VM, mount will have + the docker host value must be a valid registry hostname with optional port: + + ``` + this.matches('^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$') + ``` + """ + environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] """ secret will be created as an Environment Variable with the same name as the diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index f097f89b..ba3893e4 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -31,8 +31,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", @@ -80,8 +83,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index de30bc15..0c47b397 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -154,8 +154,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", @@ -324,8 +327,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 992d3b26..811daf89 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -78,6 +78,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -256,7 +257,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -377,6 +377,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -625,6 +626,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -803,7 +805,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -924,6 +925,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index ce957788..439581a3 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -32,6 +32,7 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( + container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="name", @@ -227,6 +228,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( + container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="name", From 1b8df09188cac540d15da43c75276db6ec26a682 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:15:53 +0000 Subject: [PATCH 090/505] feat(api): manual updates (#19) --- .stats.yml | 2 +- api.md | 23 + src/gitpod/pagination.py | 53 ++ .../resources/organizations/__init__.py | 14 + .../organizations/domain_verifications.py | 554 ++++++++++++++++++ .../resources/organizations/organizations.py | 32 + src/gitpod/types/organizations/__init__.py | 12 + .../organizations/domain_verification.py | 113 ++++ .../domain_verification_create_params.py | 15 + .../domain_verification_create_response.py | 14 + .../domain_verification_delete_params.py | 13 + .../domain_verification_list_params.py | 33 ++ .../domain_verification_retrieve_params.py | 13 + .../domain_verification_retrieve_response.py | 14 + .../domain_verification_state.py | 9 + .../domain_verification_verify_params.py | 13 + .../domain_verification_verify_response.py | 14 + .../test_domain_verifications.py | 404 +++++++++++++ 18 files changed, 1344 insertions(+), 1 deletion(-) create mode 100644 src/gitpod/resources/organizations/domain_verifications.py create mode 100644 src/gitpod/types/organizations/domain_verification.py create mode 100644 src/gitpod/types/organizations/domain_verification_create_params.py create mode 100644 src/gitpod/types/organizations/domain_verification_create_response.py create mode 100644 src/gitpod/types/organizations/domain_verification_delete_params.py create mode 100644 src/gitpod/types/organizations/domain_verification_list_params.py create mode 100644 src/gitpod/types/organizations/domain_verification_retrieve_params.py create mode 100644 src/gitpod/types/organizations/domain_verification_retrieve_response.py create mode 100644 src/gitpod/types/organizations/domain_verification_state.py create mode 100644 src/gitpod/types/organizations/domain_verification_verify_params.py create mode 100644 src/gitpod/types/organizations/domain_verification_verify_response.py create mode 100644 tests/api_resources/organizations/test_domain_verifications.py diff --git a/.stats.yml b/.stats.yml index 7b2ebfa9..87b67dee 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 106 +configured_endpoints: 111 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-36f9d46890bf3667f5a6529bdb156fe1560834ad8187c4271aa0b0024de1adb5.yml diff --git a/api.md b/api.md index 40b1aeab..d7e5d8e8 100644 --- a/api.md +++ b/api.md @@ -259,6 +259,29 @@ Methods: - client.organizations.list_members(\*\*params) -> SyncMembersPage[OrganizationMember] - client.organizations.set_role(\*\*params) -> object +## DomainVerifications + +Types: + +```python +from gitpod.types.organizations import ( + DomainVerification, + DomainVerificationState, + DomainVerificationCreateResponse, + DomainVerificationRetrieveResponse, + DomainVerificationDeleteResponse, + DomainVerificationVerifyResponse, +) +``` + +Methods: + +- client.organizations.domain_verifications.create(\*\*params) -> DomainVerificationCreateResponse +- client.organizations.domain_verifications.retrieve(\*\*params) -> DomainVerificationRetrieveResponse +- client.organizations.domain_verifications.list(\*\*params) -> SyncDomainVerificationsPage[DomainVerification] +- client.organizations.domain_verifications.delete(\*\*params) -> object +- client.organizations.domain_verifications.verify(\*\*params) -> DomainVerificationVerifyResponse + ## Invites Types: diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 393e2f83..a8e74f8f 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -9,6 +9,9 @@ from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ + "DomainVerificationsPagePagination", + "SyncDomainVerificationsPage", + "AsyncDomainVerificationsPage", "EditorsPagePagination", "SyncEditorsPage", "AsyncEditorsPage", @@ -71,6 +74,56 @@ _T = TypeVar("_T") +class DomainVerificationsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncDomainVerificationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + domain_verifications: List[_T] = FieldInfo(alias="domainVerifications") + pagination: Optional[DomainVerificationsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + domain_verifications = self.domain_verifications + if not domain_verifications: + return [] + return domain_verifications + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncDomainVerificationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + domain_verifications: List[_T] = FieldInfo(alias="domainVerifications") + pagination: Optional[DomainVerificationsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + domain_verifications = self.domain_verifications + if not domain_verifications: + return [] + return domain_verifications + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class EditorsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py index 164bee21..3b7cf4ed 100644 --- a/src/gitpod/resources/organizations/__init__.py +++ b/src/gitpod/resources/organizations/__init__.py @@ -24,8 +24,22 @@ SSOConfigurationsResourceWithStreamingResponse, AsyncSSOConfigurationsResourceWithStreamingResponse, ) +from .domain_verifications import ( + DomainVerificationsResource, + AsyncDomainVerificationsResource, + DomainVerificationsResourceWithRawResponse, + AsyncDomainVerificationsResourceWithRawResponse, + DomainVerificationsResourceWithStreamingResponse, + AsyncDomainVerificationsResourceWithStreamingResponse, +) __all__ = [ + "DomainVerificationsResource", + "AsyncDomainVerificationsResource", + "DomainVerificationsResourceWithRawResponse", + "AsyncDomainVerificationsResourceWithRawResponse", + "DomainVerificationsResourceWithStreamingResponse", + "AsyncDomainVerificationsResourceWithStreamingResponse", "InvitesResource", "AsyncInvitesResource", "InvitesResourceWithRawResponse", diff --git a/src/gitpod/resources/organizations/domain_verifications.py b/src/gitpod/resources/organizations/domain_verifications.py new file mode 100644 index 00000000..37612897 --- /dev/null +++ b/src/gitpod/resources/organizations/domain_verifications.py @@ -0,0 +1,554 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncDomainVerificationsPage, AsyncDomainVerificationsPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.organizations import ( + domain_verification_list_params, + domain_verification_create_params, + domain_verification_delete_params, + domain_verification_verify_params, + domain_verification_retrieve_params, +) +from ...types.organizations.domain_verification import DomainVerification +from ...types.organizations.domain_verification_create_response import DomainVerificationCreateResponse +from ...types.organizations.domain_verification_verify_response import DomainVerificationVerifyResponse +from ...types.organizations.domain_verification_retrieve_response import DomainVerificationRetrieveResponse + +__all__ = ["DomainVerificationsResource", "AsyncDomainVerificationsResource"] + + +class DomainVerificationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DomainVerificationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return DomainVerificationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DomainVerificationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return DomainVerificationsResourceWithStreamingResponse(self) + + def create( + self, + *, + domain: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationCreateResponse: + """ + CreateDomainVerification creates a new domain verification request + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/CreateDomainVerification", + body=maybe_transform( + { + "domain": domain, + "organization_id": organization_id, + }, + domain_verification_create_params.DomainVerificationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationCreateResponse, + ) + + def retrieve( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationRetrieveResponse: + """ + GetDomainVerification retrieves a domain verification request + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/GetDomainVerification", + body=maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_retrieve_params.DomainVerificationRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationRetrieveResponse, + ) + + def list( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncDomainVerificationsPage[DomainVerification]: + """ + ListDomainVerifications lists all domain verifications for an organization + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListDomainVerifications", + page=SyncDomainVerificationsPage[DomainVerification], + body=maybe_transform( + { + "organization_id": organization_id, + "pagination": pagination, + }, + domain_verification_list_params.DomainVerificationListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + domain_verification_list_params.DomainVerificationListParams, + ), + ), + model=DomainVerification, + method="post", + ) + + def delete( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteDomainVerification deletes a domain verification request + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/DeleteDomainVerification", + body=maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_delete_params.DomainVerificationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def verify( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationVerifyResponse: + """ + VerifyDomain verifies a domain ownership + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/VerifyDomain", + body=maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_verify_params.DomainVerificationVerifyParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationVerifyResponse, + ) + + +class AsyncDomainVerificationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDomainVerificationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncDomainVerificationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDomainVerificationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncDomainVerificationsResourceWithStreamingResponse(self) + + async def create( + self, + *, + domain: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationCreateResponse: + """ + CreateDomainVerification creates a new domain verification request + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/CreateDomainVerification", + body=await async_maybe_transform( + { + "domain": domain, + "organization_id": organization_id, + }, + domain_verification_create_params.DomainVerificationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationCreateResponse, + ) + + async def retrieve( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationRetrieveResponse: + """ + GetDomainVerification retrieves a domain verification request + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/GetDomainVerification", + body=await async_maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_retrieve_params.DomainVerificationRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationRetrieveResponse, + ) + + def list( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[DomainVerification, AsyncDomainVerificationsPage[DomainVerification]]: + """ + ListDomainVerifications lists all domain verifications for an organization + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListDomainVerifications", + page=AsyncDomainVerificationsPage[DomainVerification], + body=maybe_transform( + { + "organization_id": organization_id, + "pagination": pagination, + }, + domain_verification_list_params.DomainVerificationListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + domain_verification_list_params.DomainVerificationListParams, + ), + ), + model=DomainVerification, + method="post", + ) + + async def delete( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteDomainVerification deletes a domain verification request + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/DeleteDomainVerification", + body=await async_maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_delete_params.DomainVerificationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def verify( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationVerifyResponse: + """ + VerifyDomain verifies a domain ownership + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/VerifyDomain", + body=await async_maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_verify_params.DomainVerificationVerifyParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationVerifyResponse, + ) + + +class DomainVerificationsResourceWithRawResponse: + def __init__(self, domain_verifications: DomainVerificationsResource) -> None: + self._domain_verifications = domain_verifications + + self.create = to_raw_response_wrapper( + domain_verifications.create, + ) + self.retrieve = to_raw_response_wrapper( + domain_verifications.retrieve, + ) + self.list = to_raw_response_wrapper( + domain_verifications.list, + ) + self.delete = to_raw_response_wrapper( + domain_verifications.delete, + ) + self.verify = to_raw_response_wrapper( + domain_verifications.verify, + ) + + +class AsyncDomainVerificationsResourceWithRawResponse: + def __init__(self, domain_verifications: AsyncDomainVerificationsResource) -> None: + self._domain_verifications = domain_verifications + + self.create = async_to_raw_response_wrapper( + domain_verifications.create, + ) + self.retrieve = async_to_raw_response_wrapper( + domain_verifications.retrieve, + ) + self.list = async_to_raw_response_wrapper( + domain_verifications.list, + ) + self.delete = async_to_raw_response_wrapper( + domain_verifications.delete, + ) + self.verify = async_to_raw_response_wrapper( + domain_verifications.verify, + ) + + +class DomainVerificationsResourceWithStreamingResponse: + def __init__(self, domain_verifications: DomainVerificationsResource) -> None: + self._domain_verifications = domain_verifications + + self.create = to_streamed_response_wrapper( + domain_verifications.create, + ) + self.retrieve = to_streamed_response_wrapper( + domain_verifications.retrieve, + ) + self.list = to_streamed_response_wrapper( + domain_verifications.list, + ) + self.delete = to_streamed_response_wrapper( + domain_verifications.delete, + ) + self.verify = to_streamed_response_wrapper( + domain_verifications.verify, + ) + + +class AsyncDomainVerificationsResourceWithStreamingResponse: + def __init__(self, domain_verifications: AsyncDomainVerificationsResource) -> None: + self._domain_verifications = domain_verifications + + self.create = async_to_streamed_response_wrapper( + domain_verifications.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + domain_verifications.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + domain_verifications.list, + ) + self.delete = async_to_streamed_response_wrapper( + domain_verifications.delete, + ) + self.verify = async_to_streamed_response_wrapper( + domain_verifications.verify, + ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index d10cb521..8707b720 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -51,6 +51,14 @@ AsyncSSOConfigurationsResourceWithStreamingResponse, ) from ...types.organization import Organization +from .domain_verifications import ( + DomainVerificationsResource, + AsyncDomainVerificationsResource, + DomainVerificationsResourceWithRawResponse, + AsyncDomainVerificationsResourceWithRawResponse, + DomainVerificationsResourceWithStreamingResponse, + AsyncDomainVerificationsResourceWithStreamingResponse, +) from ...types.organization_member import OrganizationMember from ...types.invite_domains_param import InviteDomainsParam from ...types.shared.organization_role import OrganizationRole @@ -63,6 +71,10 @@ class OrganizationsResource(SyncAPIResource): + @cached_property + def domain_verifications(self) -> DomainVerificationsResource: + return DomainVerificationsResource(self._client) + @cached_property def invites(self) -> InvitesResource: return InvitesResource(self._client) @@ -490,6 +502,10 @@ def set_role( class AsyncOrganizationsResource(AsyncAPIResource): + @cached_property + def domain_verifications(self) -> AsyncDomainVerificationsResource: + return AsyncDomainVerificationsResource(self._client) + @cached_property def invites(self) -> AsyncInvitesResource: return AsyncInvitesResource(self._client) @@ -948,6 +964,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def domain_verifications(self) -> DomainVerificationsResourceWithRawResponse: + return DomainVerificationsResourceWithRawResponse(self._organizations.domain_verifications) + @cached_property def invites(self) -> InvitesResourceWithRawResponse: return InvitesResourceWithRawResponse(self._organizations.invites) @@ -989,6 +1009,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def domain_verifications(self) -> AsyncDomainVerificationsResourceWithRawResponse: + return AsyncDomainVerificationsResourceWithRawResponse(self._organizations.domain_verifications) + @cached_property def invites(self) -> AsyncInvitesResourceWithRawResponse: return AsyncInvitesResourceWithRawResponse(self._organizations.invites) @@ -1030,6 +1054,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def domain_verifications(self) -> DomainVerificationsResourceWithStreamingResponse: + return DomainVerificationsResourceWithStreamingResponse(self._organizations.domain_verifications) + @cached_property def invites(self) -> InvitesResourceWithStreamingResponse: return InvitesResourceWithStreamingResponse(self._organizations.invites) @@ -1071,6 +1099,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def domain_verifications(self) -> AsyncDomainVerificationsResourceWithStreamingResponse: + return AsyncDomainVerificationsResourceWithStreamingResponse(self._organizations.domain_verifications) + @cached_property def invites(self) -> AsyncInvitesResourceWithStreamingResponse: return AsyncInvitesResourceWithStreamingResponse(self._organizations.invites) diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index ce9a3996..83301d79 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -4,18 +4,30 @@ from .provider_type import ProviderType as ProviderType from .sso_configuration import SSOConfiguration as SSOConfiguration +from .domain_verification import DomainVerification as DomainVerification from .organization_invite import OrganizationInvite as OrganizationInvite from .invite_create_params import InviteCreateParams as InviteCreateParams from .invite_create_response import InviteCreateResponse as InviteCreateResponse from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams from .sso_configuration_state import SSOConfigurationState as SSOConfigurationState from .invite_retrieve_response import InviteRetrieveResponse as InviteRetrieveResponse +from .domain_verification_state import DomainVerificationState as DomainVerificationState from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams from .invite_get_summary_response import InviteGetSummaryResponse as InviteGetSummaryResponse from .sso_configuration_list_params import SSOConfigurationListParams as SSOConfigurationListParams +from .domain_verification_list_params import DomainVerificationListParams as DomainVerificationListParams from .sso_configuration_create_params import SSOConfigurationCreateParams as SSOConfigurationCreateParams from .sso_configuration_delete_params import SSOConfigurationDeleteParams as SSOConfigurationDeleteParams from .sso_configuration_update_params import SSOConfigurationUpdateParams as SSOConfigurationUpdateParams +from .domain_verification_create_params import DomainVerificationCreateParams as DomainVerificationCreateParams +from .domain_verification_delete_params import DomainVerificationDeleteParams as DomainVerificationDeleteParams +from .domain_verification_verify_params import DomainVerificationVerifyParams as DomainVerificationVerifyParams from .sso_configuration_create_response import SSOConfigurationCreateResponse as SSOConfigurationCreateResponse from .sso_configuration_retrieve_params import SSOConfigurationRetrieveParams as SSOConfigurationRetrieveParams +from .domain_verification_create_response import DomainVerificationCreateResponse as DomainVerificationCreateResponse +from .domain_verification_retrieve_params import DomainVerificationRetrieveParams as DomainVerificationRetrieveParams +from .domain_verification_verify_response import DomainVerificationVerifyResponse as DomainVerificationVerifyResponse from .sso_configuration_retrieve_response import SSOConfigurationRetrieveResponse as SSOConfigurationRetrieveResponse +from .domain_verification_retrieve_response import ( + DomainVerificationRetrieveResponse as DomainVerificationRetrieveResponse, +) diff --git a/src/gitpod/types/organizations/domain_verification.py b/src/gitpod/types/organizations/domain_verification.py new file mode 100644 index 00000000..04d9847a --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification.py @@ -0,0 +1,113 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .domain_verification_state import DomainVerificationState + +__all__ = ["DomainVerification"] + + +class DomainVerification(BaseModel): + id: Optional[str] = None + + domain: Optional[str] = None + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + + state: Optional[DomainVerificationState] = None + + verified_at: Optional[datetime] = FieldInfo(alias="verifiedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ diff --git a/src/gitpod/types/organizations/domain_verification_create_params.py b/src/gitpod/types/organizations/domain_verification_create_params.py new file mode 100644 index 00000000..317c1589 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_create_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["DomainVerificationCreateParams"] + + +class DomainVerificationCreateParams(TypedDict, total=False): + domain: str + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] diff --git a/src/gitpod/types/organizations/domain_verification_create_response.py b/src/gitpod/types/organizations/domain_verification_create_response.py new file mode 100644 index 00000000..c42eb645 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_create_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .domain_verification import DomainVerification + +__all__ = ["DomainVerificationCreateResponse"] + + +class DomainVerificationCreateResponse(BaseModel): + domain_verification: Optional[DomainVerification] = FieldInfo(alias="domainVerification", default=None) diff --git a/src/gitpod/types/organizations/domain_verification_delete_params.py b/src/gitpod/types/organizations/domain_verification_delete_params.py new file mode 100644 index 00000000..15025b93 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_delete_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["DomainVerificationDeleteParams"] + + +class DomainVerificationDeleteParams(TypedDict, total=False): + domain_verification_id: Annotated[str, PropertyInfo(alias="domainVerificationId")] diff --git a/src/gitpod/types/organizations/domain_verification_list_params.py b/src/gitpod/types/organizations/domain_verification_list_params.py new file mode 100644 index 00000000..dfa94c2a --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_list_params.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["DomainVerificationListParams", "Pagination"] + + +class DomainVerificationListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + + pagination: Pagination + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/organizations/domain_verification_retrieve_params.py b/src/gitpod/types/organizations/domain_verification_retrieve_params.py new file mode 100644 index 00000000..c4717202 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_retrieve_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["DomainVerificationRetrieveParams"] + + +class DomainVerificationRetrieveParams(TypedDict, total=False): + domain_verification_id: Annotated[str, PropertyInfo(alias="domainVerificationId")] diff --git a/src/gitpod/types/organizations/domain_verification_retrieve_response.py b/src/gitpod/types/organizations/domain_verification_retrieve_response.py new file mode 100644 index 00000000..06d27377 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_retrieve_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .domain_verification import DomainVerification + +__all__ = ["DomainVerificationRetrieveResponse"] + + +class DomainVerificationRetrieveResponse(BaseModel): + domain_verification: Optional[DomainVerification] = FieldInfo(alias="domainVerification", default=None) diff --git a/src/gitpod/types/organizations/domain_verification_state.py b/src/gitpod/types/organizations/domain_verification_state.py new file mode 100644 index 00000000..cc7a6d89 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_state.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DomainVerificationState"] + +DomainVerificationState: TypeAlias = Literal[ + "DOMAIN_VERIFICATION_STATE_UNSPECIFIED", "DOMAIN_VERIFICATION_STATE_PENDING", "DOMAIN_VERIFICATION_STATE_VERIFIED" +] diff --git a/src/gitpod/types/organizations/domain_verification_verify_params.py b/src/gitpod/types/organizations/domain_verification_verify_params.py new file mode 100644 index 00000000..7f96c204 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_verify_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["DomainVerificationVerifyParams"] + + +class DomainVerificationVerifyParams(TypedDict, total=False): + domain_verification_id: Annotated[str, PropertyInfo(alias="domainVerificationId")] diff --git a/src/gitpod/types/organizations/domain_verification_verify_response.py b/src/gitpod/types/organizations/domain_verification_verify_response.py new file mode 100644 index 00000000..91c00533 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_verify_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .domain_verification import DomainVerification + +__all__ = ["DomainVerificationVerifyResponse"] + + +class DomainVerificationVerifyResponse(BaseModel): + domain_verification: Optional[DomainVerification] = FieldInfo(alias="domainVerification", default=None) diff --git a/tests/api_resources/organizations/test_domain_verifications.py b/tests/api_resources/organizations/test_domain_verifications.py new file mode 100644 index 00000000..9a170cf5 --- /dev/null +++ b/tests/api_resources/organizations/test_domain_verifications.py @@ -0,0 +1,404 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.pagination import SyncDomainVerificationsPage, AsyncDomainVerificationsPage +from gitpod.types.organizations import ( + DomainVerification, + DomainVerificationCreateResponse, + DomainVerificationVerifyResponse, + DomainVerificationRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDomainVerifications: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + def test_method_create(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.create() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.create( + domain="xxxx", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.retrieve() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.retrieve( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_list(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.list() + assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.list( + token="token", + page_size=0, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.delete() + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.delete( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(object, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_verify(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.verify() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_verify_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.verify( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_verify(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.verify() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_verify(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.verify() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncDomainVerifications: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.create() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.create( + domain="xxxx", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.retrieve() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.retrieve( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.list() + assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.list( + token="token", + page_size=0, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type( + AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.delete() + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.delete( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type(object, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_verify(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.verify() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_verify_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.verify( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.verify() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_verify(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.verify() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True From 134bc0c659cb0151609db29b56fd941f14c36b59 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 08:41:46 +0000 Subject: [PATCH 091/505] feat(api): manual updates (#20) --- api.md | 8 ++++---- .../environments/automations/tasks/tasks.py | 14 +++++++------- src/gitpod/types/__init__.py | 3 +++ .../types/environments/automations/__init__.py | 5 ----- .../environments/automations/task_create_params.py | 8 ++++---- .../automations/task_create_response.py | 2 +- .../automations/task_retrieve_response.py | 2 +- src/gitpod/types/shared/__init__.py | 3 +++ .../{environments/automations => shared}/task.py | 2 +- src/gitpod/types/shared/task_execution_spec.py | 2 +- .../automations => shared}/task_metadata.py | 6 +++--- .../automations => shared}/task_spec.py | 4 ++-- src/gitpod/types/shared_params/__init__.py | 2 ++ .../task_metadata.py} | 10 +++++----- .../task_spec.py} | 8 ++++---- .../environments/automations/test_tasks.py | 2 +- 16 files changed, 42 insertions(+), 39 deletions(-) rename src/gitpod/types/{environments/automations => shared}/task.py (94%) rename src/gitpod/types/{environments/automations => shared}/task_metadata.py (97%) rename src/gitpod/types/{environments/automations => shared}/task_spec.py (86%) rename src/gitpod/types/{environments/automations/task_metadata_param.py => shared_params/task_metadata.py} (95%) rename src/gitpod/types/{environments/automations/task_spec_param.py => shared_params/task_spec.py} (71%) diff --git a/api.md b/api.md index d7e5d8e8..d6933bfb 100644 --- a/api.md +++ b/api.md @@ -9,11 +9,14 @@ from gitpod.types import ( Principal, RunsOn, Subject, + Task, TaskExecution, TaskExecutionMetadata, TaskExecutionPhase, TaskExecutionSpec, TaskExecutionStatus, + TaskMetadata, + TaskSpec, UserStatus, ) ``` @@ -141,9 +144,6 @@ Types: ```python from gitpod.types.environments.automations import ( - Task, - TaskMetadata, - TaskSpec, TaskCreateResponse, TaskRetrieveResponse, TaskUpdateResponse, @@ -157,7 +157,7 @@ Methods: - client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse - client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse - client.environments.automations.tasks.update(\*\*params) -> object -- client.environments.automations.tasks.list(\*\*params) -> SyncTasksPage[Task] +- client.environments.automations.tasks.list(\*\*params) -> SyncTasksPage[Task] - client.environments.automations.tasks.delete(\*\*params) -> object - client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 1e0b197c..98581635 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -29,6 +29,8 @@ ) from .....pagination import SyncTasksPage, AsyncTasksPage from ....._base_client import AsyncPaginator, make_request_options +from .....types.shared.task import Task +from .....types.shared_params.task_spec import TaskSpec from .....types.environments.automations import ( task_list_params, task_start_params, @@ -37,9 +39,7 @@ task_update_params, task_retrieve_params, ) -from .....types.environments.automations.task import Task -from .....types.environments.automations.task_spec_param import TaskSpecParam -from .....types.environments.automations.task_metadata_param import TaskMetadataParam +from .....types.shared_params.task_metadata import TaskMetadata from .....types.environments.automations.task_start_response import TaskStartResponse from .....types.environments.automations.task_create_response import TaskCreateResponse from .....types.environments.automations.task_retrieve_response import TaskRetrieveResponse @@ -76,8 +76,8 @@ def create( *, depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - metadata: TaskMetadataParam | NotGiven = NOT_GIVEN, - spec: TaskSpecParam | NotGiven = NOT_GIVEN, + metadata: TaskMetadata | NotGiven = NOT_GIVEN, + spec: TaskSpec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -344,8 +344,8 @@ async def create( *, depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - metadata: TaskMetadataParam | NotGiven = NOT_GIVEN, - spec: TaskSpecParam | NotGiven = NOT_GIVEN, + metadata: TaskMetadata | NotGiven = NOT_GIVEN, + spec: TaskSpec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 1ff00e1c..03e376b2 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -9,11 +9,14 @@ from .runner import Runner as Runner from .secret import Secret as Secret from .shared import ( + Task as Task, RunsOn as RunsOn, Subject as Subject, + TaskSpec as TaskSpec, Principal as Principal, FieldValue as FieldValue, UserStatus as UserStatus, + TaskMetadata as TaskMetadata, TaskExecution as TaskExecution, EnvironmentClass as EnvironmentClass, OrganizationRole as OrganizationRole, diff --git a/src/gitpod/types/environments/automations/__init__.py b/src/gitpod/types/environments/automations/__init__.py index 11a40e65..d6c647a7 100644 --- a/src/gitpod/types/environments/automations/__init__.py +++ b/src/gitpod/types/environments/automations/__init__.py @@ -2,14 +2,10 @@ from __future__ import annotations -from .task import Task as Task from .service import Service as Service -from .task_spec import TaskSpec as TaskSpec from .service_spec import ServiceSpec as ServiceSpec from .service_phase import ServicePhase as ServicePhase -from .task_metadata import TaskMetadata as TaskMetadata from .service_status import ServiceStatus as ServiceStatus -from .task_spec_param import TaskSpecParam as TaskSpecParam from .service_metadata import ServiceMetadata as ServiceMetadata from .task_list_params import TaskListParams as TaskListParams from .task_start_params import TaskStartParams as TaskStartParams @@ -19,7 +15,6 @@ from .task_update_params import TaskUpdateParams as TaskUpdateParams from .service_list_params import ServiceListParams as ServiceListParams from .service_stop_params import ServiceStopParams as ServiceStopParams -from .task_metadata_param import TaskMetadataParam as TaskMetadataParam from .task_start_response import TaskStartResponse as TaskStartResponse from .service_start_params import ServiceStartParams as ServiceStartParams from .task_create_response import TaskCreateResponse as TaskCreateResponse diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index 331519ba..5bb8916f 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -6,8 +6,8 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -from .task_spec_param import TaskSpecParam -from .task_metadata_param import TaskMetadataParam +from ...shared_params.task_spec import TaskSpec +from ...shared_params.task_metadata import TaskMetadata __all__ = ["TaskCreateParams"] @@ -17,6 +17,6 @@ class TaskCreateParams(TypedDict, total=False): environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - metadata: TaskMetadataParam + metadata: TaskMetadata - spec: TaskSpecParam + spec: TaskSpec diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index 511677b1..4845e6be 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -2,8 +2,8 @@ from typing import Optional -from .task import Task from ...._models import BaseModel +from ...shared.task import Task __all__ = ["TaskCreateResponse"] diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index 557cccee..0f01e7bb 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -2,8 +2,8 @@ from typing import Optional -from .task import Task from ...._models import BaseModel +from ...shared.task import Task __all__ = ["TaskRetrieveResponse"] diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index 4911a8a7..ba0e2567 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -1,10 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .task import Task as Task from .runs_on import RunsOn as RunsOn from .subject import Subject as Subject from .principal import Principal as Principal +from .task_spec import TaskSpec as TaskSpec from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus +from .task_metadata import TaskMetadata as TaskMetadata from .task_execution import TaskExecution as TaskExecution from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole diff --git a/src/gitpod/types/environments/automations/task.py b/src/gitpod/types/shared/task.py similarity index 94% rename from src/gitpod/types/environments/automations/task.py rename to src/gitpod/types/shared/task.py index 01d91d11..95e85661 100644 --- a/src/gitpod/types/environments/automations/task.py +++ b/src/gitpod/types/shared/task.py @@ -4,8 +4,8 @@ from pydantic import Field as FieldInfo +from ..._models import BaseModel from .task_spec import TaskSpec -from ...._models import BaseModel from .task_metadata import TaskMetadata __all__ = ["Task"] diff --git a/src/gitpod/types/shared/task_execution_spec.py b/src/gitpod/types/shared/task_execution_spec.py index 923f5f6d..17a4bff3 100644 --- a/src/gitpod/types/shared/task_execution_spec.py +++ b/src/gitpod/types/shared/task_execution_spec.py @@ -5,8 +5,8 @@ from pydantic import Field as FieldInfo from ..._models import BaseModel +from .task_spec import TaskSpec from .task_execution_phase import TaskExecutionPhase -from ..environments.automations.task_spec import TaskSpec __all__ = ["TaskExecutionSpec", "Plan", "PlanStep", "PlanStepTask"] diff --git a/src/gitpod/types/environments/automations/task_metadata.py b/src/gitpod/types/shared/task_metadata.py similarity index 97% rename from src/gitpod/types/environments/automations/task_metadata.py rename to src/gitpod/types/shared/task_metadata.py index f99f98ee..23e6c2c1 100644 --- a/src/gitpod/types/environments/automations/task_metadata.py +++ b/src/gitpod/types/shared/task_metadata.py @@ -5,9 +5,9 @@ from pydantic import Field as FieldInfo -from ...._models import BaseModel -from ...shared.subject import Subject -from ...shared.automation_trigger import AutomationTrigger +from .subject import Subject +from ..._models import BaseModel +from .automation_trigger import AutomationTrigger __all__ = ["TaskMetadata"] diff --git a/src/gitpod/types/environments/automations/task_spec.py b/src/gitpod/types/shared/task_spec.py similarity index 86% rename from src/gitpod/types/environments/automations/task_spec.py rename to src/gitpod/types/shared/task_spec.py index 3d1d0f13..c69815fb 100644 --- a/src/gitpod/types/environments/automations/task_spec.py +++ b/src/gitpod/types/shared/task_spec.py @@ -4,8 +4,8 @@ from pydantic import Field as FieldInfo -from ...._models import BaseModel -from ...shared.runs_on import RunsOn +from .runs_on import RunsOn +from ..._models import BaseModel __all__ = ["TaskSpec"] diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index d98911f7..51915e7a 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -3,7 +3,9 @@ from .runs_on import RunsOn as RunsOn from .subject import Subject as Subject from .principal import Principal as Principal +from .task_spec import TaskSpec as TaskSpec from .field_value import FieldValue as FieldValue +from .task_metadata import TaskMetadata as TaskMetadata from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole from .automation_trigger import AutomationTrigger as AutomationTrigger diff --git a/src/gitpod/types/environments/automations/task_metadata_param.py b/src/gitpod/types/shared_params/task_metadata.py similarity index 95% rename from src/gitpod/types/environments/automations/task_metadata_param.py rename to src/gitpod/types/shared_params/task_metadata.py index 9331c97e..50ffda7e 100644 --- a/src/gitpod/types/environments/automations/task_metadata_param.py +++ b/src/gitpod/types/shared_params/task_metadata.py @@ -6,14 +6,14 @@ from datetime import datetime from typing_extensions import Annotated, TypedDict -from ...._utils import PropertyInfo -from ...shared_params.subject import Subject -from ...shared_params.automation_trigger import AutomationTrigger +from .subject import Subject +from ..._utils import PropertyInfo +from .automation_trigger import AutomationTrigger -__all__ = ["TaskMetadataParam"] +__all__ = ["TaskMetadata"] -class TaskMetadataParam(TypedDict, total=False): +class TaskMetadata(TypedDict, total=False): created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] """ A Timestamp represents a point in time independent of any time zone or local diff --git a/src/gitpod/types/environments/automations/task_spec_param.py b/src/gitpod/types/shared_params/task_spec.py similarity index 71% rename from src/gitpod/types/environments/automations/task_spec_param.py rename to src/gitpod/types/shared_params/task_spec.py index bf0c6294..5f40eef4 100644 --- a/src/gitpod/types/environments/automations/task_spec_param.py +++ b/src/gitpod/types/shared_params/task_spec.py @@ -4,13 +4,13 @@ from typing_extensions import Annotated, TypedDict -from ...._utils import PropertyInfo -from ...shared_params.runs_on import RunsOn +from .runs_on import RunsOn +from ..._utils import PropertyInfo -__all__ = ["TaskSpecParam"] +__all__ = ["TaskSpec"] -class TaskSpecParam(TypedDict, total=False): +class TaskSpec(TypedDict, total=False): command: str """command contains the command the task should execute""" diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 4cee7ae4..adcf14f8 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from gitpod._utils import parse_datetime from gitpod.pagination import SyncTasksPage, AsyncTasksPage +from gitpod.types.shared import Task from gitpod.types.environments.automations import ( - Task, TaskStartResponse, TaskCreateResponse, TaskRetrieveResponse, From b34e1c14ca186952cd7e0b9c614b2f7d9456e2de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 09:08:35 +0000 Subject: [PATCH 092/505] chore(internal): version bump (#21) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ba6c3483..f14b480a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.1" + ".": "0.1.0-alpha.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6c133f8d..7c846676 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.1.0-alpha.1" +version = "0.1.0-alpha.2" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 8ed99273..ad579102 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.1.0-alpha.1" # x-release-please-version +__version__ = "0.1.0-alpha.2" # x-release-please-version From 38357011a2b655a79f8da76604a27cedc88d7311 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 12:50:02 +0000 Subject: [PATCH 093/505] feat(api): update examples (#22) --- README.md | 50 ++++++++++++++++++++++---------------------- tests/test_client.py | 48 ++++++++++++++++++++++++------------------ 2 files changed, 53 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 7cb4c28b..bb967edb 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ client = Gitpod( bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted ) -runner = client.runners.create() -print(runner.access_token) +response = client.identity.get_authenticated_identity() +print(response.organization_id) ``` While you can provide a `bearer_token` keyword argument, @@ -55,8 +55,8 @@ client = AsyncGitpod( async def main() -> None: - runner = await client.runners.create() - print(runner.access_token) + response = await client.identity.get_authenticated_identity() + print(response.organization_id) asyncio.run(main()) @@ -84,12 +84,12 @@ from gitpod import Gitpod client = Gitpod() -all_services = [] +all_environments = [] # Automatically fetches more pages as needed. -for service in client.environments.automations.services.list(): - # Do something with service here - all_services.append(service) -print(all_services) +for environment in client.environments.list(): + # Do something with environment here + all_environments.append(environment) +print(all_environments) ``` Or, asynchronously: @@ -102,11 +102,11 @@ client = AsyncGitpod() async def main() -> None: - all_services = [] + all_environments = [] # Iterate through items across all pages, issuing requests as needed. - async for service in client.environments.automations.services.list(): - all_services.append(service) - print(all_services) + async for environment in client.environments.list(): + all_environments.append(environment) + print(all_environments) asyncio.run(main()) @@ -115,11 +115,11 @@ asyncio.run(main()) Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages: ```python -first_page = await client.environments.automations.services.list() +first_page = await client.environments.list() if first_page.has_next_page(): print(f"will fetch next page using these details: {first_page.next_page_info()}") next_page = await first_page.get_next_page() - print(f"number of items we just fetched: {len(next_page.services)}") + print(f"number of items we just fetched: {len(next_page.environments)}") # Remove `await` for non-async usage. ``` @@ -127,11 +127,11 @@ if first_page.has_next_page(): Or just work directly with the returned data: ```python -first_page = await client.environments.automations.services.list() +first_page = await client.environments.list() print(f"next page cursor: {first_page.pagination.next_token}") # => "next page cursor: ..." -for service in first_page.services: - print(service.id) +for environment in first_page.environments: + print(environment.id) # Remove `await` for non-async usage. ``` @@ -152,7 +152,7 @@ from gitpod import Gitpod client = Gitpod() try: - client.runners.create() + client.identity.get_authenticated_identity() except gitpod.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. @@ -195,7 +195,7 @@ client = Gitpod( ) # Or, configure per-request: -client.with_options(max_retries=5).runners.create() +client.with_options(max_retries=5).identity.get_authenticated_identity() ``` ### Timeouts @@ -218,7 +218,7 @@ client = Gitpod( ) # Override per-request: -client.with_options(timeout=5.0).runners.create() +client.with_options(timeout=5.0).identity.get_authenticated_identity() ``` On timeout, an `APITimeoutError` is thrown. @@ -259,11 +259,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to from gitpod import Gitpod client = Gitpod() -response = client.runners.with_raw_response.create() +response = client.identity.with_raw_response.get_authenticated_identity() print(response.headers.get('X-My-Header')) -runner = response.parse() # get the object that `runners.create()` would have returned -print(runner.access_token) +identity = response.parse() # get the object that `identity.get_authenticated_identity()` would have returned +print(identity.organization_id) ``` These methods return an [`APIResponse`](https://github.com/gitpod-io/gitpod-sdk-python/tree/main/src/gitpod/_response.py) object. @@ -277,7 +277,7 @@ The above interface eagerly reads the full response body when you make the reque To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. ```python -with client.runners.with_streaming_response.create() as response: +with client.identity.with_streaming_response.get_authenticated_identity() as response: print(response.headers.get("X-My-Header")) for line in response.iter_lines(): diff --git a/tests/test_client.py b/tests/test_client.py index 10ecf0c9..8eff504a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -735,13 +735,13 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock( + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock( side_effect=httpx.TimeoutException("Test timeout error") ) with pytest.raises(APITimeoutError): self.client.post( - "/gitpod.v1.RunnerService/CreateRunner", + "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -752,11 +752,11 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(return_value=httpx.Response(500)) + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): self.client.post( - "/gitpod.v1.RunnerService/CreateRunner", + "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -788,9 +788,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: return httpx.Response(500) return httpx.Response(200) - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create() + response = client.identity.with_raw_response.get_authenticated_identity() assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -812,9 +812,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: return httpx.Response(500) return httpx.Response(200) - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) + response = client.identity.with_raw_response.get_authenticated_identity( + extra_headers={"x-stainless-retry-count": Omit()} + ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -835,9 +837,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: return httpx.Response(500) return httpx.Response(200) - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(side_effect=retry_handler) - response = client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) + response = client.identity.with_raw_response.get_authenticated_identity( + extra_headers={"x-stainless-retry-count": "42"} + ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" @@ -1531,13 +1535,13 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock( + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock( side_effect=httpx.TimeoutException("Test timeout error") ) with pytest.raises(APITimeoutError): await self.client.post( - "/gitpod.v1.RunnerService/CreateRunner", + "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1548,11 +1552,11 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(return_value=httpx.Response(500)) + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): await self.client.post( - "/gitpod.v1.RunnerService/CreateRunner", + "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1585,9 +1589,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: return httpx.Response(500) return httpx.Response(200) - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create() + response = await client.identity.with_raw_response.get_authenticated_identity() assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -1610,9 +1614,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: return httpx.Response(500) return httpx.Response(200) - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) + response = await client.identity.with_raw_response.get_authenticated_identity( + extra_headers={"x-stainless-retry-count": Omit()} + ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -1634,9 +1640,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: return httpx.Response(500) return httpx.Response(200) - respx_mock.post("/gitpod.v1.RunnerService/CreateRunner").mock(side_effect=retry_handler) + respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(side_effect=retry_handler) - response = await client.runners.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) + response = await client.identity.with_raw_response.get_authenticated_identity( + extra_headers={"x-stainless-retry-count": "42"} + ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" From 641e7674fa2aa1c5dbda445f394b401d6a319a15 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:07:36 +0000 Subject: [PATCH 094/505] feat(api): manual updates (#24) --- api.md | 2 +- src/gitpod/types/__init__.py | 2 +- src/gitpod/types/environments/automations/service_metadata.py | 4 ++-- .../types/environments/automations/service_metadata_param.py | 4 ++-- .../types/environments/automations/service_update_params.py | 4 ++-- .../types/environments/automations/task_update_params.py | 4 ++-- src/gitpod/types/shared/__init__.py | 2 +- .../shared/{automation_trigger.py => automation_trigge.py} | 4 ++-- src/gitpod/types/shared/task_metadata.py | 4 ++-- src/gitpod/types/shared_params/__init__.py | 2 +- .../{automation_trigger.py => automation_trigge.py} | 4 ++-- src/gitpod/types/shared_params/task_metadata.py | 4 ++-- 12 files changed, 20 insertions(+), 20 deletions(-) rename src/gitpod/types/shared/{automation_trigger.py => automation_trigge.py} (86%) rename src/gitpod/types/shared_params/{automation_trigger.py => automation_trigge.py} (83%) diff --git a/api.md b/api.md index d6933bfb..dfcf5a92 100644 --- a/api.md +++ b/api.md @@ -2,7 +2,7 @@ ```python from gitpod.types import ( - AutomationTrigger, + AutomationTrigge, EnvironmentClass, FieldValue, OrganizationRole, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 03e376b2..2f59c861 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -18,9 +18,9 @@ UserStatus as UserStatus, TaskMetadata as TaskMetadata, TaskExecution as TaskExecution, + AutomationTrigge as AutomationTrigge, EnvironmentClass as EnvironmentClass, OrganizationRole as OrganizationRole, - AutomationTrigger as AutomationTrigger, TaskExecutionSpec as TaskExecutionSpec, TaskExecutionPhase as TaskExecutionPhase, TaskExecutionStatus as TaskExecutionStatus, diff --git a/src/gitpod/types/environments/automations/service_metadata.py b/src/gitpod/types/environments/automations/service_metadata.py index b21e2c66..15d0d3fa 100644 --- a/src/gitpod/types/environments/automations/service_metadata.py +++ b/src/gitpod/types/environments/automations/service_metadata.py @@ -7,7 +7,7 @@ from ...._models import BaseModel from ...shared.subject import Subject -from ...shared.automation_trigger import AutomationTrigger +from ...shared.automation_trigge import AutomationTrigge __all__ = ["ServiceMetadata"] @@ -128,5 +128,5 @@ class ServiceMetadata(BaseModel): identify the service in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[AutomationTrigge]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_metadata_param.py b/src/gitpod/types/environments/automations/service_metadata_param.py index 8599c69e..614e053c 100644 --- a/src/gitpod/types/environments/automations/service_metadata_param.py +++ b/src/gitpod/types/environments/automations/service_metadata_param.py @@ -8,7 +8,7 @@ from ...._utils import PropertyInfo from ...shared_params.subject import Subject -from ...shared_params.automation_trigger import AutomationTrigger +from ...shared_params.automation_trigge import AutomationTrigge __all__ = ["ServiceMetadataParam"] @@ -129,5 +129,5 @@ class ServiceMetadataParam(TypedDict, total=False): identify the service in user interactions (e.g. the CLI). """ - triggered_by: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggeredBy")] + triggered_by: Annotated[Iterable[AutomationTrigge], PropertyInfo(alias="triggeredBy")] """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index 80a22fbf..1465e67f 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -8,7 +8,7 @@ from ...._utils import PropertyInfo from .service_phase import ServicePhase from ...shared_params.runs_on import RunsOn -from ...shared_params.automation_trigger import AutomationTrigger +from ...shared_params.automation_trigge import AutomationTrigge __all__ = ["ServiceUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec", "SpecCommands", "Status"] @@ -34,7 +34,7 @@ class ServiceUpdateParams(TypedDict, total=False): class MetadataTriggeredBy(TypedDict, total=False): - trigger: Iterable[AutomationTrigger] + trigger: Iterable[AutomationTrigge] class Metadata(TypedDict, total=False): diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index 4b0d59a9..5c6c0e12 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -7,7 +7,7 @@ from ...._utils import PropertyInfo from ...shared_params.runs_on import RunsOn -from ...shared_params.automation_trigger import AutomationTrigger +from ...shared_params.automation_trigge import AutomationTrigge __all__ = ["TaskUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec"] @@ -24,7 +24,7 @@ class TaskUpdateParams(TypedDict, total=False): class MetadataTriggeredBy(TypedDict, total=False): - trigger: Iterable[AutomationTrigger] + trigger: Iterable[AutomationTrigge] class Metadata(TypedDict, total=False): diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index ba0e2567..4e32020e 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -9,9 +9,9 @@ from .user_status import UserStatus as UserStatus from .task_metadata import TaskMetadata as TaskMetadata from .task_execution import TaskExecution as TaskExecution +from .automation_trigge import AutomationTrigge as AutomationTrigge from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole -from .automation_trigger import AutomationTrigger as AutomationTrigger from .task_execution_spec import TaskExecutionSpec as TaskExecutionSpec from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase from .task_execution_status import TaskExecutionStatus as TaskExecutionStatus diff --git a/src/gitpod/types/shared/automation_trigger.py b/src/gitpod/types/shared/automation_trigge.py similarity index 86% rename from src/gitpod/types/shared/automation_trigger.py rename to src/gitpod/types/shared/automation_trigge.py index 2b5eba3c..0aa19870 100644 --- a/src/gitpod/types/shared/automation_trigger.py +++ b/src/gitpod/types/shared/automation_trigge.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["AutomationTrigger"] +__all__ = ["AutomationTrigge"] -class AutomationTrigger(BaseModel): +class AutomationTrigge(BaseModel): manual: Optional[bool] = None post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) diff --git a/src/gitpod/types/shared/task_metadata.py b/src/gitpod/types/shared/task_metadata.py index 23e6c2c1..7365a70c 100644 --- a/src/gitpod/types/shared/task_metadata.py +++ b/src/gitpod/types/shared/task_metadata.py @@ -7,7 +7,7 @@ from .subject import Subject from ..._models import BaseModel -from .automation_trigger import AutomationTrigger +from .automation_trigge import AutomationTrigge __all__ = ["TaskMetadata"] @@ -128,5 +128,5 @@ class TaskMetadata(BaseModel): the task in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[AutomationTrigge]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the task.""" diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index 51915e7a..0b7a2057 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -6,7 +6,7 @@ from .task_spec import TaskSpec as TaskSpec from .field_value import FieldValue as FieldValue from .task_metadata import TaskMetadata as TaskMetadata +from .automation_trigge import AutomationTrigge as AutomationTrigge from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole -from .automation_trigger import AutomationTrigger as AutomationTrigger from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase diff --git a/src/gitpod/types/shared_params/automation_trigger.py b/src/gitpod/types/shared_params/automation_trigge.py similarity index 83% rename from src/gitpod/types/shared_params/automation_trigger.py rename to src/gitpod/types/shared_params/automation_trigge.py index 173dff4c..772b75ea 100644 --- a/src/gitpod/types/shared_params/automation_trigger.py +++ b/src/gitpod/types/shared_params/automation_trigge.py @@ -6,10 +6,10 @@ from ..._utils import PropertyInfo -__all__ = ["AutomationTrigger"] +__all__ = ["AutomationTrigge"] -class AutomationTrigger(TypedDict, total=False): +class AutomationTrigge(TypedDict, total=False): manual: bool post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] diff --git a/src/gitpod/types/shared_params/task_metadata.py b/src/gitpod/types/shared_params/task_metadata.py index 50ffda7e..afd8788e 100644 --- a/src/gitpod/types/shared_params/task_metadata.py +++ b/src/gitpod/types/shared_params/task_metadata.py @@ -8,7 +8,7 @@ from .subject import Subject from ..._utils import PropertyInfo -from .automation_trigger import AutomationTrigger +from .automation_trigge import AutomationTrigge __all__ = ["TaskMetadata"] @@ -129,5 +129,5 @@ class TaskMetadata(TypedDict, total=False): the task in user interactions (e.g. the CLI). """ - triggered_by: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggeredBy")] + triggered_by: Annotated[Iterable[AutomationTrigge], PropertyInfo(alias="triggeredBy")] """triggered_by is a list of trigger that start the task.""" From 848c843c650df0773b1e465eeaa82141b3cdb125 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:08:11 +0000 Subject: [PATCH 095/505] feat(api): manual updates (#25) --- api.md | 2 +- src/gitpod/types/__init__.py | 2 +- src/gitpod/types/environments/automations/service_metadata.py | 4 ++-- .../types/environments/automations/service_metadata_param.py | 4 ++-- .../types/environments/automations/service_update_params.py | 4 ++-- .../types/environments/automations/task_update_params.py | 4 ++-- src/gitpod/types/shared/__init__.py | 2 +- .../shared/{automation_trigge.py => automation_trigger.py} | 4 ++-- src/gitpod/types/shared/task_metadata.py | 4 ++-- src/gitpod/types/shared_params/__init__.py | 2 +- .../{automation_trigge.py => automation_trigger.py} | 4 ++-- src/gitpod/types/shared_params/task_metadata.py | 4 ++-- 12 files changed, 20 insertions(+), 20 deletions(-) rename src/gitpod/types/shared/{automation_trigge.py => automation_trigger.py} (86%) rename src/gitpod/types/shared_params/{automation_trigge.py => automation_trigger.py} (83%) diff --git a/api.md b/api.md index dfcf5a92..d6933bfb 100644 --- a/api.md +++ b/api.md @@ -2,7 +2,7 @@ ```python from gitpod.types import ( - AutomationTrigge, + AutomationTrigger, EnvironmentClass, FieldValue, OrganizationRole, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 2f59c861..03e376b2 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -18,9 +18,9 @@ UserStatus as UserStatus, TaskMetadata as TaskMetadata, TaskExecution as TaskExecution, - AutomationTrigge as AutomationTrigge, EnvironmentClass as EnvironmentClass, OrganizationRole as OrganizationRole, + AutomationTrigger as AutomationTrigger, TaskExecutionSpec as TaskExecutionSpec, TaskExecutionPhase as TaskExecutionPhase, TaskExecutionStatus as TaskExecutionStatus, diff --git a/src/gitpod/types/environments/automations/service_metadata.py b/src/gitpod/types/environments/automations/service_metadata.py index 15d0d3fa..b21e2c66 100644 --- a/src/gitpod/types/environments/automations/service_metadata.py +++ b/src/gitpod/types/environments/automations/service_metadata.py @@ -7,7 +7,7 @@ from ...._models import BaseModel from ...shared.subject import Subject -from ...shared.automation_trigge import AutomationTrigge +from ...shared.automation_trigger import AutomationTrigger __all__ = ["ServiceMetadata"] @@ -128,5 +128,5 @@ class ServiceMetadata(BaseModel): identify the service in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[AutomationTrigge]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_metadata_param.py b/src/gitpod/types/environments/automations/service_metadata_param.py index 614e053c..8599c69e 100644 --- a/src/gitpod/types/environments/automations/service_metadata_param.py +++ b/src/gitpod/types/environments/automations/service_metadata_param.py @@ -8,7 +8,7 @@ from ...._utils import PropertyInfo from ...shared_params.subject import Subject -from ...shared_params.automation_trigge import AutomationTrigge +from ...shared_params.automation_trigger import AutomationTrigger __all__ = ["ServiceMetadataParam"] @@ -129,5 +129,5 @@ class ServiceMetadataParam(TypedDict, total=False): identify the service in user interactions (e.g. the CLI). """ - triggered_by: Annotated[Iterable[AutomationTrigge], PropertyInfo(alias="triggeredBy")] + triggered_by: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggeredBy")] """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index 1465e67f..80a22fbf 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -8,7 +8,7 @@ from ...._utils import PropertyInfo from .service_phase import ServicePhase from ...shared_params.runs_on import RunsOn -from ...shared_params.automation_trigge import AutomationTrigge +from ...shared_params.automation_trigger import AutomationTrigger __all__ = ["ServiceUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec", "SpecCommands", "Status"] @@ -34,7 +34,7 @@ class ServiceUpdateParams(TypedDict, total=False): class MetadataTriggeredBy(TypedDict, total=False): - trigger: Iterable[AutomationTrigge] + trigger: Iterable[AutomationTrigger] class Metadata(TypedDict, total=False): diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index 5c6c0e12..4b0d59a9 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -7,7 +7,7 @@ from ...._utils import PropertyInfo from ...shared_params.runs_on import RunsOn -from ...shared_params.automation_trigge import AutomationTrigge +from ...shared_params.automation_trigger import AutomationTrigger __all__ = ["TaskUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec"] @@ -24,7 +24,7 @@ class TaskUpdateParams(TypedDict, total=False): class MetadataTriggeredBy(TypedDict, total=False): - trigger: Iterable[AutomationTrigge] + trigger: Iterable[AutomationTrigger] class Metadata(TypedDict, total=False): diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index 4e32020e..ba0e2567 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -9,9 +9,9 @@ from .user_status import UserStatus as UserStatus from .task_metadata import TaskMetadata as TaskMetadata from .task_execution import TaskExecution as TaskExecution -from .automation_trigge import AutomationTrigge as AutomationTrigge from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole +from .automation_trigger import AutomationTrigger as AutomationTrigger from .task_execution_spec import TaskExecutionSpec as TaskExecutionSpec from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase from .task_execution_status import TaskExecutionStatus as TaskExecutionStatus diff --git a/src/gitpod/types/shared/automation_trigge.py b/src/gitpod/types/shared/automation_trigger.py similarity index 86% rename from src/gitpod/types/shared/automation_trigge.py rename to src/gitpod/types/shared/automation_trigger.py index 0aa19870..2b5eba3c 100644 --- a/src/gitpod/types/shared/automation_trigge.py +++ b/src/gitpod/types/shared/automation_trigger.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["AutomationTrigge"] +__all__ = ["AutomationTrigger"] -class AutomationTrigge(BaseModel): +class AutomationTrigger(BaseModel): manual: Optional[bool] = None post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) diff --git a/src/gitpod/types/shared/task_metadata.py b/src/gitpod/types/shared/task_metadata.py index 7365a70c..23e6c2c1 100644 --- a/src/gitpod/types/shared/task_metadata.py +++ b/src/gitpod/types/shared/task_metadata.py @@ -7,7 +7,7 @@ from .subject import Subject from ..._models import BaseModel -from .automation_trigge import AutomationTrigge +from .automation_trigger import AutomationTrigger __all__ = ["TaskMetadata"] @@ -128,5 +128,5 @@ class TaskMetadata(BaseModel): the task in user interactions (e.g. the CLI). """ - triggered_by: Optional[List[AutomationTrigge]] = FieldInfo(alias="triggeredBy", default=None) + triggered_by: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the task.""" diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index 0b7a2057..51915e7a 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -6,7 +6,7 @@ from .task_spec import TaskSpec as TaskSpec from .field_value import FieldValue as FieldValue from .task_metadata import TaskMetadata as TaskMetadata -from .automation_trigge import AutomationTrigge as AutomationTrigge from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole +from .automation_trigger import AutomationTrigger as AutomationTrigger from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase diff --git a/src/gitpod/types/shared_params/automation_trigge.py b/src/gitpod/types/shared_params/automation_trigger.py similarity index 83% rename from src/gitpod/types/shared_params/automation_trigge.py rename to src/gitpod/types/shared_params/automation_trigger.py index 772b75ea..173dff4c 100644 --- a/src/gitpod/types/shared_params/automation_trigge.py +++ b/src/gitpod/types/shared_params/automation_trigger.py @@ -6,10 +6,10 @@ from ..._utils import PropertyInfo -__all__ = ["AutomationTrigge"] +__all__ = ["AutomationTrigger"] -class AutomationTrigge(TypedDict, total=False): +class AutomationTrigger(TypedDict, total=False): manual: bool post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] diff --git a/src/gitpod/types/shared_params/task_metadata.py b/src/gitpod/types/shared_params/task_metadata.py index afd8788e..50ffda7e 100644 --- a/src/gitpod/types/shared_params/task_metadata.py +++ b/src/gitpod/types/shared_params/task_metadata.py @@ -8,7 +8,7 @@ from .subject import Subject from ..._utils import PropertyInfo -from .automation_trigge import AutomationTrigge +from .automation_trigger import AutomationTrigger __all__ = ["TaskMetadata"] @@ -129,5 +129,5 @@ class TaskMetadata(TypedDict, total=False): the task in user interactions (e.g. the CLI). """ - triggered_by: Annotated[Iterable[AutomationTrigge], PropertyInfo(alias="triggeredBy")] + triggered_by: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggeredBy")] """triggered_by is a list of trigger that start the task.""" From 3080041340499ff9966a733a065ed9639621eae5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 03:52:35 +0000 Subject: [PATCH 096/505] chore(internal): update client tests (#26) --- tests/test_client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 8eff504a..b6dadcfe 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -23,10 +23,12 @@ from gitpod import Gitpod, AsyncGitpod, APIResponseValidationError from gitpod._types import Omit +from gitpod._utils import maybe_transform from gitpod._models import BaseModel, FinalRequestOptions from gitpod._constants import RAW_RESPONSE_HEADER from gitpod._exceptions import GitpodError, APIStatusError, APITimeoutError, APIResponseValidationError from gitpod._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options +from gitpod.types.identity_get_authenticated_identity_params import IdentityGetAuthenticatedIdentityParams from .utils import update_env @@ -742,7 +744,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No with pytest.raises(APITimeoutError): self.client.post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, dict()), + body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -757,7 +759,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non with pytest.raises(APIStatusError): self.client.post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, dict()), + body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1542,7 +1544,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APITimeoutError): await self.client.post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, dict()), + body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1557,7 +1559,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APIStatusError): await self.client.post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, dict()), + body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) From d01fe3e727abaa2624d2faf19bd0926f2e6617b9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 09:22:17 +0000 Subject: [PATCH 097/505] feat(api): update with latest API spec (#27) --- .stats.yml | 2 +- src/gitpod/resources/editors.py | 16 ++--- src/gitpod/types/editor.py | 15 ++--- src/gitpod/types/editor_resolve_url_params.py | 8 +-- .../types/editor_resolve_url_response.py | 3 +- src/gitpod/types/editor_retrieve_params.py | 4 +- src/gitpod/types/editor_retrieve_response.py | 3 +- tests/api_resources/test_editors.py | 64 +++++++++---------- 8 files changed, 56 insertions(+), 59 deletions(-) diff --git a/.stats.yml b/.stats.yml index 87b67dee..031a7386 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-36f9d46890bf3667f5a6529bdb156fe1560834ad8187c4271aa0b0024de1adb5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a058dd6f8c83b32adb6f30bae2db8295468b8ffc391342a960ec6f393c50b83e.yml diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 1a910b71..78e0ba23 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> EditorsResourceWithStreamingResponse: def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -132,9 +132,9 @@ def list( def resolve_url( self, *, - editor_id: str | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + editor_id: str, + environment_id: str, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -200,7 +200,7 @@ def with_streaming_response(self) -> AsyncEditorsResourceWithStreamingResponse: async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -282,9 +282,9 @@ def list( async def resolve_url( self, *, - editor_id: str | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + editor_id: str, + environment_id: str, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/types/editor.py b/src/gitpod/types/editor.py index b5ea9d04..6395cc77 100644 --- a/src/gitpod/types/editor.py +++ b/src/gitpod/types/editor.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -10,16 +9,16 @@ class Editor(BaseModel): - id: Optional[str] = None + id: str - alias: Optional[str] = None + alias: str - icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) + icon_url: str = FieldInfo(alias="iconUrl") - installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) + installation_instructions: str = FieldInfo(alias="installationInstructions") - name: Optional[str] = None + name: str - short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) + short_description: str = FieldInfo(alias="shortDescription") - url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) + url_template: str = FieldInfo(alias="urlTemplate") diff --git a/src/gitpod/types/editor_resolve_url_params.py b/src/gitpod/types/editor_resolve_url_params.py index a4a34df9..de698ba0 100644 --- a/src/gitpod/types/editor_resolve_url_params.py +++ b/src/gitpod/types/editor_resolve_url_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,11 @@ class EditorResolveURLParams(TypedDict, total=False): - editor_id: Annotated[str, PropertyInfo(alias="editorId")] + editor_id: Required[Annotated[str, PropertyInfo(alias="editorId")]] """editorId is the ID of the editor to resolve the URL for""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + environment_id: Required[Annotated[str, PropertyInfo(alias="environmentId")]] """environmentId is the ID of the environment to resolve the URL for""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organizationId is the ID of the organization to resolve the URL for""" diff --git a/src/gitpod/types/editor_resolve_url_response.py b/src/gitpod/types/editor_resolve_url_response.py index b0ee8eb0..f22f8cbf 100644 --- a/src/gitpod/types/editor_resolve_url_response.py +++ b/src/gitpod/types/editor_resolve_url_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .._models import BaseModel @@ -8,5 +7,5 @@ class EditorResolveURLResponse(BaseModel): - url: Optional[str] = None + url: str """url is the resolved editor URL""" diff --git a/src/gitpod/types/editor_retrieve_params.py b/src/gitpod/types/editor_retrieve_params.py index 9b01102e..f9f5194d 100644 --- a/src/gitpod/types/editor_retrieve_params.py +++ b/src/gitpod/types/editor_retrieve_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["EditorRetrieveParams"] class EditorRetrieveParams(TypedDict, total=False): - id: str + id: Required[str] """id is the ID of the editor to get""" diff --git a/src/gitpod/types/editor_retrieve_response.py b/src/gitpod/types/editor_retrieve_response.py index 4f962cd7..fa5bbe98 100644 --- a/src/gitpod/types/editor_retrieve_response.py +++ b/src/gitpod/types/editor_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .editor import Editor from .._models import BaseModel @@ -9,5 +8,5 @@ class EditorRetrieveResponse(BaseModel): - editor: Optional[Editor] = None + editor: Editor """editor contains the editor""" diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 9ef5526f..c8aa5247 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -25,12 +25,6 @@ class TestEditors: @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - editor = client.editors.retrieve() - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: editor = client.editors.retrieve( id="id", ) @@ -39,7 +33,9 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.retrieve() + response = client.editors.with_raw_response.retrieve( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -49,7 +45,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.retrieve() as response: + with client.editors.with_streaming_response.retrieve( + id="id", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -102,12 +100,6 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_resolve_url(self, client: Gitpod) -> None: - editor = client.editors.resolve_url() - assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: editor = client.editors.resolve_url( editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -118,7 +110,11 @@ def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.resolve_url() + response = client.editors.with_raw_response.resolve_url( + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -128,7 +124,11 @@ def test_raw_response_resolve_url(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_resolve_url(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.resolve_url() as response: + with client.editors.with_streaming_response.resolve_url( + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -144,12 +144,6 @@ class TestAsyncEditors: @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.retrieve() - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( id="id", ) @@ -158,7 +152,9 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.retrieve() + response = await async_client.editors.with_raw_response.retrieve( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -168,7 +164,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.retrieve() as response: + async with async_client.editors.with_streaming_response.retrieve( + id="id", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -221,12 +219,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.resolve_url() - assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -237,7 +229,11 @@ async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpo @pytest.mark.skip() @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.resolve_url() + response = await async_client.editors.with_raw_response.resolve_url( + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -247,7 +243,11 @@ async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None @pytest.mark.skip() @parametrize async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.resolve_url() as response: + async with async_client.editors.with_streaming_response.resolve_url( + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" From 894ff0d692aca7582607a954ab0c2bc992b6d23f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 10:54:20 +0000 Subject: [PATCH 098/505] feat(api): manual updates (#28) --- .stats.yml | 2 +- src/gitpod/resources/accounts.py | 8 +- src/gitpod/resources/environments/classes.py | 42 +- .../resources/environments/environments.py | 558 ++++++++++++++++-- .../organizations/domain_verifications.py | 24 +- src/gitpod/resources/organizations/invites.py | 12 +- .../resources/organizations/organizations.py | 60 +- .../organizations/sso_configurations.py | 48 +- .../configurations/environment_classes.py | 8 +- src/gitpod/types/account.py | 36 +- src/gitpod/types/account_delete_params.py | 4 +- .../types/account_get_sso_login_url_params.py | 4 +- .../account_get_sso_login_url_response.py | 3 +- src/gitpod/types/account_membership.py | 11 +- src/gitpod/types/account_retrieve_response.py | 3 +- .../types/environment_retrieve_params.py | 4 +- src/gitpod/types/joinable_organization.py | 7 +- src/gitpod/types/login_provider.py | 5 +- src/gitpod/types/organization.py | 12 +- .../types/organization_create_params.py | 8 +- .../types/organization_create_response.py | 6 +- .../types/organization_delete_params.py | 4 +- .../types/organization_join_response.py | 3 +- src/gitpod/types/organization_leave_params.py | 4 +- .../types/organization_list_members_params.py | 8 +- src/gitpod/types/organization_member.py | 18 +- .../types/organization_retrieve_params.py | 4 +- .../types/organization_retrieve_response.py | 3 +- .../types/organization_set_role_params.py | 8 +- .../types/organization_update_params.py | 8 +- .../types/organization_update_response.py | 3 +- .../organizations/domain_verification.py | 11 +- .../domain_verification_create_params.py | 6 +- .../domain_verification_create_response.py | 3 +- .../domain_verification_delete_params.py | 4 +- .../domain_verification_list_params.py | 6 +- .../domain_verification_retrieve_params.py | 4 +- .../domain_verification_retrieve_response.py | 3 +- .../domain_verification_verify_params.py | 4 +- .../domain_verification_verify_response.py | 3 +- .../organizations/invite_create_params.py | 4 +- .../organizations/invite_create_response.py | 3 +- .../invite_get_summary_params.py | 4 +- .../invite_get_summary_response.py | 2 +- .../organizations/invite_retrieve_params.py | 4 +- .../organizations/invite_retrieve_response.py | 3 +- .../organizations/organization_invite.py | 3 +- .../types/organizations/sso_configuration.py | 20 +- .../sso_configuration_create_params.py | 12 +- .../sso_configuration_create_response.py | 3 +- .../sso_configuration_delete_params.py | 4 +- .../sso_configuration_list_params.py | 8 +- .../sso_configuration_retrieve_params.py | 4 +- .../sso_configuration_retrieve_response.py | 3 +- .../sso_configuration_update_params.py | 8 +- .../test_domain_verifications.py | 144 ++--- .../organizations/test_invites.py | 84 ++- .../organizations/test_sso_configurations.py | 156 +++-- tests/api_resources/test_accounts.py | 52 +- tests/api_resources/test_environments.py | 100 ++-- tests/api_resources/test_organizations.py | 202 ++++--- 61 files changed, 1164 insertions(+), 631 deletions(-) diff --git a/.stats.yml b/.stats.yml index 031a7386..c57d3dcc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a058dd6f8c83b32adb6f30bae2db8295468b8ffc391342a960ec6f393c50b83e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-988164042da1361feb3d28364c6f14fee775ceab496b9d79d048141c0fa6da19.yml diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 1712f203..aa8d5010 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -89,7 +89,7 @@ def retrieve( def delete( self, *, - account_id: str | NotGiven = NOT_GIVEN, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -123,7 +123,7 @@ def delete( def get_sso_login_url( self, *, - email: str | NotGiven = NOT_GIVEN, + email: str, return_to: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -277,7 +277,7 @@ async def retrieve( async def delete( self, *, - account_id: str | NotGiven = NOT_GIVEN, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -311,7 +311,7 @@ async def delete( async def get_sso_login_url( self, *, - email: str | NotGiven = NOT_GIVEN, + email: str, return_to: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/gitpod/resources/environments/classes.py b/src/gitpod/resources/environments/classes.py index 1a64f8a6..ffe58db6 100644 --- a/src/gitpod/resources/environments/classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -57,9 +57,24 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ - ListEnvironmentClasses returns the list of environment classes with runner - details a user is able to use based on the query buf:lint:ignore - RPC_REQUEST_RESPONSE_UNIQUE + Lists available environment classes with their specifications and resource + limits. + + Use this method to understand what types of environments you can create and + their capabilities. Environment classes define the compute resources and + features available to your environments. + + ### Examples + + - List all available classes: + + Retrieves a list of all environment classes with their specifications. + + ```yaml + {} + ``` + + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: pagination: pagination contains the pagination options for listing environment classes @@ -135,9 +150,24 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ - ListEnvironmentClasses returns the list of environment classes with runner - details a user is able to use based on the query buf:lint:ignore - RPC_REQUEST_RESPONSE_UNIQUE + Lists available environment classes with their specifications and resource + limits. + + Use this method to understand what types of environments you can create and + their capabilities. Environment classes define the compute resources and + features available to your environments. + + ### Examples + + - List all available classes: + + Retrieves a list of all environment classes with their specifications. + + ```yaml + {} + ``` + + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: pagination: pagination contains the pagination options for listing environment classes diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 091b00c5..c5e250f0 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -99,22 +99,24 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentCreateResponse: - """ - CreateEnvironment creates a new environment and starts it. + """Creates a development environment from a context URL (e.g. + + Git repository) and + starts it. The `class` field must be a valid environment class ID. You can find a list of available environment classes with the `ListEnvironmentClasses` method. ### Examples - - from context URL: + - Create from context URL: - Creates an environment from a context URL, e.g. a GitHub repository. + Creates an environment from a Git repository URL with default settings. ```yaml spec: machine: - class: "61000000-0000-0000-0000-000000000000" + class: "d2c94c27-3b76-4a42-b88c-95a85e392c68" content: initializer: specs: @@ -122,15 +124,14 @@ def create( url: "https://github.com/gitpod-io/gitpod" ``` - - from Git repository: + - Create from Git repository: - Creates an environment from a Git repository directly. While less convenient, - this is useful if you want to specify a specific branch, commit, etc. + Creates an environment from a Git repository with specific branch targeting. ```yaml spec: machine: - class: "61000000-0000-0000-0000-000000000000" + class: "d2c94c27-3b76-4a42-b88c-95a85e392c68" content: initializer: specs: @@ -140,6 +141,28 @@ def create( targetMode: "CLONE_TARGET_MODE_REMOTE_BRANCH" ``` + - Create with custom timeout and ports: + + Creates an environment with custom inactivity timeout and exposed port + configuration. + + ```yaml + spec: + machine: + class: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + content: + initializer: + specs: + - contextUrl: + url: "https://github.com/gitpod-io/gitpod" + timeout: + disconnected: "7200s" # 2 hours in seconds + ports: + - port: 3000 + admission: "ADMISSION_LEVEL_EVERYONE" + name: "Web App" + ``` + Args: spec: EnvironmentSpec specifies the configuration of an environment for an environment start @@ -164,7 +187,7 @@ def create( def retrieve( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -173,7 +196,26 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentRetrieveResponse: """ - GetEnvironment returns a single environment. + Gets details about a specific environment including its status, configuration, + and context URL. + + Use this method to: + + - Check if an environment is ready to use + - Get connection details for IDE and exposed ports + - Monitor environment health and resource usage + - Debug environment setup issues + + ### Examples + + - Get environment details: + + Retrieves detailed information about a specific environment using its unique + identifier. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies the environment to get @@ -211,7 +253,56 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateEnvironment updates the environment partially. + Updates an environment's configuration while it is running. + + Updates are limited to: + + - Git credentials (username, email) + - SSH public keys + - Content initialization + - Port configurations + - Automation files + - Environment timeouts + + ### Examples + + - Update Git credentials: + + Updates the Git configuration for the environment. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + spec: + content: + gitUsername: "example-user" + gitEmail: "user@example.com" + ``` + + - Add SSH public key: + + Adds a new SSH public key for authentication. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + spec: + sshPublicKeys: + - id: "0194b7c1-c954-718d-91a4-9a742aa5fc11" + value: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI..." + ``` + + - Update content session: + + Updates the content session identifier for the environment. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + spec: + content: + session: "0194b7c1-c954-718d-91a4-9a742aa5fc11" + ``` + + Note: Machine class changes require stopping the environment and creating a new + one. Args: environment_id: environment_id specifies which environment should be updated. @@ -257,7 +348,43 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncEnvironmentsPage[Environment]: """ - ListEnvironments returns a list of environments that match the query. + Lists all environments matching the specified criteria. + + Use this method to find and monitor environments across your organization. + Results are ordered by creation time with newest environments first. + + ### Examples + + - List running environments for a project: + + Retrieves all running environments for a specific project with pagination. + + ```yaml + filter: + statusPhases: ["ENVIRONMENT_PHASE_RUNNING"] + projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + pagination: + pageSize: 10 + ``` + + - List all environments for a specific runner: + + Filters environments by runner ID and creator ID. + + ```yaml + filter: + runnerIds: ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"] + creatorIds: ["f53d2330-3795-4c5d-a1f3-453121af9c60"] + ``` + + - List stopped and deleted environments: + + Retrieves all environments in stopped or deleted state. + + ```yaml + filter: + statusPhases: ["ENVIRONMENT_PHASE_STOPPED", "ENVIRONMENT_PHASE_DELETED"] + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -309,10 +436,31 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """DeleteEnvironment deletes an environment. + """ + Permanently deletes an environment. + + Running environments are automatically stopped before deletion. If force is + true, the environment is deleted immediately without graceful shutdown. + + ### Examples + + - Delete with graceful shutdown: - When the environment is running, it - will be stopped as well. Deleted environments cannot be started again. + Deletes an environment after gracefully stopping it. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + force: false + ``` + + - Force delete: + + Immediately deletes an environment without waiting for graceful shutdown. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + force: true + ``` Args: environment_id: environment_id specifies the environment that is going to delete. @@ -360,8 +508,36 @@ def create_from_project( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentCreateFromProjectResponse: """ - CreateAbdStartEnvironmentFromProject creates a new environment from a project - and starts it. + Creates an environment from an existing project configuration and starts it. + + This method uses project settings as defaults but allows overriding specific + configurations. Project settings take precedence over default configurations, + while custom specifications in the request override project settings. + + ### Examples + + - Create with project defaults: + + Creates an environment using all default settings from the project + configuration. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + - Create with custom compute resources: + + Creates an environment from project with custom machine class and timeout + settings. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + spec: + machine: + class: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + timeout: + disconnected: "14400s" # 4 hours in seconds + ``` Args: spec: EnvironmentSpec specifies the configuration of an environment for an environment @@ -402,8 +578,20 @@ def create_logs_token( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentCreateLogsTokenResponse: """ - CreateEnvironmentLogsToken creates a token that can be used to access the logs - of an environment. + Creates an access token for retrieving environment logs. + + Generated tokens are valid for one hour and provide read-only access to the + environment's logs. + + ### Examples + + - Generate logs token: + + Creates a temporary access token for retrieving environment logs. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies the environment for which the logs token should be @@ -444,7 +632,23 @@ def mark_active( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - MarkEnvironmentActive allows tools to signal activity for an environment. + Records environment activity to prevent automatic shutdown. + + Activity signals should be sent every 5 minutes while the environment is + actively being used. The source must be between 3-80 characters. + + ### Examples + + - Signal VS Code activity: + + Records VS Code editor activity to prevent environment shutdown. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + activitySignal: + source: "VS Code" + timestamp: "2025-02-12T14:30:00Z" + ``` Args: activity_signal: EnvironmentActivitySignal used to signal activity for an environment. @@ -485,10 +689,22 @@ def start( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """StartEnvironment starts an environment. + """ + Starts a stopped environment. - This function is idempotent, i.e. if the - environment is already running no error is returned. + Use this method to resume work on a previously stopped environment. The + environment retains its configuration and workspace content from when it was + stopped. + + ### Examples + + - Start an environment: + + Resumes a previously stopped environment with its existing configuration. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies which environment should be started. @@ -522,7 +738,20 @@ def stop( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - StopEnvironment stops a running environment. + Stops a running environment. + + Use this method to pause work while preserving the environment's state. The + environment can be resumed later using StartEnvironment. + + ### Examples + + - Stop an environment: + + Gracefully stops a running environment while preserving its state. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies which environment should be stopped. @@ -586,22 +815,24 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentCreateResponse: - """ - CreateEnvironment creates a new environment and starts it. + """Creates a development environment from a context URL (e.g. + + Git repository) and + starts it. The `class` field must be a valid environment class ID. You can find a list of available environment classes with the `ListEnvironmentClasses` method. ### Examples - - from context URL: + - Create from context URL: - Creates an environment from a context URL, e.g. a GitHub repository. + Creates an environment from a Git repository URL with default settings. ```yaml spec: machine: - class: "61000000-0000-0000-0000-000000000000" + class: "d2c94c27-3b76-4a42-b88c-95a85e392c68" content: initializer: specs: @@ -609,15 +840,14 @@ async def create( url: "https://github.com/gitpod-io/gitpod" ``` - - from Git repository: + - Create from Git repository: - Creates an environment from a Git repository directly. While less convenient, - this is useful if you want to specify a specific branch, commit, etc. + Creates an environment from a Git repository with specific branch targeting. ```yaml spec: machine: - class: "61000000-0000-0000-0000-000000000000" + class: "d2c94c27-3b76-4a42-b88c-95a85e392c68" content: initializer: specs: @@ -627,6 +857,28 @@ async def create( targetMode: "CLONE_TARGET_MODE_REMOTE_BRANCH" ``` + - Create with custom timeout and ports: + + Creates an environment with custom inactivity timeout and exposed port + configuration. + + ```yaml + spec: + machine: + class: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + content: + initializer: + specs: + - contextUrl: + url: "https://github.com/gitpod-io/gitpod" + timeout: + disconnected: "7200s" # 2 hours in seconds + ports: + - port: 3000 + admission: "ADMISSION_LEVEL_EVERYONE" + name: "Web App" + ``` + Args: spec: EnvironmentSpec specifies the configuration of an environment for an environment start @@ -651,7 +903,7 @@ async def create( async def retrieve( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -660,7 +912,26 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentRetrieveResponse: """ - GetEnvironment returns a single environment. + Gets details about a specific environment including its status, configuration, + and context URL. + + Use this method to: + + - Check if an environment is ready to use + - Get connection details for IDE and exposed ports + - Monitor environment health and resource usage + - Debug environment setup issues + + ### Examples + + - Get environment details: + + Retrieves detailed information about a specific environment using its unique + identifier. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies the environment to get @@ -698,7 +969,56 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateEnvironment updates the environment partially. + Updates an environment's configuration while it is running. + + Updates are limited to: + + - Git credentials (username, email) + - SSH public keys + - Content initialization + - Port configurations + - Automation files + - Environment timeouts + + ### Examples + + - Update Git credentials: + + Updates the Git configuration for the environment. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + spec: + content: + gitUsername: "example-user" + gitEmail: "user@example.com" + ``` + + - Add SSH public key: + + Adds a new SSH public key for authentication. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + spec: + sshPublicKeys: + - id: "0194b7c1-c954-718d-91a4-9a742aa5fc11" + value: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI..." + ``` + + - Update content session: + + Updates the content session identifier for the environment. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + spec: + content: + session: "0194b7c1-c954-718d-91a4-9a742aa5fc11" + ``` + + Note: Machine class changes require stopping the environment and creating a new + one. Args: environment_id: environment_id specifies which environment should be updated. @@ -744,7 +1064,43 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Environment, AsyncEnvironmentsPage[Environment]]: """ - ListEnvironments returns a list of environments that match the query. + Lists all environments matching the specified criteria. + + Use this method to find and monitor environments across your organization. + Results are ordered by creation time with newest environments first. + + ### Examples + + - List running environments for a project: + + Retrieves all running environments for a specific project with pagination. + + ```yaml + filter: + statusPhases: ["ENVIRONMENT_PHASE_RUNNING"] + projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + pagination: + pageSize: 10 + ``` + + - List all environments for a specific runner: + + Filters environments by runner ID and creator ID. + + ```yaml + filter: + runnerIds: ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"] + creatorIds: ["f53d2330-3795-4c5d-a1f3-453121af9c60"] + ``` + + - List stopped and deleted environments: + + Retrieves all environments in stopped or deleted state. + + ```yaml + filter: + statusPhases: ["ENVIRONMENT_PHASE_STOPPED", "ENVIRONMENT_PHASE_DELETED"] + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -796,10 +1152,31 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """DeleteEnvironment deletes an environment. + """ + Permanently deletes an environment. + + Running environments are automatically stopped before deletion. If force is + true, the environment is deleted immediately without graceful shutdown. + + ### Examples + + - Delete with graceful shutdown: - When the environment is running, it - will be stopped as well. Deleted environments cannot be started again. + Deletes an environment after gracefully stopping it. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + force: false + ``` + + - Force delete: + + Immediately deletes an environment without waiting for graceful shutdown. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + force: true + ``` Args: environment_id: environment_id specifies the environment that is going to delete. @@ -847,8 +1224,36 @@ async def create_from_project( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentCreateFromProjectResponse: """ - CreateAbdStartEnvironmentFromProject creates a new environment from a project - and starts it. + Creates an environment from an existing project configuration and starts it. + + This method uses project settings as defaults but allows overriding specific + configurations. Project settings take precedence over default configurations, + while custom specifications in the request override project settings. + + ### Examples + + - Create with project defaults: + + Creates an environment using all default settings from the project + configuration. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + - Create with custom compute resources: + + Creates an environment from project with custom machine class and timeout + settings. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + spec: + machine: + class: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + timeout: + disconnected: "14400s" # 4 hours in seconds + ``` Args: spec: EnvironmentSpec specifies the configuration of an environment for an environment @@ -889,8 +1294,20 @@ async def create_logs_token( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentCreateLogsTokenResponse: """ - CreateEnvironmentLogsToken creates a token that can be used to access the logs - of an environment. + Creates an access token for retrieving environment logs. + + Generated tokens are valid for one hour and provide read-only access to the + environment's logs. + + ### Examples + + - Generate logs token: + + Creates a temporary access token for retrieving environment logs. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies the environment for which the logs token should be @@ -931,7 +1348,23 @@ async def mark_active( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - MarkEnvironmentActive allows tools to signal activity for an environment. + Records environment activity to prevent automatic shutdown. + + Activity signals should be sent every 5 minutes while the environment is + actively being used. The source must be between 3-80 characters. + + ### Examples + + - Signal VS Code activity: + + Records VS Code editor activity to prevent environment shutdown. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + activitySignal: + source: "VS Code" + timestamp: "2025-02-12T14:30:00Z" + ``` Args: activity_signal: EnvironmentActivitySignal used to signal activity for an environment. @@ -972,10 +1405,22 @@ async def start( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """StartEnvironment starts an environment. + """ + Starts a stopped environment. - This function is idempotent, i.e. if the - environment is already running no error is returned. + Use this method to resume work on a previously stopped environment. The + environment retains its configuration and workspace content from when it was + stopped. + + ### Examples + + - Start an environment: + + Resumes a previously stopped environment with its existing configuration. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies which environment should be started. @@ -1011,7 +1456,20 @@ async def stop( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - StopEnvironment stops a running environment. + Stops a running environment. + + Use this method to pause work while preserving the environment's state. The + environment can be resumed later using StartEnvironment. + + ### Examples + + - Stop an environment: + + Gracefully stops a running environment while preserving its state. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies which environment should be stopped. diff --git a/src/gitpod/resources/organizations/domain_verifications.py b/src/gitpod/resources/organizations/domain_verifications.py index 37612897..079f837c 100644 --- a/src/gitpod/resources/organizations/domain_verifications.py +++ b/src/gitpod/resources/organizations/domain_verifications.py @@ -57,8 +57,8 @@ def with_streaming_response(self) -> DomainVerificationsResourceWithStreamingRes def create( self, *, - domain: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + domain: str, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -96,7 +96,7 @@ def create( def retrieve( self, *, - domain_verification_id: str | NotGiven = NOT_GIVEN, + domain_verification_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -131,9 +131,9 @@ def retrieve( def list( self, *, + organization_id: str, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -184,7 +184,7 @@ def list( def delete( self, *, - domain_verification_id: str | NotGiven = NOT_GIVEN, + domain_verification_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -219,7 +219,7 @@ def delete( def verify( self, *, - domain_verification_id: str | NotGiven = NOT_GIVEN, + domain_verification_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -275,8 +275,8 @@ def with_streaming_response(self) -> AsyncDomainVerificationsResourceWithStreami async def create( self, *, - domain: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + domain: str, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -314,7 +314,7 @@ async def create( async def retrieve( self, *, - domain_verification_id: str | NotGiven = NOT_GIVEN, + domain_verification_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -349,9 +349,9 @@ async def retrieve( def list( self, *, + organization_id: str, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -402,7 +402,7 @@ def list( async def delete( self, *, - domain_verification_id: str | NotGiven = NOT_GIVEN, + domain_verification_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -437,7 +437,7 @@ async def delete( async def verify( self, *, - domain_verification_id: str | NotGiven = NOT_GIVEN, + domain_verification_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/organizations/invites.py b/src/gitpod/resources/organizations/invites.py index 131a39b0..2c080ce4 100644 --- a/src/gitpod/resources/organizations/invites.py +++ b/src/gitpod/resources/organizations/invites.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> InvitesResourceWithStreamingResponse: def create( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -83,7 +83,7 @@ def create( def retrieve( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -117,7 +117,7 @@ def retrieve( def get_summary( self, *, - invite_id: str | NotGiven = NOT_GIVEN, + invite_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -171,7 +171,7 @@ def with_streaming_response(self) -> AsyncInvitesResourceWithStreamingResponse: async def create( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -207,7 +207,7 @@ async def create( async def retrieve( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -243,7 +243,7 @@ async def retrieve( async def get_summary( self, *, - invite_id: str | NotGiven = NOT_GIVEN, + invite_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 8707b720..b7e09574 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -105,9 +105,9 @@ def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: def create( self, *, + name: str, invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, join_organization: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -119,14 +119,14 @@ def create( CreateOrganization creates a new Organization. Args: + name: name is the organization name + invite_accounts_with_matching_domain: Should other Accounts with the same domain be automatically invited to the organization? join_organization: join_organization decides whether the Identity issuing this request joins the org on creation - name: name is the organization name - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -139,9 +139,9 @@ def create( "/gitpod.v1.OrganizationService/CreateOrganization", body=maybe_transform( { + "name": name, "invite_accounts_with_matching_domain": invite_accounts_with_matching_domain, "join_organization": join_organization, - "name": name, }, organization_create_params.OrganizationCreateParams, ), @@ -154,7 +154,7 @@ def create( def retrieve( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -190,9 +190,9 @@ def retrieve( def update( self, *, + organization_id: str, invite_domains: Optional[InviteDomainsParam] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -204,12 +204,12 @@ def update( UpdateOrganization updates the properties of an Organization. Args: + organization_id: organization_id is the ID of the organization to update the settings for. + invite_domains: invite_domains is the domain allowlist of the organization name: name is the new name of the organization - organization_id: organization_id is the ID of the organization to update the settings for. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -222,9 +222,9 @@ def update( "/gitpod.v1.OrganizationService/UpdateOrganization", body=maybe_transform( { + "organization_id": organization_id, "invite_domains": invite_domains, "name": name, - "organization_id": organization_id, }, organization_update_params.OrganizationUpdateParams, ), @@ -294,7 +294,7 @@ def list( def delete( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -373,7 +373,7 @@ def join( def leave( self, *, - user_id: str | NotGiven = NOT_GIVEN, + user_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -405,9 +405,9 @@ def leave( def list_members( self, *, + organization_id: str, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -462,9 +462,9 @@ def list_members( def set_role( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, + user_id: str, role: OrganizationRole | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -489,8 +489,8 @@ def set_role( body=maybe_transform( { "organization_id": organization_id, - "role": role, "user_id": user_id, + "role": role, }, organization_set_role_params.OrganizationSetRoleParams, ), @@ -536,9 +536,9 @@ def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResp async def create( self, *, + name: str, invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, join_organization: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -550,14 +550,14 @@ async def create( CreateOrganization creates a new Organization. Args: + name: name is the organization name + invite_accounts_with_matching_domain: Should other Accounts with the same domain be automatically invited to the organization? join_organization: join_organization decides whether the Identity issuing this request joins the org on creation - name: name is the organization name - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -570,9 +570,9 @@ async def create( "/gitpod.v1.OrganizationService/CreateOrganization", body=await async_maybe_transform( { + "name": name, "invite_accounts_with_matching_domain": invite_accounts_with_matching_domain, "join_organization": join_organization, - "name": name, }, organization_create_params.OrganizationCreateParams, ), @@ -585,7 +585,7 @@ async def create( async def retrieve( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -621,9 +621,9 @@ async def retrieve( async def update( self, *, + organization_id: str, invite_domains: Optional[InviteDomainsParam] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -635,12 +635,12 @@ async def update( UpdateOrganization updates the properties of an Organization. Args: + organization_id: organization_id is the ID of the organization to update the settings for. + invite_domains: invite_domains is the domain allowlist of the organization name: name is the new name of the organization - organization_id: organization_id is the ID of the organization to update the settings for. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -653,9 +653,9 @@ async def update( "/gitpod.v1.OrganizationService/UpdateOrganization", body=await async_maybe_transform( { + "organization_id": organization_id, "invite_domains": invite_domains, "name": name, - "organization_id": organization_id, }, organization_update_params.OrganizationUpdateParams, ), @@ -725,7 +725,7 @@ def list( async def delete( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -804,7 +804,7 @@ async def join( async def leave( self, *, - user_id: str | NotGiven = NOT_GIVEN, + user_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -836,9 +836,9 @@ async def leave( def list_members( self, *, + organization_id: str, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -893,9 +893,9 @@ def list_members( async def set_role( self, *, - organization_id: str | NotGiven = NOT_GIVEN, + organization_id: str, + user_id: str, role: OrganizationRole | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -920,8 +920,8 @@ async def set_role( body=await async_maybe_transform( { "organization_id": organization_id, - "role": role, "user_id": user_id, + "role": role, }, organization_set_role_params.OrganizationSetRoleParams, ), diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index ab984fef..57a80100 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -60,11 +60,11 @@ def with_streaming_response(self) -> SSOConfigurationsResourceWithStreamingRespo def create( self, *, - client_id: str | NotGiven = NOT_GIVEN, - client_secret: str | NotGiven = NOT_GIVEN, - email_domain: str | NotGiven = NOT_GIVEN, - issuer_url: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + client_id: str, + client_secret: str, + email_domain: str, + issuer_url: str, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -113,7 +113,7 @@ def create( def retrieve( self, *, - sso_configuration_id: str | NotGiven = NOT_GIVEN, + sso_configuration_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -150,12 +150,12 @@ def retrieve( def update( self, *, + sso_configuration_id: str, claims: Dict[str, str] | NotGiven = NOT_GIVEN, client_id: Optional[str] | NotGiven = NOT_GIVEN, client_secret: Optional[str] | NotGiven = NOT_GIVEN, email_domain: Optional[str] | NotGiven = NOT_GIVEN, issuer_url: Optional[str] | NotGiven = NOT_GIVEN, - sso_configuration_id: str | NotGiven = NOT_GIVEN, state: Optional[SSOConfigurationState] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -168,6 +168,8 @@ def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: + sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update + claims: claims are key/value pairs that defines a mapping of claims issued by the IdP. client_id: client_id is the client ID of the SSO provider @@ -176,8 +178,6 @@ def update( issuer_url: issuer_url is the URL of the IdP issuer - sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update - state: state is the state of the SSO configuration extra_headers: Send extra headers @@ -192,12 +192,12 @@ def update( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", body=maybe_transform( { + "sso_configuration_id": sso_configuration_id, "claims": claims, "client_id": client_id, "client_secret": client_secret, "email_domain": email_domain, "issuer_url": issuer_url, - "sso_configuration_id": sso_configuration_id, "state": state, }, sso_configuration_update_params.SSOConfigurationUpdateParams, @@ -211,9 +211,9 @@ def update( def list( self, *, + organization_id: str, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: sso_configuration_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -266,7 +266,7 @@ def list( def delete( self, *, - sso_configuration_id: str | NotGiven = NOT_GIVEN, + sso_configuration_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -322,11 +322,11 @@ def with_streaming_response(self) -> AsyncSSOConfigurationsResourceWithStreaming async def create( self, *, - client_id: str | NotGiven = NOT_GIVEN, - client_secret: str | NotGiven = NOT_GIVEN, - email_domain: str | NotGiven = NOT_GIVEN, - issuer_url: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + client_id: str, + client_secret: str, + email_domain: str, + issuer_url: str, + organization_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -375,7 +375,7 @@ async def create( async def retrieve( self, *, - sso_configuration_id: str | NotGiven = NOT_GIVEN, + sso_configuration_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -412,12 +412,12 @@ async def retrieve( async def update( self, *, + sso_configuration_id: str, claims: Dict[str, str] | NotGiven = NOT_GIVEN, client_id: Optional[str] | NotGiven = NOT_GIVEN, client_secret: Optional[str] | NotGiven = NOT_GIVEN, email_domain: Optional[str] | NotGiven = NOT_GIVEN, issuer_url: Optional[str] | NotGiven = NOT_GIVEN, - sso_configuration_id: str | NotGiven = NOT_GIVEN, state: Optional[SSOConfigurationState] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -430,6 +430,8 @@ async def update( UpdateSSOConfiguration updates the SSO configuration for the organization. Args: + sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update + claims: claims are key/value pairs that defines a mapping of claims issued by the IdP. client_id: client_id is the client ID of the SSO provider @@ -438,8 +440,6 @@ async def update( issuer_url: issuer_url is the URL of the IdP issuer - sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update - state: state is the state of the SSO configuration extra_headers: Send extra headers @@ -454,12 +454,12 @@ async def update( "/gitpod.v1.OrganizationService/UpdateSSOConfiguration", body=await async_maybe_transform( { + "sso_configuration_id": sso_configuration_id, "claims": claims, "client_id": client_id, "client_secret": client_secret, "email_domain": email_domain, "issuer_url": issuer_url, - "sso_configuration_id": sso_configuration_id, "state": state, }, sso_configuration_update_params.SSOConfigurationUpdateParams, @@ -473,9 +473,9 @@ async def update( def list( self, *, + organization_id: str, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: sso_configuration_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -528,7 +528,7 @@ def list( async def delete( self, *, - sso_configuration_id: str | NotGiven = NOT_GIVEN, + sso_configuration_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index 50e5f95b..e790fe78 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -191,8 +191,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ - ListEnvironmentClasses returns all environment classes configured for a runner. - buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ListEnvironmentClasses returns all + environment classes configured for a runner. Args: pagination: pagination contains the pagination options for listing environment classes @@ -389,8 +389,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ - ListEnvironmentClasses returns all environment classes configured for a runner. - buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ListEnvironmentClasses returns all + environment classes configured for a runner. Args: pagination: pagination contains the pagination options for listing environment classes diff --git a/src/gitpod/types/account.py b/src/gitpod/types/account.py index 417f6c88..251e6bd4 100644 --- a/src/gitpod/types/account.py +++ b/src/gitpod/types/account.py @@ -13,11 +13,9 @@ class Account(BaseModel): - id: Optional[str] = None + id: str - avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) - - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + created_at: datetime = FieldInfo(alias="createdAt") """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -109,27 +107,17 @@ class Account(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - email: Optional[str] = None - - joinables: Optional[List[JoinableOrganization]] = None - - memberships: Optional[List[AccountMembership]] = None - - name: Optional[str] = None + email: str - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) - """ - organization_id is the ID of the organization the account is owned by if it's - created through custom SSO - """ + name: str - public_email_provider: Optional[bool] = FieldInfo(alias="publicEmailProvider", default=None) + public_email_provider: bool = FieldInfo(alias="publicEmailProvider") """ public_email_provider is true if the email for the Account matches a known public email provider """ - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + updated_at: datetime = FieldInfo(alias="updatedAt") """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -220,3 +208,15 @@ class Account(BaseModel): [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. """ + + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + + joinables: Optional[List[JoinableOrganization]] = None + + memberships: Optional[List[AccountMembership]] = None + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """ + organization_id is the ID of the organization the account is owned by if it's + created through custom SSO + """ diff --git a/src/gitpod/types/account_delete_params.py b/src/gitpod/types/account_delete_params.py index 93e5bf16..a0491320 100644 --- a/src/gitpod/types/account_delete_params.py +++ b/src/gitpod/types/account_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,4 +10,4 @@ class AccountDeleteParams(TypedDict, total=False): - account_id: Annotated[str, PropertyInfo(alias="accountId")] + account_id: Required[Annotated[str, PropertyInfo(alias="accountId")]] diff --git a/src/gitpod/types/account_get_sso_login_url_params.py b/src/gitpod/types/account_get_sso_login_url_params.py index 7689a8d3..4551e597 100644 --- a/src/gitpod/types/account_get_sso_login_url_params.py +++ b/src/gitpod/types/account_get_sso_login_url_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -11,7 +11,7 @@ class AccountGetSSOLoginURLParams(TypedDict, total=False): - email: str + email: Required[str] """email is the email the user wants to login with""" return_to: Annotated[Optional[str], PropertyInfo(alias="returnTo")] diff --git a/src/gitpod/types/account_get_sso_login_url_response.py b/src/gitpod/types/account_get_sso_login_url_response.py index e0cb6133..192a5fc3 100644 --- a/src/gitpod/types/account_get_sso_login_url_response.py +++ b/src/gitpod/types/account_get_sso_login_url_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -10,5 +9,5 @@ class AccountGetSSOLoginURLResponse(BaseModel): - login_url: Optional[str] = FieldInfo(alias="loginUrl", default=None) + login_url: str = FieldInfo(alias="loginUrl") """login_url is the URL to redirect the user to for SSO login""" diff --git a/src/gitpod/types/account_membership.py b/src/gitpod/types/account_membership.py index c0e606db..cd27512b 100644 --- a/src/gitpod/types/account_membership.py +++ b/src/gitpod/types/account_membership.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -11,20 +10,20 @@ class AccountMembership(BaseModel): - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + organization_id: str = FieldInfo(alias="organizationId") """organization_id is the id of the organization the user is a member of""" - organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + organization_member_count: int = FieldInfo(alias="organizationMemberCount") """ organization_name is the member count of the organization the user is a member of """ - organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) + organization_name: str = FieldInfo(alias="organizationName") """organization_name is the name of the organization the user is a member of""" - user_id: Optional[str] = FieldInfo(alias="userId", default=None) + user_id: str = FieldInfo(alias="userId") """user_id is the ID the user has in the organization""" - user_role: Optional[OrganizationRole] = FieldInfo(alias="userRole", default=None) + user_role: OrganizationRole = FieldInfo(alias="userRole") """user_role is the role the user has in the organization""" diff --git a/src/gitpod/types/account_retrieve_response.py b/src/gitpod/types/account_retrieve_response.py index 529e42b1..2768a2d4 100644 --- a/src/gitpod/types/account_retrieve_response.py +++ b/src/gitpod/types/account_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .account import Account from .._models import BaseModel @@ -9,4 +8,4 @@ class AccountRetrieveResponse(BaseModel): - account: Optional[Account] = None + account: Account diff --git a/src/gitpod/types/environment_retrieve_params.py b/src/gitpod/types/environment_retrieve_params.py index 7be510e5..f470b6cc 100644 --- a/src/gitpod/types/environment_retrieve_params.py +++ b/src/gitpod/types/environment_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,5 +10,5 @@ class EnvironmentRetrieveParams(TypedDict, total=False): - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + environment_id: Required[Annotated[str, PropertyInfo(alias="environmentId")]] """environment_id specifies the environment to get""" diff --git a/src/gitpod/types/joinable_organization.py b/src/gitpod/types/joinable_organization.py index f2fa9574..33686019 100644 --- a/src/gitpod/types/joinable_organization.py +++ b/src/gitpod/types/joinable_organization.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -10,14 +9,14 @@ class JoinableOrganization(BaseModel): - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + organization_id: str = FieldInfo(alias="organizationId") """organization_id is the id of the organization the user can join""" - organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + organization_member_count: int = FieldInfo(alias="organizationMemberCount") """ organization_member_count is the member count of the organization the user can join """ - organization_name: Optional[str] = FieldInfo(alias="organizationName", default=None) + organization_name: str = FieldInfo(alias="organizationName") """organization_name is the name of the organization the user can join""" diff --git a/src/gitpod/types/login_provider.py b/src/gitpod/types/login_provider.py index 1a3b194c..7ff022b2 100644 --- a/src/gitpod/types/login_provider.py +++ b/src/gitpod/types/login_provider.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -10,10 +9,10 @@ class LoginProvider(BaseModel): - login_url: Optional[str] = FieldInfo(alias="loginUrl", default=None) + login_url: str = FieldInfo(alias="loginUrl") """login_url is the URL to redirect the browser agent to for login""" - provider: Optional[str] = None + provider: str """provider is the provider used by this login method, e.g. "github", "google", "custom" diff --git a/src/gitpod/types/organization.py b/src/gitpod/types/organization.py index 4fd832bd..4d5eaeef 100644 --- a/src/gitpod/types/organization.py +++ b/src/gitpod/types/organization.py @@ -12,9 +12,9 @@ class Organization(BaseModel): - id: Optional[str] = None + id: str - created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + created_at: datetime = FieldInfo(alias="createdAt") """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -106,11 +106,9 @@ class Organization(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - invite_domains: Optional[InviteDomains] = FieldInfo(alias="inviteDomains", default=None) - - name: Optional[str] = None + name: str - updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + updated_at: datetime = FieldInfo(alias="updatedAt") """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -201,3 +199,5 @@ class Organization(BaseModel): [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. """ + + invite_domains: Optional[InviteDomains] = FieldInfo(alias="inviteDomains", default=None) diff --git a/src/gitpod/types/organization_create_params.py b/src/gitpod/types/organization_create_params.py index d31cc896..8251342f 100644 --- a/src/gitpod/types/organization_create_params.py +++ b/src/gitpod/types/organization_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,6 +10,9 @@ class OrganizationCreateParams(TypedDict, total=False): + name: Required[str] + """name is the organization name""" + invite_accounts_with_matching_domain: Annotated[bool, PropertyInfo(alias="inviteAccountsWithMatchingDomain")] """ Should other Accounts with the same domain be automatically invited to the @@ -21,6 +24,3 @@ class OrganizationCreateParams(TypedDict, total=False): join_organization decides whether the Identity issuing this request joins the org on creation """ - - name: str - """name is the organization name""" diff --git a/src/gitpod/types/organization_create_response.py b/src/gitpod/types/organization_create_response.py index a716cae1..51cb8f7e 100644 --- a/src/gitpod/types/organization_create_response.py +++ b/src/gitpod/types/organization_create_response.py @@ -10,11 +10,11 @@ class OrganizationCreateResponse(BaseModel): + organization: Organization + """organization is the created organization""" + member: Optional[OrganizationMember] = None """member is the member that joined the org on creation. Only set if specified "join_organization" is "true" in the request. """ - - organization: Optional[Organization] = None - """organization is the created organization""" diff --git a/src/gitpod/types/organization_delete_params.py b/src/gitpod/types/organization_delete_params.py index c3915562..8402335b 100644 --- a/src/gitpod/types/organization_delete_params.py +++ b/src/gitpod/types/organization_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,5 +10,5 @@ class OrganizationDeleteParams(TypedDict, total=False): - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organization_id is the ID of the organization to delete""" diff --git a/src/gitpod/types/organization_join_response.py b/src/gitpod/types/organization_join_response.py index 880a93de..f6a4f3dd 100644 --- a/src/gitpod/types/organization_join_response.py +++ b/src/gitpod/types/organization_join_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .._models import BaseModel from .organization_member import OrganizationMember @@ -9,5 +8,5 @@ class OrganizationJoinResponse(BaseModel): - member: Optional[OrganizationMember] = None + member: OrganizationMember """member is the member that was created by joining the organization.""" diff --git a/src/gitpod/types/organization_leave_params.py b/src/gitpod/types/organization_leave_params.py index c2c29933..f8756444 100644 --- a/src/gitpod/types/organization_leave_params.py +++ b/src/gitpod/types/organization_leave_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,4 +10,4 @@ class OrganizationLeaveParams(TypedDict, total=False): - user_id: Annotated[str, PropertyInfo(alias="userId")] + user_id: Required[Annotated[str, PropertyInfo(alias="userId")]] diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 9c03562d..aa85f580 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,13 +10,13 @@ class OrganizationListMembersParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to list members for""" + token: str page_size: Annotated[int, PropertyInfo(alias="pageSize")] - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the ID of the organization to list members for""" - pagination: Pagination """pagination contains the pagination options for listing members""" diff --git a/src/gitpod/types/organization_member.py b/src/gitpod/types/organization_member.py index b1a0109b..6745f0b2 100644 --- a/src/gitpod/types/organization_member.py +++ b/src/gitpod/types/organization_member.py @@ -13,16 +13,14 @@ class OrganizationMember(BaseModel): - avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) - - email: Optional[str] = None + email: str - full_name: Optional[str] = FieldInfo(alias="fullName", default=None) + full_name: str = FieldInfo(alias="fullName") - login_provider: Optional[str] = FieldInfo(alias="loginProvider", default=None) + login_provider: str = FieldInfo(alias="loginProvider") """login_provider is the login provider the user uses to sign in""" - member_since: Optional[datetime] = FieldInfo(alias="memberSince", default=None) + member_since: datetime = FieldInfo(alias="memberSince") """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond @@ -114,8 +112,10 @@ class OrganizationMember(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ - role: Optional[OrganizationRole] = None + role: OrganizationRole - status: Optional[UserStatus] = None + status: UserStatus - user_id: Optional[str] = FieldInfo(alias="userId", default=None) + user_id: str = FieldInfo(alias="userId") + + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) diff --git a/src/gitpod/types/organization_retrieve_params.py b/src/gitpod/types/organization_retrieve_params.py index 69947191..e81f1f3d 100644 --- a/src/gitpod/types/organization_retrieve_params.py +++ b/src/gitpod/types/organization_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,5 +10,5 @@ class OrganizationRetrieveParams(TypedDict, total=False): - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organization_id is the unique identifier of the Organization to retreive.""" diff --git a/src/gitpod/types/organization_retrieve_response.py b/src/gitpod/types/organization_retrieve_response.py index 4cb085e4..064ba4a1 100644 --- a/src/gitpod/types/organization_retrieve_response.py +++ b/src/gitpod/types/organization_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .._models import BaseModel from .organization import Organization @@ -9,5 +8,5 @@ class OrganizationRetrieveResponse(BaseModel): - organization: Optional[Organization] = None + organization: Organization """organization is the requested organization""" diff --git a/src/gitpod/types/organization_set_role_params.py b/src/gitpod/types/organization_set_role_params.py index fd565ece..9c9d4b88 100644 --- a/src/gitpod/types/organization_set_role_params.py +++ b/src/gitpod/types/organization_set_role_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo from .shared.organization_role import OrganizationRole @@ -11,8 +11,8 @@ class OrganizationSetRoleParams(TypedDict, total=False): - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] - role: OrganizationRole + user_id: Required[Annotated[str, PropertyInfo(alias="userId")]] - user_id: Annotated[str, PropertyInfo(alias="userId")] + role: OrganizationRole diff --git a/src/gitpod/types/organization_update_params.py b/src/gitpod/types/organization_update_params.py index 90e4d514..b6018bf6 100644 --- a/src/gitpod/types/organization_update_params.py +++ b/src/gitpod/types/organization_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo from .invite_domains_param import InviteDomainsParam @@ -12,11 +12,11 @@ class OrganizationUpdateParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to update the settings for.""" + invite_domains: Annotated[Optional[InviteDomainsParam], PropertyInfo(alias="inviteDomains")] """invite_domains is the domain allowlist of the organization""" name: Optional[str] """name is the new name of the organization""" - - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the ID of the organization to update the settings for.""" diff --git a/src/gitpod/types/organization_update_response.py b/src/gitpod/types/organization_update_response.py index fed05e61..f5fcb1bb 100644 --- a/src/gitpod/types/organization_update_response.py +++ b/src/gitpod/types/organization_update_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .._models import BaseModel from .organization import Organization @@ -9,5 +8,5 @@ class OrganizationUpdateResponse(BaseModel): - organization: Optional[Organization] = None + organization: Organization """organization is the updated organization""" diff --git a/src/gitpod/types/organizations/domain_verification.py b/src/gitpod/types/organizations/domain_verification.py index 04d9847a..693e6132 100644 --- a/src/gitpod/types/organizations/domain_verification.py +++ b/src/gitpod/types/organizations/domain_verification.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from datetime import datetime from pydantic import Field as FieldInfo @@ -12,15 +11,15 @@ class DomainVerification(BaseModel): - id: Optional[str] = None + id: str - domain: Optional[str] = None + domain: str - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + organization_id: str = FieldInfo(alias="organizationId") - state: Optional[DomainVerificationState] = None + state: DomainVerificationState - verified_at: Optional[datetime] = FieldInfo(alias="verifiedAt", default=None) + verified_at: datetime = FieldInfo(alias="verifiedAt") """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond diff --git a/src/gitpod/types/organizations/domain_verification_create_params.py b/src/gitpod/types/organizations/domain_verification_create_params.py index 317c1589..cfd882a6 100644 --- a/src/gitpod/types/organizations/domain_verification_create_params.py +++ b/src/gitpod/types/organizations/domain_verification_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,6 +10,6 @@ class DomainVerificationCreateParams(TypedDict, total=False): - domain: str + domain: Required[str] - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] diff --git a/src/gitpod/types/organizations/domain_verification_create_response.py b/src/gitpod/types/organizations/domain_verification_create_response.py index c42eb645..548d08a0 100644 --- a/src/gitpod/types/organizations/domain_verification_create_response.py +++ b/src/gitpod/types/organizations/domain_verification_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -11,4 +10,4 @@ class DomainVerificationCreateResponse(BaseModel): - domain_verification: Optional[DomainVerification] = FieldInfo(alias="domainVerification", default=None) + domain_verification: DomainVerification = FieldInfo(alias="domainVerification") diff --git a/src/gitpod/types/organizations/domain_verification_delete_params.py b/src/gitpod/types/organizations/domain_verification_delete_params.py index 15025b93..d8f6a816 100644 --- a/src/gitpod/types/organizations/domain_verification_delete_params.py +++ b/src/gitpod/types/organizations/domain_verification_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,4 @@ class DomainVerificationDeleteParams(TypedDict, total=False): - domain_verification_id: Annotated[str, PropertyInfo(alias="domainVerificationId")] + domain_verification_id: Required[Annotated[str, PropertyInfo(alias="domainVerificationId")]] diff --git a/src/gitpod/types/organizations/domain_verification_list_params.py b/src/gitpod/types/organizations/domain_verification_list_params.py index dfa94c2a..26573f62 100644 --- a/src/gitpod/types/organizations/domain_verification_list_params.py +++ b/src/gitpod/types/organizations/domain_verification_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,12 +10,12 @@ class DomainVerificationListParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + token: str page_size: Annotated[int, PropertyInfo(alias="pageSize")] - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - pagination: Pagination diff --git a/src/gitpod/types/organizations/domain_verification_retrieve_params.py b/src/gitpod/types/organizations/domain_verification_retrieve_params.py index c4717202..7910e1f4 100644 --- a/src/gitpod/types/organizations/domain_verification_retrieve_params.py +++ b/src/gitpod/types/organizations/domain_verification_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,4 @@ class DomainVerificationRetrieveParams(TypedDict, total=False): - domain_verification_id: Annotated[str, PropertyInfo(alias="domainVerificationId")] + domain_verification_id: Required[Annotated[str, PropertyInfo(alias="domainVerificationId")]] diff --git a/src/gitpod/types/organizations/domain_verification_retrieve_response.py b/src/gitpod/types/organizations/domain_verification_retrieve_response.py index 06d27377..88577d6d 100644 --- a/src/gitpod/types/organizations/domain_verification_retrieve_response.py +++ b/src/gitpod/types/organizations/domain_verification_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -11,4 +10,4 @@ class DomainVerificationRetrieveResponse(BaseModel): - domain_verification: Optional[DomainVerification] = FieldInfo(alias="domainVerification", default=None) + domain_verification: DomainVerification = FieldInfo(alias="domainVerification") diff --git a/src/gitpod/types/organizations/domain_verification_verify_params.py b/src/gitpod/types/organizations/domain_verification_verify_params.py index 7f96c204..1f0c3e87 100644 --- a/src/gitpod/types/organizations/domain_verification_verify_params.py +++ b/src/gitpod/types/organizations/domain_verification_verify_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,4 @@ class DomainVerificationVerifyParams(TypedDict, total=False): - domain_verification_id: Annotated[str, PropertyInfo(alias="domainVerificationId")] + domain_verification_id: Required[Annotated[str, PropertyInfo(alias="domainVerificationId")]] diff --git a/src/gitpod/types/organizations/domain_verification_verify_response.py b/src/gitpod/types/organizations/domain_verification_verify_response.py index 91c00533..8d2c6493 100644 --- a/src/gitpod/types/organizations/domain_verification_verify_response.py +++ b/src/gitpod/types/organizations/domain_verification_verify_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -11,4 +10,4 @@ class DomainVerificationVerifyResponse(BaseModel): - domain_verification: Optional[DomainVerification] = FieldInfo(alias="domainVerification", default=None) + domain_verification: DomainVerification = FieldInfo(alias="domainVerification") diff --git a/src/gitpod/types/organizations/invite_create_params.py b/src/gitpod/types/organizations/invite_create_params.py index 7caa9f48..32455ba6 100644 --- a/src/gitpod/types/organizations/invite_create_params.py +++ b/src/gitpod/types/organizations/invite_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,4 @@ class InviteCreateParams(TypedDict, total=False): - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] diff --git a/src/gitpod/types/organizations/invite_create_response.py b/src/gitpod/types/organizations/invite_create_response.py index 95c8bd76..36297d0c 100644 --- a/src/gitpod/types/organizations/invite_create_response.py +++ b/src/gitpod/types/organizations/invite_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ..._models import BaseModel from .organization_invite import OrganizationInvite @@ -9,4 +8,4 @@ class InviteCreateResponse(BaseModel): - invite: Optional[OrganizationInvite] = None + invite: OrganizationInvite diff --git a/src/gitpod/types/organizations/invite_get_summary_params.py b/src/gitpod/types/organizations/invite_get_summary_params.py index 9cbd5c90..5b576566 100644 --- a/src/gitpod/types/organizations/invite_get_summary_params.py +++ b/src/gitpod/types/organizations/invite_get_summary_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,4 @@ class InviteGetSummaryParams(TypedDict, total=False): - invite_id: Annotated[str, PropertyInfo(alias="inviteId")] + invite_id: Required[Annotated[str, PropertyInfo(alias="inviteId")]] diff --git a/src/gitpod/types/organizations/invite_get_summary_response.py b/src/gitpod/types/organizations/invite_get_summary_response.py index 16c355ad..786ae362 100644 --- a/src/gitpod/types/organizations/invite_get_summary_response.py +++ b/src/gitpod/types/organizations/invite_get_summary_response.py @@ -10,7 +10,7 @@ class InviteGetSummaryResponse(BaseModel): - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + organization_id: str = FieldInfo(alias="organizationId") organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) diff --git a/src/gitpod/types/organizations/invite_retrieve_params.py b/src/gitpod/types/organizations/invite_retrieve_params.py index 3a6a5fd4..a1812148 100644 --- a/src/gitpod/types/organizations/invite_retrieve_params.py +++ b/src/gitpod/types/organizations/invite_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,4 @@ class InviteRetrieveParams(TypedDict, total=False): - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] diff --git a/src/gitpod/types/organizations/invite_retrieve_response.py b/src/gitpod/types/organizations/invite_retrieve_response.py index bbdcdc8d..aa4239f2 100644 --- a/src/gitpod/types/organizations/invite_retrieve_response.py +++ b/src/gitpod/types/organizations/invite_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ..._models import BaseModel from .organization_invite import OrganizationInvite @@ -9,4 +8,4 @@ class InviteRetrieveResponse(BaseModel): - invite: Optional[OrganizationInvite] = None + invite: OrganizationInvite diff --git a/src/gitpod/types/organizations/organization_invite.py b/src/gitpod/types/organizations/organization_invite.py index d31f882d..3f8e7f17 100644 --- a/src/gitpod/types/organizations/organization_invite.py +++ b/src/gitpod/types/organizations/organization_invite.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -10,7 +9,7 @@ class OrganizationInvite(BaseModel): - invite_id: Optional[str] = FieldInfo(alias="inviteId", default=None) + invite_id: str = FieldInfo(alias="inviteId") """ invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization. diff --git a/src/gitpod/types/organizations/sso_configuration.py b/src/gitpod/types/organizations/sso_configuration.py index fec9955d..c12bf7cd 100644 --- a/src/gitpod/types/organizations/sso_configuration.py +++ b/src/gitpod/types/organizations/sso_configuration.py @@ -12,24 +12,24 @@ class SSOConfiguration(BaseModel): - id: Optional[str] = None + id: str """id is the unique identifier of the SSO configuration""" - claims: Optional[Dict[str, str]] = None - """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" - - client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + client_id: str = FieldInfo(alias="clientId") """client_id is the client ID of the OIDC application set on the IdP""" - email_domain: Optional[str] = FieldInfo(alias="emailDomain", default=None) + email_domain: str = FieldInfo(alias="emailDomain") - issuer_url: Optional[str] = FieldInfo(alias="issuerUrl", default=None) + issuer_url: str = FieldInfo(alias="issuerUrl") """issuer_url is the URL of the IdP issuer""" - organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + organization_id: str = FieldInfo(alias="organizationId") - provider_type: Optional[ProviderType] = FieldInfo(alias="providerType", default=None) + provider_type: ProviderType = FieldInfo(alias="providerType") """provider_type defines the type of the SSO configuration""" - state: Optional[SSOConfigurationState] = None + state: SSOConfigurationState """state is the state of the SSO configuration""" + + claims: Optional[Dict[str, str]] = None + """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" diff --git a/src/gitpod/types/organizations/sso_configuration_create_params.py b/src/gitpod/types/organizations/sso_configuration_create_params.py index 7257b9be..cd14f5c0 100644 --- a/src/gitpod/types/organizations/sso_configuration_create_params.py +++ b/src/gitpod/types/organizations/sso_configuration_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,16 +10,16 @@ class SSOConfigurationCreateParams(TypedDict, total=False): - client_id: Annotated[str, PropertyInfo(alias="clientId")] + client_id: Required[Annotated[str, PropertyInfo(alias="clientId")]] """client_id is the client ID of the OIDC application set on the IdP""" - client_secret: Annotated[str, PropertyInfo(alias="clientSecret")] + client_secret: Required[Annotated[str, PropertyInfo(alias="clientSecret")]] """client_secret is the client secret of the OIDC application set on the IdP""" - email_domain: Annotated[str, PropertyInfo(alias="emailDomain")] + email_domain: Required[Annotated[str, PropertyInfo(alias="emailDomain")]] """email_domain is the domain that is allowed to sign in to the organization""" - issuer_url: Annotated[str, PropertyInfo(alias="issuerUrl")] + issuer_url: Required[Annotated[str, PropertyInfo(alias="issuerUrl")]] """issuer_url is the URL of the IdP issuer""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] diff --git a/src/gitpod/types/organizations/sso_configuration_create_response.py b/src/gitpod/types/organizations/sso_configuration_create_response.py index 962038c4..0a2da397 100644 --- a/src/gitpod/types/organizations/sso_configuration_create_response.py +++ b/src/gitpod/types/organizations/sso_configuration_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -11,5 +10,5 @@ class SSOConfigurationCreateResponse(BaseModel): - sso_configuration: Optional[SSOConfiguration] = FieldInfo(alias="ssoConfiguration", default=None) + sso_configuration: SSOConfiguration = FieldInfo(alias="ssoConfiguration") """sso_configuration is the created SSO configuration""" diff --git a/src/gitpod/types/organizations/sso_configuration_delete_params.py b/src/gitpod/types/organizations/sso_configuration_delete_params.py index 889b5439..0e3f7b0c 100644 --- a/src/gitpod/types/organizations/sso_configuration_delete_params.py +++ b/src/gitpod/types/organizations/sso_configuration_delete_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,4 +10,4 @@ class SSOConfigurationDeleteParams(TypedDict, total=False): - sso_configuration_id: Annotated[str, PropertyInfo(alias="ssoConfigurationId")] + sso_configuration_id: Required[Annotated[str, PropertyInfo(alias="ssoConfigurationId")]] diff --git a/src/gitpod/types/organizations/sso_configuration_list_params.py b/src/gitpod/types/organizations/sso_configuration_list_params.py index 3174a67d..1f4b3a6d 100644 --- a/src/gitpod/types/organizations/sso_configuration_list_params.py +++ b/src/gitpod/types/organizations/sso_configuration_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,13 +10,13 @@ class SSOConfigurationListParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to list SSO configurations for.""" + token: str page_size: Annotated[int, PropertyInfo(alias="pageSize")] - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the ID of the organization to list SSO configurations for.""" - pagination: Pagination diff --git a/src/gitpod/types/organizations/sso_configuration_retrieve_params.py b/src/gitpod/types/organizations/sso_configuration_retrieve_params.py index a8afe6ea..25aa6340 100644 --- a/src/gitpod/types/organizations/sso_configuration_retrieve_params.py +++ b/src/gitpod/types/organizations/sso_configuration_retrieve_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,5 +10,5 @@ class SSOConfigurationRetrieveParams(TypedDict, total=False): - sso_configuration_id: Annotated[str, PropertyInfo(alias="ssoConfigurationId")] + sso_configuration_id: Required[Annotated[str, PropertyInfo(alias="ssoConfigurationId")]] """sso_configuration_id is the ID of the SSO configuration to get""" diff --git a/src/gitpod/types/organizations/sso_configuration_retrieve_response.py b/src/gitpod/types/organizations/sso_configuration_retrieve_response.py index 20aa1285..9a1da1a1 100644 --- a/src/gitpod/types/organizations/sso_configuration_retrieve_response.py +++ b/src/gitpod/types/organizations/sso_configuration_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -11,5 +10,5 @@ class SSOConfigurationRetrieveResponse(BaseModel): - sso_configuration: Optional[SSOConfiguration] = FieldInfo(alias="ssoConfiguration", default=None) + sso_configuration: SSOConfiguration = FieldInfo(alias="ssoConfiguration") """sso_configuration is the SSO configuration identified by the ID""" diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py index 129ce2c1..4af2dab7 100644 --- a/src/gitpod/types/organizations/sso_configuration_update_params.py +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo from .sso_configuration_state import SSOConfigurationState @@ -12,6 +12,9 @@ class SSOConfigurationUpdateParams(TypedDict, total=False): + sso_configuration_id: Required[Annotated[str, PropertyInfo(alias="ssoConfigurationId")]] + """sso_configuration_id is the ID of the SSO configuration to update""" + claims: Dict[str, str] """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" @@ -26,8 +29,5 @@ class SSOConfigurationUpdateParams(TypedDict, total=False): issuer_url: Annotated[Optional[str], PropertyInfo(alias="issuerUrl")] """issuer_url is the URL of the IdP issuer""" - sso_configuration_id: Annotated[str, PropertyInfo(alias="ssoConfigurationId")] - """sso_configuration_id is the ID of the SSO configuration to update""" - state: Optional[SSOConfigurationState] """state is the state of the SSO configuration""" diff --git a/tests/api_resources/organizations/test_domain_verifications.py b/tests/api_resources/organizations/test_domain_verifications.py index 9a170cf5..2b12ebf2 100644 --- a/tests/api_resources/organizations/test_domain_verifications.py +++ b/tests/api_resources/organizations/test_domain_verifications.py @@ -26,12 +26,6 @@ class TestDomainVerifications: @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: - domain_verification = client.organizations.domain_verifications.create() - assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_create_with_all_params(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.create( domain="xxxx", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -41,7 +35,10 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.domain_verifications.with_raw_response.create() + response = client.organizations.domain_verifications.with_raw_response.create( + domain="xxxx", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,7 +48,10 @@ def test_raw_response_create(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.domain_verifications.with_streaming_response.create() as response: + with client.organizations.domain_verifications.with_streaming_response.create( + domain="xxxx", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,12 +63,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - domain_verification = client.organizations.domain_verifications.retrieve() - assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.retrieve( domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -77,7 +71,9 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.domain_verifications.with_raw_response.retrieve() + response = client.organizations.domain_verifications.with_raw_response.retrieve( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -87,7 +83,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.domain_verifications.with_streaming_response.retrieve() as response: + with client.organizations.domain_verifications.with_streaming_response.retrieve( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -99,16 +97,18 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: - domain_verification = client.organizations.domain_verifications.list() + domain_verification = client.organizations.domain_verifications.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", token="token", page_size=0, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -119,7 +119,9 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.organizations.domain_verifications.with_raw_response.list() + response = client.organizations.domain_verifications.with_raw_response.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -129,7 +131,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.organizations.domain_verifications.with_streaming_response.list() as response: + with client.organizations.domain_verifications.with_streaming_response.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -141,12 +145,6 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: - domain_verification = client.organizations.domain_verifications.delete() - assert_matches_type(object, domain_verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_delete_with_all_params(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.delete( domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -155,7 +153,9 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.organizations.domain_verifications.with_raw_response.delete() + response = client.organizations.domain_verifications.with_raw_response.delete( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -165,7 +165,9 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.organizations.domain_verifications.with_streaming_response.delete() as response: + with client.organizations.domain_verifications.with_streaming_response.delete( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -177,12 +179,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_verify(self, client: Gitpod) -> None: - domain_verification = client.organizations.domain_verifications.verify() - assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_verify_with_all_params(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.verify( domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -191,7 +187,9 @@ def test_method_verify_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_verify(self, client: Gitpod) -> None: - response = client.organizations.domain_verifications.with_raw_response.verify() + response = client.organizations.domain_verifications.with_raw_response.verify( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -201,7 +199,9 @@ def test_raw_response_verify(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_verify(self, client: Gitpod) -> None: - with client.organizations.domain_verifications.with_streaming_response.verify() as response: + with client.organizations.domain_verifications.with_streaming_response.verify( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -217,12 +217,6 @@ class TestAsyncDomainVerifications: @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - domain_verification = await async_client.organizations.domain_verifications.create() - assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.create( domain="xxxx", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -232,7 +226,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.domain_verifications.with_raw_response.create() + response = await async_client.organizations.domain_verifications.with_raw_response.create( + domain="xxxx", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -242,7 +239,10 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.domain_verifications.with_streaming_response.create() as response: + async with async_client.organizations.domain_verifications.with_streaming_response.create( + domain="xxxx", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -254,12 +254,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - domain_verification = await async_client.organizations.domain_verifications.retrieve() - assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.retrieve( domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -268,7 +262,9 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.domain_verifications.with_raw_response.retrieve() + response = await async_client.organizations.domain_verifications.with_raw_response.retrieve( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -278,7 +274,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.domain_verifications.with_streaming_response.retrieve() as response: + async with async_client.organizations.domain_verifications.with_streaming_response.retrieve( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -290,16 +288,18 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - domain_verification = await async_client.organizations.domain_verifications.list() + domain_verification = await async_client.organizations.domain_verifications.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", token="token", page_size=0, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -310,7 +310,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.domain_verifications.with_raw_response.list() + response = await async_client.organizations.domain_verifications.with_raw_response.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -320,7 +322,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.domain_verifications.with_streaming_response.list() as response: + async with async_client.organizations.domain_verifications.with_streaming_response.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -334,12 +338,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - domain_verification = await async_client.organizations.domain_verifications.delete() - assert_matches_type(object, domain_verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.delete( domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -348,7 +346,9 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.domain_verifications.with_raw_response.delete() + response = await async_client.organizations.domain_verifications.with_raw_response.delete( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -358,7 +358,9 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.domain_verifications.with_streaming_response.delete() as response: + async with async_client.organizations.domain_verifications.with_streaming_response.delete( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -370,12 +372,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_method_verify(self, async_client: AsyncGitpod) -> None: - domain_verification = await async_client.organizations.domain_verifications.verify() - assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_verify_with_all_params(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.verify( domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -384,7 +380,9 @@ async def test_method_verify_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.domain_verifications.with_raw_response.verify() + response = await async_client.organizations.domain_verifications.with_raw_response.verify( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -394,7 +392,9 @@ async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_verify(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.domain_verifications.with_streaming_response.verify() as response: + async with async_client.organizations.domain_verifications.with_streaming_response.verify( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index b158bc41..2b426d67 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -24,12 +24,6 @@ class TestInvites: @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: - invite = client.organizations.invites.create() - assert_matches_type(InviteCreateResponse, invite, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_create_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.create( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -38,7 +32,9 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.invites.with_raw_response.create() + response = client.organizations.invites.with_raw_response.create( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -48,7 +44,9 @@ def test_raw_response_create(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.invites.with_streaming_response.create() as response: + with client.organizations.invites.with_streaming_response.create( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -60,12 +58,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - invite = client.organizations.invites.retrieve() - assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -74,7 +66,9 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.invites.with_raw_response.retrieve() + response = client.organizations.invites.with_raw_response.retrieve( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -84,7 +78,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.invites.with_streaming_response.retrieve() as response: + with client.organizations.invites.with_streaming_response.retrieve( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -96,12 +92,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_get_summary(self, client: Gitpod) -> None: - invite = client.organizations.invites.get_summary() - assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -110,7 +100,9 @@ def test_method_get_summary_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_get_summary(self, client: Gitpod) -> None: - response = client.organizations.invites.with_raw_response.get_summary() + response = client.organizations.invites.with_raw_response.get_summary( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -120,7 +112,9 @@ def test_raw_response_get_summary(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_get_summary(self, client: Gitpod) -> None: - with client.organizations.invites.with_streaming_response.get_summary() as response: + with client.organizations.invites.with_streaming_response.get_summary( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -136,12 +130,6 @@ class TestAsyncInvites: @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invites.create() - assert_matches_type(InviteCreateResponse, invite, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -150,7 +138,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invites.with_raw_response.create() + response = await async_client.organizations.invites.with_raw_response.create( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -160,7 +150,9 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invites.with_streaming_response.create() as response: + async with async_client.organizations.invites.with_streaming_response.create( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -172,12 +164,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invites.retrieve() - assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -186,7 +172,9 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invites.with_raw_response.retrieve() + response = await async_client.organizations.invites.with_raw_response.retrieve( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -196,7 +184,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invites.with_streaming_response.retrieve() as response: + async with async_client.organizations.invites.with_streaming_response.retrieve( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -208,12 +198,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: - invite = await async_client.organizations.invites.get_summary() - assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -222,7 +206,9 @@ async def test_method_get_summary_with_all_params(self, async_client: AsyncGitpo @pytest.mark.skip() @parametrize async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.invites.with_raw_response.get_summary() + response = await async_client.organizations.invites.with_raw_response.get_summary( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -232,7 +218,9 @@ async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None @pytest.mark.skip() @parametrize async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.invites.with_streaming_response.get_summary() as response: + async with async_client.organizations.invites.with_streaming_response.get_summary( + invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index c8f45ade..09f440f6 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -25,12 +25,6 @@ class TestSSOConfigurations: @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.create() - assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_create_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( client_id="x", client_secret="x", @@ -43,7 +37,13 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.create() + response = client.organizations.sso_configurations.with_raw_response.create( + client_id="x", + client_secret="x", + email_domain="xxxx", + issuer_url="https://example.com", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -53,7 +53,13 @@ def test_raw_response_create(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.create() as response: + with client.organizations.sso_configurations.with_streaming_response.create( + client_id="x", + client_secret="x", + email_domain="xxxx", + issuer_url="https://example.com", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -65,12 +71,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.retrieve() - assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -79,7 +79,9 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.retrieve() + response = client.organizations.sso_configurations.with_raw_response.retrieve( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -89,7 +91,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.retrieve() as response: + with client.organizations.sso_configurations.with_streaming_response.retrieve( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -101,19 +105,21 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.update() + sso_configuration = client.organizations.sso_configurations.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(object, sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", claims={"foo": "string"}, client_id="x", client_secret="x", email_domain="xxxx", issuer_url="https://example.com", - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -121,7 +127,9 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.update() + response = client.organizations.sso_configurations.with_raw_response.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -131,7 +139,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.update() as response: + with client.organizations.sso_configurations.with_streaming_response.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -143,16 +153,18 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_list(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.list() + sso_configuration = client.organizations.sso_configurations.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", token="token", page_size=0, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -163,7 +175,9 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.list() + response = client.organizations.sso_configurations.with_raw_response.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,7 +187,9 @@ def test_raw_response_list(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.list() as response: + with client.organizations.sso_configurations.with_streaming_response.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -185,12 +201,6 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: - sso_configuration = client.organizations.sso_configurations.delete() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_delete_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete( sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -199,7 +209,9 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.organizations.sso_configurations.with_raw_response.delete() + response = client.organizations.sso_configurations.with_raw_response.delete( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -209,7 +221,9 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.organizations.sso_configurations.with_streaming_response.delete() as response: + with client.organizations.sso_configurations.with_streaming_response.delete( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -225,12 +239,6 @@ class TestAsyncSSOConfigurations: @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.create() - assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( client_id="x", client_secret="x", @@ -243,7 +251,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.create() + response = await async_client.organizations.sso_configurations.with_raw_response.create( + client_id="x", + client_secret="x", + email_domain="xxxx", + issuer_url="https://example.com", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -253,7 +267,13 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.create() as response: + async with async_client.organizations.sso_configurations.with_streaming_response.create( + client_id="x", + client_secret="x", + email_domain="xxxx", + issuer_url="https://example.com", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -265,12 +285,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.retrieve() - assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -279,7 +293,9 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.retrieve() + response = await async_client.organizations.sso_configurations.with_raw_response.retrieve( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,7 +305,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.retrieve() as response: + async with async_client.organizations.sso_configurations.with_streaming_response.retrieve( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -301,19 +319,21 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.update() + sso_configuration = await async_client.organizations.sso_configurations.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(object, sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", claims={"foo": "string"}, client_id="x", client_secret="x", email_domain="xxxx", issuer_url="https://example.com", - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -321,7 +341,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.update() + response = await async_client.organizations.sso_configurations.with_raw_response.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -331,7 +353,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.update() as response: + async with async_client.organizations.sso_configurations.with_streaming_response.update( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -343,16 +367,18 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.list() + sso_configuration = await async_client.organizations.sso_configurations.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @pytest.mark.skip() @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", token="token", page_size=0, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -363,7 +389,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.list() + response = await async_client.organizations.sso_configurations.with_raw_response.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -373,7 +401,9 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.list() as response: + async with async_client.organizations.sso_configurations.with_streaming_response.list( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -385,12 +415,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - sso_configuration = await async_client.organizations.sso_configurations.delete() - assert_matches_type(object, sso_configuration, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete( sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -399,7 +423,9 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.sso_configurations.with_raw_response.delete() + response = await async_client.organizations.sso_configurations.with_raw_response.delete( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -409,7 +435,9 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.sso_configurations.with_streaming_response.delete() as response: + async with async_client.organizations.sso_configurations.with_streaming_response.delete( + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 94b1a9f8..c9f4d5a4 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -61,12 +61,6 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: - account = client.accounts.delete() - assert_matches_type(object, account, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_delete_with_all_params(self, client: Gitpod) -> None: account = client.accounts.delete( account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -75,7 +69,9 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.accounts.with_raw_response.delete() + response = client.accounts.with_raw_response.delete( + account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -85,7 +81,9 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.accounts.with_streaming_response.delete() as response: + with client.accounts.with_streaming_response.delete( + account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -97,7 +95,9 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: - account = client.accounts.get_sso_login_url() + account = client.accounts.get_sso_login_url( + email="dev@stainlessapi.com", + ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @pytest.mark.skip() @@ -112,7 +112,9 @@ def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: - response = client.accounts.with_raw_response.get_sso_login_url() + response = client.accounts.with_raw_response.get_sso_login_url( + email="dev@stainlessapi.com", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -122,7 +124,9 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: - with client.accounts.with_streaming_response.get_sso_login_url() as response: + with client.accounts.with_streaming_response.get_sso_login_url( + email="dev@stainlessapi.com", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -216,12 +220,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - account = await async_client.accounts.delete() - assert_matches_type(object, account, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete( account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -230,7 +228,9 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.accounts.with_raw_response.delete() + response = await async_client.accounts.with_raw_response.delete( + account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -240,7 +240,9 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.accounts.with_streaming_response.delete() as response: + async with async_client.accounts.with_streaming_response.delete( + account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -252,7 +254,9 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: - account = await async_client.accounts.get_sso_login_url() + account = await async_client.accounts.get_sso_login_url( + email="dev@stainlessapi.com", + ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @pytest.mark.skip() @@ -267,7 +271,9 @@ async def test_method_get_sso_login_url_with_all_params(self, async_client: Asyn @pytest.mark.skip() @parametrize async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.accounts.with_raw_response.get_sso_login_url() + response = await async_client.accounts.with_raw_response.get_sso_login_url( + email="dev@stainlessapi.com", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -277,7 +283,9 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - @pytest.mark.skip() @parametrize async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: - async with async_client.accounts.with_streaming_response.get_sso_login_url() as response: + async with async_client.accounts.with_streaming_response.get_sso_login_url( + email="dev@stainlessapi.com", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 811daf89..3441d9f1 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -66,7 +66,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "session": "session", }, "machine": { - "class": "61000000-0000-0000-0000-000000000000", + "class": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "session": "session", }, "ports": [ @@ -125,21 +125,17 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - environment = client.environments.retrieve() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment = client.environments.retrieve( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.environments.with_raw_response.retrieve() + response = client.environments.with_raw_response.retrieve( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -149,7 +145,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.environments.with_streaming_response.retrieve() as response: + with client.environments.with_streaming_response.retrieve( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -168,7 +166,7 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: environment = client.environments.update( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", metadata={}, spec={ "automations_file": { @@ -207,8 +205,8 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ], "ssh_public_keys": [ { - "id": "id", - "value": "value", + "id": "0194b7c1-c954-718d-91a4-9a742aa5fc11", + "value": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...", } ], "timeout": {"disconnected": "+9125115.360s"}, @@ -251,9 +249,9 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ - "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "creator_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, @@ -296,8 +294,8 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: environment = client.environments.delete( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - force=True, + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + force=False, ) assert_matches_type(object, environment, path=["response"]) @@ -333,7 +331,7 @@ def test_method_create_from_project(self, client: Gitpod) -> None: @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -365,7 +363,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "session": "session", }, "machine": { - "class": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "class": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "session": "session", }, "ports": [ @@ -394,7 +392,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "value": "value", } ], - "timeout": {"disconnected": "+9125115.360s"}, + "timeout": {"disconnected": "14400s"}, }, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @@ -431,7 +429,7 @@ def test_method_create_logs_token(self, client: Gitpod) -> None: @parametrize def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_logs_token( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) @@ -468,10 +466,10 @@ def test_method_mark_active(self, client: Gitpod) -> None: def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: environment = client.environments.mark_active( activity_signal={ - "source": "xxx", - "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "source": "VS Code", + "timestamp": parse_datetime("2025-02-12T14:30:00Z"), }, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) @@ -507,7 +505,7 @@ def test_method_start(self, client: Gitpod) -> None: @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) @@ -543,7 +541,7 @@ def test_method_stop(self, client: Gitpod) -> None: @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: environment = client.environments.stop( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) @@ -614,7 +612,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "session": "session", }, "machine": { - "class": "61000000-0000-0000-0000-000000000000", + "class": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "session": "session", }, "ports": [ @@ -673,21 +671,17 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - environment = await async_client.environments.retrieve() - assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.environments.with_raw_response.retrieve() + response = await async_client.environments.with_raw_response.retrieve( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -697,7 +691,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.environments.with_streaming_response.retrieve() as response: + async with async_client.environments.with_streaming_response.retrieve( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -716,7 +712,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", metadata={}, spec={ "automations_file": { @@ -755,8 +751,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ], "ssh_public_keys": [ { - "id": "id", - "value": "value", + "id": "0194b7c1-c954-718d-91a4-9a742aa5fc11", + "value": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...", } ], "timeout": {"disconnected": "+9125115.360s"}, @@ -799,9 +795,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ - "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "creator_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, @@ -844,8 +840,8 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - force=True, + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + force=False, ) assert_matches_type(object, environment, path=["response"]) @@ -881,7 +877,7 @@ async def test_method_create_from_project(self, async_client: AsyncGitpod) -> No @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -913,7 +909,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "session": "session", }, "machine": { - "class": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "class": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "session": "session", }, "ports": [ @@ -942,7 +938,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "value": "value", } ], - "timeout": {"disconnected": "+9125115.360s"}, + "timeout": {"disconnected": "14400s"}, }, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @@ -979,7 +975,7 @@ async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) @@ -1016,10 +1012,10 @@ async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active( activity_signal={ - "source": "xxx", - "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "source": "VS Code", + "timestamp": parse_datetime("2025-02-12T14:30:00Z"), }, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) @@ -1055,7 +1051,7 @@ async def test_method_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) @@ -1091,7 +1087,7 @@ async def test_method_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 8dbf4512..d869861f 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -28,23 +28,27 @@ class TestOrganizations: @pytest.mark.skip() @parametrize def test_method_create(self, client: Gitpod) -> None: - organization = client.organizations.create() + organization = client.organizations.create( + name="xxx", + ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.create( + name="xxx", invite_accounts_with_matching_domain=True, join_organization=True, - name="xxx", ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.create() + response = client.organizations.with_raw_response.create( + name="xxx", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,7 +58,9 @@ def test_raw_response_create(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.create() as response: + with client.organizations.with_streaming_response.create( + name="xxx", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -66,12 +72,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - organization = client.organizations.retrieve() - assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.retrieve( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -80,7 +80,9 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.retrieve() + response = client.organizations.with_raw_response.retrieve( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,7 +92,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.retrieve() as response: + with client.organizations.with_streaming_response.retrieve( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -102,23 +106,27 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_update(self, client: Gitpod) -> None: - organization = client.organizations.update() + organization = client.organizations.update( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.update( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, name="name", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize def test_raw_response_update(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.update() + response = client.organizations.with_raw_response.update( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -128,7 +136,9 @@ def test_raw_response_update(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.update() as response: + with client.organizations.with_streaming_response.update( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -182,12 +192,6 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: - organization = client.organizations.delete() - assert_matches_type(object, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_delete_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.delete( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -196,7 +200,9 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.delete() + response = client.organizations.with_raw_response.delete( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -206,7 +212,9 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.delete() as response: + with client.organizations.with_streaming_response.delete( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -255,12 +263,6 @@ def test_streaming_response_join(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_leave(self, client: Gitpod) -> None: - organization = client.organizations.leave() - assert_matches_type(object, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_leave_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.leave( user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -269,7 +271,9 @@ def test_method_leave_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.leave() + response = client.organizations.with_raw_response.leave( + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -279,7 +283,9 @@ def test_raw_response_leave(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.leave() as response: + with client.organizations.with_streaming_response.leave( + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -291,16 +297,18 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_list_members(self, client: Gitpod) -> None: - organization = client.organizations.list_members() + organization = client.organizations.list_members( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) @pytest.mark.skip() @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", token="token", page_size=0, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -311,7 +319,9 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.list_members() + response = client.organizations.with_raw_response.list_members( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -321,7 +331,9 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.list_members() as response: + with client.organizations.with_streaming_response.list_members( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -333,7 +345,10 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_set_role(self, client: Gitpod) -> None: - organization = client.organizations.set_role() + organization = client.organizations.set_role( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(object, organization, path=["response"]) @pytest.mark.skip() @@ -341,15 +356,18 @@ def test_method_set_role(self, client: Gitpod) -> None: def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - role="ORGANIZATION_ROLE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="ORGANIZATION_ROLE_UNSPECIFIED", ) assert_matches_type(object, organization, path=["response"]) @pytest.mark.skip() @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.set_role() + response = client.organizations.with_raw_response.set_role( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -359,7 +377,10 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.set_role() as response: + with client.organizations.with_streaming_response.set_role( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -375,23 +396,27 @@ class TestAsyncOrganizations: @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.create() + organization = await async_client.organizations.create( + name="xxx", + ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( + name="xxx", invite_accounts_with_matching_domain=True, join_organization=True, - name="xxx", ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.create() + response = await async_client.organizations.with_raw_response.create( + name="xxx", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -401,7 +426,9 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.create() as response: + async with async_client.organizations.with_streaming_response.create( + name="xxx", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -413,12 +440,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.retrieve() - assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -427,7 +448,9 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.retrieve() + response = await async_client.organizations.with_raw_response.retrieve( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -437,7 +460,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.retrieve() as response: + async with async_client.organizations.with_streaming_response.retrieve( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -449,23 +474,27 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.update() + organization = await async_client.organizations.update( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, name="name", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @pytest.mark.skip() @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.update() + response = await async_client.organizations.with_raw_response.update( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -475,7 +504,9 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.update() as response: + async with async_client.organizations.with_streaming_response.update( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -529,12 +560,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.delete() - assert_matches_type(object, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -543,7 +568,9 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.delete() + response = await async_client.organizations.with_raw_response.delete( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -553,7 +580,9 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.delete() as response: + async with async_client.organizations.with_streaming_response.delete( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -602,12 +631,6 @@ async def test_streaming_response_join(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.leave() - assert_matches_type(object, organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -616,7 +639,9 @@ async def test_method_leave_with_all_params(self, async_client: AsyncGitpod) -> @pytest.mark.skip() @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.leave() + response = await async_client.organizations.with_raw_response.leave( + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -626,7 +651,9 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.leave() as response: + async with async_client.organizations.with_streaming_response.leave( + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -638,16 +665,18 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None @pytest.mark.skip() @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.list_members() + organization = await async_client.organizations.list_members( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) @pytest.mark.skip() @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", token="token", page_size=0, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -658,7 +687,9 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp @pytest.mark.skip() @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.list_members() + response = await async_client.organizations.with_raw_response.list_members( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -668,7 +699,9 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non @pytest.mark.skip() @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.list_members() as response: + async with async_client.organizations.with_streaming_response.list_members( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -680,7 +713,10 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) @pytest.mark.skip() @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.set_role() + organization = await async_client.organizations.set_role( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert_matches_type(object, organization, path=["response"]) @pytest.mark.skip() @@ -688,15 +724,18 @@ async def test_method_set_role(self, async_client: AsyncGitpod) -> None: async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - role="ORGANIZATION_ROLE_UNSPECIFIED", user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + role="ORGANIZATION_ROLE_UNSPECIFIED", ) assert_matches_type(object, organization, path=["response"]) @pytest.mark.skip() @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.set_role() + response = await async_client.organizations.with_raw_response.set_role( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -706,7 +745,10 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.set_role() as response: + async with async_client.organizations.with_streaming_response.set_role( + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" From ef26de88f789cc2d3852410f1e42a332c8f23a62 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 12:14:15 +0000 Subject: [PATCH 099/505] feat(api): manual updates (#30) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb967edb..d89ac531 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/). ## Documentation -The REST API documentation can be found on [docs.gitpod.com](https://docs.gitpod.com). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.gitpod.io](https://docs.gitpod.io). The full API of this library can be found in [api.md](api.md). ## Installation From daa1f2bc5ff50b3dbc645777b868b2066b08968e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 03:44:16 +0000 Subject: [PATCH 100/505] fix: asyncify on non-asyncio runtimes (#31) --- src/gitpod/_utils/_sync.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_utils/_sync.py b/src/gitpod/_utils/_sync.py index 8b3aaf2b..ad7ec71b 100644 --- a/src/gitpod/_utils/_sync.py +++ b/src/gitpod/_utils/_sync.py @@ -7,16 +7,20 @@ from typing import Any, TypeVar, Callable, Awaitable from typing_extensions import ParamSpec +import anyio +import sniffio +import anyio.to_thread + T_Retval = TypeVar("T_Retval") T_ParamSpec = ParamSpec("T_ParamSpec") if sys.version_info >= (3, 9): - to_thread = asyncio.to_thread + _asyncio_to_thread = asyncio.to_thread else: # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread # for Python 3.8 support - async def to_thread( + async def _asyncio_to_thread( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs ) -> Any: """Asynchronously run function *func* in a separate thread. @@ -34,6 +38,17 @@ async def to_thread( return await loop.run_in_executor(None, func_call) +async def to_thread( + func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs +) -> T_Retval: + if sniffio.current_async_library() == "asyncio": + return await _asyncio_to_thread(func, *args, **kwargs) + + return await anyio.to_thread.run_sync( + functools.partial(func, *args, **kwargs), + ) + + # inspired by `asyncer`, https://github.com/tiangolo/asyncer def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ From 43a8876f61b93b8db1ff3d2be9d63b5234454d6d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 03:47:24 +0000 Subject: [PATCH 101/505] chore(internal): update client tests (#32) --- tests/test_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index b6dadcfe..c3fd3cab 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -744,7 +744,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No with pytest.raises(APITimeoutError): self.client.post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)), + body=cast(object, maybe_transform({}, IdentityGetAuthenticatedIdentityParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -759,7 +759,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non with pytest.raises(APIStatusError): self.client.post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)), + body=cast(object, maybe_transform({}, IdentityGetAuthenticatedIdentityParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1544,7 +1544,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APITimeoutError): await self.client.post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)), + body=cast(object, maybe_transform({}, IdentityGetAuthenticatedIdentityParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1559,7 +1559,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APIStatusError): await self.client.post( "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, maybe_transform(dict(), IdentityGetAuthenticatedIdentityParams)), + body=cast(object, maybe_transform({}, IdentityGetAuthenticatedIdentityParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) From ab59c5f327278a9af15545ef33434ed1a62809c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:02:41 +0000 Subject: [PATCH 102/505] chore(internal): version bump (#33) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f14b480a..aaf968a1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.2" + ".": "0.1.0-alpha.3" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7c846676..fa33e2fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.1.0-alpha.2" +version = "0.1.0-alpha.3" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index ad579102..a02d208c 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.1.0-alpha.2" # x-release-please-version +__version__ = "0.1.0-alpha.3" # x-release-please-version From 34527e34e2cf4a95258d527cf214b1d79c2e474d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:29:14 +0000 Subject: [PATCH 103/505] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c57d3dcc..b1eddf2a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-988164042da1361feb3d28364c6f14fee775ceab496b9d79d048141c0fa6da19.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6860d955bb7b497681b9d1ae03c10c51a458c68f5011efc648ae9d049250d6c7.yml From b09edac932b2b972924ca7d555bde0c44776a1d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:39:25 +0000 Subject: [PATCH 104/505] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b1eddf2a..d569fcb0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6860d955bb7b497681b9d1ae03c10c51a458c68f5011efc648ae9d049250d6c7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e3ac088751d52ff03184c39a009d093a7457f4e25dc489a938fe25ad5d83d98.yml From dead4a2707cb00d8113ac7168263161e2a3204e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:59:02 +0000 Subject: [PATCH 105/505] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d569fcb0..b1eddf2a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e3ac088751d52ff03184c39a009d093a7457f4e25dc489a938fe25ad5d83d98.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6860d955bb7b497681b9d1ae03c10c51a458c68f5011efc648ae9d049250d6c7.yml From 0f87f4a90d7fab110b84158ad134b411c1d4ad02 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 09:07:55 +0000 Subject: [PATCH 106/505] feat(api): manual updates (#34) --- .stats.yml | 2 +- src/gitpod/resources/secrets.py | 12 ++---------- src/gitpod/types/account.py | 12 ++++++------ src/gitpod/types/account_membership.py | 13 +++++++------ src/gitpod/types/editor.py | 13 +++++++------ src/gitpod/types/joinable_organization.py | 9 +++++---- src/gitpod/types/login_provider.py | 10 +++++++--- .../types/organizations/domain_verification.py | 3 ++- src/gitpod/types/organizations/sso_configuration.py | 10 +++++----- src/gitpod/types/secret_create_params.py | 6 +----- tests/api_resources/test_secrets.py | 4 ++-- 11 files changed, 45 insertions(+), 49 deletions(-) diff --git a/.stats.yml b/.stats.yml index b1eddf2a..4f2abc75 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6860d955bb7b497681b9d1ae03c10c51a458c68f5011efc648ae9d049250d6c7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-27f7bd641de1e4657ad8ce84a456fe0c5e8f1e14779bf1f567a4bc8667eba4da.yml diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 14c6bb4d..bcd0b7f2 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -74,11 +74,7 @@ def create( Args: container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have - the docker host value must be a valid registry hostname with optional port: - - ``` - this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$") - ``` + the docker registry host environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -324,11 +320,7 @@ async def create( Args: container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have - the docker host value must be a valid registry hostname with optional port: - - ``` - this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$") - ``` + the docker registry host environment_variable: secret will be created as an Environment Variable with the same name as the secret diff --git a/src/gitpod/types/account.py b/src/gitpod/types/account.py index 251e6bd4..f84d8641 100644 --- a/src/gitpod/types/account.py +++ b/src/gitpod/types/account.py @@ -111,12 +111,6 @@ class Account(BaseModel): name: str - public_email_provider: bool = FieldInfo(alias="publicEmailProvider") - """ - public_email_provider is true if the email for the Account matches a known - public email provider - """ - updated_at: datetime = FieldInfo(alias="updatedAt") """ A Timestamp represents a point in time independent of any time zone or local @@ -220,3 +214,9 @@ class Account(BaseModel): organization_id is the ID of the organization the account is owned by if it's created through custom SSO """ + + public_email_provider: Optional[bool] = FieldInfo(alias="publicEmailProvider", default=None) + """ + public_email_provider is true if the email for the Account matches a known + public email provider + """ diff --git a/src/gitpod/types/account_membership.py b/src/gitpod/types/account_membership.py index cd27512b..10f26031 100644 --- a/src/gitpod/types/account_membership.py +++ b/src/gitpod/types/account_membership.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from pydantic import Field as FieldInfo @@ -13,12 +14,6 @@ class AccountMembership(BaseModel): organization_id: str = FieldInfo(alias="organizationId") """organization_id is the id of the organization the user is a member of""" - organization_member_count: int = FieldInfo(alias="organizationMemberCount") - """ - organization_name is the member count of the organization the user is a member - of - """ - organization_name: str = FieldInfo(alias="organizationName") """organization_name is the name of the organization the user is a member of""" @@ -27,3 +22,9 @@ class AccountMembership(BaseModel): user_role: OrganizationRole = FieldInfo(alias="userRole") """user_role is the role the user has in the organization""" + + organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) + """ + organization_name is the member count of the organization the user is a member + of + """ diff --git a/src/gitpod/types/editor.py b/src/gitpod/types/editor.py index 6395cc77..96eebfa8 100644 --- a/src/gitpod/types/editor.py +++ b/src/gitpod/types/editor.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from pydantic import Field as FieldInfo @@ -11,14 +12,14 @@ class Editor(BaseModel): id: str - alias: str - - icon_url: str = FieldInfo(alias="iconUrl") - installation_instructions: str = FieldInfo(alias="installationInstructions") name: str - short_description: str = FieldInfo(alias="shortDescription") - url_template: str = FieldInfo(alias="urlTemplate") + + alias: Optional[str] = None + + icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) + + short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) diff --git a/src/gitpod/types/joinable_organization.py b/src/gitpod/types/joinable_organization.py index 33686019..a5b6cb69 100644 --- a/src/gitpod/types/joinable_organization.py +++ b/src/gitpod/types/joinable_organization.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from pydantic import Field as FieldInfo @@ -12,11 +13,11 @@ class JoinableOrganization(BaseModel): organization_id: str = FieldInfo(alias="organizationId") """organization_id is the id of the organization the user can join""" - organization_member_count: int = FieldInfo(alias="organizationMemberCount") + organization_name: str = FieldInfo(alias="organizationName") + """organization_name is the name of the organization the user can join""" + + organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) """ organization_member_count is the member count of the organization the user can join """ - - organization_name: str = FieldInfo(alias="organizationName") - """organization_name is the name of the organization the user can join""" diff --git a/src/gitpod/types/login_provider.py b/src/gitpod/types/login_provider.py index 7ff022b2..e23ebd8a 100644 --- a/src/gitpod/types/login_provider.py +++ b/src/gitpod/types/login_provider.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from pydantic import Field as FieldInfo @@ -9,11 +10,14 @@ class LoginProvider(BaseModel): - login_url: str = FieldInfo(alias="loginUrl") - """login_url is the URL to redirect the browser agent to for login""" - provider: str """provider is the provider used by this login method, e.g. "github", "google", "custom" """ + + login_url: Optional[str] = FieldInfo(alias="loginUrl", default=None) + """ + login_url is the URL to redirect the browser agent to for login, when provider + is "custom" + """ diff --git a/src/gitpod/types/organizations/domain_verification.py b/src/gitpod/types/organizations/domain_verification.py index 693e6132..abb36051 100644 --- a/src/gitpod/types/organizations/domain_verification.py +++ b/src/gitpod/types/organizations/domain_verification.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from datetime import datetime from pydantic import Field as FieldInfo @@ -19,7 +20,7 @@ class DomainVerification(BaseModel): state: DomainVerificationState - verified_at: datetime = FieldInfo(alias="verifiedAt") + verified_at: Optional[datetime] = FieldInfo(alias="verifiedAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond diff --git a/src/gitpod/types/organizations/sso_configuration.py b/src/gitpod/types/organizations/sso_configuration.py index c12bf7cd..4ae99127 100644 --- a/src/gitpod/types/organizations/sso_configuration.py +++ b/src/gitpod/types/organizations/sso_configuration.py @@ -15,11 +15,6 @@ class SSOConfiguration(BaseModel): id: str """id is the unique identifier of the SSO configuration""" - client_id: str = FieldInfo(alias="clientId") - """client_id is the client ID of the OIDC application set on the IdP""" - - email_domain: str = FieldInfo(alias="emailDomain") - issuer_url: str = FieldInfo(alias="issuerUrl") """issuer_url is the URL of the IdP issuer""" @@ -33,3 +28,8 @@ class SSOConfiguration(BaseModel): claims: Optional[Dict[str, str]] = None """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" + + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) + """client_id is the client ID of the OIDC application set on the IdP""" + + email_domain: Optional[str] = FieldInfo(alias="emailDomain", default=None) diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index 81da5d9f..e59b2704 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -13,11 +13,7 @@ class SecretCreateParams(TypedDict, total=False): container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] """ secret will be mounted as a docker config in the environment VM, mount will have - the docker host value must be a valid registry hostname with optional port: - - ``` - this.matches('^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$') - ``` + the docker registry host """ environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 439581a3..dfe5cd1e 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -32,7 +32,7 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( - container_registry_basic_auth_host="containerRegistryBasicAuthHost", + container_registry_basic_auth_host="https://example.com", environment_variable=True, file_path="filePath", name="name", @@ -228,7 +228,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( - container_registry_basic_auth_host="containerRegistryBasicAuthHost", + container_registry_basic_auth_host="https://example.com", environment_variable=True, file_path="filePath", name="name", From fcad5a4953347ac7cda24320b6d8b06b77a97bd1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 09:21:12 +0000 Subject: [PATCH 107/505] chore(internal): version bump (#36) --- .release-please-manifest.json | 2 +- README.md | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index aaf968a1..5547f83e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.3" + ".": "0.1.1" } \ No newline at end of file diff --git a/README.md b/README.md index d89ac531..468f5367 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The REST API documentation can be found on [docs.gitpod.io](https://docs.gitpod. ```sh # install from PyPI -pip install --pre gitpod-sdk +pip install gitpod-sdk ``` ## Usage diff --git a/pyproject.toml b/pyproject.toml index fa33e2fe..b3536967 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.1.0-alpha.3" +version = "0.1.1" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index a02d208c..5c0267d4 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.1.0-alpha.3" # x-release-please-version +__version__ = "0.1.1" # x-release-please-version From d63c9810c715c30baf7530905e3a484b8755e637 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 09:44:57 +0000 Subject: [PATCH 108/505] feat(api): Organizations Open API docs (#37) --- .stats.yml | 2 +- .../organizations/domain_verifications.py | 230 ++++++++- src/gitpod/resources/organizations/invites.py | 88 +++- .../resources/organizations/organizations.py | 482 +++++++++++++++++- .../organizations/sso_configurations.py | 268 +++++++++- .../test_domain_verifications.py | 80 +-- .../organizations/test_invites.py | 24 +- .../organizations/test_sso_configurations.py | 128 ++--- tests/api_resources/test_organizations.py | 128 ++--- 9 files changed, 1197 insertions(+), 233 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4f2abc75..df3a2f02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-27f7bd641de1e4657ad8ce84a456fe0c5e8f1e14779bf1f567a4bc8667eba4da.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0c37e687e2a070abfe49501156af6d906ff166b6eaad779ee6c2b568515f2b7e.yml diff --git a/src/gitpod/resources/organizations/domain_verifications.py b/src/gitpod/resources/organizations/domain_verifications.py index 079f837c..8661f183 100644 --- a/src/gitpod/resources/organizations/domain_verifications.py +++ b/src/gitpod/resources/organizations/domain_verifications.py @@ -67,7 +67,34 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DomainVerificationCreateResponse: """ - CreateDomainVerification creates a new domain verification request + Initiates domain verification process to enable organization features. + + Use this method to: + + - Start domain ownership verification + - Enable automatic team joining + - Set up SSO restrictions + - Configure email-based policies + + ### Examples + + - Verify primary domain: + + Starts verification for main company domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domain: "acme-corp.com" + ``` + + - Verify subsidiary domain: + + Adds verification for additional company domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domain: "acme-subsidiary.com" + ``` Args: extra_headers: Send extra headers @@ -105,7 +132,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DomainVerificationRetrieveResponse: """ - GetDomainVerification retrieves a domain verification request + Retrieves the status of a domain verification request. + + Use this method to: + + - Check verification progress + - View verification requirements + - Monitor domain status + + ### Examples + + - Get verification status: + + Checks the current state of a domain verification. + + ```yaml + domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -143,7 +186,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncDomainVerificationsPage[DomainVerification]: """ - ListDomainVerifications lists all domain verifications for an organization + Lists and monitors domain verification status across an organization. + + Use this method to: + + - Track verification progress + - View all verified domains + - Monitor pending verifications + - Audit domain settings + + ### Examples + + - List all verifications: + + Shows all domain verifications regardless of status. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + - List with pagination: + + Retrieves next page of verifications. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + token: "next-page-token-from-previous-response" + ``` Args: extra_headers: Send extra headers @@ -193,7 +266,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteDomainVerification deletes a domain verification request + Removes a domain verification request. + + Use this method to: + + - Cancel pending verifications + - Remove verified domains + - Clean up unused domain records + + ### Examples + + - Delete verification: + + Removes a domain verification request. + + ```yaml + domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -228,7 +317,23 @@ def verify( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DomainVerificationVerifyResponse: """ - VerifyDomain verifies a domain ownership + Verifies domain ownership for an organization. + + Use this method to: + + - Complete domain verification process + - Enable domain-based features + - Validate DNS configuration + + ### Examples + + - Verify domain ownership: + + Verifies ownership after DNS records are configured. + + ```yaml + domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -285,7 +390,34 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DomainVerificationCreateResponse: """ - CreateDomainVerification creates a new domain verification request + Initiates domain verification process to enable organization features. + + Use this method to: + + - Start domain ownership verification + - Enable automatic team joining + - Set up SSO restrictions + - Configure email-based policies + + ### Examples + + - Verify primary domain: + + Starts verification for main company domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domain: "acme-corp.com" + ``` + + - Verify subsidiary domain: + + Adds verification for additional company domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domain: "acme-subsidiary.com" + ``` Args: extra_headers: Send extra headers @@ -323,7 +455,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DomainVerificationRetrieveResponse: """ - GetDomainVerification retrieves a domain verification request + Retrieves the status of a domain verification request. + + Use this method to: + + - Check verification progress + - View verification requirements + - Monitor domain status + + ### Examples + + - Get verification status: + + Checks the current state of a domain verification. + + ```yaml + domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -361,7 +509,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[DomainVerification, AsyncDomainVerificationsPage[DomainVerification]]: """ - ListDomainVerifications lists all domain verifications for an organization + Lists and monitors domain verification status across an organization. + + Use this method to: + + - Track verification progress + - View all verified domains + - Monitor pending verifications + - Audit domain settings + + ### Examples + + - List all verifications: + + Shows all domain verifications regardless of status. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + - List with pagination: + + Retrieves next page of verifications. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + token: "next-page-token-from-previous-response" + ``` Args: extra_headers: Send extra headers @@ -411,7 +589,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteDomainVerification deletes a domain verification request + Removes a domain verification request. + + Use this method to: + + - Cancel pending verifications + - Remove verified domains + - Clean up unused domain records + + ### Examples + + - Delete verification: + + Removes a domain verification request. + + ```yaml + domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -446,7 +640,23 @@ async def verify( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DomainVerificationVerifyResponse: """ - VerifyDomain verifies a domain ownership + Verifies domain ownership for an organization. + + Use this method to: + + - Complete domain verification process + - Enable domain-based features + - Validate DNS configuration + + ### Examples + + - Verify domain ownership: + + Verifies ownership after DNS records are configured. + + ```yaml + domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/organizations/invites.py b/src/gitpod/resources/organizations/invites.py index 2c080ce4..ac39a548 100644 --- a/src/gitpod/resources/organizations/invites.py +++ b/src/gitpod/resources/organizations/invites.py @@ -57,11 +57,27 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InviteCreateResponse: - """CreateOrganizationInvite creates an invite for the organization. + """Creates an invite link for joining an organization. Any existing OrganizationInvites are invalidated and can no longer be used. + Use this method to: + + - Generate shareable invite links + - Manage team growth + - Control organization access + + ### Examples + + - Create organization invite: + + Generates a new invite link for the organization. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + Args: extra_headers: Send extra headers @@ -91,10 +107,8 @@ def retrieve( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InviteRetrieveResponse: - """GetOrganizationInvite retrieves invite for the organization. - - If no invite - exists, a new one is created. + """ + GetOrganizationInvite Args: extra_headers: Send extra headers @@ -126,8 +140,24 @@ def get_summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InviteGetSummaryResponse: """ - GetOrganizationInviteSummary retrieves a summary of the organization based on an - Invite ID. Used to discover which organization an invite is for. + Retrieves organization details and membership info based on an invite link. + + Use this method to: + + - Preview organization details before joining + - Validate invite link authenticity + - Check organization size and activity + - View team information before accepting + + ### Examples + + - Get invite summary: + + Retrieves organization information from an invite. + + ```yaml + inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -179,11 +209,27 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InviteCreateResponse: - """CreateOrganizationInvite creates an invite for the organization. + """Creates an invite link for joining an organization. Any existing OrganizationInvites are invalidated and can no longer be used. + Use this method to: + + - Generate shareable invite links + - Manage team growth + - Control organization access + + ### Examples + + - Create organization invite: + + Generates a new invite link for the organization. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + Args: extra_headers: Send extra headers @@ -215,10 +261,8 @@ async def retrieve( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InviteRetrieveResponse: - """GetOrganizationInvite retrieves invite for the organization. - - If no invite - exists, a new one is created. + """ + GetOrganizationInvite Args: extra_headers: Send extra headers @@ -252,8 +296,24 @@ async def get_summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InviteGetSummaryResponse: """ - GetOrganizationInviteSummary retrieves a summary of the organization based on an - Invite ID. Used to discover which organization an invite is for. + Retrieves organization details and membership info based on an invite link. + + Use this method to: + + - Preview organization details before joining + - Validate invite link authenticity + - Check organization size and activity + - View team information before accepting + + ### Examples + + - Get invite summary: + + Retrieves organization information from an invite. + + ```yaml + inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index b7e09574..f5fea4a9 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -116,7 +116,35 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationCreateResponse: """ - CreateOrganization creates a new Organization. + Creates a new organization with the specified name and settings. + + Use this method to: + + - Create a new organization for team collaboration + - Set up automatic domain-based invites for team members + - Join the organization immediately upon creation + + ### Examples + + - Create a basic organization: + + Creates an organization with just a name. + + ```yaml + name: "Acme Corp Engineering" + joinOrganization: true + ``` + + - Create with domain-based invites: + + Creates an organization that automatically invites users with matching email + domains. + + ```yaml + name: "Acme Corp" + joinOrganization: true + inviteAccountsWithMatchingDomain: true + ``` Args: name: name is the organization name @@ -163,7 +191,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationRetrieveResponse: """ - GetOrganization retrieves a single Organization. + Gets details about a specific organization. + + Use this method to: + + - Retrieve organization settings and configuration + - Check organization membership status + - View domain verification settings + + ### Examples + + - Get organization details: + + Retrieves information about a specific organization. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: organization_id: organization_id is the unique identifier of the Organization to retreive. @@ -201,7 +245,40 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationUpdateResponse: """ - UpdateOrganization updates the properties of an Organization. + Updates an organization's settings including name, invite domains, and member + policies. + + Use this method to: + + - Modify organization display name + - Configure email domain restrictions + - Update organization-wide settings + - Manage member access policies + + ### Examples + + - Update basic settings: + + Changes organization name and invite domains. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "New Company Name" + inviteDomains: + domains: + - "company.com" + - "subsidiary.com" + ``` + + - Remove domain restrictions: + + Clears all domain-based invite restrictions. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + inviteDomains: + domains: [] + ``` Args: organization_id: organization_id is the ID of the organization to update the settings for. @@ -249,7 +326,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncOrganizationsPage[Organization]: """ - ListOrganizations lists all organization the caller has access to. + Lists all organizations the caller has access to with optional filtering. + + Use this method to: + + - View organizations you're a member of + - Browse all available organizations + - Paginate through organization results + + ### Examples + + - List member organizations: + + Shows organizations where the caller is a member. + + ```yaml + pagination: + pageSize: 20 + scope: SCOPE_MEMBER + ``` + + - List all organizations: + + Shows all organizations visible to the caller. + + ```yaml + pagination: + pageSize: 50 + scope: SCOPE_ALL + ``` Args: pagination: pagination contains the pagination options for listing organizations @@ -303,7 +408,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteOrganization deletes the specified organization. + Permanently deletes an organization. + + Use this method to: + + - Remove unused organizations + - Clean up test organizations + - Complete organization migration + + ### Examples + + - Delete organization: + + Permanently removes an organization and all its data. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: organization_id: organization_id is the ID of the organization to delete @@ -340,7 +461,32 @@ def join( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationJoinResponse: """ - JoinOrganization lets accounts join an Organization. + Allows users to join an organization through direct ID, invite link, or + domain-based auto-join. + + Use this method to: + + - Join an organization via direct ID or invite + - Join automatically based on email domain + - Accept organization invitations + + ### Examples + + - Join via organization ID: + + Joins an organization directly when you have the ID. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + - Join via invite: + + Accepts an organization invitation link. + + ```yaml + inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: invite_id: invite_id is the unique identifier of the invite to join the organization. @@ -382,7 +528,26 @@ def leave( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - LeaveOrganization lets the passed user leave an Organization. + Removes a user from an organization while preserving organization data. + + Use this method to: + + - Remove yourself from an organization + - Clean up inactive memberships + - Transfer project ownership before leaving + - Manage team transitions + + ### Examples + + - Leave organization: + + Removes user from organization membership. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + Note: Ensure all projects and resources are transferred before leaving. Args: extra_headers: Send extra headers @@ -417,7 +582,36 @@ def list_members( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncMembersPage[OrganizationMember]: """ - ListMembers lists all members of the specified organization. + Lists and filters organization members with optional pagination. + + Use this method to: + + - View all organization members + - Monitor member activity + - Manage team membership + + ### Examples + + - List active members: + + Retrieves active members with pagination. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + - List with pagination: + + Retrieves next page of members. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` Args: organization_id: organization_id is the ID of the organization to list members for @@ -473,7 +667,36 @@ def set_role( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - SetRole + Manages organization membership and roles by setting a user's role within the + organization. + + Use this method to: + + - Promote members to admin role + - Change member permissions + - Demote admins to regular members + + ### Examples + + - Promote to admin: + + Makes a user an organization administrator. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: ORGANIZATION_ROLE_ADMIN + ``` + + - Change to member: + + Changes a user's role to regular member. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: ORGANIZATION_ROLE_MEMBER + ``` Args: extra_headers: Send extra headers @@ -547,7 +770,35 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationCreateResponse: """ - CreateOrganization creates a new Organization. + Creates a new organization with the specified name and settings. + + Use this method to: + + - Create a new organization for team collaboration + - Set up automatic domain-based invites for team members + - Join the organization immediately upon creation + + ### Examples + + - Create a basic organization: + + Creates an organization with just a name. + + ```yaml + name: "Acme Corp Engineering" + joinOrganization: true + ``` + + - Create with domain-based invites: + + Creates an organization that automatically invites users with matching email + domains. + + ```yaml + name: "Acme Corp" + joinOrganization: true + inviteAccountsWithMatchingDomain: true + ``` Args: name: name is the organization name @@ -594,7 +845,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationRetrieveResponse: """ - GetOrganization retrieves a single Organization. + Gets details about a specific organization. + + Use this method to: + + - Retrieve organization settings and configuration + - Check organization membership status + - View domain verification settings + + ### Examples + + - Get organization details: + + Retrieves information about a specific organization. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: organization_id: organization_id is the unique identifier of the Organization to retreive. @@ -632,7 +899,40 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationUpdateResponse: """ - UpdateOrganization updates the properties of an Organization. + Updates an organization's settings including name, invite domains, and member + policies. + + Use this method to: + + - Modify organization display name + - Configure email domain restrictions + - Update organization-wide settings + - Manage member access policies + + ### Examples + + - Update basic settings: + + Changes organization name and invite domains. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "New Company Name" + inviteDomains: + domains: + - "company.com" + - "subsidiary.com" + ``` + + - Remove domain restrictions: + + Clears all domain-based invite restrictions. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + inviteDomains: + domains: [] + ``` Args: organization_id: organization_id is the ID of the organization to update the settings for. @@ -680,7 +980,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Organization, AsyncOrganizationsPage[Organization]]: """ - ListOrganizations lists all organization the caller has access to. + Lists all organizations the caller has access to with optional filtering. + + Use this method to: + + - View organizations you're a member of + - Browse all available organizations + - Paginate through organization results + + ### Examples + + - List member organizations: + + Shows organizations where the caller is a member. + + ```yaml + pagination: + pageSize: 20 + scope: SCOPE_MEMBER + ``` + + - List all organizations: + + Shows all organizations visible to the caller. + + ```yaml + pagination: + pageSize: 50 + scope: SCOPE_ALL + ``` Args: pagination: pagination contains the pagination options for listing organizations @@ -734,7 +1062,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteOrganization deletes the specified organization. + Permanently deletes an organization. + + Use this method to: + + - Remove unused organizations + - Clean up test organizations + - Complete organization migration + + ### Examples + + - Delete organization: + + Permanently removes an organization and all its data. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: organization_id: organization_id is the ID of the organization to delete @@ -771,7 +1115,32 @@ async def join( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OrganizationJoinResponse: """ - JoinOrganization lets accounts join an Organization. + Allows users to join an organization through direct ID, invite link, or + domain-based auto-join. + + Use this method to: + + - Join an organization via direct ID or invite + - Join automatically based on email domain + - Accept organization invitations + + ### Examples + + - Join via organization ID: + + Joins an organization directly when you have the ID. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + - Join via invite: + + Accepts an organization invitation link. + + ```yaml + inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: invite_id: invite_id is the unique identifier of the invite to join the organization. @@ -813,7 +1182,26 @@ async def leave( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - LeaveOrganization lets the passed user leave an Organization. + Removes a user from an organization while preserving organization data. + + Use this method to: + + - Remove yourself from an organization + - Clean up inactive memberships + - Transfer project ownership before leaving + - Manage team transitions + + ### Examples + + - Leave organization: + + Removes user from organization membership. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + Note: Ensure all projects and resources are transferred before leaving. Args: extra_headers: Send extra headers @@ -848,7 +1236,36 @@ def list_members( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[OrganizationMember, AsyncMembersPage[OrganizationMember]]: """ - ListMembers lists all members of the specified organization. + Lists and filters organization members with optional pagination. + + Use this method to: + + - View all organization members + - Monitor member activity + - Manage team membership + + ### Examples + + - List active members: + + Retrieves active members with pagination. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + - List with pagination: + + Retrieves next page of members. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` Args: organization_id: organization_id is the ID of the organization to list members for @@ -904,7 +1321,36 @@ async def set_role( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - SetRole + Manages organization membership and roles by setting a user's role within the + organization. + + Use this method to: + + - Promote members to admin role + - Change member permissions + - Demote admins to regular members + + ### Examples + + - Promote to admin: + + Makes a user an organization administrator. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: ORGANIZATION_ROLE_ADMIN + ``` + + - Change to member: + + Changes a user's role to regular member. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: ORGANIZATION_ROLE_MEMBER + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 57a80100..68266b73 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -73,7 +73,40 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SSOConfigurationCreateResponse: """ - CreateSSOConfiguration creates a new SSO configuration for the organization. + Creates or updates SSO configuration for organizational authentication. + + Use this method to: + + - Configure OIDC-based SSO providers + - Set up built-in providers (Google, GitHub, etc.) + - Define custom identity providers + - Manage authentication policies + + ### Examples + + - Configure built-in Google SSO: + + Sets up SSO using Google Workspace. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + clientId: "012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com" + clientSecret: "GOCSPX-abcdefghijklmnopqrstuvwxyz123456" + issuerUrl: "https://accounts.google.com" + emailDomain: "acme-corp.com" + ``` + + - Configure custom OIDC provider: + + Sets up SSO with a custom identity provider. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + clientId: "acme-corp-gitpod" + clientSecret: "secret-token-value" + issuerUrl: "https://sso.acme-corp.com" + emailDomain: "acme-corp.com" + ``` Args: client_id: client_id is the client ID of the OIDC application set on the IdP @@ -122,7 +155,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SSOConfigurationRetrieveResponse: """ - GetSSOConfiguration returns an SSO configuration. + Retrieves a specific SSO configuration. + + Use this method to: + + - View SSO provider details + - Check configuration status + - Verify SSO settings + + ### Examples + + - Get SSO configuration: + + Retrieves details of a specific SSO configuration. + + ```yaml + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to get @@ -165,7 +214,36 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateSSOConfiguration updates the SSO configuration for the organization. + Updates SSO provider settings and authentication rules. + + Use this method to: + + - Rotate client credentials + - Update provider endpoints + - Modify claim mappings + - Change authentication policies + - Toggle SSO enforcement + + ### Examples + + - Update credentials: + + Rotates client ID and secret. + + ```yaml + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + clientId: "new-client-id" + clientSecret: "new-client-secret" + ``` + + - Update provider status: + + Activates or deactivates SSO provider. + + ```yaml + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + state: SSO_CONFIGURATION_STATE_ACTIVE + ``` Args: sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update @@ -223,7 +301,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncSSOConfigurationsPage[SSOConfiguration]: """ - ListSSOConfigurations lists all SSO configurations matching provided filters. + Lists and filters SSO configurations for an organization. + + Use this method to: + + - View all SSO providers + - Monitor authentication status + - Audit security settings + - Manage provider configurations + + ### Examples + + - List active configurations: + + Shows all active SSO providers. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + - List by provider type: + + Shows custom SSO configurations. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + token: "next-page-token-from-previous-response" + ``` Args: organization_id: organization_id is the ID of the organization to list SSO configurations for. @@ -275,7 +383,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteSSOConfiguration deletes an SSO configuration. + Removes an SSO configuration from an organization. + + Use this method to: + + - Disable SSO authentication + - Remove outdated providers + - Clean up unused configurations + + ### Examples + + - Delete SSO configuration: + + Removes a specific SSO configuration. + + ```yaml + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -335,7 +459,40 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SSOConfigurationCreateResponse: """ - CreateSSOConfiguration creates a new SSO configuration for the organization. + Creates or updates SSO configuration for organizational authentication. + + Use this method to: + + - Configure OIDC-based SSO providers + - Set up built-in providers (Google, GitHub, etc.) + - Define custom identity providers + - Manage authentication policies + + ### Examples + + - Configure built-in Google SSO: + + Sets up SSO using Google Workspace. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + clientId: "012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com" + clientSecret: "GOCSPX-abcdefghijklmnopqrstuvwxyz123456" + issuerUrl: "https://accounts.google.com" + emailDomain: "acme-corp.com" + ``` + + - Configure custom OIDC provider: + + Sets up SSO with a custom identity provider. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + clientId: "acme-corp-gitpod" + clientSecret: "secret-token-value" + issuerUrl: "https://sso.acme-corp.com" + emailDomain: "acme-corp.com" + ``` Args: client_id: client_id is the client ID of the OIDC application set on the IdP @@ -384,7 +541,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SSOConfigurationRetrieveResponse: """ - GetSSOConfiguration returns an SSO configuration. + Retrieves a specific SSO configuration. + + Use this method to: + + - View SSO provider details + - Check configuration status + - Verify SSO settings + + ### Examples + + - Get SSO configuration: + + Retrieves details of a specific SSO configuration. + + ```yaml + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to get @@ -427,7 +600,36 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateSSOConfiguration updates the SSO configuration for the organization. + Updates SSO provider settings and authentication rules. + + Use this method to: + + - Rotate client credentials + - Update provider endpoints + - Modify claim mappings + - Change authentication policies + - Toggle SSO enforcement + + ### Examples + + - Update credentials: + + Rotates client ID and secret. + + ```yaml + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + clientId: "new-client-id" + clientSecret: "new-client-secret" + ``` + + - Update provider status: + + Activates or deactivates SSO provider. + + ```yaml + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + state: SSO_CONFIGURATION_STATE_ACTIVE + ``` Args: sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update @@ -485,7 +687,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[SSOConfiguration, AsyncSSOConfigurationsPage[SSOConfiguration]]: """ - ListSSOConfigurations lists all SSO configurations matching provided filters. + Lists and filters SSO configurations for an organization. + + Use this method to: + + - View all SSO providers + - Monitor authentication status + - Audit security settings + - Manage provider configurations + + ### Examples + + - List active configurations: + + Shows all active SSO providers. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + - List by provider type: + + Shows custom SSO configurations. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + token: "next-page-token-from-previous-response" + ``` Args: organization_id: organization_id is the ID of the organization to list SSO configurations for. @@ -537,7 +769,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteSSOConfiguration deletes an SSO configuration. + Removes an SSO configuration from an organization. + + Use this method to: + + - Disable SSO authentication + - Remove outdated providers + - Clean up unused configurations + + ### Examples + + - Delete SSO configuration: + + Removes a specific SSO configuration. + + ```yaml + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/tests/api_resources/organizations/test_domain_verifications.py b/tests/api_resources/organizations/test_domain_verifications.py index 2b12ebf2..3c2a0c00 100644 --- a/tests/api_resources/organizations/test_domain_verifications.py +++ b/tests/api_resources/organizations/test_domain_verifications.py @@ -27,8 +27,8 @@ class TestDomainVerifications: @parametrize def test_method_create(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.create( - domain="xxxx", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain="acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) @@ -36,8 +36,8 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.create( - domain="xxxx", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain="acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -49,8 +49,8 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.create( - domain="xxxx", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain="acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -64,7 +64,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.retrieve( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) @@ -72,7 +72,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.retrieve( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -84,7 +84,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.retrieve( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,7 +98,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) @@ -106,12 +106,12 @@ def test_method_list(self, client: Gitpod) -> None: @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) @@ -120,7 +120,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -132,7 +132,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -146,7 +146,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.delete( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, domain_verification, path=["response"]) @@ -154,7 +154,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.delete( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -166,7 +166,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.delete( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -180,7 +180,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_verify(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.verify( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) @@ -188,7 +188,7 @@ def test_method_verify(self, client: Gitpod) -> None: @parametrize def test_raw_response_verify(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.verify( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -200,7 +200,7 @@ def test_raw_response_verify(self, client: Gitpod) -> None: @parametrize def test_streaming_response_verify(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.verify( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -218,8 +218,8 @@ class TestAsyncDomainVerifications: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.create( - domain="xxxx", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain="acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) @@ -227,8 +227,8 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.create( - domain="xxxx", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain="acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -240,8 +240,8 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.create( - domain="xxxx", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain="acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -255,7 +255,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.retrieve( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) @@ -263,7 +263,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.retrieve( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -275,7 +275,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.retrieve( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,7 +289,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) @@ -297,12 +297,12 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) @@ -311,7 +311,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -323,7 +323,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -339,7 +339,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.delete( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, domain_verification, path=["response"]) @@ -347,7 +347,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.delete( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -359,7 +359,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.delete( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -373,7 +373,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_verify(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.verify( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) @@ -381,7 +381,7 @@ async def test_method_verify(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.verify( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -393,7 +393,7 @@ async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_verify(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.verify( - domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + domain_verification_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index 2b426d67..524b61cf 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -25,7 +25,7 @@ class TestInvites: @parametrize def test_method_create(self, client: Gitpod) -> None: invite = client.organizations.invites.create( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @@ -33,7 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.create( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -45,7 +45,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.create( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -93,7 +93,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_get_summary(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + invite_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @@ -101,7 +101,7 @@ def test_method_get_summary(self, client: Gitpod) -> None: @parametrize def test_raw_response_get_summary(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.get_summary( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + invite_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -113,7 +113,7 @@ def test_raw_response_get_summary(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_summary(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.get_summary( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + invite_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -131,7 +131,7 @@ class TestAsyncInvites: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) @@ -139,7 +139,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.create( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -151,7 +151,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.create( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -199,7 +199,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + invite_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) @@ -207,7 +207,7 @@ async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.get_summary( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + invite_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -219,7 +219,7 @@ async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None @parametrize async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.get_summary( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + invite_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 09f440f6..566d79f8 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -26,11 +26,11 @@ class TestSSOConfigurations: @parametrize def test_method_create(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( - client_id="x", - client_secret="x", - email_domain="xxxx", - issuer_url="https://example.com", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + email_domain="acme-corp.com", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) @@ -38,11 +38,11 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.create( - client_id="x", - client_secret="x", - email_domain="xxxx", - issuer_url="https://example.com", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + email_domain="acme-corp.com", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -54,11 +54,11 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.create( - client_id="x", - client_secret="x", - email_domain="xxxx", - issuer_url="https://example.com", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + email_domain="acme-corp.com", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -72,7 +72,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @@ -80,7 +80,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.retrieve( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -92,7 +92,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.retrieve( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,7 +106,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_update(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -114,10 +114,10 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", claims={"foo": "string"}, - client_id="x", - client_secret="x", + client_id="new-client-id", + client_secret="new-client-secret", email_domain="xxxx", issuer_url="https://example.com", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", @@ -128,7 +128,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -140,7 +140,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -154,7 +154,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: @parametrize def test_method_list(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @@ -162,12 +162,12 @@ def test_method_list(self, client: Gitpod) -> None: @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @@ -176,7 +176,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -188,7 +188,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -202,7 +202,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -210,7 +210,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.delete( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -222,7 +222,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.delete( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -240,11 +240,11 @@ class TestAsyncSSOConfigurations: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( - client_id="x", - client_secret="x", - email_domain="xxxx", - issuer_url="https://example.com", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + email_domain="acme-corp.com", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) @@ -252,11 +252,11 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.create( - client_id="x", - client_secret="x", - email_domain="xxxx", - issuer_url="https://example.com", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + email_domain="acme-corp.com", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -268,11 +268,11 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.create( - client_id="x", - client_secret="x", - email_domain="xxxx", - issuer_url="https://example.com", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + email_domain="acme-corp.com", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -286,7 +286,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) @@ -294,7 +294,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.retrieve( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -306,7 +306,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.retrieve( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -320,7 +320,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -328,10 +328,10 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", claims={"foo": "string"}, - client_id="x", - client_secret="x", + client_id="new-client-id", + client_secret="new-client-secret", email_domain="xxxx", issuer_url="https://example.com", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", @@ -342,7 +342,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -354,7 +354,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -368,7 +368,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @@ -376,12 +376,12 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) @@ -390,7 +390,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -402,7 +402,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.list( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -416,7 +416,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, sso_configuration, path=["response"]) @@ -424,7 +424,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.delete( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -436,7 +436,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.delete( - sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index d869861f..62a55039 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -29,7 +29,7 @@ class TestOrganizations: @parametrize def test_method_create(self, client: Gitpod) -> None: organization = client.organizations.create( - name="xxx", + name="Acme Corp Engineering", ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @@ -37,7 +37,7 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.create( - name="xxx", + name="Acme Corp Engineering", invite_accounts_with_matching_domain=True, join_organization=True, ) @@ -47,7 +47,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.create( - name="xxx", + name="Acme Corp Engineering", ) assert response.is_closed is True @@ -59,7 +59,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.create( - name="xxx", + name="Acme Corp Engineering", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -73,7 +73,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: organization = client.organizations.retrieve( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @@ -81,7 +81,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.retrieve( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -93,7 +93,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.retrieve( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -107,7 +107,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_update(self, client: Gitpod) -> None: organization = client.organizations.update( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @@ -115,7 +115,7 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.update( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, name="name", ) @@ -125,7 +125,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -137,7 +137,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -161,7 +161,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 50, }, scope="SCOPE_UNSPECIFIED", ) @@ -193,7 +193,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: organization = client.organizations.delete( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, organization, path=["response"]) @@ -201,7 +201,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.delete( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -213,7 +213,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.delete( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -233,7 +233,7 @@ def test_method_join(self, client: Gitpod) -> None: @parametrize def test_method_join_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + invite_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -264,7 +264,7 @@ def test_streaming_response_join(self, client: Gitpod) -> None: @parametrize def test_method_leave(self, client: Gitpod) -> None: organization = client.organizations.leave( - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(object, organization, path=["response"]) @@ -272,7 +272,7 @@ def test_method_leave(self, client: Gitpod) -> None: @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.leave( - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert response.is_closed is True @@ -284,7 +284,7 @@ def test_raw_response_leave(self, client: Gitpod) -> None: @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.leave( - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -298,7 +298,7 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: @parametrize def test_method_list_members(self, client: Gitpod) -> None: organization = client.organizations.list_members( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) @@ -306,12 +306,12 @@ def test_method_list_members(self, client: Gitpod) -> None: @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) @@ -320,7 +320,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list_members( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -332,7 +332,7 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list_members( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -346,8 +346,8 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: @parametrize def test_method_set_role(self, client: Gitpod) -> None: organization = client.organizations.set_role( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(object, organization, path=["response"]) @@ -355,8 +355,8 @@ def test_method_set_role(self, client: Gitpod) -> None: @parametrize def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="ORGANIZATION_ROLE_UNSPECIFIED", ) assert_matches_type(object, organization, path=["response"]) @@ -365,8 +365,8 @@ def test_method_set_role_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.set_role( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert response.is_closed is True @@ -378,8 +378,8 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.set_role( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -397,7 +397,7 @@ class TestAsyncOrganizations: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( - name="xxx", + name="Acme Corp Engineering", ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) @@ -405,7 +405,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( - name="xxx", + name="Acme Corp Engineering", invite_accounts_with_matching_domain=True, join_organization=True, ) @@ -415,7 +415,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.create( - name="xxx", + name="Acme Corp Engineering", ) assert response.is_closed is True @@ -427,7 +427,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.create( - name="xxx", + name="Acme Corp Engineering", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -441,7 +441,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) @@ -449,7 +449,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.retrieve( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -461,7 +461,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.retrieve( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -475,7 +475,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) @@ -483,7 +483,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", invite_domains={"domains": ["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"]}, name="name", ) @@ -493,7 +493,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -505,7 +505,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -529,7 +529,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 50, }, scope="SCOPE_UNSPECIFIED", ) @@ -561,7 +561,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, organization, path=["response"]) @@ -569,7 +569,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.delete( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -581,7 +581,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.delete( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -601,7 +601,7 @@ async def test_method_join(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_join_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( - invite_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + invite_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) @@ -632,7 +632,7 @@ async def test_streaming_response_join(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(object, organization, path=["response"]) @@ -640,7 +640,7 @@ async def test_method_leave(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.leave( - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert response.is_closed is True @@ -652,7 +652,7 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.leave( - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -666,7 +666,7 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) @@ -674,12 +674,12 @@ async def test_method_list_members(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) @@ -688,7 +688,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list_members( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -700,7 +700,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list_members( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -714,8 +714,8 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(object, organization, path=["response"]) @@ -723,8 +723,8 @@ async def test_method_set_role(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="ORGANIZATION_ROLE_UNSPECIFIED", ) assert_matches_type(object, organization, path=["response"]) @@ -733,8 +733,8 @@ async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.set_role( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert response.is_closed is True @@ -746,8 +746,8 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.set_role( - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" From 7b82f34449f0cef24564c2dfb7fae7b302fc59a6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 14:44:56 +0000 Subject: [PATCH 109/505] feat(api): manual updates (#39) --- api.md | 2 ++ src/gitpod/_exceptions.py | 31 ++++++++++++++++++++++- src/gitpod/types/__init__.py | 2 ++ src/gitpod/types/shared/__init__.py | 2 ++ src/gitpod/types/shared/arbitrary_data.py | 21 +++++++++++++++ src/gitpod/types/shared/error_code.py | 24 ++++++++++++++++++ 6 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/gitpod/types/shared/arbitrary_data.py create mode 100644 src/gitpod/types/shared/error_code.py diff --git a/api.md b/api.md index d6933bfb..cc2d93c7 100644 --- a/api.md +++ b/api.md @@ -2,8 +2,10 @@ ```python from gitpod.types import ( + ArbitraryData, AutomationTrigger, EnvironmentClass, + ErrorCode, FieldValue, OrganizationRole, Principal, diff --git a/src/gitpod/_exceptions.py b/src/gitpod/_exceptions.py index 93778359..e78213ca 100644 --- a/src/gitpod/_exceptions.py +++ b/src/gitpod/_exceptions.py @@ -2,10 +2,16 @@ from __future__ import annotations +from typing import TYPE_CHECKING, Any, Optional, cast from typing_extensions import Literal import httpx +from ._utils import is_dict +from ._models import construct_type +from .types.shared.error_code import ErrorCode +from .types.shared.arbitrary_data import ArbitraryData + __all__ = [ "BadRequestError", "AuthenticationError", @@ -37,12 +43,35 @@ class APIError(GitpodError): If there was no response associated with this error then it will be `None`. """ - def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: # noqa: ARG002 + code: Optional[ErrorCode] = None + """ + The status code, which should be an enum value of + [google.rpc.Code][google.rpc.Code]. + """ + detail: Optional[ArbitraryData] = None + """ + Contains an arbitrary serialized message along with a @type that describes the + type of the serialized message. + """ + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + + def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: super().__init__(message) self.request = request self.message = message self.body = body + if is_dict(body): + self.code = cast(Any, construct_type(type_=Optional[ErrorCode], value=body.get("code"))) + self.detail = cast(Any, construct_type(type_=Optional[ArbitraryData], value=body.get("detail"))) + else: + self.code = None + self.detail = None + class APIResponseValidationError(APIError): response: httpx.Response diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 03e376b2..2b8a052a 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -13,10 +13,12 @@ RunsOn as RunsOn, Subject as Subject, TaskSpec as TaskSpec, + ErrorCode as ErrorCode, Principal as Principal, FieldValue as FieldValue, UserStatus as UserStatus, TaskMetadata as TaskMetadata, + ArbitraryData as ArbitraryData, TaskExecution as TaskExecution, EnvironmentClass as EnvironmentClass, OrganizationRole as OrganizationRole, diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index ba0e2567..b4616dc9 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -5,9 +5,11 @@ from .subject import Subject as Subject from .principal import Principal as Principal from .task_spec import TaskSpec as TaskSpec +from .error_code import ErrorCode as ErrorCode from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus from .task_metadata import TaskMetadata as TaskMetadata +from .arbitrary_data import ArbitraryData as ArbitraryData from .task_execution import TaskExecution as TaskExecution from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole diff --git a/src/gitpod/types/shared/arbitrary_data.py b/src/gitpod/types/shared/arbitrary_data.py new file mode 100644 index 00000000..de1ead23 --- /dev/null +++ b/src/gitpod/types/shared/arbitrary_data.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, Optional + +from ..._models import BaseModel + +__all__ = ["ArbitraryData"] + + +class ArbitraryData(BaseModel): + debug: Optional[Dict[str, object]] = None + + type: Optional[str] = None + + value: Optional[object] = None + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... diff --git a/src/gitpod/types/shared/error_code.py b/src/gitpod/types/shared/error_code.py new file mode 100644 index 00000000..316948ab --- /dev/null +++ b/src/gitpod/types/shared/error_code.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ErrorCode"] + +ErrorCode: TypeAlias = Literal[ + "canceled", + "unknown", + "invalid_argument", + "deadline_exceeded", + "not_found", + "already_exists", + "permission_denied", + "resource_exhausted", + "failed_precondition", + "aborted", + "out_of_range", + "unimplemented", + "internal", + "unavailable", + "data_loss", + "unauthenticated", +] From 791b4f056e3ea8fee714d0c8aaa822a2e64518f5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 14:50:48 +0000 Subject: [PATCH 110/505] chore(internal): version bump (#40) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5547f83e..cda9cbdf 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.1" + ".": "0.1.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b3536967..a50b758d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.1.1" +version = "0.1.2" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 5c0267d4..b9d4fe79 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.1.1" # x-release-please-version +__version__ = "0.1.2" # x-release-please-version From 1c95dc2e3e847c1ee1a767fa38cb2e13bafe5743 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:44:32 +0000 Subject: [PATCH 111/505] chore(internal): codegen related update (#41) --- src/gitpod/_exceptions.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/gitpod/_exceptions.py b/src/gitpod/_exceptions.py index e78213ca..a880564a 100644 --- a/src/gitpod/_exceptions.py +++ b/src/gitpod/_exceptions.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal import httpx @@ -53,11 +53,6 @@ class APIError(GitpodError): Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. """ - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: super().__init__(message) From 93f823888bb20ef1ca7e8c234452b345c883cd27 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:45:02 +0000 Subject: [PATCH 112/505] chore(internal): add jsonl unit tests (#43) --- tests/decoders/test_jsonl.py | 88 ++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 tests/decoders/test_jsonl.py diff --git a/tests/decoders/test_jsonl.py b/tests/decoders/test_jsonl.py new file mode 100644 index 00000000..a14a93e6 --- /dev/null +++ b/tests/decoders/test_jsonl.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from typing import Any, Iterator, AsyncIterator +from typing_extensions import TypeVar + +import httpx +import pytest + +from gitpod._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder + +_T = TypeVar("_T") + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_basic(sync: bool) -> None: + def body() -> Iterator[bytes]: + yield b'{"foo":true}\n' + yield b'{"bar":false}\n' + + iterator = make_jsonl_iterator( + content=body(), + sync=sync, + line_type=object, + ) + + assert await iter_next(iterator) == {"foo": True} + assert await iter_next(iterator) == {"bar": False} + + await assert_empty_iter(iterator) + + +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_new_lines_in_json( + sync: bool, +) -> None: + def body() -> Iterator[bytes]: + yield b'{"content":"Hello, world!\\nHow are you doing?"}' + + iterator = make_jsonl_iterator(content=body(), sync=sync, line_type=object) + + assert await iter_next(iterator) == {"content": "Hello, world!\nHow are you doing?"} + + +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multi_byte_character_multiple_chunks( + sync: bool, +) -> None: + def body() -> Iterator[bytes]: + yield b'{"content":"' + # bytes taken from the string 'известни' and arbitrarily split + # so that some multi-byte characters span multiple chunks + yield b"\xd0" + yield b"\xb8\xd0\xb7\xd0" + yield b"\xb2\xd0\xb5\xd1\x81\xd1\x82\xd0\xbd\xd0\xb8" + yield b'"}\n' + + iterator = make_jsonl_iterator(content=body(), sync=sync, line_type=object) + + assert await iter_next(iterator) == {"content": "известни"} + + +async def to_aiter(iter: Iterator[bytes]) -> AsyncIterator[bytes]: + for chunk in iter: + yield chunk + + +async def iter_next(iter: Iterator[_T] | AsyncIterator[_T]) -> _T: + if isinstance(iter, AsyncIterator): + return await iter.__anext__() + return next(iter) + + +async def assert_empty_iter(decoder: JSONLDecoder[Any] | AsyncJSONLDecoder[Any]) -> None: + with pytest.raises((StopAsyncIteration, RuntimeError)): + await iter_next(decoder) + + +def make_jsonl_iterator( + content: Iterator[bytes], + *, + sync: bool, + line_type: type[_T], +) -> JSONLDecoder[_T] | AsyncJSONLDecoder[_T]: + if sync: + return JSONLDecoder(line_type=line_type, raw_iterator=content, http_response=httpx.Response(200)) + + return AsyncJSONLDecoder(line_type=line_type, raw_iterator=to_aiter(content), http_response=httpx.Response(200)) From 2db481f59ab71d36bdedaa999ea92c4c92ddcc54 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 08:46:55 +0000 Subject: [PATCH 113/505] chore(internal): version bump (#45) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cda9cbdf..4c5a1a01 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.2" + ".": "0.1.3" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a50b758d..62f87d71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.1.2" +version = "0.1.3" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index b9d4fe79..a4b0bd68 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.1.2" # x-release-please-version +__version__ = "0.1.3" # x-release-please-version From 7d3c516cfd8466d74a7ac46ec0ff7b28772fe4b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 08:48:55 +0000 Subject: [PATCH 114/505] feat(api): manual updates (#46) --- .stats.yml | 2 +- src/gitpod/resources/accounts.py | 198 ++++++++- src/gitpod/resources/editors.py | 116 ++++- .../environments/automations/automations.py | 70 +++- .../environments/automations/services.py | 396 +++++++++++++++++- .../automations/tasks/executions.py | 138 +++++- .../environments/automations/tasks/tasks.py | 330 ++++++++++++++- src/gitpod/resources/identity.py | 134 +++++- src/gitpod/resources/secrets.py | 242 ++++++++++- src/gitpod/resources/users/pats.py | 114 ++++- src/gitpod/resources/users/users.py | 94 ++++- src/gitpod/types/environment.py | 2 +- .../types/environments/automations/service.py | 2 +- src/gitpod/types/runner_capability.py | 6 +- ..._check_authentication_for_host_response.py | 45 +- src/gitpod/types/shared/environment_class.py | 2 +- src/gitpod/types/shared/task.py | 2 +- .../types/shared_params/environment_class.py | 4 +- .../automations/tasks/test_executions.py | 16 +- .../environments/automations/test_services.py | 64 +-- .../environments/automations/test_tasks.py | 48 +-- .../environments/test_automations.py | 40 +- tests/api_resources/test_accounts.py | 32 +- tests/api_resources/test_editors.py | 52 +-- tests/api_resources/test_identity.py | 8 +- tests/api_resources/test_secrets.py | 36 +- tests/api_resources/test_users.py | 8 +- tests/api_resources/users/test_pats.py | 16 +- 28 files changed, 1957 insertions(+), 260 deletions(-) diff --git a/.stats.yml b/.stats.yml index df3a2f02..296014eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0c37e687e2a070abfe49501156af6d906ff166b6eaad779ee6c2b568515f2b7e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f6598ab5d6827f66b642201769e92590ea32af84ebbf24b18cc32b33dee5107e.yml diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index aa8d5010..7f3c4f75 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -66,7 +66,24 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AccountRetrieveResponse: """ - GetAccount retrieves a single Account. + Gets information about the currently authenticated account. + + Use this method to: + + - Retrieve account profile information + - Check organization memberships + - View account settings + - Get joinable organizations + + ### Examples + + - Get account details: + + Retrieves information about the authenticated account. + + ```yaml + {} + ``` Args: extra_headers: Send extra headers @@ -97,10 +114,26 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """DeleteAccount deletes an Account. + """ + Deletes an account permanently. + + Use this method to: - To Delete an Account, the Account must not be - an active member of any Organization. + - Remove unused accounts + - Clean up test accounts + - Complete account deletion requests + + The account must not be an active member of any organization. + + ### Examples + + - Delete account: + + Permanently removes an account. + + ```yaml + accountId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: extra_headers: Send extra headers @@ -133,7 +166,32 @@ def get_sso_login_url( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AccountGetSSOLoginURLResponse: """ - GetSSOLoginURL returns the URL to redirect the user to for SSO login. + Gets the SSO login URL for a specific email domain. + + Use this method to: + + - Initiate SSO authentication + - Get organization-specific login URLs + - Handle SSO redirects + + ### Examples + + - Get login URL: + + Retrieves SSO URL for email domain. + + ```yaml + email: "user@company.com" + ``` + + - Get URL with return path: + + Gets SSO URL with specific return location. + + ```yaml + email: "user@company.com" + returnTo: "https://gitpod.io/workspaces" + ``` Args: email: email is the email the user wants to login with @@ -178,8 +236,35 @@ def list_login_providers( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncLoginProvidersPage[LoginProvider]: """ - ListLoginProviders returns the list of login providers matching the provided - filters. + Lists available login providers with optional filtering. + + Use this method to: + + - View supported authentication methods + - Get provider-specific login URLs + - Filter providers by invite + + ### Examples + + - List all providers: + + Shows all available login providers. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List for specific invite: + + Shows providers available for an invite. + + ```yaml + filter: + inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: filter: filter contains the filter options for listing login methods @@ -254,7 +339,24 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AccountRetrieveResponse: """ - GetAccount retrieves a single Account. + Gets information about the currently authenticated account. + + Use this method to: + + - Retrieve account profile information + - Check organization memberships + - View account settings + - Get joinable organizations + + ### Examples + + - Get account details: + + Retrieves information about the authenticated account. + + ```yaml + {} + ``` Args: extra_headers: Send extra headers @@ -285,10 +387,26 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """DeleteAccount deletes an Account. + """ + Deletes an account permanently. + + Use this method to: - To Delete an Account, the Account must not be - an active member of any Organization. + - Remove unused accounts + - Clean up test accounts + - Complete account deletion requests + + The account must not be an active member of any organization. + + ### Examples + + - Delete account: + + Permanently removes an account. + + ```yaml + accountId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: extra_headers: Send extra headers @@ -321,7 +439,32 @@ async def get_sso_login_url( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AccountGetSSOLoginURLResponse: """ - GetSSOLoginURL returns the URL to redirect the user to for SSO login. + Gets the SSO login URL for a specific email domain. + + Use this method to: + + - Initiate SSO authentication + - Get organization-specific login URLs + - Handle SSO redirects + + ### Examples + + - Get login URL: + + Retrieves SSO URL for email domain. + + ```yaml + email: "user@company.com" + ``` + + - Get URL with return path: + + Gets SSO URL with specific return location. + + ```yaml + email: "user@company.com" + returnTo: "https://gitpod.io/workspaces" + ``` Args: email: email is the email the user wants to login with @@ -366,8 +509,35 @@ def list_login_providers( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[LoginProvider, AsyncLoginProvidersPage[LoginProvider]]: """ - ListLoginProviders returns the list of login providers matching the provided - filters. + Lists available login providers with optional filtering. + + Use this method to: + + - View supported authentication methods + - Get provider-specific login URLs + - Filter providers by invite + + ### Examples + + - List all providers: + + Shows all available login providers. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List for specific invite: + + Shows providers available for an invite. + + ```yaml + filter: + inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: filter: filter contains the filter options for listing login methods diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 78e0ba23..3ea08ba9 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -59,7 +59,22 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EditorRetrieveResponse: """ - GetEditor returns the editor with the given ID + Gets details about a specific editor. + + Use this method to: + + - View editor information + - Get editor configuration + + ### Examples + + - Get editor details: + + Retrieves information about a specific editor. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: id: id is the ID of the editor to get @@ -95,7 +110,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncEditorsPage[Editor]: """ - ListEditors lists all editors available to the caller + Lists all available code editors. + + Use this method to: + + - View supported editors + - Get editor capabilities + - Browse editor options + - Check editor availability + + ### Examples + + - List editors: + + Shows all available editors with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -143,7 +176,26 @@ def resolve_url( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EditorResolveURLResponse: """ - ResolveEditorURL resolves the editor's URL for an environment + Resolves the URL for accessing an editor in a specific environment. + + Use this method to: + + - Get editor access URLs + - Launch editors for environments + - Set up editor connections + - Configure editor access + + ### Examples + + - Resolve editor URL: + + Gets the URL for accessing an editor in an environment. + + ```yaml + editorId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: editor_id: editorId is the ID of the editor to resolve the URL for @@ -209,7 +261,22 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EditorRetrieveResponse: """ - GetEditor returns the editor with the given ID + Gets details about a specific editor. + + Use this method to: + + - View editor information + - Get editor configuration + + ### Examples + + - Get editor details: + + Retrieves information about a specific editor. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: id: id is the ID of the editor to get @@ -245,7 +312,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Editor, AsyncEditorsPage[Editor]]: """ - ListEditors lists all editors available to the caller + Lists all available code editors. + + Use this method to: + + - View supported editors + - Get editor capabilities + - Browse editor options + - Check editor availability + + ### Examples + + - List editors: + + Shows all available editors with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -293,7 +378,26 @@ async def resolve_url( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EditorResolveURLResponse: """ - ResolveEditorURL resolves the editor's URL for an environment + Resolves the URL for accessing an editor in a specific environment. + + Use this method to: + + - Get editor access URLs + - Launch editors for environments + - Set up editor connections + - Configure editor access + + ### Examples + + - Resolve editor URL: + + Gets the URL for accessing an editor in an environment. + + ```yaml + editorId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: editor_id: editorId is the ID of the editor to resolve the URL for diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index 16cacc4e..d7816c32 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -82,7 +82,40 @@ def upsert( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AutomationUpsertResponse: """ - UpsertAutomationsFile upserts the automations file for the given environment. + Upserts the automations file for the given environment. + + Use this method to: + + - Configure environment automations + - Update automation settings + - Manage automation files + + ### Examples + + - Update automations file: + + Updates or creates the automations configuration. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + automationsFile: + services: + web-server: + name: "Web Server" + description: "Development web server" + commands: + start: "npm run dev" + ready: "curl -s http://localhost:3000" + triggeredBy: + - postDevcontainerStart + tasks: + build: + name: "Build Project" + description: "Builds the project artifacts" + command: "npm run build" + triggeredBy: + - postEnvironmentStart + ``` Args: automations_file: WARN: Do not remove any field here, as it will break reading automation yaml @@ -155,7 +188,40 @@ async def upsert( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AutomationUpsertResponse: """ - UpsertAutomationsFile upserts the automations file for the given environment. + Upserts the automations file for the given environment. + + Use this method to: + + - Configure environment automations + - Update automation settings + - Manage automation files + + ### Examples + + - Update automations file: + + Updates or creates the automations configuration. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + automationsFile: + services: + web-server: + name: "Web Server" + description: "Development web server" + commands: + start: "npm run dev" + ready: "curl -s http://localhost:3000" + triggeredBy: + - postDevcontainerStart + tasks: + build: + name: "Build Project" + description: "Builds the project artifacts" + command: "npm run build" + triggeredBy: + - postEnvironmentStart + ``` Args: automations_file: WARN: Do not remove any field here, as it will break reading automation yaml diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index 9fe97160..c48e96c2 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -71,7 +71,52 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ServiceCreateResponse: """ - CreateService + Creates a new automation service for an environment. + + Use this method to: + + - Set up long-running services + - Configure service triggers + - Define service dependencies + - Specify runtime environments + + ### Examples + + - Create basic service: + + Creates a simple service with start command. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + metadata: + reference: "web-server" + name: "Web Server" + description: "Runs the development web server" + triggeredBy: + - postDevcontainerStart: true + spec: + commands: + start: "npm run dev" + ready: "curl -s http://localhost:3000" + ``` + + - Create Docker-based service: + + Creates a service running in a specific container. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + metadata: + reference: "redis" + name: "Redis Server" + description: "Redis cache service" + spec: + commands: + start: "redis-server" + runsOn: + docker: + image: "redis:7" + ``` Args: extra_headers: Send extra headers @@ -110,7 +155,24 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ServiceRetrieveResponse: """ - GetService + Gets details about a specific automation service. + + Use this method to: + + - Check service status + - View service configuration + - Monitor service health + - Retrieve service metadata + + ### Examples + + - Get service details: + + Retrieves information about a specific service. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -145,7 +207,41 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateService + Updates an automation service configuration. + + Use this method to: + + - Modify service commands + - Update triggers + - Change runtime settings + - Adjust dependencies + + ### Examples + + - Update commands: + + Changes service start and ready commands. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + spec: + commands: + start: "npm run start:dev" + ready: "curl -s http://localhost:8080" + ``` + + - Update triggers: + + Modifies when the service starts. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + metadata: + triggeredBy: + trigger: + - postDevcontainerStart: true + - manual: true + ``` Args: spec: Changing the spec of a service is a complex operation. The spec of a service can @@ -196,7 +292,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncServicesPage[Service]: """ - ListServices + Lists automation services with optional filtering. + + Use this method to: + + - View all services in an environment + - Filter services by reference + - Monitor service status + + ### Examples + + - List environment services: + + Shows all services for an environment. + + ```yaml + filter: + environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] + pagination: + pageSize: 20 + ``` + + - Filter by reference: + + Lists services matching specific references. + + ```yaml + filter: + references: ["web-server", "database"] + pagination: + pageSize: 20 + ``` Args: filter: filter contains the filter options for listing services @@ -250,11 +376,37 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """DeleteService deletes a service. + """Deletes an automation service. This call does not block until the service is deleted. If the service is not stopped it will be stopped before deletion. + Use this method to: + + - Remove unused services + - Clean up service configurations + - Stop and delete services + + ### Examples + + - Delete service: + + Removes a service after stopping it. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + force: false + ``` + + - Force delete: + + Immediately removes a service. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + force: true + ``` + Args: extra_headers: Send extra headers @@ -290,12 +442,28 @@ def start( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """StartService starts a service. + """Starts an automation service. This call does not block until the service is started. This call will not error if the service is already running or has been started. + Use this method to: + + - Start stopped services + - Resume service operations + - Trigger service initialization + + ### Examples + + - Start service: + + Starts a previously stopped service. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + Args: extra_headers: Send extra headers @@ -325,12 +493,28 @@ def stop( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """StopService stops a service. + """Stops an automation service. This call does not block until the service is stopped. This call will not error if the service is already stopped or has been stopped. + Use this method to: + + - Pause service operations + - Gracefully stop services + - Prepare for updates + + ### Examples + + - Stop service: + + Gracefully stops a running service. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + Args: extra_headers: Send extra headers @@ -384,7 +568,52 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ServiceCreateResponse: """ - CreateService + Creates a new automation service for an environment. + + Use this method to: + + - Set up long-running services + - Configure service triggers + - Define service dependencies + - Specify runtime environments + + ### Examples + + - Create basic service: + + Creates a simple service with start command. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + metadata: + reference: "web-server" + name: "Web Server" + description: "Runs the development web server" + triggeredBy: + - postDevcontainerStart: true + spec: + commands: + start: "npm run dev" + ready: "curl -s http://localhost:3000" + ``` + + - Create Docker-based service: + + Creates a service running in a specific container. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + metadata: + reference: "redis" + name: "Redis Server" + description: "Redis cache service" + spec: + commands: + start: "redis-server" + runsOn: + docker: + image: "redis:7" + ``` Args: extra_headers: Send extra headers @@ -423,7 +652,24 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ServiceRetrieveResponse: """ - GetService + Gets details about a specific automation service. + + Use this method to: + + - Check service status + - View service configuration + - Monitor service health + - Retrieve service metadata + + ### Examples + + - Get service details: + + Retrieves information about a specific service. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -458,7 +704,41 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateService + Updates an automation service configuration. + + Use this method to: + + - Modify service commands + - Update triggers + - Change runtime settings + - Adjust dependencies + + ### Examples + + - Update commands: + + Changes service start and ready commands. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + spec: + commands: + start: "npm run start:dev" + ready: "curl -s http://localhost:8080" + ``` + + - Update triggers: + + Modifies when the service starts. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + metadata: + triggeredBy: + trigger: + - postDevcontainerStart: true + - manual: true + ``` Args: spec: Changing the spec of a service is a complex operation. The spec of a service can @@ -509,7 +789,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Service, AsyncServicesPage[Service]]: """ - ListServices + Lists automation services with optional filtering. + + Use this method to: + + - View all services in an environment + - Filter services by reference + - Monitor service status + + ### Examples + + - List environment services: + + Shows all services for an environment. + + ```yaml + filter: + environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] + pagination: + pageSize: 20 + ``` + + - Filter by reference: + + Lists services matching specific references. + + ```yaml + filter: + references: ["web-server", "database"] + pagination: + pageSize: 20 + ``` Args: filter: filter contains the filter options for listing services @@ -563,11 +873,37 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """DeleteService deletes a service. + """Deletes an automation service. This call does not block until the service is deleted. If the service is not stopped it will be stopped before deletion. + Use this method to: + + - Remove unused services + - Clean up service configurations + - Stop and delete services + + ### Examples + + - Delete service: + + Removes a service after stopping it. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + force: false + ``` + + - Force delete: + + Immediately removes a service. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + force: true + ``` + Args: extra_headers: Send extra headers @@ -603,12 +939,28 @@ async def start( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """StartService starts a service. + """Starts an automation service. This call does not block until the service is started. This call will not error if the service is already running or has been started. + Use this method to: + + - Start stopped services + - Resume service operations + - Trigger service initialization + + ### Examples + + - Start service: + + Starts a previously stopped service. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + Args: extra_headers: Send extra headers @@ -638,12 +990,28 @@ async def stop( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: - """StopService stops a service. + """Stops an automation service. This call does not block until the service is stopped. This call will not error if the service is already stopped or has been stopped. + Use this method to: + + - Pause service operations + - Gracefully stop services + - Prepare for updates + + ### Examples + + - Stop service: + + Gracefully stops a running service. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index a2a887e0..62181feb 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -62,7 +62,24 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ExecutionRetrieveResponse: """ - GetTaskExecution + Gets details about a specific task execution. + + Use this method to: + + - Monitor execution progress + - View execution logs + - Check execution status + - Debug failed executions + + ### Examples + + - Get execution details: + + Retrieves information about a specific task execution. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -97,7 +114,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncTaskExecutionsPage[TaskExecution]: """ - ListTaskExecutions + Lists executions of automation tasks. + + Use this method to: + + - View task execution history + - Monitor running tasks + - Track task completion status + + ### Examples + + - List all executions: + + Shows execution history for all tasks. + + ```yaml + filter: + environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] + pagination: + pageSize: 20 + ``` + + - Filter by phase: + + Lists executions in specific phases. + + ```yaml + filter: + phases: ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"] + pagination: + pageSize: 20 + ``` Args: filter: filter contains the filter options for listing task runs @@ -151,7 +198,23 @@ def stop( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - StopTaskExecution + Stops a running task execution. + + Use this method to: + + - Cancel long-running tasks + - Stop failed executions + - Interrupt task processing + + ### Examples + + - Stop execution: + + Stops a running task execution. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -204,7 +267,24 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ExecutionRetrieveResponse: """ - GetTaskExecution + Gets details about a specific task execution. + + Use this method to: + + - Monitor execution progress + - View execution logs + - Check execution status + - Debug failed executions + + ### Examples + + - Get execution details: + + Retrieves information about a specific task execution. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -239,7 +319,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[TaskExecution, AsyncTaskExecutionsPage[TaskExecution]]: """ - ListTaskExecutions + Lists executions of automation tasks. + + Use this method to: + + - View task execution history + - Monitor running tasks + - Track task completion status + + ### Examples + + - List all executions: + + Shows execution history for all tasks. + + ```yaml + filter: + environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] + pagination: + pageSize: 20 + ``` + + - Filter by phase: + + Lists executions in specific phases. + + ```yaml + filter: + phases: ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"] + pagination: + pageSize: 20 + ``` Args: filter: filter contains the filter options for listing task runs @@ -293,7 +403,23 @@ async def stop( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - StopTaskExecution + Stops a running task execution. + + Use this method to: + + - Cancel long-running tasks + - Stop failed executions + - Interrupt task processing + + ### Examples + + - Stop execution: + + Stops a running task execution. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 98581635..782b9178 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -86,7 +86,47 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TaskCreateResponse: """ - CreateTask + Creates a new automation task. + + Use this method to: + + - Define one-off or scheduled tasks + - Set up build or test automation + - Configure task dependencies + - Specify execution environments + + ### Examples + + - Create basic task: + + Creates a simple build task. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + metadata: + reference: "build" + name: "Build Project" + description: "Builds the project artifacts" + triggeredBy: + - postEnvironmentStart: true + spec: + command: "npm run build" + ``` + + - Create task with dependencies: + + Creates a task that depends on other services. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + metadata: + reference: "test" + name: "Run Tests" + description: "Runs the test suite" + spec: + command: "npm test" + dependsOn: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + ``` Args: extra_headers: Send extra headers @@ -126,7 +166,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TaskRetrieveResponse: """ - GetTask + Gets details about a specific automation task. + + Use this method to: + + - Check task configuration + - View task dependencies + - Monitor task status + + ### Examples + + - Get task details: + + Retrieves information about a specific task. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -161,7 +217,38 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateTask + Updates an automation task configuration. + + Use this method to: + + - Modify task commands + - Update task triggers + - Change dependencies + - Adjust execution settings + + ### Examples + + - Update command: + + Changes the task's command. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + spec: + command: "npm run test:coverage" + ``` + + - Update triggers: + + Modifies when the task runs. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + metadata: + triggeredBy: + trigger: + - postEnvironmentStart: true + ``` Args: depends_on: dependencies specifies the IDs of the automations this task depends on. @@ -206,7 +293,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncTasksPage[Task]: """ - ListTasks + Lists automation tasks with optional filtering. + + Use this method to: + + - View all tasks in an environment + - Filter tasks by reference + - Monitor task status + + ### Examples + + - List environment tasks: + + Shows all tasks for an environment. + + ```yaml + filter: + environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] + pagination: + pageSize: 20 + ``` + + - Filter by reference: + + Lists tasks matching specific references. + + ```yaml + filter: + references: ["build", "test"] + pagination: + pageSize: 20 + ``` Args: filter: filter contains the filter options for listing tasks @@ -260,7 +377,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteTask + Deletes an automation task. + + Use this method to: + + - Remove unused tasks + - Clean up task configurations + - Delete obsolete automations + + ### Examples + + - Delete task: + + Removes a task and its configuration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -291,10 +424,26 @@ def start( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TaskStartResponse: - """StartTask starts a task, i.e. + """Starts a task by creating a new task execution. + + This call does not block until + the task is started; the task will be started asynchronously. + + Use this method to: + + - Trigger task execution + - Run one-off tasks + - Start scheduled tasks immediately + + ### Examples + + - Start task: + + Creates a new execution of a task. - creates a task execution. This call does not block - until the task is started; the task will be started asynchronously. + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -354,7 +503,47 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TaskCreateResponse: """ - CreateTask + Creates a new automation task. + + Use this method to: + + - Define one-off or scheduled tasks + - Set up build or test automation + - Configure task dependencies + - Specify execution environments + + ### Examples + + - Create basic task: + + Creates a simple build task. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + metadata: + reference: "build" + name: "Build Project" + description: "Builds the project artifacts" + triggeredBy: + - postEnvironmentStart: true + spec: + command: "npm run build" + ``` + + - Create task with dependencies: + + Creates a task that depends on other services. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + metadata: + reference: "test" + name: "Run Tests" + description: "Runs the test suite" + spec: + command: "npm test" + dependsOn: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + ``` Args: extra_headers: Send extra headers @@ -394,7 +583,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TaskRetrieveResponse: """ - GetTask + Gets details about a specific automation task. + + Use this method to: + + - Check task configuration + - View task dependencies + - Monitor task status + + ### Examples + + - Get task details: + + Retrieves information about a specific task. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -429,7 +634,38 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateTask + Updates an automation task configuration. + + Use this method to: + + - Modify task commands + - Update task triggers + - Change dependencies + - Adjust execution settings + + ### Examples + + - Update command: + + Changes the task's command. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + spec: + command: "npm run test:coverage" + ``` + + - Update triggers: + + Modifies when the task runs. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + metadata: + triggeredBy: + trigger: + - postEnvironmentStart: true + ``` Args: depends_on: dependencies specifies the IDs of the automations this task depends on. @@ -474,7 +710,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Task, AsyncTasksPage[Task]]: """ - ListTasks + Lists automation tasks with optional filtering. + + Use this method to: + + - View all tasks in an environment + - Filter tasks by reference + - Monitor task status + + ### Examples + + - List environment tasks: + + Shows all tasks for an environment. + + ```yaml + filter: + environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] + pagination: + pageSize: 20 + ``` + + - Filter by reference: + + Lists tasks matching specific references. + + ```yaml + filter: + references: ["build", "test"] + pagination: + pageSize: 20 + ``` Args: filter: filter contains the filter options for listing tasks @@ -528,7 +794,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteTask + Deletes an automation task. + + Use this method to: + + - Remove unused tasks + - Clean up task configurations + - Delete obsolete automations + + ### Examples + + - Delete task: + + Removes a task and its configuration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -559,10 +841,26 @@ async def start( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TaskStartResponse: - """StartTask starts a task, i.e. + """Starts a task by creating a new task execution. + + This call does not block until + the task is started; the task will be started asynchronously. + + Use this method to: + + - Trigger task execution + - Run one-off tasks + - Start scheduled tasks immediately + + ### Examples + + - Start task: + + Creates a new execution of a task. - creates a task execution. This call does not block - until the task is started; the task will be started asynchronously. + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 6635c4b6..736e308a 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -64,7 +64,23 @@ def exchange_token( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IdentityExchangeTokenResponse: """ - ExchangeToken trades an exchange token for a new access token. + Exchanges an exchange token for a new access token. + + Use this method to: + + - Convert exchange tokens to access tokens + - Obtain new access credentials + - Complete token exchange flows + + ### Examples + + - Exchange token: + + Trades an exchange token for an access token. + + ```yaml + exchangeToken: "exchange-token-value" + ``` Args: exchange_token: exchange_token is the token to exchange @@ -100,7 +116,24 @@ def get_authenticated_identity( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IdentityGetAuthenticatedIdentityResponse: """ - GetAuthenticatedIdentity allows to retrieve the current identity. + Retrieves information about the currently authenticated identity. + + Use this method to: + + - Get current user information + - Check authentication status + - Retrieve organization context + - Validate authentication principal + + ### Examples + + - Get current identity: + + Retrieves details about the authenticated user. + + ```yaml + {} + ``` Args: extra_headers: Send extra headers @@ -134,8 +167,34 @@ def get_id_token( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IdentityGetIDTokenResponse: """ - GetIDToken returns a token that can be used to authenticate the user against the - other services. + Gets an ID token for authenticating with other services. + + Use this method to: + + - Obtain authentication tokens for service-to-service calls + - Access protected resources + - Generate scoped access tokens + + ### Examples + + - Get token for single service: + + Retrieves a token for authenticating with one service. + + ```yaml + audience: + - "https://api.gitpod.io" + ``` + + - Get token for multiple services: + + Retrieves a token valid for multiple services. + + ```yaml + audience: + - "https://api.gitpod.io" + - "https://ws.gitpod.io" + ``` Args: extra_headers: Send extra headers @@ -188,7 +247,23 @@ async def exchange_token( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IdentityExchangeTokenResponse: """ - ExchangeToken trades an exchange token for a new access token. + Exchanges an exchange token for a new access token. + + Use this method to: + + - Convert exchange tokens to access tokens + - Obtain new access credentials + - Complete token exchange flows + + ### Examples + + - Exchange token: + + Trades an exchange token for an access token. + + ```yaml + exchangeToken: "exchange-token-value" + ``` Args: exchange_token: exchange_token is the token to exchange @@ -224,7 +299,24 @@ async def get_authenticated_identity( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IdentityGetAuthenticatedIdentityResponse: """ - GetAuthenticatedIdentity allows to retrieve the current identity. + Retrieves information about the currently authenticated identity. + + Use this method to: + + - Get current user information + - Check authentication status + - Retrieve organization context + - Validate authentication principal + + ### Examples + + - Get current identity: + + Retrieves details about the authenticated user. + + ```yaml + {} + ``` Args: extra_headers: Send extra headers @@ -258,8 +350,34 @@ async def get_id_token( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IdentityGetIDTokenResponse: """ - GetIDToken returns a token that can be used to authenticate the user against the - other services. + Gets an ID token for authenticating with other services. + + Use this method to: + + - Obtain authentication tokens for service-to-service calls + - Access protected resources + - Generate scoped access tokens + + ### Examples + + - Get token for single service: + + Retrieves a token for authenticating with one service. + + ```yaml + audience: + - "https://api.gitpod.io" + ``` + + - Get token for multiple services: + + Retrieves a token valid for multiple services. + + ```yaml + audience: + - "https://api.gitpod.io" + - "https://ws.gitpod.io" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index bcd0b7f2..53c051b1 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -70,7 +70,49 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SecretCreateResponse: """ - CreateSecret creates a new secret. + Creates a new secret for a project. + + Use this method to: + + - Store sensitive configuration values + - Set up environment variables + - Configure registry authentication + - Add file-based secrets + + ### Examples + + - Create environment variable: + + Creates a secret that will be available as an environment variable. + + ```yaml + name: "DATABASE_URL" + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + value: "postgresql://user:pass@localhost:5432/db" + environmentVariable: true + ``` + + - Create file secret: + + Creates a secret that will be mounted as a file. + + ```yaml + name: "SSH_KEY" + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + value: "-----BEGIN RSA PRIVATE KEY-----\n..." + filePath: "/home/gitpod/.ssh/id_rsa" + ``` + + - Create registry auth: + + Creates credentials for private container registry. + + ```yaml + name: "DOCKER_AUTH" + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + value: "username:password" + containerRegistryBasicAuthHost: "https://registry.example.com" + ``` Args: container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have @@ -132,7 +174,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncSecretsPage[Secret]: """ - ListSecrets lists secrets. + Lists secrets with optional filtering. + + Use this method to: + + - View all project secrets + - Filter secrets by project + + ### Examples + + - List project secrets: + + Shows all secrets for a project. + + ```yaml + filter: + projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -184,7 +244,22 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteSecret deletes a secret. + Deletes a secret permanently. + + Use this method to: + + - Remove unused secrets + - Clean up old credentials + + ### Examples + + - Delete secret: + + Permanently removes a secret. + + ```yaml + secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -215,9 +290,25 @@ def get_value( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SecretGetValueResponse: - """ - GetSecretValue retrieves the value of a secret Only Environments can perform - this operation, and only for secrets specified on the EnvironmentSpec. + """Gets the value of a secret. + + Only available to environments that are authorized + to access the secret. + + Use this method to: + + - Retrieve secret values + - Access credentials + + ### Examples + + - Get secret value: + + Retrieves the value of a specific secret. + + ```yaml + secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -250,7 +341,23 @@ def update_value( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateSecretValue updates the value of a secret. + Updates the value of an existing secret. + + Use this method to: + + - Rotate secret values + - Update credentials + + ### Examples + + - Update secret value: + + Changes the value of an existing secret. + + ```yaml + secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + value: "new-secret-value" + ``` Args: value: value is the plaintext value of the secret @@ -316,7 +423,49 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SecretCreateResponse: """ - CreateSecret creates a new secret. + Creates a new secret for a project. + + Use this method to: + + - Store sensitive configuration values + - Set up environment variables + - Configure registry authentication + - Add file-based secrets + + ### Examples + + - Create environment variable: + + Creates a secret that will be available as an environment variable. + + ```yaml + name: "DATABASE_URL" + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + value: "postgresql://user:pass@localhost:5432/db" + environmentVariable: true + ``` + + - Create file secret: + + Creates a secret that will be mounted as a file. + + ```yaml + name: "SSH_KEY" + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + value: "-----BEGIN RSA PRIVATE KEY-----\n..." + filePath: "/home/gitpod/.ssh/id_rsa" + ``` + + - Create registry auth: + + Creates credentials for private container registry. + + ```yaml + name: "DOCKER_AUTH" + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + value: "username:password" + containerRegistryBasicAuthHost: "https://registry.example.com" + ``` Args: container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have @@ -378,7 +527,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Secret, AsyncSecretsPage[Secret]]: """ - ListSecrets lists secrets. + Lists secrets with optional filtering. + + Use this method to: + + - View all project secrets + - Filter secrets by project + + ### Examples + + - List project secrets: + + Shows all secrets for a project. + + ```yaml + filter: + projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -430,7 +597,22 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteSecret deletes a secret. + Deletes a secret permanently. + + Use this method to: + + - Remove unused secrets + - Clean up old credentials + + ### Examples + + - Delete secret: + + Permanently removes a secret. + + ```yaml + secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -461,9 +643,25 @@ async def get_value( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SecretGetValueResponse: - """ - GetSecretValue retrieves the value of a secret Only Environments can perform - this operation, and only for secrets specified on the EnvironmentSpec. + """Gets the value of a secret. + + Only available to environments that are authorized + to access the secret. + + Use this method to: + + - Retrieve secret values + - Access credentials + + ### Examples + + - Get secret value: + + Retrieves the value of a specific secret. + + ```yaml + secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -496,7 +694,23 @@ async def update_value( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateSecretValue updates the value of a secret. + Updates the value of an existing secret. + + Use this method to: + + - Rotate secret values + - Update credentials + + ### Examples + + - Update secret value: + + Changes the value of an existing secret. + + ```yaml + secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + value: "new-secret-value" + ``` Args: value: value is the plaintext value of the secret diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index a276f0e1..12538951 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -61,7 +61,26 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncPersonalAccessTokensPage[PersonalAccessToken]: """ - ListPersonalAccessTokens + Lists personal access tokens with optional filtering. + + Use this method to: + + - View all active tokens + - Audit token usage + - Manage token lifecycle + + ### Examples + + - List user tokens: + + Shows all tokens for specific users. + + ```yaml + filter: + userIds: ["f53d2330-3795-4c5d-a1f3-453121af9c60"] + pagination: + pageSize: 20 + ``` Args: extra_headers: Send extra headers @@ -111,7 +130,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeletePersonalAccessToken + Deletes a personal access token. + + Use this method to: + + - Revoke token access + - Remove unused tokens + - Rotate credentials + + ### Examples + + - Delete token: + + Permanently revokes a token. + + ```yaml + personalAccessTokenId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -145,7 +180,23 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PatGetResponse: """ - GetPersonalAccessToken + Gets details about a specific personal access token. + + Use this method to: + + - View token metadata + - Check token expiration + - Monitor token usage + + ### Examples + + - Get token details: + + Retrieves information about a specific token. + + ```yaml + personalAccessTokenId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -201,7 +252,26 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[PersonalAccessToken, AsyncPersonalAccessTokensPage[PersonalAccessToken]]: """ - ListPersonalAccessTokens + Lists personal access tokens with optional filtering. + + Use this method to: + + - View all active tokens + - Audit token usage + - Manage token lifecycle + + ### Examples + + - List user tokens: + + Shows all tokens for specific users. + + ```yaml + filter: + userIds: ["f53d2330-3795-4c5d-a1f3-453121af9c60"] + pagination: + pageSize: 20 + ``` Args: extra_headers: Send extra headers @@ -251,7 +321,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeletePersonalAccessToken + Deletes a personal access token. + + Use this method to: + + - Revoke token access + - Remove unused tokens + - Rotate credentials + + ### Examples + + - Delete token: + + Permanently revokes a token. + + ```yaml + personalAccessTokenId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -285,7 +371,23 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PatGetResponse: """ - GetPersonalAccessToken + Gets details about a specific personal access token. + + Use this method to: + + - View token metadata + - Check token expiration + - Monitor token usage + + ### Examples + + - Get token details: + + Retrieves information about a specific token. + + ```yaml + personalAccessTokenId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index 03d30abf..ab3e3c97 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -68,7 +68,24 @@ def get_authenticated_user( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> UserGetAuthenticatedUserResponse: """ - GetAuthenticatedUser allows to retrieve the current user. + Gets information about the currently authenticated user. + + Use this method to: + + - Get user profile information + - Check authentication status + - Retrieve user settings + - Verify account details + + ### Examples + + - Get current user: + + Retrieves details about the authenticated user. + + ```yaml + {} + ``` Args: extra_headers: Send extra headers @@ -101,7 +118,33 @@ def set_suspended( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - SetSuspended sets the suspended state of the user. + Sets whether a user account is suspended. + + Use this method to: + + - Suspend problematic users + - Reactivate suspended accounts + - Manage user access + + ### Examples + + - Suspend user: + + Suspends a user account. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + suspended: true + ``` + + - Reactivate user: + + Removes suspension from a user account. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + suspended: false + ``` Args: extra_headers: Send extra headers @@ -164,7 +207,24 @@ async def get_authenticated_user( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> UserGetAuthenticatedUserResponse: """ - GetAuthenticatedUser allows to retrieve the current user. + Gets information about the currently authenticated user. + + Use this method to: + + - Get user profile information + - Check authentication status + - Retrieve user settings + - Verify account details + + ### Examples + + - Get current user: + + Retrieves details about the authenticated user. + + ```yaml + {} + ``` Args: extra_headers: Send extra headers @@ -199,7 +259,33 @@ async def set_suspended( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - SetSuspended sets the suspended state of the user. + Sets whether a user account is suspended. + + Use this method to: + + - Suspend problematic users + - Reactivate suspended accounts + - Manage user access + + ### Examples + + - Suspend user: + + Suspends a user account. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + suspended: true + ``` + + - Reactivate user: + + Removes suspension from a user account. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + suspended: false + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/types/environment.py b/src/gitpod/types/environment.py index 0be34ff2..5dd6728a 100644 --- a/src/gitpod/types/environment.py +++ b/src/gitpod/types/environment.py @@ -11,7 +11,7 @@ class Environment(BaseModel): - id: Optional[str] = None + id: str """ID is a unique identifier of this environment. No other environment with the same name must be managed by this environment diff --git a/src/gitpod/types/environments/automations/service.py b/src/gitpod/types/environments/automations/service.py index 337562b2..9dbb5aad 100644 --- a/src/gitpod/types/environments/automations/service.py +++ b/src/gitpod/types/environments/automations/service.py @@ -13,7 +13,7 @@ class Service(BaseModel): - id: Optional[str] = None + id: str environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py index 256e893d..261e0339 100644 --- a/src/gitpod/types/runner_capability.py +++ b/src/gitpod/types/runner_capability.py @@ -4,4 +4,8 @@ __all__ = ["RunnerCapability"] -RunnerCapability: TypeAlias = Literal["RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS"] +RunnerCapability: TypeAlias = Literal[ + "RUNNER_CAPABILITY_UNSPECIFIED", + "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS", + "RUNNER_CAPABILITY_SECRET_CONTAINER_REGISTRY", +] diff --git a/src/gitpod/types/runner_check_authentication_for_host_response.py b/src/gitpod/types/runner_check_authentication_for_host_response.py index fe73a2a0..273d871c 100644 --- a/src/gitpod/types/runner_check_authentication_for_host_response.py +++ b/src/gitpod/types/runner_check_authentication_for_host_response.py @@ -1,12 +1,37 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["RunnerCheckAuthenticationForHostResponse"] +__all__ = ["RunnerCheckAuthenticationForHostResponse", "SupportsOauth2", "SupportsPat"] + + +class SupportsOauth2(BaseModel): + auth_url: Optional[str] = FieldInfo(alias="authUrl", default=None) + """auth_url is the URL where users can authenticate""" + + docs_url: Optional[str] = FieldInfo(alias="docsUrl", default=None) + """docs_url is the URL to the documentation explaining this authentication method""" + + +class SupportsPat(BaseModel): + create_url: Optional[str] = FieldInfo(alias="createUrl", default=None) + """create_url is the URL where users can create a new Personal Access Token""" + + docs_url: Optional[str] = FieldInfo(alias="docsUrl", default=None) + """docs_url is the URL to the documentation explaining PAT usage for this host""" + + example: Optional[str] = None + """example is an example of a Personal Access Token""" + + required_scopes: Optional[List[str]] = FieldInfo(alias="requiredScopes", default=None) + """ + required_scopes is the list of permissions required for the Personal Access + Token + """ class RunnerCheckAuthenticationForHostResponse(BaseModel): @@ -17,3 +42,19 @@ class RunnerCheckAuthenticationForHostResponse(BaseModel): pat_supported: Optional[bool] = FieldInfo(alias="patSupported", default=None) scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + """scm_id is the unique identifier of the SCM provider""" + + scm_name: Optional[str] = FieldInfo(alias="scmName", default=None) + """ + scm_name is the human-readable name of the SCM provider (e.g., "GitHub", + "GitLab") + """ + + supports_oauth2: Optional[SupportsOauth2] = FieldInfo(alias="supportsOauth2", default=None) + """supports_oauth2 indicates that the host supports OAuth2 authentication""" + + supports_pat: Optional[SupportsPat] = FieldInfo(alias="supportsPat", default=None) + """ + supports_pat indicates that the host supports Personal Access Token + authentication + """ diff --git a/src/gitpod/types/shared/environment_class.py b/src/gitpod/types/shared/environment_class.py index 24f66bb6..2bc26214 100644 --- a/src/gitpod/types/shared/environment_class.py +++ b/src/gitpod/types/shared/environment_class.py @@ -11,7 +11,7 @@ class EnvironmentClass(BaseModel): - id: Optional[str] = None + id: str """id is the unique identifier of the environment class""" configuration: Optional[List[FieldValue]] = None diff --git a/src/gitpod/types/shared/task.py b/src/gitpod/types/shared/task.py index 95e85661..c45bfa6b 100644 --- a/src/gitpod/types/shared/task.py +++ b/src/gitpod/types/shared/task.py @@ -12,7 +12,7 @@ class Task(BaseModel): - id: Optional[str] = None + id: str depends_on: Optional[List[str]] = FieldInfo(alias="dependsOn", default=None) """dependencies specifies the IDs of the automations this task depends on.""" diff --git a/src/gitpod/types/shared_params/environment_class.py b/src/gitpod/types/shared_params/environment_class.py index 17e43a43..7493d543 100644 --- a/src/gitpod/types/shared_params/environment_class.py +++ b/src/gitpod/types/shared_params/environment_class.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo from .field_value import FieldValue @@ -12,7 +12,7 @@ class EnvironmentClass(TypedDict, total=False): - id: str + id: Required[str] """id is the unique identifier of the environment class""" configuration: Iterable[FieldValue] diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index 45ce2266..722a618e 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -31,7 +31,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @@ -71,13 +71,13 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], + "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED", "TASK_EXECUTION_PHASE_PENDING"], "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "task_references": ["string"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) @@ -114,7 +114,7 @@ def test_method_stop(self, client: Gitpod) -> None: @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, execution, path=["response"]) @@ -154,7 +154,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) @@ -196,13 +196,13 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED"], + "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED", "TASK_EXECUTION_PHASE_PENDING"], "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "task_references": ["string"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) @@ -239,7 +239,7 @@ async def test_method_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, execution, path=["response"]) diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 9c90a24c..ea60aba0 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -33,16 +33,16 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.create( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { "id": "id", "principal": "PRINCIPAL_UNSPECIFIED", }, - "description": "description", - "name": "x", - "reference": "reference", + "description": "Runs the development web server", + "name": "Web Server", + "reference": "web-server", "triggered_by": [ { "manual": True, @@ -53,8 +53,8 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: }, spec={ "commands": { - "ready": "ready", - "start": "x", + "ready": "curl -s http://localhost:3000", + "start": "npm run dev", "stop": "stop", }, "desired_phase": "SERVICE_PHASE_UNSPECIFIED", @@ -102,7 +102,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @@ -138,7 +138,7 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", metadata={ "description": "description", "name": "x", @@ -154,8 +154,8 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: }, spec={ "commands": { - "ready": "ready", - "start": "start", + "ready": "curl -s http://localhost:8080", + "start": "npm run start:dev", "stop": "stop", }, "runs_on": { @@ -210,12 +210,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], + "references": ["web-server", "database"], "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncServicesPage[Service], service, path=["response"]) @@ -252,8 +252,8 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - force=True, + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + force=False, ) assert_matches_type(object, service, path=["response"]) @@ -289,7 +289,7 @@ def test_method_start(self, client: Gitpod) -> None: @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.start( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, service, path=["response"]) @@ -325,7 +325,7 @@ def test_method_stop(self, client: Gitpod) -> None: @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.stop( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, service, path=["response"]) @@ -365,16 +365,16 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { "id": "id", "principal": "PRINCIPAL_UNSPECIFIED", }, - "description": "description", - "name": "x", - "reference": "reference", + "description": "Runs the development web server", + "name": "Web Server", + "reference": "web-server", "triggered_by": [ { "manual": True, @@ -385,8 +385,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> }, spec={ "commands": { - "ready": "ready", - "start": "x", + "ready": "curl -s http://localhost:3000", + "start": "npm run dev", "stop": "stop", }, "desired_phase": "SERVICE_PHASE_UNSPECIFIED", @@ -434,7 +434,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) @@ -470,7 +470,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", metadata={ "description": "description", "name": "x", @@ -486,8 +486,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> }, spec={ "commands": { - "ready": "ready", - "start": "start", + "ready": "curl -s http://localhost:8080", + "start": "npm run start:dev", "stop": "stop", }, "runs_on": { @@ -542,12 +542,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], + "references": ["web-server", "database"], "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) @@ -584,8 +584,8 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - force=True, + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + force=False, ) assert_matches_type(object, service, path=["response"]) @@ -621,7 +621,7 @@ async def test_method_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, service, path=["response"]) @@ -657,7 +657,7 @@ async def test_method_stop(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, service, path=["response"]) diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index adcf14f8..d9b63d44 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -35,16 +35,16 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create( depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { "id": "id", "principal": "PRINCIPAL_UNSPECIFIED", }, - "description": "description", - "name": "x", - "reference": "reference", + "description": "Builds the project artifacts", + "name": "Build Project", + "reference": "build", "triggered_by": [ { "manual": True, @@ -54,7 +54,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], }, spec={ - "command": "command", + "command": "npm run build", "runs_on": { "docker": { "environment": ["string"], @@ -97,7 +97,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -133,7 +133,7 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={ "description": "description", @@ -149,7 +149,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: }, }, spec={ - "command": "command", + "command": "npm run test:coverage", "runs_on": { "docker": { "environment": ["string"], @@ -196,12 +196,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], + "references": ["build", "test"], "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncTasksPage[Task], task, path=["response"]) @@ -238,7 +238,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, task, path=["response"]) @@ -274,7 +274,7 @@ def test_method_start(self, client: Gitpod) -> None: @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(TaskStartResponse, task, path=["response"]) @@ -315,16 +315,16 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create( depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { "id": "id", "principal": "PRINCIPAL_UNSPECIFIED", }, - "description": "description", - "name": "x", - "reference": "reference", + "description": "Builds the project artifacts", + "name": "Build Project", + "reference": "build", "triggered_by": [ { "manual": True, @@ -334,7 +334,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], }, spec={ - "command": "command", + "command": "npm run build", "runs_on": { "docker": { "environment": ["string"], @@ -377,7 +377,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) @@ -413,7 +413,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", depends_on=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={ "description": "description", @@ -429,7 +429,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> }, }, spec={ - "command": "command", + "command": "npm run test:coverage", "runs_on": { "docker": { "environment": ["string"], @@ -476,12 +476,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "references": ["x"], + "references": ["build", "test"], "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) @@ -518,7 +518,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, task, path=["response"]) @@ -554,7 +554,7 @@ async def test_method_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(TaskStartResponse, task, path=["response"]) diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index e4c8ffdb..52ebff82 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -29,14 +29,14 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: automation = client.environments.automations.upsert( automations_file={ "services": { - "foo": { + "web-server": { "commands": { - "ready": "ready", - "start": "x", + "ready": "curl -s http://localhost:3000", + "start": "npm run dev", "stop": "stop", }, - "description": "description", - "name": "x", + "description": "Development web server", + "name": "Web Server", "runs_on": { "docker": { "environment": ["string"], @@ -47,11 +47,11 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: } }, "tasks": { - "foo": { - "command": "x", + "build": { + "command": "npm run build", "depends_on": ["string"], - "description": "description", - "name": "x", + "description": "Builds the project artifacts", + "name": "Build Project", "runs_on": { "docker": { "environment": ["string"], @@ -62,7 +62,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: } }, }, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) @@ -104,14 +104,14 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> automation = await async_client.environments.automations.upsert( automations_file={ "services": { - "foo": { + "web-server": { "commands": { - "ready": "ready", - "start": "x", + "ready": "curl -s http://localhost:3000", + "start": "npm run dev", "stop": "stop", }, - "description": "description", - "name": "x", + "description": "Development web server", + "name": "Web Server", "runs_on": { "docker": { "environment": ["string"], @@ -122,11 +122,11 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> } }, "tasks": { - "foo": { - "command": "x", + "build": { + "command": "npm run build", "depends_on": ["string"], - "description": "description", - "name": "x", + "description": "Builds the project artifacts", + "name": "Build Project", "runs_on": { "docker": { "environment": ["string"], @@ -137,7 +137,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> } }, }, - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index c9f4d5a4..7aee8ed1 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -62,7 +62,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_delete(self, client: Gitpod) -> None: account = client.accounts.delete( - account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(object, account, path=["response"]) @@ -70,7 +70,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.delete( - account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert response.is_closed is True @@ -82,7 +82,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.delete( - account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -96,7 +96,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( - email="dev@stainlessapi.com", + email="user@company.com", ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -104,7 +104,7 @@ def test_method_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( - email="dev@stainlessapi.com", + email="user@company.com", return_to="https://example.com", ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -113,7 +113,7 @@ def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.get_sso_login_url( - email="dev@stainlessapi.com", + email="user@company.com", ) assert response.is_closed is True @@ -125,7 +125,7 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.get_sso_login_url( - email="dev@stainlessapi.com", + email="user@company.com", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -150,7 +150,7 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) @@ -221,7 +221,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete( - account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(object, account, path=["response"]) @@ -229,7 +229,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.delete( - account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert response.is_closed is True @@ -241,7 +241,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.delete( - account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -255,7 +255,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( - email="dev@stainlessapi.com", + email="user@company.com", ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -263,7 +263,7 @@ async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( - email="dev@stainlessapi.com", + email="user@company.com", return_to="https://example.com", ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) @@ -272,7 +272,7 @@ async def test_method_get_sso_login_url_with_all_params(self, async_client: Asyn @parametrize async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.get_sso_login_url( - email="dev@stainlessapi.com", + email="user@company.com", ) assert response.is_closed is True @@ -284,7 +284,7 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - @parametrize async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.get_sso_login_url( - email="dev@stainlessapi.com", + email="user@company.com", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -309,7 +309,7 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index c8aa5247..ecf58196 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -26,7 +26,7 @@ class TestEditors: @parametrize def test_method_retrieve(self, client: Gitpod) -> None: editor = client.editors.retrieve( - id="id", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @@ -34,7 +34,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.editors.with_raw_response.retrieve( - id="id", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -46,7 +46,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.editors.with_streaming_response.retrieve( - id="id", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -70,7 +70,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) @@ -101,9 +101,9 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_resolve_url(self, client: Gitpod) -> None: editor = client.editors.resolve_url( - editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) @@ -111,9 +111,9 @@ def test_method_resolve_url(self, client: Gitpod) -> None: @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: response = client.editors.with_raw_response.resolve_url( - editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -125,9 +125,9 @@ def test_raw_response_resolve_url(self, client: Gitpod) -> None: @parametrize def test_streaming_response_resolve_url(self, client: Gitpod) -> None: with client.editors.with_streaming_response.resolve_url( - editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -145,7 +145,7 @@ class TestAsyncEditors: @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( - id="id", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) @@ -153,7 +153,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.retrieve( - id="id", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert response.is_closed is True @@ -165,7 +165,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.retrieve( - id="id", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -189,7 +189,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) @@ -220,9 +220,9 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( - editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) @@ -230,9 +230,9 @@ async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.resolve_url( - editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert response.is_closed is True @@ -244,9 +244,9 @@ async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None @parametrize async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.resolve_url( - editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index 2991dc8d..46cfd41b 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -31,7 +31,7 @@ def test_method_exchange_token(self, client: Gitpod) -> None: @parametrize def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.exchange_token( - exchange_token="exchangeToken", + exchange_token="exchange-token-value", ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @@ -103,7 +103,7 @@ def test_method_get_id_token(self, client: Gitpod) -> None: @parametrize def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( - audience=["string"], + audience=["https://api.gitpod.io", "https://ws.gitpod.io"], ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @@ -143,7 +143,7 @@ async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token( - exchange_token="exchangeToken", + exchange_token="exchange-token-value", ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) @@ -215,7 +215,7 @@ async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( - audience=["string"], + audience=["https://api.gitpod.io", "https://ws.gitpod.io"], ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index dfe5cd1e..414aab03 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -35,9 +35,9 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: container_registry_basic_auth_host="https://example.com", environment_variable=True, file_path="filePath", - name="name", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - value="x", + name="DATABASE_URL", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + value="postgresql://user:pass@localhost:5432/db", ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -75,10 +75,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.list( token="token", page_size=0, - filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={"project_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"]}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) @@ -115,7 +115,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.delete( - secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + secret_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, secret, path=["response"]) @@ -151,7 +151,7 @@ def test_method_get_value(self, client: Gitpod) -> None: @parametrize def test_method_get_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.get_value( - secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + secret_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @@ -187,8 +187,8 @@ def test_method_update_value(self, client: Gitpod) -> None: @parametrize def test_method_update_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.update_value( - secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - value="x", + secret_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + value="new-secret-value", ) assert_matches_type(object, secret, path=["response"]) @@ -231,9 +231,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> container_registry_basic_auth_host="https://example.com", environment_variable=True, file_path="filePath", - name="name", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - value="x", + name="DATABASE_URL", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + value="postgresql://user:pass@localhost:5432/db", ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -271,10 +271,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N secret = await async_client.secrets.list( token="token", page_size=0, - filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={"project_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"]}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) @@ -311,7 +311,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete( - secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + secret_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, secret, path=["response"]) @@ -347,7 +347,7 @@ async def test_method_get_value(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value( - secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + secret_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) @@ -383,8 +383,8 @@ async def test_method_update_value(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value( - secret_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - value="x", + secret_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + value="new-secret-value", ) assert_matches_type(object, secret, path=["response"]) diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index f3707ef5..b5875362 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -63,8 +63,8 @@ def test_method_set_suspended(self, client: Gitpod) -> None: @parametrize def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: user = client.users.set_suspended( - suspended=True, - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + suspended=False, + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(object, user, path=["response"]) @@ -140,8 +140,8 @@ async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_set_suspended_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended( - suspended=True, - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + suspended=False, + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(object, user, path=["response"]) diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index bf3ea017..34611629 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -30,10 +30,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.list( token="token", page_size=0, - filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={"user_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"]}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) @@ -70,7 +70,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.delete( - personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + personal_access_token_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, pat, path=["response"]) @@ -106,7 +106,7 @@ def test_method_get(self, client: Gitpod) -> None: @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.get( - personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + personal_access_token_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PatGetResponse, pat, path=["response"]) @@ -148,10 +148,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N pat = await async_client.users.pats.list( token="token", page_size=0, - filter={"user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={"user_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"]}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) @@ -188,7 +188,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete( - personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + personal_access_token_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, pat, path=["response"]) @@ -224,7 +224,7 @@ async def test_method_get(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get( - personal_access_token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + personal_access_token_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PatGetResponse, pat, path=["response"]) From c1ecdd2d36e74874bcd4c779f66fc00be20674d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 08:57:05 +0000 Subject: [PATCH 115/505] chore(internal): version bump (#48) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4c5a1a01..a43290c3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.3" + ".": "0.1.4" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 62f87d71..8c9bd4bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.1.3" +version = "0.1.4" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index a4b0bd68..15402549 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.1.3" # x-release-please-version +__version__ = "0.1.4" # x-release-please-version From ff9a7ed14f46b008e510556726fddc4cb3c183fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:43:44 +0000 Subject: [PATCH 116/505] feat(api): manual updates (#49) --- .stats.yml | 2 +- .../environment_create_from_project_response.py | 3 +-- .../types/environment_create_logs_token_response.py | 3 +-- src/gitpod/types/environment_create_response.py | 3 +-- src/gitpod/types/environment_retrieve_response.py | 3 +-- .../automations/service_create_response.py | 3 +-- .../automations/service_retrieve_response.py | 3 +-- .../environments/automations/task_create_response.py | 3 +-- .../automations/task_retrieve_response.py | 3 +-- .../environments/automations/task_start_response.py | 3 +-- .../automations/tasks/execution_retrieve_response.py | 3 +-- src/gitpod/types/runner_create_response.py | 4 ++-- src/gitpod/types/runner_retrieve_response.py | 3 +-- .../configurations/host_authentication_token.py | 2 +- .../host_authentication_token_create_response.py | 3 +-- .../host_authentication_token_retrieve_response.py | 3 +-- src/gitpod/types/runners/policy_create_response.py | 3 +-- src/gitpod/types/runners/policy_update_response.py | 3 +-- src/gitpod/types/shared/environment_class.py | 12 ++++++------ src/gitpod/types/shared/task_execution.py | 2 +- src/gitpod/types/shared_params/environment_class.py | 12 ++++++------ .../types/user_get_authenticated_user_response.py | 3 +-- src/gitpod/types/users/pat_get_response.py | 3 +-- tests/api_resources/runners/test_configurations.py | 4 ++-- 24 files changed, 36 insertions(+), 53 deletions(-) diff --git a/.stats.yml b/.stats.yml index 296014eb..8371fbe4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f6598ab5d6827f66b642201769e92590ea32af84ebbf24b18cc32b33dee5107e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-410f762771ac58738f3d165b19c5e2e9377ebbfa3f090f041e269142cfa2e7f4.yml diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index 55275c10..7c668704 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .._models import BaseModel from .environment import Environment @@ -9,5 +8,5 @@ class EnvironmentCreateFromProjectResponse(BaseModel): - environment: Optional[Environment] = None + environment: Environment """+resource get environment""" diff --git a/src/gitpod/types/environment_create_logs_token_response.py b/src/gitpod/types/environment_create_logs_token_response.py index fb1aca3b..70f9c6ac 100644 --- a/src/gitpod/types/environment_create_logs_token_response.py +++ b/src/gitpod/types/environment_create_logs_token_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -10,7 +9,7 @@ class EnvironmentCreateLogsTokenResponse(BaseModel): - access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) + access_token: str = FieldInfo(alias="accessToken") """ access_token is the token that can be used to access the logs of the environment """ diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index 3fb02bb9..ac25a62c 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .._models import BaseModel from .environment import Environment @@ -9,5 +8,5 @@ class EnvironmentCreateResponse(BaseModel): - environment: Optional[Environment] = None + environment: Environment """+resource get environment""" diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index 1c55b33c..0a3963b2 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .._models import BaseModel from .environment import Environment @@ -9,5 +8,5 @@ class EnvironmentRetrieveResponse(BaseModel): - environment: Optional[Environment] = None + environment: Environment """+resource get environment""" diff --git a/src/gitpod/types/environments/automations/service_create_response.py b/src/gitpod/types/environments/automations/service_create_response.py index 1242a11b..79ceb843 100644 --- a/src/gitpod/types/environments/automations/service_create_response.py +++ b/src/gitpod/types/environments/automations/service_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .service import Service from ...._models import BaseModel @@ -9,4 +8,4 @@ class ServiceCreateResponse(BaseModel): - service: Optional[Service] = None + service: Service diff --git a/src/gitpod/types/environments/automations/service_retrieve_response.py b/src/gitpod/types/environments/automations/service_retrieve_response.py index e916c007..ecf90357 100644 --- a/src/gitpod/types/environments/automations/service_retrieve_response.py +++ b/src/gitpod/types/environments/automations/service_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .service import Service from ...._models import BaseModel @@ -9,4 +8,4 @@ class ServiceRetrieveResponse(BaseModel): - service: Optional[Service] = None + service: Service diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index 4845e6be..5fbdae6d 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ...._models import BaseModel from ...shared.task import Task @@ -9,4 +8,4 @@ class TaskCreateResponse(BaseModel): - task: Optional[Task] = None + task: Task diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index 0f01e7bb..e65439b4 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ...._models import BaseModel from ...shared.task import Task @@ -9,4 +8,4 @@ class TaskRetrieveResponse(BaseModel): - task: Optional[Task] = None + task: Task diff --git a/src/gitpod/types/environments/automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py index 3b7caf23..93ee3707 100644 --- a/src/gitpod/types/environments/automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -11,4 +10,4 @@ class TaskStartResponse(BaseModel): - task_execution: Optional[TaskExecution] = FieldInfo(alias="taskExecution", default=None) + task_execution: TaskExecution = FieldInfo(alias="taskExecution") diff --git a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py index 40f3dc48..58c5baae 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -11,4 +10,4 @@ class ExecutionRetrieveResponse(BaseModel): - task_execution: Optional[TaskExecution] = FieldInfo(alias="taskExecution", default=None) + task_execution: TaskExecution = FieldInfo(alias="taskExecution") diff --git a/src/gitpod/types/runner_create_response.py b/src/gitpod/types/runner_create_response.py index 7a2bbd47..2f6821f7 100644 --- a/src/gitpod/types/runner_create_response.py +++ b/src/gitpod/types/runner_create_response.py @@ -11,6 +11,8 @@ class RunnerCreateResponse(BaseModel): + runner: Runner + access_token: Optional[str] = FieldInfo(alias="accessToken", default=None) """deprecated, will be removed. Use exchange_token instead.""" @@ -20,5 +22,3 @@ class RunnerCreateResponse(BaseModel): for an access token, using the IdentityService.ExchangeToken rpc. The token expires after 24 hours. """ - - runner: Optional[Runner] = None diff --git a/src/gitpod/types/runner_retrieve_response.py b/src/gitpod/types/runner_retrieve_response.py index 6877822c..1bda9f37 100644 --- a/src/gitpod/types/runner_retrieve_response.py +++ b/src/gitpod/types/runner_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .runner import Runner from .._models import BaseModel @@ -9,4 +8,4 @@ class RunnerRetrieveResponse(BaseModel): - runner: Optional[Runner] = None + runner: Runner diff --git a/src/gitpod/types/runners/configurations/host_authentication_token.py b/src/gitpod/types/runners/configurations/host_authentication_token.py index 6ebf74ad..22e57609 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token.py @@ -12,7 +12,7 @@ class HostAuthenticationToken(BaseModel): - id: Optional[str] = None + id: str expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) """ diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py index b351bfea..3d9900d3 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ...._models import BaseModel from .host_authentication_token import HostAuthenticationToken @@ -9,4 +8,4 @@ class HostAuthenticationTokenCreateResponse(BaseModel): - token: Optional[HostAuthenticationToken] = None + token: HostAuthenticationToken diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py index 50e478b1..4f348a01 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ...._models import BaseModel from .host_authentication_token import HostAuthenticationToken @@ -9,4 +8,4 @@ class HostAuthenticationTokenRetrieveResponse(BaseModel): - token: Optional[HostAuthenticationToken] = None + token: HostAuthenticationToken diff --git a/src/gitpod/types/runners/policy_create_response.py b/src/gitpod/types/runners/policy_create_response.py index 0520b58e..d97d8e13 100644 --- a/src/gitpod/types/runners/policy_create_response.py +++ b/src/gitpod/types/runners/policy_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ..._models import BaseModel from .runner_policy import RunnerPolicy @@ -9,4 +8,4 @@ class PolicyCreateResponse(BaseModel): - policy: Optional[RunnerPolicy] = None + policy: RunnerPolicy diff --git a/src/gitpod/types/runners/policy_update_response.py b/src/gitpod/types/runners/policy_update_response.py index b5c96d6b..5f441dc6 100644 --- a/src/gitpod/types/runners/policy_update_response.py +++ b/src/gitpod/types/runners/policy_update_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ..._models import BaseModel from .runner_policy import RunnerPolicy @@ -9,4 +8,4 @@ class PolicyUpdateResponse(BaseModel): - policy: Optional[RunnerPolicy] = None + policy: RunnerPolicy diff --git a/src/gitpod/types/shared/environment_class.py b/src/gitpod/types/shared/environment_class.py index 2bc26214..7539415c 100644 --- a/src/gitpod/types/shared/environment_class.py +++ b/src/gitpod/types/shared/environment_class.py @@ -14,6 +14,12 @@ class EnvironmentClass(BaseModel): id: str """id is the unique identifier of the environment class""" + runner_id: str = FieldInfo(alias="runnerId") + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ + configuration: Optional[List[FieldValue]] = None """configuration describes the configuration of the environment class""" @@ -28,9 +34,3 @@ class EnvironmentClass(BaseModel): enabled indicates whether the environment class can be used to create new environments. """ - - runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """ - runner_id is the unique identifier of the runner the environment class belongs - to - """ diff --git a/src/gitpod/types/shared/task_execution.py b/src/gitpod/types/shared/task_execution.py index 072f66cb..3274176d 100644 --- a/src/gitpod/types/shared/task_execution.py +++ b/src/gitpod/types/shared/task_execution.py @@ -11,7 +11,7 @@ class TaskExecution(BaseModel): - id: Optional[str] = None + id: str metadata: Optional[TaskExecutionMetadata] = None diff --git a/src/gitpod/types/shared_params/environment_class.py b/src/gitpod/types/shared_params/environment_class.py index 7493d543..b310694a 100644 --- a/src/gitpod/types/shared_params/environment_class.py +++ b/src/gitpod/types/shared_params/environment_class.py @@ -15,6 +15,12 @@ class EnvironmentClass(TypedDict, total=False): id: Required[str] """id is the unique identifier of the environment class""" + runner_id: Required[Annotated[str, PropertyInfo(alias="runnerId")]] + """ + runner_id is the unique identifier of the runner the environment class belongs + to + """ + configuration: Iterable[FieldValue] """configuration describes the configuration of the environment class""" @@ -29,9 +35,3 @@ class EnvironmentClass(TypedDict, total=False): enabled indicates whether the environment class can be used to create new environments. """ - - runner_id: Annotated[str, PropertyInfo(alias="runnerId")] - """ - runner_id is the unique identifier of the runner the environment class belongs - to - """ diff --git a/src/gitpod/types/user_get_authenticated_user_response.py b/src/gitpod/types/user_get_authenticated_user_response.py index 7760c4ab..d4e06c6b 100644 --- a/src/gitpod/types/user_get_authenticated_user_response.py +++ b/src/gitpod/types/user_get_authenticated_user_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .user import User from .._models import BaseModel @@ -9,4 +8,4 @@ class UserGetAuthenticatedUserResponse(BaseModel): - user: Optional[User] = None + user: User diff --git a/src/gitpod/types/users/pat_get_response.py b/src/gitpod/types/users/pat_get_response.py index 6be85d53..54933a4c 100644 --- a/src/gitpod/types/users/pat_get_response.py +++ b/src/gitpod/types/users/pat_get_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ..._models import BaseModel from .personal_access_token import PersonalAccessToken @@ -9,4 +8,4 @@ class PatGetResponse(BaseModel): - pat: Optional[PersonalAccessToken] = None + pat: PersonalAccessToken diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index e917ea87..7184caf4 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -29,6 +29,7 @@ def test_method_validate_with_all_params(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( environment_class={ "id": "id", + "runner_id": "runnerId", "configuration": [ { "key": "key", @@ -38,7 +39,6 @@ def test_method_validate_with_all_params(self, client: Gitpod) -> None: "description": "xxx", "display_name": "xxx", "enabled": True, - "runner_id": "runnerId", }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", scm_integration={ @@ -91,6 +91,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) configuration = await async_client.runners.configurations.validate( environment_class={ "id": "id", + "runner_id": "runnerId", "configuration": [ { "key": "key", @@ -100,7 +101,6 @@ async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) "description": "xxx", "display_name": "xxx", "enabled": True, - "runner_id": "runnerId", }, runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", scm_integration={ From c9dd4041c22fe0d7dce89b65b295d8d72f827e19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:50:24 +0000 Subject: [PATCH 117/505] chore(internal): version bump (#51) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a43290c3..ab67d0fc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.4" + ".": "0.1.5" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8c9bd4bf..ace9425d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.1.4" +version = "0.1.5" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 15402549..057cab27 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.1.4" # x-release-please-version +__version__ = "0.1.5" # x-release-please-version From 1fc1fc1c431f32b882fdd2f1a65f1793fbf83afa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:48:00 +0000 Subject: [PATCH 118/505] feat(api): manual updates (#52) --- .stats.yml | 2 +- src/gitpod/types/environment_spec.py | 23 ++++++++++++++++++++ src/gitpod/types/environment_spec_param.py | 25 +++++++++++++++++++++- src/gitpod/types/user.py | 2 +- tests/api_resources/test_environments.py | 20 +++++++++++++++++ 5 files changed, 69 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8371fbe4..21d6a3d9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-410f762771ac58738f3d165b19c5e2e9377ebbfa3f090f041e269142cfa2e7f4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bef0e79f204c51c91f5dca61e621e5e31c7494dccccb200e51da0c7654340816.yml diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index d65c166f..b001bdca 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -14,6 +14,7 @@ "AutomationsFile", "Content", "Devcontainer", + "DevcontainerDotfiles", "Machine", "Port", "Secret", @@ -50,6 +51,25 @@ class Content(BaseModel): session: Optional[str] = None +class DevcontainerDotfiles(BaseModel): + repository: str + """URL of a dotfiles Git repository (e.g. https://github.com/owner/repository)""" + + install_command: Optional[str] = FieldInfo(alias="installCommand", default=None) + """install_command is the command to run after cloning the dotfiles repository. + + Defaults to run the first file of `install.sh`, `install`, `bootstrap.sh`, + `bootstrap`, `setup.sh` and `setup` found in the dotfiles repository's root + folder. + """ + + target_path: Optional[str] = FieldInfo(alias="targetPath", default=None) + """target_path is the path to clone the dotfiles repository to. + + Defaults to `~/dotfiles`. + """ + + class Devcontainer(BaseModel): devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ @@ -61,6 +81,9 @@ class Devcontainer(BaseModel): ``` """ + dotfiles: Optional[DevcontainerDotfiles] = None + """Experimental: dotfiles is the dotfiles configuration of the devcontainer""" + session: Optional[str] = None diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index cad8f657..4853ee89 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo from .admission_level import AdmissionLevel @@ -15,6 +15,7 @@ "AutomationsFile", "Content", "Devcontainer", + "DevcontainerDotfiles", "Machine", "Port", "Secret", @@ -51,6 +52,25 @@ class Content(TypedDict, total=False): session: str +class DevcontainerDotfiles(TypedDict, total=False): + repository: Required[str] + """URL of a dotfiles Git repository (e.g. https://github.com/owner/repository)""" + + install_command: Annotated[str, PropertyInfo(alias="installCommand")] + """install_command is the command to run after cloning the dotfiles repository. + + Defaults to run the first file of `install.sh`, `install`, `bootstrap.sh`, + `bootstrap`, `setup.sh` and `setup` found in the dotfiles repository's root + folder. + """ + + target_path: Annotated[str, PropertyInfo(alias="targetPath")] + """target_path is the path to clone the dotfiles repository to. + + Defaults to `~/dotfiles`. + """ + + class Devcontainer(TypedDict, total=False): devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] """ @@ -62,6 +82,9 @@ class Devcontainer(TypedDict, total=False): ``` """ + dotfiles: DevcontainerDotfiles + """Experimental: dotfiles is the dotfiles configuration of the devcontainer""" + session: str diff --git a/src/gitpod/types/user.py b/src/gitpod/types/user.py index 47c3be90..f6c16cb1 100644 --- a/src/gitpod/types/user.py +++ b/src/gitpod/types/user.py @@ -12,7 +12,7 @@ class User(BaseModel): - id: Optional[str] = None + id: str """id is a UUID of the user""" avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 3441d9f1..9733680e 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -63,6 +63,11 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { "devcontainer_file_path": "devcontainerFilePath", + "dotfiles": { + "repository": "https://example.com", + "install_command": "installCommand", + "target_path": "targetPath", + }, "session": "session", }, "machine": { @@ -360,6 +365,11 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { "devcontainer_file_path": "devcontainerFilePath", + "dotfiles": { + "repository": "https://example.com", + "install_command": "installCommand", + "target_path": "targetPath", + }, "session": "session", }, "machine": { @@ -609,6 +619,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { "devcontainer_file_path": "devcontainerFilePath", + "dotfiles": { + "repository": "https://example.com", + "install_command": "installCommand", + "target_path": "targetPath", + }, "session": "session", }, "machine": { @@ -906,6 +921,11 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { "devcontainer_file_path": "devcontainerFilePath", + "dotfiles": { + "repository": "https://example.com", + "install_command": "installCommand", + "target_path": "targetPath", + }, "session": "session", }, "machine": { From ff3ec188a7a7ed40578732ff7a1f57b37364906f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:01:45 +0000 Subject: [PATCH 119/505] chore(internal): version bump (#54) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ab67d0fc..ce447946 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.5" + ".": "0.1.6" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ace9425d..d05b380b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.1.5" +version = "0.1.6" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 057cab27..87028589 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.1.5" # x-release-please-version +__version__ = "0.1.6" # x-release-please-version From dc4e69f3435769d7026461cc751a1dbefa1ab548 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:15:24 +0000 Subject: [PATCH 120/505] chore(internal): version bump (#56) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ce447946..10f30916 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.6" + ".": "0.2.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d05b380b..bceeb3f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.1.6" +version = "0.2.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 87028589..6f1178f9 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.1.6" # x-release-please-version +__version__ = "0.2.0" # x-release-please-version From f3c4bd40a881e7d4f23a6e6f12e8c80f4ba4e61a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:00:47 +0000 Subject: [PATCH 121/505] feat(api): manual updates (#57) --- .stats.yml | 2 +- api.md | 1 - src/gitpod/_exceptions.py | 8 -------- src/gitpod/types/__init__.py | 1 - src/gitpod/types/shared/__init__.py | 1 - src/gitpod/types/shared/arbitrary_data.py | 21 --------------------- 6 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 src/gitpod/types/shared/arbitrary_data.py diff --git a/.stats.yml b/.stats.yml index 21d6a3d9..f08fd6b4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bef0e79f204c51c91f5dca61e621e5e31c7494dccccb200e51da0c7654340816.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cd6a05ae99d2a050577fa0e729e6ae89b4eacd78f61366a77269398368f8a877.yml diff --git a/api.md b/api.md index cc2d93c7..e0c317e1 100644 --- a/api.md +++ b/api.md @@ -2,7 +2,6 @@ ```python from gitpod.types import ( - ArbitraryData, AutomationTrigger, EnvironmentClass, ErrorCode, diff --git a/src/gitpod/_exceptions.py b/src/gitpod/_exceptions.py index a880564a..bb138a90 100644 --- a/src/gitpod/_exceptions.py +++ b/src/gitpod/_exceptions.py @@ -10,7 +10,6 @@ from ._utils import is_dict from ._models import construct_type from .types.shared.error_code import ErrorCode -from .types.shared.arbitrary_data import ArbitraryData __all__ = [ "BadRequestError", @@ -48,11 +47,6 @@ class APIError(GitpodError): The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. """ - detail: Optional[ArbitraryData] = None - """ - Contains an arbitrary serialized message along with a @type that describes the - type of the serialized message. - """ def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: super().__init__(message) @@ -62,10 +56,8 @@ def __init__(self, message: str, request: httpx.Request, *, body: object | None) if is_dict(body): self.code = cast(Any, construct_type(type_=Optional[ErrorCode], value=body.get("code"))) - self.detail = cast(Any, construct_type(type_=Optional[ArbitraryData], value=body.get("detail"))) else: self.code = None - self.detail = None class APIResponseValidationError(APIError): diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 2b8a052a..49ac2a0f 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -18,7 +18,6 @@ FieldValue as FieldValue, UserStatus as UserStatus, TaskMetadata as TaskMetadata, - ArbitraryData as ArbitraryData, TaskExecution as TaskExecution, EnvironmentClass as EnvironmentClass, OrganizationRole as OrganizationRole, diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index b4616dc9..f4f37882 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -9,7 +9,6 @@ from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus from .task_metadata import TaskMetadata as TaskMetadata -from .arbitrary_data import ArbitraryData as ArbitraryData from .task_execution import TaskExecution as TaskExecution from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole diff --git a/src/gitpod/types/shared/arbitrary_data.py b/src/gitpod/types/shared/arbitrary_data.py deleted file mode 100644 index de1ead23..00000000 --- a/src/gitpod/types/shared/arbitrary_data.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import TYPE_CHECKING, Dict, Optional - -from ..._models import BaseModel - -__all__ = ["ArbitraryData"] - - -class ArbitraryData(BaseModel): - debug: Optional[Dict[str, object]] = None - - type: Optional[str] = None - - value: Optional[object] = None - - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... From 39f7c34ffcba23096a7157be2aeec80b599e32cb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:08:28 +0000 Subject: [PATCH 122/505] chore(internal): version bump (#59) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 10f30916..b06ba919 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.0" + ".": "0.2.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index bceeb3f1..fca555e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.2.0" +version = "0.2.1" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 6f1178f9..c48ae7ae 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.2.0" # x-release-please-version +__version__ = "0.2.1" # x-release-please-version From 0058f91c7bb3b1c32c6b56a8afea900bd66f77dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 09:33:12 +0000 Subject: [PATCH 123/505] feat(api): manual updates (#61) --- .stats.yml | 2 +- src/gitpod/resources/events.py | 92 +++- src/gitpod/resources/groups.py | 60 ++- src/gitpod/resources/projects/policies.py | 158 ++++++- src/gitpod/resources/projects/projects.py | 290 +++++++++++- .../runners/configurations/configurations.py | 52 ++- .../configurations/environment_classes.py | 194 +++++++- .../host_authentication_tokens.py | 222 ++++++++- .../runners/configurations/schema.py | 36 +- .../configurations/scm_integrations.py | 198 +++++++- src/gitpod/resources/runners/policies.py | 158 ++++++- src/gitpod/resources/runners/runners.py | 422 +++++++++++++++--- tests/api_resources/projects/test_policies.py | 32 +- .../test_environment_classes.py | 52 ++- .../test_host_authentication_tokens.py | 56 +-- .../runners/configurations/test_schema.py | 4 +- .../configurations/test_scm_integrations.py | 48 +- .../runners/test_configurations.py | 24 +- tests/api_resources/runners/test_policies.py | 32 +- tests/api_resources/test_events.py | 8 +- tests/api_resources/test_groups.py | 4 +- tests/api_resources/test_projects.py | 40 +- tests/api_resources/test_runners.py | 40 +- 23 files changed, 1933 insertions(+), 291 deletions(-) diff --git a/.stats.yml b/.stats.yml index f08fd6b4..27a7d826 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cd6a05ae99d2a050577fa0e729e6ae89b4eacd78f61366a77269398368f8a877.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d6a243325df36817d495ce6dd54f80766b77a97e1ca2f6d371c0a68b7d070e0f.yml diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index 8a7ebdda..f5de7cf1 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -62,8 +62,32 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncEntriesPage[EventListResponse]: """ - ListAuditLogs retrieves a paginated list of audit logs for the specified - organization + Lists audit logs with filtering and pagination options. + + Use this method to: + + - View audit history + - Track user actions + - Monitor system changes + + ### Examples + + - List all logs: + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by actor: + + ```yaml + filter: + actorIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + actorPrincipals: ["PRINCIPAL_USER"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -116,7 +140,23 @@ def watch( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> JSONLDecoder[EventWatchResponse]: """ - WatchEvents streams all requests events to the client + Streams events for all projects, runners, environments, tasks, and services + based on the specified scope. + + Use this method to: + + - Monitor resource changes in real-time + - Track system events + - Receive notifications + + The scope parameter determines which events to watch: + + - Organization scope (default): Watch all organization-wide events including + projects, runners and environments. Task and service events are not included. + Use by setting organization=true or omitting the scope. + - Environment scope: Watch events for a specific environment, including its + tasks, task executions, and services. Use by setting environment_id to the + UUID of the environment to watch. Args: environment_id: Environment scope produces events for the environment itself, all tasks, task @@ -187,8 +227,32 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[EventListResponse, AsyncEntriesPage[EventListResponse]]: """ - ListAuditLogs retrieves a paginated list of audit logs for the specified - organization + Lists audit logs with filtering and pagination options. + + Use this method to: + + - View audit history + - Track user actions + - Monitor system changes + + ### Examples + + - List all logs: + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by actor: + + ```yaml + filter: + actorIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + actorPrincipals: ["PRINCIPAL_USER"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -241,7 +305,23 @@ async def watch( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncJSONLDecoder[EventWatchResponse]: """ - WatchEvents streams all requests events to the client + Streams events for all projects, runners, environments, tasks, and services + based on the specified scope. + + Use this method to: + + - Monitor resource changes in real-time + - Track system events + - Receive notifications + + The scope parameter determines which events to watch: + + - Organization scope (default): Watch all organization-wide events including + projects, runners and environments. Task and service events are not included. + Use by setting organization=true or omitting the scope. + - Environment scope: Watch events for a specific environment, including its + tasks, task executions, and services. Use by setting environment_id to the + UUID of the environment to watch. Args: environment_id: Environment scope produces events for the environment itself, all tasks, task diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py index 233e4b08..56c681f2 100644 --- a/src/gitpod/resources/groups.py +++ b/src/gitpod/resources/groups.py @@ -56,7 +56,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncGroupsPage[Group]: """ - ListGroups lists groups + Lists groups with optional pagination. + + Use this method to: + + - View all groups + - Check group memberships + - Monitor group configurations + - Audit group access + + ### Examples + + - List all groups: + + Shows all groups with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List with custom page size: + + Shows groups with specified page size. + + ```yaml + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` Args: pagination: pagination contains the pagination options for listing groups @@ -125,7 +153,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Group, AsyncGroupsPage[Group]]: """ - ListGroups lists groups + Lists groups with optional pagination. + + Use this method to: + + - View all groups + - Check group memberships + - Monitor group configurations + - Audit group access + + ### Examples + + - List all groups: + + Shows all groups with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List with custom page size: + + Shows groups with specified page size. + + ```yaml + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` Args: pagination: pagination contains the pagination options for listing groups diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index ffac1625..5ca918c7 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -68,7 +68,25 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyCreateResponse: """ - CreateProjectPolicy creates a Project Policy. + Creates a new policy for a project. + + Use this method to: + + - Set up access controls + - Define group permissions + - Configure role-based access + + ### Examples + + - Create admin policy: + + Grants admin access to a group. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: PROJECT_ROLE_ADMIN + ``` Args: group_id: group_id specifies the group_id identifier @@ -113,7 +131,25 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyUpdateResponse: """ - UpdateProjectPolicy updates a Project Policy. + Updates an existing project policy. + + Use this method to: + + - Modify access levels + - Change group roles + - Update permissions + + ### Examples + + - Update policy role: + + Changes a group's access level. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: PROJECT_ROLE_EDITOR + ``` Args: group_id: group_id specifies the group_id identifier @@ -159,7 +195,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncPoliciesPage[ProjectPolicy]: """ - ListProjectPolicies lists policies for a project. + Lists policies for a project. + + Use this method to: + + - View access controls + - Check policy configurations + - Audit permissions + + ### Examples + + - List policies: + + Shows all policies for a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing project policies @@ -214,7 +268,24 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteProjectPolicy deletes a Project Policy. + Deletes a project policy. + + Use this method to: + + - Remove access controls + - Revoke permissions + - Clean up policies + + ### Examples + + - Delete policy: + + Removes a group's access policy. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: group_id: group_id specifies the group_id identifier @@ -279,7 +350,25 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyCreateResponse: """ - CreateProjectPolicy creates a Project Policy. + Creates a new policy for a project. + + Use this method to: + + - Set up access controls + - Define group permissions + - Configure role-based access + + ### Examples + + - Create admin policy: + + Grants admin access to a group. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: PROJECT_ROLE_ADMIN + ``` Args: group_id: group_id specifies the group_id identifier @@ -324,7 +413,25 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyUpdateResponse: """ - UpdateProjectPolicy updates a Project Policy. + Updates an existing project policy. + + Use this method to: + + - Modify access levels + - Change group roles + - Update permissions + + ### Examples + + - Update policy role: + + Changes a group's access level. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: PROJECT_ROLE_EDITOR + ``` Args: group_id: group_id specifies the group_id identifier @@ -370,7 +477,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[ProjectPolicy, AsyncPoliciesPage[ProjectPolicy]]: """ - ListProjectPolicies lists policies for a project. + Lists policies for a project. + + Use this method to: + + - View access controls + - Check policy configurations + - Audit permissions + + ### Examples + + - List policies: + + Shows all policies for a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing project policies @@ -425,7 +550,24 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteProjectPolicy deletes a Project Policy. + Deletes a project policy. + + Use this method to: + + - Remove access controls + - Revoke permissions + - Clean up policies + + ### Examples + + - Delete policy: + + Removes a group's access policy. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: group_id: group_id specifies the group_id identifier diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index b3cd1461..47ddd964 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -88,7 +88,46 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectCreateResponse: """ - CreateProject creates a new Project. + Creates a new project with specified configuration. + + Use this method to: + + - Set up development projects + - Configure project environments + - Define project settings + - Initialize project content + + ### Examples + + - Create basic project: + + Creates a project with minimal configuration. + + ```yaml + name: "Web Application" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/repo" + ``` + + - Create project with devcontainer: + + Creates a project with custom development container. + + ```yaml + name: "Backend Service" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/backend" + devcontainerFilePath: ".devcontainer/devcontainer.json" + automationsFilePath: ".gitpod/automations.yaml" + ``` Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized @@ -145,7 +184,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectRetrieveResponse: """ - GetProject retrieves a single Project. + Gets details about a specific project. + + Use this method to: + + - View project configuration + - Check project status + - Get project metadata + + ### Examples + + - Get project details: + + Retrieves information about a specific project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: project_id: project_id specifies the project identifier @@ -184,7 +239,35 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectUpdateResponse: """ - UpdateProject updates the properties of a Project. + Updates a project's configuration. + + Use this method to: + + - Modify project settings + - Update environment class + - Change project name + - Configure initializers + + ### Examples + + - Update project name: + + Changes the project's display name. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "New Project Name" + ``` + + - Update environment class: + + Changes the project's environment class. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: automations_file_path: automations_file_path is the path to the automations file relative to the repo @@ -246,7 +329,24 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncProjectsPage[Project]: """ - ListProjects lists all projects the caller has access to. + Lists projects with optional filtering. + + Use this method to: + + - View all accessible projects + - Browse project configurations + - Monitor project status + + ### Examples + + - List projects: + + Shows all projects with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing organizations @@ -292,7 +392,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteProject deletes the specified project. + Deletes a project permanently. + + Use this method to: + + - Remove unused projects + - Clean up test projects + - Delete obsolete configurations + + ### Examples + + - Delete project: + + Permanently removes a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: project_id: project_id specifies the project identifier @@ -327,7 +443,24 @@ def create_from_environment( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectCreateFromEnvironmentResponse: """ - CreateProject creates a new Project using an environment as template. + Creates a new project using an existing environment as a template. + + Use this method to: + + - Clone environment configurations + - Create projects from templates + - Share environment setups + + ### Examples + + - Create from environment: + + Creates a project based on existing environment. + + ```yaml + name: "Frontend Project" + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies the environment identifier @@ -396,7 +529,46 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectCreateResponse: """ - CreateProject creates a new Project. + Creates a new project with specified configuration. + + Use this method to: + + - Set up development projects + - Configure project environments + - Define project settings + - Initialize project content + + ### Examples + + - Create basic project: + + Creates a project with minimal configuration. + + ```yaml + name: "Web Application" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/repo" + ``` + + - Create project with devcontainer: + + Creates a project with custom development container. + + ```yaml + name: "Backend Service" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/backend" + devcontainerFilePath: ".devcontainer/devcontainer.json" + automationsFilePath: ".gitpod/automations.yaml" + ``` Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized @@ -453,7 +625,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectRetrieveResponse: """ - GetProject retrieves a single Project. + Gets details about a specific project. + + Use this method to: + + - View project configuration + - Check project status + - Get project metadata + + ### Examples + + - Get project details: + + Retrieves information about a specific project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: project_id: project_id specifies the project identifier @@ -492,7 +680,35 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectUpdateResponse: """ - UpdateProject updates the properties of a Project. + Updates a project's configuration. + + Use this method to: + + - Modify project settings + - Update environment class + - Change project name + - Configure initializers + + ### Examples + + - Update project name: + + Changes the project's display name. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "New Project Name" + ``` + + - Update environment class: + + Changes the project's environment class. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: automations_file_path: automations_file_path is the path to the automations file relative to the repo @@ -554,7 +770,24 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Project, AsyncProjectsPage[Project]]: """ - ListProjects lists all projects the caller has access to. + Lists projects with optional filtering. + + Use this method to: + + - View all accessible projects + - Browse project configurations + - Monitor project status + + ### Examples + + - List projects: + + Shows all projects with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing organizations @@ -600,7 +833,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteProject deletes the specified project. + Deletes a project permanently. + + Use this method to: + + - Remove unused projects + - Clean up test projects + - Delete obsolete configurations + + ### Examples + + - Delete project: + + Permanently removes a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: project_id: project_id specifies the project identifier @@ -635,7 +884,24 @@ async def create_from_environment( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectCreateFromEnvironmentResponse: """ - CreateProject creates a new Project using an environment as template. + Creates a new project using an existing environment as a template. + + Use this method to: + + - Clone environment configurations + - Create projects from templates + - Share environment setups + + ### Examples + + - Create from environment: + + Creates a project based on existing environment. + + ```yaml + name: "Frontend Project" + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies the environment identifier diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index 135c7883..97459924 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -106,10 +106,30 @@ def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. + """ + Validates a runner configuration. + + Use this method to: + + - Check configuration validity + - Verify integration settings + - Validate environment classes + + ### Examples + + - Validate SCM integration: + + Checks if an SCM integration is valid. - environment - class, SCM integration) with the runner. + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmIntegration: + id: "integration-id" + scmId: "github" + host: "github.com" + oauthClientId: "client_id" + oauthPlaintextClientSecret: "client_secret" + ``` Args: extra_headers: Send extra headers @@ -186,10 +206,30 @@ async def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. + """ + Validates a runner configuration. + + Use this method to: + + - Check configuration validity + - Verify integration settings + - Validate environment classes + + ### Examples + + - Validate SCM integration: + + Checks if an SCM integration is valid. - environment - class, SCM integration) with the runner. + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmIntegration: + id: "integration-id" + scmId: "github" + host: "github.com" + oauthClientId: "client_id" + oauthPlaintextClientSecret: "client_secret" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index e790fe78..d9df2a5c 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -70,7 +70,30 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentClassCreateResponse: """ - CreateEnvironmentClass creates a new environment class on a runner. + Creates a new environment class for a runner. + + Use this method to: + + - Define compute resources + - Configure environment settings + - Set up runtime options + + ### Examples + + - Create environment class: + + Creates a new environment configuration. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + displayName: "Large Instance" + description: "8 CPU, 16GB RAM" + configuration: + - key: "cpu" + value: "8" + - key: "memory" + value: "16384" + ``` Args: extra_headers: Send extra headers @@ -110,7 +133,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentClassRetrieveResponse: """ - GetEnvironmentClass returns a single environment class configured for a runner. + Gets details about a specific environment class. + + Use this method to: + + - View class configuration + - Check resource settings + - Verify availability + + ### Examples + + - Get class details: + + Retrieves information about a specific class. + + ```yaml + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -148,7 +187,26 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateEnvironmentClass updates an existing environment class on a runner. + Updates an environment class. + + Use this method to: + + - Modify class settings + - Update resource limits + - Change availability + + ### Examples + + - Update class: + + Changes class configuration. + + ```yaml + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + displayName: "Updated Large Instance" + description: "16 CPU, 32GB RAM" + enabled: true + ``` Args: extra_headers: Send extra headers @@ -191,8 +249,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ - buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ListEnvironmentClasses returns all - environment classes configured for a runner. + Lists environment classes with optional filtering. + + Use this method to: + + - View available classes + - Filter by capability + - Check enabled status + + ### Examples + + - List all classes: + + Shows all environment classes. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter enabled classes: + + Lists only enabled environment classes. + + ```yaml + filter: + enabled: true + pagination: + pageSize: 20 + ``` + + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: pagination: pagination contains the pagination options for listing environment classes @@ -268,7 +355,30 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentClassCreateResponse: """ - CreateEnvironmentClass creates a new environment class on a runner. + Creates a new environment class for a runner. + + Use this method to: + + - Define compute resources + - Configure environment settings + - Set up runtime options + + ### Examples + + - Create environment class: + + Creates a new environment configuration. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + displayName: "Large Instance" + description: "8 CPU, 16GB RAM" + configuration: + - key: "cpu" + value: "8" + - key: "memory" + value: "16384" + ``` Args: extra_headers: Send extra headers @@ -308,7 +418,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentClassRetrieveResponse: """ - GetEnvironmentClass returns a single environment class configured for a runner. + Gets details about a specific environment class. + + Use this method to: + + - View class configuration + - Check resource settings + - Verify availability + + ### Examples + + - Get class details: + + Retrieves information about a specific class. + + ```yaml + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -346,7 +472,26 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateEnvironmentClass updates an existing environment class on a runner. + Updates an environment class. + + Use this method to: + + - Modify class settings + - Update resource limits + - Change availability + + ### Examples + + - Update class: + + Changes class configuration. + + ```yaml + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + displayName: "Updated Large Instance" + description: "16 CPU, 32GB RAM" + enabled: true + ``` Args: extra_headers: Send extra headers @@ -389,8 +534,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ - buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ListEnvironmentClasses returns all - environment classes configured for a runner. + Lists environment classes with optional filtering. + + Use this method to: + + - View available classes + - Filter by capability + - Check enabled status + + ### Examples + + - List all classes: + + Shows all environment classes. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter enabled classes: + + Lists only enabled environment classes. + + ```yaml + filter: + enabled: true + pagination: + pageSize: 20 + ``` + + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: pagination: pagination contains the pagination options for listing environment classes diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 4f49af81..0b8c5855 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -80,7 +80,29 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenCreateResponse: """ - CreateHostAuthenticationToken + Creates a new authentication token for accessing remote hosts. + + Use this method to: + + - Set up SCM authentication + - Configure OAuth credentials + - Manage PAT tokens + + ### Examples + + - Create OAuth token: + + Creates a new OAuth-based authentication token. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + host: "github.com" + token: "gho_xxxxxxxxxxxx" + source: HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH + expiresAt: "2024-12-31T23:59:59Z" + refreshToken: "ghr_xxxxxxxxxxxx" + ``` Args: expires_at: A Timestamp represents a point in time independent of any time zone or local @@ -212,7 +234,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenRetrieveResponse: """ - GetHostAuthenticationToken + Gets details about a specific host authentication token. + + Use this method to: + + - View token information + - Check token expiration + - Verify token validity + + ### Examples + + - Get token details: + + Retrieves information about a specific token. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -249,7 +287,26 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateHostAuthenticationToken + Updates an existing host authentication token. + + Use this method to: + + - Refresh token values + - Update expiration + - Modify token settings + + ### Examples + + - Update token: + + Updates token value and expiration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + token: "gho_xxxxxxxxxxxx" + expiresAt: "2024-12-31T23:59:59Z" + refreshToken: "ghr_xxxxxxxxxxxx" + ``` Args: expires_at: A Timestamp represents a point in time independent of any time zone or local @@ -381,7 +438,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncTokensPage[HostAuthenticationToken]: """ - ListHostAuthenticationTokens + Lists host authentication tokens with optional filtering. + + Use this method to: + + - View all tokens + - Filter by runner or user + - Monitor token status + + ### Examples + + - List all tokens: + + Shows all tokens with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by runner: + + Lists tokens for a specific runner. + + ```yaml + filter: + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: extra_headers: Send extra headers @@ -431,7 +516,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteHostAuthenticationToken + Deletes a host authentication token. + + Use this method to: + + - Remove unused tokens + - Revoke access + - Clean up expired tokens + + ### Examples + + - Delete token: + + Permanently removes a token. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -492,7 +593,29 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenCreateResponse: """ - CreateHostAuthenticationToken + Creates a new authentication token for accessing remote hosts. + + Use this method to: + + - Set up SCM authentication + - Configure OAuth credentials + - Manage PAT tokens + + ### Examples + + - Create OAuth token: + + Creates a new OAuth-based authentication token. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + host: "github.com" + token: "gho_xxxxxxxxxxxx" + source: HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH + expiresAt: "2024-12-31T23:59:59Z" + refreshToken: "ghr_xxxxxxxxxxxx" + ``` Args: expires_at: A Timestamp represents a point in time independent of any time zone or local @@ -624,7 +747,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenRetrieveResponse: """ - GetHostAuthenticationToken + Gets details about a specific host authentication token. + + Use this method to: + + - View token information + - Check token expiration + - Verify token validity + + ### Examples + + - Get token details: + + Retrieves information about a specific token. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -661,7 +800,26 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateHostAuthenticationToken + Updates an existing host authentication token. + + Use this method to: + + - Refresh token values + - Update expiration + - Modify token settings + + ### Examples + + - Update token: + + Updates token value and expiration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + token: "gho_xxxxxxxxxxxx" + expiresAt: "2024-12-31T23:59:59Z" + refreshToken: "ghr_xxxxxxxxxxxx" + ``` Args: expires_at: A Timestamp represents a point in time independent of any time zone or local @@ -793,7 +951,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[HostAuthenticationToken, AsyncTokensPage[HostAuthenticationToken]]: """ - ListHostAuthenticationTokens + Lists host authentication tokens with optional filtering. + + Use this method to: + + - View all tokens + - Filter by runner or user + - Monitor token status + + ### Examples + + - List all tokens: + + Shows all tokens with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by runner: + + Lists tokens for a specific runner. + + ```yaml + filter: + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: extra_headers: Send extra headers @@ -843,7 +1029,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteHostAuthenticationToken + Deletes a host authentication token. + + Use this method to: + + - Remove unused tokens + - Revoke access + - Clean up expired tokens + + ### Examples + + - Delete token: + + Permanently removes a token. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/runners/configurations/schema.py b/src/gitpod/resources/runners/configurations/schema.py index 4d3f3e5e..e15565ac 100644 --- a/src/gitpod/resources/runners/configurations/schema.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -56,7 +56,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SchemaRetrieveResponse: """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + Gets the latest runner configuration schema. + + Use this method to: + + - View available settings + - Check configuration options + - Validate configurations + + ### Examples + + - Get schema: + + Retrieves configuration schema for a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -109,7 +125,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SchemaRetrieveResponse: """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + Gets the latest runner configuration schema. + + Use this method to: + + - View available settings + - Check configuration options + - Validate configurations + + ### Examples + + - Get schema: + + Retrieves configuration schema for a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 97aa2608..0ce580d9 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -72,7 +72,27 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: """ - CreateSCMIntegration creates a new SCM integration on a runner. + Creates a new SCM integration for a runner. + + Use this method to: + + - Configure source control access + - Set up repository integrations + - Enable code synchronization + + ### Examples + + - Create GitHub integration: + + Sets up GitHub SCM integration. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmId: "github" + host: "github.com" + oauthClientId: "client_id" + oauthPlaintextClientSecret: "client_secret" + ``` Args: oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If @@ -123,7 +143,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationRetrieveResponse: """ - GetSCMIntegration returns a single SCM integration configured for a runner. + Gets details about a specific SCM integration. + + Use this method to: + + - View integration settings + - Check integration status + - Verify configuration + + ### Examples + + - Get integration details: + + Retrieves information about a specific integration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -158,7 +194,25 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateSCMIntegration updates an existing SCM integration on a runner. + Updates an existing SCM integration. + + Use this method to: + + - Modify integration settings + - Update credentials + - Change configuration + + ### Examples + + - Update integration: + + Updates OAuth credentials. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + oauthClientId: "new_client_id" + oauthPlaintextClientSecret: "new_client_secret" + ``` Args: oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. If an empty @@ -218,7 +272,26 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncIntegrationsPage[ScmIntegration]: """ - ListSCMIntegrations returns all SCM integrations configured for a runner. + Lists SCM integrations for a runner. + + Use this method to: + + - View all integrations + - Monitor integration status + - Check available SCMs + + ### Examples + + - List integrations: + + Shows all SCM integrations. + + ```yaml + filter: + runnerIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing scm integrations @@ -270,7 +343,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteSCMIntegration deletes an existing SCM integration on a runner. + Deletes an SCM integration. + + Use this method to: + + - Remove unused integrations + - Clean up configurations + - Revoke SCM access + + ### Examples + + - Delete integration: + + Removes an SCM integration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -328,7 +417,27 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: """ - CreateSCMIntegration creates a new SCM integration on a runner. + Creates a new SCM integration for a runner. + + Use this method to: + + - Configure source control access + - Set up repository integrations + - Enable code synchronization + + ### Examples + + - Create GitHub integration: + + Sets up GitHub SCM integration. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmId: "github" + host: "github.com" + oauthClientId: "client_id" + oauthPlaintextClientSecret: "client_secret" + ``` Args: oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If @@ -379,7 +488,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationRetrieveResponse: """ - GetSCMIntegration returns a single SCM integration configured for a runner. + Gets details about a specific SCM integration. + + Use this method to: + + - View integration settings + - Check integration status + - Verify configuration + + ### Examples + + - Get integration details: + + Retrieves information about a specific integration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -414,7 +539,25 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateSCMIntegration updates an existing SCM integration on a runner. + Updates an existing SCM integration. + + Use this method to: + + - Modify integration settings + - Update credentials + - Change configuration + + ### Examples + + - Update integration: + + Updates OAuth credentials. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + oauthClientId: "new_client_id" + oauthPlaintextClientSecret: "new_client_secret" + ``` Args: oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. If an empty @@ -474,7 +617,26 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[ScmIntegration, AsyncIntegrationsPage[ScmIntegration]]: """ - ListSCMIntegrations returns all SCM integrations configured for a runner. + Lists SCM integrations for a runner. + + Use this method to: + + - View all integrations + - Monitor integration status + - Check available SCMs + + ### Examples + + - List integrations: + + Shows all SCM integrations. + + ```yaml + filter: + runnerIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing scm integrations @@ -526,7 +688,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteSCMIntegration deletes an existing SCM integration on a runner. + Deletes an SCM integration. + + Use this method to: + + - Remove unused integrations + - Clean up configurations + - Revoke SCM access + + ### Examples + + - Delete integration: + + Removes an SCM integration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 09de7ed1..5bc9d25b 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -68,7 +68,25 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyCreateResponse: """ - CreateRunnerPolicy creates a new runner policy. + Creates a new policy for a runner. + + Use this method to: + + - Set up access controls + - Define group permissions + - Configure role-based access + + ### Examples + + - Create admin policy: + + Grants admin access to a group. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RUNNER_ROLE_ADMIN + ``` Args: group_id: group_id specifies the group_id identifier @@ -113,7 +131,25 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyUpdateResponse: """ - UpdateRunnerPolicy an existing runner policy. + Updates an existing runner policy. + + Use this method to: + + - Modify access levels + - Change group roles + - Update permissions + + ### Examples + + - Update policy role: + + Changes a group's access level. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RUNNER_ROLE_USER + ``` Args: group_id: group_id specifies the group_id identifier @@ -159,7 +195,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncPoliciesPage[RunnerPolicy]: """ - ListRunnerPolicies lists runner policies. + Lists policies for a runner. + + Use this method to: + + - View access controls + - Check policy configurations + - Audit permissions + + ### Examples + + - List policies: + + Shows all policies for a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing project policies @@ -214,7 +268,24 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteRunnerPolicy deletes a runner policy. + Deletes a runner policy. + + Use this method to: + + - Remove access controls + - Revoke permissions + - Clean up policies + + ### Examples + + - Delete policy: + + Removes a group's access policy. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: group_id: group_id specifies the group_id identifier @@ -279,7 +350,25 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyCreateResponse: """ - CreateRunnerPolicy creates a new runner policy. + Creates a new policy for a runner. + + Use this method to: + + - Set up access controls + - Define group permissions + - Configure role-based access + + ### Examples + + - Create admin policy: + + Grants admin access to a group. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RUNNER_ROLE_ADMIN + ``` Args: group_id: group_id specifies the group_id identifier @@ -324,7 +413,25 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyUpdateResponse: """ - UpdateRunnerPolicy an existing runner policy. + Updates an existing runner policy. + + Use this method to: + + - Modify access levels + - Change group roles + - Update permissions + + ### Examples + + - Update policy role: + + Changes a group's access level. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RUNNER_ROLE_USER + ``` Args: group_id: group_id specifies the group_id identifier @@ -370,7 +477,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[RunnerPolicy, AsyncPoliciesPage[RunnerPolicy]]: """ - ListRunnerPolicies lists runner policies. + Lists policies for a runner. + + Use this method to: + + - View access controls + - Check policy configurations + - Audit permissions + + ### Examples + + - List policies: + + Shows all policies for a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing project policies @@ -425,7 +550,24 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteRunnerPolicy deletes a runner policy. + Deletes a runner policy. + + Use this method to: + + - Remove access controls + - Revoke permissions + - Clean up policies + + ### Examples + + - Delete policy: + + Removes a group's access policy. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: group_id: group_id specifies the group_id identifier diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 66fc4e7a..2b4b2219 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -104,11 +104,48 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateResponse: - """CreateRunner creates a new runner with the server. + """Creates a new runner registration with the server. Registrations are very - short-lived and must be renewed every 30 seconds. Runners can be registered for - an entire organisation or a single user. + short-lived and must be renewed every 30 seconds. + + Use this method to: + + - Register organization runners + - Set up runner configurations + - Initialize runner credentials + - Configure auto-updates + + ### Examples + + - Create cloud runner: + + Creates a new runner in AWS EC2. + + ```yaml + name: "Production Runner" + provider: RUNNER_PROVIDER_AWS_EC2 + spec: + desiredPhase: RUNNER_PHASE_ACTIVE + configuration: + region: "us-west" + releaseChannel: RUNNER_RELEASE_CHANNEL_STABLE + autoUpdate: true + ``` + + - Create local runner: + + Creates a new local runner on Linux. + + ```yaml + name: "Local Development Runner" + provider: RUNNER_PROVIDER_LINUX_HOST + spec: + desiredPhase: RUNNER_PHASE_ACTIVE + configuration: + releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST + autoUpdate: true + ``` Args: kind: RunnerKind represents the kind of a runner @@ -156,7 +193,24 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerRetrieveResponse: """ - GetRunner returns a single runner. + Gets details about a specific runner. + + Use this method to: + + - Check runner status + - View runner configuration + - Monitor runner health + - Verify runner capabilities + + ### Examples + + - Get runner details: + + Retrieves information about a specific runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -190,7 +244,29 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateRunner updates an environment runner. + Updates a runner's configuration. + + Use this method to: + + - Modify runner settings + - Update release channels + - Change runner status + - Configure auto-update settings + + ### Examples + + - Update configuration: + + Changes runner settings. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + name: "Updated Runner Name" + spec: + configuration: + releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST + autoUpdate: true + ``` Args: name: The runner's name which is shown to users @@ -238,7 +314,36 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncRunnersPage[Runner]: """ - ListRunners returns all runners registered in the scope. + Lists all registered runners with optional filtering. + + Use this method to: + + - View all available runners + - Filter by runner type + - Monitor runner status + - Check runner availability + + ### Examples + + - List all runners: + + Shows all runners with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by provider: + + Lists only AWS EC2 runners. + + ```yaml + filter: + providers: ["RUNNER_PROVIDER_AWS_EC2"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing runners @@ -291,7 +396,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteRunner deletes an environment runner. + Deletes a runner permanently. + + Use this method to: + + - Remove unused runners + - Clean up runner registrations + - Delete obsolete runners + + ### Examples + + - Delete runner: + + Permanently removes a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: force: force indicates whether the runner should be deleted forcefully. When force @@ -335,10 +456,23 @@ def check_authentication_for_host( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCheckAuthenticationForHostResponse: """ - CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. If not, this function will return a URL - that the user should visit to authenticate, or indicate that Personal Access - Tokens are supported. + Checks if a user is authenticated for a specific host. + + Use this method to: + + - Verify authentication status + - Get authentication URLs + - Check PAT support + + ### Examples + + - Check authentication: + + Verifies authentication for a host. + + ```yaml + host: "github.com" + ``` Args: extra_headers: Send extra headers @@ -375,11 +509,26 @@ def create_runner_token( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateRunnerTokenResponse: - """CreateRunnerToken returns a token that can be used to authenticate as the - runner. + """ + Creates a new authentication token for a runner. + + Use this method to: + + - Generate runner credentials + - Renew expired tokens + - Set up runner authentication + + Note: This does not expire previously issued tokens. + + ### Examples + + - Create token: + + Creates a new token for runner authentication. - Use this call to renew an outdated token - this does not expire any - previously issued tokens. + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -414,18 +563,30 @@ def parse_context_url( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerParseContextURLResponse: """ - ParseContextURL asks a runner to parse a context URL, and return the parsed - result. + Parses a context URL and returns the parsed result. + + Use this method to: + + - Validate context URLs + - Check repository access + - Verify branch existence + + Returns: + + - FAILED_PRECONDITION if authentication is required + - PERMISSION_DENIED if access is not allowed + - INVALID_ARGUMENT if URL is invalid + - NOT_FOUND if repository/branch doesn't exist + + ### Examples + + - Parse URL: - This call returns + Parses and validates a context URL. - - FAILED_PRECONDITION if the user requires authentication on the runner to - access the context URL - - PERMISSION_DENIED if the user is not allowed to access the context URL using - the credentials they have - - INVALID_ARGUMENT if the context URL is invalid - - NOT_FOUND if the repository or branch indicated by the context URL does not - exist + ```yaml + contextUrl: "https://github.com/org/repo/tree/main" + ``` Args: extra_headers: Send extra headers @@ -494,11 +655,48 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateResponse: - """CreateRunner creates a new runner with the server. + """Creates a new runner registration with the server. Registrations are very - short-lived and must be renewed every 30 seconds. Runners can be registered for - an entire organisation or a single user. + short-lived and must be renewed every 30 seconds. + + Use this method to: + + - Register organization runners + - Set up runner configurations + - Initialize runner credentials + - Configure auto-updates + + ### Examples + + - Create cloud runner: + + Creates a new runner in AWS EC2. + + ```yaml + name: "Production Runner" + provider: RUNNER_PROVIDER_AWS_EC2 + spec: + desiredPhase: RUNNER_PHASE_ACTIVE + configuration: + region: "us-west" + releaseChannel: RUNNER_RELEASE_CHANNEL_STABLE + autoUpdate: true + ``` + + - Create local runner: + + Creates a new local runner on Linux. + + ```yaml + name: "Local Development Runner" + provider: RUNNER_PROVIDER_LINUX_HOST + spec: + desiredPhase: RUNNER_PHASE_ACTIVE + configuration: + releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST + autoUpdate: true + ``` Args: kind: RunnerKind represents the kind of a runner @@ -546,7 +744,24 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerRetrieveResponse: """ - GetRunner returns a single runner. + Gets details about a specific runner. + + Use this method to: + + - Check runner status + - View runner configuration + - Monitor runner health + - Verify runner capabilities + + ### Examples + + - Get runner details: + + Retrieves information about a specific runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -580,7 +795,29 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateRunner updates an environment runner. + Updates a runner's configuration. + + Use this method to: + + - Modify runner settings + - Update release channels + - Change runner status + - Configure auto-update settings + + ### Examples + + - Update configuration: + + Changes runner settings. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + name: "Updated Runner Name" + spec: + configuration: + releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST + autoUpdate: true + ``` Args: name: The runner's name which is shown to users @@ -628,7 +865,36 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Runner, AsyncRunnersPage[Runner]]: """ - ListRunners returns all runners registered in the scope. + Lists all registered runners with optional filtering. + + Use this method to: + + - View all available runners + - Filter by runner type + - Monitor runner status + - Check runner availability + + ### Examples + + - List all runners: + + Shows all runners with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by provider: + + Lists only AWS EC2 runners. + + ```yaml + filter: + providers: ["RUNNER_PROVIDER_AWS_EC2"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing runners @@ -681,7 +947,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteRunner deletes an environment runner. + Deletes a runner permanently. + + Use this method to: + + - Remove unused runners + - Clean up runner registrations + - Delete obsolete runners + + ### Examples + + - Delete runner: + + Permanently removes a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: force: force indicates whether the runner should be deleted forcefully. When force @@ -725,10 +1007,23 @@ async def check_authentication_for_host( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCheckAuthenticationForHostResponse: """ - CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. If not, this function will return a URL - that the user should visit to authenticate, or indicate that Personal Access - Tokens are supported. + Checks if a user is authenticated for a specific host. + + Use this method to: + + - Verify authentication status + - Get authentication URLs + - Check PAT support + + ### Examples + + - Check authentication: + + Verifies authentication for a host. + + ```yaml + host: "github.com" + ``` Args: extra_headers: Send extra headers @@ -765,11 +1060,26 @@ async def create_runner_token( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateRunnerTokenResponse: - """CreateRunnerToken returns a token that can be used to authenticate as the - runner. + """ + Creates a new authentication token for a runner. + + Use this method to: + + - Generate runner credentials + - Renew expired tokens + - Set up runner authentication + + Note: This does not expire previously issued tokens. + + ### Examples + + - Create token: + + Creates a new token for runner authentication. - Use this call to renew an outdated token - this does not expire any - previously issued tokens. + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -804,18 +1114,30 @@ async def parse_context_url( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerParseContextURLResponse: """ - ParseContextURL asks a runner to parse a context URL, and return the parsed - result. + Parses a context URL and returns the parsed result. + + Use this method to: + + - Validate context URLs + - Check repository access + - Verify branch existence + + Returns: + + - FAILED_PRECONDITION if authentication is required + - PERMISSION_DENIED if access is not allowed + - INVALID_ARGUMENT if URL is invalid + - NOT_FOUND if repository/branch doesn't exist + + ### Examples + + - Parse URL: - This call returns + Parses and validates a context URL. - - FAILED_PRECONDITION if the user requires authentication on the runner to - access the context URL - - PERMISSION_DENIED if the user is not allowed to access the context URL using - the credentials they have - - INVALID_ARGUMENT if the context URL is invalid - - NOT_FOUND if the repository or branch indicated by the context URL does not - exist + ```yaml + contextUrl: "https://github.com/org/repo/tree/main" + ``` Args: extra_headers: Send extra headers diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index cf0a4f4f..fdd40b73 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -32,8 +32,8 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", role="PROJECT_ROLE_UNSPECIFIED", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -70,8 +70,8 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", role="PROJECT_ROLE_UNSPECIFIED", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -112,9 +112,9 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @@ -150,8 +150,8 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.delete( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, policy, path=["response"]) @@ -191,8 +191,8 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", role="PROJECT_ROLE_UNSPECIFIED", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -229,8 +229,8 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", role="PROJECT_ROLE_UNSPECIFIED", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -271,9 +271,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @@ -309,8 +309,8 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, policy, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 0c47b397..1668612b 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -34,13 +34,17 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create( configuration=[ { - "key": "key", - "value": "value", - } + "key": "cpu", + "value": "8", + }, + { + "key": "memory", + "value": "16384", + }, ], - description="xxx", - display_name="xxx", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + description="8 CPU, 16GB RAM", + display_name="Large Instance", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) @@ -76,7 +80,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( - environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @@ -112,10 +116,10 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( - description="xxx", - display_name="xxx", + description="16 CPU, 32GB RAM", + display_name="Updated Large Instance", enabled=True, - environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, environment_class, path=["response"]) @@ -162,7 +166,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) @@ -205,13 +209,17 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> environment_class = await async_client.runners.configurations.environment_classes.create( configuration=[ { - "key": "key", - "value": "value", - } + "key": "cpu", + "value": "8", + }, + { + "key": "memory", + "value": "16384", + }, ], - description="xxx", - display_name="xxx", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + description="8 CPU, 16GB RAM", + display_name="Large Instance", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) @@ -247,7 +255,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( - environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @@ -285,10 +293,10 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( - description="xxx", - display_name="xxx", + description="16 CPU, 32GB RAM", + display_name="Updated Large Instance", enabled=True, - environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, environment_class, path=["response"]) @@ -335,7 +343,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 27694ae4..684e0f4d 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -33,13 +33,13 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create( - token="x", - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - host="x", - refresh_token="refreshToken", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + token="gho_xxxxxxxxxxxx", + expires_at=parse_datetime("2024-12-31T23:59:59Z"), + host="github.com", + refresh_token="ghr_xxxxxxxxxxxx", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -75,7 +75,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @@ -111,10 +111,10 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - token="x", - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - refresh_token="refreshToken", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + token="gho_xxxxxxxxxxxx", + expires_at=parse_datetime("2024-12-31T23:59:59Z"), + refresh_token="ghr_xxxxxxxxxxxx", ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -153,12 +153,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ - "runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "runner_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @@ -195,7 +195,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -235,13 +235,13 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( - token="x", - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - host="x", - refresh_token="refreshToken", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + token="gho_xxxxxxxxxxxx", + expires_at=parse_datetime("2024-12-31T23:59:59Z"), + host="github.com", + refresh_token="ghr_xxxxxxxxxxxx", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -279,7 +279,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @@ -317,10 +317,10 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - token="x", - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - refresh_token="refreshToken", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + token="gho_xxxxxxxxxxxx", + expires_at=parse_datetime("2024-12-31T23:59:59Z"), + refresh_token="ghr_xxxxxxxxxxxx", ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -361,12 +361,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ - "runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "runner_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @@ -405,7 +405,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, host_authentication_token, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index 3fce8e32..9d507253 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -27,7 +27,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @@ -67,7 +67,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index 41ee4a5f..a3c76eb7 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -32,12 +32,12 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( - host="host", - oauth_client_id="oauthClientId", - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + host="github.com", + oauth_client_id="client_id", + oauth_plaintext_client_secret="client_secret", pat=True, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - scm_id="scmId", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_id="github", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -73,7 +73,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @@ -109,9 +109,9 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - oauth_client_id="oauthClientId", - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + oauth_client_id="new_client_id", + oauth_plaintext_client_secret="new_client_secret", pat=True, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -150,10 +150,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list( token="token", page_size=0, - filter={"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={"runner_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"]}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @@ -190,7 +190,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, scm_integration, path=["response"]) @@ -230,12 +230,12 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( - host="host", - oauth_client_id="oauthClientId", - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + host="github.com", + oauth_client_id="client_id", + oauth_plaintext_client_secret="client_secret", pat=True, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - scm_id="scmId", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_id="github", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -271,7 +271,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @@ -307,9 +307,9 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - oauth_client_id="oauthClientId", - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + oauth_client_id="new_client_id", + oauth_plaintext_client_secret="new_client_secret", pat=True, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -348,10 +348,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N scm_integration = await async_client.runners.configurations.scm_integrations.list( token="token", page_size=0, - filter={"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={"runner_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"]}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @@ -388,7 +388,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, scm_integration, path=["response"]) diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 7184caf4..8d88dc3b 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -40,15 +40,15 @@ def test_method_validate_with_all_params(self, client: Gitpod) -> None: "display_name": "xxx", "enabled": True, }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", scm_integration={ - "id": "id", - "host": "host", - "oauth_client_id": "oauthClientId", + "id": "integration-id", + "host": "github.com", + "oauth_client_id": "client_id", "oauth_encrypted_client_secret": "U3RhaW5sZXNzIHJvY2tz", - "oauth_plaintext_client_secret": "oauthPlaintextClientSecret", + "oauth_plaintext_client_secret": "client_secret", "pat": True, - "scm_id": "scmId", + "scm_id": "github", }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -102,15 +102,15 @@ async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) "display_name": "xxx", "enabled": True, }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", scm_integration={ - "id": "id", - "host": "host", - "oauth_client_id": "oauthClientId", + "id": "integration-id", + "host": "github.com", + "oauth_client_id": "client_id", "oauth_encrypted_client_secret": "U3RhaW5sZXNzIHJvY2tz", - "oauth_plaintext_client_secret": "oauthPlaintextClientSecret", + "oauth_plaintext_client_secret": "client_secret", "pat": True, - "scm_id": "scmId", + "scm_id": "github", }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index f0bcafa7..a5da4a8d 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -32,9 +32,9 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="RUNNER_ROLE_UNSPECIFIED", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -70,9 +70,9 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="RUNNER_ROLE_UNSPECIFIED", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -112,9 +112,9 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @@ -150,8 +150,8 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.delete( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, policy, path=["response"]) @@ -191,9 +191,9 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="RUNNER_ROLE_UNSPECIFIED", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -229,9 +229,9 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="RUNNER_ROLE_UNSPECIFIED", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -271,9 +271,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @@ -309,8 +309,8 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, policy, path=["response"]) diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 11a2ab96..977730ed 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -32,14 +32,14 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ - "actor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], "actor_principals": ["PRINCIPAL_UNSPECIFIED"], "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) @@ -120,14 +120,14 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ - "actor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], "actor_principals": ["PRINCIPAL_UNSPECIFIED"], "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index 00bfe68a..ed1c0380 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -32,7 +32,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) @@ -77,7 +77,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 4a57297b..3d47dbde 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -38,7 +38,7 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "local_runner": True, }, initializer={ @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", - "remote_uri": "remoteUri", + "remote_uri": "https://github.com/org/repo", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", }, @@ -57,7 +57,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: }, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - name="x", + name="Web Application", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -99,7 +99,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -138,7 +138,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "local_runner": True, }, initializer={ @@ -156,7 +156,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ] }, name="x", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -196,7 +196,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) @@ -233,7 +233,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: project = client.projects.delete( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, project, path=["response"]) @@ -269,8 +269,8 @@ def test_method_create_from_environment(self, client: Gitpod) -> None: @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - name="x", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + name="Frontend Project", ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @@ -314,7 +314,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "local_runner": True, }, initializer={ @@ -324,7 +324,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", - "remote_uri": "remoteUri", + "remote_uri": "https://github.com/org/repo", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", }, @@ -333,7 +333,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> }, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - name="x", + name="Web Application", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -375,7 +375,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -414,7 +414,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "local_runner": True, }, initializer={ @@ -432,7 +432,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ] }, name="x", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -472,7 +472,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) @@ -509,7 +509,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, project, path=["response"]) @@ -545,8 +545,8 @@ async def test_method_create_from_environment(self, async_client: AsyncGitpod) - @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - name="x", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + name="Frontend Project", ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 3829f7d6..8968127a 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -36,12 +36,12 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( kind="RUNNER_KIND_UNSPECIFIED", - name="xxx", + name="Production Runner", provider="RUNNER_PROVIDER_UNSPECIFIED", spec={ "configuration": { "auto_update": True, - "region": "region", + "region": "us-west", "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", @@ -81,7 +81,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -117,8 +117,8 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: runner = client.runners.update( - name="xxx", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + name="Updated Runner Name", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", spec={ "configuration": { "auto_update": True, @@ -170,7 +170,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) @@ -208,7 +208,7 @@ def test_method_delete(self, client: Gitpod) -> None: def test_method_delete_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete( force=True, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, runner, path=["response"]) @@ -244,7 +244,7 @@ def test_method_check_authentication_for_host(self, client: Gitpod) -> None: @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( - host="host", + host="github.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @@ -281,7 +281,7 @@ def test_method_create_runner_token(self, client: Gitpod) -> None: @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @@ -317,7 +317,7 @@ def test_method_parse_context_url(self, client: Gitpod) -> None: @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( - context_url="https://example.com", + context_url="https://github.com/org/repo/tree/main", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @@ -359,12 +359,12 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( kind="RUNNER_KIND_UNSPECIFIED", - name="xxx", + name="Production Runner", provider="RUNNER_PROVIDER_UNSPECIFIED", spec={ "configuration": { "auto_update": True, - "region": "region", + "region": "us-west", "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", @@ -404,7 +404,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -440,8 +440,8 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( - name="xxx", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + name="Updated Runner Name", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", spec={ "configuration": { "auto_update": True, @@ -493,7 +493,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) @@ -531,7 +531,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete( force=True, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, runner, path=["response"]) @@ -567,7 +567,7 @@ async def test_method_check_authentication_for_host(self, async_client: AsyncGit @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( - host="host", + host="github.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @@ -604,7 +604,7 @@ async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> No @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @@ -640,7 +640,7 @@ async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( - context_url="https://example.com", + context_url="https://github.com/org/repo/tree/main", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) From 382a18be72fccd9f1b735d2af3678b55bbe728e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 12:10:04 +0000 Subject: [PATCH 124/505] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 27a7d826..d0c635db 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d6a243325df36817d495ce6dd54f80766b77a97e1ca2f6d371c0a68b7d070e0f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-064a191bc556bcab46bb5d612c844437e1a4aef5981a4a99ab7f825a96ede4fa.yml From 01daa74c23a67661dcec002ef0de6390591df3bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 05:20:32 +0000 Subject: [PATCH 125/505] feat(client): allow passing `NotGiven` for body (#63) fix(client): mark some request bodies as optional --- src/gitpod/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index eb601ba0..1772072c 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -518,7 +518,7 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data, + json=json_data if is_given(json_data) else None, files=files, **kwargs, ) From 54a9f12ccac6daa76a80cc7a1227de8d1dae68fa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 11:57:49 +0000 Subject: [PATCH 126/505] feat(api): manual updates (#64) --- .stats.yml | 2 +- .../resources/environments/environments.py | 22 +- src/gitpod/resources/projects/projects.py | 8 +- src/gitpod/resources/runners/runners.py | 20 +- src/gitpod/resources/secrets.py | 14 +- src/gitpod/types/environment.py | 10 +- .../types/environment_activity_signal.py | 90 +----- .../environment_activity_signal_param.py | 90 +----- .../environment_create_from_project_params.py | 5 +- src/gitpod/types/environment_create_params.py | 4 +- src/gitpod/types/environment_initializer.py | 2 +- .../types/environment_initializer_param.py | 2 +- .../types/environment_mark_active_params.py | 2 +- src/gitpod/types/environment_metadata.py | 181 +----------- src/gitpod/types/environment_spec.py | 79 +---- src/gitpod/types/environment_spec_param.py | 79 +---- src/gitpod/types/environment_status.py | 4 +- src/gitpod/types/environment_update_params.py | 63 +--- .../automations/service_metadata.py | 91 +----- .../automations/service_metadata_param.py | 91 +----- .../organizations/domain_verification.py | 94 ++++++ src/gitpod/types/project.py | 2 +- src/gitpod/types/project_create_params.py | 2 +- src/gitpod/types/project_update_params.py | 2 +- src/gitpod/types/runner.py | 192 +----------- src/gitpod/types/runner_create_params.py | 12 +- src/gitpod/types/runner_status.py | 93 +----- src/gitpod/types/runner_update_params.py | 12 +- src/gitpod/types/secret_create_params.py | 7 +- .../types/shared/task_execution_metadata.py | 273 +----------------- src/gitpod/types/shared/task_metadata.py | 91 +----- .../types/shared_params/task_metadata.py | 91 +----- src/gitpod/types/user.py | 91 +----- tests/api_resources/test_environments.py | 24 +- tests/api_resources/test_secrets.py | 4 +- 35 files changed, 220 insertions(+), 1629 deletions(-) diff --git a/.stats.yml b/.stats.yml index d0c635db..2c4d8acc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-064a191bc556bcab46bb5d612c844437e1a4aef5981a4a99ab7f825a96ede4fa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3655d5ad0ac3e228c1519af70dbf3d0bfa3c47a2d06d4cac92a650da051b49a6.yml diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index c5e250f0..a7ced1ae 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -164,8 +164,8 @@ def create( ``` Args: - spec: EnvironmentSpec specifies the configuration of an environment for an environment - start + spec: spec is the configuration of the environment that's required for the to start + the environment extra_headers: Send extra headers @@ -540,8 +540,9 @@ def create_from_project( ``` Args: - spec: EnvironmentSpec specifies the configuration of an environment for an environment - start + spec: Spec is the configuration of the environment that's required for the runner to + start the environment Configuration already defined in the Project will override + parts of the spec, if set extra_headers: Send extra headers @@ -651,7 +652,7 @@ def mark_active( ``` Args: - activity_signal: EnvironmentActivitySignal used to signal activity for an environment. + activity_signal: activity_signal specifies the activity. environment_id: The ID of the environment to update activity for. @@ -880,8 +881,8 @@ async def create( ``` Args: - spec: EnvironmentSpec specifies the configuration of an environment for an environment - start + spec: spec is the configuration of the environment that's required for the to start + the environment extra_headers: Send extra headers @@ -1256,8 +1257,9 @@ async def create_from_project( ``` Args: - spec: EnvironmentSpec specifies the configuration of an environment for an environment - start + spec: Spec is the configuration of the environment that's required for the runner to + start the environment Configuration already defined in the Project will override + parts of the spec, if set extra_headers: Send extra headers @@ -1367,7 +1369,7 @@ async def mark_active( ``` Args: - activity_signal: EnvironmentActivitySignal used to signal activity for an environment. + activity_signal: activity_signal specifies the activity. environment_id: The ID of the environment to update activity for. diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 47ddd964..6b2e5aee 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -130,7 +130,7 @@ def create( ``` Args: - initializer: EnvironmentInitializer specifies how an environment is to be initialized + initializer: initializer is the content initializer automations_file_path: automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): @@ -284,7 +284,7 @@ def update( this.matches("^$|^[^/].*") ``` - initializer: EnvironmentInitializer specifies how an environment is to be initialized + initializer: initializer is the content initializer project_id: project_id specifies the project identifier @@ -571,7 +571,7 @@ async def create( ``` Args: - initializer: EnvironmentInitializer specifies how an environment is to be initialized + initializer: initializer is the content initializer automations_file_path: automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): @@ -725,7 +725,7 @@ async def update( this.matches("^$|^[^/].*") ``` - initializer: EnvironmentInitializer specifies how an environment is to be initialized + initializer: initializer is the content initializer project_id: project_id specifies the project identifier diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 2b4b2219..20da73be 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -148,13 +148,15 @@ def create( ``` Args: - kind: RunnerKind represents the kind of a runner + kind: The runner's kind This field is optional and here for backwards-compatibility. + Use the provider field instead. If provider is set, the runner's kind will be + deduced from the provider. Only one of kind and provider must be set. name: The runner name for humans - provider: RunnerProvider identifies the specific implementation type of a runner. Each - provider maps to a specific kind of runner (local or remote), as specified below - for each provider. + provider: The specific implementation type of the runner This field is optional for + backwards compatibility but will be required in the future. When specified, kind + must not be specified (will be deduced from provider) extra_headers: Send extra headers @@ -699,13 +701,15 @@ async def create( ``` Args: - kind: RunnerKind represents the kind of a runner + kind: The runner's kind This field is optional and here for backwards-compatibility. + Use the provider field instead. If provider is set, the runner's kind will be + deduced from the provider. Only one of kind and provider must be set. name: The runner name for humans - provider: RunnerProvider identifies the specific implementation type of a runner. Each - provider maps to a specific kind of runner (local or remote), as specified below - for each provider. + provider: The specific implementation type of the runner This field is optional for + backwards compatibility but will be required in the future. When specified, kind + must not be specified (will be deduced from provider) extra_headers: Send extra headers diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 53c051b1..b6c7a0e0 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -116,7 +116,12 @@ def create( Args: container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have - the docker registry host + the docker registry host value must be a valid registry host (e.g. + registry.docker.com, https://registry.docker.com, ghcr.io:5050): + + ``` + this.matches("^[a-zA-Z0-9.-/:]+(:[0-9]+)?$") + ``` environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -469,7 +474,12 @@ async def create( Args: container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have - the docker registry host + the docker registry host value must be a valid registry host (e.g. + registry.docker.com, https://registry.docker.com, ghcr.io:5050): + + ``` + this.matches("^[a-zA-Z0-9.-/:]+(:[0-9]+)?$") + ``` environment_variable: secret will be created as an Environment Variable with the same name as the secret diff --git a/src/gitpod/types/environment.py b/src/gitpod/types/environment.py index 5dd6728a..560cf251 100644 --- a/src/gitpod/types/environment.py +++ b/src/gitpod/types/environment.py @@ -20,15 +20,15 @@ class Environment(BaseModel): metadata: Optional[EnvironmentMetadata] = None """ - EnvironmentMetadata is data associated with an environment that's required for - other parts of the system to function + Metadata is data associated with this environment that's required for other + parts of Gitpod to function """ spec: Optional[EnvironmentSpec] = None """ - EnvironmentSpec specifies the configuration of an environment for an environment - start + Spec is the configuration of the environment that's required for the runner to + start the environment """ status: Optional[EnvironmentStatus] = None - """EnvironmentStatus describes an environment status""" + """Status is the current status of the environment""" diff --git a/src/gitpod/types/environment_activity_signal.py b/src/gitpod/types/environment_activity_signal.py index ea825be1..afedc991 100644 --- a/src/gitpod/types/environment_activity_signal.py +++ b/src/gitpod/types/environment_activity_signal.py @@ -18,92 +18,6 @@ class EnvironmentActivitySignal(BaseModel): timestamp: Optional[datetime] = None """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. + timestamp of when the activity was observed by the source. Only reported every 5 + minutes. Zero value means no activity was observed. """ diff --git a/src/gitpod/types/environment_activity_signal_param.py b/src/gitpod/types/environment_activity_signal_param.py index d097493c..a9cb0c17 100644 --- a/src/gitpod/types/environment_activity_signal_param.py +++ b/src/gitpod/types/environment_activity_signal_param.py @@ -21,92 +21,6 @@ class EnvironmentActivitySignalParam(TypedDict, total=False): timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. + timestamp of when the activity was observed by the source. Only reported every 5 + minutes. Zero value means no activity was observed. """ diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index d8d60921..2c9806f7 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -15,6 +15,7 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False): spec: EnvironmentSpecParam """ - EnvironmentSpec specifies the configuration of an environment for an environment - start + Spec is the configuration of the environment that's required for the runner to + start the environment Configuration already defined in the Project will override + parts of the spec, if set """ diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index 33e65d81..e49a7d27 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -12,6 +12,6 @@ class EnvironmentCreateParams(TypedDict, total=False): spec: EnvironmentSpecParam """ - EnvironmentSpec specifies the configuration of an environment for an environment - start + spec is the configuration of the environment that's required for the to start + the environment """ diff --git a/src/gitpod/types/environment_initializer.py b/src/gitpod/types/environment_initializer.py index 8630b153..2a2866ae 100644 --- a/src/gitpod/types/environment_initializer.py +++ b/src/gitpod/types/environment_initializer.py @@ -36,7 +36,7 @@ class SpecGit(BaseModel): "CLONE_TARGET_MODE_LOCAL_BRANCH", ] ] = FieldInfo(alias="targetMode", default=None) - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + """the target mode determines what gets checked out""" upstream_remote_uri: Optional[str] = FieldInfo(alias="upstreamRemoteUri", default=None) """upstream_Remote_uri is the fork upstream of a repository""" diff --git a/src/gitpod/types/environment_initializer_param.py b/src/gitpod/types/environment_initializer_param.py index 32b0a649..695d8369 100644 --- a/src/gitpod/types/environment_initializer_param.py +++ b/src/gitpod/types/environment_initializer_param.py @@ -37,7 +37,7 @@ class SpecGit(TypedDict, total=False): ], PropertyInfo(alias="targetMode"), ] - """CloneTargetMode is the target state in which we want to leave a GitEnvironment""" + """the target mode determines what gets checked out""" upstream_remote_uri: Annotated[str, PropertyInfo(alias="upstreamRemoteUri")] """upstream_Remote_uri is the fork upstream of a repository""" diff --git a/src/gitpod/types/environment_mark_active_params.py b/src/gitpod/types/environment_mark_active_params.py index 8e2cbce5..0e109713 100644 --- a/src/gitpod/types/environment_mark_active_params.py +++ b/src/gitpod/types/environment_mark_active_params.py @@ -12,7 +12,7 @@ class EnvironmentMarkActiveParams(TypedDict, total=False): activity_signal: Annotated[EnvironmentActivitySignalParam, PropertyInfo(alias="activitySignal")] - """EnvironmentActivitySignal used to signal activity for an environment.""" + """activity_signal specifies the activity.""" environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """The ID of the environment to update activity for.""" diff --git a/src/gitpod/types/environment_metadata.py b/src/gitpod/types/environment_metadata.py index 412b7ae7..5d6e3803 100644 --- a/src/gitpod/types/environment_metadata.py +++ b/src/gitpod/types/environment_metadata.py @@ -19,190 +19,15 @@ class EnvironmentMetadata(BaseModel): """ created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """Time when the Environment was created.""" creator: Optional[Subject] = None """creator is the identity of the creator of the environment""" last_started_at: Optional[datetime] = FieldInfo(alias="lastStartedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. + """Time when the Environment was last started (i.e. - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. + CreateEnvironment or StartEnvironment were called). """ name: Optional[str] = None diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index b001bdca..0dd9d9d1 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -46,7 +46,7 @@ class Content(BaseModel): """The Git username""" initializer: Optional[EnvironmentInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" + """initializer configures how the environment is to be initialized""" session: Optional[str] = None @@ -55,20 +55,6 @@ class DevcontainerDotfiles(BaseModel): repository: str """URL of a dotfiles Git repository (e.g. https://github.com/owner/repository)""" - install_command: Optional[str] = FieldInfo(alias="installCommand", default=None) - """install_command is the command to run after cloning the dotfiles repository. - - Defaults to run the first file of `install.sh`, `install`, `bootstrap.sh`, - `bootstrap`, `setup.sh` and `setup` found in the dotfiles repository's root - folder. - """ - - target_path: Optional[str] = FieldInfo(alias="targetPath", default=None) - """target_path is the path to clone the dotfiles repository to. - - Defaults to `~/dotfiles`. - """ - class Devcontainer(BaseModel): devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) @@ -96,7 +82,7 @@ class Machine(BaseModel): class Port(BaseModel): admission: Optional[AdmissionLevel] = None - """Admission level describes who can access an environment instance and its ports.""" + """policy of this port""" name: Optional[str] = None """name of this port""" @@ -146,69 +132,14 @@ class SSHPublicKey(BaseModel): class Timeout(BaseModel): disconnected: Optional[str] = None """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". + inacitivity is the maximum time of disconnection before the environment is + stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. """ class EnvironmentSpec(BaseModel): admission: Optional[AdmissionLevel] = None - """Admission level describes who can access an environment instance and its ports.""" + """admission controlls who can access the environment and its ports.""" automations_file: Optional[AutomationsFile] = FieldInfo(alias="automationsFile", default=None) """automations_file is the automations file spec of the environment""" diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index 4853ee89..d30a7932 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -47,7 +47,7 @@ class Content(TypedDict, total=False): """The Git username""" initializer: EnvironmentInitializerParam - """EnvironmentInitializer specifies how an environment is to be initialized""" + """initializer configures how the environment is to be initialized""" session: str @@ -56,20 +56,6 @@ class DevcontainerDotfiles(TypedDict, total=False): repository: Required[str] """URL of a dotfiles Git repository (e.g. https://github.com/owner/repository)""" - install_command: Annotated[str, PropertyInfo(alias="installCommand")] - """install_command is the command to run after cloning the dotfiles repository. - - Defaults to run the first file of `install.sh`, `install`, `bootstrap.sh`, - `bootstrap`, `setup.sh` and `setup` found in the dotfiles repository's root - folder. - """ - - target_path: Annotated[str, PropertyInfo(alias="targetPath")] - """target_path is the path to clone the dotfiles repository to. - - Defaults to `~/dotfiles`. - """ - class Devcontainer(TypedDict, total=False): devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] @@ -103,7 +89,7 @@ class Machine(_MachineReservedKeywords, total=False): class Port(TypedDict, total=False): admission: AdmissionLevel - """Admission level describes who can access an environment instance and its ports.""" + """policy of this port""" name: str """name of this port""" @@ -153,69 +139,14 @@ class SSHPublicKey(TypedDict, total=False): class Timeout(TypedDict, total=False): disconnected: str """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". + inacitivity is the maximum time of disconnection before the environment is + stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. """ class EnvironmentSpecParam(TypedDict, total=False): admission: AdmissionLevel - """Admission level describes who can access an environment instance and its ports.""" + """admission controlls who can access the environment and its ports.""" automations_file: Annotated[AutomationsFile, PropertyInfo(alias="automationsFile")] """automations_file is the automations file spec of the environment""" diff --git a/src/gitpod/types/environment_status.py b/src/gitpod/types/environment_status.py index 6fd1a830..3539b281 100644 --- a/src/gitpod/types/environment_status.py +++ b/src/gitpod/types/environment_status.py @@ -342,7 +342,7 @@ class SSHPublicKey(BaseModel): class EnvironmentStatus(BaseModel): activity_signal: Optional[EnvironmentActivitySignal] = FieldInfo(alias="activitySignal", default=None) - """EnvironmentActivitySignal used to signal activity for an environment.""" + """activity_signal is the last activity signal for the environment.""" automations_file: Optional[AutomationsFile] = FieldInfo(alias="automationsFile", default=None) """automations_file contains the status of the automations file.""" @@ -377,7 +377,7 @@ class EnvironmentStatus(BaseModel): runner_ack: Optional[RunnerAck] = FieldInfo(alias="runnerAck", default=None) """ - RunnerACK is the acknowledgement from the runner that is has received the + runner_ack contains the acknowledgement from the runner that is has received the environment spec. """ diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index 9768d6ba..dba8d011 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -56,7 +56,7 @@ class SpecContent(TypedDict, total=False): """The Git username""" initializer: Optional[EnvironmentInitializerParam] - """EnvironmentInitializer specifies how an environment is to be initialized""" + """initializer configures how the environment is to be initialized""" session: Optional[str] """session should be changed to trigger a content reinitialization""" @@ -79,7 +79,7 @@ class SpecDevcontainer(TypedDict, total=False): class SpecPort(TypedDict, total=False): admission: AdmissionLevel - """Admission level describes who can access an environment instance and its ports.""" + """policy of this port""" name: str """name of this port""" @@ -102,63 +102,8 @@ class SpecSSHPublicKey(TypedDict, total=False): class SpecTimeout(TypedDict, total=False): disconnected: Optional[str] """ - A Duration represents a signed, fixed-length span of time represented as a count - of seconds and fractions of seconds at nanosecond resolution. It is independent - of any calendar and concepts like "day" or "month". It is related to Timestamp - in that the difference between two Timestamp values is a Duration and it can be - added or subtracted from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an object, - where the string ends in the suffix "s" (indicating seconds) and is preceded by - the number of seconds, with nanoseconds expressed as fractional seconds. For - example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - while 3 seconds and 1 nanosecond should be expressed in JSON format as - "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - format as "3.000001s". + inacitivity is the maximum time of disconnection before the environment is + stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. """ diff --git a/src/gitpod/types/environments/automations/service_metadata.py b/src/gitpod/types/environments/automations/service_metadata.py index b21e2c66..4555022d 100644 --- a/src/gitpod/types/environments/automations/service_metadata.py +++ b/src/gitpod/types/environments/automations/service_metadata.py @@ -14,96 +14,7 @@ class ServiceMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """created_at is the time the service was created.""" creator: Optional[Subject] = None """creator describes the principal who created the service.""" diff --git a/src/gitpod/types/environments/automations/service_metadata_param.py b/src/gitpod/types/environments/automations/service_metadata_param.py index 8599c69e..669b250a 100644 --- a/src/gitpod/types/environments/automations/service_metadata_param.py +++ b/src/gitpod/types/environments/automations/service_metadata_param.py @@ -15,96 +15,7 @@ class ServiceMetadataParam(TypedDict, total=False): created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """created_at is the time the service was created.""" creator: Subject """creator describes the principal who created the service.""" diff --git a/src/gitpod/types/organizations/domain_verification.py b/src/gitpod/types/organizations/domain_verification.py index abb36051..3d2e32aa 100644 --- a/src/gitpod/types/organizations/domain_verification.py +++ b/src/gitpod/types/organizations/domain_verification.py @@ -20,6 +20,100 @@ class DomainVerification(BaseModel): state: DomainVerificationState + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + verification_token: Optional[str] = FieldInfo(alias="verificationToken", default=None) + verified_at: Optional[datetime] = FieldInfo(alias="verifiedAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local diff --git a/src/gitpod/types/project.py b/src/gitpod/types/project.py index 9fc31a92..72037bc1 100644 --- a/src/gitpod/types/project.py +++ b/src/gitpod/types/project.py @@ -43,7 +43,7 @@ class Project(BaseModel): """ initializer: Optional[EnvironmentInitializer] = None - """EnvironmentInitializer specifies how an environment is to be initialized""" + """initializer is the content initializer""" metadata: Optional[ProjectMetadata] = None diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index cb04ea57..db0326d9 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -15,7 +15,7 @@ class ProjectCreateParams(TypedDict, total=False): environment_class: Required[Annotated[ProjectEnvironmentClassParam, PropertyInfo(alias="environmentClass")]] initializer: Required[EnvironmentInitializerParam] - """EnvironmentInitializer specifies how an environment is to be initialized""" + """initializer is the content initializer""" automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py index c22d35e0..04dbed99 100644 --- a/src/gitpod/types/project_update_params.py +++ b/src/gitpod/types/project_update_params.py @@ -36,7 +36,7 @@ class ProjectUpdateParams(TypedDict, total=False): environment_class: Annotated[Optional[ProjectEnvironmentClassParam], PropertyInfo(alias="environmentClass")] initializer: Optional[EnvironmentInitializerParam] - """EnvironmentInitializer specifies how an environment is to be initialized""" + """initializer is the content initializer""" name: Optional[str] diff --git a/src/gitpod/types/runner.py b/src/gitpod/types/runner.py index 505ab368..ec169a36 100644 --- a/src/gitpod/types/runner.py +++ b/src/gitpod/types/runner.py @@ -17,112 +17,19 @@ class Runner(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """Time when the Runner was created.""" creator: Optional[Subject] = None """creator is the identity of the creator of the environment""" kind: Optional[RunnerKind] = None - """RunnerKind represents the kind of a runner""" + """The runner's kind""" name: Optional[str] = None """The runner's name which is shown to users""" provider: Optional[RunnerProvider] = None - """ - RunnerProvider identifies the specific implementation type of a runner. Each - provider maps to a specific kind of runner (local or remote), as specified below - for each provider. - """ + """The runner's provider""" runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) @@ -130,96 +37,7 @@ class Runner(BaseModel): """The runner's specification""" status: Optional[RunnerStatus] = None - """RunnerStatus represents the status of a runner""" + """The runner's status""" updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """Time when the Runner was last udpated.""" diff --git a/src/gitpod/types/runner_create_params.py b/src/gitpod/types/runner_create_params.py index fc5580ff..6509b953 100644 --- a/src/gitpod/types/runner_create_params.py +++ b/src/gitpod/types/runner_create_params.py @@ -13,16 +13,20 @@ class RunnerCreateParams(TypedDict, total=False): kind: RunnerKind - """RunnerKind represents the kind of a runner""" + """The runner's kind This field is optional and here for backwards-compatibility. + + Use the provider field instead. If provider is set, the runner's kind will be + deduced from the provider. Only one of kind and provider must be set. + """ name: str """The runner name for humans""" provider: RunnerProvider """ - RunnerProvider identifies the specific implementation type of a runner. Each - provider maps to a specific kind of runner (local or remote), as specified below - for each provider. + The specific implementation type of the runner This field is optional for + backwards compatibility but will be required in the future. When specified, kind + must not be specified (will be deduced from provider) """ spec: RunnerSpecParam diff --git a/src/gitpod/types/runner_status.py b/src/gitpod/types/runner_status.py index e516dcbf..53a0dd5d 100644 --- a/src/gitpod/types/runner_status.py +++ b/src/gitpod/types/runner_status.py @@ -32,7 +32,7 @@ class RunnerStatus(BaseModel): """ phase: Optional[RunnerPhase] = None - """RunnerPhase represents the phase a runner is in""" + """The runner's reported phase""" region: Optional[str] = None """region is the region the runner is running in, if applicable.""" @@ -40,95 +40,6 @@ class RunnerStatus(BaseModel): system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """Time when the status was last udpated.""" version: Optional[str] = None diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index 975f0693..677a245c 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -37,4 +37,14 @@ class Spec(TypedDict, total=False): configuration: Optional[SpecConfiguration] desired_phase: Annotated[Optional[RunnerPhase], PropertyInfo(alias="desiredPhase")] - """RunnerPhase represents the phase a runner is in""" + """ + desired_phase can currently only be updated on local-configuration runners, to + toggle whether local runners are allowed for running environments in the + organization. Set to: + + - ACTIVE to enable local runners. + - INACTIVE to disable all local runners. Existing local runners and their + environments will stop, and cannot be started again until the desired_phase is + set to ACTIVE. Use this carefully, as it will affect all users in the + organization who use local runners. + """ diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index e59b2704..aa01b609 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -13,7 +13,12 @@ class SecretCreateParams(TypedDict, total=False): container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] """ secret will be mounted as a docker config in the environment VM, mount will have - the docker registry host + the docker registry host value must be a valid registry host (e.g. + registry.docker.com, https://registry.docker.com, ghcr.io:5050): + + ``` + this.matches('^[a-zA-Z0-9.-/:]+(:[0-9]+)?$') + ``` """ environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] diff --git a/src/gitpod/types/shared/task_execution_metadata.py b/src/gitpod/types/shared/task_execution_metadata.py index b0e28c96..8e723210 100644 --- a/src/gitpod/types/shared/task_execution_metadata.py +++ b/src/gitpod/types/shared/task_execution_metadata.py @@ -13,188 +13,10 @@ class TaskExecutionMetadata(BaseModel): completed_at: Optional[datetime] = FieldInfo(alias="completedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """completed_at is the time the task execution was done.""" created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """created_at is the time the task was created.""" creator: Optional[Subject] = None """creator describes the principal who created/started the task run.""" @@ -203,96 +25,7 @@ class TaskExecutionMetadata(BaseModel): """environment_id is the ID of the environment in which the task run is executed.""" started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """started_at is the time the task execution actually started to run.""" started_by: Optional[str] = FieldInfo(alias="startedBy", default=None) """started_by describes the trigger that started the task execution.""" diff --git a/src/gitpod/types/shared/task_metadata.py b/src/gitpod/types/shared/task_metadata.py index 23e6c2c1..6a34633d 100644 --- a/src/gitpod/types/shared/task_metadata.py +++ b/src/gitpod/types/shared/task_metadata.py @@ -14,96 +14,7 @@ class TaskMetadata(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """created_at is the time the task was created.""" creator: Optional[Subject] = None """creator describes the principal who created the task.""" diff --git a/src/gitpod/types/shared_params/task_metadata.py b/src/gitpod/types/shared_params/task_metadata.py index 50ffda7e..2523ba65 100644 --- a/src/gitpod/types/shared_params/task_metadata.py +++ b/src/gitpod/types/shared_params/task_metadata.py @@ -15,96 +15,7 @@ class TaskMetadata(TypedDict, total=False): created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """created_at is the time the task was created.""" creator: Subject """creator describes the principal who created the task.""" diff --git a/src/gitpod/types/user.py b/src/gitpod/types/user.py index f6c16cb1..a8ce63f8 100644 --- a/src/gitpod/types/user.py +++ b/src/gitpod/types/user.py @@ -19,96 +19,7 @@ class User(BaseModel): """avatar_url is a link to the user avatar""" created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at nanosecond - resolution. The count is relative to an epoch at UTC midnight on January 1, - 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a - [24-hour linear smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - zero-padded to two digits each. The fractional seconds, which can go up to 9 - digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - serializer should always use UTC (as indicated by "Z") when printing the - Timestamp type and a proto3 JSON parser should be able to accept both UTC and - other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted to - this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - Joda Time's - [`ISODateTimeFormat.dateTime()`]() - to obtain a formatter capable of generating timestamps in this format. - """ + """created_at is the creation time""" name: Optional[str] = None """name is the full name of the user""" diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 9733680e..3784290a 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -63,11 +63,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { "devcontainer_file_path": "devcontainerFilePath", - "dotfiles": { - "repository": "https://example.com", - "install_command": "installCommand", - "target_path": "targetPath", - }, + "dotfiles": {"repository": "https://example.com"}, "session": "session", }, "machine": { @@ -365,11 +361,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { "devcontainer_file_path": "devcontainerFilePath", - "dotfiles": { - "repository": "https://example.com", - "install_command": "installCommand", - "target_path": "targetPath", - }, + "dotfiles": {"repository": "https://example.com"}, "session": "session", }, "machine": { @@ -619,11 +611,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { "devcontainer_file_path": "devcontainerFilePath", - "dotfiles": { - "repository": "https://example.com", - "install_command": "installCommand", - "target_path": "targetPath", - }, + "dotfiles": {"repository": "https://example.com"}, "session": "session", }, "machine": { @@ -921,11 +909,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { "devcontainer_file_path": "devcontainerFilePath", - "dotfiles": { - "repository": "https://example.com", - "install_command": "installCommand", - "target_path": "targetPath", - }, + "dotfiles": {"repository": "https://example.com"}, "session": "session", }, "machine": { diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 414aab03..84caf8b4 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -32,7 +32,7 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( - container_registry_basic_auth_host="https://example.com", + container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="DATABASE_URL", @@ -228,7 +228,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( - container_registry_basic_auth_host="https://example.com", + container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="DATABASE_URL", From 62068fa815e3c3a0456143059326d20d46e8ee0f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 03:51:13 +0000 Subject: [PATCH 127/505] chore(internal): fix devcontainers setup (#65) --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ac9a2e75..55d20255 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,4 +6,4 @@ USER vscode RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash ENV PATH=/home/vscode/.rye/shims:$PATH -RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc +RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bbeb30b1..c17fdc16 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,6 +24,9 @@ } } } + }, + "features": { + "ghcr.io/devcontainers/features/node:1": {} } // Features to add to the dev container. More info: https://containers.dev/features. From e7541d812acaebf8744dcf80e1227fa4b0232da9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 03:30:53 +0000 Subject: [PATCH 128/505] chore(internal): properly set __pydantic_private__ (#66) --- src/gitpod/_base_client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 1772072c..dabdb6ea 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -63,7 +63,7 @@ ModelBuilderProtocol, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping -from ._compat import model_copy, model_dump +from ._compat import PYDANTIC_V2, model_copy, model_dump from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, @@ -207,6 +207,9 @@ def _set_private_attributes( model: Type[_T], options: FinalRequestOptions, ) -> None: + if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + self.__pydantic_private__ = {} + self._model = model self._client = client self._options = options @@ -292,6 +295,9 @@ def _set_private_attributes( client: AsyncAPIClient, options: FinalRequestOptions, ) -> None: + if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + self.__pydantic_private__ = {} + self._model = model self._client = client self._options = options From cc6a626fef95fae0c7bc2f3ec39ad661395dfc42 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 03:07:55 +0000 Subject: [PATCH 129/505] docs: update URLs from stainlessapi.com to stainless.com (#67) More details at https://www.stainless.com/changelog/stainless-com --- README.md | 2 +- SECURITY.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 468f5367..3abc0672 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The Gitpod Python library provides convenient access to the Gitpod REST API from application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx). -It is generated with [Stainless](https://www.stainlessapi.com/). +It is generated with [Stainless](https://www.stainless.com/). ## Documentation diff --git a/SECURITY.md b/SECURITY.md index 0985c82e..2b0ed909 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,9 +2,9 @@ ## Reporting Security Issues -This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. -To report a security issue, please contact the Stainless team at security@stainlessapi.com. +To report a security issue, please contact the Stainless team at security@stainless.com. ## Responsible Disclosure From b6d9912f274ea6cb675daf6f04bf280fb3ac53a7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 03:08:49 +0000 Subject: [PATCH 130/505] chore(docs): update client docstring (#68) --- src/gitpod/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 3fad133c..4b844ac0 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -82,7 +82,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new synchronous gitpod client instance. + """Construct a new synchronous Gitpod client instance. This automatically infers the `bearer_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided. """ @@ -270,7 +270,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new async gitpod client instance. + """Construct a new async AsyncGitpod client instance. This automatically infers the `bearer_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided. """ From 61b53dad43f6a3f4f4a384a6694607650475448b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 04:02:41 +0000 Subject: [PATCH 131/505] chore(internal): remove unused http client options forwarding --- src/gitpod/_base_client.py | 97 +------------------------------------- 1 file changed, 1 insertion(+), 96 deletions(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index dabdb6ea..0a82a2c1 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -9,7 +9,6 @@ import inspect import logging import platform -import warnings import email.utils from types import TracebackType from random import random @@ -36,7 +35,7 @@ import httpx import distro import pydantic -from httpx import URL, Limits +from httpx import URL from pydantic import PrivateAttr from . import _exceptions @@ -51,13 +50,10 @@ Timeout, NotGiven, ResponseT, - Transport, AnyMapping, PostParser, - ProxiesTypes, RequestFiles, HttpxSendArgs, - AsyncTransport, RequestOptions, HttpxRequestFiles, ModelBuilderProtocol, @@ -337,9 +333,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]): _base_url: URL max_retries: int timeout: Union[float, Timeout, None] - _limits: httpx.Limits - _proxies: ProxiesTypes | None - _transport: Transport | AsyncTransport | None _strict_response_validation: bool _idempotency_header: str | None _default_stream_cls: type[_DefaultStreamT] | None = None @@ -352,9 +345,6 @@ def __init__( _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None = DEFAULT_TIMEOUT, - limits: httpx.Limits, - transport: Transport | AsyncTransport | None, - proxies: ProxiesTypes | None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: @@ -362,9 +352,6 @@ def __init__( self._base_url = self._enforce_trailing_slash(URL(base_url)) self.max_retries = max_retries self.timeout = timeout - self._limits = limits - self._proxies = proxies - self._transport = transport self._custom_headers = custom_headers or {} self._custom_query = custom_query or {} self._strict_response_validation = _strict_response_validation @@ -800,46 +787,11 @@ def __init__( base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - transport: Transport | None = None, - proxies: ProxiesTypes | None = None, - limits: Limits | None = None, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, _strict_response_validation: bool, ) -> None: - kwargs: dict[str, Any] = {} - if limits is not None: - warnings.warn( - "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") - else: - limits = DEFAULT_CONNECTION_LIMITS - - if transport is not None: - kwargs["transport"] = transport - warnings.warn( - "The `transport` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `transport`") - - if proxies is not None: - kwargs["proxies"] = proxies - warnings.warn( - "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") - if not is_given(timeout): # if the user passed in a custom http client with a non-default # timeout set then we use that timeout. @@ -860,12 +812,9 @@ def __init__( super().__init__( version=version, - limits=limits, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, base_url=base_url, - transport=transport, max_retries=max_retries, custom_query=custom_query, custom_headers=custom_headers, @@ -875,9 +824,6 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - limits=limits, - follow_redirects=True, - **kwargs, # type: ignore ) def is_closed(self) -> bool: @@ -1372,45 +1318,10 @@ def __init__( _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - transport: AsyncTransport | None = None, - proxies: ProxiesTypes | None = None, - limits: Limits | None = None, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: - kwargs: dict[str, Any] = {} - if limits is not None: - warnings.warn( - "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") - else: - limits = DEFAULT_CONNECTION_LIMITS - - if transport is not None: - kwargs["transport"] = transport - warnings.warn( - "The `transport` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `transport`") - - if proxies is not None: - kwargs["proxies"] = proxies - warnings.warn( - "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") - if not is_given(timeout): # if the user passed in a custom http client with a non-default # timeout set then we use that timeout. @@ -1432,11 +1343,8 @@ def __init__( super().__init__( version=version, base_url=base_url, - limits=limits, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, max_retries=max_retries, custom_query=custom_query, custom_headers=custom_headers, @@ -1446,9 +1354,6 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - limits=limits, - follow_redirects=True, - **kwargs, # type: ignore ) def is_closed(self) -> bool: From 4ca777fe338d42d46e66f346fbc0f8a9e70361fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 06:44:35 +0000 Subject: [PATCH 132/505] chore(internal): codegen related update (#70) --- README.md | 15 +++++++++++++++ scripts/test | 2 ++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index 3abc0672..cc5daa23 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,21 @@ for environment in first_page.environments: # Remove `await` for non-async usage. ``` +## Nested params + +Nested parameters are dictionaries, typed using `TypedDict`, for example: + +```python +from gitpod import Gitpod + +client = Gitpod() + +page = client.accounts.list_login_providers( + filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, +) +print(page.login_providers) +``` + ## Handling errors When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `gitpod.APIConnectionError` is raised. diff --git a/scripts/test b/scripts/test index 4fa5698b..2b878456 100755 --- a/scripts/test +++ b/scripts/test @@ -52,6 +52,8 @@ else echo fi +export DEFER_PYDANTIC_BUILD=false + echo "==> Running tests" rye run pytest "$@" From e7fcd6d81f3e42dc1131ced82de35652c3661087 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 04:40:12 +0000 Subject: [PATCH 133/505] chore(internal): remove extra empty newlines (#71) --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fca555e0..0aa54fff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,6 @@ Homepage = "https://github.com/gitpod-io/gitpod-sdk-python" Repository = "https://github.com/gitpod-io/gitpod-sdk-python" - [tool.rye] managed = true # version pins are in requirements-dev.lock @@ -152,7 +151,6 @@ reportImplicitOverride = true reportImportCycles = false reportPrivateUsage = false - [tool.ruff] line-length = 120 output-format = "grouped" From 71a0d3f3722cb9c7b5764e4dc33ec3c089df57fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 03:58:53 +0000 Subject: [PATCH 134/505] chore(internal): codegen related update (#72) --- requirements-dev.lock | 1 + requirements.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/requirements-dev.lock b/requirements-dev.lock index cc60f656..7947716c 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -7,6 +7,7 @@ # all-features: true # with-sources: false # generate-hashes: false +# universal: false -e file:. annotated-types==0.6.0 diff --git a/requirements.lock b/requirements.lock index 65e76183..b542a715 100644 --- a/requirements.lock +++ b/requirements.lock @@ -7,6 +7,7 @@ # all-features: true # with-sources: false # generate-hashes: false +# universal: false -e file:. annotated-types==0.6.0 From 78fbbb59cc4a0365e485d7e7aa4b781b62b04c16 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 04:04:47 +0000 Subject: [PATCH 135/505] chore(internal): bump rye to 0.44.0 (#73) --- .devcontainer/Dockerfile | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish-pypi.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 55d20255..ff261bad 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} USER vscode -RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash +RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash ENV PATH=/home/vscode/.rye/shims:$PATH RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8a8a4f7..3b286e5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: '0.35.0' + RYE_VERSION: '0.44.0' RYE_INSTALL_OPTION: '--yes' - name: Install dependencies @@ -42,7 +42,7 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: '0.35.0' + RYE_VERSION: '0.44.0' RYE_INSTALL_OPTION: '--yes' - name: Bootstrap diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index df62ae14..6cd33a62 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -21,7 +21,7 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: '0.35.0' + RYE_VERSION: '0.44.0' RYE_INSTALL_OPTION: '--yes' - name: Publish to PyPI From 8dcc081117ea5d7e1c4ac26aea2cb3ce4250348c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 04:11:42 +0000 Subject: [PATCH 136/505] fix(types): handle more discriminated union shapes (#74) --- src/gitpod/_models.py | 7 +++++-- tests/test_models.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index c4401ff8..b51a1bf5 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -65,7 +65,7 @@ from ._constants import RAW_RESPONSE_HEADER if TYPE_CHECKING: - from pydantic_core.core_schema import ModelField, LiteralSchema, ModelFieldsSchema + from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema __all__ = ["BaseModel", "GenericModel"] @@ -646,15 +646,18 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, def _extract_field_schema_pv2(model: type[BaseModel], field_name: str) -> ModelField | None: schema = model.__pydantic_core_schema__ + if schema["type"] == "definitions": + schema = schema["schema"] + if schema["type"] != "model": return None + schema = cast("ModelSchema", schema) fields_schema = schema["schema"] if fields_schema["type"] != "model-fields": return None fields_schema = cast("ModelFieldsSchema", fields_schema) - field = fields_schema["fields"].get(field_name) if not field: return None diff --git a/tests/test_models.py b/tests/test_models.py index c581777c..8c0e1696 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -854,3 +854,35 @@ class Model(BaseModel): m = construct_type(value={"cls": "foo"}, type_=Model) assert isinstance(m, Model) assert isinstance(m.cls, str) + + +def test_discriminated_union_case() -> None: + class A(BaseModel): + type: Literal["a"] + + data: bool + + class B(BaseModel): + type: Literal["b"] + + data: List[Union[A, object]] + + class ModelA(BaseModel): + type: Literal["modelA"] + + data: int + + class ModelB(BaseModel): + type: Literal["modelB"] + + required: str + + data: Union[A, B] + + # when constructing ModelA | ModelB, value data doesn't match ModelB exactly - missing `required` + m = construct_type( + value={"type": "modelB", "data": {"type": "a", "data": True}}, + type_=cast(Any, Annotated[Union[ModelA, ModelB], PropertyInfo(discriminator="type")]), + ) + + assert isinstance(m, ModelB) From 88e89b6d2df153fdbf4cec9971cf4bc7f5968638 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 17:55:58 +0000 Subject: [PATCH 137/505] fix(ci): ensure pip is always available (#75) --- bin/publish-pypi | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/publish-pypi b/bin/publish-pypi index 05bfccbb..ebebf916 100644 --- a/bin/publish-pypi +++ b/bin/publish-pypi @@ -5,5 +5,6 @@ mkdir -p dist rye build --clean # Patching importlib-metadata version until upstream library version is updated # https://github.com/pypa/twine/issues/977#issuecomment-2189800841 +"$HOME/.rye/self/bin/python3" -m ensurepip "$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1' rye publish --yes --token=$PYPI_TOKEN From c05b3b20baf7d0a1cffcce606a182f1176fea473 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:03:55 +0000 Subject: [PATCH 138/505] fix(ci): remove publishing patch (#76) --- bin/publish-pypi | 4 ---- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/publish-pypi b/bin/publish-pypi index ebebf916..826054e9 100644 --- a/bin/publish-pypi +++ b/bin/publish-pypi @@ -3,8 +3,4 @@ set -eux mkdir -p dist rye build --clean -# Patching importlib-metadata version until upstream library version is updated -# https://github.com/pypa/twine/issues/977#issuecomment-2189800841 -"$HOME/.rye/self/bin/python3" -m ensurepip -"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1' rye publish --yes --token=$PYPI_TOKEN diff --git a/pyproject.toml b/pyproject.toml index 0aa54fff..4ba6414f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,7 @@ typecheck = { chain = [ "typecheck:mypy" = "mypy ." [build-system] -requires = ["hatchling", "hatch-fancy-pypi-readme"] +requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"] build-backend = "hatchling.build" [tool.hatch.build] From efe9b6ac6d0e0e484214dcad48734947accc6d65 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 03:34:08 +0000 Subject: [PATCH 139/505] chore: fix typos (#77) --- src/gitpod/_models.py | 2 +- src/gitpod/_utils/_transform.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index b51a1bf5..34935716 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -681,7 +681,7 @@ def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None: setattr(typ, "__pydantic_config__", config) # noqa: B010 -# our use of subclasssing here causes weirdness for type checkers, +# our use of subclassing here causes weirdness for type checkers, # so we just pretend that we don't subclass if TYPE_CHECKING: GenericModel = BaseModel diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index 18afd9d8..7ac2e17f 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -126,7 +126,7 @@ def _get_annotated_type(type_: type) -> type | None: def _maybe_transform_key(key: str, type_: type) -> str: """Transform the given `data` based on the annotations provided in `type_`. - Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata. + Note: this function only looks at `Annotated` types that contain `PropertyInfo` metadata. """ annotated_type = _get_annotated_type(type_) if annotated_type is None: From 3f20135f35f82c7a1eea9f5e3a80956d9f98eef9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 03:35:16 +0000 Subject: [PATCH 140/505] codegen metadata --- .stats.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.stats.yml b/.stats.yml index 2c4d8acc..e8f1d28e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,4 @@ configured_endpoints: 111 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3655d5ad0ac3e228c1519af70dbf3d0bfa3c47a2d06d4cac92a650da051b49a6.yml +openapi_spec_hash: 5dbb5577e6a7cae7db615b1b06c9d23e +config_hash: 719ad411c0ec7402a7a4c1f95515280c From e008afdc6547eb9f7e3e57c9cfff4224bab61a02 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 08:08:21 +0000 Subject: [PATCH 141/505] chore(internal): remove trailing character (#78) --- tests/test_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index c3fd3cab..2dfdeca2 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1662,7 +1662,7 @@ def test_get_platform(self) -> None: import threading from gitpod._utils import asyncify - from gitpod._base_client import get_platform + from gitpod._base_client import get_platform async def test_main() -> None: result = await asyncify(get_platform)() From 29273123d44fb44c72861fa8e184a9840c043a1f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 08:18:09 +0000 Subject: [PATCH 142/505] chore(internal): variable name and test updates (#79) --- tests/api_resources/test_events.py | 34 ++++++++++++++---------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 977730ed..77b33af8 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -69,27 +69,26 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_method_watch(self, client: Gitpod) -> None: - event = client.events.watch() - assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + event_stream = client.events.watch() + assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_method_watch_with_all_params(self, client: Gitpod) -> None: - event = client.events.watch( + event_stream = client.events.watch( environment_id="environmentId", organization=True, ) - assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize def test_raw_response_watch(self, client: Gitpod) -> None: response = client.events.with_raw_response.watch() - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - event = response.parse() - assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + stream = response.parse() + stream.close() @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize @@ -98,8 +97,8 @@ def test_streaming_response_watch(self, client: Gitpod) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - event = response.parse() - assert_matches_type(JSONLDecoder[EventWatchResponse], event, path=["response"]) + stream = response.parse() + stream.close() assert cast(Any, response.is_closed) is True @@ -157,27 +156,26 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_method_watch(self, async_client: AsyncGitpod) -> None: - event = await async_client.events.watch() - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + event_stream = await async_client.events.watch() + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> None: - event = await async_client.events.watch( + event_stream = await async_client.events.watch( environment_id="environmentId", organization=True, ) - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.watch() - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - event = await response.parse() - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + stream = await response.parse() + await stream.close() @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") @parametrize @@ -186,7 +184,7 @@ async def test_streaming_response_watch(self, async_client: AsyncGitpod) -> None assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - event = await response.parse() - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event, path=["response"]) + stream = await response.parse() + await stream.close() assert cast(Any, response.is_closed) is True From b2358e383aee543b1c7a8a15974fd622016ac77b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 02:29:32 +0000 Subject: [PATCH 143/505] chore(internal): slight transform perf improvement (#80) --- src/gitpod/_utils/_transform.py | 22 ++++++++++++++++++++++ tests/test_transform.py | 12 ++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index 7ac2e17f..3ec62081 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -142,6 +142,10 @@ def _maybe_transform_key(key: str, type_: type) -> str: return key +def _no_transform_needed(annotation: type) -> bool: + return annotation == float or annotation == int + + def _transform_recursive( data: object, *, @@ -184,6 +188,15 @@ def _transform_recursive( return cast(object, data) inner_type = extract_type_arg(stripped_type, 0) + if _no_transform_needed(inner_type): + # for some types there is no need to transform anything, so we can get a small + # perf boost from skipping that work. + # + # but we still need to convert to a list to ensure the data is json-serializable + if is_list(data): + return data + return list(data) + return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] if is_union_type(stripped_type): @@ -332,6 +345,15 @@ async def _async_transform_recursive( return cast(object, data) inner_type = extract_type_arg(stripped_type, 0) + if _no_transform_needed(inner_type): + # for some types there is no need to transform anything, so we can get a small + # perf boost from skipping that work. + # + # but we still need to convert to a list to ensure the data is json-serializable + if is_list(data): + return data + return list(data) + return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] if is_union_type(stripped_type): diff --git a/tests/test_transform.py b/tests/test_transform.py index 816139f0..d4df30cc 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -432,3 +432,15 @@ async def test_base64_file_input(use_async: bool) -> None: assert await transform({"foo": io.BytesIO(b"Hello, world!")}, TypedDictBase64Input, use_async) == { "foo": "SGVsbG8sIHdvcmxkIQ==" } # type: ignore[comparison-overlap] + + +@parametrize +@pytest.mark.asyncio +async def test_transform_skipping(use_async: bool) -> None: + # lists of ints are left as-is + data = [1, 2, 3] + assert await transform(data, List[int], use_async) is data + + # iterables of ints are converted to a list + data = iter([1, 2, 3]) + assert await transform(data, Iterable[int], use_async) == [1, 2, 3] From bb571b6dc58cac635e3dadda7829c6a87defeb26 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 02:30:10 +0000 Subject: [PATCH 144/505] chore(tests): improve enum examples (#81) --- .../automations/tasks/test_executions.py | 4 ++-- .../environments/test_automations.py | 8 ++++---- tests/api_resources/projects/test_policies.py | 8 ++++---- .../test_host_authentication_tokens.py | 4 ++-- tests/api_resources/runners/test_policies.py | 8 ++++---- tests/api_resources/test_events.py | 4 ++-- tests/api_resources/test_organizations.py | 8 ++++---- tests/api_resources/test_runners.py | 20 +++++++++---------- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index 722a618e..1adffcca 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -71,7 +71,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED", "TASK_EXECUTION_PHASE_PENDING"], + "phases": ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"], "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "task_references": ["string"], }, @@ -196,7 +196,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - "phases": ["TASK_EXECUTION_PHASE_UNSPECIFIED", "TASK_EXECUTION_PHASE_PENDING"], + "phases": ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"], "task_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "task_references": ["string"], }, diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 52ebff82..5d9cff16 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -43,7 +43,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", } }, - "triggered_by": ["manual"], + "triggered_by": ["postDevcontainerStart"], } }, "tasks": { @@ -58,7 +58,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", } }, - "triggered_by": ["manual"], + "triggered_by": ["postEnvironmentStart"], } }, }, @@ -118,7 +118,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", } }, - "triggered_by": ["manual"], + "triggered_by": ["postDevcontainerStart"], } }, "tasks": { @@ -133,7 +133,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", } }, - "triggered_by": ["manual"], + "triggered_by": ["postEnvironmentStart"], } }, }, diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index fdd40b73..ff81a486 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -34,7 +34,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", - role="PROJECT_ROLE_UNSPECIFIED", + role="PROJECT_ROLE_ADMIN", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -72,7 +72,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", - role="PROJECT_ROLE_UNSPECIFIED", + role="PROJECT_ROLE_EDITOR", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -193,7 +193,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> policy = await async_client.projects.policies.create( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", - role="PROJECT_ROLE_UNSPECIFIED", + role="PROJECT_ROLE_ADMIN", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -231,7 +231,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> policy = await async_client.projects.policies.update( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", - role="PROJECT_ROLE_UNSPECIFIED", + role="PROJECT_ROLE_EDITOR", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 684e0f4d..7667d3ca 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: host="github.com", refresh_token="ghr_xxxxxxxxxxxx", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", - source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -240,7 +240,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> host="github.com", refresh_token="ghr_xxxxxxxxxxxx", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", - source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", + source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index a5da4a8d..b94c9fff 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -33,7 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="RUNNER_ROLE_UNSPECIFIED", + role="RUNNER_ROLE_ADMIN", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -71,7 +71,7 @@ def test_method_update(self, client: Gitpod) -> None: def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="RUNNER_ROLE_UNSPECIFIED", + role="RUNNER_ROLE_USER", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -192,7 +192,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="RUNNER_ROLE_UNSPECIFIED", + role="RUNNER_ROLE_ADMIN", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -230,7 +230,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="RUNNER_ROLE_UNSPECIFIED", + role="RUNNER_ROLE_USER", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 77b33af8..fa926d85 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -33,7 +33,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], - "actor_principals": ["PRINCIPAL_UNSPECIFIED"], + "actor_principals": ["PRINCIPAL_USER"], "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], }, @@ -120,7 +120,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], - "actor_principals": ["PRINCIPAL_UNSPECIFIED"], + "actor_principals": ["PRINCIPAL_USER"], "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], }, diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 62a55039..7d24c5c2 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -163,7 +163,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 50, }, - scope="SCOPE_UNSPECIFIED", + scope="SCOPE_ALL", ) assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) @@ -357,7 +357,7 @@ def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="ORGANIZATION_ROLE_UNSPECIFIED", + role="ORGANIZATION_ROLE_MEMBER", ) assert_matches_type(object, organization, path=["response"]) @@ -531,7 +531,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 50, }, - scope="SCOPE_UNSPECIFIED", + scope="SCOPE_ALL", ) assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) @@ -725,7 +725,7 @@ async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) organization = await async_client.organizations.set_role( organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", - role="ORGANIZATION_ROLE_UNSPECIFIED", + role="ORGANIZATION_ROLE_MEMBER", ) assert_matches_type(object, organization, path=["response"]) diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 8968127a..45caf1c2 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -37,14 +37,14 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( kind="RUNNER_KIND_UNSPECIFIED", name="Production Runner", - provider="RUNNER_PROVIDER_UNSPECIFIED", + provider="RUNNER_PROVIDER_AWS_EC2", spec={ "configuration": { "auto_update": True, "region": "us-west", - "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, - "desired_phase": "RUNNER_PHASE_UNSPECIFIED", + "desired_phase": "RUNNER_PHASE_ACTIVE", }, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @@ -122,7 +122,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: spec={ "configuration": { "auto_update": True, - "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + "release_channel": "RUNNER_RELEASE_CHANNEL_LATEST", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, @@ -166,7 +166,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "kinds": ["RUNNER_KIND_UNSPECIFIED"], - "providers": ["RUNNER_PROVIDER_UNSPECIFIED"], + "providers": ["RUNNER_PROVIDER_AWS_EC2"], }, pagination={ "token": "token", @@ -360,14 +360,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> runner = await async_client.runners.create( kind="RUNNER_KIND_UNSPECIFIED", name="Production Runner", - provider="RUNNER_PROVIDER_UNSPECIFIED", + provider="RUNNER_PROVIDER_AWS_EC2", spec={ "configuration": { "auto_update": True, "region": "us-west", - "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, - "desired_phase": "RUNNER_PHASE_UNSPECIFIED", + "desired_phase": "RUNNER_PHASE_ACTIVE", }, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @@ -445,7 +445,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> spec={ "configuration": { "auto_update": True, - "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", + "release_channel": "RUNNER_RELEASE_CHANNEL_LATEST", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, @@ -489,7 +489,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "kinds": ["RUNNER_KIND_UNSPECIFIED"], - "providers": ["RUNNER_PROVIDER_UNSPECIFIED"], + "providers": ["RUNNER_PROVIDER_AWS_EC2"], }, pagination={ "token": "token", From 8b0b559b959b12e92a152c7c01cf77ee9e6547a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 02:49:33 +0000 Subject: [PATCH 145/505] chore(internal): expand CI branch coverage --- .github/workflows/ci.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b286e5a..53a3a09c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'preview-head/**' + - 'preview-base/**' + - 'preview/**' jobs: lint: name: lint runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -33,7 +33,6 @@ jobs: test: name: test runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 From a9d1cbc84c8e63ca3fc258b9e32cb7446ee97174 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 02:54:04 +0000 Subject: [PATCH 146/505] chore(internal): reduce CI branch coverage --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53a3a09c..81f6dc20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,12 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'preview-head/**' - - 'preview-base/**' - - 'preview/**' + branches: + - main + pull_request: + branches: + - main + - next jobs: lint: From 17ff809e5e8e8fc2a1b773a06810a2d819ea3381 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 02:35:32 +0000 Subject: [PATCH 147/505] fix(perf): skip traversing types for NotGiven values --- src/gitpod/_utils/_transform.py | 11 +++++++++++ tests/test_transform.py | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index 3ec62081..3b2b8e00 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -12,6 +12,7 @@ from ._utils import ( is_list, + is_given, is_mapping, is_iterable, ) @@ -258,6 +259,11 @@ def _transform_typeddict( result: dict[str, object] = {} annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): + if not is_given(value): + # we don't need to include `NotGiven` values here as they'll + # be stripped out before the request is sent anyway + continue + type_ = annotations.get(key) if type_ is None: # we do not have a type annotation for this field, leave it as is @@ -415,6 +421,11 @@ async def _async_transform_typeddict( result: dict[str, object] = {} annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): + if not is_given(value): + # we don't need to include `NotGiven` values here as they'll + # be stripped out before the request is sent anyway + continue + type_ = annotations.get(key) if type_ is None: # we do not have a type annotation for this field, leave it as is diff --git a/tests/test_transform.py b/tests/test_transform.py index d4df30cc..2a74ad4c 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from gitpod._types import Base64FileInput +from gitpod._types import NOT_GIVEN, Base64FileInput from gitpod._utils import ( PropertyInfo, transform as _transform, @@ -444,3 +444,10 @@ async def test_transform_skipping(use_async: bool) -> None: # iterables of ints are converted to a list data = iter([1, 2, 3]) assert await transform(data, Iterable[int], use_async) == [1, 2, 3] + + +@parametrize +@pytest.mark.asyncio +async def test_strips_notgiven(use_async: bool) -> None: + assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} + assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {} From e92cbdc19934dd4ba6b5f4800ee346f28eec0464 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 02:36:38 +0000 Subject: [PATCH 148/505] fix(perf): optimize some hot paths --- src/gitpod/_utils/_transform.py | 14 +++++++++++++- src/gitpod/_utils/_typing.py | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index 3b2b8e00..b0cc20a7 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -5,7 +5,7 @@ import pathlib from typing import Any, Mapping, TypeVar, cast from datetime import date, datetime -from typing_extensions import Literal, get_args, override, get_type_hints +from typing_extensions import Literal, get_args, override, get_type_hints as _get_type_hints import anyio import pydantic @@ -13,6 +13,7 @@ from ._utils import ( is_list, is_given, + lru_cache, is_mapping, is_iterable, ) @@ -109,6 +110,7 @@ class Params(TypedDict, total=False): return cast(_T, transformed) +@lru_cache(maxsize=8096) def _get_annotated_type(type_: type) -> type | None: """If the given type is an `Annotated` type then it is returned, if not `None` is returned. @@ -433,3 +435,13 @@ async def _async_transform_typeddict( else: result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_) return result + + +@lru_cache(maxsize=8096) +def get_type_hints( + obj: Any, + globalns: dict[str, Any] | None = None, + localns: Mapping[str, Any] | None = None, + include_extras: bool = False, +) -> dict[str, Any]: + return _get_type_hints(obj, globalns=globalns, localns=localns, include_extras=include_extras) diff --git a/src/gitpod/_utils/_typing.py b/src/gitpod/_utils/_typing.py index 278749b1..1958820f 100644 --- a/src/gitpod/_utils/_typing.py +++ b/src/gitpod/_utils/_typing.py @@ -13,6 +13,7 @@ get_origin, ) +from ._utils import lru_cache from .._types import InheritsGeneric from .._compat import is_union as _is_union @@ -66,6 +67,7 @@ def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]: # Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]] +@lru_cache(maxsize=8096) def strip_annotated_type(typ: type) -> type: if is_required_type(typ) or is_annotated_type(typ): return strip_annotated_type(cast(type, get_args(typ)[0])) From fdcd91f720a52c95cbadeed35691af8ad10734a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 02:49:10 +0000 Subject: [PATCH 149/505] chore(internal): update pyright settings --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 4ba6414f..d72e03a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -147,6 +147,7 @@ exclude = [ ] reportImplicitOverride = true +reportOverlappingOverload = false reportImportCycles = false reportPrivateUsage = false From 2d76d1fef3d0d2d13f468a48e79b4d51d268f28e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 02:50:35 +0000 Subject: [PATCH 150/505] chore(client): minor internal fixes --- src/gitpod/_base_client.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 0a82a2c1..2f0cf3b0 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -409,7 +409,8 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 idempotency_header = self._idempotency_header if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: - headers[idempotency_header] = options.idempotency_key or self._idempotency_key() + options.idempotency_key = options.idempotency_key or self._idempotency_key() + headers[idempotency_header] = options.idempotency_key # Don't set these headers if they were already set or removed by the caller. We check # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case. @@ -943,6 +944,10 @@ def _request( request = self._build_request(options, retries_taken=retries_taken) self._prepare_request(request) + if options.idempotency_key: + # ensure the idempotency key is reused between requests + input_options.idempotency_key = options.idempotency_key + kwargs: HttpxSendArgs = {} if self.custom_auth is not None: kwargs["auth"] = self.custom_auth @@ -1475,6 +1480,10 @@ async def _request( request = self._build_request(options, retries_taken=retries_taken) await self._prepare_request(request) + if options.idempotency_key: + # ensure the idempotency key is reused between requests + input_options.idempotency_key = options.idempotency_key + kwargs: HttpxSendArgs = {} if self.custom_auth is not None: kwargs["auth"] = self.custom_auth From f832bb1004b666b6c6f81c208c2614a475ad46d3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 02:41:30 +0000 Subject: [PATCH 151/505] chore(internal): bump pyright version --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- src/gitpod/_base_client.py | 6 +++++- src/gitpod/_models.py | 1 - src/gitpod/_utils/_typing.py | 2 +- tests/conftest.py | 2 +- tests/test_models.py | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d72e03a9..39209aee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ Repository = "https://github.com/gitpod-io/gitpod-sdk-python" managed = true # version pins are in requirements-dev.lock dev-dependencies = [ - "pyright>=1.1.359", + "pyright==1.1.399", "mypy", "respx", "pytest", diff --git a/requirements-dev.lock b/requirements-dev.lock index 7947716c..8e374b1a 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -69,7 +69,7 @@ pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.392.post0 +pyright==1.1.399 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 2f0cf3b0..2bdb630c 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -98,7 +98,11 @@ _AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any]) if TYPE_CHECKING: - from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT + from httpx._config import ( + DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage] + ) + + HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG else: try: from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 34935716..58b9263e 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -19,7 +19,6 @@ ) import pydantic -import pydantic.generics from pydantic.fields import FieldInfo from ._types import ( diff --git a/src/gitpod/_utils/_typing.py b/src/gitpod/_utils/_typing.py index 1958820f..1bac9542 100644 --- a/src/gitpod/_utils/_typing.py +++ b/src/gitpod/_utils/_typing.py @@ -110,7 +110,7 @@ class MyResponse(Foo[_T]): ``` """ cls = cast(object, get_origin(typ) or typ) - if cls in generic_bases: + if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains] # we're given the class directly return extract_type_arg(typ, index) diff --git a/tests/conftest.py b/tests/conftest.py index d7bb7fa8..2dc77cd3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,7 +10,7 @@ from gitpod import Gitpod, AsyncGitpod if TYPE_CHECKING: - from _pytest.fixtures import FixtureRequest + from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] pytest.register_assert_rewrite("tests.utils") diff --git a/tests/test_models.py b/tests/test_models.py index 8c0e1696..2390d4ae 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -832,7 +832,7 @@ class B(BaseModel): @pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") def test_type_alias_type() -> None: - Alias = TypeAliasType("Alias", str) + Alias = TypeAliasType("Alias", str) # pyright: ignore class Model(BaseModel): alias: Alias From ac6850bc1bc2bda3aae46a67f322aefd408b7717 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 02:42:02 +0000 Subject: [PATCH 152/505] chore(internal): base client updates --- src/gitpod/_base_client.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 2bdb630c..f72f028d 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -119,6 +119,7 @@ class PageInfo: url: URL | NotGiven params: Query | NotGiven + json: Body | NotGiven @overload def __init__( @@ -134,19 +135,30 @@ def __init__( params: Query, ) -> None: ... + @overload + def __init__( + self, + *, + json: Body, + ) -> None: ... + def __init__( self, *, url: URL | NotGiven = NOT_GIVEN, + json: Body | NotGiven = NOT_GIVEN, params: Query | NotGiven = NOT_GIVEN, ) -> None: self.url = url + self.json = json self.params = params @override def __repr__(self) -> str: if self.url: return f"{self.__class__.__name__}(url={self.url})" + if self.json: + return f"{self.__class__.__name__}(json={self.json})" return f"{self.__class__.__name__}(params={self.params})" @@ -195,6 +207,19 @@ def _info_to_options(self, info: PageInfo) -> FinalRequestOptions: options.url = str(url) return options + if not isinstance(info.json, NotGiven): + if not is_mapping(info.json): + raise TypeError("Pagination is only supported with mappings") + + if not options.json_data: + options.json_data = {**info.json} + else: + if not is_mapping(options.json_data): + raise TypeError("Pagination is only supported with mappings") + + options.json_data = {**options.json_data, **info.json} + return options + raise ValueError("Unexpected PageInfo state") From 28b6a06b2153bce024eb7d72f06647d6f915ece8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 19 Apr 2025 02:44:59 +0000 Subject: [PATCH 153/505] chore(internal): update models test --- tests/test_models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_models.py b/tests/test_models.py index 2390d4ae..7813b824 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -492,12 +492,15 @@ class Model(BaseModel): resource_id: Optional[str] = None m = Model.construct() + assert m.resource_id is None assert "resource_id" not in m.model_fields_set m = Model.construct(resource_id=None) + assert m.resource_id is None assert "resource_id" in m.model_fields_set m = Model.construct(resource_id="foo") + assert m.resource_id == "foo" assert "resource_id" in m.model_fields_set From 7858c5f54884ead3017d9a7b976f1c605d408919 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:17:06 +0000 Subject: [PATCH 154/505] chore(ci): add timeout thresholds for CI jobs --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81f6dc20..04b083ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: jobs: lint: + timeout-minutes: 10 name: lint runs-on: ubuntu-latest steps: @@ -30,6 +31,7 @@ jobs: run: ./scripts/lint test: + timeout-minutes: 10 name: test runs-on: ubuntu-latest steps: From 6e82aa977fd2860226e40a97de6ebcf2163cdc3e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:17:36 +0000 Subject: [PATCH 155/505] chore(internal): import reformatting --- src/gitpod/_client.py | 5 +---- src/gitpod/resources/accounts.py | 5 +---- src/gitpod/resources/editors.py | 5 +---- src/gitpod/resources/environments/automations/automations.py | 5 +---- src/gitpod/resources/environments/automations/services.py | 5 +---- .../resources/environments/automations/tasks/executions.py | 5 +---- src/gitpod/resources/environments/automations/tasks/tasks.py | 5 +---- src/gitpod/resources/environments/environments.py | 5 +---- src/gitpod/resources/events.py | 5 +---- src/gitpod/resources/identity.py | 5 +---- src/gitpod/resources/organizations/domain_verifications.py | 5 +---- src/gitpod/resources/organizations/invites.py | 5 +---- src/gitpod/resources/organizations/organizations.py | 5 +---- src/gitpod/resources/organizations/sso_configurations.py | 5 +---- src/gitpod/resources/projects/policies.py | 5 +---- src/gitpod/resources/projects/projects.py | 5 +---- .../resources/runners/configurations/configurations.py | 5 +---- .../resources/runners/configurations/environment_classes.py | 5 +---- .../runners/configurations/host_authentication_tokens.py | 5 +---- src/gitpod/resources/runners/configurations/schema.py | 5 +---- .../resources/runners/configurations/scm_integrations.py | 5 +---- src/gitpod/resources/runners/policies.py | 5 +---- src/gitpod/resources/runners/runners.py | 5 +---- src/gitpod/resources/secrets.py | 5 +---- src/gitpod/resources/users/pats.py | 5 +---- src/gitpod/resources/users/users.py | 5 +---- 26 files changed, 26 insertions(+), 104 deletions(-) diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 4b844ac0..7026467f 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -19,10 +19,7 @@ ProxiesTypes, RequestOptions, ) -from ._utils import ( - is_given, - get_async_library, -) +from ._utils import is_given, get_async_library from ._version import __version__ from .resources import events, groups, editors, secrets, accounts, identity from ._streaming import Stream as Stream, AsyncStream as AsyncStream diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 7f3c4f75..b32f176a 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -13,10 +13,7 @@ account_list_login_providers_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 3ea08ba9..756b849c 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -6,10 +6,7 @@ from ..types import editor_list_params, editor_retrieve_params, editor_resolve_url_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index d7816c32..9eda852d 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -13,10 +13,7 @@ AsyncServicesResourceWithStreamingResponse, ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from .tasks.tasks import ( TasksResource, diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index c48e96c2..0083cfbb 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -5,10 +5,7 @@ import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index 62181feb..3fff1115 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -5,10 +5,7 @@ import httpx from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import ( - maybe_transform, - async_maybe_transform, -) +from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 782b9178..b8a1b225 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -7,10 +7,7 @@ import httpx from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import ( - maybe_transform, - async_maybe_transform, -) +from ....._utils import maybe_transform, async_maybe_transform from .executions import ( ExecutionsResource, AsyncExecutionsResource, diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index a7ced1ae..bb07bb8e 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -27,10 +27,7 @@ AsyncClassesResourceWithStreamingResponse, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index f5de7cf1..b28929f1 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -6,10 +6,7 @@ from ..types import event_list_params, event_watch_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 736e308a..2528a649 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -12,10 +12,7 @@ identity_get_authenticated_identity_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/gitpod/resources/organizations/domain_verifications.py b/src/gitpod/resources/organizations/domain_verifications.py index 8661f183..5468ac8d 100644 --- a/src/gitpod/resources/organizations/domain_verifications.py +++ b/src/gitpod/resources/organizations/domain_verifications.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/gitpod/resources/organizations/invites.py b/src/gitpod/resources/organizations/invites.py index ac39a548..8ed2e02c 100644 --- a/src/gitpod/resources/organizations/invites.py +++ b/src/gitpod/resources/organizations/invites.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index f5fea4a9..4c6904e9 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -27,10 +27,7 @@ AsyncInvitesResourceWithStreamingResponse, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 68266b73..6cdb528a 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index 5ca918c7..fc12621f 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 6b2e5aee..c19157c4 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -15,10 +15,7 @@ project_create_from_environment_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, AsyncPoliciesResource, diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index 97459924..b9b2c27c 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -13,10 +13,7 @@ AsyncSchemaResourceWithStreamingResponse, ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index d9df2a5c..ba2137ce 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -7,10 +7,7 @@ import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 0b8c5855..af044ec5 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -8,10 +8,7 @@ import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( diff --git a/src/gitpod/resources/runners/configurations/schema.py b/src/gitpod/resources/runners/configurations/schema.py index e15565ac..06963e11 100644 --- a/src/gitpod/resources/runners/configurations/schema.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -5,10 +5,7 @@ import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 0ce580d9..6f7c0891 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -7,10 +7,7 @@ import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 5bc9d25b..4ce6cc35 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 20da73be..5c92b857 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -19,10 +19,7 @@ runner_check_authentication_for_host_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, AsyncPoliciesResource, diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index b6c7a0e0..8e02efa4 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -12,10 +12,7 @@ secret_update_value_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 12538951..95511b8b 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index ab3e3c97..75e9efc3 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -14,10 +14,7 @@ ) from ...types import user_set_suspended_params, user_get_authenticated_user_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( From 3ae9e501933b0aac475e7fd4ddfcb298faf91287 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:19:04 +0000 Subject: [PATCH 156/505] chore(internal): fix list file params --- src/gitpod/_utils/_utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gitpod/_utils/_utils.py b/src/gitpod/_utils/_utils.py index e5811bba..ea3cf3f2 100644 --- a/src/gitpod/_utils/_utils.py +++ b/src/gitpod/_utils/_utils.py @@ -72,8 +72,16 @@ def _extract_items( from .._files import assert_is_file_content # We have exhausted the path, return the entry we found. - assert_is_file_content(obj, key=flattened_key) assert flattened_key is not None + + if is_list(obj): + files: list[tuple[str, FileTypes]] = [] + for entry in obj: + assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "") + files.append((flattened_key + "[]", cast(FileTypes, entry))) + return files + + assert_is_file_content(obj, key=flattened_key) return [(flattened_key, cast(FileTypes, obj))] index += 1 From b38dad06c166b82202464b58e3cb2648d4c2bfbd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:19:30 +0000 Subject: [PATCH 157/505] chore(internal): refactor retries to not use recursion --- src/gitpod/_base_client.py | 414 ++++++++++++++++--------------------- 1 file changed, 175 insertions(+), 239 deletions(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index f72f028d..54b43106 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -437,8 +437,7 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 headers = httpx.Headers(headers_dict) idempotency_header = self._idempotency_header - if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: - options.idempotency_key = options.idempotency_key or self._idempotency_key() + if idempotency_header and options.idempotency_key and idempotency_header not in headers: headers[idempotency_header] = options.idempotency_key # Don't set these headers if they were already set or removed by the caller. We check @@ -903,7 +902,6 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: Literal[True], stream_cls: Type[_StreamT], @@ -914,7 +912,6 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: Literal[False] = False, ) -> ResponseT: ... @@ -924,7 +921,6 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: bool = False, stream_cls: Type[_StreamT] | None = None, @@ -934,125 +930,109 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: bool = False, stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: - if remaining_retries is not None: - retries_taken = options.get_max_retries(self.max_retries) - remaining_retries - else: - retries_taken = 0 - - return self._request( - cast_to=cast_to, - options=options, - stream=stream, - stream_cls=stream_cls, - retries_taken=retries_taken, - ) + cast_to = self._maybe_override_cast_to(cast_to, options) - def _request( - self, - *, - cast_to: Type[ResponseT], - options: FinalRequestOptions, - retries_taken: int, - stream: bool, - stream_cls: type[_StreamT] | None, - ) -> ResponseT | _StreamT: # create a copy of the options we were given so that if the # options are mutated later & we then retry, the retries are # given the original options input_options = model_copy(options) - - cast_to = self._maybe_override_cast_to(cast_to, options) - options = self._prepare_options(options) - - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken - request = self._build_request(options, retries_taken=retries_taken) - self._prepare_request(request) - - if options.idempotency_key: + if input_options.idempotency_key is None and input_options.method.lower() != "get": # ensure the idempotency key is reused between requests - input_options.idempotency_key = options.idempotency_key + input_options.idempotency_key = self._idempotency_key() - kwargs: HttpxSendArgs = {} - if self.custom_auth is not None: - kwargs["auth"] = self.custom_auth + response: httpx.Response | None = None + max_retries = input_options.get_max_retries(self.max_retries) - log.debug("Sending HTTP Request: %s %s", request.method, request.url) + retries_taken = 0 + for retries_taken in range(max_retries + 1): + options = model_copy(input_options) + options = self._prepare_options(options) - try: - response = self._client.send( - request, - stream=stream or self._should_stream_response_body(request=request), - **kwargs, - ) - except httpx.TimeoutException as err: - log.debug("Encountered httpx.TimeoutException", exc_info=True) + remaining_retries = max_retries - retries_taken + request = self._build_request(options, retries_taken=retries_taken) + self._prepare_request(request) - if remaining_retries > 0: - return self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, - ) + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth - log.debug("Raising timeout error") - raise APITimeoutError(request=request) from err - except Exception as err: - log.debug("Encountered Exception", exc_info=True) + log.debug("Sending HTTP Request: %s %s", request.method, request.url) - if remaining_retries > 0: - return self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, + response = None + try: + response = self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if remaining_retries > 0: + self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if remaining_retries > 0: + self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Response: %s %s "%i %s" %s', + request.method, + request.url, + response.status_code, + response.reason_phrase, + response.headers, + ) - log.debug("Raising connection error") - raise APIConnectionError(request=request) from err - - log.debug( - 'HTTP Response: %s %s "%i %s" %s', - request.method, - request.url, - response.status_code, - response.reason_phrase, - response.headers, - ) + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if remaining_retries > 0 and self._should_retry(err.response): + err.response.close() + self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=response, + ) + continue - try: - response.raise_for_status() - except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code - log.debug("Encountered httpx.HTTPStatusError", exc_info=True) - - if remaining_retries > 0 and self._should_retry(err.response): - err.response.close() - return self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - response_headers=err.response.headers, - stream=stream, - stream_cls=stream_cls, - ) + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + err.response.read() - # If the response is streamed then we need to explicitly read the response - # to completion before attempting to access the response text. - if not err.response.is_closed: - err.response.read() + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None - log.debug("Re-raising status error") - raise self._make_status_error_from_response(err.response) from None + break + assert response is not None, "could not resolve response (should never happen)" return self._process_response( cast_to=cast_to, options=options, @@ -1062,37 +1042,20 @@ def _request( retries_taken=retries_taken, ) - def _retry_request( - self, - options: FinalRequestOptions, - cast_to: Type[ResponseT], - *, - retries_taken: int, - response_headers: httpx.Headers | None, - stream: bool, - stream_cls: type[_StreamT] | None, - ) -> ResponseT | _StreamT: - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + def _sleep_for_retry( + self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None + ) -> None: + remaining_retries = max_retries - retries_taken if remaining_retries == 1: log.debug("1 retry left") else: log.debug("%i retries left", remaining_retries) - timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) + timeout = self._calculate_retry_timeout(remaining_retries, options, response.headers if response else None) log.info("Retrying request to %s in %f seconds", options.url, timeout) - # In a synchronous context we are blocking the entire thread. Up to the library user to run the client in a - # different thread if necessary. time.sleep(timeout) - return self._request( - options=options, - cast_to=cast_to, - retries_taken=retries_taken + 1, - stream=stream, - stream_cls=stream_cls, - ) - def _process_response( self, *, @@ -1436,7 +1399,6 @@ async def request( options: FinalRequestOptions, *, stream: Literal[False] = False, - remaining_retries: Optional[int] = None, ) -> ResponseT: ... @overload @@ -1447,7 +1409,6 @@ async def request( *, stream: Literal[True], stream_cls: type[_AsyncStreamT], - remaining_retries: Optional[int] = None, ) -> _AsyncStreamT: ... @overload @@ -1458,7 +1419,6 @@ async def request( *, stream: bool, stream_cls: type[_AsyncStreamT] | None = None, - remaining_retries: Optional[int] = None, ) -> ResponseT | _AsyncStreamT: ... async def request( @@ -1468,120 +1428,111 @@ async def request( *, stream: bool = False, stream_cls: type[_AsyncStreamT] | None = None, - remaining_retries: Optional[int] = None, - ) -> ResponseT | _AsyncStreamT: - if remaining_retries is not None: - retries_taken = options.get_max_retries(self.max_retries) - remaining_retries - else: - retries_taken = 0 - - return await self._request( - cast_to=cast_to, - options=options, - stream=stream, - stream_cls=stream_cls, - retries_taken=retries_taken, - ) - - async def _request( - self, - cast_to: Type[ResponseT], - options: FinalRequestOptions, - *, - stream: bool, - stream_cls: type[_AsyncStreamT] | None, - retries_taken: int, ) -> ResponseT | _AsyncStreamT: if self._platform is None: # `get_platform` can make blocking IO calls so we # execute it earlier while we are in an async context self._platform = await asyncify(get_platform)() + cast_to = self._maybe_override_cast_to(cast_to, options) + # create a copy of the options we were given so that if the # options are mutated later & we then retry, the retries are # given the original options input_options = model_copy(options) - - cast_to = self._maybe_override_cast_to(cast_to, options) - options = await self._prepare_options(options) - - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken - request = self._build_request(options, retries_taken=retries_taken) - await self._prepare_request(request) - - if options.idempotency_key: + if input_options.idempotency_key is None and input_options.method.lower() != "get": # ensure the idempotency key is reused between requests - input_options.idempotency_key = options.idempotency_key + input_options.idempotency_key = self._idempotency_key() - kwargs: HttpxSendArgs = {} - if self.custom_auth is not None: - kwargs["auth"] = self.custom_auth + response: httpx.Response | None = None + max_retries = input_options.get_max_retries(self.max_retries) - try: - response = await self._client.send( - request, - stream=stream or self._should_stream_response_body(request=request), - **kwargs, - ) - except httpx.TimeoutException as err: - log.debug("Encountered httpx.TimeoutException", exc_info=True) + retries_taken = 0 + for retries_taken in range(max_retries + 1): + options = model_copy(input_options) + options = await self._prepare_options(options) - if remaining_retries > 0: - return await self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, - ) + remaining_retries = max_retries - retries_taken + request = self._build_request(options, retries_taken=retries_taken) + await self._prepare_request(request) - log.debug("Raising timeout error") - raise APITimeoutError(request=request) from err - except Exception as err: - log.debug("Encountered Exception", exc_info=True) + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth - if remaining_retries > 0: - return await self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, - ) + log.debug("Sending HTTP Request: %s %s", request.method, request.url) - log.debug("Raising connection error") - raise APIConnectionError(request=request) from err + response = None + try: + response = await self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, + ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if remaining_retries > 0: + await self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if remaining_retries > 0: + await self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Response: %s %s "%i %s" %s', + request.method, + request.url, + response.status_code, + response.reason_phrase, + response.headers, + ) - log.debug( - 'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase - ) + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if remaining_retries > 0 and self._should_retry(err.response): + await err.response.aclose() + await self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=response, + ) + continue - try: - response.raise_for_status() - except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code - log.debug("Encountered httpx.HTTPStatusError", exc_info=True) - - if remaining_retries > 0 and self._should_retry(err.response): - await err.response.aclose() - return await self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - response_headers=err.response.headers, - stream=stream, - stream_cls=stream_cls, - ) + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + await err.response.aread() - # If the response is streamed then we need to explicitly read the response - # to completion before attempting to access the response text. - if not err.response.is_closed: - await err.response.aread() + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None - log.debug("Re-raising status error") - raise self._make_status_error_from_response(err.response) from None + break + assert response is not None, "could not resolve response (should never happen)" return await self._process_response( cast_to=cast_to, options=options, @@ -1591,35 +1542,20 @@ async def _request( retries_taken=retries_taken, ) - async def _retry_request( - self, - options: FinalRequestOptions, - cast_to: Type[ResponseT], - *, - retries_taken: int, - response_headers: httpx.Headers | None, - stream: bool, - stream_cls: type[_AsyncStreamT] | None, - ) -> ResponseT | _AsyncStreamT: - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + async def _sleep_for_retry( + self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None + ) -> None: + remaining_retries = max_retries - retries_taken if remaining_retries == 1: log.debug("1 retry left") else: log.debug("%i retries left", remaining_retries) - timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) + timeout = self._calculate_retry_timeout(remaining_retries, options, response.headers if response else None) log.info("Retrying request to %s in %f seconds", options.url, timeout) await anyio.sleep(timeout) - return await self._request( - options=options, - cast_to=cast_to, - retries_taken=retries_taken + 1, - stream=stream, - stream_cls=stream_cls, - ) - async def _process_response( self, *, From 5b5f2774f73f297d048e367566bab4f7e6ddfa8d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:20:06 +0000 Subject: [PATCH 158/505] fix(pydantic v1): more robust ModelField.annotation check --- src/gitpod/_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 58b9263e..798956f1 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -626,8 +626,8 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, # Note: if one variant defines an alias then they all should discriminator_alias = field_info.alias - if field_info.annotation and is_literal_type(field_info.annotation): - for entry in get_args(field_info.annotation): + if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): + for entry in get_args(annotation): if isinstance(entry, str): mapping[entry] = variant From 8887664cf4b969e3f126649d5c71d0dfacf8b9f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:30:04 +0000 Subject: [PATCH 159/505] chore(internal): minor formatting changes --- src/gitpod/types/account_get_sso_login_url_response.py | 1 - src/gitpod/types/account_retrieve_response.py | 1 - src/gitpod/types/editor_resolve_url_response.py | 1 - src/gitpod/types/editor_retrieve_response.py | 1 - src/gitpod/types/environment_create_from_project_response.py | 1 - src/gitpod/types/environment_create_logs_token_response.py | 1 - src/gitpod/types/environment_create_response.py | 1 - src/gitpod/types/environment_retrieve_response.py | 1 - .../types/environments/automations/service_create_response.py | 1 - .../types/environments/automations/service_retrieve_response.py | 1 - .../types/environments/automations/task_create_response.py | 1 - .../types/environments/automations/task_retrieve_response.py | 1 - src/gitpod/types/environments/automations/task_start_response.py | 1 - .../automations/tasks/execution_retrieve_response.py | 1 - src/gitpod/types/organization_join_response.py | 1 - src/gitpod/types/organization_retrieve_response.py | 1 - src/gitpod/types/organization_update_response.py | 1 - .../types/organizations/domain_verification_create_response.py | 1 - .../types/organizations/domain_verification_retrieve_response.py | 1 - .../types/organizations/domain_verification_verify_response.py | 1 - src/gitpod/types/organizations/invite_create_response.py | 1 - src/gitpod/types/organizations/invite_retrieve_response.py | 1 - src/gitpod/types/organizations/organization_invite.py | 1 - .../types/organizations/sso_configuration_create_response.py | 1 - .../types/organizations/sso_configuration_retrieve_response.py | 1 - src/gitpod/types/runner_retrieve_response.py | 1 - .../configurations/host_authentication_token_create_response.py | 1 - .../host_authentication_token_retrieve_response.py | 1 - src/gitpod/types/runners/policy_create_response.py | 1 - src/gitpod/types/runners/policy_update_response.py | 1 - src/gitpod/types/user_get_authenticated_user_response.py | 1 - src/gitpod/types/users/pat_get_response.py | 1 - 32 files changed, 32 deletions(-) diff --git a/src/gitpod/types/account_get_sso_login_url_response.py b/src/gitpod/types/account_get_sso_login_url_response.py index 192a5fc3..fd289cd8 100644 --- a/src/gitpod/types/account_get_sso_login_url_response.py +++ b/src/gitpod/types/account_get_sso_login_url_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from .._models import BaseModel diff --git a/src/gitpod/types/account_retrieve_response.py b/src/gitpod/types/account_retrieve_response.py index 2768a2d4..c32afbb6 100644 --- a/src/gitpod/types/account_retrieve_response.py +++ b/src/gitpod/types/account_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .account import Account from .._models import BaseModel diff --git a/src/gitpod/types/editor_resolve_url_response.py b/src/gitpod/types/editor_resolve_url_response.py index f22f8cbf..96334644 100644 --- a/src/gitpod/types/editor_resolve_url_response.py +++ b/src/gitpod/types/editor_resolve_url_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel __all__ = ["EditorResolveURLResponse"] diff --git a/src/gitpod/types/editor_retrieve_response.py b/src/gitpod/types/editor_retrieve_response.py index fa5bbe98..0a40810d 100644 --- a/src/gitpod/types/editor_retrieve_response.py +++ b/src/gitpod/types/editor_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .editor import Editor from .._models import BaseModel diff --git a/src/gitpod/types/environment_create_from_project_response.py b/src/gitpod/types/environment_create_from_project_response.py index 7c668704..3390ce06 100644 --- a/src/gitpod/types/environment_create_from_project_response.py +++ b/src/gitpod/types/environment_create_from_project_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel from .environment import Environment diff --git a/src/gitpod/types/environment_create_logs_token_response.py b/src/gitpod/types/environment_create_logs_token_response.py index 70f9c6ac..c8a81b7d 100644 --- a/src/gitpod/types/environment_create_logs_token_response.py +++ b/src/gitpod/types/environment_create_logs_token_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from .._models import BaseModel diff --git a/src/gitpod/types/environment_create_response.py b/src/gitpod/types/environment_create_response.py index ac25a62c..e3c53f08 100644 --- a/src/gitpod/types/environment_create_response.py +++ b/src/gitpod/types/environment_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel from .environment import Environment diff --git a/src/gitpod/types/environment_retrieve_response.py b/src/gitpod/types/environment_retrieve_response.py index 0a3963b2..1409d073 100644 --- a/src/gitpod/types/environment_retrieve_response.py +++ b/src/gitpod/types/environment_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel from .environment import Environment diff --git a/src/gitpod/types/environments/automations/service_create_response.py b/src/gitpod/types/environments/automations/service_create_response.py index 79ceb843..0aa85db1 100644 --- a/src/gitpod/types/environments/automations/service_create_response.py +++ b/src/gitpod/types/environments/automations/service_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .service import Service from ...._models import BaseModel diff --git a/src/gitpod/types/environments/automations/service_retrieve_response.py b/src/gitpod/types/environments/automations/service_retrieve_response.py index ecf90357..e3778371 100644 --- a/src/gitpod/types/environments/automations/service_retrieve_response.py +++ b/src/gitpod/types/environments/automations/service_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .service import Service from ...._models import BaseModel diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index 5fbdae6d..a00af2b2 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ...._models import BaseModel from ...shared.task import Task diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index e65439b4..546b7b02 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ...._models import BaseModel from ...shared.task import Task diff --git a/src/gitpod/types/environments/automations/task_start_response.py b/src/gitpod/types/environments/automations/task_start_response.py index 93ee3707..bb0fb10c 100644 --- a/src/gitpod/types/environments/automations/task_start_response.py +++ b/src/gitpod/types/environments/automations/task_start_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ...._models import BaseModel diff --git a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py index 58c5baae..59483ce7 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py +++ b/src/gitpod/types/environments/automations/tasks/execution_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ....._models import BaseModel diff --git a/src/gitpod/types/organization_join_response.py b/src/gitpod/types/organization_join_response.py index f6a4f3dd..78e8ff98 100644 --- a/src/gitpod/types/organization_join_response.py +++ b/src/gitpod/types/organization_join_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel from .organization_member import OrganizationMember diff --git a/src/gitpod/types/organization_retrieve_response.py b/src/gitpod/types/organization_retrieve_response.py index 064ba4a1..b557f522 100644 --- a/src/gitpod/types/organization_retrieve_response.py +++ b/src/gitpod/types/organization_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel from .organization import Organization diff --git a/src/gitpod/types/organization_update_response.py b/src/gitpod/types/organization_update_response.py index f5fcb1bb..d904634d 100644 --- a/src/gitpod/types/organization_update_response.py +++ b/src/gitpod/types/organization_update_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel from .organization import Organization diff --git a/src/gitpod/types/organizations/domain_verification_create_response.py b/src/gitpod/types/organizations/domain_verification_create_response.py index 548d08a0..3429a615 100644 --- a/src/gitpod/types/organizations/domain_verification_create_response.py +++ b/src/gitpod/types/organizations/domain_verification_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ..._models import BaseModel diff --git a/src/gitpod/types/organizations/domain_verification_retrieve_response.py b/src/gitpod/types/organizations/domain_verification_retrieve_response.py index 88577d6d..7f8d7e1a 100644 --- a/src/gitpod/types/organizations/domain_verification_retrieve_response.py +++ b/src/gitpod/types/organizations/domain_verification_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ..._models import BaseModel diff --git a/src/gitpod/types/organizations/domain_verification_verify_response.py b/src/gitpod/types/organizations/domain_verification_verify_response.py index 8d2c6493..307656ee 100644 --- a/src/gitpod/types/organizations/domain_verification_verify_response.py +++ b/src/gitpod/types/organizations/domain_verification_verify_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ..._models import BaseModel diff --git a/src/gitpod/types/organizations/invite_create_response.py b/src/gitpod/types/organizations/invite_create_response.py index 36297d0c..9a00dac5 100644 --- a/src/gitpod/types/organizations/invite_create_response.py +++ b/src/gitpod/types/organizations/invite_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel from .organization_invite import OrganizationInvite diff --git a/src/gitpod/types/organizations/invite_retrieve_response.py b/src/gitpod/types/organizations/invite_retrieve_response.py index aa4239f2..d00f343e 100644 --- a/src/gitpod/types/organizations/invite_retrieve_response.py +++ b/src/gitpod/types/organizations/invite_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel from .organization_invite import OrganizationInvite diff --git a/src/gitpod/types/organizations/organization_invite.py b/src/gitpod/types/organizations/organization_invite.py index 3f8e7f17..b33984a0 100644 --- a/src/gitpod/types/organizations/organization_invite.py +++ b/src/gitpod/types/organizations/organization_invite.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ..._models import BaseModel diff --git a/src/gitpod/types/organizations/sso_configuration_create_response.py b/src/gitpod/types/organizations/sso_configuration_create_response.py index 0a2da397..7e85bbe4 100644 --- a/src/gitpod/types/organizations/sso_configuration_create_response.py +++ b/src/gitpod/types/organizations/sso_configuration_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ..._models import BaseModel diff --git a/src/gitpod/types/organizations/sso_configuration_retrieve_response.py b/src/gitpod/types/organizations/sso_configuration_retrieve_response.py index 9a1da1a1..c5e0bd38 100644 --- a/src/gitpod/types/organizations/sso_configuration_retrieve_response.py +++ b/src/gitpod/types/organizations/sso_configuration_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ..._models import BaseModel diff --git a/src/gitpod/types/runner_retrieve_response.py b/src/gitpod/types/runner_retrieve_response.py index 1bda9f37..b4ec6d83 100644 --- a/src/gitpod/types/runner_retrieve_response.py +++ b/src/gitpod/types/runner_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .runner import Runner from .._models import BaseModel diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py index 3d9900d3..143bdbb6 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ...._models import BaseModel from .host_authentication_token import HostAuthenticationToken diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py index 4f348a01..ee629a1f 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ...._models import BaseModel from .host_authentication_token import HostAuthenticationToken diff --git a/src/gitpod/types/runners/policy_create_response.py b/src/gitpod/types/runners/policy_create_response.py index d97d8e13..946e4c8e 100644 --- a/src/gitpod/types/runners/policy_create_response.py +++ b/src/gitpod/types/runners/policy_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel from .runner_policy import RunnerPolicy diff --git a/src/gitpod/types/runners/policy_update_response.py b/src/gitpod/types/runners/policy_update_response.py index 5f441dc6..7d2094c7 100644 --- a/src/gitpod/types/runners/policy_update_response.py +++ b/src/gitpod/types/runners/policy_update_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel from .runner_policy import RunnerPolicy diff --git a/src/gitpod/types/user_get_authenticated_user_response.py b/src/gitpod/types/user_get_authenticated_user_response.py index d4e06c6b..8610b455 100644 --- a/src/gitpod/types/user_get_authenticated_user_response.py +++ b/src/gitpod/types/user_get_authenticated_user_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .user import User from .._models import BaseModel diff --git a/src/gitpod/types/users/pat_get_response.py b/src/gitpod/types/users/pat_get_response.py index 54933a4c..5c0b2a0f 100644 --- a/src/gitpod/types/users/pat_get_response.py +++ b/src/gitpod/types/users/pat_get_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel from .personal_access_token import PersonalAccessToken From d28775a1a166f93946e02ae11592bf7a8373ed55 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:30:41 +0000 Subject: [PATCH 160/505] chore(internal): codegen related update --- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04b083ca..33820422 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 6cd33a62..2a6bc644 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index f7fa2813..706e8092 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 if: github.repository == 'gitpod-io/gitpod-sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 84740ee651592b29e4f731417f25b5c99a4a80fe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:31:16 +0000 Subject: [PATCH 161/505] chore(ci): only use depot for staging repos --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33820422..d445d4d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/gitpod-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/gitpod-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 2a6bc644..6cd33a62 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 706e8092..f7fa2813 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest if: github.repository == 'gitpod-io/gitpod-sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 94d83ca63f7d3090cf5cb712567273e9882e010e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:33:05 +0000 Subject: [PATCH 162/505] chore: broadly detect json family of content-type headers --- src/gitpod/_response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitpod/_response.py b/src/gitpod/_response.py index 38a11e65..6211d722 100644 --- a/src/gitpod/_response.py +++ b/src/gitpod/_response.py @@ -255,7 +255,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: # split is required to handle cases where additional information is included # in the response, e.g. application/json; charset=utf-8 content_type, *_ = response.headers.get("content-type", "*").split(";") - if content_type != "application/json": + if not content_type.endswith("json"): if is_basemodel(cast_to): try: data = response.json() From 9494d47bab4c6194b71cc283424d838c9250ad86 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 09:04:40 +0000 Subject: [PATCH 163/505] feat(api): manual updates --- .stats.yml | 8 +- api.md | 39 +- src/gitpod/pagination.py | 53 --- src/gitpod/resources/editors.py | 52 +- .../resources/environments/environments.py | 116 +++++ src/gitpod/resources/identity.py | 22 +- .../resources/organizations/__init__.py | 14 + .../resources/organizations/organizations.py | 220 ++------- .../resources/organizations/policies.py | 447 ++++++++++++++++++ src/gitpod/resources/projects/projects.py | 38 +- src/gitpod/resources/secrets.py | 67 +-- src/gitpod/resources/users/__init__.py | 14 + src/gitpod/resources/users/dotfiles.py | 313 ++++++++++++ src/gitpod/resources/users/users.py | 32 ++ src/gitpod/types/__init__.py | 15 +- src/gitpod/types/editor_list_params.py | 13 +- ...ronment_create_environment_token_params.py | 17 + ...nment_create_environment_token_response.py | 12 + src/gitpod/types/environment_spec.py | 9 + src/gitpod/types/environment_spec_param.py | 9 + src/gitpod/types/environment_status.py | 9 + .../automations/service_status.py | 8 +- .../automations/service_update_params.py | 5 +- src/gitpod/types/id_token_version.py | 7 + .../types/identity_get_id_token_params.py | 5 + src/gitpod/types/log_level.py | 9 + src/gitpod/types/metrics_configuration.py | 21 + .../types/metrics_configuration_param.py | 21 + src/gitpod/types/organization.py | 4 + src/gitpod/types/organization_list_params.py | 36 -- src/gitpod/types/organization_tier.py | 9 + src/gitpod/types/organizations/__init__.py | 4 + .../organizations/organization_policies.py | 66 +++ .../organizations/policy_retrieve_params.py | 14 + .../organizations/policy_retrieve_response.py | 10 + .../organizations/policy_update_params.py | 69 +++ src/gitpod/types/project.py | 6 + src/gitpod/types/project_create_params.py | 6 + src/gitpod/types/project_list_params.py | 10 +- src/gitpod/types/project_update_params.py | 6 + src/gitpod/types/resource_type.py | 6 + src/gitpod/types/runner_capability.py | 3 + src/gitpod/types/runner_configuration.py | 8 + .../types/runner_configuration_param.py | 8 + .../runner_parse_context_url_response.py | 5 +- src/gitpod/types/runner_update_params.py | 23 +- .../runner_configuration_schema.py | 48 ++ src/gitpod/types/scope.py | 7 - src/gitpod/types/secret.py | 5 +- src/gitpod/types/secret_create_params.py | 15 +- src/gitpod/types/secret_list_params.py | 9 +- src/gitpod/types/secret_scope.py | 17 + src/gitpod/types/secret_scope_param.py | 17 + .../types/shared/task_execution_status.py | 8 +- src/gitpod/types/users/__init__.py | 4 + src/gitpod/types/users/dotfile_get_params.py | 11 + .../types/users/dotfile_get_response.py | 12 + src/gitpod/types/users/dotfile_set_params.py | 11 + .../types/users/dotfiles_configuration.py | 12 + .../environments/automations/test_services.py | 2 + .../organizations/test_policies.py | 192 ++++++++ tests/api_resources/test_editors.py | 2 + tests/api_resources/test_environments.py | 77 +++ tests/api_resources/test_identity.py | 2 + tests/api_resources/test_organizations.py | 87 +--- tests/api_resources/test_projects.py | 6 + tests/api_resources/test_runners.py | 28 ++ tests/api_resources/test_secrets.py | 28 +- tests/api_resources/users/test_dotfiles.py | 166 +++++++ 69 files changed, 2197 insertions(+), 457 deletions(-) create mode 100644 src/gitpod/resources/organizations/policies.py create mode 100644 src/gitpod/resources/users/dotfiles.py create mode 100644 src/gitpod/types/environment_create_environment_token_params.py create mode 100644 src/gitpod/types/environment_create_environment_token_response.py create mode 100644 src/gitpod/types/id_token_version.py create mode 100644 src/gitpod/types/log_level.py create mode 100644 src/gitpod/types/metrics_configuration.py create mode 100644 src/gitpod/types/metrics_configuration_param.py delete mode 100644 src/gitpod/types/organization_list_params.py create mode 100644 src/gitpod/types/organization_tier.py create mode 100644 src/gitpod/types/organizations/organization_policies.py create mode 100644 src/gitpod/types/organizations/policy_retrieve_params.py create mode 100644 src/gitpod/types/organizations/policy_retrieve_response.py create mode 100644 src/gitpod/types/organizations/policy_update_params.py delete mode 100644 src/gitpod/types/scope.py create mode 100644 src/gitpod/types/secret_scope.py create mode 100644 src/gitpod/types/secret_scope_param.py create mode 100644 src/gitpod/types/users/dotfile_get_params.py create mode 100644 src/gitpod/types/users/dotfile_get_response.py create mode 100644 src/gitpod/types/users/dotfile_set_params.py create mode 100644 src/gitpod/types/users/dotfiles_configuration.py create mode 100644 tests/api_resources/organizations/test_policies.py create mode 100644 tests/api_resources/users/test_dotfiles.py diff --git a/.stats.yml b/.stats.yml index e8f1d28e..ef4c6308 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3655d5ad0ac3e228c1519af70dbf3d0bfa3c47a2d06d4cac92a650da051b49a6.yml -openapi_spec_hash: 5dbb5577e6a7cae7db615b1b06c9d23e -config_hash: 719ad411c0ec7402a7a4c1f95515280c +configured_endpoints: 115 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d854bc81e0a99171716893e6790a87ba350bb6fc778f8e3244abdd47d5c252c3.yml +openapi_spec_hash: 5189220e4712a7b0cdd35beba2ebb47d +config_hash: 981e43e8b1e3ddabd435d350aeeed417 diff --git a/api.md b/api.md index e0c317e1..2de3b619 100644 --- a/api.md +++ b/api.md @@ -76,6 +76,7 @@ from gitpod.types import ( EnvironmentRetrieveResponse, EnvironmentUpdateResponse, EnvironmentDeleteResponse, + EnvironmentCreateEnvironmentTokenResponse, EnvironmentCreateFromProjectResponse, EnvironmentCreateLogsTokenResponse, EnvironmentMarkActiveResponse, @@ -91,6 +92,7 @@ Methods: - client.environments.update(\*\*params) -> object - client.environments.list(\*\*params) -> SyncEnvironmentsPage[Environment] - client.environments.delete(\*\*params) -> object +- client.environments.create_environment_token(\*\*params) -> EnvironmentCreateEnvironmentTokenResponse - client.environments.create_from_project(\*\*params) -> EnvironmentCreateFromProjectResponse - client.environments.create_logs_token(\*\*params) -> EnvironmentCreateLogsTokenResponse - client.environments.mark_active(\*\*params) -> object @@ -216,6 +218,7 @@ Types: ```python from gitpod.types import ( + IDTokenVersion, IdentityExchangeTokenResponse, IdentityGetAuthenticatedIdentityResponse, IdentityGetIDTokenResponse, @@ -237,7 +240,7 @@ from gitpod.types import ( InviteDomains, Organization, OrganizationMember, - Scope, + OrganizationTier, OrganizationCreateResponse, OrganizationRetrieveResponse, OrganizationUpdateResponse, @@ -253,7 +256,6 @@ Methods: - client.organizations.create(\*\*params) -> OrganizationCreateResponse - client.organizations.retrieve(\*\*params) -> OrganizationRetrieveResponse - client.organizations.update(\*\*params) -> OrganizationUpdateResponse -- client.organizations.list(\*\*params) -> SyncOrganizationsPage[Organization] - client.organizations.delete(\*\*params) -> object - client.organizations.join(\*\*params) -> OrganizationJoinResponse - client.organizations.leave(\*\*params) -> object @@ -302,6 +304,23 @@ Methods: - client.organizations.invites.retrieve(\*\*params) -> InviteRetrieveResponse - client.organizations.invites.get_summary(\*\*params) -> InviteGetSummaryResponse +## Policies + +Types: + +```python +from gitpod.types.organizations import ( + OrganizationPolicies, + PolicyRetrieveResponse, + PolicyUpdateResponse, +) +``` + +Methods: + +- client.organizations.policies.retrieve(\*\*params) -> PolicyRetrieveResponse +- client.organizations.policies.update(\*\*params) -> object + ## SSOConfigurations Types: @@ -380,6 +399,8 @@ Types: ```python from gitpod.types import ( + LogLevel, + MetricsConfiguration, Runner, RunnerCapability, RunnerConfiguration, @@ -532,6 +553,7 @@ Types: ```python from gitpod.types import ( Secret, + SecretScope, SecretCreateResponse, SecretDeleteResponse, SecretGetValueResponse, @@ -560,6 +582,19 @@ Methods: - client.users.get_authenticated_user(\*\*params) -> UserGetAuthenticatedUserResponse - client.users.set_suspended(\*\*params) -> object +## Dotfiles + +Types: + +```python +from gitpod.types.users import DotfilesConfiguration, DotfileGetResponse, DotfileSetResponse +``` + +Methods: + +- client.users.dotfiles.get(\*\*params) -> DotfileGetResponse +- client.users.dotfiles.set(\*\*params) -> object + ## Pats Types: diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index a8e74f8f..578b1f79 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -36,9 +36,6 @@ "MembersPagePagination", "SyncMembersPage", "AsyncMembersPage", - "OrganizationsPagePagination", - "SyncOrganizationsPage", - "AsyncOrganizationsPage", "PersonalAccessTokensPagePagination", "SyncPersonalAccessTokensPage", "AsyncPersonalAccessTokensPage", @@ -524,56 +521,6 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class OrganizationsPagePagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - -class SyncOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - organizations: List[_T] - pagination: Optional[OrganizationsPagePagination] = None - - @override - def _get_page_items(self) -> List[_T]: - organizations = self.organizations - if not organizations: - return [] - return organizations - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = None - if self.pagination is not None: - if self.pagination.next_token is not None: - next_token = self.pagination.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - organizations: List[_T] - pagination: Optional[OrganizationsPagePagination] = None - - @override - def _get_page_items(self) -> List[_T]: - organizations = self.organizations - if not organizations: - return [] - return organizations - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = None - if self.pagination is not None: - if self.pagination.next_token is not None: - next_token = self.pagination.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - class PersonalAccessTokensPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 756b849c..3c3075f2 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -98,6 +98,7 @@ def list( *, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, + filter: editor_list_params.Filter | NotGiven = NOT_GIVEN, pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -107,7 +108,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncEditorsPage[Editor]: """ - Lists all available code editors. + Lists all available code editors, optionally filtered to those allowed in an + organization. Use this method to: @@ -127,7 +129,21 @@ def list( pageSize: 20 ``` + - List editors available to the organization: + + Shows all available editors that are allowed by the policies enforced in the + organization with pagination. + + ```yaml + pagination: + pageSize: 20 + filter: + allowedByPolicy: true + ``` + Args: + filter: filter contains the filter options for listing editors + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -141,7 +157,13 @@ def list( return self._get_api_list( "/gitpod.v1.EditorService/ListEditors", page=SyncEditorsPage[Editor], - body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + editor_list_params.EditorListParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -300,6 +322,7 @@ def list( *, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, + filter: editor_list_params.Filter | NotGiven = NOT_GIVEN, pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -309,7 +332,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Editor, AsyncEditorsPage[Editor]]: """ - Lists all available code editors. + Lists all available code editors, optionally filtered to those allowed in an + organization. Use this method to: @@ -329,7 +353,21 @@ def list( pageSize: 20 ``` + - List editors available to the organization: + + Shows all available editors that are allowed by the policies enforced in the + organization with pagination. + + ```yaml + pagination: + pageSize: 20 + filter: + allowedByPolicy: true + ``` + Args: + filter: filter contains the filter options for listing editors + pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -343,7 +381,13 @@ def list( return self._get_api_list( "/gitpod.v1.EditorService/ListEditors", page=AsyncEditorsPage[Editor], - body=maybe_transform({"pagination": pagination}, editor_list_params.EditorListParams), + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + editor_list_params.EditorListParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index bb07bb8e..8cafcee9 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -17,6 +17,7 @@ environment_mark_active_params, environment_create_logs_token_params, environment_create_from_project_params, + environment_create_environment_token_params, ) from .classes import ( ClassesResource, @@ -53,6 +54,7 @@ from ...types.environment_activity_signal_param import EnvironmentActivitySignalParam from ...types.environment_create_logs_token_response import EnvironmentCreateLogsTokenResponse from ...types.environment_create_from_project_response import EnvironmentCreateFromProjectResponse +from ...types.environment_create_environment_token_response import EnvironmentCreateEnvironmentTokenResponse __all__ = ["EnvironmentsResource", "AsyncEnvironmentsResource"] @@ -492,6 +494,57 @@ def delete( cast_to=object, ) + def create_environment_token( + self, + *, + environment_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentCreateEnvironmentTokenResponse: + """ + Creates an access token for the environment. + + Generated tokens are valid for one hour and provide environment-specific access + permissions. The token is scoped to a specific environment. + + ### Examples + + - Generate environment token: + + Creates a temporary access token for accessing an environment. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + environment_id: environment_id specifies the environment for which the access token should be + created. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.EnvironmentService/CreateEnvironmentAccessToken", + body=maybe_transform( + {"environment_id": environment_id}, + environment_create_environment_token_params.EnvironmentCreateEnvironmentTokenParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentCreateEnvironmentTokenResponse, + ) + def create_from_project( self, *, @@ -1209,6 +1262,57 @@ async def delete( cast_to=object, ) + async def create_environment_token( + self, + *, + environment_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EnvironmentCreateEnvironmentTokenResponse: + """ + Creates an access token for the environment. + + Generated tokens are valid for one hour and provide environment-specific access + permissions. The token is scoped to a specific environment. + + ### Examples + + - Generate environment token: + + Creates a temporary access token for accessing an environment. + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + environment_id: environment_id specifies the environment for which the access token should be + created. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.EnvironmentService/CreateEnvironmentAccessToken", + body=await async_maybe_transform( + {"environment_id": environment_id}, + environment_create_environment_token_params.EnvironmentCreateEnvironmentTokenParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EnvironmentCreateEnvironmentTokenResponse, + ) + async def create_from_project( self, *, @@ -1514,6 +1618,9 @@ def __init__(self, environments: EnvironmentsResource) -> None: self.delete = to_raw_response_wrapper( environments.delete, ) + self.create_environment_token = to_raw_response_wrapper( + environments.create_environment_token, + ) self.create_from_project = to_raw_response_wrapper( environments.create_from_project, ) @@ -1558,6 +1665,9 @@ def __init__(self, environments: AsyncEnvironmentsResource) -> None: self.delete = async_to_raw_response_wrapper( environments.delete, ) + self.create_environment_token = async_to_raw_response_wrapper( + environments.create_environment_token, + ) self.create_from_project = async_to_raw_response_wrapper( environments.create_from_project, ) @@ -1602,6 +1712,9 @@ def __init__(self, environments: EnvironmentsResource) -> None: self.delete = to_streamed_response_wrapper( environments.delete, ) + self.create_environment_token = to_streamed_response_wrapper( + environments.create_environment_token, + ) self.create_from_project = to_streamed_response_wrapper( environments.create_from_project, ) @@ -1646,6 +1759,9 @@ def __init__(self, environments: AsyncEnvironmentsResource) -> None: self.delete = async_to_streamed_response_wrapper( environments.delete, ) + self.create_environment_token = async_to_streamed_response_wrapper( + environments.create_environment_token, + ) self.create_from_project = async_to_streamed_response_wrapper( environments.create_from_project, ) diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 2528a649..25b859b5 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -7,6 +7,7 @@ import httpx from ..types import ( + IDTokenVersion, identity_get_id_token_params, identity_exchange_token_params, identity_get_authenticated_identity_params, @@ -22,6 +23,7 @@ async_to_streamed_response_wrapper, ) from .._base_client import make_request_options +from ..types.id_token_version import IDTokenVersion from ..types.identity_get_id_token_response import IdentityGetIDTokenResponse from ..types.identity_exchange_token_response import IdentityExchangeTokenResponse from ..types.identity_get_authenticated_identity_response import IdentityGetAuthenticatedIdentityResponse @@ -156,6 +158,7 @@ def get_id_token( self, *, audience: List[str] | NotGiven = NOT_GIVEN, + version: IDTokenVersion | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -194,6 +197,8 @@ def get_id_token( ``` Args: + version: version is the version of the ID token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -204,7 +209,13 @@ def get_id_token( """ return self._post( "/gitpod.v1.IdentityService/GetIDToken", - body=maybe_transform({"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams), + body=maybe_transform( + { + "audience": audience, + "version": version, + }, + identity_get_id_token_params.IdentityGetIDTokenParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -339,6 +350,7 @@ async def get_id_token( self, *, audience: List[str] | NotGiven = NOT_GIVEN, + version: IDTokenVersion | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -377,6 +389,8 @@ async def get_id_token( ``` Args: + version: version is the version of the ID token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -388,7 +402,11 @@ async def get_id_token( return await self._post( "/gitpod.v1.IdentityService/GetIDToken", body=await async_maybe_transform( - {"audience": audience}, identity_get_id_token_params.IdentityGetIDTokenParams + { + "audience": audience, + "version": version, + }, + identity_get_id_token_params.IdentityGetIDTokenParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py index 3b7cf4ed..28e5eedf 100644 --- a/src/gitpod/resources/organizations/__init__.py +++ b/src/gitpod/resources/organizations/__init__.py @@ -8,6 +8,14 @@ InvitesResourceWithStreamingResponse, AsyncInvitesResourceWithStreamingResponse, ) +from .policies import ( + PoliciesResource, + AsyncPoliciesResource, + PoliciesResourceWithRawResponse, + AsyncPoliciesResourceWithRawResponse, + PoliciesResourceWithStreamingResponse, + AsyncPoliciesResourceWithStreamingResponse, +) from .organizations import ( OrganizationsResource, AsyncOrganizationsResource, @@ -46,6 +54,12 @@ "AsyncInvitesResourceWithRawResponse", "InvitesResourceWithStreamingResponse", "AsyncInvitesResourceWithStreamingResponse", + "PoliciesResource", + "AsyncPoliciesResource", + "PoliciesResourceWithRawResponse", + "AsyncPoliciesResourceWithRawResponse", + "PoliciesResourceWithStreamingResponse", + "AsyncPoliciesResourceWithStreamingResponse", "SSOConfigurationsResource", "AsyncSSOConfigurationsResource", "SSOConfigurationsResourceWithRawResponse", diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 4c6904e9..0e989d83 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -7,9 +7,7 @@ import httpx from ...types import ( - Scope, organization_join_params, - organization_list_params, organization_leave_params, organization_create_params, organization_delete_params, @@ -28,6 +26,14 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import maybe_transform, async_maybe_transform +from .policies import ( + PoliciesResource, + AsyncPoliciesResource, + PoliciesResourceWithRawResponse, + AsyncPoliciesResourceWithRawResponse, + PoliciesResourceWithStreamingResponse, + AsyncPoliciesResourceWithStreamingResponse, +) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -36,8 +42,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncMembersPage, AsyncMembersPage, SyncOrganizationsPage, AsyncOrganizationsPage -from ...types.scope import Scope +from ...pagination import SyncMembersPage, AsyncMembersPage from ..._base_client import AsyncPaginator, make_request_options from .sso_configurations import ( SSOConfigurationsResource, @@ -47,7 +52,6 @@ SSOConfigurationsResourceWithStreamingResponse, AsyncSSOConfigurationsResourceWithStreamingResponse, ) -from ...types.organization import Organization from .domain_verifications import ( DomainVerificationsResource, AsyncDomainVerificationsResource, @@ -76,6 +80,10 @@ def domain_verifications(self) -> DomainVerificationsResource: def invites(self) -> InvitesResource: return InvitesResource(self._client) + @cached_property + def policies(self) -> PoliciesResource: + return PoliciesResource(self._client) + @cached_property def sso_configurations(self) -> SSOConfigurationsResource: return SSOConfigurationsResource(self._client) @@ -308,91 +316,6 @@ def update( cast_to=OrganizationUpdateResponse, ) - def list( - self, - *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: organization_list_params.Pagination | NotGiven = NOT_GIVEN, - scope: Scope | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncOrganizationsPage[Organization]: - """ - Lists all organizations the caller has access to with optional filtering. - - Use this method to: - - - View organizations you're a member of - - Browse all available organizations - - Paginate through organization results - - ### Examples - - - List member organizations: - - Shows organizations where the caller is a member. - - ```yaml - pagination: - pageSize: 20 - scope: SCOPE_MEMBER - ``` - - - List all organizations: - - Shows all organizations visible to the caller. - - ```yaml - pagination: - pageSize: 50 - scope: SCOPE_ALL - ``` - - Args: - pagination: pagination contains the pagination options for listing organizations - - scope: scope is the scope of the organizations to list - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/gitpod.v1.OrganizationService/ListOrganizations", - page=SyncOrganizationsPage[Organization], - body=maybe_transform( - { - "pagination": pagination, - "scope": scope, - }, - organization_list_params.OrganizationListParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "token": token, - "page_size": page_size, - }, - organization_list_params.OrganizationListParams, - ), - ), - model=Organization, - method="post", - ) - def delete( self, *, @@ -730,6 +653,10 @@ def domain_verifications(self) -> AsyncDomainVerificationsResource: def invites(self) -> AsyncInvitesResource: return AsyncInvitesResource(self._client) + @cached_property + def policies(self) -> AsyncPoliciesResource: + return AsyncPoliciesResource(self._client) + @cached_property def sso_configurations(self) -> AsyncSSOConfigurationsResource: return AsyncSSOConfigurationsResource(self._client) @@ -962,91 +889,6 @@ async def update( cast_to=OrganizationUpdateResponse, ) - def list( - self, - *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: organization_list_params.Pagination | NotGiven = NOT_GIVEN, - scope: Scope | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Organization, AsyncOrganizationsPage[Organization]]: - """ - Lists all organizations the caller has access to with optional filtering. - - Use this method to: - - - View organizations you're a member of - - Browse all available organizations - - Paginate through organization results - - ### Examples - - - List member organizations: - - Shows organizations where the caller is a member. - - ```yaml - pagination: - pageSize: 20 - scope: SCOPE_MEMBER - ``` - - - List all organizations: - - Shows all organizations visible to the caller. - - ```yaml - pagination: - pageSize: 50 - scope: SCOPE_ALL - ``` - - Args: - pagination: pagination contains the pagination options for listing organizations - - scope: scope is the scope of the organizations to list - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/gitpod.v1.OrganizationService/ListOrganizations", - page=AsyncOrganizationsPage[Organization], - body=maybe_transform( - { - "pagination": pagination, - "scope": scope, - }, - organization_list_params.OrganizationListParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "token": token, - "page_size": page_size, - }, - organization_list_params.OrganizationListParams, - ), - ), - model=Organization, - method="post", - ) - async def delete( self, *, @@ -1388,9 +1230,6 @@ def __init__(self, organizations: OrganizationsResource) -> None: self.update = to_raw_response_wrapper( organizations.update, ) - self.list = to_raw_response_wrapper( - organizations.list, - ) self.delete = to_raw_response_wrapper( organizations.delete, ) @@ -1415,6 +1254,10 @@ def domain_verifications(self) -> DomainVerificationsResourceWithRawResponse: def invites(self) -> InvitesResourceWithRawResponse: return InvitesResourceWithRawResponse(self._organizations.invites) + @cached_property + def policies(self) -> PoliciesResourceWithRawResponse: + return PoliciesResourceWithRawResponse(self._organizations.policies) + @cached_property def sso_configurations(self) -> SSOConfigurationsResourceWithRawResponse: return SSOConfigurationsResourceWithRawResponse(self._organizations.sso_configurations) @@ -1433,9 +1276,6 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: self.update = async_to_raw_response_wrapper( organizations.update, ) - self.list = async_to_raw_response_wrapper( - organizations.list, - ) self.delete = async_to_raw_response_wrapper( organizations.delete, ) @@ -1460,6 +1300,10 @@ def domain_verifications(self) -> AsyncDomainVerificationsResourceWithRawRespons def invites(self) -> AsyncInvitesResourceWithRawResponse: return AsyncInvitesResourceWithRawResponse(self._organizations.invites) + @cached_property + def policies(self) -> AsyncPoliciesResourceWithRawResponse: + return AsyncPoliciesResourceWithRawResponse(self._organizations.policies) + @cached_property def sso_configurations(self) -> AsyncSSOConfigurationsResourceWithRawResponse: return AsyncSSOConfigurationsResourceWithRawResponse(self._organizations.sso_configurations) @@ -1478,9 +1322,6 @@ def __init__(self, organizations: OrganizationsResource) -> None: self.update = to_streamed_response_wrapper( organizations.update, ) - self.list = to_streamed_response_wrapper( - organizations.list, - ) self.delete = to_streamed_response_wrapper( organizations.delete, ) @@ -1505,6 +1346,10 @@ def domain_verifications(self) -> DomainVerificationsResourceWithStreamingRespon def invites(self) -> InvitesResourceWithStreamingResponse: return InvitesResourceWithStreamingResponse(self._organizations.invites) + @cached_property + def policies(self) -> PoliciesResourceWithStreamingResponse: + return PoliciesResourceWithStreamingResponse(self._organizations.policies) + @cached_property def sso_configurations(self) -> SSOConfigurationsResourceWithStreamingResponse: return SSOConfigurationsResourceWithStreamingResponse(self._organizations.sso_configurations) @@ -1523,9 +1368,6 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: self.update = async_to_streamed_response_wrapper( organizations.update, ) - self.list = async_to_streamed_response_wrapper( - organizations.list, - ) self.delete = async_to_streamed_response_wrapper( organizations.delete, ) @@ -1550,6 +1392,10 @@ def domain_verifications(self) -> AsyncDomainVerificationsResourceWithStreamingR def invites(self) -> AsyncInvitesResourceWithStreamingResponse: return AsyncInvitesResourceWithStreamingResponse(self._organizations.invites) + @cached_property + def policies(self) -> AsyncPoliciesResourceWithStreamingResponse: + return AsyncPoliciesResourceWithStreamingResponse(self._organizations.policies) + @cached_property def sso_configurations(self) -> AsyncSSOConfigurationsResourceWithStreamingResponse: return AsyncSSOConfigurationsResourceWithStreamingResponse(self._organizations.sso_configurations) diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py new file mode 100644 index 00000000..172591c0 --- /dev/null +++ b/src/gitpod/resources/organizations/policies.py @@ -0,0 +1,447 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.organizations import policy_update_params, policy_retrieve_params +from ...types.organizations.policy_retrieve_response import PolicyRetrieveResponse + +__all__ = ["PoliciesResource", "AsyncPoliciesResource"] + + +class PoliciesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PoliciesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return PoliciesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return PoliciesResourceWithStreamingResponse(self) + + def retrieve( + self, + *, + organization_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PolicyRetrieveResponse: + """ + Gets organization policy settings by organization ID. + + Use this method to: + + - Retrieve current policy settings for an organization + - View resource limits and restrictions + - Check allowed editors and other configurations + + ### Examples + + - Get organization policies: + + Retrieves policy settings for a specific organization. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to retrieve policies for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/GetOrganizationPolicies", + body=maybe_transform({"organization_id": organization_id}, policy_retrieve_params.PolicyRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PolicyRetrieveResponse, + ) + + def update( + self, + *, + organization_id: str, + allowed_editor_ids: List[str] | NotGiven = NOT_GIVEN, + allow_local_runners: Optional[bool] | NotGiven = NOT_GIVEN, + default_editor_id: Optional[str] | NotGiven = NOT_GIVEN, + default_environment_image: Optional[str] | NotGiven = NOT_GIVEN, + maximum_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, + maximum_environment_timeout: Optional[str] | NotGiven = NOT_GIVEN, + maximum_running_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, + members_create_projects: Optional[bool] | NotGiven = NOT_GIVEN, + members_require_projects: Optional[bool] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Updates organization policy settings. + + Use this method to: + + - Configure editor restrictions + - Set environment resource limits + - Define project creation permissions + - Customize default configurations + + ### Examples + + - Update editor policies: + + Restricts available editors and sets a default. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + allowedEditorIds: + - "vscode" + - "jetbrains" + defaultEditorId: "vscode" + ``` + + - Set environment limits: + + Configures limits for environment usage. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + maximumEnvironmentTimeout: "3600s" + maximumRunningEnvironmentsPerUser: "5" + maximumEnvironmentsPerUser: "20" + ``` + + Args: + organization_id: organization_id is the ID of the organization to update policies for + + allowed_editor_ids: allowed_editor_ids is the list of editor IDs that are allowed to be used in the + organization + + allow_local_runners: allow_local_runners controls whether local runners are allowed to be used in the + organization + + default_editor_id: default_editor_id is the default editor ID to be used when a user doesn't + specify one + + default_environment_image: default_environment_image is the default container image when none is defined in + repo + + maximum_environments_per_user: maximum_environments_per_user limits total environments (running or stopped) per + user + + maximum_environment_timeout: maximum_environment_timeout controls the maximum timeout allowed for + environments in seconds. 0 means no limit (never). Minimum duration is 30 + minutes. + + maximum_running_environments_per_user: maximum_running_environments_per_user limits simultaneously running environments + per user + + members_create_projects: members_create_projects controls whether members can create projects + + members_require_projects: members_require_projects controls whether environments can only be created from + projects by non-admin users + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/UpdateOrganizationPolicies", + body=maybe_transform( + { + "organization_id": organization_id, + "allowed_editor_ids": allowed_editor_ids, + "allow_local_runners": allow_local_runners, + "default_editor_id": default_editor_id, + "default_environment_image": default_environment_image, + "maximum_environments_per_user": maximum_environments_per_user, + "maximum_environment_timeout": maximum_environment_timeout, + "maximum_running_environments_per_user": maximum_running_environments_per_user, + "members_create_projects": members_create_projects, + "members_require_projects": members_require_projects, + }, + policy_update_params.PolicyUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncPoliciesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncPoliciesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncPoliciesResourceWithStreamingResponse(self) + + async def retrieve( + self, + *, + organization_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PolicyRetrieveResponse: + """ + Gets organization policy settings by organization ID. + + Use this method to: + + - Retrieve current policy settings for an organization + - View resource limits and restrictions + - Check allowed editors and other configurations + + ### Examples + + - Get organization policies: + + Retrieves policy settings for a specific organization. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to retrieve policies for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/GetOrganizationPolicies", + body=await async_maybe_transform( + {"organization_id": organization_id}, policy_retrieve_params.PolicyRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PolicyRetrieveResponse, + ) + + async def update( + self, + *, + organization_id: str, + allowed_editor_ids: List[str] | NotGiven = NOT_GIVEN, + allow_local_runners: Optional[bool] | NotGiven = NOT_GIVEN, + default_editor_id: Optional[str] | NotGiven = NOT_GIVEN, + default_environment_image: Optional[str] | NotGiven = NOT_GIVEN, + maximum_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, + maximum_environment_timeout: Optional[str] | NotGiven = NOT_GIVEN, + maximum_running_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, + members_create_projects: Optional[bool] | NotGiven = NOT_GIVEN, + members_require_projects: Optional[bool] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Updates organization policy settings. + + Use this method to: + + - Configure editor restrictions + - Set environment resource limits + - Define project creation permissions + - Customize default configurations + + ### Examples + + - Update editor policies: + + Restricts available editors and sets a default. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + allowedEditorIds: + - "vscode" + - "jetbrains" + defaultEditorId: "vscode" + ``` + + - Set environment limits: + + Configures limits for environment usage. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + maximumEnvironmentTimeout: "3600s" + maximumRunningEnvironmentsPerUser: "5" + maximumEnvironmentsPerUser: "20" + ``` + + Args: + organization_id: organization_id is the ID of the organization to update policies for + + allowed_editor_ids: allowed_editor_ids is the list of editor IDs that are allowed to be used in the + organization + + allow_local_runners: allow_local_runners controls whether local runners are allowed to be used in the + organization + + default_editor_id: default_editor_id is the default editor ID to be used when a user doesn't + specify one + + default_environment_image: default_environment_image is the default container image when none is defined in + repo + + maximum_environments_per_user: maximum_environments_per_user limits total environments (running or stopped) per + user + + maximum_environment_timeout: maximum_environment_timeout controls the maximum timeout allowed for + environments in seconds. 0 means no limit (never). Minimum duration is 30 + minutes. + + maximum_running_environments_per_user: maximum_running_environments_per_user limits simultaneously running environments + per user + + members_create_projects: members_create_projects controls whether members can create projects + + members_require_projects: members_require_projects controls whether environments can only be created from + projects by non-admin users + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/UpdateOrganizationPolicies", + body=await async_maybe_transform( + { + "organization_id": organization_id, + "allowed_editor_ids": allowed_editor_ids, + "allow_local_runners": allow_local_runners, + "default_editor_id": default_editor_id, + "default_environment_image": default_environment_image, + "maximum_environments_per_user": maximum_environments_per_user, + "maximum_environment_timeout": maximum_environment_timeout, + "maximum_running_environments_per_user": maximum_running_environments_per_user, + "members_create_projects": members_create_projects, + "members_require_projects": members_require_projects, + }, + policy_update_params.PolicyUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class PoliciesResourceWithRawResponse: + def __init__(self, policies: PoliciesResource) -> None: + self._policies = policies + + self.retrieve = to_raw_response_wrapper( + policies.retrieve, + ) + self.update = to_raw_response_wrapper( + policies.update, + ) + + +class AsyncPoliciesResourceWithRawResponse: + def __init__(self, policies: AsyncPoliciesResource) -> None: + self._policies = policies + + self.retrieve = async_to_raw_response_wrapper( + policies.retrieve, + ) + self.update = async_to_raw_response_wrapper( + policies.update, + ) + + +class PoliciesResourceWithStreamingResponse: + def __init__(self, policies: PoliciesResource) -> None: + self._policies = policies + + self.retrieve = to_streamed_response_wrapper( + policies.retrieve, + ) + self.update = to_streamed_response_wrapper( + policies.update, + ) + + +class AsyncPoliciesResourceWithStreamingResponse: + def __init__(self, policies: AsyncPoliciesResource) -> None: + self._policies = policies + + self.retrieve = async_to_streamed_response_wrapper( + policies.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + policies.update, + ) diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index c19157c4..2c8e6375 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -77,6 +77,7 @@ def create( automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + technical_description: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -143,6 +144,9 @@ def create( this.matches("^$|^[^/].*") ``` + technical_description: technical_description is a detailed technical description of the project This + field is not returned by default in GetProject or ListProjects responses 8KB max + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -160,6 +164,7 @@ def create( "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, "name": name, + "technical_description": technical_description, }, project_create_params.ProjectCreateParams, ), @@ -228,6 +233,7 @@ def update( initializer: Optional[EnvironmentInitializerParam] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, + technical_description: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -285,6 +291,9 @@ def update( project_id: project_id specifies the project identifier + technical_description: technical_description is a detailed technical description of the project This + field is not returned by default in GetProject or ListProjects responses 8KB max + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -303,6 +312,7 @@ def update( "initializer": initializer, "name": name, "project_id": project_id, + "technical_description": technical_description, }, project_update_params.ProjectUpdateParams, ), @@ -317,6 +327,7 @@ def list( *, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, + filter: project_list_params.Filter | NotGiven = NOT_GIVEN, pagination: project_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -359,7 +370,13 @@ def list( return self._get_api_list( "/gitpod.v1.ProjectService/ListProjects", page=SyncProjectsPage[Project], - body=maybe_transform({"pagination": pagination}, project_list_params.ProjectListParams), + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + project_list_params.ProjectListParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -518,6 +535,7 @@ async def create( automations_file_path: str | NotGiven = NOT_GIVEN, devcontainer_file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + technical_description: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -584,6 +602,9 @@ async def create( this.matches("^$|^[^/].*") ``` + technical_description: technical_description is a detailed technical description of the project This + field is not returned by default in GetProject or ListProjects responses 8KB max + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -601,6 +622,7 @@ async def create( "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, "name": name, + "technical_description": technical_description, }, project_create_params.ProjectCreateParams, ), @@ -669,6 +691,7 @@ async def update( initializer: Optional[EnvironmentInitializerParam] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, + technical_description: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -726,6 +749,9 @@ async def update( project_id: project_id specifies the project identifier + technical_description: technical_description is a detailed technical description of the project This + field is not returned by default in GetProject or ListProjects responses 8KB max + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -744,6 +770,7 @@ async def update( "initializer": initializer, "name": name, "project_id": project_id, + "technical_description": technical_description, }, project_update_params.ProjectUpdateParams, ), @@ -758,6 +785,7 @@ def list( *, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, + filter: project_list_params.Filter | NotGiven = NOT_GIVEN, pagination: project_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -800,7 +828,13 @@ def list( return self._get_api_list( "/gitpod.v1.ProjectService/ListProjects", page=AsyncProjectsPage[Project], - body=maybe_transform({"pagination": pagination}, project_list_params.ProjectListParams), + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + project_list_params.ProjectListParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 8e02efa4..8e0fdf58 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -24,6 +24,7 @@ from ..pagination import SyncSecretsPage, AsyncSecretsPage from .._base_client import AsyncPaginator, make_request_options from ..types.secret import Secret +from ..types.secret_scope_param import SecretScopeParam from ..types.secret_create_response import SecretCreateResponse from ..types.secret_get_value_response import SecretGetValueResponse @@ -58,6 +59,7 @@ def create( file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, + scope: SecretScopeParam | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -113,12 +115,7 @@ def create( Args: container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have - the docker registry host value must be a valid registry host (e.g. - registry.docker.com, https://registry.docker.com, ghcr.io:5050): - - ``` - this.matches("^[a-zA-Z0-9.-/:]+(:[0-9]+)?$") - ``` + the docker registry host environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -130,7 +127,9 @@ def create( this.matches("^/(?:[^/]*/)*.*$") ``` - project_id: project_id is the ProjectID this Secret belongs to + project_id: project_id is the ProjectID this Secret belongs to Deprecated: use scope instead + + scope: scope is the scope of the secret value: value is the plaintext value of the secret @@ -151,6 +150,7 @@ def create( "file_path": file_path, "name": name, "project_id": project_id, + "scope": scope, "value": value, }, secret_create_params.SecretCreateParams, @@ -176,25 +176,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncSecretsPage[Secret]: """ - Lists secrets with optional filtering. - - Use this method to: - - - View all project secrets - - Filter secrets by project - - ### Examples - - - List project secrets: - - Shows all secrets for a project. - - ```yaml - filter: - projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] - pagination: - pageSize: 20 - ``` + ListSecrets Args: pagination: pagination contains the pagination options for listing environments @@ -416,6 +398,7 @@ async def create( file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, + scope: SecretScopeParam | NotGiven = NOT_GIVEN, value: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -471,12 +454,7 @@ async def create( Args: container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have - the docker registry host value must be a valid registry host (e.g. - registry.docker.com, https://registry.docker.com, ghcr.io:5050): - - ``` - this.matches("^[a-zA-Z0-9.-/:]+(:[0-9]+)?$") - ``` + the docker registry host environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -488,7 +466,9 @@ async def create( this.matches("^/(?:[^/]*/)*.*$") ``` - project_id: project_id is the ProjectID this Secret belongs to + project_id: project_id is the ProjectID this Secret belongs to Deprecated: use scope instead + + scope: scope is the scope of the secret value: value is the plaintext value of the secret @@ -509,6 +489,7 @@ async def create( "file_path": file_path, "name": name, "project_id": project_id, + "scope": scope, "value": value, }, secret_create_params.SecretCreateParams, @@ -534,25 +515,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Secret, AsyncSecretsPage[Secret]]: """ - Lists secrets with optional filtering. - - Use this method to: - - - View all project secrets - - Filter secrets by project - - ### Examples - - - List project secrets: - - Shows all secrets for a project. - - ```yaml - filter: - projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] - pagination: - pageSize: 20 - ``` + ListSecrets Args: pagination: pagination contains the pagination options for listing environments diff --git a/src/gitpod/resources/users/__init__.py b/src/gitpod/resources/users/__init__.py index c138e0bf..7250286e 100644 --- a/src/gitpod/resources/users/__init__.py +++ b/src/gitpod/resources/users/__init__.py @@ -16,8 +16,22 @@ UsersResourceWithStreamingResponse, AsyncUsersResourceWithStreamingResponse, ) +from .dotfiles import ( + DotfilesResource, + AsyncDotfilesResource, + DotfilesResourceWithRawResponse, + AsyncDotfilesResourceWithRawResponse, + DotfilesResourceWithStreamingResponse, + AsyncDotfilesResourceWithStreamingResponse, +) __all__ = [ + "DotfilesResource", + "AsyncDotfilesResource", + "DotfilesResourceWithRawResponse", + "AsyncDotfilesResourceWithRawResponse", + "DotfilesResourceWithStreamingResponse", + "AsyncDotfilesResourceWithStreamingResponse", "PatsResource", "AsyncPatsResource", "PatsResourceWithRawResponse", diff --git a/src/gitpod/resources/users/dotfiles.py b/src/gitpod/resources/users/dotfiles.py new file mode 100644 index 00000000..6e14987b --- /dev/null +++ b/src/gitpod/resources/users/dotfiles.py @@ -0,0 +1,313 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...types.users import dotfile_get_params, dotfile_set_params +from ..._base_client import make_request_options +from ...types.users.dotfile_get_response import DotfileGetResponse + +__all__ = ["DotfilesResource", "AsyncDotfilesResource"] + + +class DotfilesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DotfilesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return DotfilesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DotfilesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return DotfilesResourceWithStreamingResponse(self) + + def get( + self, + *, + empty: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DotfileGetResponse: + """ + Gets the dotfiles for a user. + + Use this method to: + + - Retrieve user dotfiles + + ### Examples + + - Get dotfiles: + + Retrieves the dotfiles for the current user. + + ```yaml + {} + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.UserService/GetDotfilesConfiguration", + body=maybe_transform({"empty": empty}, dotfile_get_params.DotfileGetParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DotfileGetResponse, + ) + + def set( + self, + *, + repository: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Sets the dotfiles configuration for a user. + + Use this method to: + + - Configure user dotfiles + - Update dotfiles settings + + ### Examples + + - Set dotfiles configuration: + + Sets the dotfiles configuration for the current user. + + ```yaml + { "repository": "https://github.com/gitpod-io/dotfiles" } + ``` + + - Remove dotfiles: + + Removes the dotfiles for the current user. + + ```yaml + {} + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.UserService/SetDotfilesConfiguration", + body=maybe_transform({"repository": repository}, dotfile_set_params.DotfileSetParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncDotfilesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDotfilesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncDotfilesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDotfilesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncDotfilesResourceWithStreamingResponse(self) + + async def get( + self, + *, + empty: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DotfileGetResponse: + """ + Gets the dotfiles for a user. + + Use this method to: + + - Retrieve user dotfiles + + ### Examples + + - Get dotfiles: + + Retrieves the dotfiles for the current user. + + ```yaml + {} + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.UserService/GetDotfilesConfiguration", + body=await async_maybe_transform({"empty": empty}, dotfile_get_params.DotfileGetParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DotfileGetResponse, + ) + + async def set( + self, + *, + repository: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Sets the dotfiles configuration for a user. + + Use this method to: + + - Configure user dotfiles + - Update dotfiles settings + + ### Examples + + - Set dotfiles configuration: + + Sets the dotfiles configuration for the current user. + + ```yaml + { "repository": "https://github.com/gitpod-io/dotfiles" } + ``` + + - Remove dotfiles: + + Removes the dotfiles for the current user. + + ```yaml + {} + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.UserService/SetDotfilesConfiguration", + body=await async_maybe_transform({"repository": repository}, dotfile_set_params.DotfileSetParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class DotfilesResourceWithRawResponse: + def __init__(self, dotfiles: DotfilesResource) -> None: + self._dotfiles = dotfiles + + self.get = to_raw_response_wrapper( + dotfiles.get, + ) + self.set = to_raw_response_wrapper( + dotfiles.set, + ) + + +class AsyncDotfilesResourceWithRawResponse: + def __init__(self, dotfiles: AsyncDotfilesResource) -> None: + self._dotfiles = dotfiles + + self.get = async_to_raw_response_wrapper( + dotfiles.get, + ) + self.set = async_to_raw_response_wrapper( + dotfiles.set, + ) + + +class DotfilesResourceWithStreamingResponse: + def __init__(self, dotfiles: DotfilesResource) -> None: + self._dotfiles = dotfiles + + self.get = to_streamed_response_wrapper( + dotfiles.get, + ) + self.set = to_streamed_response_wrapper( + dotfiles.set, + ) + + +class AsyncDotfilesResourceWithStreamingResponse: + def __init__(self, dotfiles: AsyncDotfilesResource) -> None: + self._dotfiles = dotfiles + + self.get = async_to_streamed_response_wrapper( + dotfiles.get, + ) + self.set = async_to_streamed_response_wrapper( + dotfiles.set, + ) diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index 75e9efc3..0ffe276a 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -15,6 +15,14 @@ from ...types import user_set_suspended_params, user_get_authenticated_user_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import maybe_transform, async_maybe_transform +from .dotfiles import ( + DotfilesResource, + AsyncDotfilesResource, + DotfilesResourceWithRawResponse, + AsyncDotfilesResourceWithRawResponse, + DotfilesResourceWithStreamingResponse, + AsyncDotfilesResourceWithStreamingResponse, +) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -30,6 +38,10 @@ class UsersResource(SyncAPIResource): + @cached_property + def dotfiles(self) -> DotfilesResource: + return DotfilesResource(self._client) + @cached_property def pats(self) -> PatsResource: return PatsResource(self._client) @@ -169,6 +181,10 @@ def set_suspended( class AsyncUsersResource(AsyncAPIResource): + @cached_property + def dotfiles(self) -> AsyncDotfilesResource: + return AsyncDotfilesResource(self._client) + @cached_property def pats(self) -> AsyncPatsResource: return AsyncPatsResource(self._client) @@ -320,6 +336,10 @@ def __init__(self, users: UsersResource) -> None: users.set_suspended, ) + @cached_property + def dotfiles(self) -> DotfilesResourceWithRawResponse: + return DotfilesResourceWithRawResponse(self._users.dotfiles) + @cached_property def pats(self) -> PatsResourceWithRawResponse: return PatsResourceWithRawResponse(self._users.pats) @@ -336,6 +356,10 @@ def __init__(self, users: AsyncUsersResource) -> None: users.set_suspended, ) + @cached_property + def dotfiles(self) -> AsyncDotfilesResourceWithRawResponse: + return AsyncDotfilesResourceWithRawResponse(self._users.dotfiles) + @cached_property def pats(self) -> AsyncPatsResourceWithRawResponse: return AsyncPatsResourceWithRawResponse(self._users.pats) @@ -352,6 +376,10 @@ def __init__(self, users: UsersResource) -> None: users.set_suspended, ) + @cached_property + def dotfiles(self) -> DotfilesResourceWithStreamingResponse: + return DotfilesResourceWithStreamingResponse(self._users.dotfiles) + @cached_property def pats(self) -> PatsResourceWithStreamingResponse: return PatsResourceWithStreamingResponse(self._users.pats) @@ -368,6 +396,10 @@ def __init__(self, users: AsyncUsersResource) -> None: users.set_suspended, ) + @cached_property + def dotfiles(self) -> AsyncDotfilesResourceWithStreamingResponse: + return AsyncDotfilesResourceWithStreamingResponse(self._users.dotfiles) + @cached_property def pats(self) -> AsyncPatsResourceWithStreamingResponse: return AsyncPatsResourceWithStreamingResponse(self._users.pats) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 49ac2a0f..ddaf37e5 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -4,7 +4,6 @@ from .user import User as User from .group import Group as Group -from .scope import Scope as Scope from .editor import Editor as Editor from .runner import Runner as Runner from .secret import Secret as Secret @@ -29,11 +28,13 @@ ) from .account import Account as Account from .project import Project as Project +from .log_level import LogLevel as LogLevel from .environment import Environment as Environment from .runner_kind import RunnerKind as RunnerKind from .runner_spec import RunnerSpec as RunnerSpec from .organization import Organization as Organization from .runner_phase import RunnerPhase as RunnerPhase +from .secret_scope import SecretScope as SecretScope from .resource_type import ResourceType as ResourceType from .runner_status import RunnerStatus as RunnerStatus from .invite_domains import InviteDomains as InviteDomains @@ -41,10 +42,12 @@ from .admission_level import AdmissionLevel as AdmissionLevel from .runner_provider import RunnerProvider as RunnerProvider from .environment_spec import EnvironmentSpec as EnvironmentSpec +from .id_token_version import IDTokenVersion as IDTokenVersion from .project_metadata import ProjectMetadata as ProjectMetadata from .environment_phase import EnvironmentPhase as EnvironmentPhase from .event_list_params import EventListParams as EventListParams from .group_list_params import GroupListParams as GroupListParams +from .organization_tier import OrganizationTier as OrganizationTier from .runner_capability import RunnerCapability as RunnerCapability from .runner_spec_param import RunnerSpecParam as RunnerSpecParam from .account_membership import AccountMembership as AccountMembership @@ -54,6 +57,7 @@ from .resource_operation import ResourceOperation as ResourceOperation from .runner_list_params import RunnerListParams as RunnerListParams from .secret_list_params import SecretListParams as SecretListParams +from .secret_scope_param import SecretScopeParam as SecretScopeParam from .event_list_response import EventListResponse as EventListResponse from .organization_member import OrganizationMember as OrganizationMember from .project_list_params import ProjectListParams as ProjectListParams @@ -68,6 +72,7 @@ from .secret_delete_params import SecretDeleteParams as SecretDeleteParams from .account_delete_params import AccountDeleteParams as AccountDeleteParams from .joinable_organization import JoinableOrganization as JoinableOrganization +from .metrics_configuration import MetricsConfiguration as MetricsConfiguration from .project_create_params import ProjectCreateParams as ProjectCreateParams from .project_delete_params import ProjectDeleteParams as ProjectDeleteParams from .project_update_params import ProjectUpdateParams as ProjectUpdateParams @@ -88,7 +93,6 @@ from .editor_retrieve_response import EditorRetrieveResponse as EditorRetrieveResponse from .environment_start_params import EnvironmentStartParams as EnvironmentStartParams from .organization_join_params import OrganizationJoinParams as OrganizationJoinParams -from .organization_list_params import OrganizationListParams as OrganizationListParams from .runner_retrieve_response import RunnerRetrieveResponse as RunnerRetrieveResponse from .account_retrieve_response import AccountRetrieveResponse as AccountRetrieveResponse from .editor_resolve_url_params import EditorResolveURLParams as EditorResolveURLParams @@ -110,6 +114,7 @@ from .environment_activity_signal import EnvironmentActivitySignal as EnvironmentActivitySignal from .environment_create_response import EnvironmentCreateResponse as EnvironmentCreateResponse from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams +from .metrics_configuration_param import MetricsConfigurationParam as MetricsConfigurationParam from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams from .organization_create_response import OrganizationCreateResponse as OrganizationCreateResponse from .organization_retrieve_params import OrganizationRetrieveParams as OrganizationRetrieveParams @@ -153,12 +158,18 @@ from .identity_get_authenticated_identity_params import ( IdentityGetAuthenticatedIdentityParams as IdentityGetAuthenticatedIdentityParams, ) +from .environment_create_environment_token_params import ( + EnvironmentCreateEnvironmentTokenParams as EnvironmentCreateEnvironmentTokenParams, +) from .runner_check_authentication_for_host_params import ( RunnerCheckAuthenticationForHostParams as RunnerCheckAuthenticationForHostParams, ) from .identity_get_authenticated_identity_response import ( IdentityGetAuthenticatedIdentityResponse as IdentityGetAuthenticatedIdentityResponse, ) +from .environment_create_environment_token_response import ( + EnvironmentCreateEnvironmentTokenResponse as EnvironmentCreateEnvironmentTokenResponse, +) from .runner_check_authentication_for_host_response import ( RunnerCheckAuthenticationForHostResponse as RunnerCheckAuthenticationForHostResponse, ) diff --git a/src/gitpod/types/editor_list_params.py b/src/gitpod/types/editor_list_params.py index 13184679..42f94266 100644 --- a/src/gitpod/types/editor_list_params.py +++ b/src/gitpod/types/editor_list_params.py @@ -6,7 +6,7 @@ from .._utils import PropertyInfo -__all__ = ["EditorListParams", "Pagination"] +__all__ = ["EditorListParams", "Filter", "Pagination"] class EditorListParams(TypedDict, total=False): @@ -14,10 +14,21 @@ class EditorListParams(TypedDict, total=False): page_size: Annotated[int, PropertyInfo(alias="pageSize")] + filter: Filter + """filter contains the filter options for listing editors""" + pagination: Pagination """pagination contains the pagination options for listing environments""" +class Filter(TypedDict, total=False): + allowed_by_policy: Annotated[bool, PropertyInfo(alias="allowedByPolicy")] + """ + allowed_by_policy filters the response to only editors that are allowed by the + policies enforced in the organization + """ + + class Pagination(TypedDict, total=False): token: str """ diff --git a/src/gitpod/types/environment_create_environment_token_params.py b/src/gitpod/types/environment_create_environment_token_params.py new file mode 100644 index 00000000..cf7fdd1a --- /dev/null +++ b/src/gitpod/types/environment_create_environment_token_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentCreateEnvironmentTokenParams"] + + +class EnvironmentCreateEnvironmentTokenParams(TypedDict, total=False): + environment_id: Required[Annotated[str, PropertyInfo(alias="environmentId")]] + """ + environment_id specifies the environment for which the access token should be + created. + """ diff --git a/src/gitpod/types/environment_create_environment_token_response.py b/src/gitpod/types/environment_create_environment_token_response.py new file mode 100644 index 00000000..64b74d70 --- /dev/null +++ b/src/gitpod/types/environment_create_environment_token_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EnvironmentCreateEnvironmentTokenResponse"] + + +class EnvironmentCreateEnvironmentTokenResponse(BaseModel): + access_token: str = FieldInfo(alias="accessToken") + """access_token is the token that can be used for environment authentication""" diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index 0dd9d9d1..a6ccaa63 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -57,6 +57,12 @@ class DevcontainerDotfiles(BaseModel): class Devcontainer(BaseModel): + default_devcontainer_image: Optional[str] = FieldInfo(alias="defaultDevcontainerImage", default=None) + """ + default_devcontainer_image is the default image that is used to start the + devcontainer if no devcontainer config file is found + """ + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo @@ -92,6 +98,9 @@ class Port(BaseModel): class Secret(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the secret.""" + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) """ container_registry_basic_auth_host is the hostname of the container registry diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index d30a7932..6e846a5b 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -58,6 +58,12 @@ class DevcontainerDotfiles(TypedDict, total=False): class Devcontainer(TypedDict, total=False): + default_devcontainer_image: Annotated[str, PropertyInfo(alias="defaultDevcontainerImage")] + """ + default_devcontainer_image is the default image that is used to start the + devcontainer if no devcontainer config file is found + """ + devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] """ devcontainer_file_path is the path to the devcontainer file relative to the repo @@ -99,6 +105,9 @@ class Port(TypedDict, total=False): class Secret(TypedDict, total=False): + id: str + """id is the unique identifier of the secret.""" + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] """ container_registry_basic_auth_host is the hostname of the container registry diff --git a/src/gitpod/types/environment_status.py b/src/gitpod/types/environment_status.py index 3539b281..45955432 100644 --- a/src/gitpod/types/environment_status.py +++ b/src/gitpod/types/environment_status.py @@ -66,6 +66,12 @@ class AutomationsFile(BaseModel): environment. """ + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. + + when no triggers are defined in the automations file. + """ + class ContentGitChangedFile(BaseModel): change_type: Optional[ @@ -297,6 +303,9 @@ class RunnerAck(BaseModel): class Secret(BaseModel): + id: Optional[str] = None + """id is the unique identifier of the secret.""" + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message contains the reason the secret failed to be materialize.""" diff --git a/src/gitpod/types/environments/automations/service_status.py b/src/gitpod/types/environments/automations/service_status.py index cfda3ec2..b95049b2 100644 --- a/src/gitpod/types/environments/automations/service_status.py +++ b/src/gitpod/types/environments/automations/service_status.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, Optional from pydantic import Field as FieldInfo @@ -21,6 +21,12 @@ class ServiceStatus(BaseModel): log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) """log_url contains the URL at which the service logs can be accessed.""" + output: Optional[Dict[str, str]] = None + """ + output contains the output of the service. setting an output field to empty + string will unset it. + """ + phase: Optional[ServicePhase] = None """phase is the current phase of the service.""" diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index 80a22fbf..3fba2a06 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Iterable, Optional +from typing import Dict, Iterable, Optional from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo @@ -64,6 +64,9 @@ class Status(TypedDict, total=False): log_url: Annotated[Optional[str], PropertyInfo(alias="logUrl")] + output: Dict[str, str] + """setting an output field to empty string will unset it.""" + phase: Optional[ServicePhase] session: Optional[str] diff --git a/src/gitpod/types/id_token_version.py b/src/gitpod/types/id_token_version.py new file mode 100644 index 00000000..ecbfdba4 --- /dev/null +++ b/src/gitpod/types/id_token_version.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["IDTokenVersion"] + +IDTokenVersion: TypeAlias = Literal["ID_TOKEN_VERSION_UNSPECIFIED", "ID_TOKEN_VERSION_V1", "ID_TOKEN_VERSION_V2"] diff --git a/src/gitpod/types/identity_get_id_token_params.py b/src/gitpod/types/identity_get_id_token_params.py index e1d4c821..c5686ae4 100644 --- a/src/gitpod/types/identity_get_id_token_params.py +++ b/src/gitpod/types/identity_get_id_token_params.py @@ -5,8 +5,13 @@ from typing import List from typing_extensions import TypedDict +from .id_token_version import IDTokenVersion + __all__ = ["IdentityGetIDTokenParams"] class IdentityGetIDTokenParams(TypedDict, total=False): audience: List[str] + + version: IDTokenVersion + """version is the version of the ID token.""" diff --git a/src/gitpod/types/log_level.py b/src/gitpod/types/log_level.py new file mode 100644 index 00000000..7f2abd16 --- /dev/null +++ b/src/gitpod/types/log_level.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["LogLevel"] + +LogLevel: TypeAlias = Literal[ + "LOG_LEVEL_UNSPECIFIED", "LOG_LEVEL_DEBUG", "LOG_LEVEL_INFO", "LOG_LEVEL_WARN", "LOG_LEVEL_ERROR" +] diff --git a/src/gitpod/types/metrics_configuration.py b/src/gitpod/types/metrics_configuration.py new file mode 100644 index 00000000..0f6a0758 --- /dev/null +++ b/src/gitpod/types/metrics_configuration.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["MetricsConfiguration"] + + +class MetricsConfiguration(BaseModel): + enabled: Optional[bool] = None + """enabled indicates whether the runner should collect metrics""" + + password: Optional[str] = None + """password is the password to use for the metrics collector""" + + url: Optional[str] = None + """url is the URL of the metrics collector""" + + username: Optional[str] = None + """username is the username to use for the metrics collector""" diff --git a/src/gitpod/types/metrics_configuration_param.py b/src/gitpod/types/metrics_configuration_param.py new file mode 100644 index 00000000..252253e2 --- /dev/null +++ b/src/gitpod/types/metrics_configuration_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["MetricsConfigurationParam"] + + +class MetricsConfigurationParam(TypedDict, total=False): + enabled: bool + """enabled indicates whether the runner should collect metrics""" + + password: str + """password is the password to use for the metrics collector""" + + url: str + """url is the URL of the metrics collector""" + + username: str + """username is the username to use for the metrics collector""" diff --git a/src/gitpod/types/organization.py b/src/gitpod/types/organization.py index 4d5eaeef..9ecda14c 100644 --- a/src/gitpod/types/organization.py +++ b/src/gitpod/types/organization.py @@ -7,6 +7,7 @@ from .._models import BaseModel from .invite_domains import InviteDomains +from .organization_tier import OrganizationTier __all__ = ["Organization"] @@ -108,6 +109,9 @@ class Organization(BaseModel): name: str + tier: OrganizationTier + """The tier of the organization - free or enterprise""" + updated_at: datetime = FieldInfo(alias="updatedAt") """ A Timestamp represents a point in time independent of any time zone or local diff --git a/src/gitpod/types/organization_list_params.py b/src/gitpod/types/organization_list_params.py deleted file mode 100644 index edecdc21..00000000 --- a/src/gitpod/types/organization_list_params.py +++ /dev/null @@ -1,36 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Annotated, TypedDict - -from .scope import Scope -from .._utils import PropertyInfo - -__all__ = ["OrganizationListParams", "Pagination"] - - -class OrganizationListParams(TypedDict, total=False): - token: str - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - - pagination: Pagination - """pagination contains the pagination options for listing organizations""" - - scope: Scope - """scope is the scope of the organizations to list""" - - -class Pagination(TypedDict, total=False): - token: str - """ - Token for the next set of results that was returned as next_token of a - PaginationResponse - """ - - page_size: Annotated[int, PropertyInfo(alias="pageSize")] - """Page size is the maximum number of results to retrieve per page. Defaults to 25. - - Maximum 100. - """ diff --git a/src/gitpod/types/organization_tier.py b/src/gitpod/types/organization_tier.py new file mode 100644 index 00000000..ea000b24 --- /dev/null +++ b/src/gitpod/types/organization_tier.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["OrganizationTier"] + +OrganizationTier: TypeAlias = Literal[ + "ORGANIZATION_TIER_UNSPECIFIED", "ORGANIZATION_TIER_FREE", "ORGANIZATION_TIER_ENTERPRISE" +] diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index 83301d79..edd5451d 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -7,10 +7,14 @@ from .domain_verification import DomainVerification as DomainVerification from .organization_invite import OrganizationInvite as OrganizationInvite from .invite_create_params import InviteCreateParams as InviteCreateParams +from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams +from .organization_policies import OrganizationPolicies as OrganizationPolicies from .invite_create_response import InviteCreateResponse as InviteCreateResponse from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams +from .policy_retrieve_params import PolicyRetrieveParams as PolicyRetrieveParams from .sso_configuration_state import SSOConfigurationState as SSOConfigurationState from .invite_retrieve_response import InviteRetrieveResponse as InviteRetrieveResponse +from .policy_retrieve_response import PolicyRetrieveResponse as PolicyRetrieveResponse from .domain_verification_state import DomainVerificationState as DomainVerificationState from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams from .invite_get_summary_response import InviteGetSummaryResponse as InviteGetSummaryResponse diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py new file mode 100644 index 00000000..1fdc5682 --- /dev/null +++ b/src/gitpod/types/organizations/organization_policies.py @@ -0,0 +1,66 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["OrganizationPolicies"] + + +class OrganizationPolicies(BaseModel): + allowed_editor_ids: List[str] = FieldInfo(alias="allowedEditorIds") + """ + allowed_editor_ids is the list of editor IDs that are allowed to be used in the + organization + """ + + allow_local_runners: bool = FieldInfo(alias="allowLocalRunners") + """ + allow_local_runners controls whether local runners are allowed to be used in the + organization + """ + + default_editor_id: str = FieldInfo(alias="defaultEditorId") + """ + default_editor_id is the default editor ID to be used when a user doesn't + specify one + """ + + default_environment_image: str = FieldInfo(alias="defaultEnvironmentImage") + """ + default_environment_image is the default container image when none is defined in + repo + """ + + maximum_environments_per_user: str = FieldInfo(alias="maximumEnvironmentsPerUser") + """ + maximum_environments_per_user limits total environments (running or stopped) per + user + """ + + maximum_running_environments_per_user: str = FieldInfo(alias="maximumRunningEnvironmentsPerUser") + """ + maximum_running_environments_per_user limits simultaneously running environments + per user + """ + + members_create_projects: bool = FieldInfo(alias="membersCreateProjects") + """members_create_projects controls whether members can create projects""" + + members_require_projects: bool = FieldInfo(alias="membersRequireProjects") + """ + members_require_projects controls whether environments can only be created from + projects by non-admin users + """ + + organization_id: str = FieldInfo(alias="organizationId") + """organization_id is the ID of the organization""" + + maximum_environment_timeout: Optional[str] = FieldInfo(alias="maximumEnvironmentTimeout", default=None) + """ + maximum_environment_timeout controls the maximum timeout allowed for + environments in seconds. 0 means no limit (never). Minimum duration is 30 + minutes. + """ diff --git a/src/gitpod/types/organizations/policy_retrieve_params.py b/src/gitpod/types/organizations/policy_retrieve_params.py new file mode 100644 index 00000000..8c54248c --- /dev/null +++ b/src/gitpod/types/organizations/policy_retrieve_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PolicyRetrieveParams"] + + +class PolicyRetrieveParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to retrieve policies for""" diff --git a/src/gitpod/types/organizations/policy_retrieve_response.py b/src/gitpod/types/organizations/policy_retrieve_response.py new file mode 100644 index 00000000..c54a1e74 --- /dev/null +++ b/src/gitpod/types/organizations/policy_retrieve_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel +from .organization_policies import OrganizationPolicies + +__all__ = ["PolicyRetrieveResponse"] + + +class PolicyRetrieveResponse(BaseModel): + policies: OrganizationPolicies diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py new file mode 100644 index 00000000..b8ea2aa2 --- /dev/null +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -0,0 +1,69 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PolicyUpdateParams"] + + +class PolicyUpdateParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to update policies for""" + + allowed_editor_ids: Annotated[List[str], PropertyInfo(alias="allowedEditorIds")] + """ + allowed_editor_ids is the list of editor IDs that are allowed to be used in the + organization + """ + + allow_local_runners: Annotated[Optional[bool], PropertyInfo(alias="allowLocalRunners")] + """ + allow_local_runners controls whether local runners are allowed to be used in the + organization + """ + + default_editor_id: Annotated[Optional[str], PropertyInfo(alias="defaultEditorId")] + """ + default_editor_id is the default editor ID to be used when a user doesn't + specify one + """ + + default_environment_image: Annotated[Optional[str], PropertyInfo(alias="defaultEnvironmentImage")] + """ + default_environment_image is the default container image when none is defined in + repo + """ + + maximum_environments_per_user: Annotated[Optional[str], PropertyInfo(alias="maximumEnvironmentsPerUser")] + """ + maximum_environments_per_user limits total environments (running or stopped) per + user + """ + + maximum_environment_timeout: Annotated[Optional[str], PropertyInfo(alias="maximumEnvironmentTimeout")] + """ + maximum_environment_timeout controls the maximum timeout allowed for + environments in seconds. 0 means no limit (never). Minimum duration is 30 + minutes. + """ + + maximum_running_environments_per_user: Annotated[ + Optional[str], PropertyInfo(alias="maximumRunningEnvironmentsPerUser") + ] + """ + maximum_running_environments_per_user limits simultaneously running environments + per user + """ + + members_create_projects: Annotated[Optional[bool], PropertyInfo(alias="membersCreateProjects")] + """members_create_projects controls whether members can create projects""" + + members_require_projects: Annotated[Optional[bool], PropertyInfo(alias="membersRequireProjects")] + """ + members_require_projects controls whether environments can only be created from + projects by non-admin users + """ diff --git a/src/gitpod/types/project.py b/src/gitpod/types/project.py index 72037bc1..80e2586f 100644 --- a/src/gitpod/types/project.py +++ b/src/gitpod/types/project.py @@ -47,4 +47,10 @@ class Project(BaseModel): metadata: Optional[ProjectMetadata] = None + technical_description: Optional[str] = FieldInfo(alias="technicalDescription", default=None) + """ + technical_description is a detailed technical description of the project This + field is not returned by default in GetProject or ListProjects responses + """ + used_by: Optional[UsedBy] = FieldInfo(alias="usedBy", default=None) diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index db0326d9..ff3b8b27 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -38,3 +38,9 @@ class ProjectCreateParams(TypedDict, total=False): """ name: str + + technical_description: Annotated[str, PropertyInfo(alias="technicalDescription")] + """ + technical_description is a detailed technical description of the project This + field is not returned by default in GetProject or ListProjects responses 8KB max + """ diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py index 3d2202de..4709a7ba 100644 --- a/src/gitpod/types/project_list_params.py +++ b/src/gitpod/types/project_list_params.py @@ -2,11 +2,12 @@ from __future__ import annotations +from typing import List from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["ProjectListParams", "Pagination"] +__all__ = ["ProjectListParams", "Filter", "Pagination"] class ProjectListParams(TypedDict, total=False): @@ -14,10 +15,17 @@ class ProjectListParams(TypedDict, total=False): page_size: Annotated[int, PropertyInfo(alias="pageSize")] + filter: Filter + pagination: Pagination """pagination contains the pagination options for listing organizations""" +class Filter(TypedDict, total=False): + project_ids: Annotated[List[str], PropertyInfo(alias="projectIds")] + """project_ids filters the response to only projects with these IDs""" + + class Pagination(TypedDict, total=False): token: str """ diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py index 04dbed99..214d3fa8 100644 --- a/src/gitpod/types/project_update_params.py +++ b/src/gitpod/types/project_update_params.py @@ -42,3 +42,9 @@ class ProjectUpdateParams(TypedDict, total=False): project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" + + technical_description: Annotated[Optional[str], PropertyInfo(alias="technicalDescription")] + """ + technical_description is a detailed technical description of the project This + field is not returned by default in GetProject or ListProjects responses 8KB max + """ diff --git a/src/gitpod/types/resource_type.py b/src/gitpod/types/resource_type.py index ed64eeeb..c273d47a 100644 --- a/src/gitpod/types/resource_type.py +++ b/src/gitpod/types/resource_type.py @@ -24,4 +24,10 @@ "RESOURCE_TYPE_SECRET", "RESOURCE_TYPE_SSO_CONFIG", "RESOURCE_TYPE_DOMAIN_VERIFICATION", + "RESOURCE_TYPE_AGENT_EXECUTION", + "RESOURCE_TYPE_RUNNER_LLM_INTEGRATION", + "RESOURCE_TYPE_AGENT", + "RESOURCE_TYPE_ENVIRONMENT_SESSION", + "RESOURCE_TYPE_USER_SECRET", + "RESOURCE_TYPE_ORGANIZATION_POLICY", ] diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py index 261e0339..0a668725 100644 --- a/src/gitpod/types/runner_capability.py +++ b/src/gitpod/types/runner_capability.py @@ -8,4 +8,7 @@ "RUNNER_CAPABILITY_UNSPECIFIED", "RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS", "RUNNER_CAPABILITY_SECRET_CONTAINER_REGISTRY", + "RUNNER_CAPABILITY_AGENT_EXECUTION", + "RUNNER_CAPABILITY_ALLOW_ENV_TOKEN_POPULATION", + "RUNNER_CAPABILITY_DEFAULT_DEV_CONTAINER_IMAGE", ] diff --git a/src/gitpod/types/runner_configuration.py b/src/gitpod/types/runner_configuration.py index ebb33363..be9ab44f 100644 --- a/src/gitpod/types/runner_configuration.py +++ b/src/gitpod/types/runner_configuration.py @@ -5,6 +5,8 @@ from pydantic import Field as FieldInfo from .._models import BaseModel +from .log_level import LogLevel +from .metrics_configuration import MetricsConfiguration from .runner_release_channel import RunnerReleaseChannel __all__ = ["RunnerConfiguration"] @@ -14,6 +16,12 @@ class RunnerConfiguration(BaseModel): auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) """auto_update indicates whether the runner should automatically update itself.""" + log_level: Optional[LogLevel] = FieldInfo(alias="logLevel", default=None) + """log_level is the log level for the runner""" + + metrics: Optional[MetricsConfiguration] = None + """metrics contains configuration for the runner's metrics collection""" + region: Optional[str] = None """ Region to deploy the runner in, if applicable. This is mainly used for remote diff --git a/src/gitpod/types/runner_configuration_param.py b/src/gitpod/types/runner_configuration_param.py index 3f3b95b7..b2adc5a5 100644 --- a/src/gitpod/types/runner_configuration_param.py +++ b/src/gitpod/types/runner_configuration_param.py @@ -5,7 +5,9 @@ from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .log_level import LogLevel from .runner_release_channel import RunnerReleaseChannel +from .metrics_configuration_param import MetricsConfigurationParam __all__ = ["RunnerConfigurationParam"] @@ -14,6 +16,12 @@ class RunnerConfigurationParam(TypedDict, total=False): auto_update: Annotated[bool, PropertyInfo(alias="autoUpdate")] """auto_update indicates whether the runner should automatically update itself.""" + log_level: Annotated[LogLevel, PropertyInfo(alias="logLevel")] + """log_level is the log level for the runner""" + + metrics: MetricsConfigurationParam + """metrics contains configuration for the runner's metrics collection""" + region: str """ Region to deploy the runner in, if applicable. This is mainly used for remote diff --git a/src/gitpod/types/runner_parse_context_url_response.py b/src/gitpod/types/runner_parse_context_url_response.py index f51e857a..e34f770b 100644 --- a/src/gitpod/types/runner_parse_context_url_response.py +++ b/src/gitpod/types/runner_parse_context_url_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from pydantic import Field as FieldInfo @@ -29,3 +29,6 @@ class RunnerParseContextURLResponse(BaseModel): git: Optional[Git] = None original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + + project_ids: Optional[List[str]] = FieldInfo(alias="projectIds", default=None) + """project_ids is a list of projects to which the context URL belongs to.""" diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index 677a245c..8e36e4d9 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -6,10 +6,11 @@ from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .log_level import LogLevel from .runner_phase import RunnerPhase from .runner_release_channel import RunnerReleaseChannel -__all__ = ["RunnerUpdateParams", "Spec", "SpecConfiguration"] +__all__ = ["RunnerUpdateParams", "Spec", "SpecConfiguration", "SpecConfigurationMetrics"] class RunnerUpdateParams(TypedDict, total=False): @@ -25,10 +26,30 @@ class RunnerUpdateParams(TypedDict, total=False): spec: Optional[Spec] +class SpecConfigurationMetrics(TypedDict, total=False): + enabled: Optional[bool] + """enabled indicates whether the runner should collect metrics""" + + password: Optional[str] + """password is the password to use for the metrics collector""" + + url: Optional[str] + """url is the URL of the metrics collector""" + + username: Optional[str] + """username is the username to use for the metrics collector""" + + class SpecConfiguration(TypedDict, total=False): auto_update: Annotated[Optional[bool], PropertyInfo(alias="autoUpdate")] """auto_update indicates whether the runner should automatically update itself.""" + log_level: Annotated[Optional[LogLevel], PropertyInfo(alias="logLevel")] + """log_level is the log level for the runner""" + + metrics: Optional[SpecConfigurationMetrics] + """metrics contains configuration for the runner's metrics collection""" + release_channel: Annotated[Optional[RunnerReleaseChannel], PropertyInfo(alias="releaseChannel")] """The release channel the runner is on""" diff --git a/src/gitpod/types/runners/configurations/runner_configuration_schema.py b/src/gitpod/types/runners/configurations/runner_configuration_schema.py index fff9b91a..caeccd7e 100644 --- a/src/gitpod/types/runners/configurations/runner_configuration_schema.py +++ b/src/gitpod/types/runners/configurations/runner_configuration_schema.py @@ -13,12 +13,16 @@ "EnvironmentClassBool", "EnvironmentClassDisplay", "EnvironmentClassEnum", + "EnvironmentClassEnumDefaultValue", + "EnvironmentClassEnumPossibleValue", "EnvironmentClassInt", "EnvironmentClassString", "RunnerConfig", "RunnerConfigBool", "RunnerConfigDisplay", "RunnerConfigEnum", + "RunnerConfigEnumDefaultValue", + "RunnerConfigEnumPossibleValue", "RunnerConfigInt", "RunnerConfigString", "Scm", @@ -35,10 +39,32 @@ class EnvironmentClassDisplay(BaseModel): default: Optional[str] = None +class EnvironmentClassEnumDefaultValue(BaseModel): + detail: Optional[str] = None + + subtitle: Optional[str] = None + + title: Optional[str] = None + + +class EnvironmentClassEnumPossibleValue(BaseModel): + detail: Optional[str] = None + + subtitle: Optional[str] = None + + title: Optional[str] = None + + class EnvironmentClassEnum(BaseModel): default: Optional[str] = None + """deprecated, will be removed, use default_value instead""" + + default_value: Optional[EnvironmentClassEnumDefaultValue] = FieldInfo(alias="defaultValue", default=None) + + possible_values: Optional[List[EnvironmentClassEnumPossibleValue]] = FieldInfo(alias="possibleValues", default=None) values: Optional[List[str]] = None + """deprecated, will be removed, use possible_values instead""" class EnvironmentClassInt(BaseModel): @@ -85,10 +111,32 @@ class RunnerConfigDisplay(BaseModel): default: Optional[str] = None +class RunnerConfigEnumDefaultValue(BaseModel): + detail: Optional[str] = None + + subtitle: Optional[str] = None + + title: Optional[str] = None + + +class RunnerConfigEnumPossibleValue(BaseModel): + detail: Optional[str] = None + + subtitle: Optional[str] = None + + title: Optional[str] = None + + class RunnerConfigEnum(BaseModel): default: Optional[str] = None + """deprecated, will be removed, use default_value instead""" + + default_value: Optional[RunnerConfigEnumDefaultValue] = FieldInfo(alias="defaultValue", default=None) + + possible_values: Optional[List[RunnerConfigEnumPossibleValue]] = FieldInfo(alias="possibleValues", default=None) values: Optional[List[str]] = None + """deprecated, will be removed, use possible_values instead""" class RunnerConfigInt(BaseModel): diff --git a/src/gitpod/types/scope.py b/src/gitpod/types/scope.py deleted file mode 100644 index 0f1bd71b..00000000 --- a/src/gitpod/types/scope.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["Scope"] - -Scope: TypeAlias = Literal["SCOPE_UNSPECIFIED", "SCOPE_MEMBER", "SCOPE_ALL"] diff --git a/src/gitpod/types/secret.py b/src/gitpod/types/secret.py index e994fa73..f7bdd151 100644 --- a/src/gitpod/types/secret.py +++ b/src/gitpod/types/secret.py @@ -6,6 +6,7 @@ from pydantic import Field as FieldInfo from .._models import BaseModel +from .secret_scope import SecretScope from .shared.subject import Subject __all__ = ["Secret"] @@ -125,7 +126,9 @@ class Secret(BaseModel): """Name of the secret for humans.""" project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """The Project ID this Secret belongs to""" + """The Project ID this Secret belongs to Deprecated: use scope instead""" + + scope: Optional[SecretScope] = None updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) """ diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index aa01b609..61487b0c 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -5,6 +5,7 @@ from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .secret_scope_param import SecretScopeParam __all__ = ["SecretCreateParams"] @@ -13,12 +14,7 @@ class SecretCreateParams(TypedDict, total=False): container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] """ secret will be mounted as a docker config in the environment VM, mount will have - the docker registry host value must be a valid registry host (e.g. - registry.docker.com, https://registry.docker.com, ghcr.io:5050): - - ``` - this.matches('^[a-zA-Z0-9.-/:]+(:[0-9]+)?$') - ``` + the docker registry host """ environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] @@ -40,7 +36,12 @@ class SecretCreateParams(TypedDict, total=False): name: str project_id: Annotated[str, PropertyInfo(alias="projectId")] - """project_id is the ProjectID this Secret belongs to""" + """ + project_id is the ProjectID this Secret belongs to Deprecated: use scope instead + """ + + scope: SecretScopeParam + """scope is the scope of the secret""" value: str """value is the plaintext value of the secret""" diff --git a/src/gitpod/types/secret_list_params.py b/src/gitpod/types/secret_list_params.py index a0d7593d..44ab4bd5 100644 --- a/src/gitpod/types/secret_list_params.py +++ b/src/gitpod/types/secret_list_params.py @@ -6,6 +6,7 @@ from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .secret_scope_param import SecretScopeParam __all__ = ["SecretListParams", "Filter", "Pagination"] @@ -23,7 +24,13 @@ class SecretListParams(TypedDict, total=False): class Filter(TypedDict, total=False): project_ids: Annotated[List[str], PropertyInfo(alias="projectIds")] - """project_ids filters the response to only Secrets used by these Project IDs""" + """ + project_ids filters the response to only Secrets used by these Project IDs + Deprecated: use scope instead. Values in project_ids will be ignored. + """ + + scope: SecretScopeParam + """scope is the scope of the secrets to list""" class Pagination(TypedDict, total=False): diff --git a/src/gitpod/types/secret_scope.py b/src/gitpod/types/secret_scope.py new file mode 100644 index 00000000..0c5bc664 --- /dev/null +++ b/src/gitpod/types/secret_scope.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["SecretScope"] + + +class SecretScope(BaseModel): + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """project_id is the Project ID this Secret belongs to""" + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + """user_id is the User ID this Secret belongs to""" diff --git a/src/gitpod/types/secret_scope_param.py b/src/gitpod/types/secret_scope_param.py new file mode 100644 index 00000000..85ee9a40 --- /dev/null +++ b/src/gitpod/types/secret_scope_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["SecretScopeParam"] + + +class SecretScopeParam(TypedDict, total=False): + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id is the Project ID this Secret belongs to""" + + user_id: Annotated[str, PropertyInfo(alias="userId")] + """user_id is the User ID this Secret belongs to""" diff --git a/src/gitpod/types/shared/task_execution_status.py b/src/gitpod/types/shared/task_execution_status.py index b5ab03a0..2a4765ae 100644 --- a/src/gitpod/types/shared/task_execution_status.py +++ b/src/gitpod/types/shared/task_execution_status.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from pydantic import Field as FieldInfo @@ -21,6 +21,12 @@ class Step(BaseModel): to a failed state. """ + output: Optional[Dict[str, str]] = None + """ + output contains the output of the task execution. setting an output field to + empty string will unset it. + """ + phase: Optional[TaskExecutionPhase] = None """phase is the current phase of the execution step""" diff --git a/src/gitpod/types/users/__init__.py b/src/gitpod/types/users/__init__.py index b54651e0..8145891f 100644 --- a/src/gitpod/types/users/__init__.py +++ b/src/gitpod/types/users/__init__.py @@ -6,4 +6,8 @@ from .pat_list_params import PatListParams as PatListParams from .pat_get_response import PatGetResponse as PatGetResponse from .pat_delete_params import PatDeleteParams as PatDeleteParams +from .dotfile_get_params import DotfileGetParams as DotfileGetParams +from .dotfile_set_params import DotfileSetParams as DotfileSetParams +from .dotfile_get_response import DotfileGetResponse as DotfileGetResponse from .personal_access_token import PersonalAccessToken as PersonalAccessToken +from .dotfiles_configuration import DotfilesConfiguration as DotfilesConfiguration diff --git a/src/gitpod/types/users/dotfile_get_params.py b/src/gitpod/types/users/dotfile_get_params.py new file mode 100644 index 00000000..f9272c3a --- /dev/null +++ b/src/gitpod/types/users/dotfile_get_params.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DotfileGetParams"] + + +class DotfileGetParams(TypedDict, total=False): + empty: bool diff --git a/src/gitpod/types/users/dotfile_get_response.py b/src/gitpod/types/users/dotfile_get_response.py new file mode 100644 index 00000000..4cb5e021 --- /dev/null +++ b/src/gitpod/types/users/dotfile_get_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .dotfiles_configuration import DotfilesConfiguration + +__all__ = ["DotfileGetResponse"] + + +class DotfileGetResponse(BaseModel): + dotfiles_configuration: DotfilesConfiguration = FieldInfo(alias="dotfilesConfiguration") diff --git a/src/gitpod/types/users/dotfile_set_params.py b/src/gitpod/types/users/dotfile_set_params.py new file mode 100644 index 00000000..21d63bdb --- /dev/null +++ b/src/gitpod/types/users/dotfile_set_params.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DotfileSetParams"] + + +class DotfileSetParams(TypedDict, total=False): + repository: str diff --git a/src/gitpod/types/users/dotfiles_configuration.py b/src/gitpod/types/users/dotfiles_configuration.py new file mode 100644 index 00000000..c5595be0 --- /dev/null +++ b/src/gitpod/types/users/dotfiles_configuration.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["DotfilesConfiguration"] + + +class DotfilesConfiguration(BaseModel): + repository: Optional[str] = None + """The URL of a dotfiles repository.""" diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index ea60aba0..c64d5770 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -168,6 +168,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: status={ "failure_message": "failureMessage", "log_url": "logUrl", + "output": {"foo": "string"}, "phase": "SERVICE_PHASE_UNSPECIFIED", "session": "session", }, @@ -500,6 +501,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> status={ "failure_message": "failureMessage", "log_url": "logUrl", + "output": {"foo": "string"}, "phase": "SERVICE_PHASE_UNSPECIFIED", "session": "session", }, diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py new file mode 100644 index 00000000..7ae176cd --- /dev/null +++ b/tests/api_resources/organizations/test_policies.py @@ -0,0 +1,192 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.organizations import PolicyRetrieveResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPolicies: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + policy = client.organizations.policies.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.policies.with_raw_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.policies.with_streaming_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_update(self, client: Gitpod) -> None: + policy = client.organizations.policies.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + policy = client.organizations.policies.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + allowed_editor_ids=["string"], + allow_local_runners=True, + default_editor_id="defaultEditorId", + default_environment_image="defaultEnvironmentImage", + maximum_environments_per_user="20", + maximum_environment_timeout="3600s", + maximum_running_environments_per_user="5", + members_create_projects=True, + members_require_projects=True, + ) + assert_matches_type(object, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.organizations.policies.with_raw_response.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = response.parse() + assert_matches_type(object, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.organizations.policies.with_streaming_response.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = response.parse() + assert_matches_type(object, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncPolicies: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + policy = await async_client.organizations.policies.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.policies.with_raw_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.policies.with_streaming_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + policy = await async_client.organizations.policies.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + policy = await async_client.organizations.policies.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + allowed_editor_ids=["string"], + allow_local_runners=True, + default_editor_id="defaultEditorId", + default_environment_image="defaultEnvironmentImage", + maximum_environments_per_user="20", + maximum_environment_timeout="3600s", + maximum_running_environments_per_user="5", + members_create_projects=True, + members_require_projects=True, + ) + assert_matches_type(object, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.policies.with_raw_response.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + policy = await response.parse() + assert_matches_type(object, policy, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.policies.with_streaming_response.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + policy = await response.parse() + assert_matches_type(object, policy, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index ecf58196..4c77d22c 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -68,6 +68,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: editor = client.editors.list( token="token", page_size=0, + filter={"allowed_by_policy": True}, pagination={ "token": "token", "page_size": 20, @@ -187,6 +188,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N editor = await async_client.editors.list( token="token", page_size=0, + filter={"allowed_by_policy": True}, pagination={ "token": "token", "page_size": 20, diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 3784290a..fb06565b 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -15,6 +15,7 @@ EnvironmentRetrieveResponse, EnvironmentCreateLogsTokenResponse, EnvironmentCreateFromProjectResponse, + EnvironmentCreateEnvironmentTokenResponse, ) from gitpod._utils import parse_datetime from gitpod.pagination import SyncEnvironmentsPage, AsyncEnvironmentsPage @@ -62,6 +63,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { + "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, "session": "session", @@ -79,6 +81,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "secrets": [ { + "id": "id", "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -322,6 +325,40 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() + @parametrize + def test_method_create_environment_token(self, client: Gitpod) -> None: + environment = client.environments.create_environment_token( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_environment_token(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.create_environment_token( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_environment_token(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.create_environment_token( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: @@ -360,6 +397,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { + "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, "session": "session", @@ -377,6 +415,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "secrets": [ { + "id": "id", "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -610,6 +649,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { + "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, "session": "session", @@ -627,6 +667,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "secrets": [ { + "id": "id", "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -870,6 +911,40 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip() + @parametrize + async def test_method_create_environment_token(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.create_environment_token( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_environment_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.create_environment_token( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_environment_token(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.create_environment_token( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: @@ -908,6 +983,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As }, "desired_phase": "ENVIRONMENT_PHASE_UNSPECIFIED", "devcontainer": { + "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, "session": "session", @@ -925,6 +1001,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "secrets": [ { + "id": "id", "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index 46cfd41b..bcc639d1 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -104,6 +104,7 @@ def test_method_get_id_token(self, client: Gitpod) -> None: def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( audience=["https://api.gitpod.io", "https://ws.gitpod.io"], + version="ID_TOKEN_VERSION_UNSPECIFIED", ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) @@ -216,6 +217,7 @@ async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( audience=["https://api.gitpod.io", "https://ws.gitpod.io"], + version="ID_TOKEN_VERSION_UNSPECIFIED", ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 7d24c5c2..da165e0b 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -10,14 +10,13 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import ( - Organization, OrganizationMember, OrganizationJoinResponse, OrganizationCreateResponse, OrganizationUpdateResponse, OrganizationRetrieveResponse, ) -from gitpod.pagination import SyncMembersPage, AsyncMembersPage, SyncOrganizationsPage, AsyncOrganizationsPage +from gitpod.pagination import SyncMembersPage, AsyncMembersPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -147,48 +146,6 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Gitpod) -> None: - organization = client.organizations.list() - assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_list_with_all_params(self, client: Gitpod) -> None: - organization = client.organizations.list( - token="token", - page_size=0, - pagination={ - "token": "token", - "page_size": 50, - }, - scope="SCOPE_ALL", - ) - assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Gitpod) -> None: - response = client.organizations.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = response.parse() - assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Gitpod) -> None: - with client.organizations.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = response.parse() - assert_matches_type(SyncOrganizationsPage[Organization], organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Gitpod) -> None: @@ -515,48 +472,6 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() - @parametrize - async def test_method_list(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.list() - assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: - organization = await async_client.organizations.list( - token="token", - page_size=0, - pagination={ - "token": "token", - "page_size": 50, - }, - scope="SCOPE_ALL", - ) - assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: - response = await async_client.organizations.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = await response.parse() - assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: - async with async_client.organizations.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - organization = await response.parse() - assert_matches_type(AsyncOrganizationsPage[Organization], organization, path=["response"]) - - assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 3d47dbde..f33816b9 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -58,6 +58,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="Web Application", + technical_description="technicalDescription", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -157,6 +158,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: }, name="x", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + technical_description="technicalDescription", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -194,6 +196,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: project = client.projects.list( token="token", page_size=0, + filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 20, @@ -334,6 +337,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="Web Application", + technical_description="technicalDescription", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -433,6 +437,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> }, name="x", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + technical_description="technicalDescription", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -470,6 +475,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N project = await async_client.projects.list( token="token", page_size=0, + filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, pagination={ "token": "token", "page_size": 20, diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 45caf1c2..45c556dc 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -41,6 +41,13 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: spec={ "configuration": { "auto_update": True, + "log_level": "LOG_LEVEL_UNSPECIFIED", + "metrics": { + "enabled": True, + "password": "password", + "url": "url", + "username": "username", + }, "region": "us-west", "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, @@ -122,6 +129,13 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: spec={ "configuration": { "auto_update": True, + "log_level": "LOG_LEVEL_UNSPECIFIED", + "metrics": { + "enabled": True, + "password": "password", + "url": "url", + "username": "username", + }, "release_channel": "RUNNER_RELEASE_CHANNEL_LATEST", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", @@ -364,6 +378,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> spec={ "configuration": { "auto_update": True, + "log_level": "LOG_LEVEL_UNSPECIFIED", + "metrics": { + "enabled": True, + "password": "password", + "url": "url", + "username": "username", + }, "region": "us-west", "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, @@ -445,6 +466,13 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> spec={ "configuration": { "auto_update": True, + "log_level": "LOG_LEVEL_UNSPECIFIED", + "metrics": { + "enabled": True, + "password": "password", + "url": "url", + "username": "username", + }, "release_channel": "RUNNER_RELEASE_CHANNEL_LATEST", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 84caf8b4..e74682b0 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -37,6 +37,10 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: file_path="filePath", name="DATABASE_URL", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + scope={ + "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, value="postgresql://user:pass@localhost:5432/db", ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -75,10 +79,16 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.list( token="token", page_size=0, - filter={"project_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"]}, + filter={ + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "scope": { + "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, + }, pagination={ "token": "token", - "page_size": 20, + "page_size": 100, }, ) assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) @@ -233,6 +243,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> file_path="filePath", name="DATABASE_URL", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + scope={ + "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, value="postgresql://user:pass@localhost:5432/db", ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) @@ -271,10 +285,16 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N secret = await async_client.secrets.list( token="token", page_size=0, - filter={"project_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"]}, + filter={ + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "scope": { + "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, + }, pagination={ "token": "token", - "page_size": 20, + "page_size": 100, }, ) assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) diff --git a/tests/api_resources/users/test_dotfiles.py b/tests/api_resources/users/test_dotfiles.py new file mode 100644 index 00000000..ff40da72 --- /dev/null +++ b/tests/api_resources/users/test_dotfiles.py @@ -0,0 +1,166 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.users import DotfileGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDotfiles: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + def test_method_get(self, client: Gitpod) -> None: + dotfile = client.users.dotfiles.get() + assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_get_with_all_params(self, client: Gitpod) -> None: + dotfile = client.users.dotfiles.get( + empty=True, + ) + assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_get(self, client: Gitpod) -> None: + response = client.users.dotfiles.with_raw_response.get() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dotfile = response.parse() + assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_get(self, client: Gitpod) -> None: + with client.users.dotfiles.with_streaming_response.get() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dotfile = response.parse() + assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_set(self, client: Gitpod) -> None: + dotfile = client.users.dotfiles.set() + assert_matches_type(object, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_set_with_all_params(self, client: Gitpod) -> None: + dotfile = client.users.dotfiles.set( + repository="https://example.com", + ) + assert_matches_type(object, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_set(self, client: Gitpod) -> None: + response = client.users.dotfiles.with_raw_response.set() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dotfile = response.parse() + assert_matches_type(object, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_set(self, client: Gitpod) -> None: + with client.users.dotfiles.with_streaming_response.set() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dotfile = response.parse() + assert_matches_type(object, dotfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncDotfiles: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncGitpod) -> None: + dotfile = await async_client.users.dotfiles.get() + assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: + dotfile = await async_client.users.dotfiles.get( + empty=True, + ) + assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.dotfiles.with_raw_response.get() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dotfile = await response.parse() + assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: + async with async_client.users.dotfiles.with_streaming_response.get() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dotfile = await response.parse() + assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_set(self, async_client: AsyncGitpod) -> None: + dotfile = await async_client.users.dotfiles.set() + assert_matches_type(object, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_set_with_all_params(self, async_client: AsyncGitpod) -> None: + dotfile = await async_client.users.dotfiles.set( + repository="https://example.com", + ) + assert_matches_type(object, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_set(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.dotfiles.with_raw_response.set() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dotfile = await response.parse() + assert_matches_type(object, dotfile, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_set(self, async_client: AsyncGitpod) -> None: + async with async_client.users.dotfiles.with_streaming_response.set() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dotfile = await response.parse() + assert_matches_type(object, dotfile, path=["response"]) + + assert cast(Any, response.is_closed) is True From fda28c075f96f147da98ddcbb2b3de29caca030c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 09:52:33 +0000 Subject: [PATCH 164/505] feat(api): manual updates --- .stats.yml | 4 +- api.md | 12 + src/gitpod/_client.py | 10 +- src/gitpod/pagination.py | 53 +++++ src/gitpod/resources/__init__.py | 14 ++ src/gitpod/resources/usage.py | 220 ++++++++++++++++++ src/gitpod/types/__init__.py | 4 + src/gitpod/types/environment_session.py | 36 +++ .../usage_list_environment_sessions_params.py | 53 +++++ tests/api_resources/test_usage.py | 120 ++++++++++ 10 files changed, 523 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/resources/usage.py create mode 100644 src/gitpod/types/environment_session.py create mode 100644 src/gitpod/types/usage_list_environment_sessions_params.py create mode 100644 tests/api_resources/test_usage.py diff --git a/.stats.yml b/.stats.yml index ef4c6308..5233e38d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 115 +configured_endpoints: 116 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d854bc81e0a99171716893e6790a87ba350bb6fc778f8e3244abdd47d5c252c3.yml openapi_spec_hash: 5189220e4712a7b0cdd35beba2ebb47d -config_hash: 981e43e8b1e3ddabd435d350aeeed417 +config_hash: 60929489bdc1eaf979e7ef74fdd17b94 diff --git a/api.md b/api.md index 2de3b619..dfb3cfec 100644 --- a/api.md +++ b/api.md @@ -569,6 +569,18 @@ Methods: - client.secrets.get_value(\*\*params) -> SecretGetValueResponse - client.secrets.update_value(\*\*params) -> object +# Usage + +Types: + +```python +from gitpod.types import EnvironmentSession +``` + +Methods: + +- client.usage.list_environment_sessions(\*\*params) -> SyncSessionsPage[EnvironmentSession] + # Users Types: diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 7026467f..e0035c32 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -21,7 +21,7 @@ ) from ._utils import is_given, get_async_library from ._version import __version__ -from .resources import events, groups, editors, secrets, accounts, identity +from .resources import usage, events, groups, editors, secrets, accounts, identity from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import GitpodError, APIStatusError from ._base_client import ( @@ -49,6 +49,7 @@ class Gitpod(SyncAPIClient): projects: projects.ProjectsResource runners: runners.RunnersResource secrets: secrets.SecretsResource + usage: usage.UsageResource users: users.UsersResource with_raw_response: GitpodWithRawResponse with_streaming_response: GitpodWithStreamedResponse @@ -117,6 +118,7 @@ def __init__( self.projects = projects.ProjectsResource(self) self.runners = runners.RunnersResource(self) self.secrets = secrets.SecretsResource(self) + self.usage = usage.UsageResource(self) self.users = users.UsersResource(self) self.with_raw_response = GitpodWithRawResponse(self) self.with_streaming_response = GitpodWithStreamedResponse(self) @@ -237,6 +239,7 @@ class AsyncGitpod(AsyncAPIClient): projects: projects.AsyncProjectsResource runners: runners.AsyncRunnersResource secrets: secrets.AsyncSecretsResource + usage: usage.AsyncUsageResource users: users.AsyncUsersResource with_raw_response: AsyncGitpodWithRawResponse with_streaming_response: AsyncGitpodWithStreamedResponse @@ -305,6 +308,7 @@ def __init__( self.projects = projects.AsyncProjectsResource(self) self.runners = runners.AsyncRunnersResource(self) self.secrets = secrets.AsyncSecretsResource(self) + self.usage = usage.AsyncUsageResource(self) self.users = users.AsyncUsersResource(self) self.with_raw_response = AsyncGitpodWithRawResponse(self) self.with_streaming_response = AsyncGitpodWithStreamedResponse(self) @@ -426,6 +430,7 @@ def __init__(self, client: Gitpod) -> None: self.projects = projects.ProjectsResourceWithRawResponse(client.projects) self.runners = runners.RunnersResourceWithRawResponse(client.runners) self.secrets = secrets.SecretsResourceWithRawResponse(client.secrets) + self.usage = usage.UsageResourceWithRawResponse(client.usage) self.users = users.UsersResourceWithRawResponse(client.users) @@ -441,6 +446,7 @@ def __init__(self, client: AsyncGitpod) -> None: self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) self.runners = runners.AsyncRunnersResourceWithRawResponse(client.runners) self.secrets = secrets.AsyncSecretsResourceWithRawResponse(client.secrets) + self.usage = usage.AsyncUsageResourceWithRawResponse(client.usage) self.users = users.AsyncUsersResourceWithRawResponse(client.users) @@ -456,6 +462,7 @@ def __init__(self, client: Gitpod) -> None: self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) self.runners = runners.RunnersResourceWithStreamingResponse(client.runners) self.secrets = secrets.SecretsResourceWithStreamingResponse(client.secrets) + self.usage = usage.UsageResourceWithStreamingResponse(client.usage) self.users = users.UsersResourceWithStreamingResponse(client.users) @@ -471,6 +478,7 @@ def __init__(self, client: AsyncGitpod) -> None: self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) self.runners = runners.AsyncRunnersResourceWithStreamingResponse(client.runners) self.secrets = secrets.AsyncSecretsResourceWithStreamingResponse(client.secrets) + self.usage = usage.AsyncUsageResourceWithStreamingResponse(client.usage) self.users = users.AsyncUsersResourceWithStreamingResponse(client.users) diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 578b1f79..1800f53a 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -54,6 +54,9 @@ "ServicesPagePagination", "SyncServicesPage", "AsyncServicesPage", + "SessionsPagePagination", + "SyncSessionsPage", + "AsyncSessionsPage", "SSOConfigurationsPagePagination", "SyncSSOConfigurationsPage", "AsyncSSOConfigurationsPage", @@ -821,6 +824,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class SessionsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncSessionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[SessionsPagePagination] = None + sessions: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + sessions = self.sessions + if not sessions: + return [] + return sessions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncSessionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[SessionsPagePagination] = None + sessions: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + sessions = self.sessions + if not sessions: + return [] + return sessions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class SSOConfigurationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index 1e169c21..773dc4d0 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .usage import ( + UsageResource, + AsyncUsageResource, + UsageResourceWithRawResponse, + AsyncUsageResourceWithRawResponse, + UsageResourceWithStreamingResponse, + AsyncUsageResourceWithStreamingResponse, +) from .users import ( UsersResource, AsyncUsersResource, @@ -150,6 +158,12 @@ "AsyncSecretsResourceWithRawResponse", "SecretsResourceWithStreamingResponse", "AsyncSecretsResourceWithStreamingResponse", + "UsageResource", + "AsyncUsageResource", + "UsageResourceWithRawResponse", + "AsyncUsageResourceWithRawResponse", + "UsageResourceWithStreamingResponse", + "AsyncUsageResourceWithStreamingResponse", "UsersResource", "AsyncUsersResource", "UsersResourceWithRawResponse", diff --git a/src/gitpod/resources/usage.py b/src/gitpod/resources/usage.py new file mode 100644 index 00000000..8d63dacb --- /dev/null +++ b/src/gitpod/resources/usage.py @@ -0,0 +1,220 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import usage_list_environment_sessions_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncSessionsPage, AsyncSessionsPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.environment_session import EnvironmentSession + +__all__ = ["UsageResource", "AsyncUsageResource"] + + +class UsageResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> UsageResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return UsageResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> UsageResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return UsageResourceWithStreamingResponse(self) + + def list_environment_sessions( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: usage_list_environment_sessions_params.Filter | NotGiven = NOT_GIVEN, + pagination: usage_list_environment_sessions_params.Pagination | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSessionsPage[EnvironmentSession]: + """ + Lists environment sessions within a specified date range. + + Returns a list of environment sessions that were active within the specified + date range. + + Args: + filter: Filter options. + + pagination: Pagination options. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.UsageService/ListEnvironmentSessions", + page=SyncSessionsPage[EnvironmentSession], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + usage_list_environment_sessions_params.UsageListEnvironmentSessionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + usage_list_environment_sessions_params.UsageListEnvironmentSessionsParams, + ), + ), + model=EnvironmentSession, + method="post", + ) + + +class AsyncUsageResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncUsageResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncUsageResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncUsageResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncUsageResourceWithStreamingResponse(self) + + def list_environment_sessions( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + filter: usage_list_environment_sessions_params.Filter | NotGiven = NOT_GIVEN, + pagination: usage_list_environment_sessions_params.Pagination | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[EnvironmentSession, AsyncSessionsPage[EnvironmentSession]]: + """ + Lists environment sessions within a specified date range. + + Returns a list of environment sessions that were active within the specified + date range. + + Args: + filter: Filter options. + + pagination: Pagination options. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.UsageService/ListEnvironmentSessions", + page=AsyncSessionsPage[EnvironmentSession], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + usage_list_environment_sessions_params.UsageListEnvironmentSessionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + usage_list_environment_sessions_params.UsageListEnvironmentSessionsParams, + ), + ), + model=EnvironmentSession, + method="post", + ) + + +class UsageResourceWithRawResponse: + def __init__(self, usage: UsageResource) -> None: + self._usage = usage + + self.list_environment_sessions = to_raw_response_wrapper( + usage.list_environment_sessions, + ) + + +class AsyncUsageResourceWithRawResponse: + def __init__(self, usage: AsyncUsageResource) -> None: + self._usage = usage + + self.list_environment_sessions = async_to_raw_response_wrapper( + usage.list_environment_sessions, + ) + + +class UsageResourceWithStreamingResponse: + def __init__(self, usage: UsageResource) -> None: + self._usage = usage + + self.list_environment_sessions = to_streamed_response_wrapper( + usage.list_environment_sessions, + ) + + +class AsyncUsageResourceWithStreamingResponse: + def __init__(self, usage: AsyncUsageResource) -> None: + self._usage = usage + + self.list_environment_sessions = async_to_streamed_response_wrapper( + usage.list_environment_sessions, + ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index ddaf37e5..9ef9703c 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -58,6 +58,7 @@ from .runner_list_params import RunnerListParams as RunnerListParams from .secret_list_params import SecretListParams as SecretListParams from .secret_scope_param import SecretScopeParam as SecretScopeParam +from .environment_session import EnvironmentSession as EnvironmentSession from .event_list_response import EventListResponse as EventListResponse from .organization_member import OrganizationMember as OrganizationMember from .project_list_params import ProjectListParams as ProjectListParams @@ -149,6 +150,9 @@ from .project_create_from_environment_params import ( ProjectCreateFromEnvironmentParams as ProjectCreateFromEnvironmentParams, ) +from .usage_list_environment_sessions_params import ( + UsageListEnvironmentSessionsParams as UsageListEnvironmentSessionsParams, +) from .environment_create_from_project_response import ( EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, ) diff --git a/src/gitpod/types/environment_session.py b/src/gitpod/types/environment_session.py new file mode 100644 index 00000000..733376f0 --- /dev/null +++ b/src/gitpod/types/environment_session.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["EnvironmentSession"] + + +class EnvironmentSession(BaseModel): + id: Optional[str] = None + """Environment session ID.""" + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """Time when the session was created.""" + + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """Environment class ID associated with the session.""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """Environment ID associated with the session.""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """Project ID associated with the session.""" + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """Runner ID associated with the session.""" + + stopped_at: Optional[datetime] = FieldInfo(alias="stoppedAt", default=None) + """Time when the session was stopped.""" + + user_id: Optional[str] = FieldInfo(alias="userId", default=None) + """User ID who created the session.""" diff --git a/src/gitpod/types/usage_list_environment_sessions_params.py b/src/gitpod/types/usage_list_environment_sessions_params.py new file mode 100644 index 00000000..8222547e --- /dev/null +++ b/src/gitpod/types/usage_list_environment_sessions_params.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["UsageListEnvironmentSessionsParams", "Filter", "FilterDateRange", "Pagination"] + + +class UsageListEnvironmentSessionsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + """Filter options.""" + + pagination: Pagination + """Pagination options.""" + + +class FilterDateRange(TypedDict, total=False): + end_time: Required[Annotated[Union[str, datetime], PropertyInfo(alias="endTime", format="iso8601")]] + """End time of the date range (exclusive).""" + + start_time: Required[Annotated[Union[str, datetime], PropertyInfo(alias="startTime", format="iso8601")]] + """Start time of the date range (inclusive).""" + + +class Filter(TypedDict, total=False): + date_range: Required[Annotated[FilterDateRange, PropertyInfo(alias="dateRange")]] + """Date range to query sessions within.""" + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """Optional project ID to filter sessions by.""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/tests/api_resources/test_usage.py b/tests/api_resources/test_usage.py new file mode 100644 index 00000000..a6c5b0d2 --- /dev/null +++ b/tests/api_resources/test_usage.py @@ -0,0 +1,120 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import EnvironmentSession +from gitpod._utils import parse_datetime +from gitpod.pagination import SyncSessionsPage, AsyncSessionsPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestUsage: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + def test_method_list_environment_sessions(self, client: Gitpod) -> None: + usage = client.usage.list_environment_sessions() + assert_matches_type(SyncSessionsPage[EnvironmentSession], usage, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_list_environment_sessions_with_all_params(self, client: Gitpod) -> None: + usage = client.usage.list_environment_sessions( + token="token", + page_size=0, + filter={ + "date_range": { + "end_time": parse_datetime("2019-12-27T18:11:19.117Z"), + "start_time": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + "project_id": "projectId", + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncSessionsPage[EnvironmentSession], usage, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_list_environment_sessions(self, client: Gitpod) -> None: + response = client.usage.with_raw_response.list_environment_sessions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + usage = response.parse() + assert_matches_type(SyncSessionsPage[EnvironmentSession], usage, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_list_environment_sessions(self, client: Gitpod) -> None: + with client.usage.with_streaming_response.list_environment_sessions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + usage = response.parse() + assert_matches_type(SyncSessionsPage[EnvironmentSession], usage, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncUsage: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_list_environment_sessions(self, async_client: AsyncGitpod) -> None: + usage = await async_client.usage.list_environment_sessions() + assert_matches_type(AsyncSessionsPage[EnvironmentSession], usage, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_list_environment_sessions_with_all_params(self, async_client: AsyncGitpod) -> None: + usage = await async_client.usage.list_environment_sessions( + token="token", + page_size=0, + filter={ + "date_range": { + "end_time": parse_datetime("2019-12-27T18:11:19.117Z"), + "start_time": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + "project_id": "projectId", + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncSessionsPage[EnvironmentSession], usage, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_list_environment_sessions(self, async_client: AsyncGitpod) -> None: + response = await async_client.usage.with_raw_response.list_environment_sessions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + usage = await response.parse() + assert_matches_type(AsyncSessionsPage[EnvironmentSession], usage, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_list_environment_sessions(self, async_client: AsyncGitpod) -> None: + async with async_client.usage.with_streaming_response.list_environment_sessions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + usage = await response.parse() + assert_matches_type(AsyncSessionsPage[EnvironmentSession], usage, path=["response"]) + + assert cast(Any, response.is_closed) is True From d15ff26e73757d6acc127eb4360c813ed173bfa0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 10:19:53 +0000 Subject: [PATCH 165/505] feat(api): manual updates --- .stats.yml | 4 +- src/gitpod/resources/secrets.py | 66 ++++++++++++++++++- src/gitpod/resources/usage.py | 50 ++++++++++++-- src/gitpod/types/environment_session.py | 4 +- src/gitpod/types/runner_configuration.py | 7 ++ .../types/runner_configuration_param.py | 7 ++ src/gitpod/types/runner_update_params.py | 6 ++ tests/api_resources/test_runners.py | 4 ++ tests/api_resources/test_secrets.py | 8 +-- tests/api_resources/test_usage.py | 12 ++-- 10 files changed, 146 insertions(+), 22 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5233e38d..9cdc117c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d854bc81e0a99171716893e6790a87ba350bb6fc778f8e3244abdd47d5c252c3.yml -openapi_spec_hash: 5189220e4712a7b0cdd35beba2ebb47d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2e6ddfc9da00e33fcf13baf0b67012b97f051fa986658ff114fde989e56caa94.yml +openapi_spec_hash: 5af02ea2008312d609394e548756e761 config_hash: 60929489bdc1eaf979e7ef74fdd17b94 diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 8e0fdf58..42c84854 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -176,7 +176,38 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncSecretsPage[Secret]: """ - ListSecrets + Lists secrets + + Use this method to: + + - View all project secrets + - View all user secrets + + ### Examples + + - List project secrets: + + Shows all secrets for a project. + + ```yaml + filter: + scope: + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + - List user secrets: + + Shows all secrets for a user. + + ```yaml + filter: + scope: + userId: "123e4567-e89b-12d3-a456-426614174000" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -515,7 +546,38 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Secret, AsyncSecretsPage[Secret]]: """ - ListSecrets + Lists secrets + + Use this method to: + + - View all project secrets + - View all user secrets + + ### Examples + + - List project secrets: + + Shows all secrets for a project. + + ```yaml + filter: + scope: + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + - List user secrets: + + Shows all secrets for a user. + + ```yaml + filter: + scope: + userId: "123e4567-e89b-12d3-a456-426614174000" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments diff --git a/src/gitpod/resources/usage.py b/src/gitpod/resources/usage.py index 8d63dacb..045048a0 100644 --- a/src/gitpod/resources/usage.py +++ b/src/gitpod/resources/usage.py @@ -57,10 +57,29 @@ def list_environment_sessions( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncSessionsPage[EnvironmentSession]: """ - Lists environment sessions within a specified date range. + Lists completed environment sessions within a specified date range. - Returns a list of environment sessions that were active within the specified - date range. + Returns a list of environment sessions that were completed within the specified + date range. Currently running sessions are not included. + + Use this method to: + + - View environment sessions + - Filter by project + - Monitor session activity + - Create custom usage reports + + ### Example + + ```yaml + filter: + projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + dateRange: + startTime: "2024-01-01T00:00:00Z" + endTime: "2024-01-02T00:00:00Z" + pagination: + pageSize: 100 + ``` Args: filter: Filter options. @@ -138,10 +157,29 @@ def list_environment_sessions( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[EnvironmentSession, AsyncSessionsPage[EnvironmentSession]]: """ - Lists environment sessions within a specified date range. + Lists completed environment sessions within a specified date range. + + Returns a list of environment sessions that were completed within the specified + date range. Currently running sessions are not included. + + Use this method to: + + - View environment sessions + - Filter by project + - Monitor session activity + - Create custom usage reports + + ### Example - Returns a list of environment sessions that were active within the specified - date range. + ```yaml + filter: + projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + dateRange: + startTime: "2024-01-01T00:00:00Z" + endTime: "2024-01-02T00:00:00Z" + pagination: + pageSize: 100 + ``` Args: filter: Filter options. diff --git a/src/gitpod/types/environment_session.py b/src/gitpod/types/environment_session.py index 733376f0..df51aaba 100644 --- a/src/gitpod/types/environment_session.py +++ b/src/gitpod/types/environment_session.py @@ -24,7 +24,7 @@ class EnvironmentSession(BaseModel): """Environment ID associated with the session.""" project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """Project ID associated with the session.""" + """Project ID associated with the session (if available).""" runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) """Runner ID associated with the session.""" @@ -33,4 +33,4 @@ class EnvironmentSession(BaseModel): """Time when the session was stopped.""" user_id: Optional[str] = FieldInfo(alias="userId", default=None) - """User ID who created the session.""" + """User ID that created the session.""" diff --git a/src/gitpod/types/runner_configuration.py b/src/gitpod/types/runner_configuration.py index be9ab44f..4f91d552 100644 --- a/src/gitpod/types/runner_configuration.py +++ b/src/gitpod/types/runner_configuration.py @@ -16,6 +16,13 @@ class RunnerConfiguration(BaseModel): auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None) """auto_update indicates whether the runner should automatically update itself.""" + devcontainer_image_cache_enabled: Optional[bool] = FieldInfo(alias="devcontainerImageCacheEnabled", default=None) + """ + devcontainer_image_cache_enabled controls whether the devcontainer build cache + is enabled for this runner. Only takes effect on supported runners, currently + only AWS EC2 runners. + """ + log_level: Optional[LogLevel] = FieldInfo(alias="logLevel", default=None) """log_level is the log level for the runner""" diff --git a/src/gitpod/types/runner_configuration_param.py b/src/gitpod/types/runner_configuration_param.py index b2adc5a5..7ba49ee7 100644 --- a/src/gitpod/types/runner_configuration_param.py +++ b/src/gitpod/types/runner_configuration_param.py @@ -16,6 +16,13 @@ class RunnerConfigurationParam(TypedDict, total=False): auto_update: Annotated[bool, PropertyInfo(alias="autoUpdate")] """auto_update indicates whether the runner should automatically update itself.""" + devcontainer_image_cache_enabled: Annotated[bool, PropertyInfo(alias="devcontainerImageCacheEnabled")] + """ + devcontainer_image_cache_enabled controls whether the devcontainer build cache + is enabled for this runner. Only takes effect on supported runners, currently + only AWS EC2 runners. + """ + log_level: Annotated[LogLevel, PropertyInfo(alias="logLevel")] """log_level is the log level for the runner""" diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index 8e36e4d9..4bef0fe3 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -44,6 +44,12 @@ class SpecConfiguration(TypedDict, total=False): auto_update: Annotated[Optional[bool], PropertyInfo(alias="autoUpdate")] """auto_update indicates whether the runner should automatically update itself.""" + devcontainer_image_cache_enabled: Annotated[Optional[bool], PropertyInfo(alias="devcontainerImageCacheEnabled")] + """ + devcontainer_image_cache_enabled controls whether the shared devcontainer build + cache is enabled for this runner. + """ + log_level: Annotated[Optional[LogLevel], PropertyInfo(alias="logLevel")] """log_level is the log level for the runner""" diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 45c556dc..afbbc444 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -41,6 +41,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: spec={ "configuration": { "auto_update": True, + "devcontainer_image_cache_enabled": True, "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, @@ -129,6 +130,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: spec={ "configuration": { "auto_update": True, + "devcontainer_image_cache_enabled": True, "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, @@ -378,6 +380,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> spec={ "configuration": { "auto_update": True, + "devcontainer_image_cache_enabled": True, "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, @@ -466,6 +469,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> spec={ "configuration": { "auto_update": True, + "devcontainer_image_cache_enabled": True, "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index e74682b0..02a47669 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -82,13 +82,13 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "scope": { - "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) @@ -288,13 +288,13 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "scope": { - "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) diff --git a/tests/api_resources/test_usage.py b/tests/api_resources/test_usage.py index a6c5b0d2..126ea4a6 100644 --- a/tests/api_resources/test_usage.py +++ b/tests/api_resources/test_usage.py @@ -33,10 +33,10 @@ def test_method_list_environment_sessions_with_all_params(self, client: Gitpod) page_size=0, filter={ "date_range": { - "end_time": parse_datetime("2019-12-27T18:11:19.117Z"), - "start_time": parse_datetime("2019-12-27T18:11:19.117Z"), + "end_time": parse_datetime("2024-01-02T00:00:00Z"), + "start_time": parse_datetime("2024-01-01T00:00:00Z"), }, - "project_id": "projectId", + "project_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", }, pagination={ "token": "token", @@ -85,10 +85,10 @@ async def test_method_list_environment_sessions_with_all_params(self, async_clie page_size=0, filter={ "date_range": { - "end_time": parse_datetime("2019-12-27T18:11:19.117Z"), - "start_time": parse_datetime("2019-12-27T18:11:19.117Z"), + "end_time": parse_datetime("2024-01-02T00:00:00Z"), + "start_time": parse_datetime("2024-01-01T00:00:00Z"), }, - "project_id": "projectId", + "project_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", }, pagination={ "token": "token", From 8e9981abacd37809f4a2cbf6aa65ca8c011ac777 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 12:59:57 +0000 Subject: [PATCH 166/505] feat(api): manual updates --- .github/workflows/ci.yml | 24 +++ .stats.yml | 8 +- CONTRIBUTING.md | 3 +- README.md | 2 +- SECURITY.md | 4 +- api.md | 139 +++++-------- scripts/utils/upload-artifact.sh | 25 +++ src/gitpod/__init__.py | 5 + src/gitpod/_base_client.py | 6 + src/gitpod/_client.py | 10 +- src/gitpod/_models.py | 2 + src/gitpod/_types.py | 2 + src/gitpod/_utils/_proxy.py | 5 +- src/gitpod/_utils/_resources_proxy.py | 24 +++ src/gitpod/pagination.py | 159 +++++++++----- src/gitpod/resources/__init__.py | 14 ++ src/gitpod/resources/accounts.py | 138 ++++++++++++ .../resources/environments/environments.py | 105 ++++++++++ src/gitpod/resources/gateways.py | 196 ++++++++++++++++++ .../resources/organizations/policies.py | 10 + .../configurations/scm_integrations.py | 20 ++ src/gitpod/resources/runners/runners.py | 10 + src/gitpod/resources/usage.py | 78 +++---- src/gitpod/types/__init__.py | 18 +- src/gitpod/types/account.py | 1 + ...ount_list_joinable_organizations_params.py | 17 ++ ...nt_list_joinable_organizations_response.py | 16 ++ src/gitpod/types/environment_list_params.py | 17 +- src/gitpod/types/environment_metadata.py | 6 + .../types/environment_unarchive_params.py | 17 ++ ...session.py => environment_usage_record.py} | 23 +- src/gitpod/types/gateway_info.py | 16 ++ src/gitpod/types/gateway_list_params.py | 32 +++ .../organizations/organization_policies.py | 6 + .../organizations/policy_update_params.py | 6 + src/gitpod/types/runner_create_params.py | 9 +- src/gitpod/types/runner_provider.py | 1 + src/gitpod/types/runner_status.py | 6 +- .../runners/configuration_validate_params.py | 6 + .../scm_integration_create_params.py | 6 + .../scm_integration_oauth_config.py | 8 + .../scm_integration_update_params.py | 6 + src/gitpod/types/shared/__init__.py | 1 + src/gitpod/types/shared/gateway.py | 21 ++ src/gitpod/types/shared/principal.py | 1 + src/gitpod/types/shared_params/principal.py | 1 + ...ist_environment_runtime_records_params.py} | 8 +- .../organizations/test_policies.py | 2 + .../configurations/test_scm_integrations.py | 4 + .../runners/test_configurations.py | 2 + tests/api_resources/test_accounts.py | 77 +++++++ tests/api_resources/test_environments.py | 74 +++++++ tests/api_resources/test_gateways.py | 105 ++++++++++ tests/api_resources/test_runners.py | 2 + tests/api_resources/test_usage.py | 52 ++--- tests/test_client.py | 54 +++++ tests/test_utils/test_proxy.py | 11 + 57 files changed, 1385 insertions(+), 236 deletions(-) create mode 100755 scripts/utils/upload-artifact.sh create mode 100644 src/gitpod/_utils/_resources_proxy.py create mode 100644 src/gitpod/resources/gateways.py create mode 100644 src/gitpod/types/account_list_joinable_organizations_params.py create mode 100644 src/gitpod/types/account_list_joinable_organizations_response.py create mode 100644 src/gitpod/types/environment_unarchive_params.py rename src/gitpod/types/{environment_session.py => environment_usage_record.py} (59%) create mode 100644 src/gitpod/types/gateway_info.py create mode 100644 src/gitpod/types/gateway_list_params.py create mode 100644 src/gitpod/types/shared/gateway.py rename src/gitpod/types/{usage_list_environment_sessions_params.py => usage_list_environment_runtime_records_params.py} (82%) create mode 100644 tests/api_resources/test_gateways.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d445d4d3..a15f2553 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,30 @@ jobs: - name: Run lints run: ./scripts/lint + upload: + if: github.repository == 'stainless-sdks/gitpod-python' + timeout-minutes: 10 + name: upload + permissions: + contents: read + id-token: write + runs-on: depot-ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Get GitHub OIDC Token + id: github-oidc + uses: actions/github-script@v6 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh + test: timeout-minutes: 10 name: test diff --git a/.stats.yml b/.stats.yml index 9cdc117c..ac7c24ea 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2e6ddfc9da00e33fcf13baf0b67012b97f051fa986658ff114fde989e56caa94.yml -openapi_spec_hash: 5af02ea2008312d609394e548756e761 -config_hash: 60929489bdc1eaf979e7ef74fdd17b94 +configured_endpoints: 119 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c850a6432597255fc1b788ba21a0494162e639f41dd80c0f9d07def239d31865.yml +openapi_spec_hash: fba3f62e51d3ba39eea280abe29f39f1 +config_hash: 8e3b8fba844b78950ad4a13b75b7fffc diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63af7070..8e1d17a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,8 +17,7 @@ $ rye sync --all-features You can then run scripts using `rye run python script.py` or by activating the virtual environment: ```sh -$ rye shell -# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work +# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work $ source .venv/bin/activate # now you can omit the `rye run` prefix diff --git a/README.md b/README.md index cc5daa23..f4421881 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ from gitpod import Gitpod client = Gitpod() page = client.accounts.list_login_providers( - filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + filter={}, ) print(page.login_providers) ``` diff --git a/SECURITY.md b/SECURITY.md index 2b0ed909..efd90888 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,11 +16,11 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Gitpod please follow the respective company's security reporting guidelines. +or products provided by Gitpod, please follow the respective company's security reporting guidelines. ### Gitpod Terms and Policies -Please contact dev-feedback@gitpod.com for any questions or concerns regarding security of our services. +Please contact dev-feedback@gitpod.com for any questions or concerns regarding the security of our services. --- diff --git a/api.md b/api.md index dfb3cfec..d6b34b7f 100644 --- a/api.md +++ b/api.md @@ -6,6 +6,7 @@ from gitpod.types import ( EnvironmentClass, ErrorCode, FieldValue, + Gateway, OrganizationRole, Principal, RunsOn, @@ -33,16 +34,17 @@ from gitpod.types import ( JoinableOrganization, LoginProvider, AccountRetrieveResponse, - AccountDeleteResponse, AccountGetSSOLoginURLResponse, + AccountListJoinableOrganizationsResponse, ) ``` Methods: - client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse -- client.accounts.delete(\*\*params) -> object +- client.accounts.delete(\*\*params) -> object - client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse +- client.accounts.list_joinable_organizations(\*\*params) -> AccountListJoinableOrganizationsResponse - client.accounts.list_login_providers(\*\*params) -> SyncLoginProvidersPage[LoginProvider] # Editors @@ -74,14 +76,9 @@ from gitpod.types import ( EnvironmentStatus, EnvironmentCreateResponse, EnvironmentRetrieveResponse, - EnvironmentUpdateResponse, - EnvironmentDeleteResponse, EnvironmentCreateEnvironmentTokenResponse, EnvironmentCreateFromProjectResponse, EnvironmentCreateLogsTokenResponse, - EnvironmentMarkActiveResponse, - EnvironmentStartResponse, - EnvironmentStopResponse, ) ``` @@ -89,15 +86,16 @@ Methods: - client.environments.create(\*\*params) -> EnvironmentCreateResponse - client.environments.retrieve(\*\*params) -> EnvironmentRetrieveResponse -- client.environments.update(\*\*params) -> object +- client.environments.update(\*\*params) -> object - client.environments.list(\*\*params) -> SyncEnvironmentsPage[Environment] -- client.environments.delete(\*\*params) -> object +- client.environments.delete(\*\*params) -> object - client.environments.create_environment_token(\*\*params) -> EnvironmentCreateEnvironmentTokenResponse - client.environments.create_from_project(\*\*params) -> EnvironmentCreateFromProjectResponse - client.environments.create_logs_token(\*\*params) -> EnvironmentCreateLogsTokenResponse -- client.environments.mark_active(\*\*params) -> object -- client.environments.start(\*\*params) -> object -- client.environments.stop(\*\*params) -> object +- client.environments.mark_active(\*\*params) -> object +- client.environments.start(\*\*params) -> object +- client.environments.stop(\*\*params) -> object +- client.environments.unarchive(\*\*params) -> object ## Automations @@ -124,10 +122,6 @@ from gitpod.types.environments.automations import ( ServiceStatus, ServiceCreateResponse, ServiceRetrieveResponse, - ServiceUpdateResponse, - ServiceDeleteResponse, - ServiceStartResponse, - ServiceStopResponse, ) ``` @@ -135,11 +129,11 @@ Methods: - client.environments.automations.services.create(\*\*params) -> ServiceCreateResponse - client.environments.automations.services.retrieve(\*\*params) -> ServiceRetrieveResponse -- client.environments.automations.services.update(\*\*params) -> object +- client.environments.automations.services.update(\*\*params) -> object - client.environments.automations.services.list(\*\*params) -> SyncServicesPage[Service] -- client.environments.automations.services.delete(\*\*params) -> object -- client.environments.automations.services.start(\*\*params) -> object -- client.environments.automations.services.stop(\*\*params) -> object +- client.environments.automations.services.delete(\*\*params) -> object +- client.environments.automations.services.start(\*\*params) -> object +- client.environments.automations.services.stop(\*\*params) -> object ### Tasks @@ -149,8 +143,6 @@ Types: from gitpod.types.environments.automations import ( TaskCreateResponse, TaskRetrieveResponse, - TaskUpdateResponse, - TaskDeleteResponse, TaskStartResponse, ) ``` @@ -159,9 +151,9 @@ Methods: - client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse - client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse -- client.environments.automations.tasks.update(\*\*params) -> object +- client.environments.automations.tasks.update(\*\*params) -> object - client.environments.automations.tasks.list(\*\*params) -> SyncTasksPage[Task] -- client.environments.automations.tasks.delete(\*\*params) -> object +- client.environments.automations.tasks.delete(\*\*params) -> object - client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse #### Executions @@ -169,17 +161,14 @@ Methods: Types: ```python -from gitpod.types.environments.automations.tasks import ( - ExecutionRetrieveResponse, - ExecutionStopResponse, -) +from gitpod.types.environments.automations.tasks import ExecutionRetrieveResponse ``` Methods: - client.environments.automations.tasks.executions.retrieve(\*\*params) -> ExecutionRetrieveResponse - client.environments.automations.tasks.executions.list(\*\*params) -> SyncTaskExecutionsPage[TaskExecution] -- client.environments.automations.tasks.executions.stop(\*\*params) -> object +- client.environments.automations.tasks.executions.stop(\*\*params) -> object ## Classes @@ -200,6 +189,12 @@ Methods: - client.events.list(\*\*params) -> SyncEntriesPage[EventListResponse] - client.events.watch(\*\*params) -> JSONLDecoder[EventWatchResponse] +# Gateways + +Methods: + +- client.gateways.list(\*\*params) -> SyncGatewaysPage[Gateway] + # Groups Types: @@ -244,10 +239,7 @@ from gitpod.types import ( OrganizationCreateResponse, OrganizationRetrieveResponse, OrganizationUpdateResponse, - OrganizationDeleteResponse, OrganizationJoinResponse, - OrganizationLeaveResponse, - OrganizationSetRoleResponse, ) ``` @@ -256,11 +248,11 @@ Methods: - client.organizations.create(\*\*params) -> OrganizationCreateResponse - client.organizations.retrieve(\*\*params) -> OrganizationRetrieveResponse - client.organizations.update(\*\*params) -> OrganizationUpdateResponse -- client.organizations.delete(\*\*params) -> object +- client.organizations.delete(\*\*params) -> object - client.organizations.join(\*\*params) -> OrganizationJoinResponse -- client.organizations.leave(\*\*params) -> object +- client.organizations.leave(\*\*params) -> object - client.organizations.list_members(\*\*params) -> SyncMembersPage[OrganizationMember] -- client.organizations.set_role(\*\*params) -> object +- client.organizations.set_role(\*\*params) -> object ## DomainVerifications @@ -272,7 +264,6 @@ from gitpod.types.organizations import ( DomainVerificationState, DomainVerificationCreateResponse, DomainVerificationRetrieveResponse, - DomainVerificationDeleteResponse, DomainVerificationVerifyResponse, ) ``` @@ -282,7 +273,7 @@ Methods: - client.organizations.domain_verifications.create(\*\*params) -> DomainVerificationCreateResponse - client.organizations.domain_verifications.retrieve(\*\*params) -> DomainVerificationRetrieveResponse - client.organizations.domain_verifications.list(\*\*params) -> SyncDomainVerificationsPage[DomainVerification] -- client.organizations.domain_verifications.delete(\*\*params) -> object +- client.organizations.domain_verifications.delete(\*\*params) -> object - client.organizations.domain_verifications.verify(\*\*params) -> DomainVerificationVerifyResponse ## Invites @@ -309,17 +300,13 @@ Methods: Types: ```python -from gitpod.types.organizations import ( - OrganizationPolicies, - PolicyRetrieveResponse, - PolicyUpdateResponse, -) +from gitpod.types.organizations import OrganizationPolicies, PolicyRetrieveResponse ``` Methods: - client.organizations.policies.retrieve(\*\*params) -> PolicyRetrieveResponse -- client.organizations.policies.update(\*\*params) -> object +- client.organizations.policies.update(\*\*params) -> object ## SSOConfigurations @@ -332,8 +319,6 @@ from gitpod.types.organizations import ( SSOConfigurationState, SSOConfigurationCreateResponse, SSOConfigurationRetrieveResponse, - SSOConfigurationUpdateResponse, - SSOConfigurationDeleteResponse, ) ``` @@ -341,9 +326,9 @@ Methods: - client.organizations.sso_configurations.create(\*\*params) -> SSOConfigurationCreateResponse - client.organizations.sso_configurations.retrieve(\*\*params) -> SSOConfigurationRetrieveResponse -- client.organizations.sso_configurations.update(\*\*params) -> object +- client.organizations.sso_configurations.update(\*\*params) -> object - client.organizations.sso_configurations.list(\*\*params) -> SyncSSOConfigurationsPage[SSOConfiguration] -- client.organizations.sso_configurations.delete(\*\*params) -> object +- client.organizations.sso_configurations.delete(\*\*params) -> object # Projects @@ -358,7 +343,6 @@ from gitpod.types import ( ProjectCreateResponse, ProjectRetrieveResponse, ProjectUpdateResponse, - ProjectDeleteResponse, ProjectCreateFromEnvironmentResponse, ) ``` @@ -369,7 +353,7 @@ Methods: - client.projects.retrieve(\*\*params) -> ProjectRetrieveResponse - client.projects.update(\*\*params) -> ProjectUpdateResponse - client.projects.list(\*\*params) -> SyncProjectsPage[Project] -- client.projects.delete(\*\*params) -> object +- client.projects.delete(\*\*params) -> object - client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse ## Policies @@ -382,7 +366,6 @@ from gitpod.types.projects import ( ProjectRole, PolicyCreateResponse, PolicyUpdateResponse, - PolicyDeleteResponse, ) ``` @@ -391,7 +374,7 @@ Methods: - client.projects.policies.create(\*\*params) -> PolicyCreateResponse - client.projects.policies.update(\*\*params) -> PolicyUpdateResponse - client.projects.policies.list(\*\*params) -> SyncPoliciesPage[ProjectPolicy] -- client.projects.policies.delete(\*\*params) -> object +- client.projects.policies.delete(\*\*params) -> object # Runners @@ -399,6 +382,7 @@ Types: ```python from gitpod.types import ( + GatewayInfo, LogLevel, MetricsConfiguration, Runner, @@ -412,8 +396,6 @@ from gitpod.types import ( RunnerStatus, RunnerCreateResponse, RunnerRetrieveResponse, - RunnerUpdateResponse, - RunnerDeleteResponse, RunnerCheckAuthenticationForHostResponse, RunnerCreateRunnerTokenResponse, RunnerParseContextURLResponse, @@ -424,9 +406,9 @@ Methods: - client.runners.create(\*\*params) -> RunnerCreateResponse - client.runners.retrieve(\*\*params) -> RunnerRetrieveResponse -- client.runners.update(\*\*params) -> object +- client.runners.update(\*\*params) -> object - client.runners.list(\*\*params) -> SyncRunnersPage[Runner] -- client.runners.delete(\*\*params) -> object +- client.runners.delete(\*\*params) -> object - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse - client.runners.parse_context_url(\*\*params) -> RunnerParseContextURLResponse @@ -456,7 +438,6 @@ Types: from gitpod.types.runners.configurations import ( EnvironmentClassCreateResponse, EnvironmentClassRetrieveResponse, - EnvironmentClassUpdateResponse, ) ``` @@ -464,7 +445,7 @@ Methods: - client.runners.configurations.environment_classes.create(\*\*params) -> EnvironmentClassCreateResponse - client.runners.configurations.environment_classes.retrieve(\*\*params) -> EnvironmentClassRetrieveResponse -- client.runners.configurations.environment_classes.update(\*\*params) -> object +- client.runners.configurations.environment_classes.update(\*\*params) -> object - client.runners.configurations.environment_classes.list(\*\*params) -> SyncEnvironmentClassesPage[EnvironmentClass] ### HostAuthenticationTokens @@ -477,8 +458,6 @@ from gitpod.types.runners.configurations import ( HostAuthenticationTokenSource, HostAuthenticationTokenCreateResponse, HostAuthenticationTokenRetrieveResponse, - HostAuthenticationTokenUpdateResponse, - HostAuthenticationTokenDeleteResponse, ) ``` @@ -486,9 +465,9 @@ Methods: - client.runners.configurations.host_authentication_tokens.create(\*\*params) -> HostAuthenticationTokenCreateResponse - client.runners.configurations.host_authentication_tokens.retrieve(\*\*params) -> HostAuthenticationTokenRetrieveResponse -- client.runners.configurations.host_authentication_tokens.update(\*\*params) -> object +- client.runners.configurations.host_authentication_tokens.update(\*\*params) -> object - client.runners.configurations.host_authentication_tokens.list(\*\*params) -> SyncTokensPage[HostAuthenticationToken] -- client.runners.configurations.host_authentication_tokens.delete(\*\*params) -> object +- client.runners.configurations.host_authentication_tokens.delete(\*\*params) -> object ### Schema @@ -512,8 +491,6 @@ from gitpod.types.runners.configurations import ( ScmIntegrationOAuthConfig, ScmIntegrationCreateResponse, ScmIntegrationRetrieveResponse, - ScmIntegrationUpdateResponse, - ScmIntegrationDeleteResponse, ) ``` @@ -521,9 +498,9 @@ Methods: - client.runners.configurations.scm_integrations.create(\*\*params) -> ScmIntegrationCreateResponse - client.runners.configurations.scm_integrations.retrieve(\*\*params) -> ScmIntegrationRetrieveResponse -- client.runners.configurations.scm_integrations.update(\*\*params) -> object +- client.runners.configurations.scm_integrations.update(\*\*params) -> object - client.runners.configurations.scm_integrations.list(\*\*params) -> SyncIntegrationsPage[ScmIntegration] -- client.runners.configurations.scm_integrations.delete(\*\*params) -> object +- client.runners.configurations.scm_integrations.delete(\*\*params) -> object ## Policies @@ -535,7 +512,6 @@ from gitpod.types.runners import ( RunnerRole, PolicyCreateResponse, PolicyUpdateResponse, - PolicyDeleteResponse, ) ``` @@ -544,79 +520,72 @@ Methods: - client.runners.policies.create(\*\*params) -> PolicyCreateResponse - client.runners.policies.update(\*\*params) -> PolicyUpdateResponse - client.runners.policies.list(\*\*params) -> SyncPoliciesPage[RunnerPolicy] -- client.runners.policies.delete(\*\*params) -> object +- client.runners.policies.delete(\*\*params) -> object # Secrets Types: ```python -from gitpod.types import ( - Secret, - SecretScope, - SecretCreateResponse, - SecretDeleteResponse, - SecretGetValueResponse, - SecretUpdateValueResponse, -) +from gitpod.types import Secret, SecretScope, SecretCreateResponse, SecretGetValueResponse ``` Methods: - client.secrets.create(\*\*params) -> SecretCreateResponse - client.secrets.list(\*\*params) -> SyncSecretsPage[Secret] -- client.secrets.delete(\*\*params) -> object +- client.secrets.delete(\*\*params) -> object - client.secrets.get_value(\*\*params) -> SecretGetValueResponse -- client.secrets.update_value(\*\*params) -> object +- client.secrets.update_value(\*\*params) -> object # Usage Types: ```python -from gitpod.types import EnvironmentSession +from gitpod.types import EnvironmentUsageRecord ``` Methods: -- client.usage.list_environment_sessions(\*\*params) -> SyncSessionsPage[EnvironmentSession] +- client.usage.list_environment_runtime_records(\*\*params) -> SyncRecordsPage[EnvironmentUsageRecord] # Users Types: ```python -from gitpod.types import User, UserGetAuthenticatedUserResponse, UserSetSuspendedResponse +from gitpod.types import User, UserGetAuthenticatedUserResponse ``` Methods: - client.users.get_authenticated_user(\*\*params) -> UserGetAuthenticatedUserResponse -- client.users.set_suspended(\*\*params) -> object +- client.users.set_suspended(\*\*params) -> object ## Dotfiles Types: ```python -from gitpod.types.users import DotfilesConfiguration, DotfileGetResponse, DotfileSetResponse +from gitpod.types.users import DotfilesConfiguration, DotfileGetResponse ``` Methods: - client.users.dotfiles.get(\*\*params) -> DotfileGetResponse -- client.users.dotfiles.set(\*\*params) -> object +- client.users.dotfiles.set(\*\*params) -> object ## Pats Types: ```python -from gitpod.types.users import PersonalAccessToken, PatDeleteResponse, PatGetResponse +from gitpod.types.users import PersonalAccessToken, PatGetResponse ``` Methods: - client.users.pats.list(\*\*params) -> SyncPersonalAccessTokensPage[PersonalAccessToken] -- client.users.pats.delete(\*\*params) -> object +- client.users.pats.delete(\*\*params) -> object - client.users.pats.get(\*\*params) -> PatGetResponse diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 00000000..f50929ab --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary @- "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/gitpod-python/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi diff --git a/src/gitpod/__init__.py b/src/gitpod/__init__.py index 4bba6ebd..ce63e16c 100644 --- a/src/gitpod/__init__.py +++ b/src/gitpod/__init__.py @@ -1,5 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import typing as _t + from . import types from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes from ._utils import file_from_path @@ -68,6 +70,9 @@ "DefaultAsyncHttpxClient", ] +if not _t.TYPE_CHECKING: + from ._utils._resources_proxy import resources as resources + _setup_logging() # Update the __module__ attribute for exported symbols so that diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 54b43106..34005d22 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -960,6 +960,9 @@ def request( if self.custom_auth is not None: kwargs["auth"] = self.custom_auth + if options.follow_redirects is not None: + kwargs["follow_redirects"] = options.follow_redirects + log.debug("Sending HTTP Request: %s %s", request.method, request.url) response = None @@ -1460,6 +1463,9 @@ async def request( if self.custom_auth is not None: kwargs["auth"] = self.custom_auth + if options.follow_redirects is not None: + kwargs["follow_redirects"] = options.follow_redirects + log.debug("Sending HTTP Request: %s %s", request.method, request.url) response = None diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index e0035c32..dd0ccc22 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -21,7 +21,7 @@ ) from ._utils import is_given, get_async_library from ._version import __version__ -from .resources import usage, events, groups, editors, secrets, accounts, identity +from .resources import usage, events, groups, editors, secrets, accounts, gateways, identity from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import GitpodError, APIStatusError from ._base_client import ( @@ -43,6 +43,7 @@ class Gitpod(SyncAPIClient): editors: editors.EditorsResource environments: environments.EnvironmentsResource events: events.EventsResource + gateways: gateways.GatewaysResource groups: groups.GroupsResource identity: identity.IdentityResource organizations: organizations.OrganizationsResource @@ -112,6 +113,7 @@ def __init__( self.editors = editors.EditorsResource(self) self.environments = environments.EnvironmentsResource(self) self.events = events.EventsResource(self) + self.gateways = gateways.GatewaysResource(self) self.groups = groups.GroupsResource(self) self.identity = identity.IdentityResource(self) self.organizations = organizations.OrganizationsResource(self) @@ -233,6 +235,7 @@ class AsyncGitpod(AsyncAPIClient): editors: editors.AsyncEditorsResource environments: environments.AsyncEnvironmentsResource events: events.AsyncEventsResource + gateways: gateways.AsyncGatewaysResource groups: groups.AsyncGroupsResource identity: identity.AsyncIdentityResource organizations: organizations.AsyncOrganizationsResource @@ -302,6 +305,7 @@ def __init__( self.editors = editors.AsyncEditorsResource(self) self.environments = environments.AsyncEnvironmentsResource(self) self.events = events.AsyncEventsResource(self) + self.gateways = gateways.AsyncGatewaysResource(self) self.groups = groups.AsyncGroupsResource(self) self.identity = identity.AsyncIdentityResource(self) self.organizations = organizations.AsyncOrganizationsResource(self) @@ -424,6 +428,7 @@ def __init__(self, client: Gitpod) -> None: self.editors = editors.EditorsResourceWithRawResponse(client.editors) self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) self.events = events.EventsResourceWithRawResponse(client.events) + self.gateways = gateways.GatewaysResourceWithRawResponse(client.gateways) self.groups = groups.GroupsResourceWithRawResponse(client.groups) self.identity = identity.IdentityResourceWithRawResponse(client.identity) self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations) @@ -440,6 +445,7 @@ def __init__(self, client: AsyncGitpod) -> None: self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) self.events = events.AsyncEventsResourceWithRawResponse(client.events) + self.gateways = gateways.AsyncGatewaysResourceWithRawResponse(client.gateways) self.groups = groups.AsyncGroupsResourceWithRawResponse(client.groups) self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity) self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations) @@ -456,6 +462,7 @@ def __init__(self, client: Gitpod) -> None: self.editors = editors.EditorsResourceWithStreamingResponse(client.editors) self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) self.events = events.EventsResourceWithStreamingResponse(client.events) + self.gateways = gateways.GatewaysResourceWithStreamingResponse(client.gateways) self.groups = groups.GroupsResourceWithStreamingResponse(client.groups) self.identity = identity.IdentityResourceWithStreamingResponse(client.identity) self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations) @@ -472,6 +479,7 @@ def __init__(self, client: AsyncGitpod) -> None: self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) self.events = events.AsyncEventsResourceWithStreamingResponse(client.events) + self.gateways = gateways.AsyncGatewaysResourceWithStreamingResponse(client.gateways) self.groups = groups.AsyncGroupsResourceWithStreamingResponse(client.groups) self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity) self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 798956f1..4f214980 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): idempotency_key: str json_data: Body extra_json: AnyMapping + follow_redirects: bool @final @@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel): files: Union[HttpxRequestFiles, None] = None idempotency_key: Union[str, None] = None post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() + follow_redirects: Union[bool, None] = None # It should be noted that we cannot use `json` here as that would override # a BaseModel method in an incompatible fashion. diff --git a/src/gitpod/_types.py b/src/gitpod/_types.py index 618f1886..b5cea322 100644 --- a/src/gitpod/_types.py +++ b/src/gitpod/_types.py @@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False): params: Query extra_json: AnyMapping idempotency_key: str + follow_redirects: bool # Sentinel class used until PEP 0661 is accepted @@ -215,3 +216,4 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth + follow_redirects: bool diff --git a/src/gitpod/_utils/_proxy.py b/src/gitpod/_utils/_proxy.py index ffd883e9..0f239a33 100644 --- a/src/gitpod/_utils/_proxy.py +++ b/src/gitpod/_utils/_proxy.py @@ -46,7 +46,10 @@ def __dir__(self) -> Iterable[str]: @property # type: ignore @override def __class__(self) -> type: # pyright: ignore - proxied = self.__get_proxied__() + try: + proxied = self.__get_proxied__() + except Exception: + return type(self) if issubclass(type(proxied), LazyProxy): return type(proxied) return proxied.__class__ diff --git a/src/gitpod/_utils/_resources_proxy.py b/src/gitpod/_utils/_resources_proxy.py new file mode 100644 index 00000000..7ffe977d --- /dev/null +++ b/src/gitpod/_utils/_resources_proxy.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +from typing import Any +from typing_extensions import override + +from ._proxy import LazyProxy + + +class ResourcesProxy(LazyProxy[Any]): + """A proxy for the `gitpod.resources` module. + + This is used so that we can lazily import `gitpod.resources` only when + needed *and* so that users can just import `gitpod` and reference `gitpod.resources` + """ + + @override + def __load__(self) -> Any: + import importlib + + mod = importlib.import_module("gitpod.resources") + return mod + + +resources = ResourcesProxy().__as_proxied__() diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 1800f53a..647ccd9c 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -24,6 +24,9 @@ "EnvironmentsPagePagination", "SyncEnvironmentsPage", "AsyncEnvironmentsPage", + "GatewaysPagePagination", + "SyncGatewaysPage", + "AsyncGatewaysPage", "GroupsPagePagination", "SyncGroupsPage", "AsyncGroupsPage", @@ -45,6 +48,9 @@ "ProjectsPagePagination", "SyncProjectsPage", "AsyncProjectsPage", + "RecordsPagePagination", + "SyncRecordsPage", + "AsyncRecordsPage", "RunnersPagePagination", "SyncRunnersPage", "AsyncRunnersPage", @@ -54,9 +60,6 @@ "ServicesPagePagination", "SyncServicesPage", "AsyncServicesPage", - "SessionsPagePagination", - "SyncSessionsPage", - "AsyncSessionsPage", "SSOConfigurationsPagePagination", "SyncSSOConfigurationsPage", "AsyncSSOConfigurationsPage", @@ -324,6 +327,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class GatewaysPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncGatewaysPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + gateways: List[_T] + pagination: Optional[GatewaysPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + gateways = self.gateways + if not gateways: + return [] + return gateways + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncGatewaysPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + gateways: List[_T] + pagination: Optional[GatewaysPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + gateways = self.gateways + if not gateways: + return [] + return gateways + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class GroupsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -674,6 +727,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class RecordsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncRecordsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[RecordsPagePagination] = None + records: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + records = self.records + if not records: + return [] + return records + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncRecordsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[RecordsPagePagination] = None + records: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + records = self.records + if not records: + return [] + return records + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class RunnersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -824,56 +927,6 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) -class SessionsPagePagination(BaseModel): - next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) - - -class SyncSessionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SessionsPagePagination] = None - sessions: List[_T] - - @override - def _get_page_items(self) -> List[_T]: - sessions = self.sessions - if not sessions: - return [] - return sessions - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = None - if self.pagination is not None: - if self.pagination.next_token is not None: - next_token = self.pagination.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - -class AsyncSessionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - pagination: Optional[SessionsPagePagination] = None - sessions: List[_T] - - @override - def _get_page_items(self) -> List[_T]: - sessions = self.sessions - if not sessions: - return [] - return sessions - - @override - def next_page_info(self) -> Optional[PageInfo]: - next_token = None - if self.pagination is not None: - if self.pagination.next_token is not None: - next_token = self.pagination.next_token - if not next_token: - return None - - return PageInfo(params={"token": next_token}) - - class SSOConfigurationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index 773dc4d0..fe636120 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -64,6 +64,14 @@ AccountsResourceWithStreamingResponse, AsyncAccountsResourceWithStreamingResponse, ) +from .gateways import ( + GatewaysResource, + AsyncGatewaysResource, + GatewaysResourceWithRawResponse, + AsyncGatewaysResourceWithRawResponse, + GatewaysResourceWithStreamingResponse, + AsyncGatewaysResourceWithStreamingResponse, +) from .identity import ( IdentityResource, AsyncIdentityResource, @@ -122,6 +130,12 @@ "AsyncEventsResourceWithRawResponse", "EventsResourceWithStreamingResponse", "AsyncEventsResourceWithStreamingResponse", + "GatewaysResource", + "AsyncGatewaysResource", + "GatewaysResourceWithRawResponse", + "AsyncGatewaysResourceWithRawResponse", + "GatewaysResourceWithStreamingResponse", + "AsyncGatewaysResourceWithStreamingResponse", "GroupsResource", "AsyncGroupsResource", "GroupsResourceWithRawResponse", diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index b32f176a..e756632b 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -11,6 +11,7 @@ account_retrieve_params, account_get_sso_login_url_params, account_list_login_providers_params, + account_list_joinable_organizations_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import maybe_transform, async_maybe_transform @@ -27,6 +28,7 @@ from ..types.login_provider import LoginProvider from ..types.account_retrieve_response import AccountRetrieveResponse from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse +from ..types.account_list_joinable_organizations_response import AccountListJoinableOrganizationsResponse __all__ = ["AccountsResource", "AsyncAccountsResource"] @@ -218,6 +220,68 @@ def get_sso_login_url( cast_to=AccountGetSSOLoginURLResponse, ) + def list_joinable_organizations( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + empty: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccountListJoinableOrganizationsResponse: + """ + Lists organizations that the currently authenticated account can join. + + Use this method to: + + - Discover organizations associated with the account's email domain. + - Allow users to join existing organizations. + - Display potential organizations during onboarding. + + ### Examples + + - List joinable organizations: + + Retrieves a list of organizations the account can join. + + ```yaml + {} + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AccountService/ListJoinableOrganizations", + body=maybe_transform( + {"empty": empty}, account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, + ), + ), + cast_to=AccountListJoinableOrganizationsResponse, + ) + def list_login_providers( self, *, @@ -491,6 +555,68 @@ async def get_sso_login_url( cast_to=AccountGetSSOLoginURLResponse, ) + async def list_joinable_organizations( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + empty: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccountListJoinableOrganizationsResponse: + """ + Lists organizations that the currently authenticated account can join. + + Use this method to: + + - Discover organizations associated with the account's email domain. + - Allow users to join existing organizations. + - Display potential organizations during onboarding. + + ### Examples + + - List joinable organizations: + + Retrieves a list of organizations the account can join. + + ```yaml + {} + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AccountService/ListJoinableOrganizations", + body=await async_maybe_transform( + {"empty": empty}, account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "token": token, + "page_size": page_size, + }, + account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, + ), + ), + cast_to=AccountListJoinableOrganizationsResponse, + ) + def list_login_providers( self, *, @@ -590,6 +716,9 @@ def __init__(self, accounts: AccountsResource) -> None: self.get_sso_login_url = to_raw_response_wrapper( accounts.get_sso_login_url, ) + self.list_joinable_organizations = to_raw_response_wrapper( + accounts.list_joinable_organizations, + ) self.list_login_providers = to_raw_response_wrapper( accounts.list_login_providers, ) @@ -608,6 +737,9 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.get_sso_login_url = async_to_raw_response_wrapper( accounts.get_sso_login_url, ) + self.list_joinable_organizations = async_to_raw_response_wrapper( + accounts.list_joinable_organizations, + ) self.list_login_providers = async_to_raw_response_wrapper( accounts.list_login_providers, ) @@ -626,6 +758,9 @@ def __init__(self, accounts: AccountsResource) -> None: self.get_sso_login_url = to_streamed_response_wrapper( accounts.get_sso_login_url, ) + self.list_joinable_organizations = to_streamed_response_wrapper( + accounts.list_joinable_organizations, + ) self.list_login_providers = to_streamed_response_wrapper( accounts.list_login_providers, ) @@ -644,6 +779,9 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.get_sso_login_url = async_to_streamed_response_wrapper( accounts.get_sso_login_url, ) + self.list_joinable_organizations = async_to_streamed_response_wrapper( + accounts.list_joinable_organizations, + ) self.list_login_providers = async_to_streamed_response_wrapper( accounts.list_login_providers, ) diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 8cafcee9..93d9b105 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -14,6 +14,7 @@ environment_delete_params, environment_update_params, environment_retrieve_params, + environment_unarchive_params, environment_mark_active_params, environment_create_logs_token_params, environment_create_from_project_params, @@ -826,6 +827,52 @@ def stop( cast_to=object, ) + def unarchive( + self, + *, + environment_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Unarchives an environment. + + ### Examples + + - Unarchive an environment: + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + environment_id: environment_id specifies the environment to unarchive. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.EnvironmentService/UnarchiveEnvironment", + body=maybe_transform( + {"environment_id": environment_id}, environment_unarchive_params.EnvironmentUnarchiveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + class AsyncEnvironmentsResource(AsyncAPIResource): @cached_property @@ -1598,6 +1645,52 @@ async def stop( cast_to=object, ) + async def unarchive( + self, + *, + environment_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Unarchives an environment. + + ### Examples + + - Unarchive an environment: + + ```yaml + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + environment_id: environment_id specifies the environment to unarchive. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.EnvironmentService/UnarchiveEnvironment", + body=await async_maybe_transform( + {"environment_id": environment_id}, environment_unarchive_params.EnvironmentUnarchiveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + class EnvironmentsResourceWithRawResponse: def __init__(self, environments: EnvironmentsResource) -> None: @@ -1636,6 +1729,9 @@ def __init__(self, environments: EnvironmentsResource) -> None: self.stop = to_raw_response_wrapper( environments.stop, ) + self.unarchive = to_raw_response_wrapper( + environments.unarchive, + ) @cached_property def automations(self) -> AutomationsResourceWithRawResponse: @@ -1683,6 +1779,9 @@ def __init__(self, environments: AsyncEnvironmentsResource) -> None: self.stop = async_to_raw_response_wrapper( environments.stop, ) + self.unarchive = async_to_raw_response_wrapper( + environments.unarchive, + ) @cached_property def automations(self) -> AsyncAutomationsResourceWithRawResponse: @@ -1730,6 +1829,9 @@ def __init__(self, environments: EnvironmentsResource) -> None: self.stop = to_streamed_response_wrapper( environments.stop, ) + self.unarchive = to_streamed_response_wrapper( + environments.unarchive, + ) @cached_property def automations(self) -> AutomationsResourceWithStreamingResponse: @@ -1777,6 +1879,9 @@ def __init__(self, environments: AsyncEnvironmentsResource) -> None: self.stop = async_to_streamed_response_wrapper( environments.stop, ) + self.unarchive = async_to_streamed_response_wrapper( + environments.unarchive, + ) @cached_property def automations(self) -> AsyncAutomationsResourceWithStreamingResponse: diff --git a/src/gitpod/resources/gateways.py b/src/gitpod/resources/gateways.py new file mode 100644 index 00000000..9351d6a9 --- /dev/null +++ b/src/gitpod/resources/gateways.py @@ -0,0 +1,196 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import gateway_list_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncGatewaysPage, AsyncGatewaysPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.shared.gateway import Gateway + +__all__ = ["GatewaysResource", "AsyncGatewaysResource"] + + +class GatewaysResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> GatewaysResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return GatewaysResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GatewaysResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return GatewaysResourceWithStreamingResponse(self) + + def list( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: gateway_list_params.Pagination | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncGatewaysPage[Gateway]: + """ + ListGateways + + Args: + pagination: pagination contains the pagination options for listing gateways + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GatewayService/ListGateways", + page=SyncGatewaysPage[Gateway], + body=maybe_transform({"pagination": pagination}, gateway_list_params.GatewayListParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + gateway_list_params.GatewayListParams, + ), + ), + model=Gateway, + method="post", + ) + + +class AsyncGatewaysResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncGatewaysResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncGatewaysResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGatewaysResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncGatewaysResourceWithStreamingResponse(self) + + def list( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + pagination: gateway_list_params.Pagination | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[Gateway, AsyncGatewaysPage[Gateway]]: + """ + ListGateways + + Args: + pagination: pagination contains the pagination options for listing gateways + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GatewayService/ListGateways", + page=AsyncGatewaysPage[Gateway], + body=maybe_transform({"pagination": pagination}, gateway_list_params.GatewayListParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + gateway_list_params.GatewayListParams, + ), + ), + model=Gateway, + method="post", + ) + + +class GatewaysResourceWithRawResponse: + def __init__(self, gateways: GatewaysResource) -> None: + self._gateways = gateways + + self.list = to_raw_response_wrapper( + gateways.list, + ) + + +class AsyncGatewaysResourceWithRawResponse: + def __init__(self, gateways: AsyncGatewaysResource) -> None: + self._gateways = gateways + + self.list = async_to_raw_response_wrapper( + gateways.list, + ) + + +class GatewaysResourceWithStreamingResponse: + def __init__(self, gateways: GatewaysResource) -> None: + self._gateways = gateways + + self.list = to_streamed_response_wrapper( + gateways.list, + ) + + +class AsyncGatewaysResourceWithStreamingResponse: + def __init__(self, gateways: AsyncGatewaysResource) -> None: + self._gateways = gateways + + self.list = async_to_streamed_response_wrapper( + gateways.list, + ) diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 172591c0..feb894c5 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -106,6 +106,7 @@ def update( maximum_running_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, members_create_projects: Optional[bool] | NotGiven = NOT_GIVEN, members_require_projects: Optional[bool] | NotGiven = NOT_GIVEN, + port_sharing_disabled: Optional[bool] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -178,6 +179,9 @@ def update( members_require_projects: members_require_projects controls whether environments can only be created from projects by non-admin users + port_sharing_disabled: port_sharing_disabled controls whether port sharing is disabled in the + organization + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -200,6 +204,7 @@ def update( "maximum_running_environments_per_user": maximum_running_environments_per_user, "members_create_projects": members_create_projects, "members_require_projects": members_require_projects, + "port_sharing_disabled": port_sharing_disabled, }, policy_update_params.PolicyUpdateParams, ), @@ -295,6 +300,7 @@ async def update( maximum_running_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, members_create_projects: Optional[bool] | NotGiven = NOT_GIVEN, members_require_projects: Optional[bool] | NotGiven = NOT_GIVEN, + port_sharing_disabled: Optional[bool] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -367,6 +373,9 @@ async def update( members_require_projects: members_require_projects controls whether environments can only be created from projects by non-admin users + port_sharing_disabled: port_sharing_disabled controls whether port sharing is disabled in the + organization + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -389,6 +398,7 @@ async def update( "maximum_running_environments_per_user": maximum_running_environments_per_user, "members_create_projects": members_create_projects, "members_require_projects": members_require_projects, + "port_sharing_disabled": port_sharing_disabled, }, policy_update_params.PolicyUpdateParams, ), diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 6f7c0891..2947b2e7 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -56,6 +56,7 @@ def create( self, *, host: str | NotGiven = NOT_GIVEN, + issuer_url: Optional[str] | NotGiven = NOT_GIVEN, oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, pat: bool | NotGiven = NOT_GIVEN, @@ -92,6 +93,9 @@ def create( ``` Args: + issuer_url: issuer_url can be set to override the authentication provider URL, if it doesn't + match the SCM host. + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If configured, oauth_plaintext_client_secret must also be set. @@ -114,6 +118,7 @@ def create( body=maybe_transform( { "host": host, + "issuer_url": issuer_url, "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, @@ -180,6 +185,7 @@ def update( self, *, id: str | NotGiven = NOT_GIVEN, + issuer_url: Optional[str] | NotGiven = NOT_GIVEN, oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, pat: Optional[bool] | NotGiven = NOT_GIVEN, @@ -212,6 +218,9 @@ def update( ``` Args: + issuer_url: issuer_url can be set to override the authentication provider URL, if it doesn't + match the SCM host. + oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. If an empty string is set, the OAuth configuration will be removed (regardless of whether a client secret is set), and any existing Host Authentication Tokens for the SCM @@ -242,6 +251,7 @@ def update( body=maybe_transform( { "id": id, + "issuer_url": issuer_url, "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, @@ -401,6 +411,7 @@ async def create( self, *, host: str | NotGiven = NOT_GIVEN, + issuer_url: Optional[str] | NotGiven = NOT_GIVEN, oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, pat: bool | NotGiven = NOT_GIVEN, @@ -437,6 +448,9 @@ async def create( ``` Args: + issuer_url: issuer_url can be set to override the authentication provider URL, if it doesn't + match the SCM host. + oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If configured, oauth_plaintext_client_secret must also be set. @@ -459,6 +473,7 @@ async def create( body=await async_maybe_transform( { "host": host, + "issuer_url": issuer_url, "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, @@ -525,6 +540,7 @@ async def update( self, *, id: str | NotGiven = NOT_GIVEN, + issuer_url: Optional[str] | NotGiven = NOT_GIVEN, oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, pat: Optional[bool] | NotGiven = NOT_GIVEN, @@ -557,6 +573,9 @@ async def update( ``` Args: + issuer_url: issuer_url can be set to override the authentication provider URL, if it doesn't + match the SCM host. + oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. If an empty string is set, the OAuth configuration will be removed (regardless of whether a client secret is set), and any existing Host Authentication Tokens for the SCM @@ -587,6 +606,7 @@ async def update( body=await async_maybe_transform( { "id": id, + "issuer_url": issuer_url, "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 5c92b857..876c5293 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -93,6 +93,7 @@ def create( kind: RunnerKind | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, provider: RunnerProvider | NotGiven = NOT_GIVEN, + runner_manager_id: str | NotGiven = NOT_GIVEN, spec: RunnerSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -155,6 +156,9 @@ def create( backwards compatibility but will be required in the future. When specified, kind must not be specified (will be deduced from provider) + runner_manager_id: The runner manager id specifies the runner manager for the managed runner. This + field is mandatory for managed runners, otheriwse should not be set. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -170,6 +174,7 @@ def create( "kind": kind, "name": name, "provider": provider, + "runner_manager_id": runner_manager_id, "spec": spec, }, runner_create_params.RunnerCreateParams, @@ -646,6 +651,7 @@ async def create( kind: RunnerKind | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, provider: RunnerProvider | NotGiven = NOT_GIVEN, + runner_manager_id: str | NotGiven = NOT_GIVEN, spec: RunnerSpecParam | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -708,6 +714,9 @@ async def create( backwards compatibility but will be required in the future. When specified, kind must not be specified (will be deduced from provider) + runner_manager_id: The runner manager id specifies the runner manager for the managed runner. This + field is mandatory for managed runners, otheriwse should not be set. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -723,6 +732,7 @@ async def create( "kind": kind, "name": name, "provider": provider, + "runner_manager_id": runner_manager_id, "spec": spec, }, runner_create_params.RunnerCreateParams, diff --git a/src/gitpod/resources/usage.py b/src/gitpod/resources/usage.py index 045048a0..71c698eb 100644 --- a/src/gitpod/resources/usage.py +++ b/src/gitpod/resources/usage.py @@ -4,7 +4,7 @@ import httpx -from ..types import usage_list_environment_sessions_params +from ..types import usage_list_environment_runtime_records_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import maybe_transform from .._compat import cached_property @@ -15,9 +15,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..pagination import SyncSessionsPage, AsyncSessionsPage +from ..pagination import SyncRecordsPage, AsyncRecordsPage from .._base_client import AsyncPaginator, make_request_options -from ..types.environment_session import EnvironmentSession +from ..types.environment_usage_record import EnvironmentUsageRecord __all__ = ["UsageResource", "AsyncUsageResource"] @@ -42,31 +42,31 @@ def with_streaming_response(self) -> UsageResourceWithStreamingResponse: """ return UsageResourceWithStreamingResponse(self) - def list_environment_sessions( + def list_environment_runtime_records( self, *, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, - filter: usage_list_environment_sessions_params.Filter | NotGiven = NOT_GIVEN, - pagination: usage_list_environment_sessions_params.Pagination | NotGiven = NOT_GIVEN, + filter: usage_list_environment_runtime_records_params.Filter | NotGiven = NOT_GIVEN, + pagination: usage_list_environment_runtime_records_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSessionsPage[EnvironmentSession]: + ) -> SyncRecordsPage[EnvironmentUsageRecord]: """ - Lists completed environment sessions within a specified date range. + Lists completed environment runtime records within a specified date range. - Returns a list of environment sessions that were completed within the specified - date range. Currently running sessions are not included. + Returns a list of environment runtime records that were completed within the + specified date range. Records of currently running environments are not + included. Use this method to: - - View environment sessions + - View environment runtime records - Filter by project - - Monitor session activity - Create custom usage reports ### Example @@ -95,14 +95,14 @@ def list_environment_sessions( timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( - "/gitpod.v1.UsageService/ListEnvironmentSessions", - page=SyncSessionsPage[EnvironmentSession], + "/gitpod.v1.UsageService/ListEnvironmentUsageRecords", + page=SyncRecordsPage[EnvironmentUsageRecord], body=maybe_transform( { "filter": filter, "pagination": pagination, }, - usage_list_environment_sessions_params.UsageListEnvironmentSessionsParams, + usage_list_environment_runtime_records_params.UsageListEnvironmentRuntimeRecordsParams, ), options=make_request_options( extra_headers=extra_headers, @@ -114,10 +114,10 @@ def list_environment_sessions( "token": token, "page_size": page_size, }, - usage_list_environment_sessions_params.UsageListEnvironmentSessionsParams, + usage_list_environment_runtime_records_params.UsageListEnvironmentRuntimeRecordsParams, ), ), - model=EnvironmentSession, + model=EnvironmentUsageRecord, method="post", ) @@ -142,31 +142,31 @@ def with_streaming_response(self) -> AsyncUsageResourceWithStreamingResponse: """ return AsyncUsageResourceWithStreamingResponse(self) - def list_environment_sessions( + def list_environment_runtime_records( self, *, token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, - filter: usage_list_environment_sessions_params.Filter | NotGiven = NOT_GIVEN, - pagination: usage_list_environment_sessions_params.Pagination | NotGiven = NOT_GIVEN, + filter: usage_list_environment_runtime_records_params.Filter | NotGiven = NOT_GIVEN, + pagination: usage_list_environment_runtime_records_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[EnvironmentSession, AsyncSessionsPage[EnvironmentSession]]: + ) -> AsyncPaginator[EnvironmentUsageRecord, AsyncRecordsPage[EnvironmentUsageRecord]]: """ - Lists completed environment sessions within a specified date range. + Lists completed environment runtime records within a specified date range. - Returns a list of environment sessions that were completed within the specified - date range. Currently running sessions are not included. + Returns a list of environment runtime records that were completed within the + specified date range. Records of currently running environments are not + included. Use this method to: - - View environment sessions + - View environment runtime records - Filter by project - - Monitor session activity - Create custom usage reports ### Example @@ -195,14 +195,14 @@ def list_environment_sessions( timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( - "/gitpod.v1.UsageService/ListEnvironmentSessions", - page=AsyncSessionsPage[EnvironmentSession], + "/gitpod.v1.UsageService/ListEnvironmentUsageRecords", + page=AsyncRecordsPage[EnvironmentUsageRecord], body=maybe_transform( { "filter": filter, "pagination": pagination, }, - usage_list_environment_sessions_params.UsageListEnvironmentSessionsParams, + usage_list_environment_runtime_records_params.UsageListEnvironmentRuntimeRecordsParams, ), options=make_request_options( extra_headers=extra_headers, @@ -214,10 +214,10 @@ def list_environment_sessions( "token": token, "page_size": page_size, }, - usage_list_environment_sessions_params.UsageListEnvironmentSessionsParams, + usage_list_environment_runtime_records_params.UsageListEnvironmentRuntimeRecordsParams, ), ), - model=EnvironmentSession, + model=EnvironmentUsageRecord, method="post", ) @@ -226,8 +226,8 @@ class UsageResourceWithRawResponse: def __init__(self, usage: UsageResource) -> None: self._usage = usage - self.list_environment_sessions = to_raw_response_wrapper( - usage.list_environment_sessions, + self.list_environment_runtime_records = to_raw_response_wrapper( + usage.list_environment_runtime_records, ) @@ -235,8 +235,8 @@ class AsyncUsageResourceWithRawResponse: def __init__(self, usage: AsyncUsageResource) -> None: self._usage = usage - self.list_environment_sessions = async_to_raw_response_wrapper( - usage.list_environment_sessions, + self.list_environment_runtime_records = async_to_raw_response_wrapper( + usage.list_environment_runtime_records, ) @@ -244,8 +244,8 @@ class UsageResourceWithStreamingResponse: def __init__(self, usage: UsageResource) -> None: self._usage = usage - self.list_environment_sessions = to_streamed_response_wrapper( - usage.list_environment_sessions, + self.list_environment_runtime_records = to_streamed_response_wrapper( + usage.list_environment_runtime_records, ) @@ -253,6 +253,6 @@ class AsyncUsageResourceWithStreamingResponse: def __init__(self, usage: AsyncUsageResource) -> None: self._usage = usage - self.list_environment_sessions = async_to_streamed_response_wrapper( - usage.list_environment_sessions, + self.list_environment_runtime_records = async_to_streamed_response_wrapper( + usage.list_environment_runtime_records, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 9ef9703c..cfa1c5d7 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -10,6 +10,7 @@ from .shared import ( Task as Task, RunsOn as RunsOn, + Gateway as Gateway, Subject as Subject, TaskSpec as TaskSpec, ErrorCode as ErrorCode, @@ -32,6 +33,7 @@ from .environment import Environment as Environment from .runner_kind import RunnerKind as RunnerKind from .runner_spec import RunnerSpec as RunnerSpec +from .gateway_info import GatewayInfo as GatewayInfo from .organization import Organization as Organization from .runner_phase import RunnerPhase as RunnerPhase from .secret_scope import SecretScope as SecretScope @@ -58,8 +60,8 @@ from .runner_list_params import RunnerListParams as RunnerListParams from .secret_list_params import SecretListParams as SecretListParams from .secret_scope_param import SecretScopeParam as SecretScopeParam -from .environment_session import EnvironmentSession as EnvironmentSession from .event_list_response import EventListResponse as EventListResponse +from .gateway_list_params import GatewayListParams as GatewayListParams from .organization_member import OrganizationMember as OrganizationMember from .project_list_params import ProjectListParams as ProjectListParams from .environment_metadata import EnvironmentMetadata as EnvironmentMetadata @@ -93,6 +95,7 @@ from .secret_get_value_params import SecretGetValueParams as SecretGetValueParams from .editor_retrieve_response import EditorRetrieveResponse as EditorRetrieveResponse from .environment_start_params import EnvironmentStartParams as EnvironmentStartParams +from .environment_usage_record import EnvironmentUsageRecord as EnvironmentUsageRecord from .organization_join_params import OrganizationJoinParams as OrganizationJoinParams from .runner_retrieve_response import RunnerRetrieveResponse as RunnerRetrieveResponse from .account_retrieve_response import AccountRetrieveResponse as AccountRetrieveResponse @@ -116,6 +119,7 @@ from .environment_create_response import EnvironmentCreateResponse as EnvironmentCreateResponse from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams from .metrics_configuration_param import MetricsConfigurationParam as MetricsConfigurationParam +from .environment_unarchive_params import EnvironmentUnarchiveParams as EnvironmentUnarchiveParams from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams from .organization_create_response import OrganizationCreateResponse as OrganizationCreateResponse from .organization_retrieve_params import OrganizationRetrieveParams as OrganizationRetrieveParams @@ -150,15 +154,15 @@ from .project_create_from_environment_params import ( ProjectCreateFromEnvironmentParams as ProjectCreateFromEnvironmentParams, ) -from .usage_list_environment_sessions_params import ( - UsageListEnvironmentSessionsParams as UsageListEnvironmentSessionsParams, -) from .environment_create_from_project_response import ( EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, ) from .project_create_from_environment_response import ( ProjectCreateFromEnvironmentResponse as ProjectCreateFromEnvironmentResponse, ) +from .account_list_joinable_organizations_params import ( + AccountListJoinableOrganizationsParams as AccountListJoinableOrganizationsParams, +) from .identity_get_authenticated_identity_params import ( IdentityGetAuthenticatedIdentityParams as IdentityGetAuthenticatedIdentityParams, ) @@ -168,6 +172,9 @@ from .runner_check_authentication_for_host_params import ( RunnerCheckAuthenticationForHostParams as RunnerCheckAuthenticationForHostParams, ) +from .account_list_joinable_organizations_response import ( + AccountListJoinableOrganizationsResponse as AccountListJoinableOrganizationsResponse, +) from .identity_get_authenticated_identity_response import ( IdentityGetAuthenticatedIdentityResponse as IdentityGetAuthenticatedIdentityResponse, ) @@ -177,3 +184,6 @@ from .runner_check_authentication_for_host_response import ( RunnerCheckAuthenticationForHostResponse as RunnerCheckAuthenticationForHostResponse, ) +from .usage_list_environment_runtime_records_params import ( + UsageListEnvironmentRuntimeRecordsParams as UsageListEnvironmentRuntimeRecordsParams, +) diff --git a/src/gitpod/types/account.py b/src/gitpod/types/account.py index f84d8641..41ee0469 100644 --- a/src/gitpod/types/account.py +++ b/src/gitpod/types/account.py @@ -206,6 +206,7 @@ class Account(BaseModel): avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) joinables: Optional[List[JoinableOrganization]] = None + """joinables is deprecated. Use ListJoinableOrganizations instead.""" memberships: Optional[List[AccountMembership]] = None diff --git a/src/gitpod/types/account_list_joinable_organizations_params.py b/src/gitpod/types/account_list_joinable_organizations_params.py new file mode 100644 index 00000000..d4531fb7 --- /dev/null +++ b/src/gitpod/types/account_list_joinable_organizations_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AccountListJoinableOrganizationsParams"] + + +class AccountListJoinableOrganizationsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + empty: bool diff --git a/src/gitpod/types/account_list_joinable_organizations_response.py b/src/gitpod/types/account_list_joinable_organizations_response.py new file mode 100644 index 00000000..3253ba5c --- /dev/null +++ b/src/gitpod/types/account_list_joinable_organizations_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .joinable_organization import JoinableOrganization + +__all__ = ["AccountListJoinableOrganizationsResponse"] + + +class AccountListJoinableOrganizationsResponse(BaseModel): + joinable_organizations: Optional[List[JoinableOrganization]] = FieldInfo( + alias="joinableOrganizations", default=None + ) diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index 4fe1e4c0..eedde71c 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import List -from typing_extensions import Annotated, TypedDict +from typing import List, Optional +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo from .runner_kind import RunnerKind @@ -24,6 +24,19 @@ class EnvironmentListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + archival_status: Annotated[ + Optional[ + Literal[ + "ARCHIVAL_STATUS_UNSPECIFIED", + "ARCHIVAL_STATUS_ACTIVE", + "ARCHIVAL_STATUS_ARCHIVED", + "ARCHIVAL_STATUS_ALL", + ] + ], + PropertyInfo(alias="archivalStatus"), + ] + """archival_status filters the response based on environment archive status""" + creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] """ creator_ids filters the response to only Environments created by specified diff --git a/src/gitpod/types/environment_metadata.py b/src/gitpod/types/environment_metadata.py index 5d6e3803..67090e04 100644 --- a/src/gitpod/types/environment_metadata.py +++ b/src/gitpod/types/environment_metadata.py @@ -18,6 +18,12 @@ class EnvironmentMetadata(BaseModel): +internal - not yet implemented """ + archived_at: Optional[datetime] = FieldInfo(alias="archivedAt", default=None) + """Time when the Environment was archived. + + If not set, the environment is not archived. + """ + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """Time when the Environment was created.""" diff --git a/src/gitpod/types/environment_unarchive_params.py b/src/gitpod/types/environment_unarchive_params.py new file mode 100644 index 00000000..862c3be7 --- /dev/null +++ b/src/gitpod/types/environment_unarchive_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EnvironmentUnarchiveParams"] + + +class EnvironmentUnarchiveParams(TypedDict, total=False): + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + """environment_id specifies the environment to unarchive. + + +required + """ diff --git a/src/gitpod/types/environment_session.py b/src/gitpod/types/environment_usage_record.py similarity index 59% rename from src/gitpod/types/environment_session.py rename to src/gitpod/types/environment_usage_record.py index df51aaba..59c85a7c 100644 --- a/src/gitpod/types/environment_session.py +++ b/src/gitpod/types/environment_usage_record.py @@ -7,30 +7,33 @@ from .._models import BaseModel -__all__ = ["EnvironmentSession"] +__all__ = ["EnvironmentUsageRecord"] -class EnvironmentSession(BaseModel): +class EnvironmentUsageRecord(BaseModel): id: Optional[str] = None - """Environment session ID.""" + """Environment usage record ID.""" created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) - """Time when the session was created.""" + """Time when the environment was created.""" environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) - """Environment class ID associated with the session.""" + """Environment class ID associated with the record.""" environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) - """Environment ID associated with the session.""" + """Environment ID associated with the record.""" project_id: Optional[str] = FieldInfo(alias="projectId", default=None) - """Project ID associated with the session (if available).""" + """Project ID associated with the environment (if available).""" runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) - """Runner ID associated with the session.""" + """Runner ID associated with the environment.""" stopped_at: Optional[datetime] = FieldInfo(alias="stoppedAt", default=None) - """Time when the session was stopped.""" + """Time when the environment was stopped.""" user_id: Optional[str] = FieldInfo(alias="userId", default=None) - """User ID that created the session.""" + """ + User ID is the ID of the user who created the environment associated with the + record. + """ diff --git a/src/gitpod/types/gateway_info.py b/src/gitpod/types/gateway_info.py new file mode 100644 index 00000000..d8211a98 --- /dev/null +++ b/src/gitpod/types/gateway_info.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .shared.gateway import Gateway + +__all__ = ["GatewayInfo"] + + +class GatewayInfo(BaseModel): + gateway: Optional[Gateway] = None + """Gateway represents a system gateway that provides access to services""" + + latency: Optional[str] = None + """latency is the round-trip time of the runner to the gateway in milliseconds.""" diff --git a/src/gitpod/types/gateway_list_params.py b/src/gitpod/types/gateway_list_params.py new file mode 100644 index 00000000..8afa4676 --- /dev/null +++ b/src/gitpod/types/gateway_list_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GatewayListParams", "Pagination"] + + +class GatewayListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + pagination: Pagination + """pagination contains the pagination options for listing gateways""" + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py index 1fdc5682..673c7561 100644 --- a/src/gitpod/types/organizations/organization_policies.py +++ b/src/gitpod/types/organizations/organization_policies.py @@ -58,6 +58,12 @@ class OrganizationPolicies(BaseModel): organization_id: str = FieldInfo(alias="organizationId") """organization_id is the ID of the organization""" + port_sharing_disabled: bool = FieldInfo(alias="portSharingDisabled") + """ + port_sharing_disabled controls whether port sharing is disabled in the + organization + """ + maximum_environment_timeout: Optional[str] = FieldInfo(alias="maximumEnvironmentTimeout", default=None) """ maximum_environment_timeout controls the maximum timeout allowed for diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index b8ea2aa2..ca6b8ab7 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -67,3 +67,9 @@ class PolicyUpdateParams(TypedDict, total=False): members_require_projects controls whether environments can only be created from projects by non-admin users """ + + port_sharing_disabled: Annotated[Optional[bool], PropertyInfo(alias="portSharingDisabled")] + """ + port_sharing_disabled controls whether port sharing is disabled in the + organization + """ diff --git a/src/gitpod/types/runner_create_params.py b/src/gitpod/types/runner_create_params.py index 6509b953..6834fa31 100644 --- a/src/gitpod/types/runner_create_params.py +++ b/src/gitpod/types/runner_create_params.py @@ -2,8 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict +from .._utils import PropertyInfo from .runner_kind import RunnerKind from .runner_provider import RunnerProvider from .runner_spec_param import RunnerSpecParam @@ -29,4 +30,10 @@ class RunnerCreateParams(TypedDict, total=False): must not be specified (will be deduced from provider) """ + runner_manager_id: Annotated[str, PropertyInfo(alias="runnerManagerId")] + """ + The runner manager id specifies the runner manager for the managed runner. This + field is mandatory for managed runners, otheriwse should not be set. + """ + spec: RunnerSpecParam diff --git a/src/gitpod/types/runner_provider.py b/src/gitpod/types/runner_provider.py index 371260b1..8f8efef0 100644 --- a/src/gitpod/types/runner_provider.py +++ b/src/gitpod/types/runner_provider.py @@ -9,4 +9,5 @@ "RUNNER_PROVIDER_AWS_EC2", "RUNNER_PROVIDER_LINUX_HOST", "RUNNER_PROVIDER_DESKTOP_MAC", + "RUNNER_PROVIDER_MANAGED", ] diff --git a/src/gitpod/types/runner_status.py b/src/gitpod/types/runner_status.py index 53a0dd5d..a302c70a 100644 --- a/src/gitpod/types/runner_status.py +++ b/src/gitpod/types/runner_status.py @@ -6,6 +6,7 @@ from pydantic import Field as FieldInfo from .._models import BaseModel +from .gateway_info import GatewayInfo from .runner_phase import RunnerPhase from .runner_capability import RunnerCapability from .shared.field_value import FieldValue @@ -23,6 +24,9 @@ class RunnerStatus(BaseModel): capabilities: Optional[List[RunnerCapability]] = None """capabilities is a list of capabilities the runner supports.""" + gateway_info: Optional[GatewayInfo] = FieldInfo(alias="gatewayInfo", default=None) + """gateway_info is information about the gateway to which the runner is connected.""" + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) message: Optional[str] = None @@ -40,6 +44,6 @@ class RunnerStatus(BaseModel): system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) - """Time when the status was last udpated.""" + """Time when the status was last updated.""" version: Optional[str] = None diff --git a/src/gitpod/types/runners/configuration_validate_params.py b/src/gitpod/types/runners/configuration_validate_params.py index df2d65e4..8afdbe5d 100644 --- a/src/gitpod/types/runners/configuration_validate_params.py +++ b/src/gitpod/types/runners/configuration_validate_params.py @@ -27,6 +27,12 @@ class ScmIntegration(TypedDict, total=False): host: str + issuer_url: Annotated[Optional[str], PropertyInfo(alias="issuerUrl")] + """ + issuer_url can be set to override the authentication provider URL, if it doesn't + match the SCM host. + """ + oauth_client_id: Annotated[Optional[str], PropertyInfo(alias="oauthClientId")] """ oauth_client_id is the OAuth app's client ID, if OAuth is configured. If diff --git a/src/gitpod/types/runners/configurations/scm_integration_create_params.py b/src/gitpod/types/runners/configurations/scm_integration_create_params.py index 9713c075..8cbddf05 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_create_params.py @@ -13,6 +13,12 @@ class ScmIntegrationCreateParams(TypedDict, total=False): host: str + issuer_url: Annotated[Optional[str], PropertyInfo(alias="issuerUrl")] + """ + issuer_url can be set to override the authentication provider URL, if it doesn't + match the SCM host. + """ + oauth_client_id: Annotated[Optional[str], PropertyInfo(alias="oauthClientId")] """ oauth_client_id is the OAuth app's client ID, if OAuth is configured. If diff --git a/src/gitpod/types/runners/configurations/scm_integration_oauth_config.py b/src/gitpod/types/runners/configurations/scm_integration_oauth_config.py index bda03c2b..f113775a 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_oauth_config.py +++ b/src/gitpod/types/runners/configurations/scm_integration_oauth_config.py @@ -18,3 +18,11 @@ class ScmIntegrationOAuthConfig(BaseModel): encrypted_client_secret is the OAuth app's secret encrypted with the runner's public key. """ + + issuer_url: Optional[str] = FieldInfo(alias="issuerUrl", default=None) + """ + issuer_url is used to override the authentication provider URL, if it doesn't + match the SCM host. + + +optional if not set, this account is owned by the installation. + """ diff --git a/src/gitpod/types/runners/configurations/scm_integration_update_params.py b/src/gitpod/types/runners/configurations/scm_integration_update_params.py index 94e14e06..706496de 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_update_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_update_params.py @@ -13,6 +13,12 @@ class ScmIntegrationUpdateParams(TypedDict, total=False): id: str + issuer_url: Annotated[Optional[str], PropertyInfo(alias="issuerUrl")] + """ + issuer_url can be set to override the authentication provider URL, if it doesn't + match the SCM host. + """ + oauth_client_id: Annotated[Optional[str], PropertyInfo(alias="oauthClientId")] """ oauth_client_id can be set to update the OAuth app's client ID. If an empty diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index f4f37882..4a5d70aa 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .task import Task as Task +from .gateway import Gateway as Gateway from .runs_on import RunsOn as RunsOn from .subject import Subject as Subject from .principal import Principal as Principal diff --git a/src/gitpod/types/shared/gateway.py b/src/gitpod/types/shared/gateway.py new file mode 100644 index 00000000..cae2976f --- /dev/null +++ b/src/gitpod/types/shared/gateway.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["Gateway"] + + +class Gateway(BaseModel): + name: str + """name is the human-readable name of the gateway. + + name is unique across all gateways. + """ + + url: str + """url of the gateway""" + + region: Optional[str] = None + """region is the geographical region where the gateway is located""" diff --git a/src/gitpod/types/shared/principal.py b/src/gitpod/types/shared/principal.py index bd0a3b97..5300b520 100644 --- a/src/gitpod/types/shared/principal.py +++ b/src/gitpod/types/shared/principal.py @@ -11,4 +11,5 @@ "PRINCIPAL_RUNNER", "PRINCIPAL_ENVIRONMENT", "PRINCIPAL_SERVICE_ACCOUNT", + "PRINCIPAL_RUNNER_MANAGER", ] diff --git a/src/gitpod/types/shared_params/principal.py b/src/gitpod/types/shared_params/principal.py index 1f2e22eb..3cefcfa1 100644 --- a/src/gitpod/types/shared_params/principal.py +++ b/src/gitpod/types/shared_params/principal.py @@ -13,4 +13,5 @@ "PRINCIPAL_RUNNER", "PRINCIPAL_ENVIRONMENT", "PRINCIPAL_SERVICE_ACCOUNT", + "PRINCIPAL_RUNNER_MANAGER", ] diff --git a/src/gitpod/types/usage_list_environment_sessions_params.py b/src/gitpod/types/usage_list_environment_runtime_records_params.py similarity index 82% rename from src/gitpod/types/usage_list_environment_sessions_params.py rename to src/gitpod/types/usage_list_environment_runtime_records_params.py index 8222547e..3f972435 100644 --- a/src/gitpod/types/usage_list_environment_sessions_params.py +++ b/src/gitpod/types/usage_list_environment_runtime_records_params.py @@ -8,10 +8,10 @@ from .._utils import PropertyInfo -__all__ = ["UsageListEnvironmentSessionsParams", "Filter", "FilterDateRange", "Pagination"] +__all__ = ["UsageListEnvironmentRuntimeRecordsParams", "Filter", "FilterDateRange", "Pagination"] -class UsageListEnvironmentSessionsParams(TypedDict, total=False): +class UsageListEnvironmentRuntimeRecordsParams(TypedDict, total=False): token: str page_size: Annotated[int, PropertyInfo(alias="pageSize")] @@ -33,10 +33,10 @@ class FilterDateRange(TypedDict, total=False): class Filter(TypedDict, total=False): date_range: Required[Annotated[FilterDateRange, PropertyInfo(alias="dateRange")]] - """Date range to query sessions within.""" + """Date range to query runtime records within.""" project_id: Annotated[str, PropertyInfo(alias="projectId")] - """Optional project ID to filter sessions by.""" + """Optional project ID to filter runtime records by.""" class Pagination(TypedDict, total=False): diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index 7ae176cd..6d7709f8 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -73,6 +73,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: maximum_running_environments_per_user="5", members_create_projects=True, members_require_projects=True, + port_sharing_disabled=True, ) assert_matches_type(object, policy, path=["response"]) @@ -162,6 +163,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> maximum_running_environments_per_user="5", members_create_projects=True, members_require_projects=True, + port_sharing_disabled=True, ) assert_matches_type(object, policy, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index a3c76eb7..a1685845 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -33,6 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( host="github.com", + issuer_url="issuerUrl", oauth_client_id="client_id", oauth_plaintext_client_secret="client_secret", pat=True, @@ -110,6 +111,7 @@ def test_method_update(self, client: Gitpod) -> None: def test_method_update_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + issuer_url="issuerUrl", oauth_client_id="new_client_id", oauth_plaintext_client_secret="new_client_secret", pat=True, @@ -231,6 +233,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( host="github.com", + issuer_url="issuerUrl", oauth_client_id="client_id", oauth_plaintext_client_secret="client_secret", pat=True, @@ -308,6 +311,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + issuer_url="issuerUrl", oauth_client_id="new_client_id", oauth_plaintext_client_secret="new_client_secret", pat=True, diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 8d88dc3b..8732d185 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -44,6 +44,7 @@ def test_method_validate_with_all_params(self, client: Gitpod) -> None: scm_integration={ "id": "integration-id", "host": "github.com", + "issuer_url": "issuerUrl", "oauth_client_id": "client_id", "oauth_encrypted_client_secret": "U3RhaW5sZXNzIHJvY2tz", "oauth_plaintext_client_secret": "client_secret", @@ -106,6 +107,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) scm_integration={ "id": "integration-id", "host": "github.com", + "issuer_url": "issuerUrl", "oauth_client_id": "client_id", "oauth_encrypted_client_secret": "U3RhaW5sZXNzIHJvY2tz", "oauth_plaintext_client_secret": "client_secret", diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 7aee8ed1..2cf8e691 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -13,6 +13,7 @@ LoginProvider, AccountRetrieveResponse, AccountGetSSOLoginURLResponse, + AccountListJoinableOrganizationsResponse, ) from gitpod.pagination import SyncLoginProvidersPage, AsyncLoginProvidersPage @@ -135,6 +136,44 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() + @parametrize + def test_method_list_joinable_organizations(self, client: Gitpod) -> None: + account = client.accounts.list_joinable_organizations() + assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_list_joinable_organizations_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.list_joinable_organizations( + token="token", + page_size=0, + empty=True, + ) + assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_list_joinable_organizations(self, client: Gitpod) -> None: + response = client.accounts.with_raw_response.list_joinable_organizations() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = response.parse() + assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_list_joinable_organizations(self, client: Gitpod) -> None: + with client.accounts.with_streaming_response.list_joinable_organizations() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = response.parse() + assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: @@ -294,6 +333,44 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True + @pytest.mark.skip() + @parametrize + async def test_method_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.list_joinable_organizations() + assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_list_joinable_organizations_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.list_joinable_organizations( + token="token", + page_size=0, + empty=True, + ) + assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: + response = await async_client.accounts.with_raw_response.list_joinable_organizations() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = await response.parse() + assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: + async with async_client.accounts.with_streaming_response.list_joinable_organizations() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = await response.parse() + assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip() @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index fb06565b..58a3580d 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -253,6 +253,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ + "archival_status": "ARCHIVAL_STATUS_UNSPECIFIED", "creator_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], @@ -608,6 +609,42 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip() + @parametrize + def test_method_unarchive(self, client: Gitpod) -> None: + environment = client.environments.unarchive() + assert_matches_type(object, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_unarchive_with_all_params(self, client: Gitpod) -> None: + environment = client.environments.unarchive( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(object, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_unarchive(self, client: Gitpod) -> None: + response = client.environments.with_raw_response.unarchive() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_unarchive(self, client: Gitpod) -> None: + with client.environments.with_streaming_response.unarchive() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncEnvironments: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -839,6 +876,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ + "archival_status": "ARCHIVAL_STATUS_UNSPECIFIED", "creator_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], @@ -1193,3 +1231,39 @@ async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: assert_matches_type(object, environment, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_unarchive(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.unarchive() + assert_matches_type(object, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_unarchive_with_all_params(self, async_client: AsyncGitpod) -> None: + environment = await async_client.environments.unarchive( + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(object, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_unarchive(self, async_client: AsyncGitpod) -> None: + response = await async_client.environments.with_raw_response.unarchive() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_unarchive(self, async_client: AsyncGitpod) -> None: + async with async_client.environments.with_streaming_response.unarchive() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment = await response.parse() + assert_matches_type(object, environment, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_gateways.py b/tests/api_resources/test_gateways.py new file mode 100644 index 00000000..c41f7fbc --- /dev/null +++ b/tests/api_resources/test_gateways.py @@ -0,0 +1,105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.pagination import SyncGatewaysPage, AsyncGatewaysPage +from gitpod.types.shared import Gateway + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestGateways: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + def test_method_list(self, client: Gitpod) -> None: + gateway = client.gateways.list() + assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + gateway = client.gateways.list( + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.gateways.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway = response.parse() + assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.gateways.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway = response.parse() + assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncGateways: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + gateway = await async_client.gateways.list() + assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + gateway = await async_client.gateways.list( + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.gateways.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway = await response.parse() + assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.gateways.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway = await response.parse() + assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index afbbc444..f20cf48d 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -38,6 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: kind="RUNNER_KIND_UNSPECIFIED", name="Production Runner", provider="RUNNER_PROVIDER_AWS_EC2", + runner_manager_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "configuration": { "auto_update": True, @@ -377,6 +378,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> kind="RUNNER_KIND_UNSPECIFIED", name="Production Runner", provider="RUNNER_PROVIDER_AWS_EC2", + runner_manager_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "configuration": { "auto_update": True, diff --git a/tests/api_resources/test_usage.py b/tests/api_resources/test_usage.py index 126ea4a6..9a005f95 100644 --- a/tests/api_resources/test_usage.py +++ b/tests/api_resources/test_usage.py @@ -9,9 +9,9 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import EnvironmentSession +from gitpod.types import EnvironmentUsageRecord from gitpod._utils import parse_datetime -from gitpod.pagination import SyncSessionsPage, AsyncSessionsPage +from gitpod.pagination import SyncRecordsPage, AsyncRecordsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,14 +21,14 @@ class TestUsage: @pytest.mark.skip() @parametrize - def test_method_list_environment_sessions(self, client: Gitpod) -> None: - usage = client.usage.list_environment_sessions() - assert_matches_type(SyncSessionsPage[EnvironmentSession], usage, path=["response"]) + def test_method_list_environment_runtime_records(self, client: Gitpod) -> None: + usage = client.usage.list_environment_runtime_records() + assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_environment_sessions_with_all_params(self, client: Gitpod) -> None: - usage = client.usage.list_environment_sessions( + def test_method_list_environment_runtime_records_with_all_params(self, client: Gitpod) -> None: + usage = client.usage.list_environment_runtime_records( token="token", page_size=0, filter={ @@ -43,27 +43,27 @@ def test_method_list_environment_sessions_with_all_params(self, client: Gitpod) "page_size": 100, }, ) - assert_matches_type(SyncSessionsPage[EnvironmentSession], usage, path=["response"]) + assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list_environment_sessions(self, client: Gitpod) -> None: - response = client.usage.with_raw_response.list_environment_sessions() + def test_raw_response_list_environment_runtime_records(self, client: Gitpod) -> None: + response = client.usage.with_raw_response.list_environment_runtime_records() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" usage = response.parse() - assert_matches_type(SyncSessionsPage[EnvironmentSession], usage, path=["response"]) + assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list_environment_sessions(self, client: Gitpod) -> None: - with client.usage.with_streaming_response.list_environment_sessions() as response: + def test_streaming_response_list_environment_runtime_records(self, client: Gitpod) -> None: + with client.usage.with_streaming_response.list_environment_runtime_records() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" usage = response.parse() - assert_matches_type(SyncSessionsPage[EnvironmentSession], usage, path=["response"]) + assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) assert cast(Any, response.is_closed) is True @@ -73,14 +73,14 @@ class TestAsyncUsage: @pytest.mark.skip() @parametrize - async def test_method_list_environment_sessions(self, async_client: AsyncGitpod) -> None: - usage = await async_client.usage.list_environment_sessions() - assert_matches_type(AsyncSessionsPage[EnvironmentSession], usage, path=["response"]) + async def test_method_list_environment_runtime_records(self, async_client: AsyncGitpod) -> None: + usage = await async_client.usage.list_environment_runtime_records() + assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_environment_sessions_with_all_params(self, async_client: AsyncGitpod) -> None: - usage = await async_client.usage.list_environment_sessions( + async def test_method_list_environment_runtime_records_with_all_params(self, async_client: AsyncGitpod) -> None: + usage = await async_client.usage.list_environment_runtime_records( token="token", page_size=0, filter={ @@ -95,26 +95,26 @@ async def test_method_list_environment_sessions_with_all_params(self, async_clie "page_size": 100, }, ) - assert_matches_type(AsyncSessionsPage[EnvironmentSession], usage, path=["response"]) + assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list_environment_sessions(self, async_client: AsyncGitpod) -> None: - response = await async_client.usage.with_raw_response.list_environment_sessions() + async def test_raw_response_list_environment_runtime_records(self, async_client: AsyncGitpod) -> None: + response = await async_client.usage.with_raw_response.list_environment_runtime_records() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" usage = await response.parse() - assert_matches_type(AsyncSessionsPage[EnvironmentSession], usage, path=["response"]) + assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list_environment_sessions(self, async_client: AsyncGitpod) -> None: - async with async_client.usage.with_streaming_response.list_environment_sessions() as response: + async def test_streaming_response_list_environment_runtime_records(self, async_client: AsyncGitpod) -> None: + async with async_client.usage.with_streaming_response.list_environment_runtime_records() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" usage = await response.parse() - assert_matches_type(AsyncSessionsPage[EnvironmentSession], usage, path=["response"]) + assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/test_client.py b/tests/test_client.py index 2dfdeca2..a2433c91 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -847,6 +847,33 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" + @pytest.mark.respx(base_url=base_url) + def test_follow_redirects(self, respx_mock: MockRouter) -> None: + # Test that the default follow_redirects=True allows following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) + + response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + + @pytest.mark.respx(base_url=base_url) + def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + # Test that follow_redirects=False prevents following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + + with pytest.raises(APIStatusError) as exc_info: + self.client.post( + "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response + ) + + assert exc_info.value.response.status_code == 302 + assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" + class TestAsyncGitpod: client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) @@ -1694,3 +1721,30 @@ async def test_main() -> None: raise AssertionError("calling get_platform using asyncify resulted in a hung process") time.sleep(0.1) + + @pytest.mark.respx(base_url=base_url) + async def test_follow_redirects(self, respx_mock: MockRouter) -> None: + # Test that the default follow_redirects=True allows following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) + + response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + + @pytest.mark.respx(base_url=base_url) + async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + # Test that follow_redirects=False prevents following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + + with pytest.raises(APIStatusError) as exc_info: + await self.client.post( + "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response + ) + + assert exc_info.value.response.status_code == 302 + assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py index a6465693..ec41af28 100644 --- a/tests/test_utils/test_proxy.py +++ b/tests/test_utils/test_proxy.py @@ -21,3 +21,14 @@ def test_recursive_proxy() -> None: assert dir(proxy) == [] assert type(proxy).__name__ == "RecursiveLazyProxy" assert type(operator.attrgetter("name.foo.bar.baz")(proxy)).__name__ == "RecursiveLazyProxy" + + +def test_isinstance_does_not_error() -> None: + class AlwaysErrorProxy(LazyProxy[Any]): + @override + def __load__(self) -> Any: + raise RuntimeError("Mocking missing dependency") + + proxy = AlwaysErrorProxy() + assert not isinstance(proxy, dict) + assert isinstance(proxy, LazyProxy) From eb56bfd104aed4cb16e9d29c629bdfd2dfa18adf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 08:19:24 +0000 Subject: [PATCH 167/505] feat(api): manual updates --- .stats.yml | 6 +++--- src/gitpod/resources/environments/environments.py | 4 ++-- src/gitpod/types/environment_update_params.py | 8 +++++++- tests/api_resources/test_environments.py | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index ac7c24ea..d375176e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 119 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c850a6432597255fc1b788ba21a0494162e639f41dd80c0f9d07def239d31865.yml -openapi_spec_hash: fba3f62e51d3ba39eea280abe29f39f1 -config_hash: 8e3b8fba844b78950ad4a13b75b7fffc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ca9a49ac7fbb63f55611fd7cd48a22a3ff8b38a797125c8513e891d9b7345550.yml +openapi_spec_hash: fd6ffbdfaefcc555e61ca1c565e05214 +config_hash: bb9d0a0bdadbee0985dd7c1e4f0e9e8a diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 93d9b105..e57316b8 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -243,7 +243,7 @@ def update( self, *, environment_id: str | NotGiven = NOT_GIVEN, - metadata: Optional[object] | NotGiven = NOT_GIVEN, + metadata: Optional[environment_update_params.Metadata] | NotGiven = NOT_GIVEN, spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1057,7 +1057,7 @@ async def update( self, *, environment_id: str | NotGiven = NOT_GIVEN, - metadata: Optional[object] | NotGiven = NOT_GIVEN, + metadata: Optional[environment_update_params.Metadata] | NotGiven = NOT_GIVEN, spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index dba8d011..60d7bfcf 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -11,6 +11,7 @@ __all__ = [ "EnvironmentUpdateParams", + "Metadata", "Spec", "SpecAutomationsFile", "SpecContent", @@ -28,11 +29,16 @@ class EnvironmentUpdateParams(TypedDict, total=False): +required """ - metadata: Optional[object] + metadata: Optional[Metadata] spec: Optional[Spec] +class Metadata(TypedDict, total=False): + name: Optional[str] + """name is the user-defined display name of the environment""" + + class SpecAutomationsFile(TypedDict, total=False): automations_file_path: Annotated[Optional[str], PropertyInfo(alias="automationsFilePath")] """ diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 58a3580d..979e659a 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -171,7 +171,7 @@ def test_method_update(self, client: Gitpod) -> None: def test_method_update_with_all_params(self, client: Gitpod) -> None: environment = client.environments.update( environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", - metadata={}, + metadata={"name": "name"}, spec={ "automations_file": { "automations_file_path": "automationsFilePath", @@ -794,7 +794,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", - metadata={}, + metadata={"name": "name"}, spec={ "automations_file": { "automations_file_path": "automationsFilePath", From e4b9f3b2376247906c1b8e085e8198004fe670e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 12:07:27 +0000 Subject: [PATCH 168/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b06ba919..6b7b74c5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.1" + ".": "0.3.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 39209aee..b9533a32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.2.1" +version = "0.3.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index c48ae7ae..1bd510f0 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.2.1" # x-release-please-version +__version__ = "0.3.0" # x-release-please-version From 3134776df2c50eae882afa0168b99179636d5557 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 02:13:58 +0000 Subject: [PATCH 169/505] chore(tests): run tests in parallel --- pyproject.toml | 3 ++- requirements-dev.lock | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b9533a32..3d4f8c12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ dev-dependencies = [ "importlib-metadata>=6.7.0", "rich>=13.7.1", "nest_asyncio==1.6.0", + "pytest-xdist>=3.6.1", ] [tool.rye.scripts] @@ -125,7 +126,7 @@ replacement = '[\1](https://github.com/gitpod-io/gitpod-sdk-python/tree/main/\g< [tool.pytest.ini_options] testpaths = ["tests"] -addopts = "--tb=short" +addopts = "--tb=short -n auto" xfail_strict = true asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "session" diff --git a/requirements-dev.lock b/requirements-dev.lock index 8e374b1a..ebdd437c 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -30,6 +30,8 @@ distro==1.8.0 exceptiongroup==1.2.2 # via anyio # via pytest +execnet==2.1.1 + # via pytest-xdist filelock==3.12.4 # via virtualenv h11==0.14.0 @@ -72,7 +74,9 @@ pygments==2.18.0 pyright==1.1.399 pytest==8.3.3 # via pytest-asyncio + # via pytest-xdist pytest-asyncio==0.24.0 +pytest-xdist==3.7.0 python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 From b01dba60217527d53d0b1e911132f36fd2e52703 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 02:38:58 +0000 Subject: [PATCH 170/505] fix(client): correctly parse binary response | stream --- src/gitpod/_base_client.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 34005d22..efec6f6c 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -1071,7 +1071,14 @@ def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, APIResponse): raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}") @@ -1574,7 +1581,14 @@ async def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, AsyncAPIResponse): raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}") From d312ce9c6467fd14315c7ac8ae94004a2b69afc0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 02:45:16 +0000 Subject: [PATCH 171/505] chore(tests): add tests for httpx client instantiation & proxies --- tests/test_client.py | 53 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index a2433c91..e59fd81f 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -27,7 +27,14 @@ from gitpod._models import BaseModel, FinalRequestOptions from gitpod._constants import RAW_RESPONSE_HEADER from gitpod._exceptions import GitpodError, APIStatusError, APITimeoutError, APIResponseValidationError -from gitpod._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options +from gitpod._base_client import ( + DEFAULT_TIMEOUT, + HTTPX_DEFAULT_TIMEOUT, + BaseClient, + DefaultHttpxClient, + DefaultAsyncHttpxClient, + make_request_options, +) from gitpod.types.identity_get_authenticated_identity_params import IdentityGetAuthenticatedIdentityParams from .utils import update_env @@ -847,6 +854,28 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" + def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects @@ -1722,6 +1751,28 @@ async def test_main() -> None: time.sleep(0.1) + async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultAsyncHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + async def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultAsyncHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) async def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects From 83052e058adf9c16364a2bb097ecd95151cf9a72 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 04:15:05 +0000 Subject: [PATCH 172/505] chore(internal): update conftest.py --- tests/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 2dc77cd3..3a3dba97 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + from __future__ import annotations import os From 07e7a421650bfc9dfd1c359e2e8f7c80b4ca109e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 06:46:31 +0000 Subject: [PATCH 173/505] chore(ci): enable for pull requests --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a15f2553..546e26b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,10 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: From 0b6c613025c2bd8c4581036f2a543bb6cda2b87e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 02:17:14 +0000 Subject: [PATCH 174/505] chore(readme): update badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4421881..1e1dea85 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gitpod Python API library -[![PyPI version](https://img.shields.io/pypi/v/gitpod-sdk.svg)](https://pypi.org/project/gitpod-sdk/) +[![PyPI version]()](https://pypi.org/project/gitpod-sdk/) The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, From b541374832ec5310aea1072f99cafee7d937f2ba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 05:54:17 +0000 Subject: [PATCH 175/505] fix(tests): fix: tests which call HTTP endpoints directly with the example parameters --- tests/test_client.py | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index e59fd81f..8d0b5a8d 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -23,9 +23,7 @@ from gitpod import Gitpod, AsyncGitpod, APIResponseValidationError from gitpod._types import Omit -from gitpod._utils import maybe_transform from gitpod._models import BaseModel, FinalRequestOptions -from gitpod._constants import RAW_RESPONSE_HEADER from gitpod._exceptions import GitpodError, APIStatusError, APITimeoutError, APIResponseValidationError from gitpod._base_client import ( DEFAULT_TIMEOUT, @@ -35,7 +33,6 @@ DefaultAsyncHttpxClient, make_request_options, ) -from gitpod.types.identity_get_authenticated_identity_params import IdentityGetAuthenticatedIdentityParams from .utils import update_env @@ -743,34 +740,23 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Gitpod) -> None: respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock( side_effect=httpx.TimeoutException("Test timeout error") ) with pytest.raises(APITimeoutError): - self.client.post( - "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, maybe_transform({}, IdentityGetAuthenticatedIdentityParams)), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + client.identity.with_streaming_response.get_authenticated_identity().__enter__() assert _get_open_connections(self.client) == 0 @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Gitpod) -> None: respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - self.client.post( - "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, maybe_transform({}, IdentityGetAuthenticatedIdentityParams)), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) - + client.identity.with_streaming_response.get_authenticated_identity().__enter__() assert _get_open_connections(self.client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -1592,34 +1578,23 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock( side_effect=httpx.TimeoutException("Test timeout error") ) with pytest.raises(APITimeoutError): - await self.client.post( - "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, maybe_transform({}, IdentityGetAuthenticatedIdentityParams)), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + await async_client.identity.with_streaming_response.get_authenticated_identity().__aenter__() assert _get_open_connections(self.client) == 0 @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: respx_mock.post("/gitpod.v1.IdentityService/GetAuthenticatedIdentity").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - await self.client.post( - "/gitpod.v1.IdentityService/GetAuthenticatedIdentity", - body=cast(object, maybe_transform({}, IdentityGetAuthenticatedIdentityParams)), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) - + await async_client.identity.with_streaming_response.get_authenticated_identity().__aenter__() assert _get_open_connections(self.client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) From 0fc6f8521431498aadeb6382ff63e338d65293bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Jun 2025 02:55:22 +0000 Subject: [PATCH 176/505] docs(client): fix httpx.Timeout documentation reference --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e1dea85..aae4b866 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ client.with_options(max_retries=5).identity.get_authenticated_identity() ### Timeouts By default requests time out after 1 minute. You can configure this with a `timeout` option, -which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: +which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object: ```python from gitpod import Gitpod From 8bfd9ce2f9b7a401c4bfaef76220f303dab5db94 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Jun 2025 04:14:16 +0000 Subject: [PATCH 177/505] feat(client): add support for aiohttp --- README.md | 32 ++++++++++++++ pyproject.toml | 2 + requirements-dev.lock | 27 ++++++++++++ requirements.lock | 27 ++++++++++++ src/gitpod/__init__.py | 3 +- src/gitpod/_base_client.py | 22 ++++++++++ .../automations/tasks/test_executions.py | 4 +- .../environments/automations/test_services.py | 4 +- .../environments/automations/test_tasks.py | 4 +- .../environments/test_automations.py | 4 +- .../environments/test_classes.py | 4 +- .../test_domain_verifications.py | 4 +- .../organizations/test_invites.py | 4 +- .../organizations/test_policies.py | 4 +- .../organizations/test_sso_configurations.py | 4 +- tests/api_resources/projects/test_policies.py | 4 +- .../test_environment_classes.py | 4 +- .../test_host_authentication_tokens.py | 4 +- .../runners/configurations/test_schema.py | 4 +- .../configurations/test_scm_integrations.py | 4 +- .../runners/test_configurations.py | 4 +- tests/api_resources/runners/test_policies.py | 4 +- tests/api_resources/test_accounts.py | 4 +- tests/api_resources/test_editors.py | 4 +- tests/api_resources/test_environments.py | 4 +- tests/api_resources/test_events.py | 4 +- tests/api_resources/test_gateways.py | 4 +- tests/api_resources/test_groups.py | 4 +- tests/api_resources/test_identity.py | 4 +- tests/api_resources/test_organizations.py | 4 +- tests/api_resources/test_projects.py | 4 +- tests/api_resources/test_runners.py | 4 +- tests/api_resources/test_secrets.py | 4 +- tests/api_resources/test_usage.py | 4 +- tests/api_resources/test_users.py | 4 +- tests/api_resources/users/test_dotfiles.py | 4 +- tests/api_resources/users/test_pats.py | 4 +- tests/conftest.py | 43 ++++++++++++++++--- 38 files changed, 242 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index aae4b866..44d3f237 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,38 @@ asyncio.run(main()) Functionality between the synchronous and asynchronous clients is otherwise identical. +### With aiohttp + +By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend. + +You can enable this by installing `aiohttp`: + +```sh +# install from PyPI +pip install gitpod-sdk[aiohttp] +``` + +Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: + +```python +import os +import asyncio +from gitpod import DefaultAioHttpClient +from gitpod import AsyncGitpod + + +async def main() -> None: + async with AsyncGitpod( + bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted + http_client=DefaultAioHttpClient(), + ) as client: + response = await client.identity.get_authenticated_identity() + print(response.organization_id) + + +asyncio.run(main()) +``` + ## Using types Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like: diff --git a/pyproject.toml b/pyproject.toml index 3d4f8c12..67cdbbd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,8 @@ classifiers = [ Homepage = "https://github.com/gitpod-io/gitpod-sdk-python" Repository = "https://github.com/gitpod-io/gitpod-sdk-python" +[project.optional-dependencies] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"] [tool.rye] managed = true diff --git a/requirements-dev.lock b/requirements-dev.lock index ebdd437c..670e9c42 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -10,6 +10,13 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.8 + # via gitpod-sdk + # via httpx-aiohttp +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 @@ -17,6 +24,10 @@ anyio==4.4.0 # via httpx argcomplete==3.1.2 # via nox +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx @@ -34,16 +45,23 @@ execnet==2.1.1 # via pytest-xdist filelock==3.12.4 # via virtualenv +frozenlist==1.6.2 + # via aiohttp + # via aiosignal h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx httpx==0.28.1 # via gitpod-sdk + # via httpx-aiohttp # via respx +httpx-aiohttp==0.1.6 + # via gitpod-sdk idna==3.4 # via anyio # via httpx + # via yarl importlib-metadata==7.0.0 iniconfig==2.0.0 # via pytest @@ -51,6 +69,9 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py +multidict==6.4.4 + # via aiohttp + # via yarl mypy==1.14.1 mypy-extensions==1.0.0 # via mypy @@ -65,6 +86,9 @@ platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 # via pytest +propcache==0.3.1 + # via aiohttp + # via yarl pydantic==2.10.3 # via gitpod-sdk pydantic-core==2.27.1 @@ -98,11 +122,14 @@ tomli==2.0.2 typing-extensions==4.12.2 # via anyio # via gitpod-sdk + # via multidict # via mypy # via pydantic # via pydantic-core # via pyright virtualenv==20.24.5 # via nox +yarl==1.20.0 + # via aiohttp zipp==3.17.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index b542a715..384f0efb 100644 --- a/requirements.lock +++ b/requirements.lock @@ -10,11 +10,22 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.8 + # via gitpod-sdk + # via httpx-aiohttp +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 # via gitpod-sdk # via httpx +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx @@ -22,15 +33,28 @@ distro==1.8.0 # via gitpod-sdk exceptiongroup==1.2.2 # via anyio +frozenlist==1.6.2 + # via aiohttp + # via aiosignal h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx httpx==0.28.1 # via gitpod-sdk + # via httpx-aiohttp +httpx-aiohttp==0.1.6 + # via gitpod-sdk idna==3.4 # via anyio # via httpx + # via yarl +multidict==6.4.4 + # via aiohttp + # via yarl +propcache==0.3.1 + # via aiohttp + # via yarl pydantic==2.10.3 # via gitpod-sdk pydantic-core==2.27.1 @@ -41,5 +65,8 @@ sniffio==1.3.0 typing-extensions==4.12.2 # via anyio # via gitpod-sdk + # via multidict # via pydantic # via pydantic-core +yarl==1.20.0 + # via aiohttp diff --git a/src/gitpod/__init__.py b/src/gitpod/__init__.py index ce63e16c..f2a5eb27 100644 --- a/src/gitpod/__init__.py +++ b/src/gitpod/__init__.py @@ -26,7 +26,7 @@ UnprocessableEntityError, APIResponseValidationError, ) -from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient +from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient from ._utils._logs import setup_logging as _setup_logging __all__ = [ @@ -68,6 +68,7 @@ "DEFAULT_CONNECTION_LIMITS", "DefaultHttpxClient", "DefaultAsyncHttpxClient", + "DefaultAioHttpClient", ] if not _t.TYPE_CHECKING: diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index efec6f6c..36aa633a 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -1289,6 +1289,24 @@ def __init__(self, **kwargs: Any) -> None: super().__init__(**kwargs) +try: + import httpx_aiohttp +except ImportError: + + class _DefaultAioHttpClient(httpx.AsyncClient): + def __init__(self, **_kwargs: Any) -> None: + raise RuntimeError("To use the aiohttp client you must have installed the package with the `aiohttp` extra") +else: + + class _DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + + super().__init__(**kwargs) + + if TYPE_CHECKING: DefaultAsyncHttpxClient = httpx.AsyncClient """An alias to `httpx.AsyncClient` that provides the same defaults that this SDK @@ -1297,8 +1315,12 @@ def __init__(self, **kwargs: Any) -> None: This is useful because overriding the `http_client` with your own instance of `httpx.AsyncClient` will result in httpx's defaults being used, not ours. """ + + DefaultAioHttpClient = httpx.AsyncClient + """An alias to `httpx.AsyncClient` that changes the default HTTP transport to `aiohttp`.""" else: DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient + DefaultAioHttpClient = _DefaultAioHttpClient class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index 1adffcca..aa72d5fd 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -142,7 +142,9 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncExecutions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index c64d5770..64db132c 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -354,7 +354,9 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: class TestAsyncServices: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index d9b63d44..3d97263b 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -302,7 +302,9 @@ def test_streaming_response_start(self, client: Gitpod) -> None: class TestAsyncTasks: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 5d9cff16..40362d68 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -90,7 +90,9 @@ def test_streaming_response_upsert(self, client: Gitpod) -> None: class TestAsyncAutomations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index ba3893e4..3049c13e 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -68,7 +68,9 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncClasses: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/organizations/test_domain_verifications.py b/tests/api_resources/organizations/test_domain_verifications.py index 3c2a0c00..b9e06da6 100644 --- a/tests/api_resources/organizations/test_domain_verifications.py +++ b/tests/api_resources/organizations/test_domain_verifications.py @@ -212,7 +212,9 @@ def test_streaming_response_verify(self, client: Gitpod) -> None: class TestAsyncDomainVerifications: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index 524b61cf..d1cc059e 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -125,7 +125,9 @@ def test_streaming_response_get_summary(self, client: Gitpod) -> None: class TestAsyncInvites: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index 6d7709f8..b539b9c5 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -105,7 +105,9 @@ def test_streaming_response_update(self, client: Gitpod) -> None: class TestAsyncPolicies: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 566d79f8..deba284d 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -234,7 +234,9 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncSSOConfigurations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index ff81a486..430b982c 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -179,7 +179,9 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncPolicies: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 1668612b..649e8077 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -195,7 +195,9 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncEnvironmentClasses: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 7667d3ca..0766e3a5 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -223,7 +223,9 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncHostAuthenticationTokens: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index 9d507253..828522fc 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -55,7 +55,9 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: class TestAsyncSchema: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index a1685845..d3c07900 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -220,7 +220,9 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncScmIntegrations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 8732d185..94422e13 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -78,7 +78,9 @@ def test_streaming_response_validate(self, client: Gitpod) -> None: class TestAsyncConfigurations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index b94c9fff..9f387dd8 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -179,7 +179,9 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: class TestAsyncPolicies: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 2cf8e691..7955675f 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -218,7 +218,9 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: class TestAsyncAccounts: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 4c77d22c..14b2938d 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -140,7 +140,9 @@ def test_streaming_response_resolve_url(self, client: Gitpod) -> None: class TestAsyncEditors: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 979e659a..861ebc42 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -647,7 +647,9 @@ def test_streaming_response_unarchive(self, client: Gitpod) -> None: class TestAsyncEnvironments: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index fa926d85..20a56a24 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -104,7 +104,9 @@ def test_streaming_response_watch(self, client: Gitpod) -> None: class TestAsyncEvents: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_gateways.py b/tests/api_resources/test_gateways.py index c41f7fbc..d4684fb9 100644 --- a/tests/api_resources/test_gateways.py +++ b/tests/api_resources/test_gateways.py @@ -61,7 +61,9 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncGateways: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index ed1c0380..e0f09363 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -61,7 +61,9 @@ def test_streaming_response_list(self, client: Gitpod) -> None: class TestAsyncGroups: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index bcc639d1..5fbbe491 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -132,7 +132,9 @@ def test_streaming_response_get_id_token(self, client: Gitpod) -> None: class TestAsyncIdentity: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index da165e0b..69138c98 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -348,7 +348,9 @@ def test_streaming_response_set_role(self, client: Gitpod) -> None: class TestAsyncOrganizations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index f33816b9..217408d1 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -301,7 +301,9 @@ def test_streaming_response_create_from_environment(self, client: Gitpod) -> Non class TestAsyncProjects: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index f20cf48d..5fc76d7f 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -363,7 +363,9 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: class TestAsyncRunners: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 02a47669..1b215c5d 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -226,7 +226,9 @@ def test_streaming_response_update_value(self, client: Gitpod) -> None: class TestAsyncSecrets: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_usage.py b/tests/api_resources/test_usage.py index 9a005f95..e92f8aee 100644 --- a/tests/api_resources/test_usage.py +++ b/tests/api_resources/test_usage.py @@ -69,7 +69,9 @@ def test_streaming_response_list_environment_runtime_records(self, client: Gitpo class TestAsyncUsage: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index b5875362..2c16986b 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -92,7 +92,9 @@ def test_streaming_response_set_suspended(self, client: Gitpod) -> None: class TestAsyncUsers: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/users/test_dotfiles.py b/tests/api_resources/users/test_dotfiles.py index ff40da72..1bb65b72 100644 --- a/tests/api_resources/users/test_dotfiles.py +++ b/tests/api_resources/users/test_dotfiles.py @@ -91,7 +91,9 @@ def test_streaming_response_set(self, client: Gitpod) -> None: class TestAsyncDotfiles: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index 34611629..c8e10826 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -134,7 +134,9 @@ def test_streaming_response_get(self, client: Gitpod) -> None: class TestAsyncPats: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/conftest.py b/tests/conftest.py index 3a3dba97..8697828c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,10 +6,12 @@ import logging from typing import TYPE_CHECKING, Iterator, AsyncIterator +import httpx import pytest from pytest_asyncio import is_async_test -from gitpod import Gitpod, AsyncGitpod +from gitpod import Gitpod, AsyncGitpod, DefaultAioHttpClient +from gitpod._utils import is_dict if TYPE_CHECKING: from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] @@ -27,6 +29,19 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: for async_test in pytest_asyncio_tests: async_test.add_marker(session_scope_marker, append=False) + # We skip tests that use both the aiohttp client and respx_mock as respx_mock + # doesn't support custom transports. + for item in items: + if "async_client" not in item.fixturenames or "respx_mock" not in item.fixturenames: + continue + + if not hasattr(item, "callspec"): + continue + + async_client_param = item.callspec.params.get("async_client") + if is_dict(async_client_param) and async_client_param.get("http_client") == "aiohttp": + item.add_marker(pytest.mark.skip(reason="aiohttp client is not compatible with respx_mock")) + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -45,9 +60,25 @@ def client(request: FixtureRequest) -> Iterator[Gitpod]: @pytest.fixture(scope="session") async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncGitpod]: - strict = getattr(request, "param", True) - if not isinstance(strict, bool): - raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - - async with AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: + param = getattr(request, "param", True) + + # defaults + strict = True + http_client: None | httpx.AsyncClient = None + + if isinstance(param, bool): + strict = param + elif is_dict(param): + strict = param.get("strict", True) + assert isinstance(strict, bool) + + http_client_type = param.get("http_client", "httpx") + if http_client_type == "aiohttp": + http_client = DefaultAioHttpClient() + else: + raise TypeError(f"Unexpected fixture parameter type {type(param)}, expected bool or dict") + + async with AsyncGitpod( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict, http_client=http_client + ) as client: yield client From 04c03a8d306228316976049c2f6fd0156009e894 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 04:35:44 +0000 Subject: [PATCH 178/505] chore(tests): skip some failing tests on the latest python versions --- tests/test_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 8d0b5a8d..911333e2 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -194,6 +194,7 @@ def test_copy_signature(self) -> None: copy_param = copy_signature.parameters.get(name) assert copy_param is not None, f"copy() signature is missing the {name} param" + @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") def test_copy_build_request(self) -> None: options = FinalRequestOptions(method="get", url="/foo") @@ -1028,6 +1029,7 @@ def test_copy_signature(self) -> None: copy_param = copy_signature.parameters.get(name) assert copy_param is not None, f"copy() signature is missing the {name} param" + @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") def test_copy_build_request(self) -> None: options = FinalRequestOptions(method="get", url="/foo") From 1decd6e367942aff7e455d447266e72ecdb92bdf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 02:39:03 +0000 Subject: [PATCH 179/505] =?UTF-8?q?fix(ci):=20release-doctor=20=E2=80=94?= =?UTF-8?q?=20report=20correct=20token=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/check-release-environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/check-release-environment b/bin/check-release-environment index 374fdaea..b845b0f4 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${PYPI_TOKEN}" ]; then - errors+=("The GITPOD_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") + errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi lenErrors=${#errors[@]} From cedceeca4543f6548c5f4b6eb196a399f3067266 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 28 Jun 2025 08:57:38 +0000 Subject: [PATCH 180/505] chore(ci): only run for pushes and fork pull requests --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 546e26b6..840334f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/gitpod-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -42,6 +43,7 @@ jobs: contents: read id-token: write runs-on: depot-ubuntu-24.04 + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -62,6 +64,7 @@ jobs: timeout-minutes: 10 name: test runs-on: ${{ github.repository == 'stainless-sdks/gitpod-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 From 9035babe3559719ed876fe9e86b9967dae4599a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 02:33:43 +0000 Subject: [PATCH 181/505] fix(ci): correct conditional --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 840334f6..3b59659d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,14 +36,13 @@ jobs: run: ./scripts/lint upload: - if: github.repository == 'stainless-sdks/gitpod-python' + if: github.repository == 'stainless-sdks/gitpod-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) timeout-minutes: 10 name: upload permissions: contents: read id-token: write runs-on: depot-ubuntu-24.04 - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 From 1f8abb7cb26524c5d4bfe73a1b1ef3d771069f09 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 05:23:17 +0000 Subject: [PATCH 182/505] chore(ci): change upload type --- .github/workflows/ci.yml | 18 ++++++++++++++++-- scripts/utils/upload-artifact.sh | 12 +++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b59659d..322b0f79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,10 +35,10 @@ jobs: - name: Run lints run: ./scripts/lint - upload: + build: if: github.repository == 'stainless-sdks/gitpod-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) timeout-minutes: 10 - name: upload + name: build permissions: contents: read id-token: write @@ -46,6 +46,20 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Install dependencies + run: rye sync --all-features + + - name: Run build + run: rye build + - name: Get GitHub OIDC Token id: github-oidc uses: actions/github-script@v6 diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index f50929ab..ea682938 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash set -exuo pipefail -RESPONSE=$(curl -X POST "$URL" \ +FILENAME=$(basename dist/*.whl) + +RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \ -H "Authorization: Bearer $AUTH" \ -H "Content-Type: application/json") @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ - -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) +UPLOAD_RESPONSE=$(curl -v -X PUT \ + -H "Content-Type: binary/octet-stream" \ + --data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/gitpod-python/$SHA'\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/gitpod-python/$SHA/$FILENAME'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 From 4b17b69433143636e1a1c862e33a3ae95335f096 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 02:17:55 +0000 Subject: [PATCH 183/505] chore(internal): codegen related update --- requirements-dev.lock | 2 +- requirements.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 670e9c42..f3a4e4fb 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -56,7 +56,7 @@ httpx==0.28.1 # via gitpod-sdk # via httpx-aiohttp # via respx -httpx-aiohttp==0.1.6 +httpx-aiohttp==0.1.8 # via gitpod-sdk idna==3.4 # via anyio diff --git a/requirements.lock b/requirements.lock index 384f0efb..ead19b93 100644 --- a/requirements.lock +++ b/requirements.lock @@ -43,7 +43,7 @@ httpcore==1.0.2 httpx==0.28.1 # via gitpod-sdk # via httpx-aiohttp -httpx-aiohttp==0.1.6 +httpx-aiohttp==0.1.8 # via gitpod-sdk idna==3.4 # via anyio From 172a45a786c74d5b971ae72f8f06826d6d87ea02 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 02:35:06 +0000 Subject: [PATCH 184/505] chore(internal): bump pinned h11 dep --- requirements-dev.lock | 4 ++-- requirements.lock | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index f3a4e4fb..d4964258 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -48,9 +48,9 @@ filelock==3.12.4 frozenlist==1.6.2 # via aiohttp # via aiosignal -h11==0.14.0 +h11==0.16.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.9 # via httpx httpx==0.28.1 # via gitpod-sdk diff --git a/requirements.lock b/requirements.lock index ead19b93..c0455c90 100644 --- a/requirements.lock +++ b/requirements.lock @@ -36,9 +36,9 @@ exceptiongroup==1.2.2 frozenlist==1.6.2 # via aiohttp # via aiosignal -h11==0.14.0 +h11==0.16.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.9 # via httpx httpx==0.28.1 # via gitpod-sdk From c977abbc5c0c3a1ba2b024920aa114f474ced635 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 02:55:03 +0000 Subject: [PATCH 185/505] chore(package): mark python 3.13 as supported --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 67cdbbd0..494c2b74 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", From 5e7b4ca2efbfdf3e63427c22695f6ef2c70b400a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 02:49:52 +0000 Subject: [PATCH 186/505] fix(parsing): correctly handle nested discriminated unions --- src/gitpod/_models.py | 13 ++++++++----- tests/test_models.py | 45 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 4f214980..528d5680 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -2,9 +2,10 @@ import os import inspect -from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast +from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast from datetime import date, datetime from typing_extensions import ( + List, Unpack, Literal, ClassVar, @@ -366,7 +367,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: if type_ is None: raise RuntimeError(f"Unexpected field type is None for {key}") - return construct_type(value=value, type_=type_) + return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) def is_basemodel(type_: type) -> bool: @@ -420,7 +421,7 @@ def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T: return cast(_T, construct_type(value=value, type_=type_)) -def construct_type(*, value: object, type_: object) -> object: +def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]] = None) -> object: """Loose coercion to the expected type with construction of nested values. If the given value does not match the expected type then it is returned as-is. @@ -438,8 +439,10 @@ def construct_type(*, value: object, type_: object) -> object: type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` - if is_annotated_type(type_): - meta: tuple[Any, ...] = get_args(type_)[1:] + if metadata is not None: + meta: tuple[Any, ...] = tuple(metadata) + elif is_annotated_type(type_): + meta = get_args(type_)[1:] type_ = extract_type_arg(type_, 0) else: meta = tuple() diff --git a/tests/test_models.py b/tests/test_models.py index 7813b824..26429e1e 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -889,3 +889,48 @@ class ModelB(BaseModel): ) assert isinstance(m, ModelB) + + +def test_nested_discriminated_union() -> None: + class InnerType1(BaseModel): + type: Literal["type_1"] + + class InnerModel(BaseModel): + inner_value: str + + class InnerType2(BaseModel): + type: Literal["type_2"] + some_inner_model: InnerModel + + class Type1(BaseModel): + base_type: Literal["base_type_1"] + value: Annotated[ + Union[ + InnerType1, + InnerType2, + ], + PropertyInfo(discriminator="type"), + ] + + class Type2(BaseModel): + base_type: Literal["base_type_2"] + + T = Annotated[ + Union[ + Type1, + Type2, + ], + PropertyInfo(discriminator="base_type"), + ] + + model = construct_type( + type_=T, + value={ + "base_type": "base_type_1", + "value": { + "type": "type_2", + }, + }, + ) + assert isinstance(model, Type1) + assert isinstance(model.value, InnerType2) From 0bb596f533df0defbb05910970f2f6bfe69ac6f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 03:24:03 +0000 Subject: [PATCH 187/505] chore(readme): fix version rendering on pypi --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44d3f237..1cb18256 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Gitpod Python API library -[![PyPI version]()](https://pypi.org/project/gitpod-sdk/) + +[![PyPI version](https://img.shields.io/pypi/v/gitpod-sdk.svg?label=pypi%20(stable))](https://pypi.org/project/gitpod-sdk/) The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, From a8e5ca660783bd51e2a4b56df44b0681b7a3b33e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Jul 2025 02:14:39 +0000 Subject: [PATCH 188/505] fix(client): don't send Content-Type header on GET requests --- pyproject.toml | 2 +- src/gitpod/_base_client.py | 11 +++++++++-- tests/test_client.py | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 494c2b74..5f4250e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/gitpod-io/gitpod-sdk-python" Repository = "https://github.com/gitpod-io/gitpod-sdk-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] [tool.rye] managed = true diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 36aa633a..550b73f0 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -529,6 +529,15 @@ def _build_request( # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + is_body_allowed = options.method.lower() != "get" + + if is_body_allowed: + kwargs["json"] = json_data if is_given(json_data) else None + kwargs["files"] = files + else: + headers.pop("Content-Type", None) + kwargs.pop("data", None) + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, @@ -540,8 +549,6 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data if is_given(json_data) else None, - files=files, **kwargs, ) diff --git a/tests/test_client.py b/tests/test_client.py index 911333e2..1c80f7b8 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -473,7 +473,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, client: Gitpod) -> None: request = client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, @@ -1308,7 +1308,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, async_client: AsyncGitpod) -> None: request = async_client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, From cf6d9f6ee90727ea38481e704d9a48d4f8ec74f5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 02:14:19 +0000 Subject: [PATCH 189/505] feat: clean up environment call outs --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 1cb18256..b5d56262 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,6 @@ pip install gitpod-sdk[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python -import os import asyncio from gitpod import DefaultAioHttpClient from gitpod import AsyncGitpod @@ -87,7 +86,7 @@ from gitpod import AsyncGitpod async def main() -> None: async with AsyncGitpod( - bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted + bearer_token="My Bearer Token", http_client=DefaultAioHttpClient(), ) as client: response = await client.identity.get_authenticated_identity() From 1d509b0617ae93b29f71c9eee34af304773799aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 02:17:20 +0000 Subject: [PATCH 190/505] fix(parsing): ignore empty metadata --- src/gitpod/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 528d5680..ffcbf67b 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -439,7 +439,7 @@ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any] type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` - if metadata is not None: + if metadata is not None and len(metadata) > 0: meta: tuple[Any, ...] = tuple(metadata) elif is_annotated_type(type_): meta = get_args(type_)[1:] From 597b04d73087339b4c7da78b12a5733fda6fd48a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 02:20:48 +0000 Subject: [PATCH 191/505] fix(parsing): parse extra field types --- src/gitpod/_models.py | 25 +++++++++++++++++++++++-- tests/test_models.py | 29 ++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index ffcbf67b..b8387ce9 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -208,14 +208,18 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] else: fields_values[name] = field_get_default(field) + extra_field_type = _get_extra_fields_type(__cls) + _extra = {} for key, value in values.items(): if key not in model_fields: + parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value + if PYDANTIC_V2: - _extra[key] = value + _extra[key] = parsed else: _fields_set.add(key) - fields_values[key] = value + fields_values[key] = parsed object.__setattr__(m, "__dict__", fields_values) @@ -370,6 +374,23 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) +def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: + if not PYDANTIC_V2: + # TODO + return None + + schema = cls.__pydantic_core_schema__ + if schema["type"] == "model": + fields = schema["schema"] + if fields["type"] == "model-fields": + extras = fields.get("extras_schema") + if extras and "cls" in extras: + # mypy can't narrow the type + return extras["cls"] # type: ignore[no-any-return] + + return None + + def is_basemodel(type_: type) -> bool: """Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`""" if is_union(type_): diff --git a/tests/test_models.py b/tests/test_models.py index 26429e1e..845989a6 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,5 +1,5 @@ import json -from typing import Any, Dict, List, Union, Optional, cast +from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast from datetime import datetime, timezone from typing_extensions import Literal, Annotated, TypeAliasType @@ -934,3 +934,30 @@ class Type2(BaseModel): ) assert isinstance(model, Type1) assert isinstance(model.value, InnerType2) + + +@pytest.mark.skipif(not PYDANTIC_V2, reason="this is only supported in pydantic v2 for now") +def test_extra_properties() -> None: + class Item(BaseModel): + prop: int + + class Model(BaseModel): + __pydantic_extra__: Dict[str, Item] = Field(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + other: str + + if TYPE_CHECKING: + + def __getattr__(self, attr: str) -> Item: ... + + model = construct_type( + type_=Model, + value={ + "a": {"prop": 1}, + "other": "foo", + }, + ) + assert isinstance(model, Model) + assert model.a.prop == 1 + assert isinstance(model.a, Item) + assert model.other == "foo" From f4915098c350c7bcafcc21dbeb0a792d29ea507e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 04:46:22 +0000 Subject: [PATCH 192/505] chore(project): add settings file for vscode --- .gitignore | 1 - .vscode/settings.json | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 87797408..95ceb189 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .prism.log -.vscode _dev __pycache__ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..5b010307 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.importFormat": "relative", +} From 31783681bd40db51f0d454c2cc7328f7e3f9efeb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 06:43:42 +0000 Subject: [PATCH 193/505] feat(client): support file upload requests --- src/gitpod/_base_client.py | 5 ++++- src/gitpod/_files.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 550b73f0..6c9d3918 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -532,7 +532,10 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - kwargs["json"] = json_data if is_given(json_data) else None + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/gitpod/_files.py b/src/gitpod/_files.py index 715cc207..cc14c14f 100644 --- a/src/gitpod/_files.py +++ b/src/gitpod/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() From d88be6e5d2eb934bfd1386126ec5beb140a8ef73 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 08:08:23 +0000 Subject: [PATCH 194/505] chore(internal): fix ruff target version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5f4250e2..6922c5c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -159,7 +159,7 @@ reportPrivateUsage = false [tool.ruff] line-length = 120 output-format = "grouped" -target-version = "py37" +target-version = "py38" [tool.ruff.format] docstring-code-format = true From b5dd0c33e16b4063da6c8b912390d199f86b0e33 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 04:53:03 +0000 Subject: [PATCH 195/505] chore: update @stainless-api/prism-cli to v5.15.0 --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index d2814ae6..0b28f6ea 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi From a06b81dbe408f5685b7808b9d027b2f4d66cc3f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 04:59:44 +0000 Subject: [PATCH 196/505] chore(internal): update comment in script --- scripts/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test b/scripts/test index 2b878456..dbeda2d2 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 From 79ae679ef94a8c047c22322d7456842516ff08bd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 17:12:49 +0000 Subject: [PATCH 197/505] feat(api): gitpod -> ona --- .github/workflows/ci.yml | 6 +- .stats.yml | 2 +- README.md | 2 +- SECURITY.md | 2 +- pyproject.toml | 3 +- src/gitpod/_models.py | 2 +- src/gitpod/_types.py | 36 +++- src/gitpod/_utils/__init__.py | 1 + src/gitpod/_utils/_transform.py | 6 + src/gitpod/_utils/_typing.py | 5 + .../environments/automations/tasks/tasks.py | 12 +- src/gitpod/resources/identity.py | 8 +- .../resources/organizations/policies.py | 8 +- src/gitpod/types/environment_list_params.py | 7 +- .../automations/service_list_params.py | 8 +- .../automations/task_create_params.py | 4 +- .../automations/task_list_params.py | 8 +- .../automations/task_update_params.py | 5 +- .../tasks/execution_list_params.py | 7 +- .../environments/automations_file_param.py | 3 +- .../types/environments/class_list_params.py | 3 +- src/gitpod/types/event_list_params.py | 5 +- .../types/identity_get_id_token_params.py | 4 +- src/gitpod/types/invite_domains_param.py | 5 +- .../organizations/policy_update_params.py | 5 +- src/gitpod/types/project_list_params.py | 4 +- src/gitpod/types/runner_list_params.py | 3 +- .../environment_class_list_params.py | 3 +- .../scm_integration_list_params.py | 4 +- src/gitpod/types/secret_list_params.py | 4 +- src/gitpod/types/shared_params/runs_on.py | 5 +- src/gitpod/types/users/pat_list_params.py | 4 +- .../automations/tasks/test_executions.py | 48 ++--- .../environments/automations/test_services.py | 112 +++++------ .../environments/automations/test_tasks.py | 96 ++++----- .../environments/test_automations.py | 16 +- .../environments/test_classes.py | 16 +- .../test_domain_verifications.py | 64 +++--- .../organizations/test_invites.py | 36 ++-- .../organizations/test_policies.py | 28 +-- .../organizations/test_sso_configurations.py | 68 +++---- tests/api_resources/projects/test_policies.py | 64 +++--- .../test_environment_classes.py | 64 +++--- .../test_host_authentication_tokens.py | 80 ++++---- .../runners/configurations/test_schema.py | 16 +- .../configurations/test_scm_integrations.py | 80 ++++---- .../runners/test_configurations.py | 16 +- tests/api_resources/runners/test_policies.py | 64 +++--- tests/api_resources/test_accounts.py | 76 ++++---- tests/api_resources/test_editors.py | 40 ++-- tests/api_resources/test_environments.py | 184 +++++++++--------- tests/api_resources/test_events.py | 32 +-- tests/api_resources/test_gateways.py | 16 +- tests/api_resources/test_groups.py | 16 +- tests/api_resources/test_identity.py | 48 ++--- tests/api_resources/test_organizations.py | 116 +++++------ tests/api_resources/test_projects.py | 96 ++++----- tests/api_resources/test_runners.py | 128 ++++++------ tests/api_resources/test_secrets.py | 80 ++++---- tests/api_resources/test_usage.py | 16 +- tests/api_resources/test_users.py | 32 +-- tests/api_resources/users/test_dotfiles.py | 32 +-- tests/api_resources/users/test_pats.py | 48 ++--- tests/utils.py | 10 +- 64 files changed, 1043 insertions(+), 979 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 322b0f79..d60bafb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,13 +36,13 @@ jobs: run: ./scripts/lint build: - if: github.repository == 'stainless-sdks/gitpod-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork timeout-minutes: 10 name: build permissions: contents: read id-token: write - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/gitpod-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -61,12 +61,14 @@ jobs: run: rye build - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/gitpod-python' id: github-oidc uses: actions/github-script@v6 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball + if: github.repository == 'stainless-sdks/gitpod-python' env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} diff --git a/.stats.yml b/.stats.yml index d375176e..6151d953 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 119 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ca9a49ac7fbb63f55611fd7cd48a22a3ff8b38a797125c8513e891d9b7345550.yml openapi_spec_hash: fd6ffbdfaefcc555e61ca1c565e05214 -config_hash: bb9d0a0bdadbee0985dd7c1e4f0e9e8a +config_hash: 4e185fe86d21ca21f2b484a2c647cc68 diff --git a/README.md b/README.md index b5d56262..ccfdae1d 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It is generated with [Stainless](https://www.stainless.com/). ## Documentation -The REST API documentation can be found on [docs.gitpod.io](https://docs.gitpod.io). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.ona.com](https://docs.ona.com). The full API of this library can be found in [api.md](api.md). ## Installation diff --git a/SECURITY.md b/SECURITY.md index efd90888..8975e827 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -20,7 +20,7 @@ or products provided by Gitpod, please follow the respective company's security ### Gitpod Terms and Policies -Please contact dev-feedback@gitpod.com for any questions or concerns regarding the security of our services. +Please contact dev-feedback@ona.com for any questions or concerns regarding the security of our services. --- diff --git a/pyproject.toml b/pyproject.toml index 6922c5c4..fa779412 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" authors = [ -{ name = "Gitpod", email = "dev-feedback@gitpod.com" }, +{ name = "Gitpod", email = "dev-feedback@ona.com" }, ] dependencies = [ "httpx>=0.23.0, <1", @@ -148,6 +148,7 @@ exclude = [ "_dev", ".venv", ".nox", + ".git", ] reportImplicitOverride = true diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index b8387ce9..92f7c10b 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -304,7 +304,7 @@ def model_dump( exclude_none=exclude_none, ) - return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped + return cast("dict[str, Any]", json_safe(dumped)) if mode == "json" else dumped @override def model_dump_json( diff --git a/src/gitpod/_types.py b/src/gitpod/_types.py index b5cea322..b5c5d596 100644 --- a/src/gitpod/_types.py +++ b/src/gitpod/_types.py @@ -13,10 +13,21 @@ Mapping, TypeVar, Callable, + Iterator, Optional, Sequence, ) -from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable +from typing_extensions import ( + Set, + Literal, + Protocol, + TypeAlias, + TypedDict, + SupportsIndex, + overload, + override, + runtime_checkable, +) import httpx import pydantic @@ -217,3 +228,26 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth follow_redirects: bool + + +_T_co = TypeVar("_T_co", covariant=True) + + +if TYPE_CHECKING: + # This works because str.__contains__ does not accept object (either in typeshed or at runtime) + # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + class SequenceNotStr(Protocol[_T_co]): + @overload + def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... + @overload + def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... + def __contains__(self, value: object, /) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T_co]: ... + def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... + def count(self, value: Any, /) -> int: ... + def __reversed__(self) -> Iterator[_T_co]: ... +else: + # just point this to a normal `Sequence` at runtime to avoid having to special case + # deserializing our custom sequence type + SequenceNotStr = Sequence diff --git a/src/gitpod/_utils/__init__.py b/src/gitpod/_utils/__init__.py index d4fda26f..ca547ce5 100644 --- a/src/gitpod/_utils/__init__.py +++ b/src/gitpod/_utils/__init__.py @@ -38,6 +38,7 @@ extract_type_arg as extract_type_arg, is_iterable_type as is_iterable_type, is_required_type as is_required_type, + is_sequence_type as is_sequence_type, is_annotated_type as is_annotated_type, is_type_alias_type as is_type_alias_type, strip_annotated_type as strip_annotated_type, diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index b0cc20a7..f0bcefd4 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -16,6 +16,7 @@ lru_cache, is_mapping, is_iterable, + is_sequence, ) from .._files import is_base64_file_input from ._typing import ( @@ -24,6 +25,7 @@ extract_type_arg, is_iterable_type, is_required_type, + is_sequence_type, is_annotated_type, strip_annotated_type, ) @@ -184,6 +186,8 @@ def _transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. @@ -346,6 +350,8 @@ async def _async_transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. diff --git a/src/gitpod/_utils/_typing.py b/src/gitpod/_utils/_typing.py index 1bac9542..845cd6b2 100644 --- a/src/gitpod/_utils/_typing.py +++ b/src/gitpod/_utils/_typing.py @@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool: return (get_origin(typ) or typ) == list +def is_sequence_type(typ: type) -> bool: + origin = get_origin(typ) or typ + return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence + + def is_iterable_type(typ: type) -> bool: """If the given type is `typing.Iterable[T]`""" origin = get_origin(typ) or typ diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index b8a1b225..6723fe8a 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -2,11 +2,9 @@ from __future__ import annotations -from typing import List - import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ....._utils import maybe_transform, async_maybe_transform from .executions import ( ExecutionsResource, @@ -71,7 +69,7 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse: def create( self, *, - depends_on: List[str] | NotGiven = NOT_GIVEN, + depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, metadata: TaskMetadata | NotGiven = NOT_GIVEN, spec: TaskSpec | NotGiven = NOT_GIVEN, @@ -203,7 +201,7 @@ def update( self, *, id: str | NotGiven = NOT_GIVEN, - depends_on: List[str] | NotGiven = NOT_GIVEN, + depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, spec: task_update_params.Spec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -488,7 +486,7 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: async def create( self, *, - depends_on: List[str] | NotGiven = NOT_GIVEN, + depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, metadata: TaskMetadata | NotGiven = NOT_GIVEN, spec: TaskSpec | NotGiven = NOT_GIVEN, @@ -620,7 +618,7 @@ async def update( self, *, id: str | NotGiven = NOT_GIVEN, - depends_on: List[str] | NotGiven = NOT_GIVEN, + depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, spec: task_update_params.Spec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index 25b859b5..dc4b0c30 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import List - import httpx from ..types import ( @@ -12,7 +10,7 @@ identity_exchange_token_params, identity_get_authenticated_identity_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -157,7 +155,7 @@ def get_authenticated_identity( def get_id_token( self, *, - audience: List[str] | NotGiven = NOT_GIVEN, + audience: SequenceNotStr[str] | NotGiven = NOT_GIVEN, version: IDTokenVersion | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -349,7 +347,7 @@ async def get_authenticated_identity( async def get_id_token( self, *, - audience: List[str] | NotGiven = NOT_GIVEN, + audience: SequenceNotStr[str] | NotGiven = NOT_GIVEN, version: IDTokenVersion | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index feb894c5..60124dc6 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -97,7 +97,7 @@ def update( self, *, organization_id: str, - allowed_editor_ids: List[str] | NotGiven = NOT_GIVEN, + allowed_editor_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, allow_local_runners: Optional[bool] | NotGiven = NOT_GIVEN, default_editor_id: Optional[str] | NotGiven = NOT_GIVEN, default_environment_image: Optional[str] | NotGiven = NOT_GIVEN, @@ -291,7 +291,7 @@ async def update( self, *, organization_id: str, - allowed_editor_ids: List[str] | NotGiven = NOT_GIVEN, + allowed_editor_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, allow_local_runners: Optional[bool] | NotGiven = NOT_GIVEN, default_editor_id: Optional[str] | NotGiven = NOT_GIVEN, default_environment_image: Optional[str] | NotGiven = NOT_GIVEN, diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index eedde71c..2e3ed79f 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -5,6 +5,7 @@ from typing import List, Optional from typing_extensions import Literal, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .runner_kind import RunnerKind from .environment_phase import EnvironmentPhase @@ -37,19 +38,19 @@ class Filter(TypedDict, total=False): ] """archival_status filters the response based on environment archive status""" - creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] """ creator_ids filters the response to only Environments created by specified members """ - project_ids: Annotated[List[str], PropertyInfo(alias="projectIds")] + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] """ project_ids filters the response to only Environments associated with the specified projects """ - runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] + runner_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="runnerIds")] """ runner_ids filters the response to only Environments running on these Runner IDs """ diff --git a/src/gitpod/types/environments/automations/service_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py index c2c08b03..76c8981d 100644 --- a/src/gitpod/types/environments/automations/service_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo __all__ = ["ServiceListParams", "Filter", "Pagination"] @@ -23,13 +23,13 @@ class ServiceListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + environment_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentIds")] """environment_ids filters the response to only services of these environments""" - references: List[str] + references: SequenceNotStr[str] """references filters the response to only services with these references""" - service_ids: Annotated[List[str], PropertyInfo(alias="serviceIds")] + service_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="serviceIds")] """service_ids filters the response to only services with these IDs""" diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index 5bb8916f..4258da77 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo from ...shared_params.task_spec import TaskSpec from ...shared_params.task_metadata import TaskMetadata @@ -13,7 +13,7 @@ class TaskCreateParams(TypedDict, total=False): - depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] + depends_on: Annotated[SequenceNotStr[str], PropertyInfo(alias="dependsOn")] environment_id: Annotated[str, PropertyInfo(alias="environmentId")] diff --git a/src/gitpod/types/environments/automations/task_list_params.py b/src/gitpod/types/environments/automations/task_list_params.py index 7afc694b..3dc576db 100644 --- a/src/gitpod/types/environments/automations/task_list_params.py +++ b/src/gitpod/types/environments/automations/task_list_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo __all__ = ["TaskListParams", "Filter", "Pagination"] @@ -23,13 +23,13 @@ class TaskListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + environment_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentIds")] """environment_ids filters the response to only tasks of these environments""" - references: List[str] + references: SequenceNotStr[str] """references filters the response to only services with these references""" - task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] + task_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="taskIds")] """task_ids filters the response to only tasks with these IDs""" diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index 4b0d59a9..43d66208 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo from ...shared_params.runs_on import RunsOn from ...shared_params.automation_trigger import AutomationTrigger @@ -15,7 +16,7 @@ class TaskUpdateParams(TypedDict, total=False): id: str - depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] + depends_on: Annotated[SequenceNotStr[str], PropertyInfo(alias="dependsOn")] """dependencies specifies the IDs of the automations this task depends on.""" metadata: Metadata diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_params.py b/src/gitpod/types/environments/automations/tasks/execution_list_params.py index 0441fb52..a8f517cc 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_list_params.py +++ b/src/gitpod/types/environments/automations/tasks/execution_list_params.py @@ -5,6 +5,7 @@ from typing import List from typing_extensions import Annotated, TypedDict +from ....._types import SequenceNotStr from ....._utils import PropertyInfo from ....shared.task_execution_phase import TaskExecutionPhase @@ -24,16 +25,16 @@ class ExecutionListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - environment_ids: Annotated[List[str], PropertyInfo(alias="environmentIds")] + environment_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentIds")] """environment_ids filters the response to only task runs of these environments""" phases: List[TaskExecutionPhase] """phases filters the response to only task runs in these phases""" - task_ids: Annotated[List[str], PropertyInfo(alias="taskIds")] + task_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="taskIds")] """task_ids filters the response to only task runs of these tasks""" - task_references: Annotated[List[str], PropertyInfo(alias="taskReferences")] + task_references: Annotated[SequenceNotStr[str], PropertyInfo(alias="taskReferences")] """task_references filters the response to only task runs with this reference""" diff --git a/src/gitpod/types/environments/automations_file_param.py b/src/gitpod/types/environments/automations_file_param.py index e2c0a7e3..977537ce 100644 --- a/src/gitpod/types/environments/automations_file_param.py +++ b/src/gitpod/types/environments/automations_file_param.py @@ -5,6 +5,7 @@ from typing import Dict, List from typing_extensions import Literal, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo from ..shared_params.runs_on import RunsOn @@ -58,7 +59,7 @@ class Services(TypedDict, total=False): class Tasks(TypedDict, total=False): command: str - depends_on: Annotated[List[str], PropertyInfo(alias="dependsOn")] + depends_on: Annotated[SequenceNotStr[str], PropertyInfo(alias="dependsOn")] description: str diff --git a/src/gitpod/types/environments/class_list_params.py b/src/gitpod/types/environments/class_list_params.py index 1abb82c8..c47afe5c 100644 --- a/src/gitpod/types/environments/class_list_params.py +++ b/src/gitpod/types/environments/class_list_params.py @@ -5,6 +5,7 @@ from typing import List, Optional from typing_extensions import Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo from ..runner_kind import RunnerKind from ..runner_provider import RunnerProvider @@ -38,7 +39,7 @@ class Filter(TypedDict, total=False): not set, all environment classes are returned. """ - runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] + runner_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="runnerIds")] """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] diff --git a/src/gitpod/types/event_list_params.py b/src/gitpod/types/event_list_params.py index f444df68..06af4ab5 100644 --- a/src/gitpod/types/event_list_params.py +++ b/src/gitpod/types/event_list_params.py @@ -5,6 +5,7 @@ from typing import List from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .resource_type import ResourceType from .shared.principal import Principal @@ -24,11 +25,11 @@ class EventListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - actor_ids: Annotated[List[str], PropertyInfo(alias="actorIds")] + actor_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="actorIds")] actor_principals: Annotated[List[Principal], PropertyInfo(alias="actorPrincipals")] - subject_ids: Annotated[List[str], PropertyInfo(alias="subjectIds")] + subject_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="subjectIds")] subject_types: Annotated[List[ResourceType], PropertyInfo(alias="subjectTypes")] diff --git a/src/gitpod/types/identity_get_id_token_params.py b/src/gitpod/types/identity_get_id_token_params.py index c5686ae4..289aadaa 100644 --- a/src/gitpod/types/identity_get_id_token_params.py +++ b/src/gitpod/types/identity_get_id_token_params.py @@ -2,16 +2,16 @@ from __future__ import annotations -from typing import List from typing_extensions import TypedDict +from .._types import SequenceNotStr from .id_token_version import IDTokenVersion __all__ = ["IdentityGetIDTokenParams"] class IdentityGetIDTokenParams(TypedDict, total=False): - audience: List[str] + audience: SequenceNotStr[str] version: IDTokenVersion """version is the version of the ID token.""" diff --git a/src/gitpod/types/invite_domains_param.py b/src/gitpod/types/invite_domains_param.py index d38601a1..e46b1254 100644 --- a/src/gitpod/types/invite_domains_param.py +++ b/src/gitpod/types/invite_domains_param.py @@ -2,12 +2,13 @@ from __future__ import annotations -from typing import List from typing_extensions import TypedDict +from .._types import SequenceNotStr + __all__ = ["InviteDomainsParam"] class InviteDomainsParam(TypedDict, total=False): - domains: List[str] + domains: SequenceNotStr[str] """domains is the list of domains that are allowed to join the organization""" diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index ca6b8ab7..acd315bd 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Required, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo __all__ = ["PolicyUpdateParams"] @@ -14,7 +15,7 @@ class PolicyUpdateParams(TypedDict, total=False): organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organization_id is the ID of the organization to update policies for""" - allowed_editor_ids: Annotated[List[str], PropertyInfo(alias="allowedEditorIds")] + allowed_editor_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="allowedEditorIds")] """ allowed_editor_ids is the list of editor IDs that are allowed to be used in the organization diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py index 4709a7ba..558a8338 100644 --- a/src/gitpod/types/project_list_params.py +++ b/src/gitpod/types/project_list_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["ProjectListParams", "Filter", "Pagination"] @@ -22,7 +22,7 @@ class ProjectListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - project_ids: Annotated[List[str], PropertyInfo(alias="projectIds")] + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] """project_ids filters the response to only projects with these IDs""" diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py index 7d2a9864..d013e9d5 100644 --- a/src/gitpod/types/runner_list_params.py +++ b/src/gitpod/types/runner_list_params.py @@ -5,6 +5,7 @@ from typing import List from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .runner_kind import RunnerKind from .runner_provider import RunnerProvider @@ -24,7 +25,7 @@ class RunnerListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - creator_ids: Annotated[List[str], PropertyInfo(alias="creatorIds")] + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] """creator_ids filters the response to only runner created by specified users""" kinds: List[RunnerKind] diff --git a/src/gitpod/types/runners/configurations/environment_class_list_params.py b/src/gitpod/types/runners/configurations/environment_class_list_params.py index 14cdf32d..f8f0b97c 100644 --- a/src/gitpod/types/runners/configurations/environment_class_list_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_params.py @@ -5,6 +5,7 @@ from typing import List, Optional from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo from ...runner_kind import RunnerKind from ...runner_provider import RunnerProvider @@ -38,7 +39,7 @@ class Filter(TypedDict, total=False): not set, all environment classes are returned. """ - runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] + runner_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="runnerIds")] """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_params.py b/src/gitpod/types/runners/configurations/scm_integration_list_params.py index 649b18ad..811ec9cd 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_list_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_list_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo __all__ = ["ScmIntegrationListParams", "Filter", "Pagination"] @@ -22,7 +22,7 @@ class ScmIntegrationListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] + runner_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="runnerIds")] """runner_ids filters the response to only SCM integrations of these Runner IDs""" diff --git a/src/gitpod/types/secret_list_params.py b/src/gitpod/types/secret_list_params.py index 44ab4bd5..0ecd8336 100644 --- a/src/gitpod/types/secret_list_params.py +++ b/src/gitpod/types/secret_list_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .secret_scope_param import SecretScopeParam @@ -23,7 +23,7 @@ class SecretListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - project_ids: Annotated[List[str], PropertyInfo(alias="projectIds")] + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] """ project_ids filters the response to only Secrets used by these Project IDs Deprecated: use scope instead. Values in project_ids will be ignored. diff --git a/src/gitpod/types/shared_params/runs_on.py b/src/gitpod/types/shared_params/runs_on.py index 55a079f3..733d8286 100644 --- a/src/gitpod/types/shared_params/runs_on.py +++ b/src/gitpod/types/shared_params/runs_on.py @@ -2,14 +2,15 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["RunsOn", "Docker"] class Docker(TypedDict, total=False): - environment: List[str] + environment: SequenceNotStr[str] image: str diff --git a/src/gitpod/types/users/pat_list_params.py b/src/gitpod/types/users/pat_list_params.py index b03f6d62..59e62161 100644 --- a/src/gitpod/types/users/pat_list_params.py +++ b/src/gitpod/types/users/pat_list_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo __all__ = ["PatListParams", "Filter", "Pagination"] @@ -21,7 +21,7 @@ class PatListParams(TypedDict, total=False): class Filter(TypedDict, total=False): - user_ids: Annotated[List[str], PropertyInfo(alias="userIds")] + user_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="userIds")] """ creator_ids filters the response to only Environments created by specified members diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index aa72d5fd..f4d55beb 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -21,13 +21,13 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve( @@ -35,7 +35,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -45,7 +45,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.retrieve() as response: @@ -57,13 +57,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list() assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list( @@ -82,7 +82,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.list() @@ -92,7 +92,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -104,13 +104,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_stop(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop( @@ -118,7 +118,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.stop() @@ -128,7 +128,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.stop() as response: @@ -146,13 +146,13 @@ class TestAsyncExecutions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve( @@ -160,7 +160,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -170,7 +170,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -184,13 +184,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list() assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list( @@ -209,7 +209,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.list() @@ -219,7 +219,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -231,13 +231,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop( @@ -245,7 +245,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.stop() @@ -255,7 +255,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 64db132c..d4b9aebc 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -23,13 +23,13 @@ class TestServices: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: service = client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.create( @@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.create() @@ -80,7 +80,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.create() as response: @@ -92,13 +92,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve( @@ -106,7 +106,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.retrieve() @@ -116,7 +116,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -128,13 +128,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: service = client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( @@ -175,7 +175,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.update() @@ -185,7 +185,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.update() as response: @@ -197,13 +197,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: service = client.environments.automations.services.list() assert_matches_type(SyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.list( @@ -221,7 +221,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.list() @@ -231,7 +231,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(SyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.list() as response: @@ -243,13 +243,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: service = client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.delete( @@ -258,7 +258,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.delete() @@ -268,7 +268,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.delete() as response: @@ -280,13 +280,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_start(self, client: Gitpod) -> None: service = client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.start( @@ -294,7 +294,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.start() @@ -304,7 +304,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.start() as response: @@ -316,13 +316,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_stop(self, client: Gitpod) -> None: service = client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.stop( @@ -330,7 +330,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.stop() @@ -340,7 +340,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.stop() as response: @@ -358,13 +358,13 @@ class TestAsyncServices: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create( @@ -405,7 +405,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.create() @@ -415,7 +415,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.create() as response: @@ -427,13 +427,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve( @@ -441,7 +441,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.retrieve() @@ -451,7 +451,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -463,13 +463,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( @@ -510,7 +510,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.update() @@ -520,7 +520,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.update() as response: @@ -532,13 +532,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list() assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( @@ -556,7 +556,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.list() @@ -566,7 +566,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.list() as response: @@ -578,13 +578,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete( @@ -593,7 +593,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.delete() @@ -603,7 +603,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.delete() as response: @@ -615,13 +615,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start( @@ -629,7 +629,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.start() @@ -639,7 +639,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.start() as response: @@ -651,13 +651,13 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop( @@ -665,7 +665,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.stop() @@ -675,7 +675,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 3d97263b..58ec8c1d 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -24,13 +24,13 @@ class TestTasks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create( @@ -65,7 +65,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.create() @@ -75,7 +75,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.create() as response: @@ -87,13 +87,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( @@ -101,7 +101,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.retrieve() @@ -111,7 +111,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -123,13 +123,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( @@ -160,7 +160,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.update() @@ -170,7 +170,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.update() as response: @@ -182,13 +182,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list() assert_matches_type(SyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( @@ -206,7 +206,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.list() @@ -216,7 +216,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(SyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.list() as response: @@ -228,13 +228,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete( @@ -242,7 +242,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.delete() @@ -252,7 +252,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -264,13 +264,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_start(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start( @@ -278,7 +278,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.start() @@ -288,7 +288,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.start() as response: @@ -306,13 +306,13 @@ class TestAsyncTasks: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create( @@ -347,7 +347,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.create() @@ -357,7 +357,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.create() as response: @@ -369,13 +369,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( @@ -383,7 +383,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.retrieve() @@ -393,7 +393,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -405,13 +405,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( @@ -442,7 +442,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.update() @@ -452,7 +452,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.update() as response: @@ -464,13 +464,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list() assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( @@ -488,7 +488,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.list() @@ -498,7 +498,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.list() as response: @@ -510,13 +510,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete( @@ -524,7 +524,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.delete() @@ -534,7 +534,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -546,13 +546,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start( @@ -560,7 +560,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.start() @@ -570,7 +570,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.start() as response: diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 40362d68..8a2f0551 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -17,13 +17,13 @@ class TestAutomations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_upsert(self, client: Gitpod) -> None: automation = client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_upsert_with_all_params(self, client: Gitpod) -> None: automation = client.environments.automations.upsert( @@ -66,7 +66,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_upsert(self, client: Gitpod) -> None: response = client.environments.automations.with_raw_response.upsert() @@ -76,7 +76,7 @@ def test_raw_response_upsert(self, client: Gitpod) -> None: automation = response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_upsert(self, client: Gitpod) -> None: with client.environments.automations.with_streaming_response.upsert() as response: @@ -94,13 +94,13 @@ class TestAsyncAutomations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_upsert(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert( @@ -143,7 +143,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.with_raw_response.upsert() @@ -153,7 +153,7 @@ async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: automation = await response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.with_streaming_response.upsert() as response: diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index 3049c13e..9f70511b 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -18,13 +18,13 @@ class TestClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: class_ = client.environments.classes.list() assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: class_ = client.environments.classes.list( @@ -44,7 +44,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.classes.with_raw_response.list() @@ -54,7 +54,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: class_ = response.parse() assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.classes.with_streaming_response.list() as response: @@ -72,13 +72,13 @@ class TestAsyncClasses: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list() assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list( @@ -98,7 +98,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.classes.with_raw_response.list() @@ -108,7 +108,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: class_ = await response.parse() assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/organizations/test_domain_verifications.py b/tests/api_resources/organizations/test_domain_verifications.py index b9e06da6..c6c7043e 100644 --- a/tests/api_resources/organizations/test_domain_verifications.py +++ b/tests/api_resources/organizations/test_domain_verifications.py @@ -23,7 +23,7 @@ class TestDomainVerifications: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.create( @@ -32,7 +32,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.create( @@ -45,7 +45,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.create( @@ -60,7 +60,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.retrieve( @@ -68,7 +68,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.retrieve( @@ -80,7 +80,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.retrieve( @@ -94,7 +94,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.list( @@ -102,7 +102,7 @@ def test_method_list(self, client: Gitpod) -> None: ) assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.list( @@ -116,7 +116,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.list( @@ -128,7 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.list( @@ -142,7 +142,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(object, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_verify(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.verify( @@ -184,7 +184,7 @@ def test_method_verify(self, client: Gitpod) -> None: ) assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_verify(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.verify( @@ -196,7 +196,7 @@ def test_raw_response_verify(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_verify(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.verify( @@ -216,7 +216,7 @@ class TestAsyncDomainVerifications: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.create( @@ -225,7 +225,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.create( @@ -238,7 +238,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.create( @@ -253,7 +253,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.retrieve( @@ -261,7 +261,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.retrieve( @@ -273,7 +273,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.retrieve( @@ -287,7 +287,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.list( @@ -295,7 +295,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.list( @@ -309,7 +309,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.list( @@ -321,7 +321,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.list( @@ -337,7 +337,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.delete( @@ -345,7 +345,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.delete( @@ -357,7 +357,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(object, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.delete( @@ -371,7 +371,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_verify(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.verify( @@ -379,7 +379,7 @@ async def test_method_verify(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.verify( @@ -391,7 +391,7 @@ async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_verify(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.verify( diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index d1cc059e..df2e8805 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -21,7 +21,7 @@ class TestInvites: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: invite = client.organizations.invites.create( @@ -29,7 +29,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.create( @@ -41,7 +41,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.create( @@ -55,7 +55,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve( @@ -63,7 +63,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.retrieve( @@ -75,7 +75,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.retrieve( @@ -89,7 +89,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_summary(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( @@ -97,7 +97,7 @@ def test_method_get_summary(self, client: Gitpod) -> None: ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get_summary(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.get_summary( @@ -109,7 +109,7 @@ def test_raw_response_get_summary(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get_summary(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.get_summary( @@ -129,7 +129,7 @@ class TestAsyncInvites: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create( @@ -137,7 +137,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.create( @@ -149,7 +149,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.create( @@ -163,7 +163,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve( @@ -171,7 +171,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.retrieve( @@ -183,7 +183,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.retrieve( @@ -197,7 +197,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( @@ -205,7 +205,7 @@ async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.get_summary( @@ -217,7 +217,7 @@ async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None invite = await response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.get_summary( diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index b539b9c5..cf7c13ff 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -17,7 +17,7 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: policy = client.organizations.policies.retrieve( @@ -25,7 +25,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.policies.with_raw_response.retrieve( @@ -37,7 +37,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.policies.with_streaming_response.retrieve( @@ -51,7 +51,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.organizations.policies.update( @@ -59,7 +59,7 @@ def test_method_update(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.organizations.policies.update( @@ -77,7 +77,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.policies.with_raw_response.update( @@ -89,7 +89,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.policies.with_streaming_response.update( @@ -109,7 +109,7 @@ class TestAsyncPolicies: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: policy = await async_client.organizations.policies.retrieve( @@ -117,7 +117,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.policies.with_raw_response.retrieve( @@ -129,7 +129,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.policies.with_streaming_response.retrieve( @@ -143,7 +143,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.organizations.policies.update( @@ -151,7 +151,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.organizations.policies.update( @@ -169,7 +169,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.policies.with_raw_response.update( @@ -181,7 +181,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.policies.with_streaming_response.update( diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index deba284d..415fd137 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -22,7 +22,7 @@ class TestSSOConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( @@ -34,7 +34,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.create( @@ -50,7 +50,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.create( @@ -68,7 +68,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( @@ -76,7 +76,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.retrieve( @@ -88,7 +88,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.retrieve( @@ -102,7 +102,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -110,7 +110,7 @@ def test_method_update(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -124,7 +124,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -136,7 +136,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -150,7 +150,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( @@ -158,7 +158,7 @@ def test_method_list(self, client: Gitpod) -> None: ) assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( @@ -172,7 +172,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.list( @@ -184,7 +184,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.list( @@ -198,7 +198,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete( @@ -206,7 +206,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.delete( @@ -218,7 +218,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.delete( @@ -238,7 +238,7 @@ class TestAsyncSSOConfigurations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( @@ -250,7 +250,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.create( @@ -266,7 +266,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.create( @@ -284,7 +284,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( @@ -292,7 +292,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.retrieve( @@ -304,7 +304,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.retrieve( @@ -318,7 +318,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -326,7 +326,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -340,7 +340,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -352,7 +352,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -366,7 +366,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( @@ -374,7 +374,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( @@ -388,7 +388,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.list( @@ -400,7 +400,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.list( @@ -414,7 +414,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete( @@ -422,7 +422,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.delete( @@ -434,7 +434,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.delete( diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index 430b982c..17b49580 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -22,13 +22,13 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.create() @@ -48,7 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.create() as response: @@ -60,13 +60,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( @@ -76,7 +76,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.update() @@ -86,7 +86,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.update() as response: @@ -98,13 +98,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.projects.policies.list() assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.list( @@ -118,7 +118,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.list() @@ -128,7 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.list() as response: @@ -140,13 +140,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.delete( @@ -155,7 +155,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.delete() @@ -165,7 +165,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.delete() as response: @@ -183,13 +183,13 @@ class TestAsyncPolicies: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create( @@ -199,7 +199,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.create() @@ -209,7 +209,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.create() as response: @@ -221,13 +221,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update( @@ -237,7 +237,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.update() @@ -247,7 +247,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.update() as response: @@ -259,13 +259,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list() assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list( @@ -279,7 +279,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.list() @@ -289,7 +289,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.list() as response: @@ -301,13 +301,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete( @@ -316,7 +316,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.delete() @@ -326,7 +326,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 649e8077..919e93d8 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -22,13 +22,13 @@ class TestEnvironmentClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create( @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.create() @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -70,13 +70,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( @@ -84,7 +84,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -94,7 +94,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.retrieve() as response: @@ -106,13 +106,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -123,7 +123,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update() @@ -133,7 +133,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update() as response: @@ -145,13 +145,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list() assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list( @@ -171,7 +171,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.list() @@ -181,7 +181,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.list() as response: @@ -199,13 +199,13 @@ class TestAsyncEnvironmentClasses: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create( @@ -225,7 +225,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.create() @@ -235,7 +235,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -247,13 +247,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( @@ -261,7 +261,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -271,7 +271,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -285,13 +285,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -302,7 +302,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update() @@ -312,7 +312,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update() as response: @@ -324,13 +324,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list() assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list( @@ -350,7 +350,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.list() @@ -360,7 +360,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 0766e3a5..3e24dbc1 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -23,13 +23,13 @@ class TestHostAuthenticationTokens: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create( @@ -43,7 +43,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.create() as response: @@ -65,13 +65,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( @@ -79,7 +79,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -89,7 +89,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: @@ -101,13 +101,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -118,7 +118,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update() @@ -128,7 +128,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update() as response: @@ -140,13 +140,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list() assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list( @@ -163,7 +163,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -173,7 +173,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.list() as response: @@ -185,13 +185,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( @@ -199,7 +199,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -209,7 +209,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.delete() as response: @@ -227,13 +227,13 @@ class TestAsyncHostAuthenticationTokens: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( @@ -247,7 +247,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -257,7 +257,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with ( @@ -271,13 +271,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( @@ -285,7 +285,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -295,7 +295,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -309,13 +309,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -326,7 +326,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update() @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with ( @@ -350,13 +350,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list() assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( @@ -373,7 +373,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -383,7 +383,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with ( @@ -397,13 +397,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( @@ -411,7 +411,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -421,7 +421,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with ( diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index 828522fc..e83271f8 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -17,13 +17,13 @@ class TestSchema: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( @@ -31,7 +31,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.schema.with_raw_response.retrieve() @@ -41,7 +41,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: schema = response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.schema.with_streaming_response.retrieve() as response: @@ -59,13 +59,13 @@ class TestAsyncSchema: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( @@ -73,7 +73,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.schema.with_raw_response.retrieve() @@ -83,7 +83,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: schema = await response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.schema.with_streaming_response.retrieve() as response: diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index d3c07900..36bf74fd 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -22,13 +22,13 @@ class TestScmIntegrations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create() @@ -52,7 +52,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create() as response: @@ -64,13 +64,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( @@ -78,7 +78,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -88,7 +88,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -100,13 +100,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -118,7 +118,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update() @@ -128,7 +128,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update() as response: @@ -140,13 +140,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list() assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list( @@ -160,7 +160,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.list() @@ -170,7 +170,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -182,13 +182,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete( @@ -196,7 +196,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -206,7 +206,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: @@ -224,13 +224,13 @@ class TestAsyncScmIntegrations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( @@ -244,7 +244,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create() @@ -254,7 +254,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create() as response: @@ -266,13 +266,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( @@ -280,7 +280,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -290,7 +290,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -302,13 +302,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -320,7 +320,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update() @@ -330,7 +330,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update() as response: @@ -342,13 +342,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list() assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list( @@ -362,7 +362,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.list() @@ -372,7 +372,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -384,13 +384,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete( @@ -398,7 +398,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -408,7 +408,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 94422e13..cebba5e7 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -17,13 +17,13 @@ class TestConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_validate(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_validate_with_all_params(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -54,7 +54,7 @@ def test_method_validate_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_validate(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate() @@ -64,7 +64,7 @@ def test_raw_response_validate(self, client: Gitpod) -> None: configuration = response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_validate(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate() as response: @@ -82,13 +82,13 @@ class TestAsyncConfigurations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_validate(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -119,7 +119,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_validate(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate() @@ -129,7 +129,7 @@ async def test_raw_response_validate(self, async_client: AsyncGitpod) -> None: configuration = await response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_validate(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate() as response: diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index 9f387dd8..8fa81fa5 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -22,13 +22,13 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.create() @@ -48,7 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.create() as response: @@ -60,13 +60,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( @@ -76,7 +76,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.update() @@ -86,7 +86,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.update() as response: @@ -98,13 +98,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.runners.policies.list() assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.list( @@ -118,7 +118,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.list() @@ -128,7 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.list() as response: @@ -140,13 +140,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.delete( @@ -155,7 +155,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.delete() @@ -165,7 +165,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.delete() as response: @@ -183,13 +183,13 @@ class TestAsyncPolicies: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( @@ -199,7 +199,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.create() @@ -209,7 +209,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.create() as response: @@ -221,13 +221,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( @@ -237,7 +237,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.update() @@ -247,7 +247,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.update() as response: @@ -259,13 +259,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list() assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( @@ -279,7 +279,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.list() @@ -289,7 +289,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.list() as response: @@ -301,13 +301,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete( @@ -316,7 +316,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.delete() @@ -326,7 +326,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 7955675f..31390ba9 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -23,13 +23,13 @@ class TestAccounts: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: account = client.accounts.retrieve() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: account = client.accounts.retrieve( @@ -37,7 +37,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.retrieve() @@ -47,7 +47,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.retrieve() as response: @@ -59,7 +59,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: account = client.accounts.delete( @@ -67,7 +67,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.delete( @@ -79,7 +79,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.delete( @@ -93,7 +93,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -101,7 +101,7 @@ def test_method_get_sso_login_url(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -110,7 +110,7 @@ def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.get_sso_login_url( @@ -122,7 +122,7 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.get_sso_login_url( @@ -136,13 +136,13 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_joinable_organizations(self, client: Gitpod) -> None: account = client.accounts.list_joinable_organizations() assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_joinable_organizations_with_all_params(self, client: Gitpod) -> None: account = client.accounts.list_joinable_organizations( @@ -152,7 +152,7 @@ def test_method_list_joinable_organizations_with_all_params(self, client: Gitpod ) assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_joinable_organizations(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.list_joinable_organizations() @@ -162,7 +162,7 @@ def test_raw_response_list_joinable_organizations(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_joinable_organizations(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.list_joinable_organizations() as response: @@ -174,13 +174,13 @@ def test_streaming_response_list_joinable_organizations(self, client: Gitpod) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: account = client.accounts.list_login_providers() assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> None: account = client.accounts.list_login_providers( @@ -194,7 +194,7 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No ) assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_login_providers(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.list_login_providers() @@ -204,7 +204,7 @@ def test_raw_response_list_login_providers(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.list_login_providers() as response: @@ -222,13 +222,13 @@ class TestAsyncAccounts: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve( @@ -236,7 +236,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.retrieve() @@ -246,7 +246,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: account = await response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.retrieve() as response: @@ -258,7 +258,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete( @@ -266,7 +266,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.delete( @@ -278,7 +278,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: account = await response.parse() assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.delete( @@ -292,7 +292,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -300,7 +300,7 @@ async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -309,7 +309,7 @@ async def test_method_get_sso_login_url_with_all_params(self, async_client: Asyn ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.get_sso_login_url( @@ -321,7 +321,7 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - account = await response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.get_sso_login_url( @@ -335,13 +335,13 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_joinable_organizations() assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_joinable_organizations_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_joinable_organizations( @@ -351,7 +351,7 @@ async def test_method_list_joinable_organizations_with_all_params(self, async_cl ) assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.list_joinable_organizations() @@ -361,7 +361,7 @@ async def test_raw_response_list_joinable_organizations(self, async_client: Asyn account = await response.parse() assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.list_joinable_organizations() as response: @@ -373,13 +373,13 @@ async def test_streaming_response_list_joinable_organizations(self, async_client assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers() assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_login_providers_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers( @@ -393,7 +393,7 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A ) assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.list_login_providers() @@ -403,7 +403,7 @@ async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod account = await response.parse() assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_login_providers(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.list_login_providers() as response: diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 14b2938d..45b7012c 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -22,7 +22,7 @@ class TestEditors: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: editor = client.editors.retrieve( @@ -30,7 +30,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.editors.with_raw_response.retrieve( @@ -42,7 +42,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.editors.with_streaming_response.retrieve( @@ -56,13 +56,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: editor = client.editors.list() assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: editor = client.editors.list( @@ -76,7 +76,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.editors.with_raw_response.list() @@ -86,7 +86,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.editors.with_streaming_response.list() as response: @@ -98,7 +98,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_resolve_url(self, client: Gitpod) -> None: editor = client.editors.resolve_url( @@ -108,7 +108,7 @@ def test_method_resolve_url(self, client: Gitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: response = client.editors.with_raw_response.resolve_url( @@ -122,7 +122,7 @@ def test_raw_response_resolve_url(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_resolve_url(self, client: Gitpod) -> None: with client.editors.with_streaming_response.resolve_url( @@ -144,7 +144,7 @@ class TestAsyncEditors: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( @@ -152,7 +152,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.retrieve( @@ -164,7 +164,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.retrieve( @@ -178,13 +178,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list() assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list( @@ -198,7 +198,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.list() @@ -208,7 +208,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.list() as response: @@ -220,7 +220,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( @@ -230,7 +230,7 @@ async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.resolve_url( @@ -244,7 +244,7 @@ async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None editor = await response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.resolve_url( diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 861ebc42..d7876b0e 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -26,13 +26,13 @@ class TestEnvironments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: environment = client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( @@ -104,7 +104,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create() @@ -114,7 +114,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create() as response: @@ -126,7 +126,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment = client.environments.retrieve( @@ -134,7 +134,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.with_raw_response.retrieve( @@ -146,7 +146,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.with_streaming_response.retrieve( @@ -160,13 +160,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: environment = client.environments.update() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: environment = client.environments.update( @@ -218,7 +218,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update() @@ -228,7 +228,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update() as response: @@ -240,13 +240,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: environment = client.environments.list() assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( @@ -267,7 +267,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.with_raw_response.list() @@ -277,7 +277,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.with_streaming_response.list() as response: @@ -289,13 +289,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: environment = client.environments.delete() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: environment = client.environments.delete( @@ -304,7 +304,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.with_raw_response.delete() @@ -314,7 +314,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.with_streaming_response.delete() as response: @@ -326,7 +326,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_environment_token(self, client: Gitpod) -> None: environment = client.environments.create_environment_token( @@ -334,7 +334,7 @@ def test_method_create_environment_token(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create_environment_token(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_environment_token( @@ -346,7 +346,7 @@ def test_raw_response_create_environment_token(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create_environment_token(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_environment_token( @@ -360,13 +360,13 @@ def test_streaming_response_create_environment_token(self, client: Gitpod) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: environment = client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( @@ -439,7 +439,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create_from_project(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_from_project() @@ -449,7 +449,7 @@ def test_raw_response_create_from_project(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create_from_project(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_from_project() as response: @@ -461,13 +461,13 @@ def test_streaming_response_create_from_project(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_logs_token(self, client: Gitpod) -> None: environment = client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_logs_token( @@ -475,7 +475,7 @@ def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create_logs_token(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_logs_token() @@ -485,7 +485,7 @@ def test_raw_response_create_logs_token(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_logs_token() as response: @@ -497,13 +497,13 @@ def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_mark_active(self, client: Gitpod) -> None: environment = client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: environment = client.environments.mark_active( @@ -515,7 +515,7 @@ def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_mark_active(self, client: Gitpod) -> None: response = client.environments.with_raw_response.mark_active() @@ -525,7 +525,7 @@ def test_raw_response_mark_active(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_mark_active(self, client: Gitpod) -> None: with client.environments.with_streaming_response.mark_active() as response: @@ -537,13 +537,13 @@ def test_streaming_response_mark_active(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_start(self, client: Gitpod) -> None: environment = client.environments.start() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( @@ -551,7 +551,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.with_raw_response.start() @@ -561,7 +561,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.with_streaming_response.start() as response: @@ -573,13 +573,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_stop(self, client: Gitpod) -> None: environment = client.environments.stop() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: environment = client.environments.stop( @@ -587,7 +587,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.with_raw_response.stop() @@ -597,7 +597,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.with_streaming_response.stop() as response: @@ -609,13 +609,13 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_unarchive(self, client: Gitpod) -> None: environment = client.environments.unarchive() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_unarchive_with_all_params(self, client: Gitpod) -> None: environment = client.environments.unarchive( @@ -623,7 +623,7 @@ def test_method_unarchive_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_unarchive(self, client: Gitpod) -> None: response = client.environments.with_raw_response.unarchive() @@ -633,7 +633,7 @@ def test_raw_response_unarchive(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_unarchive(self, client: Gitpod) -> None: with client.environments.with_streaming_response.unarchive() as response: @@ -651,13 +651,13 @@ class TestAsyncEnvironments: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( @@ -729,7 +729,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create() @@ -739,7 +739,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create() as response: @@ -751,7 +751,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( @@ -759,7 +759,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.retrieve( @@ -771,7 +771,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.retrieve( @@ -785,13 +785,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( @@ -843,7 +843,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update() @@ -853,7 +853,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update() as response: @@ -865,13 +865,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list() assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( @@ -892,7 +892,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.list() @@ -902,7 +902,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.list() as response: @@ -914,13 +914,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete( @@ -929,7 +929,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.delete() @@ -939,7 +939,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.delete() as response: @@ -951,7 +951,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_environment_token(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_environment_token( @@ -959,7 +959,7 @@ async def test_method_create_environment_token(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create_environment_token(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_environment_token( @@ -971,7 +971,7 @@ async def test_raw_response_create_environment_token(self, async_client: AsyncGi environment = await response.parse() assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create_environment_token(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_environment_token( @@ -985,13 +985,13 @@ async def test_streaming_response_create_environment_token(self, async_client: A assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( @@ -1064,7 +1064,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_from_project() @@ -1074,7 +1074,7 @@ async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) environment = await response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create_from_project(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_from_project() as response: @@ -1086,13 +1086,13 @@ async def test_streaming_response_create_from_project(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token( @@ -1100,7 +1100,7 @@ async def test_method_create_logs_token_with_all_params(self, async_client: Asyn ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_logs_token() @@ -1110,7 +1110,7 @@ async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_logs_token() as response: @@ -1122,13 +1122,13 @@ async def test_streaming_response_create_logs_token(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active( @@ -1140,7 +1140,7 @@ async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.mark_active() @@ -1150,7 +1150,7 @@ async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.mark_active() as response: @@ -1162,13 +1162,13 @@ async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( @@ -1176,7 +1176,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.start() @@ -1186,7 +1186,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.start() as response: @@ -1198,13 +1198,13 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop( @@ -1212,7 +1212,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.stop() @@ -1222,7 +1222,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.stop() as response: @@ -1234,13 +1234,13 @@ async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_unarchive(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.unarchive() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_unarchive_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.unarchive( @@ -1248,7 +1248,7 @@ async def test_method_unarchive_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_unarchive(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.unarchive() @@ -1258,7 +1258,7 @@ async def test_raw_response_unarchive(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_unarchive(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.unarchive() as response: diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 20a56a24..64aff13d 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -19,13 +19,13 @@ class TestEvents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: event = client.events.list() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: event = client.events.list( @@ -44,7 +44,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.events.with_raw_response.list() @@ -54,7 +54,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: event = response.parse() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.events.with_streaming_response.list() as response: @@ -66,13 +66,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") + @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") @parametrize def test_method_watch(self, client: Gitpod) -> None: event_stream = client.events.watch() assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") + @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") @parametrize def test_method_watch_with_all_params(self, client: Gitpod) -> None: event_stream = client.events.watch( @@ -81,7 +81,7 @@ def test_method_watch_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") + @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") @parametrize def test_raw_response_watch(self, client: Gitpod) -> None: response = client.events.with_raw_response.watch() @@ -90,7 +90,7 @@ def test_raw_response_watch(self, client: Gitpod) -> None: stream = response.parse() stream.close() - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") + @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") @parametrize def test_streaming_response_watch(self, client: Gitpod) -> None: with client.events.with_streaming_response.watch() as response: @@ -108,13 +108,13 @@ class TestAsyncEvents: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list( @@ -133,7 +133,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.list() @@ -143,7 +143,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: event = await response.parse() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.list() as response: @@ -155,13 +155,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") + @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") @parametrize async def test_method_watch(self, async_client: AsyncGitpod) -> None: event_stream = await async_client.events.watch() assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") + @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") @parametrize async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> None: event_stream = await async_client.events.watch( @@ -170,7 +170,7 @@ async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") + @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") @parametrize async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.watch() @@ -179,7 +179,7 @@ async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None: stream = await response.parse() await stream.close() - @pytest.mark.skip(reason="Prism doesn't support JSONL responses yet") + @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") @parametrize async def test_streaming_response_watch(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.watch() as response: diff --git a/tests/api_resources/test_gateways.py b/tests/api_resources/test_gateways.py index d4684fb9..b18ceec7 100644 --- a/tests/api_resources/test_gateways.py +++ b/tests/api_resources/test_gateways.py @@ -18,13 +18,13 @@ class TestGateways: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: gateway = client.gateways.list() assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: gateway = client.gateways.list( @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.gateways.with_raw_response.list() @@ -47,7 +47,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: gateway = response.parse() assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.gateways.with_streaming_response.list() as response: @@ -65,13 +65,13 @@ class TestAsyncGateways: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: gateway = await async_client.gateways.list() assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: gateway = await async_client.gateways.list( @@ -84,7 +84,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.gateways.with_raw_response.list() @@ -94,7 +94,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: gateway = await response.parse() assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.gateways.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index e0f09363..dd784b4e 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -18,13 +18,13 @@ class TestGroups: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: group = client.groups.list() assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: group = client.groups.list( @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.groups.with_raw_response.list() @@ -47,7 +47,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: group = response.parse() assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.groups.with_streaming_response.list() as response: @@ -65,13 +65,13 @@ class TestAsyncGroups: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list() assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list( @@ -84,7 +84,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.with_raw_response.list() @@ -94,7 +94,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: group = await response.parse() assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.groups.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index 5fbbe491..de7afdff 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -21,13 +21,13 @@ class TestIdentity: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_exchange_token(self, client: Gitpod) -> None: identity = client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.exchange_token( @@ -35,7 +35,7 @@ def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_exchange_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.exchange_token() @@ -45,7 +45,7 @@ def test_raw_response_exchange_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_exchange_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.exchange_token() as response: @@ -57,13 +57,13 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_authenticated_identity(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( @@ -71,7 +71,7 @@ def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_authenticated_identity() @@ -81,7 +81,7 @@ def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_authenticated_identity() as response: @@ -93,13 +93,13 @@ def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_id_token(self, client: Gitpod) -> None: identity = client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( @@ -108,7 +108,7 @@ def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get_id_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_id_token() @@ -118,7 +118,7 @@ def test_raw_response_get_id_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get_id_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_id_token() as response: @@ -136,13 +136,13 @@ class TestAsyncIdentity: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token( @@ -150,7 +150,7 @@ async def test_method_exchange_token_with_all_params(self, async_client: AsyncGi ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.exchange_token() @@ -160,7 +160,7 @@ async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> N identity = await response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.exchange_token() as response: @@ -172,13 +172,13 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( @@ -186,7 +186,7 @@ async def test_method_get_authenticated_identity_with_all_params(self, async_cli ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_authenticated_identity() @@ -196,7 +196,7 @@ async def test_raw_response_get_authenticated_identity(self, async_client: Async identity = await response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_authenticated_identity() as response: @@ -208,13 +208,13 @@ async def test_streaming_response_get_authenticated_identity(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( @@ -223,7 +223,7 @@ async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_id_token() @@ -233,7 +233,7 @@ async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> Non identity = await response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_id_token() as response: diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 69138c98..ff2df938 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -24,7 +24,7 @@ class TestOrganizations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: organization = client.organizations.create( @@ -32,7 +32,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.create( @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.create( @@ -54,7 +54,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.create( @@ -68,7 +68,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: organization = client.organizations.retrieve( @@ -76,7 +76,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.retrieve( @@ -88,7 +88,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.retrieve( @@ -102,7 +102,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -110,7 +110,7 @@ def test_method_update(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -120,7 +120,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( @@ -132,7 +132,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( @@ -146,7 +146,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: organization = client.organizations.delete( @@ -154,7 +154,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.delete( @@ -166,7 +166,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.delete( @@ -180,13 +180,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_join(self, client: Gitpod) -> None: organization = client.organizations.join() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_join_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.join( @@ -195,7 +195,7 @@ def test_method_join_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_join(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join() @@ -205,7 +205,7 @@ def test_raw_response_join(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_join(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join() as response: @@ -217,7 +217,7 @@ def test_streaming_response_join(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_leave(self, client: Gitpod) -> None: organization = client.organizations.leave( @@ -225,7 +225,7 @@ def test_method_leave(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.leave( @@ -237,7 +237,7 @@ def test_raw_response_leave(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.leave( @@ -251,7 +251,7 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_members(self, client: Gitpod) -> None: organization = client.organizations.list_members( @@ -259,7 +259,7 @@ def test_method_list_members(self, client: Gitpod) -> None: ) assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( @@ -273,7 +273,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list_members( @@ -285,7 +285,7 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list_members( @@ -299,7 +299,7 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_set_role(self, client: Gitpod) -> None: organization = client.organizations.set_role( @@ -308,7 +308,7 @@ def test_method_set_role(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( @@ -318,7 +318,7 @@ def test_method_set_role_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.set_role( @@ -331,7 +331,7 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.set_role( @@ -352,7 +352,7 @@ class TestAsyncOrganizations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( @@ -360,7 +360,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( @@ -370,7 +370,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.create( @@ -382,7 +382,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.create( @@ -396,7 +396,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( @@ -404,7 +404,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.retrieve( @@ -416,7 +416,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.retrieve( @@ -430,7 +430,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -438,7 +438,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -448,7 +448,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( @@ -460,7 +460,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( @@ -474,7 +474,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete( @@ -482,7 +482,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.delete( @@ -494,7 +494,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.delete( @@ -508,13 +508,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_join(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_join_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( @@ -523,7 +523,7 @@ async def test_method_join_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_join(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join() @@ -533,7 +533,7 @@ async def test_raw_response_join(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_join(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join() as response: @@ -545,7 +545,7 @@ async def test_streaming_response_join(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( @@ -553,7 +553,7 @@ async def test_method_leave(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.leave( @@ -565,7 +565,7 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.leave( @@ -579,7 +579,7 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( @@ -587,7 +587,7 @@ async def test_method_list_members(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( @@ -601,7 +601,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list_members( @@ -613,7 +613,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non organization = await response.parse() assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list_members( @@ -627,7 +627,7 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( @@ -636,7 +636,7 @@ async def test_method_set_role(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( @@ -646,7 +646,7 @@ async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.set_role( @@ -659,7 +659,7 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.set_role( diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 217408d1..217a8453 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -24,7 +24,7 @@ class TestProjects: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( @@ -33,7 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( @@ -62,7 +62,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( @@ -75,7 +75,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( @@ -90,13 +90,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: project = client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( @@ -104,7 +104,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.projects.with_raw_response.retrieve() @@ -114,7 +114,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.projects.with_streaming_response.retrieve() as response: @@ -126,13 +126,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: project = client.projects.update() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: project = client.projects.update( @@ -162,7 +162,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update() @@ -172,7 +172,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update() as response: @@ -184,13 +184,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: project = client.projects.list() assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: project = client.projects.list( @@ -204,7 +204,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.with_raw_response.list() @@ -214,7 +214,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.with_streaming_response.list() as response: @@ -226,13 +226,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: project = client.projects.delete() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: project = client.projects.delete( @@ -240,7 +240,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.with_raw_response.delete() @@ -250,7 +250,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.with_streaming_response.delete() as response: @@ -262,13 +262,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: project = client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( @@ -277,7 +277,7 @@ def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create_from_environment(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create_from_environment() @@ -287,7 +287,7 @@ def test_raw_response_create_from_environment(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create_from_environment(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create_from_environment() as response: @@ -305,7 +305,7 @@ class TestAsyncProjects: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -314,7 +314,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -343,7 +343,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( @@ -356,7 +356,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create( @@ -371,13 +371,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( @@ -385,7 +385,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.retrieve() @@ -395,7 +395,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.retrieve() as response: @@ -407,13 +407,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -443,7 +443,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update() @@ -453,7 +453,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update() as response: @@ -465,13 +465,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list() assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list( @@ -485,7 +485,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.list() @@ -495,7 +495,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.list() as response: @@ -507,13 +507,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete( @@ -521,7 +521,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.delete() @@ -531,7 +531,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.delete() as response: @@ -543,13 +543,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( @@ -558,7 +558,7 @@ async def test_method_create_from_environment_with_all_params(self, async_client ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create_from_environment(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create_from_environment() @@ -568,7 +568,7 @@ async def test_raw_response_create_from_environment(self, async_client: AsyncGit project = await response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create_from_environment(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create_from_environment() as response: diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 5fc76d7f..56e374ae 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -25,13 +25,13 @@ class TestRunners: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: runner = client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( @@ -58,7 +58,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create() @@ -68,7 +68,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create() as response: @@ -80,13 +80,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: runner = client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( @@ -94,7 +94,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.with_raw_response.retrieve() @@ -104,7 +104,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.with_streaming_response.retrieve() as response: @@ -116,13 +116,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: runner = client.runners.update() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: runner = client.runners.update( @@ -146,7 +146,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update() @@ -156,7 +156,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update() as response: @@ -168,13 +168,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: runner = client.runners.list() assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list( @@ -192,7 +192,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.with_raw_response.list() @@ -202,7 +202,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.with_streaming_response.list() as response: @@ -214,13 +214,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: runner = client.runners.delete() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete( @@ -229,7 +229,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.with_raw_response.delete() @@ -239,7 +239,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.with_streaming_response.delete() as response: @@ -251,13 +251,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_check_authentication_for_host(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( @@ -266,7 +266,7 @@ def test_method_check_authentication_for_host_with_all_params(self, client: Gitp ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: response = client.runners.with_raw_response.check_authentication_for_host() @@ -276,7 +276,7 @@ def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> Non runner = response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: with client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -288,13 +288,13 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: runner = client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( @@ -302,7 +302,7 @@ def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create_runner_token(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create_runner_token() @@ -312,7 +312,7 @@ def test_raw_response_create_runner_token(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create_runner_token() as response: @@ -324,13 +324,13 @@ def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_parse_context_url(self, client: Gitpod) -> None: runner = client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( @@ -339,7 +339,7 @@ def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_parse_context_url(self, client: Gitpod) -> None: response = client.runners.with_raw_response.parse_context_url() @@ -349,7 +349,7 @@ def test_raw_response_parse_context_url(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: with client.runners.with_streaming_response.parse_context_url() as response: @@ -367,13 +367,13 @@ class TestAsyncRunners: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( @@ -400,7 +400,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create() @@ -410,7 +410,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create() as response: @@ -422,13 +422,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( @@ -436,7 +436,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.retrieve() @@ -446,7 +446,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.retrieve() as response: @@ -458,13 +458,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( @@ -488,7 +488,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update() @@ -498,7 +498,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update() as response: @@ -510,13 +510,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list() assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( @@ -534,7 +534,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.list() @@ -544,7 +544,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.list() as response: @@ -556,13 +556,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete( @@ -571,7 +571,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.delete() @@ -581,7 +581,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.delete() as response: @@ -593,13 +593,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( @@ -608,7 +608,7 @@ async def test_method_check_authentication_for_host_with_all_params(self, async_ ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.check_authentication_for_host() @@ -618,7 +618,7 @@ async def test_raw_response_check_authentication_for_host(self, async_client: As runner = await response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -630,13 +630,13 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( @@ -644,7 +644,7 @@ async def test_method_create_runner_token_with_all_params(self, async_client: As ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create_runner_token() @@ -654,7 +654,7 @@ async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) runner = await response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create_runner_token() as response: @@ -666,13 +666,13 @@ async def test_streaming_response_create_runner_token(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( @@ -681,7 +681,7 @@ async def test_method_parse_context_url_with_all_params(self, async_client: Asyn ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.parse_context_url() @@ -691,7 +691,7 @@ async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.parse_context_url() as response: diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 1b215c5d..ddaaae29 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -22,13 +22,13 @@ class TestSecrets: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: secret = client.secrets.create() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create() @@ -55,7 +55,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create() as response: @@ -67,13 +67,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: secret = client.secrets.list() assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.list( @@ -93,7 +93,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.list() @@ -103,7 +103,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.list() as response: @@ -115,13 +115,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: secret = client.secrets.delete() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.delete( @@ -129,7 +129,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.delete() @@ -139,7 +139,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.delete() as response: @@ -151,13 +151,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_value(self, client: Gitpod) -> None: secret = client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.get_value( @@ -165,7 +165,7 @@ def test_method_get_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.get_value() @@ -175,7 +175,7 @@ def test_raw_response_get_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.get_value() as response: @@ -187,13 +187,13 @@ def test_streaming_response_get_value(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_value(self, client: Gitpod) -> None: secret = client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.update_value( @@ -202,7 +202,7 @@ def test_method_update_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.update_value() @@ -212,7 +212,7 @@ def test_raw_response_update_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.update_value() as response: @@ -230,13 +230,13 @@ class TestAsyncSecrets: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -253,7 +253,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create() @@ -263,7 +263,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create() as response: @@ -275,13 +275,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list() assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list( @@ -301,7 +301,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.list() @@ -311,7 +311,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.list() as response: @@ -323,13 +323,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete( @@ -337,7 +337,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.delete() @@ -347,7 +347,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.delete() as response: @@ -359,13 +359,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value( @@ -373,7 +373,7 @@ async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.get_value() @@ -383,7 +383,7 @@ async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.get_value() as response: @@ -395,13 +395,13 @@ async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value( @@ -410,7 +410,7 @@ async def test_method_update_value_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.update_value() @@ -420,7 +420,7 @@ async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> Non secret = await response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.update_value() as response: diff --git a/tests/api_resources/test_usage.py b/tests/api_resources/test_usage.py index e92f8aee..a203b817 100644 --- a/tests/api_resources/test_usage.py +++ b/tests/api_resources/test_usage.py @@ -19,13 +19,13 @@ class TestUsage: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_environment_runtime_records(self, client: Gitpod) -> None: usage = client.usage.list_environment_runtime_records() assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_environment_runtime_records_with_all_params(self, client: Gitpod) -> None: usage = client.usage.list_environment_runtime_records( @@ -45,7 +45,7 @@ def test_method_list_environment_runtime_records_with_all_params(self, client: G ) assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_environment_runtime_records(self, client: Gitpod) -> None: response = client.usage.with_raw_response.list_environment_runtime_records() @@ -55,7 +55,7 @@ def test_raw_response_list_environment_runtime_records(self, client: Gitpod) -> usage = response.parse() assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_environment_runtime_records(self, client: Gitpod) -> None: with client.usage.with_streaming_response.list_environment_runtime_records() as response: @@ -73,13 +73,13 @@ class TestAsyncUsage: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_environment_runtime_records(self, async_client: AsyncGitpod) -> None: usage = await async_client.usage.list_environment_runtime_records() assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_environment_runtime_records_with_all_params(self, async_client: AsyncGitpod) -> None: usage = await async_client.usage.list_environment_runtime_records( @@ -99,7 +99,7 @@ async def test_method_list_environment_runtime_records_with_all_params(self, asy ) assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_environment_runtime_records(self, async_client: AsyncGitpod) -> None: response = await async_client.usage.with_raw_response.list_environment_runtime_records() @@ -109,7 +109,7 @@ async def test_raw_response_list_environment_runtime_records(self, async_client: usage = await response.parse() assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_environment_runtime_records(self, async_client: AsyncGitpod) -> None: async with async_client.usage.with_streaming_response.list_environment_runtime_records() as response: diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index 2c16986b..cfe22b3d 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -17,13 +17,13 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_authenticated_user(self, client: Gitpod) -> None: user = client.users.get_authenticated_user() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> None: user = client.users.get_authenticated_user( @@ -31,7 +31,7 @@ def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: response = client.users.with_raw_response.get_authenticated_user() @@ -41,7 +41,7 @@ def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None: with client.users.with_streaming_response.get_authenticated_user() as response: @@ -53,13 +53,13 @@ def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_set_suspended(self, client: Gitpod) -> None: user = client.users.set_suspended() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: user = client.users.set_suspended( @@ -68,7 +68,7 @@ def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_set_suspended(self, client: Gitpod) -> None: response = client.users.with_raw_response.set_suspended() @@ -78,7 +78,7 @@ def test_raw_response_set_suspended(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_set_suspended(self, client: Gitpod) -> None: with client.users.with_streaming_response.set_suspended() as response: @@ -96,13 +96,13 @@ class TestAsyncUsers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_authenticated_user_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user( @@ -110,7 +110,7 @@ async def test_method_get_authenticated_user_with_all_params(self, async_client: ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.get_authenticated_user() @@ -120,7 +120,7 @@ async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitp user = await response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.get_authenticated_user() as response: @@ -132,13 +132,13 @@ async def test_streaming_response_get_authenticated_user(self, async_client: Asy assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_set_suspended_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended( @@ -147,7 +147,7 @@ async def test_method_set_suspended_with_all_params(self, async_client: AsyncGit ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.set_suspended() @@ -157,7 +157,7 @@ async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> No user = await response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_set_suspended(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.set_suspended() as response: diff --git a/tests/api_resources/users/test_dotfiles.py b/tests/api_resources/users/test_dotfiles.py index 1bb65b72..6d2ebe96 100644 --- a/tests/api_resources/users/test_dotfiles.py +++ b/tests/api_resources/users/test_dotfiles.py @@ -17,13 +17,13 @@ class TestDotfiles: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get(self, client: Gitpod) -> None: dotfile = client.users.dotfiles.get() assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: dotfile = client.users.dotfiles.get( @@ -31,7 +31,7 @@ def test_method_get_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get(self, client: Gitpod) -> None: response = client.users.dotfiles.with_raw_response.get() @@ -41,7 +41,7 @@ def test_raw_response_get(self, client: Gitpod) -> None: dotfile = response.parse() assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: with client.users.dotfiles.with_streaming_response.get() as response: @@ -53,13 +53,13 @@ def test_streaming_response_get(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_set(self, client: Gitpod) -> None: dotfile = client.users.dotfiles.set() assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_set_with_all_params(self, client: Gitpod) -> None: dotfile = client.users.dotfiles.set( @@ -67,7 +67,7 @@ def test_method_set_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_set(self, client: Gitpod) -> None: response = client.users.dotfiles.with_raw_response.set() @@ -77,7 +77,7 @@ def test_raw_response_set(self, client: Gitpod) -> None: dotfile = response.parse() assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_set(self, client: Gitpod) -> None: with client.users.dotfiles.with_streaming_response.set() as response: @@ -95,13 +95,13 @@ class TestAsyncDotfiles: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: dotfile = await async_client.users.dotfiles.get() assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: dotfile = await async_client.users.dotfiles.get( @@ -109,7 +109,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> No ) assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: response = await async_client.users.dotfiles.with_raw_response.get() @@ -119,7 +119,7 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: dotfile = await response.parse() assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: async with async_client.users.dotfiles.with_streaming_response.get() as response: @@ -131,13 +131,13 @@ async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_set(self, async_client: AsyncGitpod) -> None: dotfile = await async_client.users.dotfiles.set() assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_set_with_all_params(self, async_client: AsyncGitpod) -> None: dotfile = await async_client.users.dotfiles.set( @@ -145,7 +145,7 @@ async def test_method_set_with_all_params(self, async_client: AsyncGitpod) -> No ) assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_set(self, async_client: AsyncGitpod) -> None: response = await async_client.users.dotfiles.with_raw_response.set() @@ -155,7 +155,7 @@ async def test_raw_response_set(self, async_client: AsyncGitpod) -> None: dotfile = await response.parse() assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_set(self, async_client: AsyncGitpod) -> None: async with async_client.users.dotfiles.with_streaming_response.set() as response: diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index c8e10826..d00d8d20 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -18,13 +18,13 @@ class TestPats: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: pat = client.users.pats.list() assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.list( @@ -38,7 +38,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.list() @@ -48,7 +48,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.list() as response: @@ -60,13 +60,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: pat = client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.delete( @@ -74,7 +74,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.delete() @@ -84,7 +84,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.delete() as response: @@ -96,13 +96,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get(self, client: Gitpod) -> None: pat = client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.get( @@ -110,7 +110,7 @@ def test_method_get_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.get() @@ -120,7 +120,7 @@ def test_raw_response_get(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.get() as response: @@ -138,13 +138,13 @@ class TestAsyncPats: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list() assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list( @@ -158,7 +158,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.list() @@ -168,7 +168,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.list() as response: @@ -180,13 +180,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete( @@ -194,7 +194,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.delete() @@ -204,7 +204,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.delete() as response: @@ -216,13 +216,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get( @@ -230,7 +230,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> No ) assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.get() @@ -240,7 +240,7 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.get() as response: diff --git a/tests/utils.py b/tests/utils.py index d7dbee62..3f054b4a 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -4,7 +4,7 @@ import inspect import traceback import contextlib -from typing import Any, TypeVar, Iterator, cast +from typing import Any, TypeVar, Iterator, Sequence, cast from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type @@ -15,6 +15,7 @@ is_list_type, is_union_type, extract_type_arg, + is_sequence_type, is_annotated_type, is_type_alias_type, ) @@ -71,6 +72,13 @@ def assert_matches_type( if is_list_type(type_): return _assert_list_type(type_, value) + if is_sequence_type(type_): + assert isinstance(value, Sequence) + inner_type = get_args(type_)[0] + for entry in value: # type: ignore + assert_type(inner_type, entry) # type: ignore + return + if origin == str: assert isinstance(value, str) elif origin == int: From 03cd9ac7afedda15880dd96ebe9c94dff3a5ab1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 21:54:22 +0000 Subject: [PATCH 198/505] feat: improve future compat with pydantic v3 --- src/gitpod/_base_client.py | 6 +- src/gitpod/_compat.py | 96 ++++++++--------- src/gitpod/_models.py | 80 +++++++------- src/gitpod/_utils/__init__.py | 10 +- src/gitpod/_utils/_compat.py | 45 ++++++++ src/gitpod/_utils/_datetime_parse.py | 136 ++++++++++++++++++++++++ src/gitpod/_utils/_transform.py | 6 +- src/gitpod/_utils/_typing.py | 2 +- src/gitpod/_utils/_utils.py | 1 - tests/test_models.py | 48 ++++----- tests/test_transform.py | 16 +-- tests/test_utils/test_datetime_parse.py | 110 +++++++++++++++++++ tests/utils.py | 8 +- 13 files changed, 432 insertions(+), 132 deletions(-) create mode 100644 src/gitpod/_utils/_compat.py create mode 100644 src/gitpod/_utils/_datetime_parse.py create mode 100644 tests/test_utils/test_datetime_parse.py diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 6c9d3918..14ac3c4c 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -59,7 +59,7 @@ ModelBuilderProtocol, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping -from ._compat import PYDANTIC_V2, model_copy, model_dump +from ._compat import PYDANTIC_V1, model_copy, model_dump from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, @@ -232,7 +232,7 @@ def _set_private_attributes( model: Type[_T], options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None: self.__pydantic_private__ = {} self._model = model @@ -320,7 +320,7 @@ def _set_private_attributes( client: AsyncAPIClient, options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None: self.__pydantic_private__ = {} self._model = model diff --git a/src/gitpod/_compat.py b/src/gitpod/_compat.py index 92d9ee61..bdef67f0 100644 --- a/src/gitpod/_compat.py +++ b/src/gitpod/_compat.py @@ -12,14 +12,13 @@ _T = TypeVar("_T") _ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel) -# --------------- Pydantic v2 compatibility --------------- +# --------------- Pydantic v2, v3 compatibility --------------- # Pyright incorrectly reports some of our functions as overriding a method when they don't # pyright: reportIncompatibleMethodOverride=false -PYDANTIC_V2 = pydantic.VERSION.startswith("2.") +PYDANTIC_V1 = pydantic.VERSION.startswith("1.") -# v1 re-exports if TYPE_CHECKING: def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001 @@ -44,90 +43,92 @@ def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001 ... else: - if PYDANTIC_V2: - from pydantic.v1.typing import ( + # v1 re-exports + if PYDANTIC_V1: + from pydantic.typing import ( get_args as get_args, is_union as is_union, get_origin as get_origin, is_typeddict as is_typeddict, is_literal_type as is_literal_type, ) - from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime + from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime else: - from pydantic.typing import ( + from ._utils import ( get_args as get_args, is_union as is_union, get_origin as get_origin, + parse_date as parse_date, is_typeddict as is_typeddict, + parse_datetime as parse_datetime, is_literal_type as is_literal_type, ) - from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime # refactored config if TYPE_CHECKING: from pydantic import ConfigDict as ConfigDict else: - if PYDANTIC_V2: - from pydantic import ConfigDict - else: + if PYDANTIC_V1: # TODO: provide an error message here? ConfigDict = None + else: + from pydantic import ConfigDict as ConfigDict # renamed methods / properties def parse_obj(model: type[_ModelT], value: object) -> _ModelT: - if PYDANTIC_V2: - return model.model_validate(value) - else: + if PYDANTIC_V1: return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + else: + return model.model_validate(value) def field_is_required(field: FieldInfo) -> bool: - if PYDANTIC_V2: - return field.is_required() - return field.required # type: ignore + if PYDANTIC_V1: + return field.required # type: ignore + return field.is_required() def field_get_default(field: FieldInfo) -> Any: value = field.get_default() - if PYDANTIC_V2: - from pydantic_core import PydanticUndefined - - if value == PydanticUndefined: - return None + if PYDANTIC_V1: return value + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None return value def field_outer_type(field: FieldInfo) -> Any: - if PYDANTIC_V2: - return field.annotation - return field.outer_type_ # type: ignore + if PYDANTIC_V1: + return field.outer_type_ # type: ignore + return field.annotation def get_model_config(model: type[pydantic.BaseModel]) -> Any: - if PYDANTIC_V2: - return model.model_config - return model.__config__ # type: ignore + if PYDANTIC_V1: + return model.__config__ # type: ignore + return model.model_config def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]: - if PYDANTIC_V2: - return model.model_fields - return model.__fields__ # type: ignore + if PYDANTIC_V1: + return model.__fields__ # type: ignore + return model.model_fields def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT: - if PYDANTIC_V2: - return model.model_copy(deep=deep) - return model.copy(deep=deep) # type: ignore + if PYDANTIC_V1: + return model.copy(deep=deep) # type: ignore + return model.model_copy(deep=deep) def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: - if PYDANTIC_V2: - return model.model_dump_json(indent=indent) - return model.json(indent=indent) # type: ignore + if PYDANTIC_V1: + return model.json(indent=indent) # type: ignore + return model.model_dump_json(indent=indent) def model_dump( @@ -139,14 +140,14 @@ def model_dump( warnings: bool = True, mode: Literal["json", "python"] = "python", ) -> dict[str, Any]: - if PYDANTIC_V2 or hasattr(model, "model_dump"): + if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( mode=mode, exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 - warnings=warnings if PYDANTIC_V2 else True, + warnings=True if PYDANTIC_V1 else warnings, ) return cast( "dict[str, Any]", @@ -159,9 +160,9 @@ def model_dump( def model_parse(model: type[_ModelT], data: Any) -> _ModelT: - if PYDANTIC_V2: - return model.model_validate(data) - return model.parse_obj(data) # pyright: ignore[reportDeprecated] + if PYDANTIC_V1: + return model.parse_obj(data) # pyright: ignore[reportDeprecated] + return model.model_validate(data) # generic models @@ -170,17 +171,16 @@ def model_parse(model: type[_ModelT], data: Any) -> _ModelT: class GenericModel(pydantic.BaseModel): ... else: - if PYDANTIC_V2: + if PYDANTIC_V1: + import pydantic.generics + + class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... + else: # there no longer needs to be a distinction in v2 but # we still have to create our own subclass to avoid # inconsistent MRO ordering errors class GenericModel(pydantic.BaseModel): ... - else: - import pydantic.generics - - class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... - # cached properties if TYPE_CHECKING: diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 92f7c10b..3a6017ef 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -50,7 +50,7 @@ strip_annotated_type, ) from ._compat import ( - PYDANTIC_V2, + PYDANTIC_V1, ConfigDict, GenericModel as BaseGenericModel, get_args, @@ -81,11 +81,7 @@ class _ConfigProtocol(Protocol): class BaseModel(pydantic.BaseModel): - if PYDANTIC_V2: - model_config: ClassVar[ConfigDict] = ConfigDict( - extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) - ) - else: + if PYDANTIC_V1: @property @override @@ -95,6 +91,10 @@ def model_fields_set(self) -> set[str]: class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] extra: Any = pydantic.Extra.allow # type: ignore + else: + model_config: ClassVar[ConfigDict] = ConfigDict( + extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) + ) def to_dict( self, @@ -215,25 +215,25 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] if key not in model_fields: parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value - if PYDANTIC_V2: - _extra[key] = parsed - else: + if PYDANTIC_V1: _fields_set.add(key) fields_values[key] = parsed + else: + _extra[key] = parsed object.__setattr__(m, "__dict__", fields_values) - if PYDANTIC_V2: - # these properties are copied from Pydantic's `model_construct()` method - object.__setattr__(m, "__pydantic_private__", None) - object.__setattr__(m, "__pydantic_extra__", _extra) - object.__setattr__(m, "__pydantic_fields_set__", _fields_set) - else: + if PYDANTIC_V1: # init_private_attributes() does not exist in v2 m._init_private_attributes() # type: ignore # copied from Pydantic v1's `construct()` method object.__setattr__(m, "__fields_set__", _fields_set) + else: + # these properties are copied from Pydantic's `model_construct()` method + object.__setattr__(m, "__pydantic_private__", None) + object.__setattr__(m, "__pydantic_extra__", _extra) + object.__setattr__(m, "__pydantic_fields_set__", _fields_set) return m @@ -243,7 +243,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] # although not in practice model_construct = construct - if not PYDANTIC_V2: + if PYDANTIC_V1: # we define aliases for some of the new pydantic v2 methods so # that we can just document these methods without having to specify # a specific pydantic version as some users may not know which @@ -363,10 +363,10 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: if value is None: return field_get_default(field) - if PYDANTIC_V2: - type_ = field.annotation - else: + if PYDANTIC_V1: type_ = cast(type, field.outer_type_) # type: ignore + else: + type_ = field.annotation # type: ignore if type_ is None: raise RuntimeError(f"Unexpected field type is None for {key}") @@ -375,7 +375,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: - if not PYDANTIC_V2: + if PYDANTIC_V1: # TODO return None @@ -628,30 +628,30 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, for variant in get_args(union): variant = strip_annotated_type(variant) if is_basemodel_type(variant): - if PYDANTIC_V2: - field = _extract_field_schema_pv2(variant, discriminator_field_name) - if not field: + if PYDANTIC_V1: + field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + if not field_info: continue # Note: if one variant defines an alias then they all should - discriminator_alias = field.get("serialization_alias") - - field_schema = field["schema"] + discriminator_alias = field_info.alias - if field_schema["type"] == "literal": - for entry in cast("LiteralSchema", field_schema)["expected"]: + if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): + for entry in get_args(annotation): if isinstance(entry, str): mapping[entry] = variant else: - field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - if not field_info: + field = _extract_field_schema_pv2(variant, discriminator_field_name) + if not field: continue # Note: if one variant defines an alias then they all should - discriminator_alias = field_info.alias + discriminator_alias = field.get("serialization_alias") - if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): - for entry in get_args(annotation): + field_schema = field["schema"] + + if field_schema["type"] == "literal": + for entry in cast("LiteralSchema", field_schema)["expected"]: if isinstance(entry, str): mapping[entry] = variant @@ -714,7 +714,7 @@ class GenericModel(BaseGenericModel, BaseModel): pass -if PYDANTIC_V2: +if not PYDANTIC_V1: from pydantic import TypeAdapter as _TypeAdapter _CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter)) @@ -782,12 +782,12 @@ class FinalRequestOptions(pydantic.BaseModel): json_data: Union[Body, None] = None extra_json: Union[AnyMapping, None] = None - if PYDANTIC_V2: - model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) - else: + if PYDANTIC_V1: class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] arbitrary_types_allowed: bool = True + else: + model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) def get_max_retries(self, max_retries: int) -> int: if isinstance(self.max_retries, NotGiven): @@ -820,9 +820,9 @@ def construct( # type: ignore key: strip_not_given(value) for key, value in values.items() } - if PYDANTIC_V2: - return super().model_construct(_fields_set, **kwargs) - return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + if PYDANTIC_V1: + return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + return super().model_construct(_fields_set, **kwargs) if not TYPE_CHECKING: # type checkers incorrectly complain about this assignment diff --git a/src/gitpod/_utils/__init__.py b/src/gitpod/_utils/__init__.py index ca547ce5..dc64e29a 100644 --- a/src/gitpod/_utils/__init__.py +++ b/src/gitpod/_utils/__init__.py @@ -10,7 +10,6 @@ lru_cache as lru_cache, is_mapping as is_mapping, is_tuple_t as is_tuple_t, - parse_date as parse_date, is_iterable as is_iterable, is_sequence as is_sequence, coerce_float as coerce_float, @@ -23,7 +22,6 @@ coerce_boolean as coerce_boolean, coerce_integer as coerce_integer, file_from_path as file_from_path, - parse_datetime as parse_datetime, strip_not_given as strip_not_given, deepcopy_minimal as deepcopy_minimal, get_async_library as get_async_library, @@ -32,6 +30,13 @@ maybe_coerce_boolean as maybe_coerce_boolean, maybe_coerce_integer as maybe_coerce_integer, ) +from ._compat import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, +) from ._typing import ( is_list_type as is_list_type, is_union_type as is_union_type, @@ -56,3 +61,4 @@ function_has_argument as function_has_argument, assert_signatures_in_sync as assert_signatures_in_sync, ) +from ._datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime diff --git a/src/gitpod/_utils/_compat.py b/src/gitpod/_utils/_compat.py new file mode 100644 index 00000000..dd703233 --- /dev/null +++ b/src/gitpod/_utils/_compat.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +import sys +import typing_extensions +from typing import Any, Type, Union, Literal, Optional +from datetime import date, datetime +from typing_extensions import get_args as _get_args, get_origin as _get_origin + +from .._types import StrBytesIntFloat +from ._datetime_parse import parse_date as _parse_date, parse_datetime as _parse_datetime + +_LITERAL_TYPES = {Literal, typing_extensions.Literal} + + +def get_args(tp: type[Any]) -> tuple[Any, ...]: + return _get_args(tp) + + +def get_origin(tp: type[Any]) -> type[Any] | None: + return _get_origin(tp) + + +def is_union(tp: Optional[Type[Any]]) -> bool: + if sys.version_info < (3, 10): + return tp is Union # type: ignore[comparison-overlap] + else: + import types + + return tp is Union or tp is types.UnionType + + +def is_typeddict(tp: Type[Any]) -> bool: + return typing_extensions.is_typeddict(tp) + + +def is_literal_type(tp: Type[Any]) -> bool: + return get_origin(tp) in _LITERAL_TYPES + + +def parse_date(value: Union[date, StrBytesIntFloat]) -> date: + return _parse_date(value) + + +def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + return _parse_datetime(value) diff --git a/src/gitpod/_utils/_datetime_parse.py b/src/gitpod/_utils/_datetime_parse.py new file mode 100644 index 00000000..7cb9d9e6 --- /dev/null +++ b/src/gitpod/_utils/_datetime_parse.py @@ -0,0 +1,136 @@ +""" +This file contains code from https://github.com/pydantic/pydantic/blob/main/pydantic/v1/datetime_parse.py +without the Pydantic v1 specific errors. +""" + +from __future__ import annotations + +import re +from typing import Dict, Union, Optional +from datetime import date, datetime, timezone, timedelta + +from .._types import StrBytesIntFloat + +date_expr = r"(?P\d{4})-(?P\d{1,2})-(?P\d{1,2})" +time_expr = ( + r"(?P\d{1,2}):(?P\d{1,2})" + r"(?::(?P\d{1,2})(?:\.(?P\d{1,6})\d{0,6})?)?" + r"(?PZ|[+-]\d{2}(?::?\d{2})?)?$" +) + +date_re = re.compile(f"{date_expr}$") +datetime_re = re.compile(f"{date_expr}[T ]{time_expr}") + + +EPOCH = datetime(1970, 1, 1) +# if greater than this, the number is in ms, if less than or equal it's in seconds +# (in seconds this is 11th October 2603, in ms it's 20th August 1970) +MS_WATERSHED = int(2e10) +# slightly more than datetime.max in ns - (datetime.max - EPOCH).total_seconds() * 1e9 +MAX_NUMBER = int(3e20) + + +def _get_numeric(value: StrBytesIntFloat, native_expected_type: str) -> Union[None, int, float]: + if isinstance(value, (int, float)): + return value + try: + return float(value) + except ValueError: + return None + except TypeError: + raise TypeError(f"invalid type; expected {native_expected_type}, string, bytes, int or float") from None + + +def _from_unix_seconds(seconds: Union[int, float]) -> datetime: + if seconds > MAX_NUMBER: + return datetime.max + elif seconds < -MAX_NUMBER: + return datetime.min + + while abs(seconds) > MS_WATERSHED: + seconds /= 1000 + dt = EPOCH + timedelta(seconds=seconds) + return dt.replace(tzinfo=timezone.utc) + + +def _parse_timezone(value: Optional[str]) -> Union[None, int, timezone]: + if value == "Z": + return timezone.utc + elif value is not None: + offset_mins = int(value[-2:]) if len(value) > 3 else 0 + offset = 60 * int(value[1:3]) + offset_mins + if value[0] == "-": + offset = -offset + return timezone(timedelta(minutes=offset)) + else: + return None + + +def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + """ + Parse a datetime/int/float/string and return a datetime.datetime. + + This function supports time zone offsets. When the input contains one, + the output uses a timezone with a fixed offset from UTC. + + Raise ValueError if the input is well formatted but not a valid datetime. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, datetime): + return value + + number = _get_numeric(value, "datetime") + if number is not None: + return _from_unix_seconds(number) + + if isinstance(value, bytes): + value = value.decode() + + assert not isinstance(value, (float, int)) + + match = datetime_re.match(value) + if match is None: + raise ValueError("invalid datetime format") + + kw = match.groupdict() + if kw["microsecond"]: + kw["microsecond"] = kw["microsecond"].ljust(6, "0") + + tzinfo = _parse_timezone(kw.pop("tzinfo")) + kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None} + kw_["tzinfo"] = tzinfo + + return datetime(**kw_) # type: ignore + + +def parse_date(value: Union[date, StrBytesIntFloat]) -> date: + """ + Parse a date/int/float/string and return a datetime.date. + + Raise ValueError if the input is well formatted but not a valid date. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, date): + if isinstance(value, datetime): + return value.date() + else: + return value + + number = _get_numeric(value, "date") + if number is not None: + return _from_unix_seconds(number).date() + + if isinstance(value, bytes): + value = value.decode() + + assert not isinstance(value, (float, int)) + match = date_re.match(value) + if match is None: + raise ValueError("invalid date format") + + kw = {k: int(v) for k, v in match.groupdict().items()} + + try: + return date(**kw) + except ValueError: + raise ValueError("invalid date format") from None diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index f0bcefd4..c19124f0 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -19,6 +19,7 @@ is_sequence, ) from .._files import is_base64_file_input +from ._compat import get_origin, is_typeddict from ._typing import ( is_list_type, is_union_type, @@ -29,7 +30,6 @@ is_annotated_type, strip_annotated_type, ) -from .._compat import get_origin, model_dump, is_typeddict _T = TypeVar("_T") @@ -169,6 +169,8 @@ def _transform_recursive( Defaults to the same value as the `annotation` argument. """ + from .._compat import model_dump + if inner_type is None: inner_type = annotation @@ -333,6 +335,8 @@ async def _async_transform_recursive( Defaults to the same value as the `annotation` argument. """ + from .._compat import model_dump + if inner_type is None: inner_type = annotation diff --git a/src/gitpod/_utils/_typing.py b/src/gitpod/_utils/_typing.py index 845cd6b2..193109f3 100644 --- a/src/gitpod/_utils/_typing.py +++ b/src/gitpod/_utils/_typing.py @@ -15,7 +15,7 @@ from ._utils import lru_cache from .._types import InheritsGeneric -from .._compat import is_union as _is_union +from ._compat import is_union as _is_union def is_annotated_type(typ: type) -> bool: diff --git a/src/gitpod/_utils/_utils.py b/src/gitpod/_utils/_utils.py index ea3cf3f2..f0818595 100644 --- a/src/gitpod/_utils/_utils.py +++ b/src/gitpod/_utils/_utils.py @@ -22,7 +22,6 @@ import sniffio from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike -from .._compat import parse_date as parse_date, parse_datetime as parse_datetime _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) diff --git a/tests/test_models.py b/tests/test_models.py index 845989a6..fad48103 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -8,7 +8,7 @@ from pydantic import Field from gitpod._utils import PropertyInfo -from gitpod._compat import PYDANTIC_V2, parse_obj, model_dump, model_json +from gitpod._compat import PYDANTIC_V1, parse_obj, model_dump, model_json from gitpod._models import BaseModel, construct_type @@ -294,12 +294,12 @@ class Model(BaseModel): assert cast(bool, m.foo) is True m = Model.construct(foo={"name": 3}) - if PYDANTIC_V2: - assert isinstance(m.foo, Submodel1) - assert m.foo.name == 3 # type: ignore - else: + if PYDANTIC_V1: assert isinstance(m.foo, Submodel2) assert m.foo.name == "3" + else: + assert isinstance(m.foo, Submodel1) + assert m.foo.name == 3 # type: ignore def test_list_of_unions() -> None: @@ -426,10 +426,10 @@ class Model(BaseModel): expected = datetime(2019, 12, 27, 18, 11, 19, 117000, tzinfo=timezone.utc) - if PYDANTIC_V2: - expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}' - else: + if PYDANTIC_V1: expected_json = '{"created_at": "2019-12-27T18:11:19.117000+00:00"}' + else: + expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}' model = Model.construct(created_at="2019-12-27T18:11:19.117Z") assert model.created_at == expected @@ -531,7 +531,7 @@ class Model2(BaseModel): assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)} assert m4.to_dict(mode="json") == {"created_at": time_str} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): m.to_dict(warnings=False) @@ -556,7 +556,7 @@ class Model(BaseModel): assert m3.model_dump() == {"foo": None} assert m3.model_dump(exclude_none=True) == {} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): m.model_dump(round_trip=True) @@ -580,10 +580,10 @@ class Model(BaseModel): assert json.loads(m.to_json()) == {"FOO": "hello"} assert json.loads(m.to_json(use_api_names=False)) == {"foo": "hello"} - if PYDANTIC_V2: - assert m.to_json(indent=None) == '{"FOO":"hello"}' - else: + if PYDANTIC_V1: assert m.to_json(indent=None) == '{"FOO": "hello"}' + else: + assert m.to_json(indent=None) == '{"FOO":"hello"}' m2 = Model() assert json.loads(m2.to_json()) == {} @@ -595,7 +595,7 @@ class Model(BaseModel): assert json.loads(m3.to_json()) == {"FOO": None} assert json.loads(m3.to_json(exclude_none=True)) == {} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): m.to_json(warnings=False) @@ -622,7 +622,7 @@ class Model(BaseModel): assert json.loads(m3.model_dump_json()) == {"foo": None} assert json.loads(m3.model_dump_json(exclude_none=True)) == {} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): m.model_dump_json(round_trip=True) @@ -679,12 +679,12 @@ class B(BaseModel): ) assert isinstance(m, A) assert m.type == "a" - if PYDANTIC_V2: - assert m.data == 100 # type: ignore[comparison-overlap] - else: + if PYDANTIC_V1: # pydantic v1 automatically converts inputs to strings # if the expected type is a str assert m.data == "100" + else: + assert m.data == 100 # type: ignore[comparison-overlap] def test_discriminated_unions_unknown_variant() -> None: @@ -768,12 +768,12 @@ class B(BaseModel): ) assert isinstance(m, A) assert m.foo_type == "a" - if PYDANTIC_V2: - assert m.data == 100 # type: ignore[comparison-overlap] - else: + if PYDANTIC_V1: # pydantic v1 automatically converts inputs to strings # if the expected type is a str assert m.data == "100" + else: + assert m.data == 100 # type: ignore[comparison-overlap] def test_discriminated_unions_overlapping_discriminators_invalid_data() -> None: @@ -833,7 +833,7 @@ class B(BaseModel): assert UnionType.__discriminator__ is discriminator -@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +@pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") def test_type_alias_type() -> None: Alias = TypeAliasType("Alias", str) # pyright: ignore @@ -849,7 +849,7 @@ class Model(BaseModel): assert m.union == "bar" -@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +@pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") def test_field_named_cls() -> None: class Model(BaseModel): cls: str @@ -936,7 +936,7 @@ class Type2(BaseModel): assert isinstance(model.value, InnerType2) -@pytest.mark.skipif(not PYDANTIC_V2, reason="this is only supported in pydantic v2 for now") +@pytest.mark.skipif(PYDANTIC_V1, reason="this is only supported in pydantic v2 for now") def test_extra_properties() -> None: class Item(BaseModel): prop: int diff --git a/tests/test_transform.py b/tests/test_transform.py index 2a74ad4c..d3c756e2 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -15,7 +15,7 @@ parse_datetime, async_transform as _async_transform, ) -from gitpod._compat import PYDANTIC_V2 +from gitpod._compat import PYDANTIC_V1 from gitpod._models import BaseModel _T = TypeVar("_T") @@ -189,7 +189,7 @@ class DateModel(BaseModel): @pytest.mark.asyncio async def test_iso8601_format(use_async: bool) -> None: dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") - tz = "Z" if PYDANTIC_V2 else "+00:00" + tz = "+00:00" if PYDANTIC_V1 else "Z" assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692" + tz} # type: ignore[comparison-overlap] @@ -297,11 +297,11 @@ async def test_pydantic_unknown_field(use_async: bool) -> None: @pytest.mark.asyncio async def test_pydantic_mismatched_types(use_async: bool) -> None: model = MyModel.construct(foo=True) - if PYDANTIC_V2: + if PYDANTIC_V1: + params = await transform(model, Any, use_async) + else: with pytest.warns(UserWarning): params = await transform(model, Any, use_async) - else: - params = await transform(model, Any, use_async) assert cast(Any, params) == {"foo": True} @@ -309,11 +309,11 @@ async def test_pydantic_mismatched_types(use_async: bool) -> None: @pytest.mark.asyncio async def test_pydantic_mismatched_object_type(use_async: bool) -> None: model = MyModel.construct(foo=MyModel.construct(hello="world")) - if PYDANTIC_V2: + if PYDANTIC_V1: + params = await transform(model, Any, use_async) + else: with pytest.warns(UserWarning): params = await transform(model, Any, use_async) - else: - params = await transform(model, Any, use_async) assert cast(Any, params) == {"foo": {"hello": "world"}} diff --git a/tests/test_utils/test_datetime_parse.py b/tests/test_utils/test_datetime_parse.py new file mode 100644 index 00000000..21c16d43 --- /dev/null +++ b/tests/test_utils/test_datetime_parse.py @@ -0,0 +1,110 @@ +""" +Copied from https://github.com/pydantic/pydantic/blob/v1.10.22/tests/test_datetime_parse.py +with modifications so it works without pydantic v1 imports. +""" + +from typing import Type, Union +from datetime import date, datetime, timezone, timedelta + +import pytest + +from gitpod._utils import parse_date, parse_datetime + + +def create_tz(minutes: int) -> timezone: + return timezone(timedelta(minutes=minutes)) + + +@pytest.mark.parametrize( + "value,result", + [ + # Valid inputs + ("1494012444.883309", date(2017, 5, 5)), + (b"1494012444.883309", date(2017, 5, 5)), + (1_494_012_444.883_309, date(2017, 5, 5)), + ("1494012444", date(2017, 5, 5)), + (1_494_012_444, date(2017, 5, 5)), + (0, date(1970, 1, 1)), + ("2012-04-23", date(2012, 4, 23)), + (b"2012-04-23", date(2012, 4, 23)), + ("2012-4-9", date(2012, 4, 9)), + (date(2012, 4, 9), date(2012, 4, 9)), + (datetime(2012, 4, 9, 12, 15), date(2012, 4, 9)), + # Invalid inputs + ("x20120423", ValueError), + ("2012-04-56", ValueError), + (19_999_999_999, date(2603, 10, 11)), # just before watershed + (20_000_000_001, date(1970, 8, 20)), # just after watershed + (1_549_316_052, date(2019, 2, 4)), # nowish in s + (1_549_316_052_104, date(2019, 2, 4)), # nowish in ms + (1_549_316_052_104_324, date(2019, 2, 4)), # nowish in μs + (1_549_316_052_104_324_096, date(2019, 2, 4)), # nowish in ns + ("infinity", date(9999, 12, 31)), + ("inf", date(9999, 12, 31)), + (float("inf"), date(9999, 12, 31)), + ("infinity ", date(9999, 12, 31)), + (int("1" + "0" * 100), date(9999, 12, 31)), + (1e1000, date(9999, 12, 31)), + ("-infinity", date(1, 1, 1)), + ("-inf", date(1, 1, 1)), + ("nan", ValueError), + ], +) +def test_date_parsing(value: Union[str, bytes, int, float], result: Union[date, Type[Exception]]) -> None: + if type(result) == type and issubclass(result, Exception): # pyright: ignore[reportUnnecessaryIsInstance] + with pytest.raises(result): + parse_date(value) + else: + assert parse_date(value) == result + + +@pytest.mark.parametrize( + "value,result", + [ + # Valid inputs + # values in seconds + ("1494012444.883309", datetime(2017, 5, 5, 19, 27, 24, 883_309, tzinfo=timezone.utc)), + (1_494_012_444.883_309, datetime(2017, 5, 5, 19, 27, 24, 883_309, tzinfo=timezone.utc)), + ("1494012444", datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + (b"1494012444", datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + (1_494_012_444, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + # values in ms + ("1494012444000.883309", datetime(2017, 5, 5, 19, 27, 24, 883, tzinfo=timezone.utc)), + ("-1494012444000.883309", datetime(1922, 8, 29, 4, 32, 35, 999117, tzinfo=timezone.utc)), + (1_494_012_444_000, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + ("2012-04-23T09:15:00", datetime(2012, 4, 23, 9, 15)), + ("2012-4-9 4:8:16", datetime(2012, 4, 9, 4, 8, 16)), + ("2012-04-23T09:15:00Z", datetime(2012, 4, 23, 9, 15, 0, 0, timezone.utc)), + ("2012-4-9 4:8:16-0320", datetime(2012, 4, 9, 4, 8, 16, 0, create_tz(-200))), + ("2012-04-23T10:20:30.400+02:30", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(150))), + ("2012-04-23T10:20:30.400+02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(120))), + ("2012-04-23T10:20:30.400-02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))), + (b"2012-04-23T10:20:30.400-02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))), + (datetime(2017, 5, 5), datetime(2017, 5, 5)), + (0, datetime(1970, 1, 1, 0, 0, 0, tzinfo=timezone.utc)), + # Invalid inputs + ("x20120423091500", ValueError), + ("2012-04-56T09:15:90", ValueError), + ("2012-04-23T11:05:00-25:00", ValueError), + (19_999_999_999, datetime(2603, 10, 11, 11, 33, 19, tzinfo=timezone.utc)), # just before watershed + (20_000_000_001, datetime(1970, 8, 20, 11, 33, 20, 1000, tzinfo=timezone.utc)), # just after watershed + (1_549_316_052, datetime(2019, 2, 4, 21, 34, 12, 0, tzinfo=timezone.utc)), # nowish in s + (1_549_316_052_104, datetime(2019, 2, 4, 21, 34, 12, 104_000, tzinfo=timezone.utc)), # nowish in ms + (1_549_316_052_104_324, datetime(2019, 2, 4, 21, 34, 12, 104_324, tzinfo=timezone.utc)), # nowish in μs + (1_549_316_052_104_324_096, datetime(2019, 2, 4, 21, 34, 12, 104_324, tzinfo=timezone.utc)), # nowish in ns + ("infinity", datetime(9999, 12, 31, 23, 59, 59, 999999)), + ("inf", datetime(9999, 12, 31, 23, 59, 59, 999999)), + ("inf ", datetime(9999, 12, 31, 23, 59, 59, 999999)), + (1e50, datetime(9999, 12, 31, 23, 59, 59, 999999)), + (float("inf"), datetime(9999, 12, 31, 23, 59, 59, 999999)), + ("-infinity", datetime(1, 1, 1, 0, 0)), + ("-inf", datetime(1, 1, 1, 0, 0)), + ("nan", ValueError), + ], +) +def test_datetime_parsing(value: Union[str, bytes, int, float], result: Union[datetime, Type[Exception]]) -> None: + if type(result) == type and issubclass(result, Exception): # pyright: ignore[reportUnnecessaryIsInstance] + with pytest.raises(result): + parse_datetime(value) + else: + assert parse_datetime(value) == result diff --git a/tests/utils.py b/tests/utils.py index 3f054b4a..860e524c 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -19,7 +19,7 @@ is_annotated_type, is_type_alias_type, ) -from gitpod._compat import PYDANTIC_V2, field_outer_type, get_model_fields +from gitpod._compat import PYDANTIC_V1, field_outer_type, get_model_fields from gitpod._models import BaseModel BaseModelT = TypeVar("BaseModelT", bound=BaseModel) @@ -28,12 +28,12 @@ def assert_matches_model(model: type[BaseModelT], value: BaseModelT, *, path: list[str]) -> bool: for name, field in get_model_fields(model).items(): field_value = getattr(value, name) - if PYDANTIC_V2: - allow_none = False - else: + if PYDANTIC_V1: # in v1 nullability was structured differently # https://docs.pydantic.dev/2.0/migration/#required-optional-and-nullable-fields allow_none = getattr(field, "allow_none", False) + else: + allow_none = False assert_matches_type( field_outer_type(field), From 80fcbce71e8d64f39b20dbac68d258cfd4a8a9c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 14:47:08 +0000 Subject: [PATCH 199/505] chore(internal): move mypy configurations to `pyproject.toml` file --- mypy.ini | 50 ------------------------------------------------ pyproject.toml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 50 deletions(-) delete mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index e2d13204..00000000 --- a/mypy.ini +++ /dev/null @@ -1,50 +0,0 @@ -[mypy] -pretty = True -show_error_codes = True - -# Exclude _files.py because mypy isn't smart enough to apply -# the correct type narrowing and as this is an internal module -# it's fine to just use Pyright. -# -# We also exclude our `tests` as mypy doesn't always infer -# types correctly and Pyright will still catch any type errors. -exclude = ^(src/gitpod/_files\.py|_dev/.*\.py|tests/.*)$ - -strict_equality = True -implicit_reexport = True -check_untyped_defs = True -no_implicit_optional = True - -warn_return_any = True -warn_unreachable = True -warn_unused_configs = True - -# Turn these options off as it could cause conflicts -# with the Pyright options. -warn_unused_ignores = False -warn_redundant_casts = False - -disallow_any_generics = True -disallow_untyped_defs = True -disallow_untyped_calls = True -disallow_subclassing_any = True -disallow_incomplete_defs = True -disallow_untyped_decorators = True -cache_fine_grained = True - -# By default, mypy reports an error if you assign a value to the result -# of a function call that doesn't return anything. We do this in our test -# cases: -# ``` -# result = ... -# assert result is None -# ``` -# Changing this codegen to make mypy happy would increase complexity -# and would not be worth it. -disable_error_code = func-returns-value,overload-cannot-match - -# https://github.com/python/mypy/issues/12162 -[mypy.overrides] -module = "black.files.*" -ignore_errors = true -ignore_missing_imports = true diff --git a/pyproject.toml b/pyproject.toml index fa779412..6e6cff1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -157,6 +157,58 @@ reportOverlappingOverload = false reportImportCycles = false reportPrivateUsage = false +[tool.mypy] +pretty = true +show_error_codes = true + +# Exclude _files.py because mypy isn't smart enough to apply +# the correct type narrowing and as this is an internal module +# it's fine to just use Pyright. +# +# We also exclude our `tests` as mypy doesn't always infer +# types correctly and Pyright will still catch any type errors. +exclude = ['src/gitpod/_files.py', '_dev/.*.py', 'tests/.*'] + +strict_equality = true +implicit_reexport = true +check_untyped_defs = true +no_implicit_optional = true + +warn_return_any = true +warn_unreachable = true +warn_unused_configs = true + +# Turn these options off as it could cause conflicts +# with the Pyright options. +warn_unused_ignores = false +warn_redundant_casts = false + +disallow_any_generics = true +disallow_untyped_defs = true +disallow_untyped_calls = true +disallow_subclassing_any = true +disallow_incomplete_defs = true +disallow_untyped_decorators = true +cache_fine_grained = true + +# By default, mypy reports an error if you assign a value to the result +# of a function call that doesn't return anything. We do this in our test +# cases: +# ``` +# result = ... +# assert result is None +# ``` +# Changing this codegen to make mypy happy would increase complexity +# and would not be worth it. +disable_error_code = "func-returns-value,overload-cannot-match" + +# https://github.com/python/mypy/issues/12162 +[[tool.mypy.overrides]] +module = "black.files.*" +ignore_errors = true +ignore_missing_imports = true + + [tool.ruff] line-length = 120 output-format = "grouped" From c4f67c18d45d0cd4a2ccee9e5b1a68de07a42250 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 22:00:25 +0000 Subject: [PATCH 200/505] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6151d953..d2b21929 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 119 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ca9a49ac7fbb63f55611fd7cd48a22a3ff8b38a797125c8513e891d9b7345550.yml openapi_spec_hash: fd6ffbdfaefcc555e61ca1c565e05214 -config_hash: 4e185fe86d21ca21f2b484a2c647cc68 +config_hash: 6e0a070326b83dc6e5544baae3d14bbb From 943eb61b354ed30b94a4977d4b2e179842e91cb0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 21:25:42 +0000 Subject: [PATCH 201/505] chore(tests): simplify `get_platform` test `nest_asyncio` is archived and broken on some platforms so it's not worth keeping in our test suite. --- pyproject.toml | 1 - requirements-dev.lock | 1 - tests/test_client.py | 53 +++++-------------------------------------- 3 files changed, 6 insertions(+), 49 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6e6cff1e..0f527e52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,6 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - "nest_asyncio==1.6.0", "pytest-xdist>=3.6.1", ] diff --git a/requirements-dev.lock b/requirements-dev.lock index d4964258..5682c917 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -75,7 +75,6 @@ multidict==6.4.4 mypy==1.14.1 mypy-extensions==1.0.0 # via mypy -nest-asyncio==1.6.0 nodeenv==1.8.0 # via pyright nox==2023.4.22 diff --git a/tests/test_client.py b/tests/test_client.py index 1c80f7b8..cb493a90 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -6,13 +6,10 @@ import os import sys import json -import time import asyncio import inspect -import subprocess import tracemalloc from typing import Any, Union, cast -from textwrap import dedent from unittest import mock from typing_extensions import Literal @@ -23,14 +20,17 @@ from gitpod import Gitpod, AsyncGitpod, APIResponseValidationError from gitpod._types import Omit +from gitpod._utils import asyncify from gitpod._models import BaseModel, FinalRequestOptions from gitpod._exceptions import GitpodError, APIStatusError, APITimeoutError, APIResponseValidationError from gitpod._base_client import ( DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, + OtherPlatform, DefaultHttpxClient, DefaultAsyncHttpxClient, + get_platform, make_request_options, ) @@ -1683,50 +1683,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" - def test_get_platform(self) -> None: - # A previous implementation of asyncify could leave threads unterminated when - # used with nest_asyncio. - # - # Since nest_asyncio.apply() is global and cannot be un-applied, this - # test is run in a separate process to avoid affecting other tests. - test_code = dedent(""" - import asyncio - import nest_asyncio - import threading - - from gitpod._utils import asyncify - from gitpod._base_client import get_platform - - async def test_main() -> None: - result = await asyncify(get_platform)() - print(result) - for thread in threading.enumerate(): - print(thread.name) - - nest_asyncio.apply() - asyncio.run(test_main()) - """) - with subprocess.Popen( - [sys.executable, "-c", test_code], - text=True, - ) as process: - timeout = 10 # seconds - - start_time = time.monotonic() - while True: - return_code = process.poll() - if return_code is not None: - if return_code != 0: - raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") - - # success - break - - if time.monotonic() - start_time > timeout: - process.kill() - raise AssertionError("calling get_platform using asyncify resulted in a hung process") - - time.sleep(0.1) + async def test_get_platform(self) -> None: + platform = await asyncify(get_platform)() + assert isinstance(platform, (str, OtherPlatform)) async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly From 0dc81a58e3c3963d996d550e7e2497a59dc5cfbf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Sep 2025 19:12:34 +0000 Subject: [PATCH 202/505] chore(internal): update pydantic dependency --- requirements-dev.lock | 7 +++++-- requirements.lock | 7 +++++-- src/gitpod/_models.py | 14 ++++++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 5682c917..7106de61 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -88,9 +88,9 @@ pluggy==1.5.0 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via gitpod-sdk -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic pygments==2.18.0 # via rich @@ -126,6 +126,9 @@ typing-extensions==4.12.2 # via pydantic # via pydantic-core # via pyright + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic virtualenv==20.24.5 # via nox yarl==1.20.0 diff --git a/requirements.lock b/requirements.lock index c0455c90..e1664d85 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,9 +55,9 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via gitpod-sdk -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic sniffio==1.3.0 # via anyio @@ -68,5 +68,8 @@ typing-extensions==4.12.2 # via multidict # via pydantic # via pydantic-core + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic yarl==1.20.0 # via aiohttp diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 3a6017ef..6a3cd1d2 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -256,7 +256,7 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, @@ -264,6 +264,7 @@ def model_dump( warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, serialize_as_any: bool = False, + fallback: Callable[[Any], Any] | None = None, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -295,10 +296,12 @@ def model_dump( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, @@ -313,13 +316,14 @@ def model_dump_json( indent: int | None = None, include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, + fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json @@ -348,11 +352,13 @@ def model_dump_json( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, From a2a54f63b808b2645c9535d8cfc7bdb1c87d10d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:23:19 +0000 Subject: [PATCH 203/505] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d2b21929..9333247e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 119 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ca9a49ac7fbb63f55611fd7cd48a22a3ff8b38a797125c8513e891d9b7345550.yml openapi_spec_hash: fd6ffbdfaefcc555e61ca1c565e05214 -config_hash: 6e0a070326b83dc6e5544baae3d14bbb +config_hash: 7fb76543ceafd4a116473f647f8d63b1 From 5aacffd1d0cff6e4c90a6789c47d73675d0bcd57 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:57:15 +0000 Subject: [PATCH 204/505] chore(types): change optional parameter type from NotGiven to Omit --- src/gitpod/__init__.py | 4 +- src/gitpod/_base_client.py | 18 +-- src/gitpod/_client.py | 16 +-- src/gitpod/_qs.py | 14 +- src/gitpod/_types.py | 29 +++-- src/gitpod/_utils/_transform.py | 4 +- src/gitpod/_utils/_utils.py | 8 +- src/gitpod/resources/accounts.py | 58 ++++----- src/gitpod/resources/editors.py | 30 ++--- .../environments/automations/automations.py | 14 +- .../environments/automations/services.py | 94 +++++++------- .../automations/tasks/executions.py | 38 +++--- .../environments/automations/tasks/tasks.py | 86 ++++++------ src/gitpod/resources/environments/classes.py | 22 ++-- .../resources/environments/environments.py | 122 +++++++++--------- src/gitpod/resources/events.py | 34 ++--- src/gitpod/resources/gateways.py | 18 +-- src/gitpod/resources/groups.py | 18 +-- src/gitpod/resources/identity.py | 30 ++--- .../organizations/domain_verifications.py | 34 ++--- src/gitpod/resources/organizations/invites.py | 14 +- .../resources/organizations/organizations.py | 74 +++++------ .../resources/organizations/policies.py | 50 +++---- .../organizations/sso_configurations.py | 58 ++++----- src/gitpod/resources/projects/policies.py | 66 +++++----- src/gitpod/resources/projects/projects.py | 102 +++++++-------- .../runners/configurations/configurations.py | 18 +-- .../configurations/environment_classes.py | 70 +++++----- .../host_authentication_tokens.py | 90 ++++++------- .../runners/configurations/schema.py | 10 +- .../configurations/scm_integrations.py | 94 +++++++------- src/gitpod/resources/runners/policies.py | 66 +++++----- src/gitpod/resources/runners/runners.py | 114 ++++++++-------- src/gitpod/resources/secrets.py | 82 ++++++------ src/gitpod/resources/usage.py | 22 ++-- src/gitpod/resources/users/dotfiles.py | 18 +-- src/gitpod/resources/users/pats.py | 38 +++--- src/gitpod/resources/users/users.py | 22 ++-- tests/test_transform.py | 11 +- 39 files changed, 863 insertions(+), 847 deletions(-) diff --git a/src/gitpod/__init__.py b/src/gitpod/__init__.py index f2a5eb27..64437d6c 100644 --- a/src/gitpod/__init__.py +++ b/src/gitpod/__init__.py @@ -3,7 +3,7 @@ import typing as _t from . import types -from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given from ._utils import file_from_path from ._client import Client, Gitpod, Stream, Timeout, Transport, AsyncClient, AsyncGitpod, AsyncStream, RequestOptions from ._models import BaseModel @@ -38,7 +38,9 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "not_given", "Omit", + "omit", "GitpodError", "APIError", "APIStatusError", diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 14ac3c4c..e817a04e 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -42,7 +42,6 @@ from ._qs import Querystring from ._files import to_httpx_files, async_to_httpx_files from ._types import ( - NOT_GIVEN, Body, Omit, Query, @@ -57,6 +56,7 @@ RequestOptions, HttpxRequestFiles, ModelBuilderProtocol, + not_given, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping from ._compat import PYDANTIC_V1, model_copy, model_dump @@ -145,9 +145,9 @@ def __init__( def __init__( self, *, - url: URL | NotGiven = NOT_GIVEN, - json: Body | NotGiven = NOT_GIVEN, - params: Query | NotGiven = NOT_GIVEN, + url: URL | NotGiven = not_given, + json: Body | NotGiven = not_given, + params: Query | NotGiven = not_given, ) -> None: self.url = url self.json = json @@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques # we internally support defining a temporary header to override the # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response` # see _response.py for implementation details - override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN) + override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given) if is_given(override_cast_to): options.headers = headers return cast(Type[ResponseT], override_cast_to) @@ -825,7 +825,7 @@ def __init__( version: str, base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1356,7 +1356,7 @@ def __init__( base_url: str | URL, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1818,8 +1818,8 @@ def make_request_options( extra_query: Query | None = None, extra_body: Body | None = None, idempotency_key: str | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - post_parser: PostParser | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + post_parser: PostParser | NotGiven = not_given, ) -> RequestOptions: """Create a dict of type RequestOptions without keys of NotGiven values.""" options: RequestOptions = {} diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index dd0ccc22..d3675ad8 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Union, Mapping +from typing import Any, Mapping from typing_extensions import Self, override import httpx @@ -11,13 +11,13 @@ from . import _exceptions from ._qs import Querystring from ._types import ( - NOT_GIVEN, Omit, Timeout, NotGiven, Transport, ProxiesTypes, RequestOptions, + not_given, ) from ._utils import is_given, get_async_library from ._version import __version__ @@ -63,7 +63,7 @@ def __init__( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -150,9 +150,9 @@ def copy( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -255,7 +255,7 @@ def __init__( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -342,9 +342,9 @@ def copy( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, diff --git a/src/gitpod/_qs.py b/src/gitpod/_qs.py index 274320ca..ada6fd3f 100644 --- a/src/gitpod/_qs.py +++ b/src/gitpod/_qs.py @@ -4,7 +4,7 @@ from urllib.parse import parse_qs, urlencode from typing_extensions import Literal, get_args -from ._types import NOT_GIVEN, NotGiven, NotGivenOr +from ._types import NotGiven, not_given from ._utils import flatten _T = TypeVar("_T") @@ -41,8 +41,8 @@ def stringify( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> str: return urlencode( self.stringify_items( @@ -56,8 +56,8 @@ def stringify_items( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> list[tuple[str, str]]: opts = Options( qs=self, @@ -143,8 +143,8 @@ def __init__( self, qs: Querystring = _qs, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> None: self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format diff --git a/src/gitpod/_types.py b/src/gitpod/_types.py index b5c5d596..a4e7196a 100644 --- a/src/gitpod/_types.py +++ b/src/gitpod/_types.py @@ -117,18 +117,21 @@ class RequestOptions(TypedDict, total=False): # Sentinel class used until PEP 0661 is accepted class NotGiven: """ - A sentinel singleton class used to distinguish omitted keyword arguments - from those passed in with the value None (which may have different behavior). + For parameters with a meaningful None value, we need to distinguish between + the user explicitly passing None, and the user not passing the parameter at + all. + + User code shouldn't need to use not_given directly. For example: ```py - def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ... + def create(timeout: Timeout | None | NotGiven = not_given): ... - get(timeout=1) # 1s timeout - get(timeout=None) # No timeout - get() # Default timeout behavior, which may not be statically known at the method definition. + create(timeout=1) # 1s timeout + create(timeout=None) # No timeout + create() # Default timeout behavior ``` """ @@ -140,13 +143,14 @@ def __repr__(self) -> str: return "NOT_GIVEN" -NotGivenOr = Union[_T, NotGiven] +not_given = NotGiven() +# for backwards compatibility: NOT_GIVEN = NotGiven() class Omit: - """In certain situations you need to be able to represent a case where a default value has - to be explicitly removed and `None` is not an appropriate substitute, for example: + """ + To explicitly omit something from being sent in a request, use `omit`. ```py # as the default `Content-Type` header is `application/json` that will be sent @@ -156,8 +160,8 @@ class Omit: # to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983' client.post(..., headers={"Content-Type": "multipart/form-data"}) - # instead you can remove the default `application/json` header by passing Omit - client.post(..., headers={"Content-Type": Omit()}) + # instead you can remove the default `application/json` header by passing omit + client.post(..., headers={"Content-Type": omit}) ``` """ @@ -165,6 +169,9 @@ def __bool__(self) -> Literal[False]: return False +omit = Omit() + + @runtime_checkable class ModelBuilderProtocol(Protocol): @classmethod diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index c19124f0..52075492 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -268,7 +268,7 @@ def _transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue @@ -434,7 +434,7 @@ async def _async_transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue diff --git a/src/gitpod/_utils/_utils.py b/src/gitpod/_utils/_utils.py index f0818595..50d59269 100644 --- a/src/gitpod/_utils/_utils.py +++ b/src/gitpod/_utils/_utils.py @@ -21,7 +21,7 @@ import sniffio -from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike +from .._types import Omit, NotGiven, FileTypes, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -63,7 +63,7 @@ def _extract_items( try: key = path[index] except IndexError: - if isinstance(obj, NotGiven): + if not is_given(obj): # no value was provided - we can safely ignore return [] @@ -126,8 +126,8 @@ def _extract_items( return [] -def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: - return not isinstance(obj, NotGiven) +def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: + return not isinstance(obj, NotGiven) and not isinstance(obj, Omit) # Type safe methods for narrowing types with TypeVars. diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index e756632b..664b3f80 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -13,7 +13,7 @@ account_list_login_providers_params, account_list_joinable_organizations_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -56,13 +56,13 @@ def with_streaming_response(self) -> AccountsResourceWithStreamingResponse: def retrieve( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountRetrieveResponse: """ Gets information about the currently authenticated account. @@ -111,7 +111,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an account permanently. @@ -156,13 +156,13 @@ def get_sso_login_url( self, *, email: str, - return_to: Optional[str] | NotGiven = NOT_GIVEN, + return_to: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountGetSSOLoginURLResponse: """ Gets the SSO login URL for a specific email domain. @@ -223,15 +223,15 @@ def get_sso_login_url( def list_joinable_organizations( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - empty: bool | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountListJoinableOrganizationsResponse: """ Lists organizations that the currently authenticated account can join. @@ -285,16 +285,16 @@ def list_joinable_organizations( def list_login_providers( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: account_list_login_providers_params.Filter | NotGiven = NOT_GIVEN, - pagination: account_list_login_providers_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: account_list_login_providers_params.Filter | Omit = omit, + pagination: account_list_login_providers_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncLoginProvidersPage[LoginProvider]: """ Lists available login providers with optional filtering. @@ -391,13 +391,13 @@ def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse: async def retrieve( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountRetrieveResponse: """ Gets information about the currently authenticated account. @@ -446,7 +446,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an account permanently. @@ -491,13 +491,13 @@ async def get_sso_login_url( self, *, email: str, - return_to: Optional[str] | NotGiven = NOT_GIVEN, + return_to: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountGetSSOLoginURLResponse: """ Gets the SSO login URL for a specific email domain. @@ -558,15 +558,15 @@ async def get_sso_login_url( async def list_joinable_organizations( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - empty: bool | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountListJoinableOrganizationsResponse: """ Lists organizations that the currently authenticated account can join. @@ -620,16 +620,16 @@ async def list_joinable_organizations( def list_login_providers( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: account_list_login_providers_params.Filter | NotGiven = NOT_GIVEN, - pagination: account_list_login_providers_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: account_list_login_providers_params.Filter | Omit = omit, + pagination: account_list_login_providers_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[LoginProvider, AsyncLoginProvidersPage[LoginProvider]]: """ Lists available login providers with optional filtering. diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 3c3075f2..a66b33f4 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -5,7 +5,7 @@ import httpx from ..types import editor_list_params, editor_retrieve_params, editor_resolve_url_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -53,7 +53,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EditorRetrieveResponse: """ Gets details about a specific editor. @@ -96,16 +96,16 @@ def retrieve( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: editor_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: editor_list_params.Filter | Omit = omit, + pagination: editor_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEditorsPage[Editor]: """ Lists all available code editors, optionally filtered to those allowed in an @@ -192,7 +192,7 @@ def resolve_url( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EditorResolveURLResponse: """ Resolves the URL for accessing an editor in a specific environment. @@ -277,7 +277,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EditorRetrieveResponse: """ Gets details about a specific editor. @@ -320,16 +320,16 @@ async def retrieve( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: editor_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: editor_list_params.Filter | Omit = omit, + pagination: editor_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Editor, AsyncEditorsPage[Editor]]: """ Lists all available code editors, optionally filtered to those allowed in an @@ -416,7 +416,7 @@ async def resolve_url( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EditorResolveURLResponse: """ Resolves the URL for accessing an editor in a specific environment. diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index 9eda852d..f2c08556 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -12,7 +12,7 @@ ServicesResourceWithStreamingResponse, AsyncServicesResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from .tasks.tasks import ( @@ -69,14 +69,14 @@ def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: def upsert( self, *, - automations_file: AutomationsFileParam | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, + automations_file: AutomationsFileParam | Omit = omit, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomationUpsertResponse: """ Upserts the automations file for the given environment. @@ -175,14 +175,14 @@ def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingRespon async def upsert( self, *, - automations_file: AutomationsFileParam | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, + automations_file: AutomationsFileParam | Omit = omit, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomationUpsertResponse: """ Upserts the automations file for the given environment. diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index 0083cfbb..f5d5440d 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -57,15 +57,15 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: def create( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: ServiceMetadataParam | NotGiven = NOT_GIVEN, - spec: ServiceSpecParam | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + metadata: ServiceMetadataParam | Omit = omit, + spec: ServiceSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceCreateResponse: """ Creates a new automation service for an environment. @@ -143,13 +143,13 @@ def create( def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceRetrieveResponse: """ Gets details about a specific automation service. @@ -192,16 +192,16 @@ def retrieve( def update( self, *, - id: str | NotGiven = NOT_GIVEN, - metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: service_update_params.Spec | NotGiven = NOT_GIVEN, - status: service_update_params.Status | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + metadata: service_update_params.Metadata | Omit = omit, + spec: service_update_params.Spec | Omit = omit, + status: service_update_params.Status | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an automation service configuration. @@ -277,16 +277,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: service_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: service_list_params.Filter | Omit = omit, + pagination: service_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncServicesPage[Service]: """ Lists automation services with optional filtering. @@ -364,14 +364,14 @@ def list( def delete( self, *, - id: str | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Deletes an automation service. @@ -431,13 +431,13 @@ def delete( def start( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Starts an automation service. @@ -482,13 +482,13 @@ def start( def stop( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Stops an automation service. @@ -554,15 +554,15 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: async def create( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: ServiceMetadataParam | NotGiven = NOT_GIVEN, - spec: ServiceSpecParam | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + metadata: ServiceMetadataParam | Omit = omit, + spec: ServiceSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceCreateResponse: """ Creates a new automation service for an environment. @@ -640,13 +640,13 @@ async def create( async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceRetrieveResponse: """ Gets details about a specific automation service. @@ -689,16 +689,16 @@ async def retrieve( async def update( self, *, - id: str | NotGiven = NOT_GIVEN, - metadata: service_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: service_update_params.Spec | NotGiven = NOT_GIVEN, - status: service_update_params.Status | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + metadata: service_update_params.Metadata | Omit = omit, + spec: service_update_params.Spec | Omit = omit, + status: service_update_params.Status | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an automation service configuration. @@ -774,16 +774,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: service_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: service_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: service_list_params.Filter | Omit = omit, + pagination: service_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Service, AsyncServicesPage[Service]]: """ Lists automation services with optional filtering. @@ -861,14 +861,14 @@ def list( async def delete( self, *, - id: str | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Deletes an automation service. @@ -928,13 +928,13 @@ async def delete( async def start( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Starts an automation service. @@ -979,13 +979,13 @@ async def start( async def stop( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Stops an automation service. diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index 3fff1115..d834d48a 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -50,13 +50,13 @@ def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExecutionRetrieveResponse: """ Gets details about a specific task execution. @@ -99,16 +99,16 @@ def retrieve( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: execution_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: execution_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: execution_list_params.Filter | Omit = omit, + pagination: execution_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncTaskExecutionsPage[TaskExecution]: """ Lists executions of automation tasks. @@ -186,13 +186,13 @@ def list( def stop( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Stops a running task execution. @@ -255,13 +255,13 @@ def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingRespons async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExecutionRetrieveResponse: """ Gets details about a specific task execution. @@ -304,16 +304,16 @@ async def retrieve( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: execution_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: execution_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: execution_list_params.Filter | Omit = omit, + pagination: execution_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TaskExecution, AsyncTaskExecutionsPage[TaskExecution]]: """ Lists executions of automation tasks. @@ -391,13 +391,13 @@ def list( async def stop( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Stops a running task execution. diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 6723fe8a..c1758248 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from .executions import ( ExecutionsResource, @@ -69,16 +69,16 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse: def create( self, *, - depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: TaskMetadata | NotGiven = NOT_GIVEN, - spec: TaskSpec | NotGiven = NOT_GIVEN, + depends_on: SequenceNotStr[str] | Omit = omit, + environment_id: str | Omit = omit, + metadata: TaskMetadata | Omit = omit, + spec: TaskSpec | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskCreateResponse: """ Creates a new automation task. @@ -152,13 +152,13 @@ def create( def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskRetrieveResponse: """ Gets details about a specific automation task. @@ -200,16 +200,16 @@ def retrieve( def update( self, *, - id: str | NotGiven = NOT_GIVEN, - depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: task_update_params.Spec | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + depends_on: SequenceNotStr[str] | Omit = omit, + metadata: task_update_params.Metadata | Omit = omit, + spec: task_update_params.Spec | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an automation task configuration. @@ -276,16 +276,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: task_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: task_list_params.Filter | Omit = omit, + pagination: task_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncTasksPage[Task]: """ Lists automation tasks with optional filtering. @@ -363,13 +363,13 @@ def list( def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an automation task. @@ -411,13 +411,13 @@ def delete( def start( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskStartResponse: """Starts a task by creating a new task execution. @@ -486,16 +486,16 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: async def create( self, *, - depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: TaskMetadata | NotGiven = NOT_GIVEN, - spec: TaskSpec | NotGiven = NOT_GIVEN, + depends_on: SequenceNotStr[str] | Omit = omit, + environment_id: str | Omit = omit, + metadata: TaskMetadata | Omit = omit, + spec: TaskSpec | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskCreateResponse: """ Creates a new automation task. @@ -569,13 +569,13 @@ async def create( async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskRetrieveResponse: """ Gets details about a specific automation task. @@ -617,16 +617,16 @@ async def retrieve( async def update( self, *, - id: str | NotGiven = NOT_GIVEN, - depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: task_update_params.Spec | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + depends_on: SequenceNotStr[str] | Omit = omit, + metadata: task_update_params.Metadata | Omit = omit, + spec: task_update_params.Spec | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an automation task configuration. @@ -693,16 +693,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: task_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: task_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: task_list_params.Filter | Omit = omit, + pagination: task_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Task, AsyncTasksPage[Task]]: """ Lists automation tasks with optional filtering. @@ -780,13 +780,13 @@ def list( async def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an automation task. @@ -828,13 +828,13 @@ async def delete( async def start( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskStartResponse: """Starts a task by creating a new task execution. diff --git a/src/gitpod/resources/environments/classes.py b/src/gitpod/resources/environments/classes.py index ffe58db6..a61eb67e 100644 --- a/src/gitpod/resources/environments/classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -45,16 +45,16 @@ def with_streaming_response(self) -> ClassesResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: class_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: class_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: class_list_params.Filter | Omit = omit, + pagination: class_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ Lists available environment classes with their specifications and resource @@ -138,16 +138,16 @@ def with_streaming_response(self) -> AsyncClassesResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: class_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: class_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: class_list_params.Filter | Omit = omit, + pagination: class_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ Lists available environment classes with their specifications and resource diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index e57316b8..6de9f762 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -28,7 +28,7 @@ ClassesResourceWithStreamingResponse, AsyncClassesResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -91,13 +91,13 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: def create( self, *, - spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, + spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateResponse: """Creates a development environment from a context URL (e.g. @@ -193,7 +193,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentRetrieveResponse: """ Gets details about a specific environment including its status, configuration, @@ -242,15 +242,15 @@ def retrieve( def update( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: Optional[environment_update_params.Metadata] | NotGiven = NOT_GIVEN, - spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + metadata: Optional[environment_update_params.Metadata] | Omit = omit, + spec: Optional[environment_update_params.Spec] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an environment's configuration while it is running. @@ -336,16 +336,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: environment_list_params.Filter | Omit = omit, + pagination: environment_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEnvironmentsPage[Environment]: """ Lists all environments matching the specified criteria. @@ -427,14 +427,14 @@ def list( def delete( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Permanently deletes an environment. @@ -504,7 +504,7 @@ def create_environment_token( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateEnvironmentTokenResponse: """ Creates an access token for the environment. @@ -549,14 +549,14 @@ def create_environment_token( def create_from_project( self, *, - project_id: str | NotGiven = NOT_GIVEN, - spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, + spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateFromProjectResponse: """ Creates an environment from an existing project configuration and starts it. @@ -621,13 +621,13 @@ def create_from_project( def create_logs_token( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateLogsTokenResponse: """ Creates an access token for retrieving environment logs. @@ -674,14 +674,14 @@ def create_logs_token( def mark_active( self, *, - activity_signal: EnvironmentActivitySignalParam | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, + activity_signal: EnvironmentActivitySignalParam | Omit = omit, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Records environment activity to prevent automatic shutdown. @@ -733,13 +733,13 @@ def mark_active( def start( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Starts a stopped environment. @@ -781,13 +781,13 @@ def start( def stop( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Stops a running environment. @@ -830,13 +830,13 @@ def stop( def unarchive( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Unarchives an environment. @@ -905,13 +905,13 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo async def create( self, *, - spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, + spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateResponse: """Creates a development environment from a context URL (e.g. @@ -1007,7 +1007,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentRetrieveResponse: """ Gets details about a specific environment including its status, configuration, @@ -1056,15 +1056,15 @@ async def retrieve( async def update( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: Optional[environment_update_params.Metadata] | NotGiven = NOT_GIVEN, - spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + metadata: Optional[environment_update_params.Metadata] | Omit = omit, + spec: Optional[environment_update_params.Spec] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an environment's configuration while it is running. @@ -1150,16 +1150,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: environment_list_params.Filter | Omit = omit, + pagination: environment_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Environment, AsyncEnvironmentsPage[Environment]]: """ Lists all environments matching the specified criteria. @@ -1241,14 +1241,14 @@ def list( async def delete( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Permanently deletes an environment. @@ -1318,7 +1318,7 @@ async def create_environment_token( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateEnvironmentTokenResponse: """ Creates an access token for the environment. @@ -1363,14 +1363,14 @@ async def create_environment_token( async def create_from_project( self, *, - project_id: str | NotGiven = NOT_GIVEN, - spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, + spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateFromProjectResponse: """ Creates an environment from an existing project configuration and starts it. @@ -1435,13 +1435,13 @@ async def create_from_project( async def create_logs_token( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateLogsTokenResponse: """ Creates an access token for retrieving environment logs. @@ -1488,14 +1488,14 @@ async def create_logs_token( async def mark_active( self, *, - activity_signal: EnvironmentActivitySignalParam | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, + activity_signal: EnvironmentActivitySignalParam | Omit = omit, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Records environment activity to prevent automatic shutdown. @@ -1547,13 +1547,13 @@ async def mark_active( async def start( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Starts a stopped environment. @@ -1597,13 +1597,13 @@ async def start( async def stop( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Stops a running environment. @@ -1648,13 +1648,13 @@ async def stop( async def unarchive( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Unarchives an environment. diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index b28929f1..a37c2a27 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -5,7 +5,7 @@ import httpx from ..types import event_list_params, event_watch_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -47,16 +47,16 @@ def with_streaming_response(self) -> EventsResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: event_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: event_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: event_list_params.Filter | Omit = omit, + pagination: event_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEntriesPage[EventListResponse]: """ Lists audit logs with filtering and pagination options. @@ -127,14 +127,14 @@ def list( def watch( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - organization: bool | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + organization: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JSONLDecoder[EventWatchResponse]: """ Streams events for all projects, runners, environments, tasks, and services @@ -212,16 +212,16 @@ def with_streaming_response(self) -> AsyncEventsResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: event_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: event_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: event_list_params.Filter | Omit = omit, + pagination: event_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EventListResponse, AsyncEntriesPage[EventListResponse]]: """ Lists audit logs with filtering and pagination options. @@ -292,14 +292,14 @@ def list( async def watch( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - organization: bool | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + organization: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncJSONLDecoder[EventWatchResponse]: """ Streams events for all projects, runners, environments, tasks, and services diff --git a/src/gitpod/resources/gateways.py b/src/gitpod/resources/gateways.py index 9351d6a9..77ded7ed 100644 --- a/src/gitpod/resources/gateways.py +++ b/src/gitpod/resources/gateways.py @@ -5,7 +5,7 @@ import httpx from ..types import gateway_list_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -45,15 +45,15 @@ def with_streaming_response(self) -> GatewaysResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: gateway_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: gateway_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncGatewaysPage[Gateway]: """ ListGateways @@ -114,15 +114,15 @@ def with_streaming_response(self) -> AsyncGatewaysResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: gateway_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: gateway_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Gateway, AsyncGatewaysPage[Gateway]]: """ ListGateways diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py index 56c681f2..36e2ed43 100644 --- a/src/gitpod/resources/groups.py +++ b/src/gitpod/resources/groups.py @@ -5,7 +5,7 @@ import httpx from ..types import group_list_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -45,15 +45,15 @@ def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: group_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: group_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncGroupsPage[Group]: """ Lists groups with optional pagination. @@ -142,15 +142,15 @@ def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: group_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: group_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Group, AsyncGroupsPage[Group]]: """ Lists groups with optional pagination. diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index dc4b0c30..4ad7f4fa 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -10,7 +10,7 @@ identity_exchange_token_params, identity_get_authenticated_identity_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -52,13 +52,13 @@ def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: def exchange_token( self, *, - exchange_token: str | NotGiven = NOT_GIVEN, + exchange_token: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityExchangeTokenResponse: """ Exchanges an exchange token for a new access token. @@ -104,13 +104,13 @@ def exchange_token( def get_authenticated_identity( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityGetAuthenticatedIdentityResponse: """ Retrieves information about the currently authenticated identity. @@ -155,14 +155,14 @@ def get_authenticated_identity( def get_id_token( self, *, - audience: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - version: IDTokenVersion | NotGiven = NOT_GIVEN, + audience: SequenceNotStr[str] | Omit = omit, + version: IDTokenVersion | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityGetIDTokenResponse: """ Gets an ID token for authenticating with other services. @@ -244,13 +244,13 @@ def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: async def exchange_token( self, *, - exchange_token: str | NotGiven = NOT_GIVEN, + exchange_token: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityExchangeTokenResponse: """ Exchanges an exchange token for a new access token. @@ -296,13 +296,13 @@ async def exchange_token( async def get_authenticated_identity( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityGetAuthenticatedIdentityResponse: """ Retrieves information about the currently authenticated identity. @@ -347,14 +347,14 @@ async def get_authenticated_identity( async def get_id_token( self, *, - audience: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - version: IDTokenVersion | NotGiven = NOT_GIVEN, + audience: SequenceNotStr[str] | Omit = omit, + version: IDTokenVersion | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityGetIDTokenResponse: """ Gets an ID token for authenticating with other services. diff --git a/src/gitpod/resources/organizations/domain_verifications.py b/src/gitpod/resources/organizations/domain_verifications.py index 5468ac8d..6d97f6d1 100644 --- a/src/gitpod/resources/organizations/domain_verifications.py +++ b/src/gitpod/resources/organizations/domain_verifications.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -61,7 +61,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationCreateResponse: """ Initiates domain verification process to enable organization features. @@ -126,7 +126,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationRetrieveResponse: """ Retrieves the status of a domain verification request. @@ -172,15 +172,15 @@ def list( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: domain_verification_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDomainVerificationsPage[DomainVerification]: """ Lists and monitors domain verification status across an organization. @@ -260,7 +260,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a domain verification request. @@ -311,7 +311,7 @@ def verify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationVerifyResponse: """ Verifies domain ownership for an organization. @@ -384,7 +384,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationCreateResponse: """ Initiates domain verification process to enable organization features. @@ -449,7 +449,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationRetrieveResponse: """ Retrieves the status of a domain verification request. @@ -495,15 +495,15 @@ def list( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: domain_verification_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DomainVerification, AsyncDomainVerificationsPage[DomainVerification]]: """ Lists and monitors domain verification status across an organization. @@ -583,7 +583,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a domain verification request. @@ -634,7 +634,7 @@ async def verify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationVerifyResponse: """ Verifies domain ownership for an organization. diff --git a/src/gitpod/resources/organizations/invites.py b/src/gitpod/resources/organizations/invites.py index 8ed2e02c..140f8524 100644 --- a/src/gitpod/resources/organizations/invites.py +++ b/src/gitpod/resources/organizations/invites.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -52,7 +52,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteCreateResponse: """Creates an invite link for joining an organization. @@ -102,7 +102,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteRetrieveResponse: """ GetOrganizationInvite @@ -134,7 +134,7 @@ def get_summary( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteGetSummaryResponse: """ Retrieves organization details and membership info based on an invite link. @@ -204,7 +204,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteCreateResponse: """Creates an invite link for joining an organization. @@ -256,7 +256,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteRetrieveResponse: """ GetOrganizationInvite @@ -290,7 +290,7 @@ async def get_summary( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteGetSummaryResponse: """ Retrieves organization details and membership info based on an invite link. diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 0e989d83..28312caa 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -24,7 +24,7 @@ InvitesResourceWithStreamingResponse, AsyncInvitesResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, @@ -111,14 +111,14 @@ def create( self, *, name: str, - invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, - join_organization: bool | NotGiven = NOT_GIVEN, + invite_accounts_with_matching_domain: bool | Omit = omit, + join_organization: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationCreateResponse: """ Creates a new organization with the specified name and settings. @@ -193,7 +193,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationRetrieveResponse: """ Gets details about a specific organization. @@ -240,14 +240,14 @@ def update( self, *, organization_id: str, - invite_domains: Optional[InviteDomainsParam] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + invite_domains: Optional[InviteDomainsParam] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationUpdateResponse: """ Updates an organization's settings including name, invite domains, and member @@ -325,7 +325,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Permanently deletes an organization. @@ -371,14 +371,14 @@ def delete( def join( self, *, - invite_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + invite_id: str | Omit = omit, + organization_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationJoinResponse: """ Allows users to join an organization through direct ID, invite link, or @@ -445,7 +445,7 @@ def leave( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a user from an organization while preserving organization data. @@ -491,15 +491,15 @@ def list_members( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: organization_list_members_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncMembersPage[OrganizationMember]: """ Lists and filters organization members with optional pagination. @@ -578,13 +578,13 @@ def set_role( *, organization_id: str, user_id: str, - role: OrganizationRole | NotGiven = NOT_GIVEN, + role: OrganizationRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Manages organization membership and roles by setting a user's role within the @@ -684,14 +684,14 @@ async def create( self, *, name: str, - invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, - join_organization: bool | NotGiven = NOT_GIVEN, + invite_accounts_with_matching_domain: bool | Omit = omit, + join_organization: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationCreateResponse: """ Creates a new organization with the specified name and settings. @@ -766,7 +766,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationRetrieveResponse: """ Gets details about a specific organization. @@ -813,14 +813,14 @@ async def update( self, *, organization_id: str, - invite_domains: Optional[InviteDomainsParam] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + invite_domains: Optional[InviteDomainsParam] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationUpdateResponse: """ Updates an organization's settings including name, invite domains, and member @@ -898,7 +898,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Permanently deletes an organization. @@ -944,14 +944,14 @@ async def delete( async def join( self, *, - invite_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + invite_id: str | Omit = omit, + organization_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationJoinResponse: """ Allows users to join an organization through direct ID, invite link, or @@ -1018,7 +1018,7 @@ async def leave( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a user from an organization while preserving organization data. @@ -1064,15 +1064,15 @@ def list_members( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: organization_list_members_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OrganizationMember, AsyncMembersPage[OrganizationMember]]: """ Lists and filters organization members with optional pagination. @@ -1151,13 +1151,13 @@ async def set_role( *, organization_id: str, user_id: str, - role: OrganizationRole | NotGiven = NOT_GIVEN, + role: OrganizationRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Manages organization membership and roles by setting a user's role within the diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 60124dc6..70d3b52d 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -52,7 +52,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyRetrieveResponse: """ Gets organization policy settings by organization ID. @@ -97,22 +97,22 @@ def update( self, *, organization_id: str, - allowed_editor_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - allow_local_runners: Optional[bool] | NotGiven = NOT_GIVEN, - default_editor_id: Optional[str] | NotGiven = NOT_GIVEN, - default_environment_image: Optional[str] | NotGiven = NOT_GIVEN, - maximum_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, - maximum_environment_timeout: Optional[str] | NotGiven = NOT_GIVEN, - maximum_running_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, - members_create_projects: Optional[bool] | NotGiven = NOT_GIVEN, - members_require_projects: Optional[bool] | NotGiven = NOT_GIVEN, - port_sharing_disabled: Optional[bool] | NotGiven = NOT_GIVEN, + allowed_editor_ids: SequenceNotStr[str] | Omit = omit, + allow_local_runners: Optional[bool] | Omit = omit, + default_editor_id: Optional[str] | Omit = omit, + default_environment_image: Optional[str] | Omit = omit, + maximum_environments_per_user: Optional[str] | Omit = omit, + maximum_environment_timeout: Optional[str] | Omit = omit, + maximum_running_environments_per_user: Optional[str] | Omit = omit, + members_create_projects: Optional[bool] | Omit = omit, + members_require_projects: Optional[bool] | Omit = omit, + port_sharing_disabled: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates organization policy settings. @@ -244,7 +244,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyRetrieveResponse: """ Gets organization policy settings by organization ID. @@ -291,22 +291,22 @@ async def update( self, *, organization_id: str, - allowed_editor_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - allow_local_runners: Optional[bool] | NotGiven = NOT_GIVEN, - default_editor_id: Optional[str] | NotGiven = NOT_GIVEN, - default_environment_image: Optional[str] | NotGiven = NOT_GIVEN, - maximum_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, - maximum_environment_timeout: Optional[str] | NotGiven = NOT_GIVEN, - maximum_running_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, - members_create_projects: Optional[bool] | NotGiven = NOT_GIVEN, - members_require_projects: Optional[bool] | NotGiven = NOT_GIVEN, - port_sharing_disabled: Optional[bool] | NotGiven = NOT_GIVEN, + allowed_editor_ids: SequenceNotStr[str] | Omit = omit, + allow_local_runners: Optional[bool] | Omit = omit, + default_editor_id: Optional[str] | Omit = omit, + default_environment_image: Optional[str] | Omit = omit, + maximum_environments_per_user: Optional[str] | Omit = omit, + maximum_environment_timeout: Optional[str] | Omit = omit, + maximum_running_environments_per_user: Optional[str] | Omit = omit, + members_create_projects: Optional[bool] | Omit = omit, + members_require_projects: Optional[bool] | Omit = omit, + port_sharing_disabled: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates organization policy settings. diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 6cdb528a..c0f1dad1 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -67,7 +67,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SSOConfigurationCreateResponse: """ Creates or updates SSO configuration for organizational authentication. @@ -149,7 +149,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SSOConfigurationRetrieveResponse: """ Retrieves a specific SSO configuration. @@ -197,18 +197,18 @@ def update( self, *, sso_configuration_id: str, - claims: Dict[str, str] | NotGiven = NOT_GIVEN, - client_id: Optional[str] | NotGiven = NOT_GIVEN, - client_secret: Optional[str] | NotGiven = NOT_GIVEN, - email_domain: Optional[str] | NotGiven = NOT_GIVEN, - issuer_url: Optional[str] | NotGiven = NOT_GIVEN, - state: Optional[SSOConfigurationState] | NotGiven = NOT_GIVEN, + claims: Dict[str, str] | Omit = omit, + client_id: Optional[str] | Omit = omit, + client_secret: Optional[str] | Omit = omit, + email_domain: Optional[str] | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + state: Optional[SSOConfigurationState] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates SSO provider settings and authentication rules. @@ -287,15 +287,15 @@ def list( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: sso_configuration_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: sso_configuration_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSSOConfigurationsPage[SSOConfiguration]: """ Lists and filters SSO configurations for an organization. @@ -377,7 +377,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes an SSO configuration from an organization. @@ -453,7 +453,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SSOConfigurationCreateResponse: """ Creates or updates SSO configuration for organizational authentication. @@ -535,7 +535,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SSOConfigurationRetrieveResponse: """ Retrieves a specific SSO configuration. @@ -583,18 +583,18 @@ async def update( self, *, sso_configuration_id: str, - claims: Dict[str, str] | NotGiven = NOT_GIVEN, - client_id: Optional[str] | NotGiven = NOT_GIVEN, - client_secret: Optional[str] | NotGiven = NOT_GIVEN, - email_domain: Optional[str] | NotGiven = NOT_GIVEN, - issuer_url: Optional[str] | NotGiven = NOT_GIVEN, - state: Optional[SSOConfigurationState] | NotGiven = NOT_GIVEN, + claims: Dict[str, str] | Omit = omit, + client_id: Optional[str] | Omit = omit, + client_secret: Optional[str] | Omit = omit, + email_domain: Optional[str] | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + state: Optional[SSOConfigurationState] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates SSO provider settings and authentication rules. @@ -673,15 +673,15 @@ def list( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: sso_configuration_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: sso_configuration_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SSOConfiguration, AsyncSSOConfigurationsPage[SSOConfiguration]]: """ Lists and filters SSO configurations for an organization. @@ -763,7 +763,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes an SSO configuration from an organization. diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index fc12621f..0c873cc8 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,15 +54,15 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def create( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - role: ProjectRole | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, + role: ProjectRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyCreateResponse: """ Creates a new policy for a project. @@ -117,15 +117,15 @@ def create( def update( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - role: ProjectRole | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, + role: ProjectRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyUpdateResponse: """ Updates an existing project policy. @@ -180,16 +180,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: policy_list_params.Pagination | Omit = omit, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncPoliciesPage[ProjectPolicy]: """ Lists policies for a project. @@ -255,14 +255,14 @@ def list( def delete( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a project policy. @@ -336,15 +336,15 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def create( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - role: ProjectRole | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, + role: ProjectRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyCreateResponse: """ Creates a new policy for a project. @@ -399,15 +399,15 @@ async def create( async def update( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - role: ProjectRole | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, + role: ProjectRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyUpdateResponse: """ Updates an existing project policy. @@ -462,16 +462,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: policy_list_params.Pagination | Omit = omit, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ProjectPolicy, AsyncPoliciesPage[ProjectPolicy]]: """ Lists policies for a project. @@ -537,14 +537,14 @@ def list( async def delete( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a project policy. diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 2c8e6375..d8d61de5 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -14,7 +14,7 @@ project_retrieve_params, project_create_from_environment_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, @@ -74,16 +74,16 @@ def create( *, environment_class: ProjectEnvironmentClassParam, initializer: EnvironmentInitializerParam, - automations_file_path: str | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - technical_description: str | NotGiven = NOT_GIVEN, + automations_file_path: str | Omit = omit, + devcontainer_file_path: str | Omit = omit, + name: str | Omit = omit, + technical_description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectCreateResponse: """ Creates a new project with specified configuration. @@ -177,13 +177,13 @@ def create( def retrieve( self, *, - project_id: str | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectRetrieveResponse: """ Gets details about a specific project. @@ -227,19 +227,19 @@ def retrieve( def update( self, *, - automations_file_path: Optional[str] | NotGiven = NOT_GIVEN, - devcontainer_file_path: Optional[str] | NotGiven = NOT_GIVEN, - environment_class: Optional[ProjectEnvironmentClassParam] | NotGiven = NOT_GIVEN, - initializer: Optional[EnvironmentInitializerParam] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - technical_description: Optional[str] | NotGiven = NOT_GIVEN, + automations_file_path: Optional[str] | Omit = omit, + devcontainer_file_path: Optional[str] | Omit = omit, + environment_class: Optional[ProjectEnvironmentClassParam] | Omit = omit, + initializer: Optional[EnvironmentInitializerParam] | Omit = omit, + name: Optional[str] | Omit = omit, + project_id: str | Omit = omit, + technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectUpdateResponse: """ Updates a project's configuration. @@ -325,16 +325,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: project_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: project_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: project_list_params.Filter | Omit = omit, + pagination: project_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncProjectsPage[Project]: """ Lists projects with optional filtering. @@ -397,13 +397,13 @@ def list( def delete( self, *, - project_id: str | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a project permanently. @@ -447,14 +447,14 @@ def delete( def create_from_environment( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectCreateFromEnvironmentResponse: """ Creates a new project using an existing environment as a template. @@ -532,16 +532,16 @@ async def create( *, environment_class: ProjectEnvironmentClassParam, initializer: EnvironmentInitializerParam, - automations_file_path: str | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - technical_description: str | NotGiven = NOT_GIVEN, + automations_file_path: str | Omit = omit, + devcontainer_file_path: str | Omit = omit, + name: str | Omit = omit, + technical_description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectCreateResponse: """ Creates a new project with specified configuration. @@ -635,13 +635,13 @@ async def create( async def retrieve( self, *, - project_id: str | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectRetrieveResponse: """ Gets details about a specific project. @@ -685,19 +685,19 @@ async def retrieve( async def update( self, *, - automations_file_path: Optional[str] | NotGiven = NOT_GIVEN, - devcontainer_file_path: Optional[str] | NotGiven = NOT_GIVEN, - environment_class: Optional[ProjectEnvironmentClassParam] | NotGiven = NOT_GIVEN, - initializer: Optional[EnvironmentInitializerParam] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - technical_description: Optional[str] | NotGiven = NOT_GIVEN, + automations_file_path: Optional[str] | Omit = omit, + devcontainer_file_path: Optional[str] | Omit = omit, + environment_class: Optional[ProjectEnvironmentClassParam] | Omit = omit, + initializer: Optional[EnvironmentInitializerParam] | Omit = omit, + name: Optional[str] | Omit = omit, + project_id: str | Omit = omit, + technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectUpdateResponse: """ Updates a project's configuration. @@ -783,16 +783,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: project_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: project_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: project_list_params.Filter | Omit = omit, + pagination: project_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Project, AsyncProjectsPage[Project]]: """ Lists projects with optional filtering. @@ -855,13 +855,13 @@ def list( async def delete( self, *, - project_id: str | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a project permanently. @@ -905,14 +905,14 @@ async def delete( async def create_from_environment( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectCreateFromEnvironmentResponse: """ Creates a new project using an existing environment as a template. diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index b9b2c27c..e2506ec0 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -12,7 +12,7 @@ SchemaResourceWithStreamingResponse, AsyncSchemaResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -93,15 +93,15 @@ def with_streaming_response(self) -> ConfigurationsResourceWithStreamingResponse def validate( self, *, - environment_class: EnvironmentClass | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.ScmIntegration | NotGiven = NOT_GIVEN, + environment_class: EnvironmentClass | Omit = omit, + runner_id: str | Omit = omit, + scm_integration: configuration_validate_params.ScmIntegration | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigurationValidateResponse: """ Validates a runner configuration. @@ -193,15 +193,15 @@ def with_streaming_response(self) -> AsyncConfigurationsResourceWithStreamingRes async def validate( self, *, - environment_class: EnvironmentClass | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.ScmIntegration | NotGiven = NOT_GIVEN, + environment_class: EnvironmentClass | Omit = omit, + runner_id: str | Omit = omit, + scm_integration: configuration_validate_params.ScmIntegration | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigurationValidateResponse: """ Validates a runner configuration. diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index ba2137ce..5ad80efe 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -55,16 +55,16 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp def create( self, *, - configuration: Iterable[FieldValue] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - display_name: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + configuration: Iterable[FieldValue] | Omit = omit, + description: str | Omit = omit, + display_name: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentClassCreateResponse: """ Creates a new environment class for a runner. @@ -121,13 +121,13 @@ def create( def retrieve( self, *, - environment_class_id: str | NotGiven = NOT_GIVEN, + environment_class_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentClassRetrieveResponse: """ Gets details about a specific environment class. @@ -172,16 +172,16 @@ def retrieve( def update( self, *, - description: Optional[str] | NotGiven = NOT_GIVEN, - display_name: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, - environment_class_id: str | NotGiven = NOT_GIVEN, + description: Optional[str] | Omit = omit, + display_name: Optional[str] | Omit = omit, + enabled: Optional[bool] | Omit = omit, + environment_class_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an environment class. @@ -234,16 +234,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: environment_class_list_params.Filter | Omit = omit, + pagination: environment_class_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ Lists environment classes with optional filtering. @@ -340,16 +340,16 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin async def create( self, *, - configuration: Iterable[FieldValue] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - display_name: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + configuration: Iterable[FieldValue] | Omit = omit, + description: str | Omit = omit, + display_name: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentClassCreateResponse: """ Creates a new environment class for a runner. @@ -406,13 +406,13 @@ async def create( async def retrieve( self, *, - environment_class_id: str | NotGiven = NOT_GIVEN, + environment_class_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentClassRetrieveResponse: """ Gets details about a specific environment class. @@ -457,16 +457,16 @@ async def retrieve( async def update( self, *, - description: Optional[str] | NotGiven = NOT_GIVEN, - display_name: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, - environment_class_id: str | NotGiven = NOT_GIVEN, + description: Optional[str] | Omit = omit, + display_name: Optional[str] | Omit = omit, + enabled: Optional[bool] | Omit = omit, + environment_class_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an environment class. @@ -519,16 +519,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: environment_class_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_class_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: environment_class_list_params.Filter | Omit = omit, + pagination: environment_class_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ Lists environment classes with optional filtering. diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index af044ec5..1c77a680 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -62,19 +62,19 @@ def with_streaming_response(self) -> HostAuthenticationTokensResourceWithStreami def create( self, *, - token: str | NotGiven = NOT_GIVEN, - expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - host: str | NotGiven = NOT_GIVEN, - refresh_token: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - source: HostAuthenticationTokenSource | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + expires_at: Union[str, datetime] | Omit = omit, + host: str | Omit = omit, + refresh_token: str | Omit = omit, + runner_id: str | Omit = omit, + source: HostAuthenticationTokenSource | Omit = omit, + user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HostAuthenticationTokenCreateResponse: """ Creates a new authentication token for accessing remote hosts. @@ -222,13 +222,13 @@ def create( def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HostAuthenticationTokenRetrieveResponse: """ Gets details about a specific host authentication token. @@ -272,16 +272,16 @@ def retrieve( def update( self, *, - id: str | NotGiven = NOT_GIVEN, - token: Optional[str] | NotGiven = NOT_GIVEN, - expires_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - refresh_token: Optional[str] | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + token: Optional[str] | Omit = omit, + expires_at: Union[str, datetime, None] | Omit = omit, + refresh_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an existing host authentication token. @@ -423,16 +423,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: host_authentication_token_list_params.Filter | Omit = omit, + pagination: host_authentication_token_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncTokensPage[HostAuthenticationToken]: """ Lists host authentication tokens with optional filtering. @@ -504,13 +504,13 @@ def list( def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a host authentication token. @@ -575,19 +575,19 @@ def with_streaming_response(self) -> AsyncHostAuthenticationTokensResourceWithSt async def create( self, *, - token: str | NotGiven = NOT_GIVEN, - expires_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - host: str | NotGiven = NOT_GIVEN, - refresh_token: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - source: HostAuthenticationTokenSource | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + expires_at: Union[str, datetime] | Omit = omit, + host: str | Omit = omit, + refresh_token: str | Omit = omit, + runner_id: str | Omit = omit, + source: HostAuthenticationTokenSource | Omit = omit, + user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HostAuthenticationTokenCreateResponse: """ Creates a new authentication token for accessing remote hosts. @@ -735,13 +735,13 @@ async def create( async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HostAuthenticationTokenRetrieveResponse: """ Gets details about a specific host authentication token. @@ -785,16 +785,16 @@ async def retrieve( async def update( self, *, - id: str | NotGiven = NOT_GIVEN, - token: Optional[str] | NotGiven = NOT_GIVEN, - expires_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - refresh_token: Optional[str] | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + token: Optional[str] | Omit = omit, + expires_at: Union[str, datetime, None] | Omit = omit, + refresh_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an existing host authentication token. @@ -936,16 +936,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: host_authentication_token_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: host_authentication_token_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: host_authentication_token_list_params.Filter | Omit = omit, + pagination: host_authentication_token_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[HostAuthenticationToken, AsyncTokensPage[HostAuthenticationToken]]: """ Lists host authentication tokens with optional filtering. @@ -1017,13 +1017,13 @@ def list( async def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a host authentication token. diff --git a/src/gitpod/resources/runners/configurations/schema.py b/src/gitpod/resources/runners/configurations/schema.py index 06963e11..958f2a95 100644 --- a/src/gitpod/resources/runners/configurations/schema.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -44,13 +44,13 @@ def with_streaming_response(self) -> SchemaResourceWithStreamingResponse: def retrieve( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaRetrieveResponse: """ Gets the latest runner configuration schema. @@ -113,13 +113,13 @@ def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse: async def retrieve( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaRetrieveResponse: """ Gets the latest runner configuration schema. diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 2947b2e7..2f5f82ad 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -55,19 +55,19 @@ def with_streaming_response(self) -> ScmIntegrationsResourceWithStreamingRespons def create( self, *, - host: str | NotGiven = NOT_GIVEN, - issuer_url: Optional[str] | NotGiven = NOT_GIVEN, - oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, - pat: bool | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - scm_id: str | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + oauth_client_id: Optional[str] | Omit = omit, + oauth_plaintext_client_secret: Optional[str] | Omit = omit, + pat: bool | Omit = omit, + runner_id: str | Omit = omit, + scm_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScmIntegrationCreateResponse: """ Creates a new SCM integration for a runner. @@ -136,13 +136,13 @@ def create( def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScmIntegrationRetrieveResponse: """ Gets details about a specific SCM integration. @@ -184,17 +184,17 @@ def retrieve( def update( self, *, - id: str | NotGiven = NOT_GIVEN, - issuer_url: Optional[str] | NotGiven = NOT_GIVEN, - oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, - pat: Optional[bool] | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + oauth_client_id: Optional[str] | Omit = omit, + oauth_plaintext_client_secret: Optional[str] | Omit = omit, + pat: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an existing SCM integration. @@ -267,16 +267,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: scm_integration_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: scm_integration_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: scm_integration_list_params.Filter | Omit = omit, + pagination: scm_integration_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncIntegrationsPage[ScmIntegration]: """ Lists SCM integrations for a runner. @@ -341,13 +341,13 @@ def list( def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an SCM integration. @@ -410,19 +410,19 @@ def with_streaming_response(self) -> AsyncScmIntegrationsResourceWithStreamingRe async def create( self, *, - host: str | NotGiven = NOT_GIVEN, - issuer_url: Optional[str] | NotGiven = NOT_GIVEN, - oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, - pat: bool | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - scm_id: str | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + oauth_client_id: Optional[str] | Omit = omit, + oauth_plaintext_client_secret: Optional[str] | Omit = omit, + pat: bool | Omit = omit, + runner_id: str | Omit = omit, + scm_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScmIntegrationCreateResponse: """ Creates a new SCM integration for a runner. @@ -491,13 +491,13 @@ async def create( async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScmIntegrationRetrieveResponse: """ Gets details about a specific SCM integration. @@ -539,17 +539,17 @@ async def retrieve( async def update( self, *, - id: str | NotGiven = NOT_GIVEN, - issuer_url: Optional[str] | NotGiven = NOT_GIVEN, - oauth_client_id: Optional[str] | NotGiven = NOT_GIVEN, - oauth_plaintext_client_secret: Optional[str] | NotGiven = NOT_GIVEN, - pat: Optional[bool] | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + oauth_client_id: Optional[str] | Omit = omit, + oauth_plaintext_client_secret: Optional[str] | Omit = omit, + pat: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an existing SCM integration. @@ -622,16 +622,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: scm_integration_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: scm_integration_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: scm_integration_list_params.Filter | Omit = omit, + pagination: scm_integration_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ScmIntegration, AsyncIntegrationsPage[ScmIntegration]]: """ Lists SCM integrations for a runner. @@ -696,13 +696,13 @@ def list( async def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an SCM integration. diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 4ce6cc35..934a8a70 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,15 +54,15 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def create( self, *, - group_id: str | NotGiven = NOT_GIVEN, - role: RunnerRole | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + role: RunnerRole | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyCreateResponse: """ Creates a new policy for a runner. @@ -117,15 +117,15 @@ def create( def update( self, *, - group_id: str | NotGiven = NOT_GIVEN, - role: RunnerRole | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + role: RunnerRole | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyUpdateResponse: """ Updates an existing runner policy. @@ -180,16 +180,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: policy_list_params.Pagination | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncPoliciesPage[RunnerPolicy]: """ Lists policies for a runner. @@ -255,14 +255,14 @@ def list( def delete( self, *, - group_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a runner policy. @@ -336,15 +336,15 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def create( self, *, - group_id: str | NotGiven = NOT_GIVEN, - role: RunnerRole | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + role: RunnerRole | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyCreateResponse: """ Creates a new policy for a runner. @@ -399,15 +399,15 @@ async def create( async def update( self, *, - group_id: str | NotGiven = NOT_GIVEN, - role: RunnerRole | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + role: RunnerRole | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyUpdateResponse: """ Updates an existing runner policy. @@ -462,16 +462,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: policy_list_params.Pagination | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: policy_list_params.Pagination | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RunnerPolicy, AsyncPoliciesPage[RunnerPolicy]]: """ Lists policies for a runner. @@ -537,14 +537,14 @@ def list( async def delete( self, *, - group_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a runner policy. diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 876c5293..5b44c562 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -18,7 +18,7 @@ runner_create_runner_token_params, runner_check_authentication_for_host_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, @@ -90,17 +90,17 @@ def with_streaming_response(self) -> RunnersResourceWithStreamingResponse: def create( self, *, - kind: RunnerKind | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - provider: RunnerProvider | NotGiven = NOT_GIVEN, - runner_manager_id: str | NotGiven = NOT_GIVEN, - spec: RunnerSpecParam | NotGiven = NOT_GIVEN, + kind: RunnerKind | Omit = omit, + name: str | Omit = omit, + provider: RunnerProvider | Omit = omit, + runner_manager_id: str | Omit = omit, + spec: RunnerSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCreateResponse: """Creates a new runner registration with the server. @@ -188,13 +188,13 @@ def create( def retrieve( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerRetrieveResponse: """ Gets details about a specific runner. @@ -237,15 +237,15 @@ def retrieve( def update( self, *, - name: Optional[str] | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - spec: Optional[runner_update_params.Spec] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + runner_id: str | Omit = omit, + spec: Optional[runner_update_params.Spec] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates a runner's configuration. @@ -306,16 +306,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: runner_list_params.Filter | Omit = omit, + pagination: runner_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncRunnersPage[Runner]: """ Lists all registered runners with optional filtering. @@ -390,14 +390,14 @@ def list( def delete( self, *, - force: bool | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + force: bool | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a runner permanently. @@ -450,14 +450,14 @@ def delete( def check_authentication_for_host( self, *, - host: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCheckAuthenticationForHostResponse: """ Checks if a user is authenticated for a specific host. @@ -505,13 +505,13 @@ def check_authentication_for_host( def create_runner_token( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCreateRunnerTokenResponse: """ Creates a new authentication token for a runner. @@ -557,14 +557,14 @@ def create_runner_token( def parse_context_url( self, *, - context_url: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + context_url: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerParseContextURLResponse: """ Parses a context URL and returns the parsed result. @@ -648,17 +648,17 @@ def with_streaming_response(self) -> AsyncRunnersResourceWithStreamingResponse: async def create( self, *, - kind: RunnerKind | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - provider: RunnerProvider | NotGiven = NOT_GIVEN, - runner_manager_id: str | NotGiven = NOT_GIVEN, - spec: RunnerSpecParam | NotGiven = NOT_GIVEN, + kind: RunnerKind | Omit = omit, + name: str | Omit = omit, + provider: RunnerProvider | Omit = omit, + runner_manager_id: str | Omit = omit, + spec: RunnerSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCreateResponse: """Creates a new runner registration with the server. @@ -746,13 +746,13 @@ async def create( async def retrieve( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerRetrieveResponse: """ Gets details about a specific runner. @@ -795,15 +795,15 @@ async def retrieve( async def update( self, *, - name: Optional[str] | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - spec: Optional[runner_update_params.Spec] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + runner_id: str | Omit = omit, + spec: Optional[runner_update_params.Spec] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates a runner's configuration. @@ -864,16 +864,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: runner_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: runner_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: runner_list_params.Filter | Omit = omit, + pagination: runner_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Runner, AsyncRunnersPage[Runner]]: """ Lists all registered runners with optional filtering. @@ -948,14 +948,14 @@ def list( async def delete( self, *, - force: bool | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + force: bool | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a runner permanently. @@ -1008,14 +1008,14 @@ async def delete( async def check_authentication_for_host( self, *, - host: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCheckAuthenticationForHostResponse: """ Checks if a user is authenticated for a specific host. @@ -1063,13 +1063,13 @@ async def check_authentication_for_host( async def create_runner_token( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCreateRunnerTokenResponse: """ Creates a new authentication token for a runner. @@ -1115,14 +1115,14 @@ async def create_runner_token( async def parse_context_url( self, *, - context_url: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + context_url: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerParseContextURLResponse: """ Parses a context URL and returns the parsed result. diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 42c84854..16dcd675 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -11,7 +11,7 @@ secret_get_value_params, secret_update_value_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -54,19 +54,19 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: def create( self, *, - container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN, - environment_variable: bool | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - scope: SecretScopeParam | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + container_registry_basic_auth_host: str | Omit = omit, + environment_variable: bool | Omit = omit, + file_path: str | Omit = omit, + name: str | Omit = omit, + project_id: str | Omit = omit, + scope: SecretScopeParam | Omit = omit, + value: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretCreateResponse: """ Creates a new secret for a project. @@ -164,16 +164,16 @@ def create( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: secret_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: secret_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: secret_list_params.Filter | Omit = omit, + pagination: secret_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSecretsPage[Secret]: """ Lists secrets @@ -250,13 +250,13 @@ def list( def delete( self, *, - secret_id: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a secret permanently. @@ -297,13 +297,13 @@ def delete( def get_value( self, *, - secret_id: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretGetValueResponse: """Gets the value of a secret. @@ -346,14 +346,14 @@ def get_value( def update_value( self, *, - secret_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, + value: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates the value of an existing secret. @@ -424,19 +424,19 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: async def create( self, *, - container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN, - environment_variable: bool | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - scope: SecretScopeParam | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + container_registry_basic_auth_host: str | Omit = omit, + environment_variable: bool | Omit = omit, + file_path: str | Omit = omit, + name: str | Omit = omit, + project_id: str | Omit = omit, + scope: SecretScopeParam | Omit = omit, + value: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretCreateResponse: """ Creates a new secret for a project. @@ -534,16 +534,16 @@ async def create( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: secret_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: secret_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: secret_list_params.Filter | Omit = omit, + pagination: secret_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Secret, AsyncSecretsPage[Secret]]: """ Lists secrets @@ -620,13 +620,13 @@ def list( async def delete( self, *, - secret_id: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a secret permanently. @@ -667,13 +667,13 @@ async def delete( async def get_value( self, *, - secret_id: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretGetValueResponse: """Gets the value of a secret. @@ -716,14 +716,14 @@ async def get_value( async def update_value( self, *, - secret_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, + value: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates the value of an existing secret. diff --git a/src/gitpod/resources/usage.py b/src/gitpod/resources/usage.py index 71c698eb..2b98af15 100644 --- a/src/gitpod/resources/usage.py +++ b/src/gitpod/resources/usage.py @@ -5,7 +5,7 @@ import httpx from ..types import usage_list_environment_runtime_records_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -45,16 +45,16 @@ def with_streaming_response(self) -> UsageResourceWithStreamingResponse: def list_environment_runtime_records( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: usage_list_environment_runtime_records_params.Filter | NotGiven = NOT_GIVEN, - pagination: usage_list_environment_runtime_records_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: usage_list_environment_runtime_records_params.Filter | Omit = omit, + pagination: usage_list_environment_runtime_records_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncRecordsPage[EnvironmentUsageRecord]: """ Lists completed environment runtime records within a specified date range. @@ -145,16 +145,16 @@ def with_streaming_response(self) -> AsyncUsageResourceWithStreamingResponse: def list_environment_runtime_records( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: usage_list_environment_runtime_records_params.Filter | NotGiven = NOT_GIVEN, - pagination: usage_list_environment_runtime_records_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: usage_list_environment_runtime_records_params.Filter | Omit = omit, + pagination: usage_list_environment_runtime_records_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EnvironmentUsageRecord, AsyncRecordsPage[EnvironmentUsageRecord]]: """ Lists completed environment runtime records within a specified date range. diff --git a/src/gitpod/resources/users/dotfiles.py b/src/gitpod/resources/users/dotfiles.py index 6e14987b..8e02290a 100644 --- a/src/gitpod/resources/users/dotfiles.py +++ b/src/gitpod/resources/users/dotfiles.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -44,13 +44,13 @@ def with_streaming_response(self) -> DotfilesResourceWithStreamingResponse: def get( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DotfileGetResponse: """ Gets the dotfiles for a user. @@ -90,13 +90,13 @@ def get( def set( self, *, - repository: str | NotGiven = NOT_GIVEN, + repository: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Sets the dotfiles configuration for a user. @@ -166,13 +166,13 @@ def with_streaming_response(self) -> AsyncDotfilesResourceWithStreamingResponse: async def get( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DotfileGetResponse: """ Gets the dotfiles for a user. @@ -212,13 +212,13 @@ async def get( async def set( self, *, - repository: str | NotGiven = NOT_GIVEN, + repository: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Sets the dotfiles configuration for a user. diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 95511b8b..972111bc 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -46,16 +46,16 @@ def with_streaming_response(self) -> PatsResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: pat_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: pat_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: pat_list_params.Filter | Omit = omit, + pagination: pat_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncPersonalAccessTokensPage[PersonalAccessToken]: """ Lists personal access tokens with optional filtering. @@ -118,13 +118,13 @@ def list( def delete( self, *, - personal_access_token_id: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a personal access token. @@ -168,13 +168,13 @@ def delete( def get( self, *, - personal_access_token_id: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PatGetResponse: """ Gets details about a specific personal access token. @@ -237,16 +237,16 @@ def with_streaming_response(self) -> AsyncPatsResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: pat_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: pat_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: pat_list_params.Filter | Omit = omit, + pagination: pat_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PersonalAccessToken, AsyncPersonalAccessTokensPage[PersonalAccessToken]]: """ Lists personal access tokens with optional filtering. @@ -309,13 +309,13 @@ def list( async def delete( self, *, - personal_access_token_id: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a personal access token. @@ -359,13 +359,13 @@ async def delete( async def get( self, *, - personal_access_token_id: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PatGetResponse: """ Gets details about a specific personal access token. diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index 0ffe276a..2fae4522 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -13,7 +13,7 @@ AsyncPatsResourceWithStreamingResponse, ) from ...types import user_set_suspended_params, user_get_authenticated_user_params -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .dotfiles import ( DotfilesResource, @@ -68,13 +68,13 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: def get_authenticated_user( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserGetAuthenticatedUserResponse: """ Gets information about the currently authenticated user. @@ -117,14 +117,14 @@ def get_authenticated_user( def set_suspended( self, *, - suspended: bool | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + suspended: bool | Omit = omit, + user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Sets whether a user account is suspended. @@ -211,13 +211,13 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: async def get_authenticated_user( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserGetAuthenticatedUserResponse: """ Gets information about the currently authenticated user. @@ -262,14 +262,14 @@ async def get_authenticated_user( async def set_suspended( self, *, - suspended: bool | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + suspended: bool | Omit = omit, + user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Sets whether a user account is suspended. diff --git a/tests/test_transform.py b/tests/test_transform.py index d3c756e2..1d6e3fec 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from gitpod._types import NOT_GIVEN, Base64FileInput +from gitpod._types import Base64FileInput, omit, not_given from gitpod._utils import ( PropertyInfo, transform as _transform, @@ -450,4 +450,11 @@ async def test_transform_skipping(use_async: bool) -> None: @pytest.mark.asyncio async def test_strips_notgiven(use_async: bool) -> None: assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} - assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {} + assert await transform({"foo_bar": not_given}, Foo1, use_async) == {} + + +@parametrize +@pytest.mark.asyncio +async def test_strips_omit(use_async: bool) -> None: + assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} + assert await transform({"foo_bar": omit}, Foo1, use_async) == {} From 53b67fb1db2811bd4348ba81df4d89e2c630ee57 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 17:43:45 +0000 Subject: [PATCH 205/505] chore: do not install brew dependencies in ./scripts/bootstrap by default --- scripts/bootstrap | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index e84fe62c..b430fee3 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi From 27fa6411bcd159c8ef3628225e67703e9c04248e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 08:49:40 +0000 Subject: [PATCH 206/505] chore(internal): detect missing future annotations with ruff --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 0f527e52..058fc94e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -224,6 +224,8 @@ select = [ "B", # remove unused imports "F401", + # check for missing future annotations + "FA102", # bare except statements "E722", # unused arguments @@ -246,6 +248,8 @@ unfixable = [ "T203", ] +extend-safe-fixes = ["FA102"] + [tool.ruff.lint.flake8-tidy-imports.banned-api] "functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" From 92d0ef09690d790ec96c7329d7f9c6ae9f85a486 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 10:20:53 +0000 Subject: [PATCH 207/505] chore: bump `httpx-aiohttp` version to 0.1.9 --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- requirements.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 058fc94e..7a66e71a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/gitpod-io/gitpod-sdk-python" Repository = "https://github.com/gitpod-io/gitpod-sdk-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] [tool.rye] managed = true diff --git a/requirements-dev.lock b/requirements-dev.lock index 7106de61..62bf5dfc 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -56,7 +56,7 @@ httpx==0.28.1 # via gitpod-sdk # via httpx-aiohttp # via respx -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via gitpod-sdk idna==3.4 # via anyio diff --git a/requirements.lock b/requirements.lock index e1664d85..201981e7 100644 --- a/requirements.lock +++ b/requirements.lock @@ -43,7 +43,7 @@ httpcore==1.0.9 httpx==0.28.1 # via gitpod-sdk # via httpx-aiohttp -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via gitpod-sdk idna==3.4 # via anyio From ed41146aa4985e9ba50e12e48fda85554865c136 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 10:43:36 +0000 Subject: [PATCH 208/505] fix(client): close streams without requiring full consumption --- src/gitpod/_streaming.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gitpod/_streaming.py b/src/gitpod/_streaming.py index deacb4d4..4a34a6b0 100644 --- a/src/gitpod/_streaming.py +++ b/src/gitpod/_streaming.py @@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]: for sse in iterator: yield process_data(data=sse.json(), cast_to=cast_to, response=response) - # Ensure the entire stream is consumed - for _sse in iterator: - ... + # As we might not fully consume the response stream, we need to close it explicitly + response.close() def __enter__(self) -> Self: return self @@ -121,9 +120,8 @@ async def __stream__(self) -> AsyncIterator[_T]: async for sse in iterator: yield process_data(data=sse.json(), cast_to=cast_to, response=response) - # Ensure the entire stream is consumed - async for _sse in iterator: - ... + # As we might not fully consume the response stream, we need to close it explicitly + await response.aclose() async def __aenter__(self) -> Self: return self From f9c6cd17da54b8e02657577203398be18611a698 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:03:16 +0000 Subject: [PATCH 209/505] chore(internal/tests): avoid race condition with implicit client cleanup --- tests/test_client.py | 362 +++++++++++++++++++++++-------------------- 1 file changed, 198 insertions(+), 164 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index cb493a90..f948b8a0 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -59,51 +59,49 @@ def _get_open_connections(client: Gitpod | AsyncGitpod) -> int: class TestGitpod: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - @pytest.mark.respx(base_url=base_url) - def test_raw_response(self, respx_mock: MockRouter) -> None: + def test_raw_response(self, respx_mock: MockRouter, client: Gitpod) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + def test_raw_response_for_binary(self, respx_mock: MockRouter, client: Gitpod) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self) -> None: - copied = self.client.copy() - assert id(copied) != id(self.client) + def test_copy(self, client: Gitpod) -> None: + copied = client.copy() + assert id(copied) != id(client) - copied = self.client.copy(bearer_token="another My Bearer Token") + copied = client.copy(bearer_token="another My Bearer Token") assert copied.bearer_token == "another My Bearer Token" - assert self.client.bearer_token == "My Bearer Token" + assert client.bearer_token == "My Bearer Token" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, client: Gitpod) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert client.max_retries == 2 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 assert copied.max_retries == 7 # timeout - assert isinstance(self.client.timeout, httpx.Timeout) - copied = self.client.copy(timeout=None) + assert isinstance(client.timeout, httpx.Timeout) + copied = client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: client = Gitpod( @@ -141,6 +139,7 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + client.close() def test_copy_default_query(self) -> None: client = Gitpod( @@ -178,13 +177,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + client.close() + + def test_copy_signature(self, client: Gitpod) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -195,12 +196,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, client: Gitpod) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -257,14 +258,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + def test_request_timeout(self, client: Gitpod) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT - request = self.client._build_request( - FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0))) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(100.0) @@ -277,6 +276,8 @@ def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + client.close() + def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: @@ -288,6 +289,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + client.close() + # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: client = Gitpod( @@ -298,6 +301,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + client.close() + # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = Gitpod( @@ -308,6 +313,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + client.close() + async def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): async with httpx.AsyncClient() as http_client: @@ -319,17 +326,17 @@ async def test_invalid_http_client(self) -> None: ) def test_default_headers_option(self) -> None: - client = Gitpod( + test_client = Gitpod( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" - client2 = Gitpod( + test_client2 = Gitpod( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, @@ -338,10 +345,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + test_client.close() + test_client2.close() + def test_validate_headers(self) -> None: client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -373,8 +383,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + client.close() + + def test_request_extra_json(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -385,7 +397,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -396,7 +408,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -407,8 +419,8 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self) -> None: - request = self.client._build_request( + def test_request_extra_headers(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -418,7 +430,7 @@ def test_request_extra_headers(self) -> None: assert request.headers.get("X-Foo") == "Foo" # `extra_headers` takes priority over `default_headers` when keys clash - request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -429,8 +441,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -443,7 +455,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -457,7 +469,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -500,7 +512,7 @@ def test_multipart_repeating_array(self, client: Gitpod) -> None: ] @pytest.mark.respx(base_url=base_url) - def test_basic_union_response(self, respx_mock: MockRouter) -> None: + def test_basic_union_response(self, respx_mock: MockRouter, client: Gitpod) -> None: class Model1(BaseModel): name: str @@ -509,12 +521,12 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + def test_union_response_different_types(self, respx_mock: MockRouter, client: Gitpod) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -525,18 +537,18 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) assert response.foo == 1 @pytest.mark.respx(base_url=base_url) - def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter, client: Gitpod) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -552,7 +564,7 @@ class Model(BaseModel): ) ) - response = self.client.get("/foo", cast_to=Model) + response = client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 @@ -566,6 +578,8 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" + client.close() + def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): client = Gitpod(bearer_token=bearer_token, _strict_response_validation=True) @@ -597,6 +611,7 @@ def test_base_url_trailing_slash(self, client: Gitpod) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -624,6 +639,7 @@ def test_base_url_no_trailing_slash(self, client: Gitpod) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -651,35 +667,36 @@ def test_absolute_request_url(self, client: Gitpod) -> None: ), ) assert request.url == "https://myapi.com/foo" + client.close() def test_copied_client_does_not_close_http(self) -> None: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - assert not client.is_closed() + test_client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied - assert not client.is_closed() + assert not test_client.is_closed() def test_client_context_manager(self) -> None: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - with client as c2: - assert c2 is client + test_client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + def test_client_response_validation_error(self, respx_mock: MockRouter, client: Gitpod) -> None: class Model(BaseModel): foo: str respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: - self.client.get("/foo", cast_to=Model) + client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -704,11 +721,14 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) + non_strict_client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) - response = client.get("/foo", cast_to=Model) + response = non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + strict_client.close() + non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -731,9 +751,9 @@ class Model(BaseModel): ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) - def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - + def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, client: Gitpod + ) -> None: headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) @@ -749,7 +769,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien with pytest.raises(APITimeoutError): client.identity.with_streaming_response.get_authenticated_identity().__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -758,7 +778,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client with pytest.raises(APIStatusError): client.identity.with_streaming_response.get_authenticated_identity().__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @@ -864,83 +884,77 @@ def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - def test_follow_redirects(self, respx_mock: MockRouter) -> None: + def test_follow_redirects(self, respx_mock: MockRouter, client: Gitpod) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: Gitpod) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - self.client.post( - "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response - ) + client.post("/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response) assert exc_info.value.response.status_code == 302 assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" class TestAsyncGitpod: - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_raw_response(self, respx_mock: MockRouter) -> None: + async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self) -> None: - copied = self.client.copy() - assert id(copied) != id(self.client) + def test_copy(self, async_client: AsyncGitpod) -> None: + copied = async_client.copy() + assert id(copied) != id(async_client) - copied = self.client.copy(bearer_token="another My Bearer Token") + copied = async_client.copy(bearer_token="another My Bearer Token") assert copied.bearer_token == "another My Bearer Token" - assert self.client.bearer_token == "My Bearer Token" + assert async_client.bearer_token == "My Bearer Token" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, async_client: AsyncGitpod) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = async_client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert async_client.max_retries == 2 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 assert copied.max_retries == 7 # timeout - assert isinstance(self.client.timeout, httpx.Timeout) - copied = self.client.copy(timeout=None) + assert isinstance(async_client.timeout, httpx.Timeout) + copied = async_client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(async_client.timeout, httpx.Timeout) - def test_copy_default_headers(self) -> None: + async def test_copy_default_headers(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, @@ -976,8 +990,9 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + await client.close() - def test_copy_default_query(self) -> None: + async def test_copy_default_query(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} ) @@ -1013,13 +1028,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + await client.close() + + def test_copy_signature(self, async_client: AsyncGitpod) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + async_client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(async_client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -1030,12 +1047,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, async_client: AsyncGitpod) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = async_client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -1092,12 +1109,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - async def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + async def test_request_timeout(self, async_client: AsyncGitpod) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT - request = self.client._build_request( + request = async_client._build_request( FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) ) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1112,6 +1129,8 @@ async def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + await client.close() + async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: @@ -1123,6 +1142,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + await client.close() + # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: client = AsyncGitpod( @@ -1133,6 +1154,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + await client.close() + # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = AsyncGitpod( @@ -1143,6 +1166,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + await client.close() + def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): with httpx.Client() as http_client: @@ -1153,18 +1178,18 @@ def test_invalid_http_client(self) -> None: http_client=cast(Any, http_client), ) - def test_default_headers_option(self) -> None: - client = AsyncGitpod( + async def test_default_headers_option(self) -> None: + test_client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" - client2 = AsyncGitpod( + test_client2 = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, @@ -1173,10 +1198,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + await test_client.close() + await test_client2.close() + def test_validate_headers(self) -> None: client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1187,7 +1215,7 @@ def test_validate_headers(self) -> None: client2 = AsyncGitpod(base_url=base_url, bearer_token=None, _strict_response_validation=True) _ = client2 - def test_default_query_option(self) -> None: + async def test_default_query_option(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, @@ -1208,8 +1236,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + await client.close() + + def test_request_extra_json(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1220,7 +1250,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1231,7 +1261,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1242,8 +1272,8 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self) -> None: - request = self.client._build_request( + def test_request_extra_headers(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1253,7 +1283,7 @@ def test_request_extra_headers(self) -> None: assert request.headers.get("X-Foo") == "Foo" # `extra_headers` takes priority over `default_headers` when keys clash - request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1264,8 +1294,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1278,7 +1308,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1292,7 +1322,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1335,7 +1365,7 @@ def test_multipart_repeating_array(self, async_client: AsyncGitpod) -> None: ] @pytest.mark.respx(base_url=base_url) - async def test_basic_union_response(self, respx_mock: MockRouter) -> None: + async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: class Model1(BaseModel): name: str @@ -1344,12 +1374,12 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - async def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + async def test_union_response_different_types(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -1360,18 +1390,20 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) assert response.foo == 1 @pytest.mark.respx(base_url=base_url) - async def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + async def test_non_application_json_content_type_for_json_data( + self, respx_mock: MockRouter, async_client: AsyncGitpod + ) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -1387,11 +1419,11 @@ class Model(BaseModel): ) ) - response = await self.client.get("/foo", cast_to=Model) + response = await async_client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 - def test_base_url_setter(self) -> None: + async def test_base_url_setter(self) -> None: client = AsyncGitpod( base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True ) @@ -1401,7 +1433,9 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" - def test_base_url_env(self) -> None: + await client.close() + + async def test_base_url_env(self) -> None: with update_env(GITPOD_BASE_URL="http://localhost:5000/from/env"): client = AsyncGitpod(bearer_token=bearer_token, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @@ -1423,7 +1457,7 @@ def test_base_url_env(self) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: + async def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1432,6 +1466,7 @@ def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1450,7 +1485,7 @@ def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: + async def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1459,6 +1494,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1477,7 +1513,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: ], ids=["standard", "custom http client"], ) - def test_absolute_request_url(self, client: AsyncGitpod) -> None: + async def test_absolute_request_url(self, client: AsyncGitpod) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1486,37 +1522,37 @@ def test_absolute_request_url(self, client: AsyncGitpod) -> None: ), ) assert request.url == "https://myapi.com/foo" + await client.close() async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - assert not client.is_closed() + test_client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied await asyncio.sleep(0.2) - assert not client.is_closed() + assert not test_client.is_closed() async def test_client_context_manager(self) -> None: - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - async with client as c2: - assert c2 is client + test_client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + async with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + async def test_client_response_validation_error(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: class Model(BaseModel): foo: str respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: - await self.client.get("/foo", cast_to=Model) + await async_client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -1530,7 +1566,6 @@ async def test_client_max_retries_validation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: class Model(BaseModel): name: str @@ -1542,11 +1577,14 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) + non_strict_client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) - response = await client.get("/foo", cast_to=Model) + response = await non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + await strict_client.close() + await non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -1569,13 +1607,12 @@ class Model(BaseModel): ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) - @pytest.mark.asyncio - async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - + async def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, async_client: AsyncGitpod + ) -> None: headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) - calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + calculated = async_client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @@ -1588,7 +1625,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, with pytest.raises(APITimeoutError): await async_client.identity.with_streaming_response.get_authenticated_identity().__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -1597,12 +1634,11 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, with pytest.raises(APIStatusError): await async_client.identity.with_streaming_response.get_authenticated_identity().__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio @pytest.mark.parametrize("failure_mode", ["status", "exception"]) async def test_retries_taken( self, @@ -1634,7 +1670,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_omit_retry_count_header( self, async_client: AsyncGitpod, failures_before_success: int, respx_mock: MockRouter ) -> None: @@ -1660,7 +1695,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_overwrite_retry_count_header( self, async_client: AsyncGitpod, failures_before_success: int, respx_mock: MockRouter ) -> None: @@ -1710,26 +1744,26 @@ async def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = await async_client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects_disabled(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - await self.client.post( + await async_client.post( "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response ) From 9d34de3f445b112bec9a7656c857656f189e498d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 16:12:53 +0000 Subject: [PATCH 210/505] chore(internal): grammar fix (it's -> its) --- src/gitpod/_utils/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitpod/_utils/_utils.py b/src/gitpod/_utils/_utils.py index 50d59269..eec7f4a1 100644 --- a/src/gitpod/_utils/_utils.py +++ b/src/gitpod/_utils/_utils.py @@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: # Type safe methods for narrowing types with TypeVars. # The default narrowing for isinstance(obj, dict) is dict[unknown, unknown], # however this cause Pyright to rightfully report errors. As we know we don't -# care about the contained types we can safely use `object` in it's place. +# care about the contained types we can safely use `object` in its place. # # There are two separate functions defined, `is_*` and `is_*_t` for different use cases. # `is_*` is for when you're dealing with an unknown input From 3795f8c70206495d62d62915513f56f6cdf14575 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 11:29:39 +0000 Subject: [PATCH 211/505] chore(package): drop Python 3.8 support --- README.md | 4 ++-- pyproject.toml | 5 ++--- src/gitpod/_utils/_sync.py | 34 +++------------------------------- 3 files changed, 7 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index ccfdae1d..c60349eb 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![PyPI version](https://img.shields.io/pypi/v/gitpod-sdk.svg?label=pypi%20(stable))](https://pypi.org/project/gitpod-sdk/) -The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.8+ +The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.9+ application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx). @@ -434,7 +434,7 @@ print(gitpod.__version__) ## Requirements -Python 3.8 or higher. +Python 3.9 or higher. ## Contributing diff --git a/pyproject.toml b/pyproject.toml index 7a66e71a..0934f652 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,11 +15,10 @@ dependencies = [ "distro>=1.7.0, <2", "sniffio", ] -requires-python = ">= 3.8" +requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", "Intended Audience :: Developers", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -141,7 +140,7 @@ filterwarnings = [ # there are a couple of flags that are still disabled by # default in strict mode as they are experimental and niche. typeCheckingMode = "strict" -pythonVersion = "3.8" +pythonVersion = "3.9" exclude = [ "_dev", diff --git a/src/gitpod/_utils/_sync.py b/src/gitpod/_utils/_sync.py index ad7ec71b..f6027c18 100644 --- a/src/gitpod/_utils/_sync.py +++ b/src/gitpod/_utils/_sync.py @@ -1,10 +1,8 @@ from __future__ import annotations -import sys import asyncio import functools -import contextvars -from typing import Any, TypeVar, Callable, Awaitable +from typing import TypeVar, Callable, Awaitable from typing_extensions import ParamSpec import anyio @@ -15,34 +13,11 @@ T_ParamSpec = ParamSpec("T_ParamSpec") -if sys.version_info >= (3, 9): - _asyncio_to_thread = asyncio.to_thread -else: - # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread - # for Python 3.8 support - async def _asyncio_to_thread( - func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs - ) -> Any: - """Asynchronously run function *func* in a separate thread. - - Any *args and **kwargs supplied for this function are directly passed - to *func*. Also, the current :class:`contextvars.Context` is propagated, - allowing context variables from the main thread to be accessed in the - separate thread. - - Returns a coroutine that can be awaited to get the eventual result of *func*. - """ - loop = asyncio.events.get_running_loop() - ctx = contextvars.copy_context() - func_call = functools.partial(ctx.run, func, *args, **kwargs) - return await loop.run_in_executor(None, func_call) - - async def to_thread( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs ) -> T_Retval: if sniffio.current_async_library() == "asyncio": - return await _asyncio_to_thread(func, *args, **kwargs) + return await asyncio.to_thread(func, *args, **kwargs) return await anyio.to_thread.run_sync( functools.partial(func, *args, **kwargs), @@ -53,10 +28,7 @@ async def to_thread( def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ Take a blocking function and create an async one that receives the same - positional and keyword arguments. For python version 3.9 and above, it uses - asyncio.to_thread to run the function in a separate thread. For python version - 3.8, it uses locally defined copy of the asyncio.to_thread function which was - introduced in python 3.9. + positional and keyword arguments. Usage: From d71e60eaf6e5560f951758ef2e27dd23957f00f6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 13:38:19 +0000 Subject: [PATCH 212/505] fix: compat with Python 3.14 --- src/gitpod/_models.py | 11 ++++++++--- tests/test_models.py | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 6a3cd1d2..fcec2cf9 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -2,6 +2,7 @@ import os import inspect +import weakref from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast from datetime import date, datetime from typing_extensions import ( @@ -573,6 +574,9 @@ class CachedDiscriminatorType(Protocol): __discriminator__: DiscriminatorDetails +DISCRIMINATOR_CACHE: weakref.WeakKeyDictionary[type, DiscriminatorDetails] = weakref.WeakKeyDictionary() + + class DiscriminatorDetails: field_name: str """The name of the discriminator field in the variant class, e.g. @@ -615,8 +619,9 @@ def __init__( def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None: - if isinstance(union, CachedDiscriminatorType): - return union.__discriminator__ + cached = DISCRIMINATOR_CACHE.get(union) + if cached is not None: + return cached discriminator_field_name: str | None = None @@ -669,7 +674,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, discriminator_field=discriminator_field_name, discriminator_alias=discriminator_alias, ) - cast(CachedDiscriminatorType, union).__discriminator__ = details + DISCRIMINATOR_CACHE.setdefault(union, details) return details diff --git a/tests/test_models.py b/tests/test_models.py index fad48103..47fa9efd 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -9,7 +9,7 @@ from gitpod._utils import PropertyInfo from gitpod._compat import PYDANTIC_V1, parse_obj, model_dump, model_json -from gitpod._models import BaseModel, construct_type +from gitpod._models import DISCRIMINATOR_CACHE, BaseModel, construct_type class BasicModel(BaseModel): @@ -809,7 +809,7 @@ class B(BaseModel): UnionType = cast(Any, Union[A, B]) - assert not hasattr(UnionType, "__discriminator__") + assert not DISCRIMINATOR_CACHE.get(UnionType) m = construct_type( value={"type": "b", "data": "foo"}, type_=cast(Any, Annotated[UnionType, PropertyInfo(discriminator="type")]) @@ -818,7 +818,7 @@ class B(BaseModel): assert m.type == "b" assert m.data == "foo" # type: ignore[comparison-overlap] - discriminator = UnionType.__discriminator__ + discriminator = DISCRIMINATOR_CACHE.get(UnionType) assert discriminator is not None m = construct_type( @@ -830,7 +830,7 @@ class B(BaseModel): # if the discriminator details object stays the same between invocations then # we hit the cache - assert UnionType.__discriminator__ is discriminator + assert DISCRIMINATOR_CACHE.get(UnionType) is discriminator @pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") From 51a1948b2d85151043c7dbc15d089727a444e257 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 14:37:51 +0000 Subject: [PATCH 213/505] fix(compat): update signatures of `model_dump` and `model_dump_json` for Pydantic v1 --- src/gitpod/_models.py | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index fcec2cf9..ca9500b2 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -257,15 +257,16 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, + context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, - context: dict[str, Any] | None = None, - serialize_as_any: bool = False, fallback: Callable[[Any], Any] | None = None, + serialize_as_any: bool = False, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -273,16 +274,24 @@ def model_dump( Args: mode: The mode in which `to_python` should run. - If mode is 'json', the dictionary will only contain JSON serializable types. - If mode is 'python', the dictionary may contain any Python objects. - include: A list of fields to include in the output. - exclude: A list of fields to exclude from the output. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. by_alias: Whether to use the field's alias in the dictionary key if defined. - exclude_unset: Whether to exclude fields that are unset or None from the output. - exclude_defaults: Whether to exclude fields that are set to their default value from the output. - exclude_none: Whether to exclude fields that have a value of `None` from the output. - round_trip: Whether to enable serialization and deserialization round-trip support. - warnings: Whether to log warnings when invalid fields are encountered. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + exclude_computed_fields: Whether to exclude computed fields. + While this can be useful for round-tripping, it is usually recommended to use the dedicated + `round_trip` parameter instead. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. Returns: A dictionary representation of the model. @@ -299,6 +308,8 @@ def model_dump( raise ValueError("serialize_as_any is only supported in Pydantic v2") if fallback is not None: raise ValueError("fallback is only supported in Pydantic v2") + if exclude_computed_fields != False: + raise ValueError("exclude_computed_fields is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, @@ -315,15 +326,17 @@ def model_dump_json( self, *, indent: int | None = None, + ensure_ascii: bool = False, include: IncEx | None = None, exclude: IncEx | None = None, + context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, - context: dict[str, Any] | None = None, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: @@ -355,6 +368,10 @@ def model_dump_json( raise ValueError("serialize_as_any is only supported in Pydantic v2") if fallback is not None: raise ValueError("fallback is only supported in Pydantic v2") + if ensure_ascii != False: + raise ValueError("ensure_ascii is only supported in Pydantic v2") + if exclude_computed_fields != False: + raise ValueError("exclude_computed_fields is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, From 2283b913f816d7fa5ee707e96b111df5b527a390 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 23:30:12 +0000 Subject: [PATCH 214/505] chore(internal): codegen related update --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 0934f652..e25fda8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", From ad54d30d9110173a6ec77b90f7522073ae80798e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 16:52:18 +0000 Subject: [PATCH 215/505] fix: ensure streams are always closed --- src/gitpod/_streaming.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gitpod/_streaming.py b/src/gitpod/_streaming.py index 4a34a6b0..9a4ccf40 100644 --- a/src/gitpod/_streaming.py +++ b/src/gitpod/_streaming.py @@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - response.close() + try: + for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + response.close() def __enter__(self) -> Self: return self @@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - async for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - await response.aclose() + try: + async for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + await response.aclose() async def __aenter__(self) -> Self: return self From d78e266376437356634a950c7040ad550723c20f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 18:47:44 +0000 Subject: [PATCH 216/505] chore(deps): mypy 1.18.1 has a regression, pin to 1.17 --- pyproject.toml | 2 +- requirements-dev.lock | 4 +++- requirements.lock | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e25fda8e..aa6b07ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ managed = true # version pins are in requirements-dev.lock dev-dependencies = [ "pyright==1.1.399", - "mypy", + "mypy==1.17", "respx", "pytest", "pytest-asyncio", diff --git a/requirements-dev.lock b/requirements-dev.lock index 62bf5dfc..7d289849 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -72,7 +72,7 @@ mdurl==0.1.2 multidict==6.4.4 # via aiohttp # via yarl -mypy==1.14.1 +mypy==1.17.0 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 @@ -81,6 +81,8 @@ nox==2023.4.22 packaging==23.2 # via nox # via pytest +pathspec==0.12.1 + # via mypy platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 diff --git a/requirements.lock b/requirements.lock index 201981e7..d08d684e 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,21 +55,21 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via gitpod-sdk -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic sniffio==1.3.0 # via anyio # via gitpod-sdk -typing-extensions==4.12.2 +typing-extensions==4.15.0 # via anyio # via gitpod-sdk # via multidict # via pydantic # via pydantic-core # via typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic yarl==1.20.0 # via aiohttp From e5361f8f610f6164ad7a79a994a9a85194e5de11 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 11:06:44 +0000 Subject: [PATCH 217/505] chore: update lockfile --- pyproject.toml | 14 +++--- requirements-dev.lock | 108 +++++++++++++++++++++++------------------- requirements.lock | 31 ++++++------ 3 files changed, 83 insertions(+), 70 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aa6b07ec..33e3946f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,14 +7,16 @@ license = "Apache-2.0" authors = [ { name = "Gitpod", email = "dev-feedback@ona.com" }, ] + dependencies = [ - "httpx>=0.23.0, <1", - "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", - "anyio>=3.5.0, <5", - "distro>=1.7.0, <2", - "sniffio", + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.10, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", ] + requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", diff --git a/requirements-dev.lock b/requirements-dev.lock index 7d289849..343a3daa 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,40 +12,45 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via gitpod-sdk # via httpx-aiohttp -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via gitpod-sdk # via httpx -argcomplete==3.1.2 +argcomplete==3.6.3 # via nox async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 + # via nox +backports-asyncio-runner==1.2.0 + # via pytest-asyncio +certifi==2025.11.12 # via httpcore # via httpx -colorlog==6.7.0 +colorlog==6.10.1 + # via nox +dependency-groups==1.3.1 # via nox -dirty-equals==0.6.0 -distlib==0.3.7 +dirty-equals==0.11 +distlib==0.4.0 # via virtualenv -distro==1.8.0 +distro==1.9.0 # via gitpod-sdk -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio # via pytest -execnet==2.1.1 +execnet==2.1.2 # via pytest-xdist -filelock==3.12.4 +filelock==3.19.1 # via virtualenv -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -58,82 +63,87 @@ httpx==0.28.1 # via respx httpx-aiohttp==0.1.9 # via gitpod-sdk -idna==3.4 +humanize==4.13.0 + # via nox +idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==7.0.0 -iniconfig==2.0.0 +importlib-metadata==8.7.0 +iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl mypy==1.17.0 -mypy-extensions==1.0.0 +mypy-extensions==1.1.0 # via mypy -nodeenv==1.8.0 +nodeenv==1.9.1 # via pyright -nox==2023.4.22 -packaging==23.2 +nox==2025.11.12 +packaging==25.0 + # via dependency-groups # via nox # via pytest pathspec==0.12.1 # via mypy -platformdirs==3.11.0 +platformdirs==4.4.0 # via virtualenv -pluggy==1.5.0 +pluggy==1.6.0 # via pytest -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via gitpod-sdk -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -pygments==2.18.0 +pygments==2.19.2 + # via pytest # via rich pyright==1.1.399 -pytest==8.3.3 +pytest==8.4.2 # via pytest-asyncio # via pytest-xdist -pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.8.2 +pytest-asyncio==1.2.0 +pytest-xdist==3.8.0 +python-dateutil==2.9.0.post0 # via time-machine -pytz==2023.3.post1 - # via dirty-equals respx==0.22.0 -rich==13.7.1 -ruff==0.9.4 -setuptools==68.2.2 - # via nodeenv -six==1.16.0 +rich==14.2.0 +ruff==0.14.7 +six==1.17.0 # via python-dateutil -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via gitpod-sdk -time-machine==2.9.0 -tomli==2.0.2 +time-machine==2.19.0 +tomli==2.3.0 + # via dependency-groups # via mypy + # via nox # via pytest -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via gitpod-sdk # via multidict # via mypy # via pydantic # via pydantic-core # via pyright + # via pytest-asyncio # via typing-inspection -typing-inspection==0.4.1 + # via virtualenv +typing-inspection==0.4.2 # via pydantic -virtualenv==20.24.5 +virtualenv==20.35.4 # via nox -yarl==1.20.0 +yarl==1.22.0 # via aiohttp -zipp==3.17.0 +zipp==3.23.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index d08d684e..73d1ab78 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,28 +12,28 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via gitpod-sdk # via httpx-aiohttp -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via gitpod-sdk # via httpx async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 +certifi==2025.11.12 # via httpcore # via httpx -distro==1.8.0 +distro==1.9.0 # via gitpod-sdk -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -45,25 +45,26 @@ httpx==0.28.1 # via httpx-aiohttp httpx-aiohttp==0.1.9 # via gitpod-sdk -idna==3.4 +idna==3.11 # via anyio # via httpx # via yarl -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl pydantic==2.12.5 # via gitpod-sdk pydantic-core==2.41.5 # via pydantic -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via gitpod-sdk typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via gitpod-sdk # via multidict # via pydantic @@ -71,5 +72,5 @@ typing-extensions==4.15.0 # via typing-inspection typing-inspection==0.4.2 # via pydantic -yarl==1.20.0 +yarl==1.22.0 # via aiohttp From ee1fa888b345676c9f989a11bfdb48bd82321c35 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 21:24:34 +0000 Subject: [PATCH 218/505] chore(docs): use environment variables for authentication in code snippets --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c60349eb..7721c369 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ pip install gitpod-sdk[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python +import os import asyncio from gitpod import DefaultAioHttpClient from gitpod import AsyncGitpod @@ -86,7 +87,7 @@ from gitpod import AsyncGitpod async def main() -> None: async with AsyncGitpod( - bearer_token="My Bearer Token", + bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: response = await client.identity.get_authenticated_identity() From 50da0ab9675e2868438682ca5c5936b0e6781dd5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:16:36 +0000 Subject: [PATCH 219/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6b7b74c5..da59f99e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.4.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 33e3946f..3823dd12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.3.0" +version = "0.4.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 1bd510f0..7fe2c1c0 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.3.0" # x-release-please-version +__version__ = "0.4.0" # x-release-please-version From 343c297c4891b82f3bb358702411f0d75210fb1b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:30:11 +0000 Subject: [PATCH 220/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index da59f99e..3e2bf498 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0" + ".": "0.4.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 3823dd12..a5eebf56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.4.0" +version = "0.4.1" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 7fe2c1c0..fffd9e81 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.4.0" # x-release-please-version +__version__ = "0.4.1" # x-release-please-version From 528438c5ea7c92d31a61e870b869050c9f7cd0f1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:41:47 +0000 Subject: [PATCH 221/505] fix(types): allow pyright to infer TypedDict types within SequenceNotStr --- src/gitpod/_types.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_types.py b/src/gitpod/_types.py index a4e7196a..ab7cbe2a 100644 --- a/src/gitpod/_types.py +++ b/src/gitpod/_types.py @@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False): if TYPE_CHECKING: # This works because str.__contains__ does not accept object (either in typeshed or at runtime) # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + # + # Note: index() and count() methods are intentionally omitted to allow pyright to properly + # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr. class SequenceNotStr(Protocol[_T_co]): @overload def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... @@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... def __contains__(self, value: object, /) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T_co]: ... - def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... - def count(self, value: Any, /) -> int: ... def __reversed__(self) -> Iterator[_T_co]: ... else: # just point this to a normal `Sequence` at runtime to avoid having to special case From 5a919ceaeda7be50665b77564ee2b8c706ea9132 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:28:58 +0000 Subject: [PATCH 222/505] chore: add missing docstrings --- .../account_list_login_providers_params.py | 4 +++ src/gitpod/types/editor_list_params.py | 4 +++ src/gitpod/types/environment.py | 2 ++ .../types/environment_activity_signal.py | 2 ++ .../environment_activity_signal_param.py | 2 ++ src/gitpod/types/environment_initializer.py | 2 ++ .../types/environment_initializer_param.py | 2 ++ src/gitpod/types/environment_list_params.py | 2 ++ src/gitpod/types/environment_metadata.py | 5 ++++ src/gitpod/types/environment_spec.py | 17 +++++++++++ src/gitpod/types/environment_spec_param.py | 17 +++++++++++ src/gitpod/types/environment_status.py | 30 +++++++++++++++++++ src/gitpod/types/environment_update_params.py | 4 +++ src/gitpod/types/environment_usage_record.py | 4 +++ .../automations/service_list_params.py | 4 +++ .../environments/automations/service_spec.py | 4 +++ .../automations/service_spec_param.py | 4 +++ .../automations/service_update_params.py | 14 +++++++++ .../automations/task_list_params.py | 4 +++ .../tasks/execution_list_params.py | 4 +++ .../environments/automations_file_param.py | 6 ++++ .../types/environments/class_list_params.py | 2 ++ src/gitpod/types/event_list_params.py | 2 ++ src/gitpod/types/gateway_list_params.py | 2 ++ src/gitpod/types/group_list_params.py | 2 ++ .../types/organization_list_members_params.py | 2 ++ src/gitpod/types/project_list_params.py | 2 ++ .../types/projects/policy_list_params.py | 2 ++ ..._check_authentication_for_host_response.py | 6 ++++ src/gitpod/types/runner_list_params.py | 2 ++ src/gitpod/types/runner_status.py | 2 ++ src/gitpod/types/runner_update_params.py | 2 ++ .../environment_class_list_params.py | 2 ++ .../scm_integration_list_params.py | 2 ++ .../types/runners/policy_list_params.py | 2 ++ src/gitpod/types/secret_list_params.py | 2 ++ src/gitpod/types/shared/automation_trigger.py | 6 ++++ src/gitpod/types/shared/gateway.py | 2 ++ .../types/shared_params/automation_trigger.py | 6 ++++ ...list_environment_runtime_records_params.py | 6 ++++ 40 files changed, 191 insertions(+) diff --git a/src/gitpod/types/account_list_login_providers_params.py b/src/gitpod/types/account_list_login_providers_params.py index e7c5da7a..87a93493 100644 --- a/src/gitpod/types/account_list_login_providers_params.py +++ b/src/gitpod/types/account_list_login_providers_params.py @@ -22,11 +22,15 @@ class AccountListLoginProvidersParams(TypedDict, total=False): class Filter(TypedDict, total=False): + """filter contains the filter options for listing login methods""" + invite_id: Annotated[str, PropertyInfo(alias="inviteId")] """invite_id is the ID of the invite URL the user wants to login with""" class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing login methods""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/editor_list_params.py b/src/gitpod/types/editor_list_params.py index 42f94266..12c60741 100644 --- a/src/gitpod/types/editor_list_params.py +++ b/src/gitpod/types/editor_list_params.py @@ -22,6 +22,8 @@ class EditorListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + """filter contains the filter options for listing editors""" + allowed_by_policy: Annotated[bool, PropertyInfo(alias="allowedByPolicy")] """ allowed_by_policy filters the response to only editors that are allowed by the @@ -30,6 +32,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing environments""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/environment.py b/src/gitpod/types/environment.py index 560cf251..0294448f 100644 --- a/src/gitpod/types/environment.py +++ b/src/gitpod/types/environment.py @@ -11,6 +11,8 @@ class Environment(BaseModel): + """+resource get environment""" + id: str """ID is a unique identifier of this environment. diff --git a/src/gitpod/types/environment_activity_signal.py b/src/gitpod/types/environment_activity_signal.py index afedc991..42f41bc1 100644 --- a/src/gitpod/types/environment_activity_signal.py +++ b/src/gitpod/types/environment_activity_signal.py @@ -9,6 +9,8 @@ class EnvironmentActivitySignal(BaseModel): + """EnvironmentActivitySignal used to signal activity for an environment.""" + source: Optional[str] = None """ source of the activity signal, such as "VS Code", "SSH", or "Automations". It diff --git a/src/gitpod/types/environment_activity_signal_param.py b/src/gitpod/types/environment_activity_signal_param.py index a9cb0c17..7f0e1fb4 100644 --- a/src/gitpod/types/environment_activity_signal_param.py +++ b/src/gitpod/types/environment_activity_signal_param.py @@ -12,6 +12,8 @@ class EnvironmentActivitySignalParam(TypedDict, total=False): + """EnvironmentActivitySignal used to signal activity for an environment.""" + source: str """ source of the activity signal, such as "VS Code", "SSH", or "Automations". It diff --git a/src/gitpod/types/environment_initializer.py b/src/gitpod/types/environment_initializer.py index 2a2866ae..17d42ca5 100644 --- a/src/gitpod/types/environment_initializer.py +++ b/src/gitpod/types/environment_initializer.py @@ -49,4 +49,6 @@ class Spec(BaseModel): class EnvironmentInitializer(BaseModel): + """EnvironmentInitializer specifies how an environment is to be initialized""" + specs: Optional[List[Spec]] = None diff --git a/src/gitpod/types/environment_initializer_param.py b/src/gitpod/types/environment_initializer_param.py index 695d8369..b9a8a978 100644 --- a/src/gitpod/types/environment_initializer_param.py +++ b/src/gitpod/types/environment_initializer_param.py @@ -50,4 +50,6 @@ class Spec(TypedDict, total=False): class EnvironmentInitializerParam(TypedDict, total=False): + """EnvironmentInitializer specifies how an environment is to be initialized""" + specs: Iterable[Spec] diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index 2e3ed79f..e0ff12ed 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -69,6 +69,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing environments""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/environment_metadata.py b/src/gitpod/types/environment_metadata.py index 67090e04..38cb520a 100644 --- a/src/gitpod/types/environment_metadata.py +++ b/src/gitpod/types/environment_metadata.py @@ -12,6 +12,11 @@ class EnvironmentMetadata(BaseModel): + """ + EnvironmentMetadata is data associated with an environment that's required for + other parts of the system to function + """ + annotations: Optional[Dict[str, str]] = None """ annotations are key/value pairs that gets attached to the environment. diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index a6ccaa63..3e14a5a6 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -24,6 +24,8 @@ class AutomationsFile(BaseModel): + """automations_file is the automations file spec of the environment""" + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file that is applied in the @@ -39,6 +41,8 @@ class AutomationsFile(BaseModel): class Content(BaseModel): + """content is the content spec of the environment""" + git_email: Optional[str] = FieldInfo(alias="gitEmail", default=None) """The Git email address""" @@ -52,11 +56,15 @@ class Content(BaseModel): class DevcontainerDotfiles(BaseModel): + """Experimental: dotfiles is the dotfiles configuration of the devcontainer""" + repository: str """URL of a dotfiles Git repository (e.g. https://github.com/owner/repository)""" class Devcontainer(BaseModel): + """devcontainer is the devcontainer spec of the environment""" + default_devcontainer_image: Optional[str] = FieldInfo(alias="defaultDevcontainerImage", default=None) """ default_devcontainer_image is the default image that is used to start the @@ -80,6 +88,8 @@ class Devcontainer(BaseModel): class Machine(BaseModel): + """machine is the machine spec of the environment""" + class_: Optional[str] = FieldInfo(alias="class", default=None) """Class denotes the class of the environment we ought to start""" @@ -139,6 +149,8 @@ class SSHPublicKey(BaseModel): class Timeout(BaseModel): + """Timeout configures the environment timeout""" + disconnected: Optional[str] = None """ inacitivity is the maximum time of disconnection before the environment is @@ -147,6 +159,11 @@ class Timeout(BaseModel): class EnvironmentSpec(BaseModel): + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + admission: Optional[AdmissionLevel] = None """admission controlls who can access the environment and its ports.""" diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index 6e846a5b..e2fb03ce 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -25,6 +25,8 @@ class AutomationsFile(TypedDict, total=False): + """automations_file is the automations file spec of the environment""" + automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file that is applied in the @@ -40,6 +42,8 @@ class AutomationsFile(TypedDict, total=False): class Content(TypedDict, total=False): + """content is the content spec of the environment""" + git_email: Annotated[str, PropertyInfo(alias="gitEmail")] """The Git email address""" @@ -53,11 +57,15 @@ class Content(TypedDict, total=False): class DevcontainerDotfiles(TypedDict, total=False): + """Experimental: dotfiles is the dotfiles configuration of the devcontainer""" + repository: Required[str] """URL of a dotfiles Git repository (e.g. https://github.com/owner/repository)""" class Devcontainer(TypedDict, total=False): + """devcontainer is the devcontainer spec of the environment""" + default_devcontainer_image: Annotated[str, PropertyInfo(alias="defaultDevcontainerImage")] """ default_devcontainer_image is the default image that is used to start the @@ -90,6 +98,8 @@ class Devcontainer(TypedDict, total=False): class Machine(_MachineReservedKeywords, total=False): + """machine is the machine spec of the environment""" + session: str @@ -146,6 +156,8 @@ class SSHPublicKey(TypedDict, total=False): class Timeout(TypedDict, total=False): + """Timeout configures the environment timeout""" + disconnected: str """ inacitivity is the maximum time of disconnection before the environment is @@ -154,6 +166,11 @@ class Timeout(TypedDict, total=False): class EnvironmentSpecParam(TypedDict, total=False): + """ + EnvironmentSpec specifies the configuration of an environment for an environment + start + """ + admission: AdmissionLevel """admission controlls who can access the environment and its ports.""" diff --git a/src/gitpod/types/environment_status.py b/src/gitpod/types/environment_status.py index 45955432..aae1b3a4 100644 --- a/src/gitpod/types/environment_status.py +++ b/src/gitpod/types/environment_status.py @@ -28,6 +28,8 @@ class AutomationsFile(BaseModel): + """automations_file contains the status of the automations file.""" + automations_file_path: Optional[str] = FieldInfo(alias="automationsFilePath", default=None) """ automations_file_path is the path to the automations file relative to the repo @@ -93,6 +95,12 @@ class ContentGitChangedFile(BaseModel): class ContentGit(BaseModel): + """ + git is the Git working copy status of the environment. + Note: this is a best-effort field and more often than not will not be + present. Its absence does not indicate the absence of a working copy. + """ + branch: Optional[str] = None """branch is branch we're currently on""" @@ -124,6 +132,8 @@ class ContentGit(BaseModel): class Content(BaseModel): + """content contains the status of the environment content.""" + content_location_in_machine: Optional[str] = FieldInfo(alias="contentLocationInMachine", default=None) """content_location_in_machine is the location of the content in the machine""" @@ -160,6 +170,8 @@ class Content(BaseModel): class Devcontainer(BaseModel): + """devcontainer contains the status of the devcontainer.""" + container_id: Optional[str] = FieldInfo(alias="containerId", default=None) """container_id is the ID of the container.""" @@ -231,10 +243,17 @@ class EnvironmentURLsPort(BaseModel): class EnvironmentURLsSSH(BaseModel): + """SSH is the URL at which the environment can be accessed via SSH.""" + url: Optional[str] = None class EnvironmentURLs(BaseModel): + """ + environment_url contains the URL at which the environment can be accessed. + This field is only set if the environment is running. + """ + logs: Optional[str] = None """logs is the URL at which the environment logs can be accessed.""" @@ -245,12 +264,16 @@ class EnvironmentURLs(BaseModel): class MachineVersions(BaseModel): + """versions contains the versions of components in the machine.""" + supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) class Machine(BaseModel): + """machine contains the status of the environment machine""" + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message contains the reason the machine failed to operate.""" @@ -288,6 +311,11 @@ class Machine(BaseModel): class RunnerAck(BaseModel): + """ + runner_ack contains the acknowledgement from the runner that is has + received the environment spec. + """ + message: Optional[str] = None spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) @@ -350,6 +378,8 @@ class SSHPublicKey(BaseModel): class EnvironmentStatus(BaseModel): + """EnvironmentStatus describes an environment status""" + activity_signal: Optional[EnvironmentActivitySignal] = FieldInfo(alias="activitySignal", default=None) """activity_signal is the last activity signal for the environment.""" diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index 60d7bfcf..172877e9 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -40,6 +40,8 @@ class Metadata(TypedDict, total=False): class SpecAutomationsFile(TypedDict, total=False): + """automations_file is the automations file spec of the environment""" + automations_file_path: Annotated[Optional[str], PropertyInfo(alias="automationsFilePath")] """ automations_file_path is the path to the automations file that is applied in the @@ -106,6 +108,8 @@ class SpecSSHPublicKey(TypedDict, total=False): class SpecTimeout(TypedDict, total=False): + """Timeout configures the environment timeout""" + disconnected: Optional[str] """ inacitivity is the maximum time of disconnection before the environment is diff --git a/src/gitpod/types/environment_usage_record.py b/src/gitpod/types/environment_usage_record.py index 59c85a7c..4dacb3d0 100644 --- a/src/gitpod/types/environment_usage_record.py +++ b/src/gitpod/types/environment_usage_record.py @@ -11,6 +11,10 @@ class EnvironmentUsageRecord(BaseModel): + """ + EnvironmentUsageRecord represents a record of an environment from start to stop. + """ + id: Optional[str] = None """Environment usage record ID.""" diff --git a/src/gitpod/types/environments/automations/service_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py index 76c8981d..8a91cdc6 100644 --- a/src/gitpod/types/environments/automations/service_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -23,6 +23,8 @@ class ServiceListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + """filter contains the filter options for listing services""" + environment_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentIds")] """environment_ids filters the response to only services of these environments""" @@ -34,6 +36,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing services""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/environments/automations/service_spec.py b/src/gitpod/types/environments/automations/service_spec.py index 7e160fe3..6240b462 100644 --- a/src/gitpod/types/environments/automations/service_spec.py +++ b/src/gitpod/types/environments/automations/service_spec.py @@ -12,6 +12,10 @@ class Commands(BaseModel): + """ + commands contains the commands to start, stop and check the readiness of the service + """ + ready: Optional[str] = None """ ready is an optional command that is run repeatedly until it exits with a zero diff --git a/src/gitpod/types/environments/automations/service_spec_param.py b/src/gitpod/types/environments/automations/service_spec_param.py index 469be0e2..b08445b4 100644 --- a/src/gitpod/types/environments/automations/service_spec_param.py +++ b/src/gitpod/types/environments/automations/service_spec_param.py @@ -12,6 +12,10 @@ class Commands(TypedDict, total=False): + """ + commands contains the commands to start, stop and check the readiness of the service + """ + ready: str """ ready is an optional command that is run repeatedly until it exits with a zero diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index 3fba2a06..a1c08a83 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -54,12 +54,26 @@ class SpecCommands(TypedDict, total=False): class Spec(TypedDict, total=False): + """Changing the spec of a service is a complex operation. + + The spec of a service + can only be updated if the service is in a stopped state. If the service is + running, it must be stopped first. + """ + commands: Optional[SpecCommands] runs_on: Annotated[Optional[RunsOn], PropertyInfo(alias="runsOn")] class Status(TypedDict, total=False): + """Service status updates are only expected from the executing environment. + + As a client + of this API you are not expected to provide this field. Updating this field requires + the `environmentservice:update_status` permission. + """ + failure_message: Annotated[Optional[str], PropertyInfo(alias="failureMessage")] log_url: Annotated[Optional[str], PropertyInfo(alias="logUrl")] diff --git a/src/gitpod/types/environments/automations/task_list_params.py b/src/gitpod/types/environments/automations/task_list_params.py index 3dc576db..1c10420f 100644 --- a/src/gitpod/types/environments/automations/task_list_params.py +++ b/src/gitpod/types/environments/automations/task_list_params.py @@ -23,6 +23,8 @@ class TaskListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + """filter contains the filter options for listing tasks""" + environment_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentIds")] """environment_ids filters the response to only tasks of these environments""" @@ -34,6 +36,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing tasks""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/environments/automations/tasks/execution_list_params.py b/src/gitpod/types/environments/automations/tasks/execution_list_params.py index a8f517cc..158f7e14 100644 --- a/src/gitpod/types/environments/automations/tasks/execution_list_params.py +++ b/src/gitpod/types/environments/automations/tasks/execution_list_params.py @@ -25,6 +25,8 @@ class ExecutionListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + """filter contains the filter options for listing task runs""" + environment_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentIds")] """environment_ids filters the response to only task runs of these environments""" @@ -39,6 +41,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing task runs""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/environments/automations_file_param.py b/src/gitpod/types/environments/automations_file_param.py index 977537ce..7d4a2562 100644 --- a/src/gitpod/types/environments/automations_file_param.py +++ b/src/gitpod/types/environments/automations_file_param.py @@ -73,6 +73,12 @@ class Tasks(TypedDict, total=False): class AutomationsFileParam(TypedDict, total=False): + """ + WARN: Do not remove any field here, as it will break reading automation yaml files. We error if there are any + unknown fields in the yaml (to ensure the yaml is correct), but would break if we removed any fields. + This includes marking a field as "reserved" in the proto file, this will also break reading the yaml. + """ + services: Dict[str, Services] tasks: Dict[str, Tasks] diff --git a/src/gitpod/types/environments/class_list_params.py b/src/gitpod/types/environments/class_list_params.py index c47afe5c..c42dc49a 100644 --- a/src/gitpod/types/environments/class_list_params.py +++ b/src/gitpod/types/environments/class_list_params.py @@ -56,6 +56,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing environment classes""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/event_list_params.py b/src/gitpod/types/event_list_params.py index 06af4ab5..51ddc544 100644 --- a/src/gitpod/types/event_list_params.py +++ b/src/gitpod/types/event_list_params.py @@ -35,6 +35,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing environments""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/gateway_list_params.py b/src/gitpod/types/gateway_list_params.py index 8afa4676..d4449316 100644 --- a/src/gitpod/types/gateway_list_params.py +++ b/src/gitpod/types/gateway_list_params.py @@ -19,6 +19,8 @@ class GatewayListParams(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing gateways""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/group_list_params.py b/src/gitpod/types/group_list_params.py index 9b7e7e8e..223e3e8d 100644 --- a/src/gitpod/types/group_list_params.py +++ b/src/gitpod/types/group_list_params.py @@ -19,6 +19,8 @@ class GroupListParams(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing groups""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index aa85f580..ad8d4495 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -22,6 +22,8 @@ class OrganizationListMembersParams(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing members""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py index 558a8338..ccd432f5 100644 --- a/src/gitpod/types/project_list_params.py +++ b/src/gitpod/types/project_list_params.py @@ -27,6 +27,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing organizations""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/projects/policy_list_params.py b/src/gitpod/types/projects/policy_list_params.py index 9f860882..82a4459d 100644 --- a/src/gitpod/types/projects/policy_list_params.py +++ b/src/gitpod/types/projects/policy_list_params.py @@ -22,6 +22,8 @@ class PolicyListParams(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing project policies""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/runner_check_authentication_for_host_response.py b/src/gitpod/types/runner_check_authentication_for_host_response.py index 273d871c..4ee9a3dc 100644 --- a/src/gitpod/types/runner_check_authentication_for_host_response.py +++ b/src/gitpod/types/runner_check_authentication_for_host_response.py @@ -10,6 +10,8 @@ class SupportsOauth2(BaseModel): + """supports_oauth2 indicates that the host supports OAuth2 authentication""" + auth_url: Optional[str] = FieldInfo(alias="authUrl", default=None) """auth_url is the URL where users can authenticate""" @@ -18,6 +20,10 @@ class SupportsOauth2(BaseModel): class SupportsPat(BaseModel): + """ + supports_pat indicates that the host supports Personal Access Token authentication + """ + create_url: Optional[str] = FieldInfo(alias="createUrl", default=None) """create_url is the URL where users can create a new Personal Access Token""" diff --git a/src/gitpod/types/runner_list_params.py b/src/gitpod/types/runner_list_params.py index d013e9d5..595ff262 100644 --- a/src/gitpod/types/runner_list_params.py +++ b/src/gitpod/types/runner_list_params.py @@ -36,6 +36,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing runners""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/runner_status.py b/src/gitpod/types/runner_status.py index a302c70a..d1d2971f 100644 --- a/src/gitpod/types/runner_status.py +++ b/src/gitpod/types/runner_status.py @@ -15,6 +15,8 @@ class RunnerStatus(BaseModel): + """RunnerStatus represents the status of a runner""" + additional_info: Optional[List[FieldValue]] = FieldInfo(alias="additionalInfo", default=None) """additional_info contains additional information about the runner, e.g. diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index 4bef0fe3..444e842e 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -27,6 +27,8 @@ class RunnerUpdateParams(TypedDict, total=False): class SpecConfigurationMetrics(TypedDict, total=False): + """metrics contains configuration for the runner's metrics collection""" + enabled: Optional[bool] """enabled indicates whether the runner should collect metrics""" diff --git a/src/gitpod/types/runners/configurations/environment_class_list_params.py b/src/gitpod/types/runners/configurations/environment_class_list_params.py index f8f0b97c..6ff1dfcb 100644 --- a/src/gitpod/types/runners/configurations/environment_class_list_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_params.py @@ -56,6 +56,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing environment classes""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/runners/configurations/scm_integration_list_params.py b/src/gitpod/types/runners/configurations/scm_integration_list_params.py index 811ec9cd..05d76efc 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_list_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_list_params.py @@ -27,6 +27,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing scm integrations""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/runners/policy_list_params.py b/src/gitpod/types/runners/policy_list_params.py index 8317d429..3da2bf3e 100644 --- a/src/gitpod/types/runners/policy_list_params.py +++ b/src/gitpod/types/runners/policy_list_params.py @@ -22,6 +22,8 @@ class PolicyListParams(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing project policies""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/secret_list_params.py b/src/gitpod/types/secret_list_params.py index 0ecd8336..bffe7344 100644 --- a/src/gitpod/types/secret_list_params.py +++ b/src/gitpod/types/secret_list_params.py @@ -34,6 +34,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing environments""" + token: str """ Token for the next set of results that was returned as next_token of a diff --git a/src/gitpod/types/shared/automation_trigger.py b/src/gitpod/types/shared/automation_trigger.py index 2b5eba3c..d319ff02 100644 --- a/src/gitpod/types/shared/automation_trigger.py +++ b/src/gitpod/types/shared/automation_trigger.py @@ -10,6 +10,12 @@ class AutomationTrigger(BaseModel): + """ + An AutomationTrigger represents a trigger for an automation action. + The `post_environment_start` field indicates that the automation should be triggered after the environment has started. + The `post_devcontainer_start` field indicates that the automation should be triggered after the dev container has started. + """ + manual: Optional[bool] = None post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) diff --git a/src/gitpod/types/shared/gateway.py b/src/gitpod/types/shared/gateway.py index cae2976f..a63e58f9 100644 --- a/src/gitpod/types/shared/gateway.py +++ b/src/gitpod/types/shared/gateway.py @@ -8,6 +8,8 @@ class Gateway(BaseModel): + """Gateway represents a system gateway that provides access to services""" + name: str """name is the human-readable name of the gateway. diff --git a/src/gitpod/types/shared_params/automation_trigger.py b/src/gitpod/types/shared_params/automation_trigger.py index 173dff4c..2327173a 100644 --- a/src/gitpod/types/shared_params/automation_trigger.py +++ b/src/gitpod/types/shared_params/automation_trigger.py @@ -10,6 +10,12 @@ class AutomationTrigger(TypedDict, total=False): + """ + An AutomationTrigger represents a trigger for an automation action. + The `post_environment_start` field indicates that the automation should be triggered after the environment has started. + The `post_devcontainer_start` field indicates that the automation should be triggered after the dev container has started. + """ + manual: bool post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] diff --git a/src/gitpod/types/usage_list_environment_runtime_records_params.py b/src/gitpod/types/usage_list_environment_runtime_records_params.py index 3f972435..e3459eae 100644 --- a/src/gitpod/types/usage_list_environment_runtime_records_params.py +++ b/src/gitpod/types/usage_list_environment_runtime_records_params.py @@ -24,6 +24,8 @@ class UsageListEnvironmentRuntimeRecordsParams(TypedDict, total=False): class FilterDateRange(TypedDict, total=False): + """Date range to query runtime records within.""" + end_time: Required[Annotated[Union[str, datetime], PropertyInfo(alias="endTime", format="iso8601")]] """End time of the date range (exclusive).""" @@ -32,6 +34,8 @@ class FilterDateRange(TypedDict, total=False): class Filter(TypedDict, total=False): + """Filter options.""" + date_range: Required[Annotated[FilterDateRange, PropertyInfo(alias="dateRange")]] """Date range to query runtime records within.""" @@ -40,6 +44,8 @@ class Filter(TypedDict, total=False): class Pagination(TypedDict, total=False): + """Pagination options.""" + token: str """ Token for the next set of results that was returned as next_token of a From f282d9677242303b0c75538d5edcb8193edfe195 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 09:46:26 +0000 Subject: [PATCH 223/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3e2bf498..980ea052 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.1" + ".": "0.4.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a5eebf56..5d73847e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.4.1" +version = "0.4.2" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index fffd9e81..76dce375 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.4.1" # x-release-please-version +__version__ = "0.4.2" # x-release-please-version From 6c622cb28bb48e9fa1062ef9d9641d292a42b471 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 09:51:48 +0000 Subject: [PATCH 224/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 980ea052..f8007191 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.2" + ".": "0.4.3" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5d73847e..b30e3aa4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.4.2" +version = "0.4.3" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 76dce375..4dd9d2a8 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.4.2" # x-release-please-version +__version__ = "0.4.3" # x-release-please-version From 51db369c82935c437af98caef01b90894e185f4b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 10:32:06 +0000 Subject: [PATCH 225/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f8007191..0c02950d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.3" + ".": "0.4.4" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b30e3aa4..eb0612a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.4.3" +version = "0.4.4" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 4dd9d2a8..fb7ab941 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.4.3" # x-release-please-version +__version__ = "0.4.4" # x-release-please-version From 43b3ab89825c393410deb34b3295135c16d0b9f6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 13:54:21 +0000 Subject: [PATCH 226/505] feat(api): RBAC APIs --- .stats.yml | 8 +- README.md | 8 +- SECURITY.md | 2 +- api.md | 186 +- pyproject.toml | 2 +- src/gitpod/_client.py | 27 +- src/gitpod/pagination.py | 424 +++++ src/gitpod/resources/__init__.py | 42 + src/gitpod/resources/accounts.py | 205 ++- src/gitpod/resources/agents.py | 1516 +++++++++++++++++ src/gitpod/resources/editors.py | 14 + src/gitpod/resources/errors.py | 199 +++ src/gitpod/resources/groups.py | 252 --- src/gitpod/resources/groups/__init__.py | 47 + src/gitpod/resources/groups/groups.py | 843 +++++++++ src/gitpod/resources/groups/memberships.py | 516 ++++++ .../resources/groups/role_assignments.py | 580 +++++++ .../resources/organizations/__init__.py | 14 + .../resources/organizations/custom_domains.py | 636 +++++++ .../resources/organizations/organizations.py | 36 + .../resources/organizations/policies.py | 66 +- .../organizations/sso_configurations.py | 34 +- src/gitpod/resources/prebuilds.py | 860 ++++++++++ src/gitpod/resources/projects/__init__.py | 14 + .../resources/projects/environment_clases.py | 385 +++++ src/gitpod/resources/projects/projects.py | 102 +- .../host_authentication_tokens.py | 39 +- .../configurations/scm_integrations.py | 28 + src/gitpod/resources/runners/runners.py | 304 ++++ src/gitpod/resources/secrets.py | 12 + src/gitpod/resources/users/users.py | 196 ++- src/gitpod/types/__init__.py | 89 +- src/gitpod/types/account_delete_params.py | 4 + ...ount_list_joinable_organizations_params.py | 21 +- ...nt_list_joinable_organizations_response.py | 16 - .../account_list_login_providers_params.py | 6 +- .../types/account_list_sso_logins_params.py | 41 + .../types/account_list_sso_logins_response.py | 18 + src/gitpod/types/agent_code_context.py | 71 + src/gitpod/types/agent_code_context_param.py | 72 + ...ate_execution_conversation_token_params.py | 13 + ...e_execution_conversation_token_response.py | 11 + .../types/agent_create_prompt_params.py | 23 + .../types/agent_create_prompt_response.py | 12 + .../types/agent_delete_execution_params.py | 13 + .../types/agent_delete_prompt_params.py | 13 + src/gitpod/types/agent_execution.py | 439 +++++ .../types/agent_list_executions_params.py | 56 + src/gitpod/types/agent_list_prompts_params.py | 43 + src/gitpod/types/agent_mode.py | 7 + .../types/agent_retrieve_execution_params.py | 13 + .../agent_retrieve_execution_response.py | 14 + .../types/agent_retrieve_prompt_params.py | 13 + .../types/agent_retrieve_prompt_response.py | 12 + .../types/agent_send_to_execution_params.py | 16 + .../types/agent_start_execution_params.py | 32 + .../types/agent_start_execution_response.py | 13 + .../types/agent_stop_execution_params.py | 13 + .../types/agent_update_prompt_params.py | 47 + .../types/agent_update_prompt_response.py | 12 + src/gitpod/types/breadcrumb_param.py | 34 + src/gitpod/types/editor.py | 6 +- src/gitpod/types/editor_resolve_url_params.py | 8 + src/gitpod/types/editor_version.py | 10 + src/gitpod/types/environment_initializer.py | 1 + .../types/environment_initializer_param.py | 1 + src/gitpod/types/environment_list_params.py | 10 +- src/gitpod/types/environment_metadata.py | 10 + src/gitpod/types/environment_role.py | 9 + src/gitpod/types/environment_spec.py | 38 +- src/gitpod/types/environment_spec_param.py | 42 +- src/gitpod/types/environment_status.py | 15 + src/gitpod/types/environment_update_params.py | 9 +- .../environments/automations/__init__.py | 1 + .../automations/service_list_params.py | 5 + .../automations/service_metadata.py | 4 + .../automations/service_metadata_param.py | 4 + .../environments/automations/service_role.py | 13 + .../environments/automations/service_spec.py | 6 +- .../automations/service_spec_param.py | 5 + .../automations/service_update_params.py | 6 + .../automations/task_update_params.py | 3 + .../environments/automations_file_param.py | 5 +- src/gitpod/types/error_event_param.py | 74 + src/gitpod/types/error_level.py | 14 + .../types/error_report_errors_params.py | 15 + src/gitpod/types/event_list_params.py | 2 +- src/gitpod/types/event_list_response.py | 2 +- src/gitpod/types/event_watch_response.py | 2 +- src/gitpod/types/exception_info_param.py | 34 + src/gitpod/types/exception_mechanism_param.py | 27 + src/gitpod/types/group.py | 5 + src/gitpod/types/group_create_params.py | 17 + src/gitpod/types/group_create_response.py | 12 + src/gitpod/types/group_delete_params.py | 13 + src/gitpod/types/group_retrieve_params.py | 13 + src/gitpod/types/group_retrieve_response.py | 12 + src/gitpod/types/group_update_params.py | 17 + src/gitpod/types/group_update_response.py | 12 + src/gitpod/types/groups/__init__.py | 15 + src/gitpod/types/groups/group_membership.py | 29 + .../types/groups/membership_create_params.py | 17 + .../groups/membership_create_response.py | 13 + .../types/groups/membership_delete_params.py | 14 + .../types/groups/membership_list_params.py | 36 + src/gitpod/types/groups/resource_role.py | 56 + src/gitpod/types/groups/role_assignment.py | 33 + .../groups/role_assignment_create_params.py | 25 + .../groups/role_assignment_create_response.py | 13 + .../groups/role_assignment_delete_params.py | 13 + .../groups/role_assignment_list_params.py | 68 + src/gitpod/types/organization.py | 2 +- .../types/organization_list_members_params.py | 9 +- src/gitpod/types/organization_tier.py | 6 +- src/gitpod/types/organizations/__init__.py | 12 + .../types/organizations/agent_policy.py | 31 + .../organizations/crowd_strike_config.py | 34 + .../types/organizations/custom_domain.py | 42 + .../custom_domain_create_params.py | 31 + .../custom_domain_create_response.py | 15 + .../custom_domain_delete_params.py | 14 + .../organizations/custom_domain_provider.py | 9 + .../custom_domain_retrieve_params.py | 14 + .../custom_domain_retrieve_response.py | 13 + .../custom_domain_update_params.py | 31 + .../custom_domain_update_response.py | 15 + .../organizations/organization_policies.py | 60 +- .../organizations/policy_update_params.py | 111 +- .../organizations/security_agent_policy.py | 18 + .../types/organizations/sso_configuration.py | 6 +- .../sso_configuration_create_params.py | 12 +- .../sso_configuration_update_params.py | 5 + src/gitpod/types/prebuild.py | 29 + src/gitpod/types/prebuild_cancel_params.py | 14 + src/gitpod/types/prebuild_cancel_response.py | 14 + .../prebuild_create_logs_token_params.py | 17 + .../prebuild_create_logs_token_response.py | 12 + src/gitpod/types/prebuild_create_params.py | 25 + src/gitpod/types/prebuild_create_response.py | 14 + src/gitpod/types/prebuild_delete_params.py | 14 + src/gitpod/types/prebuild_list_params.py | 50 + src/gitpod/types/prebuild_metadata.py | 54 + src/gitpod/types/prebuild_phase.py | 20 + src/gitpod/types/prebuild_retrieve_params.py | 14 + .../types/prebuild_retrieve_response.py | 14 + src/gitpod/types/prebuild_spec.py | 32 + src/gitpod/types/prebuild_spec_param.py | 32 + src/gitpod/types/prebuild_status.py | 51 + src/gitpod/types/prebuild_trigger.py | 9 + src/gitpod/types/project.py | 19 +- src/gitpod/types/project_create_params.py | 10 +- src/gitpod/types/project_list_params.py | 12 + src/gitpod/types/project_phase.py | 7 + .../types/project_prebuild_configuration.py | 74 + .../project_prebuild_configuration_param.py | 75 + src/gitpod/types/project_update_params.py | 13 +- src/gitpod/types/projects/__init__.py | 2 + .../projects/environment_clase_list_params.py | 37 + .../environment_clase_update_params.py | 20 + src/gitpod/types/prompt.py | 17 + src/gitpod/types/prompt_metadata.py | 209 +++ src/gitpod/types/prompt_spec.py | 23 + src/gitpod/types/request_info_param.py | 29 + src/gitpod/types/runner.py | 6 + src/gitpod/types/runner_capability.py | 1 + src/gitpod/types/runner_configuration.py | 2 +- .../types/runner_configuration_param.py | 2 +- .../types/runner_create_logs_token_params.py | 17 + .../runner_create_logs_token_response.py | 15 + .../runner_parse_context_url_response.py | 82 +- src/gitpod/types/runner_provider.py | 1 + .../runner_search_repositories_params.py | 48 + .../runner_search_repositories_response.py | 38 + src/gitpod/types/runner_spec.py | 4 + src/gitpod/types/runner_spec_param.py | 4 + src/gitpod/types/runner_status.py | 13 + src/gitpod/types/runner_variant.py | 7 + .../runners/configuration_validate_params.py | 8 + .../host_authentication_token.py | 18 +- ...host_authentication_token_create_params.py | 13 + .../host_authentication_token_list_params.py | 4 + ...host_authentication_token_update_params.py | 3 + .../runners/configurations/scm_integration.py | 8 + .../scm_integration_create_params.py | 8 + .../scm_integration_update_params.py | 8 + src/gitpod/types/search_mode.py | 7 + src/gitpod/types/secret.py | 3 + src/gitpod/types/secret_create_params.py | 7 + src/gitpod/types/secret_scope.py | 3 + src/gitpod/types/secret_scope_param.py | 3 + src/gitpod/types/shared/__init__.py | 5 + src/gitpod/types/shared/automation_trigger.py | 11 +- .../types/shared/environment_variable_item.py | 26 + .../shared/environment_variable_source.py | 15 + src/gitpod/types/shared/principal.py | 1 + .../{ => shared}/project_environment_class.py | 5 +- .../types/{ => shared}/resource_type.py | 17 + src/gitpod/types/shared/runs_on.py | 5 +- src/gitpod/types/shared/secret_ref.py | 14 + src/gitpod/types/shared/task_spec.py | 6 +- src/gitpod/types/shared_params/__init__.py | 5 + .../types/shared_params/automation_trigger.py | 11 +- .../environment_variable_item.py | 26 + .../environment_variable_source.py | 17 + src/gitpod/types/shared_params/principal.py | 1 + .../project_environment_class.py} | 9 +- .../types/shared_params/resource_type.py | 52 + src/gitpod/types/shared_params/runs_on.py | 7 +- src/gitpod/types/shared_params/secret_ref.py | 14 + src/gitpod/types/shared_params/task_spec.py | 5 + src/gitpod/types/stack_frame_param.py | 43 + src/gitpod/types/user.py | 3 + src/gitpod/types/user_delete_user_params.py | 13 + src/gitpod/types/user_get_user_params.py | 13 + src/gitpod/types/user_get_user_response.py | 10 + src/gitpod/types/user_input_block_param.py | 24 + .../environments/automations/test_services.py | 58 +- .../environments/automations/test_tasks.py | 52 +- .../environments/test_automations.py | 14 +- tests/api_resources/groups/__init__.py | 1 + .../api_resources/groups/test_memberships.py | 264 +++ .../groups/test_role_assignments.py | 272 +++ .../organizations/test_custom_domains.py | 360 ++++ .../organizations/test_policies.py | 36 + .../organizations/test_sso_configurations.py | 38 +- .../projects/test_environment_clases.py | 221 +++ .../test_host_authentication_tokens.py | 16 + .../configurations/test_scm_integrations.py | 4 + .../runners/test_configurations.py | 2 + tests/api_resources/test_accounts.py | 164 +- tests/api_resources/test_agents.py | 1037 +++++++++++ tests/api_resources/test_editors.py | 22 + tests/api_resources/test_environments.py | 70 +- tests/api_resources/test_errors.py | 224 +++ tests/api_resources/test_groups.py | 303 +++- tests/api_resources/test_organizations.py | 2 + tests/api_resources/test_prebuilds.py | 495 ++++++ tests/api_resources/test_projects.py | 78 +- tests/api_resources/test_runners.py | 164 ++ tests/api_resources/test_secrets.py | 6 + tests/api_resources/test_users.py | 149 +- 241 files changed, 15326 insertions(+), 467 deletions(-) create mode 100644 src/gitpod/resources/agents.py create mode 100644 src/gitpod/resources/errors.py delete mode 100644 src/gitpod/resources/groups.py create mode 100644 src/gitpod/resources/groups/__init__.py create mode 100644 src/gitpod/resources/groups/groups.py create mode 100644 src/gitpod/resources/groups/memberships.py create mode 100644 src/gitpod/resources/groups/role_assignments.py create mode 100644 src/gitpod/resources/organizations/custom_domains.py create mode 100644 src/gitpod/resources/prebuilds.py create mode 100644 src/gitpod/resources/projects/environment_clases.py delete mode 100644 src/gitpod/types/account_list_joinable_organizations_response.py create mode 100644 src/gitpod/types/account_list_sso_logins_params.py create mode 100644 src/gitpod/types/account_list_sso_logins_response.py create mode 100644 src/gitpod/types/agent_code_context.py create mode 100644 src/gitpod/types/agent_code_context_param.py create mode 100644 src/gitpod/types/agent_create_execution_conversation_token_params.py create mode 100644 src/gitpod/types/agent_create_execution_conversation_token_response.py create mode 100644 src/gitpod/types/agent_create_prompt_params.py create mode 100644 src/gitpod/types/agent_create_prompt_response.py create mode 100644 src/gitpod/types/agent_delete_execution_params.py create mode 100644 src/gitpod/types/agent_delete_prompt_params.py create mode 100644 src/gitpod/types/agent_execution.py create mode 100644 src/gitpod/types/agent_list_executions_params.py create mode 100644 src/gitpod/types/agent_list_prompts_params.py create mode 100644 src/gitpod/types/agent_mode.py create mode 100644 src/gitpod/types/agent_retrieve_execution_params.py create mode 100644 src/gitpod/types/agent_retrieve_execution_response.py create mode 100644 src/gitpod/types/agent_retrieve_prompt_params.py create mode 100644 src/gitpod/types/agent_retrieve_prompt_response.py create mode 100644 src/gitpod/types/agent_send_to_execution_params.py create mode 100644 src/gitpod/types/agent_start_execution_params.py create mode 100644 src/gitpod/types/agent_start_execution_response.py create mode 100644 src/gitpod/types/agent_stop_execution_params.py create mode 100644 src/gitpod/types/agent_update_prompt_params.py create mode 100644 src/gitpod/types/agent_update_prompt_response.py create mode 100644 src/gitpod/types/breadcrumb_param.py create mode 100644 src/gitpod/types/editor_version.py create mode 100644 src/gitpod/types/environment_role.py create mode 100644 src/gitpod/types/environments/automations/service_role.py create mode 100644 src/gitpod/types/error_event_param.py create mode 100644 src/gitpod/types/error_level.py create mode 100644 src/gitpod/types/error_report_errors_params.py create mode 100644 src/gitpod/types/exception_info_param.py create mode 100644 src/gitpod/types/exception_mechanism_param.py create mode 100644 src/gitpod/types/group_create_params.py create mode 100644 src/gitpod/types/group_create_response.py create mode 100644 src/gitpod/types/group_delete_params.py create mode 100644 src/gitpod/types/group_retrieve_params.py create mode 100644 src/gitpod/types/group_retrieve_response.py create mode 100644 src/gitpod/types/group_update_params.py create mode 100644 src/gitpod/types/group_update_response.py create mode 100644 src/gitpod/types/groups/__init__.py create mode 100644 src/gitpod/types/groups/group_membership.py create mode 100644 src/gitpod/types/groups/membership_create_params.py create mode 100644 src/gitpod/types/groups/membership_create_response.py create mode 100644 src/gitpod/types/groups/membership_delete_params.py create mode 100644 src/gitpod/types/groups/membership_list_params.py create mode 100644 src/gitpod/types/groups/resource_role.py create mode 100644 src/gitpod/types/groups/role_assignment.py create mode 100644 src/gitpod/types/groups/role_assignment_create_params.py create mode 100644 src/gitpod/types/groups/role_assignment_create_response.py create mode 100644 src/gitpod/types/groups/role_assignment_delete_params.py create mode 100644 src/gitpod/types/groups/role_assignment_list_params.py create mode 100644 src/gitpod/types/organizations/agent_policy.py create mode 100644 src/gitpod/types/organizations/crowd_strike_config.py create mode 100644 src/gitpod/types/organizations/custom_domain.py create mode 100644 src/gitpod/types/organizations/custom_domain_create_params.py create mode 100644 src/gitpod/types/organizations/custom_domain_create_response.py create mode 100644 src/gitpod/types/organizations/custom_domain_delete_params.py create mode 100644 src/gitpod/types/organizations/custom_domain_provider.py create mode 100644 src/gitpod/types/organizations/custom_domain_retrieve_params.py create mode 100644 src/gitpod/types/organizations/custom_domain_retrieve_response.py create mode 100644 src/gitpod/types/organizations/custom_domain_update_params.py create mode 100644 src/gitpod/types/organizations/custom_domain_update_response.py create mode 100644 src/gitpod/types/organizations/security_agent_policy.py create mode 100644 src/gitpod/types/prebuild.py create mode 100644 src/gitpod/types/prebuild_cancel_params.py create mode 100644 src/gitpod/types/prebuild_cancel_response.py create mode 100644 src/gitpod/types/prebuild_create_logs_token_params.py create mode 100644 src/gitpod/types/prebuild_create_logs_token_response.py create mode 100644 src/gitpod/types/prebuild_create_params.py create mode 100644 src/gitpod/types/prebuild_create_response.py create mode 100644 src/gitpod/types/prebuild_delete_params.py create mode 100644 src/gitpod/types/prebuild_list_params.py create mode 100644 src/gitpod/types/prebuild_metadata.py create mode 100644 src/gitpod/types/prebuild_phase.py create mode 100644 src/gitpod/types/prebuild_retrieve_params.py create mode 100644 src/gitpod/types/prebuild_retrieve_response.py create mode 100644 src/gitpod/types/prebuild_spec.py create mode 100644 src/gitpod/types/prebuild_spec_param.py create mode 100644 src/gitpod/types/prebuild_status.py create mode 100644 src/gitpod/types/prebuild_trigger.py create mode 100644 src/gitpod/types/project_phase.py create mode 100644 src/gitpod/types/project_prebuild_configuration.py create mode 100644 src/gitpod/types/project_prebuild_configuration_param.py create mode 100644 src/gitpod/types/projects/environment_clase_list_params.py create mode 100644 src/gitpod/types/projects/environment_clase_update_params.py create mode 100644 src/gitpod/types/prompt.py create mode 100644 src/gitpod/types/prompt_metadata.py create mode 100644 src/gitpod/types/prompt_spec.py create mode 100644 src/gitpod/types/request_info_param.py create mode 100644 src/gitpod/types/runner_create_logs_token_params.py create mode 100644 src/gitpod/types/runner_create_logs_token_response.py create mode 100644 src/gitpod/types/runner_search_repositories_params.py create mode 100644 src/gitpod/types/runner_search_repositories_response.py create mode 100644 src/gitpod/types/runner_variant.py create mode 100644 src/gitpod/types/search_mode.py create mode 100644 src/gitpod/types/shared/environment_variable_item.py create mode 100644 src/gitpod/types/shared/environment_variable_source.py rename src/gitpod/types/{ => shared}/project_environment_class.py (83%) rename src/gitpod/types/{ => shared}/resource_type.py (63%) create mode 100644 src/gitpod/types/shared/secret_ref.py create mode 100644 src/gitpod/types/shared_params/environment_variable_item.py create mode 100644 src/gitpod/types/shared_params/environment_variable_source.py rename src/gitpod/types/{project_environment_class_param.py => shared_params/project_environment_class.py} (72%) create mode 100644 src/gitpod/types/shared_params/resource_type.py create mode 100644 src/gitpod/types/shared_params/secret_ref.py create mode 100644 src/gitpod/types/stack_frame_param.py create mode 100644 src/gitpod/types/user_delete_user_params.py create mode 100644 src/gitpod/types/user_get_user_params.py create mode 100644 src/gitpod/types/user_get_user_response.py create mode 100644 src/gitpod/types/user_input_block_param.py create mode 100644 tests/api_resources/groups/__init__.py create mode 100644 tests/api_resources/groups/test_memberships.py create mode 100644 tests/api_resources/groups/test_role_assignments.py create mode 100644 tests/api_resources/organizations/test_custom_domains.py create mode 100644 tests/api_resources/projects/test_environment_clases.py create mode 100644 tests/api_resources/test_agents.py create mode 100644 tests/api_resources/test_errors.py create mode 100644 tests/api_resources/test_prebuilds.py diff --git a/.stats.yml b/.stats.yml index 9333247e..0fdb5b62 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 119 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ca9a49ac7fbb63f55611fd7cd48a22a3ff8b38a797125c8513e891d9b7345550.yml -openapi_spec_hash: fd6ffbdfaefcc555e61ca1c565e05214 -config_hash: 7fb76543ceafd4a116473f647f8d63b1 +configured_endpoints: 159 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d62ef4b9187c1f3d36f428abc4b31d8a09ffd36e93d39b8136c60c8f463c838e.yml +openapi_spec_hash: d7f01b6f24e88eb46d744ecd28061f26 +config_hash: 26e4a10dfc6ec809322e60d889d15414 diff --git a/README.md b/README.md index 7721c369..9c57f502 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It is generated with [Stainless](https://www.stainless.com/). ## Documentation -The REST API documentation can be found on [docs.ona.com](https://docs.ona.com). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.gitpod.io](https://docs.gitpod.io). The full API of this library can be found in [api.md](api.md). ## Installation @@ -178,10 +178,10 @@ from gitpod import Gitpod client = Gitpod() -page = client.accounts.list_login_providers( - filter={}, +page = client.accounts.list_joinable_organizations( + pagination={}, ) -print(page.login_providers) +print(page.joinable_organizations) ``` ## Handling errors diff --git a/SECURITY.md b/SECURITY.md index 8975e827..efd90888 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -20,7 +20,7 @@ or products provided by Gitpod, please follow the respective company's security ### Gitpod Terms and Policies -Please contact dev-feedback@ona.com for any questions or concerns regarding the security of our services. +Please contact dev-feedback@gitpod.com for any questions or concerns regarding the security of our services. --- diff --git a/api.md b/api.md index d6b34b7f..54769280 100644 --- a/api.md +++ b/api.md @@ -4,12 +4,17 @@ from gitpod.types import ( AutomationTrigger, EnvironmentClass, + EnvironmentVariableItem, + EnvironmentVariableSource, ErrorCode, FieldValue, Gateway, OrganizationRole, Principal, + ProjectEnvironmentClass, + ResourceType, RunsOn, + SecretRef, Subject, Task, TaskExecution, @@ -35,7 +40,7 @@ from gitpod.types import ( LoginProvider, AccountRetrieveResponse, AccountGetSSOLoginURLResponse, - AccountListJoinableOrganizationsResponse, + AccountListSSOLoginsResponse, ) ``` @@ -44,15 +49,53 @@ Methods: - client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse - client.accounts.delete(\*\*params) -> object - client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse -- client.accounts.list_joinable_organizations(\*\*params) -> AccountListJoinableOrganizationsResponse +- client.accounts.list_joinable_organizations(\*\*params) -> SyncJoinableOrganizationsPage[JoinableOrganization] - client.accounts.list_login_providers(\*\*params) -> SyncLoginProvidersPage[LoginProvider] +- client.accounts.list_sso_logins(\*\*params) -> SyncLoginsPage[AccountListSSOLoginsResponse] + +# Agents + +Types: + +```python +from gitpod.types import ( + AgentCodeContext, + AgentExecution, + AgentMode, + Prompt, + PromptMetadata, + PromptSpec, + UserInputBlock, + AgentCreateExecutionConversationTokenResponse, + AgentCreatePromptResponse, + AgentRetrieveExecutionResponse, + AgentRetrievePromptResponse, + AgentStartExecutionResponse, + AgentUpdatePromptResponse, +) +``` + +Methods: + +- client.agents.create_execution_conversation_token(\*\*params) -> AgentCreateExecutionConversationTokenResponse +- client.agents.create_prompt(\*\*params) -> AgentCreatePromptResponse +- client.agents.delete_execution(\*\*params) -> object +- client.agents.delete_prompt(\*\*params) -> object +- client.agents.list_executions(\*\*params) -> SyncAgentExecutionsPage[AgentExecution] +- client.agents.list_prompts(\*\*params) -> SyncPromptsPage[Prompt] +- client.agents.retrieve_execution(\*\*params) -> AgentRetrieveExecutionResponse +- client.agents.retrieve_prompt(\*\*params) -> AgentRetrievePromptResponse +- client.agents.send_to_execution(\*\*params) -> object +- client.agents.start_execution(\*\*params) -> AgentStartExecutionResponse +- client.agents.stop_execution(\*\*params) -> object +- client.agents.update_prompt(\*\*params) -> AgentUpdatePromptResponse # Editors Types: ```python -from gitpod.types import Editor, EditorRetrieveResponse, EditorResolveURLResponse +from gitpod.types import Editor, EditorVersion, EditorRetrieveResponse, EditorResolveURLResponse ``` Methods: @@ -72,6 +115,7 @@ from gitpod.types import ( EnvironmentActivitySignal, EnvironmentMetadata, EnvironmentPhase, + EnvironmentRole, EnvironmentSpec, EnvironmentStatus, EnvironmentCreateResponse, @@ -118,6 +162,7 @@ from gitpod.types.environments.automations import ( Service, ServiceMetadata, ServicePhase, + ServiceRole, ServiceSpec, ServiceStatus, ServiceCreateResponse, @@ -176,12 +221,32 @@ Methods: - client.environments.classes.list(\*\*params) -> SyncEnvironmentClassesPage[EnvironmentClass] +# Errors + +Types: + +```python +from gitpod.types import ( + Breadcrumb, + ErrorEvent, + ErrorLevel, + ExceptionInfo, + ExceptionMechanism, + RequestInfo, + StackFrame, +) +``` + +Methods: + +- client.errors.report_errors(\*\*params) -> object + # Events Types: ```python -from gitpod.types import ResourceOperation, ResourceType, EventListResponse, EventWatchResponse +from gitpod.types import ResourceOperation, EventListResponse, EventWatchResponse ``` Methods: @@ -200,12 +265,44 @@ Methods: Types: ```python -from gitpod.types import Group +from gitpod.types import Group, GroupCreateResponse, GroupRetrieveResponse, GroupUpdateResponse +``` + +Methods: + +- client.groups.create(\*\*params) -> GroupCreateResponse +- client.groups.retrieve(\*\*params) -> GroupRetrieveResponse +- client.groups.update(\*\*params) -> GroupUpdateResponse +- client.groups.list(\*\*params) -> SyncGroupsPage[Group] +- client.groups.delete(\*\*params) -> object + +## Memberships + +Types: + +```python +from gitpod.types.groups import GroupMembership, MembershipCreateResponse +``` + +Methods: + +- client.groups.memberships.create(\*\*params) -> MembershipCreateResponse +- client.groups.memberships.list(\*\*params) -> SyncMembersPage[GroupMembership] +- client.groups.memberships.delete(\*\*params) -> object + +## RoleAssignments + +Types: + +```python +from gitpod.types.groups import ResourceRole, RoleAssignment, RoleAssignmentCreateResponse ``` Methods: -- client.groups.list(\*\*params) -> SyncGroupsPage[Group] +- client.groups.role_assignments.create(\*\*params) -> RoleAssignmentCreateResponse +- client.groups.role_assignments.list(\*\*params) -> SyncAssignmentsPage[RoleAssignment] +- client.groups.role_assignments.delete(\*\*params) -> object # Identity @@ -254,6 +351,27 @@ Methods: - client.organizations.list_members(\*\*params) -> SyncMembersPage[OrganizationMember] - client.organizations.set_role(\*\*params) -> object +## CustomDomains + +Types: + +```python +from gitpod.types.organizations import ( + CustomDomain, + CustomDomainProvider, + CustomDomainCreateResponse, + CustomDomainRetrieveResponse, + CustomDomainUpdateResponse, +) +``` + +Methods: + +- client.organizations.custom_domains.create(\*\*params) -> CustomDomainCreateResponse +- client.organizations.custom_domains.retrieve(\*\*params) -> CustomDomainRetrieveResponse +- client.organizations.custom_domains.update(\*\*params) -> CustomDomainUpdateResponse +- client.organizations.custom_domains.delete(\*\*params) -> object + ## DomainVerifications Types: @@ -300,7 +418,13 @@ Methods: Types: ```python -from gitpod.types.organizations import OrganizationPolicies, PolicyRetrieveResponse +from gitpod.types.organizations import ( + AgentPolicy, + CrowdStrikeConfig, + OrganizationPolicies, + SecurityAgentPolicy, + PolicyRetrieveResponse, +) ``` Methods: @@ -330,6 +454,34 @@ Methods: - client.organizations.sso_configurations.list(\*\*params) -> SyncSSOConfigurationsPage[SSOConfiguration] - client.organizations.sso_configurations.delete(\*\*params) -> object +# Prebuilds + +Types: + +```python +from gitpod.types import ( + Prebuild, + PrebuildMetadata, + PrebuildPhase, + PrebuildSpec, + PrebuildStatus, + PrebuildTrigger, + PrebuildCreateResponse, + PrebuildRetrieveResponse, + PrebuildCancelResponse, + PrebuildCreateLogsTokenResponse, +) +``` + +Methods: + +- client.prebuilds.create(\*\*params) -> PrebuildCreateResponse +- client.prebuilds.retrieve(\*\*params) -> PrebuildRetrieveResponse +- client.prebuilds.list(\*\*params) -> SyncPrebuildsPage[Prebuild] +- client.prebuilds.delete(\*\*params) -> object +- client.prebuilds.cancel(\*\*params) -> PrebuildCancelResponse +- client.prebuilds.create_logs_token(\*\*params) -> PrebuildCreateLogsTokenResponse + # Projects Types: @@ -338,8 +490,9 @@ Types: from gitpod.types import ( EnvironmentInitializer, Project, - ProjectEnvironmentClass, ProjectMetadata, + ProjectPhase, + ProjectPrebuildConfiguration, ProjectCreateResponse, ProjectRetrieveResponse, ProjectUpdateResponse, @@ -356,6 +509,13 @@ Methods: - client.projects.delete(\*\*params) -> object - client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse +## EnvironmentClases + +Methods: + +- client.projects.environment_clases.update(\*\*params) -> object +- client.projects.environment_clases.list(\*\*params) -> SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass] + ## Policies Types: @@ -394,11 +554,15 @@ from gitpod.types import ( RunnerReleaseChannel, RunnerSpec, RunnerStatus, + RunnerVariant, + SearchMode, RunnerCreateResponse, RunnerRetrieveResponse, RunnerCheckAuthenticationForHostResponse, + RunnerCreateLogsTokenResponse, RunnerCreateRunnerTokenResponse, RunnerParseContextURLResponse, + RunnerSearchRepositoriesResponse, ) ``` @@ -410,8 +574,10 @@ Methods: - client.runners.list(\*\*params) -> SyncRunnersPage[Runner] - client.runners.delete(\*\*params) -> object - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse +- client.runners.create_logs_token(\*\*params) -> RunnerCreateLogsTokenResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse - client.runners.parse_context_url(\*\*params) -> RunnerParseContextURLResponse +- client.runners.search_repositories(\*\*params) -> RunnerSearchRepositoriesResponse ## Configurations @@ -555,12 +721,14 @@ Methods: Types: ```python -from gitpod.types import User, UserGetAuthenticatedUserResponse +from gitpod.types import User, UserGetAuthenticatedUserResponse, UserGetUserResponse ``` Methods: +- client.users.delete_user(\*\*params) -> object - client.users.get_authenticated_user(\*\*params) -> UserGetAuthenticatedUserResponse +- client.users.get_user(\*\*params) -> UserGetUserResponse - client.users.set_suspended(\*\*params) -> object ## Dotfiles diff --git a/pyproject.toml b/pyproject.toml index eb0612a2..5b178f85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" authors = [ -{ name = "Gitpod", email = "dev-feedback@ona.com" }, +{ name = "Gitpod", email = "dev-feedback@gitpod.com" }, ] dependencies = [ diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index d3675ad8..40bb8763 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -21,7 +21,7 @@ ) from ._utils import is_given, get_async_library from ._version import __version__ -from .resources import usage, events, groups, editors, secrets, accounts, gateways, identity +from .resources import usage, agents, errors, events, editors, secrets, accounts, gateways, identity, prebuilds from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import GitpodError, APIStatusError from ._base_client import ( @@ -30,6 +30,7 @@ AsyncAPIClient, ) from .resources.users import users +from .resources.groups import groups from .resources.runners import runners from .resources.projects import projects from .resources.environments import environments @@ -40,13 +41,16 @@ class Gitpod(SyncAPIClient): accounts: accounts.AccountsResource + agents: agents.AgentsResource editors: editors.EditorsResource environments: environments.EnvironmentsResource + errors: errors.ErrorsResource events: events.EventsResource gateways: gateways.GatewaysResource groups: groups.GroupsResource identity: identity.IdentityResource organizations: organizations.OrganizationsResource + prebuilds: prebuilds.PrebuildsResource projects: projects.ProjectsResource runners: runners.RunnersResource secrets: secrets.SecretsResource @@ -110,13 +114,16 @@ def __init__( ) self.accounts = accounts.AccountsResource(self) + self.agents = agents.AgentsResource(self) self.editors = editors.EditorsResource(self) self.environments = environments.EnvironmentsResource(self) + self.errors = errors.ErrorsResource(self) self.events = events.EventsResource(self) self.gateways = gateways.GatewaysResource(self) self.groups = groups.GroupsResource(self) self.identity = identity.IdentityResource(self) self.organizations = organizations.OrganizationsResource(self) + self.prebuilds = prebuilds.PrebuildsResource(self) self.projects = projects.ProjectsResource(self) self.runners = runners.RunnersResource(self) self.secrets = secrets.SecretsResource(self) @@ -232,13 +239,16 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): accounts: accounts.AsyncAccountsResource + agents: agents.AsyncAgentsResource editors: editors.AsyncEditorsResource environments: environments.AsyncEnvironmentsResource + errors: errors.AsyncErrorsResource events: events.AsyncEventsResource gateways: gateways.AsyncGatewaysResource groups: groups.AsyncGroupsResource identity: identity.AsyncIdentityResource organizations: organizations.AsyncOrganizationsResource + prebuilds: prebuilds.AsyncPrebuildsResource projects: projects.AsyncProjectsResource runners: runners.AsyncRunnersResource secrets: secrets.AsyncSecretsResource @@ -302,13 +312,16 @@ def __init__( ) self.accounts = accounts.AsyncAccountsResource(self) + self.agents = agents.AsyncAgentsResource(self) self.editors = editors.AsyncEditorsResource(self) self.environments = environments.AsyncEnvironmentsResource(self) + self.errors = errors.AsyncErrorsResource(self) self.events = events.AsyncEventsResource(self) self.gateways = gateways.AsyncGatewaysResource(self) self.groups = groups.AsyncGroupsResource(self) self.identity = identity.AsyncIdentityResource(self) self.organizations = organizations.AsyncOrganizationsResource(self) + self.prebuilds = prebuilds.AsyncPrebuildsResource(self) self.projects = projects.AsyncProjectsResource(self) self.runners = runners.AsyncRunnersResource(self) self.secrets = secrets.AsyncSecretsResource(self) @@ -425,13 +438,16 @@ def _make_status_error( class GitpodWithRawResponse: def __init__(self, client: Gitpod) -> None: self.accounts = accounts.AccountsResourceWithRawResponse(client.accounts) + self.agents = agents.AgentsResourceWithRawResponse(client.agents) self.editors = editors.EditorsResourceWithRawResponse(client.editors) self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) + self.errors = errors.ErrorsResourceWithRawResponse(client.errors) self.events = events.EventsResourceWithRawResponse(client.events) self.gateways = gateways.GatewaysResourceWithRawResponse(client.gateways) self.groups = groups.GroupsResourceWithRawResponse(client.groups) self.identity = identity.IdentityResourceWithRawResponse(client.identity) self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations) + self.prebuilds = prebuilds.PrebuildsResourceWithRawResponse(client.prebuilds) self.projects = projects.ProjectsResourceWithRawResponse(client.projects) self.runners = runners.RunnersResourceWithRawResponse(client.runners) self.secrets = secrets.SecretsResourceWithRawResponse(client.secrets) @@ -442,13 +458,16 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithRawResponse: def __init__(self, client: AsyncGitpod) -> None: self.accounts = accounts.AsyncAccountsResourceWithRawResponse(client.accounts) + self.agents = agents.AsyncAgentsResourceWithRawResponse(client.agents) self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) + self.errors = errors.AsyncErrorsResourceWithRawResponse(client.errors) self.events = events.AsyncEventsResourceWithRawResponse(client.events) self.gateways = gateways.AsyncGatewaysResourceWithRawResponse(client.gateways) self.groups = groups.AsyncGroupsResourceWithRawResponse(client.groups) self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity) self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations) + self.prebuilds = prebuilds.AsyncPrebuildsResourceWithRawResponse(client.prebuilds) self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) self.runners = runners.AsyncRunnersResourceWithRawResponse(client.runners) self.secrets = secrets.AsyncSecretsResourceWithRawResponse(client.secrets) @@ -459,13 +478,16 @@ def __init__(self, client: AsyncGitpod) -> None: class GitpodWithStreamedResponse: def __init__(self, client: Gitpod) -> None: self.accounts = accounts.AccountsResourceWithStreamingResponse(client.accounts) + self.agents = agents.AgentsResourceWithStreamingResponse(client.agents) self.editors = editors.EditorsResourceWithStreamingResponse(client.editors) self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) + self.errors = errors.ErrorsResourceWithStreamingResponse(client.errors) self.events = events.EventsResourceWithStreamingResponse(client.events) self.gateways = gateways.GatewaysResourceWithStreamingResponse(client.gateways) self.groups = groups.GroupsResourceWithStreamingResponse(client.groups) self.identity = identity.IdentityResourceWithStreamingResponse(client.identity) self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations) + self.prebuilds = prebuilds.PrebuildsResourceWithStreamingResponse(client.prebuilds) self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) self.runners = runners.RunnersResourceWithStreamingResponse(client.runners) self.secrets = secrets.SecretsResourceWithStreamingResponse(client.secrets) @@ -476,13 +498,16 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithStreamedResponse: def __init__(self, client: AsyncGitpod) -> None: self.accounts = accounts.AsyncAccountsResourceWithStreamingResponse(client.accounts) + self.agents = agents.AsyncAgentsResourceWithStreamingResponse(client.agents) self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) + self.errors = errors.AsyncErrorsResourceWithStreamingResponse(client.errors) self.events = events.AsyncEventsResourceWithStreamingResponse(client.events) self.gateways = gateways.AsyncGatewaysResourceWithStreamingResponse(client.gateways) self.groups = groups.AsyncGroupsResourceWithStreamingResponse(client.groups) self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity) self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) + self.prebuilds = prebuilds.AsyncPrebuildsResourceWithStreamingResponse(client.prebuilds) self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) self.runners = runners.AsyncRunnersResourceWithStreamingResponse(client.runners) self.secrets = secrets.AsyncSecretsResourceWithStreamingResponse(client.secrets) diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 647ccd9c..c8d007ff 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -9,6 +9,12 @@ from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ + "AgentExecutionsPagePagination", + "SyncAgentExecutionsPage", + "AsyncAgentExecutionsPage", + "AssignmentsPagePagination", + "SyncAssignmentsPage", + "AsyncAssignmentsPage", "DomainVerificationsPagePagination", "SyncDomainVerificationsPage", "AsyncDomainVerificationsPage", @@ -33,9 +39,15 @@ "IntegrationsPagePagination", "SyncIntegrationsPage", "AsyncIntegrationsPage", + "JoinableOrganizationsPagePagination", + "SyncJoinableOrganizationsPage", + "AsyncJoinableOrganizationsPage", "LoginProvidersPagePagination", "SyncLoginProvidersPage", "AsyncLoginProvidersPage", + "LoginsPagePagination", + "SyncLoginsPage", + "AsyncLoginsPage", "MembersPagePagination", "SyncMembersPage", "AsyncMembersPage", @@ -45,12 +57,24 @@ "PoliciesPagePagination", "SyncPoliciesPage", "AsyncPoliciesPage", + "PrebuildsPagePagination", + "SyncPrebuildsPage", + "AsyncPrebuildsPage", + "ProjectEnvironmentClassesPagePagination", + "SyncProjectEnvironmentClassesPage", + "AsyncProjectEnvironmentClassesPage", "ProjectsPagePagination", "SyncProjectsPage", "AsyncProjectsPage", + "PromptsPagePagination", + "SyncPromptsPage", + "AsyncPromptsPage", "RecordsPagePagination", "SyncRecordsPage", "AsyncRecordsPage", + "RepositoriesPagePagination", + "SyncRepositoriesPage", + "AsyncRepositoriesPage", "RunnersPagePagination", "SyncRunnersPage", "AsyncRunnersPage", @@ -77,6 +101,106 @@ _T = TypeVar("_T") +class AgentExecutionsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncAgentExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + agent_executions: List[_T] = FieldInfo(alias="agentExecutions") + pagination: Optional[AgentExecutionsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + agent_executions = self.agent_executions + if not agent_executions: + return [] + return agent_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncAgentExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + agent_executions: List[_T] = FieldInfo(alias="agentExecutions") + pagination: Optional[AgentExecutionsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + agent_executions = self.agent_executions + if not agent_executions: + return [] + return agent_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AssignmentsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncAssignmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + assignments: List[_T] + pagination: Optional[AssignmentsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + assignments = self.assignments + if not assignments: + return [] + return assignments + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncAssignmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + assignments: List[_T] + pagination: Optional[AssignmentsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + assignments = self.assignments + if not assignments: + return [] + return assignments + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class DomainVerificationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -477,6 +601,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class JoinableOrganizationsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncJoinableOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + joinable_organizations: List[_T] = FieldInfo(alias="joinableOrganizations") + pagination: Optional[JoinableOrganizationsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + joinable_organizations = self.joinable_organizations + if not joinable_organizations: + return [] + return joinable_organizations + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncJoinableOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + joinable_organizations: List[_T] = FieldInfo(alias="joinableOrganizations") + pagination: Optional[JoinableOrganizationsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + joinable_organizations = self.joinable_organizations + if not joinable_organizations: + return [] + return joinable_organizations + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class LoginProvidersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -527,6 +701,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class LoginsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncLoginsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + logins: List[_T] + pagination: Optional[LoginsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + logins = self.logins + if not logins: + return [] + return logins + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncLoginsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + logins: List[_T] + pagination: Optional[LoginsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + logins = self.logins + if not logins: + return [] + return logins + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class MembersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -677,6 +901,106 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class PrebuildsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncPrebuildsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PrebuildsPagePagination] = None + prebuilds: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + prebuilds = self.prebuilds + if not prebuilds: + return [] + return prebuilds + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncPrebuildsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PrebuildsPagePagination] = None + prebuilds: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + prebuilds = self.prebuilds + if not prebuilds: + return [] + return prebuilds + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class ProjectEnvironmentClassesPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncProjectEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ProjectEnvironmentClassesPagePagination] = None + project_environment_classes: List[_T] = FieldInfo(alias="projectEnvironmentClasses") + + @override + def _get_page_items(self) -> List[_T]: + project_environment_classes = self.project_environment_classes + if not project_environment_classes: + return [] + return project_environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncProjectEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ProjectEnvironmentClassesPagePagination] = None + project_environment_classes: List[_T] = FieldInfo(alias="projectEnvironmentClasses") + + @override + def _get_page_items(self) -> List[_T]: + project_environment_classes = self.project_environment_classes + if not project_environment_classes: + return [] + return project_environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class ProjectsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -727,6 +1051,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class PromptsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncPromptsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PromptsPagePagination] = None + prompts: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + prompts = self.prompts + if not prompts: + return [] + return prompts + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncPromptsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PromptsPagePagination] = None + prompts: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + prompts = self.prompts + if not prompts: + return [] + return prompts + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class RecordsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -777,6 +1151,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class RepositoriesPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncRepositoriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[RepositoriesPagePagination] = None + repositories: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + repositories = self.repositories + if not repositories: + return [] + return repositories + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncRepositoriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[RepositoriesPagePagination] = None + repositories: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + repositories = self.repositories + if not repositories: + return [] + return repositories + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class RunnersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index fe636120..d5baa12a 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -16,6 +16,22 @@ UsersResourceWithStreamingResponse, AsyncUsersResourceWithStreamingResponse, ) +from .agents import ( + AgentsResource, + AsyncAgentsResource, + AgentsResourceWithRawResponse, + AsyncAgentsResourceWithRawResponse, + AgentsResourceWithStreamingResponse, + AsyncAgentsResourceWithStreamingResponse, +) +from .errors import ( + ErrorsResource, + AsyncErrorsResource, + ErrorsResourceWithRawResponse, + AsyncErrorsResourceWithRawResponse, + ErrorsResourceWithStreamingResponse, + AsyncErrorsResourceWithStreamingResponse, +) from .events import ( EventsResource, AsyncEventsResource, @@ -88,6 +104,14 @@ ProjectsResourceWithStreamingResponse, AsyncProjectsResourceWithStreamingResponse, ) +from .prebuilds import ( + PrebuildsResource, + AsyncPrebuildsResource, + PrebuildsResourceWithRawResponse, + AsyncPrebuildsResourceWithRawResponse, + PrebuildsResourceWithStreamingResponse, + AsyncPrebuildsResourceWithStreamingResponse, +) from .environments import ( EnvironmentsResource, AsyncEnvironmentsResource, @@ -112,6 +136,12 @@ "AsyncAccountsResourceWithRawResponse", "AccountsResourceWithStreamingResponse", "AsyncAccountsResourceWithStreamingResponse", + "AgentsResource", + "AsyncAgentsResource", + "AgentsResourceWithRawResponse", + "AsyncAgentsResourceWithRawResponse", + "AgentsResourceWithStreamingResponse", + "AsyncAgentsResourceWithStreamingResponse", "EditorsResource", "AsyncEditorsResource", "EditorsResourceWithRawResponse", @@ -124,6 +154,12 @@ "AsyncEnvironmentsResourceWithRawResponse", "EnvironmentsResourceWithStreamingResponse", "AsyncEnvironmentsResourceWithStreamingResponse", + "ErrorsResource", + "AsyncErrorsResource", + "ErrorsResourceWithRawResponse", + "AsyncErrorsResourceWithRawResponse", + "ErrorsResourceWithStreamingResponse", + "AsyncErrorsResourceWithStreamingResponse", "EventsResource", "AsyncEventsResource", "EventsResourceWithRawResponse", @@ -154,6 +190,12 @@ "AsyncOrganizationsResourceWithRawResponse", "OrganizationsResourceWithStreamingResponse", "AsyncOrganizationsResourceWithStreamingResponse", + "PrebuildsResource", + "AsyncPrebuildsResource", + "PrebuildsResourceWithRawResponse", + "AsyncPrebuildsResourceWithRawResponse", + "PrebuildsResourceWithStreamingResponse", + "AsyncPrebuildsResourceWithStreamingResponse", "ProjectsResource", "AsyncProjectsResource", "ProjectsResourceWithRawResponse", diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 664b3f80..69b48155 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -9,6 +9,7 @@ from ..types import ( account_delete_params, account_retrieve_params, + account_list_sso_logins_params, account_get_sso_login_url_params, account_list_login_providers_params, account_list_joinable_organizations_params, @@ -23,12 +24,20 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..pagination import SyncLoginProvidersPage, AsyncLoginProvidersPage +from ..pagination import ( + SyncLoginsPage, + AsyncLoginsPage, + SyncLoginProvidersPage, + AsyncLoginProvidersPage, + SyncJoinableOrganizationsPage, + AsyncJoinableOrganizationsPage, +) from .._base_client import AsyncPaginator, make_request_options from ..types.login_provider import LoginProvider +from ..types.joinable_organization import JoinableOrganization from ..types.account_retrieve_response import AccountRetrieveResponse +from ..types.account_list_sso_logins_response import AccountListSSOLoginsResponse from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse -from ..types.account_list_joinable_organizations_response import AccountListJoinableOrganizationsResponse __all__ = ["AccountsResource", "AsyncAccountsResource"] @@ -106,6 +115,7 @@ def delete( self, *, account_id: str, + reason: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -135,6 +145,8 @@ def delete( ``` Args: + reason: reason is an optional field for the reason for account deletion + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -145,7 +157,13 @@ def delete( """ return self._post( "/gitpod.v1.AccountService/DeleteAccount", - body=maybe_transform({"account_id": account_id}, account_delete_params.AccountDeleteParams), + body=maybe_transform( + { + "account_id": account_id, + "reason": reason, + }, + account_delete_params.AccountDeleteParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -225,14 +243,14 @@ def list_joinable_organizations( *, token: str | Omit = omit, page_size: int | Omit = omit, - empty: bool | Omit = omit, + pagination: account_list_joinable_organizations_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AccountListJoinableOrganizationsResponse: + ) -> SyncJoinableOrganizationsPage[JoinableOrganization]: """ Lists organizations that the currently authenticated account can join. @@ -253,6 +271,8 @@ def list_joinable_organizations( ``` Args: + pagination: pagination contains the pagination options for listing joinable organizations + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -261,10 +281,12 @@ def list_joinable_organizations( timeout: Override the client-level default timeout for this request, in seconds """ - return self._post( + return self._get_api_list( "/gitpod.v1.AccountService/ListJoinableOrganizations", + page=SyncJoinableOrganizationsPage[JoinableOrganization], body=maybe_transform( - {"empty": empty}, account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams + {"pagination": pagination}, + account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, ), options=make_request_options( extra_headers=extra_headers, @@ -279,7 +301,8 @@ def list_joinable_organizations( account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, ), ), - cast_to=AccountListJoinableOrganizationsResponse, + model=JoinableOrganization, + method="post", ) def list_login_providers( @@ -367,6 +390,67 @@ def list_login_providers( method="post", ) + def list_sso_logins( + self, + *, + email: str, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: account_list_sso_logins_params.Pagination | Omit = omit, + return_to: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncLoginsPage[AccountListSSOLoginsResponse]: + """ + ListSSOLogins + + Args: + email: email is the email the user wants to login with + + pagination: pagination contains the pagination options for listing SSO logins + + return_to: return_to is the URL the user will be redirected to after login + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AccountService/ListSSOLogins", + page=SyncLoginsPage[AccountListSSOLoginsResponse], + body=maybe_transform( + { + "email": email, + "pagination": pagination, + "return_to": return_to, + }, + account_list_sso_logins_params.AccountListSSOLoginsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + account_list_sso_logins_params.AccountListSSOLoginsParams, + ), + ), + model=AccountListSSOLoginsResponse, + method="post", + ) + class AsyncAccountsResource(AsyncAPIResource): @cached_property @@ -441,6 +525,7 @@ async def delete( self, *, account_id: str, + reason: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -470,6 +555,8 @@ async def delete( ``` Args: + reason: reason is an optional field for the reason for account deletion + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -480,7 +567,13 @@ async def delete( """ return await self._post( "/gitpod.v1.AccountService/DeleteAccount", - body=await async_maybe_transform({"account_id": account_id}, account_delete_params.AccountDeleteParams), + body=await async_maybe_transform( + { + "account_id": account_id, + "reason": reason, + }, + account_delete_params.AccountDeleteParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -555,19 +648,19 @@ async def get_sso_login_url( cast_to=AccountGetSSOLoginURLResponse, ) - async def list_joinable_organizations( + def list_joinable_organizations( self, *, token: str | Omit = omit, page_size: int | Omit = omit, - empty: bool | Omit = omit, + pagination: account_list_joinable_organizations_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AccountListJoinableOrganizationsResponse: + ) -> AsyncPaginator[JoinableOrganization, AsyncJoinableOrganizationsPage[JoinableOrganization]]: """ Lists organizations that the currently authenticated account can join. @@ -588,6 +681,8 @@ async def list_joinable_organizations( ``` Args: + pagination: pagination contains the pagination options for listing joinable organizations + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -596,17 +691,19 @@ async def list_joinable_organizations( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._post( + return self._get_api_list( "/gitpod.v1.AccountService/ListJoinableOrganizations", - body=await async_maybe_transform( - {"empty": empty}, account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams + page=AsyncJoinableOrganizationsPage[JoinableOrganization], + body=maybe_transform( + {"pagination": pagination}, + account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "token": token, "page_size": page_size, @@ -614,7 +711,8 @@ async def list_joinable_organizations( account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, ), ), - cast_to=AccountListJoinableOrganizationsResponse, + model=JoinableOrganization, + method="post", ) def list_login_providers( @@ -702,6 +800,67 @@ def list_login_providers( method="post", ) + def list_sso_logins( + self, + *, + email: str, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: account_list_sso_logins_params.Pagination | Omit = omit, + return_to: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[AccountListSSOLoginsResponse, AsyncLoginsPage[AccountListSSOLoginsResponse]]: + """ + ListSSOLogins + + Args: + email: email is the email the user wants to login with + + pagination: pagination contains the pagination options for listing SSO logins + + return_to: return_to is the URL the user will be redirected to after login + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AccountService/ListSSOLogins", + page=AsyncLoginsPage[AccountListSSOLoginsResponse], + body=maybe_transform( + { + "email": email, + "pagination": pagination, + "return_to": return_to, + }, + account_list_sso_logins_params.AccountListSSOLoginsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + account_list_sso_logins_params.AccountListSSOLoginsParams, + ), + ), + model=AccountListSSOLoginsResponse, + method="post", + ) + class AccountsResourceWithRawResponse: def __init__(self, accounts: AccountsResource) -> None: @@ -722,6 +881,9 @@ def __init__(self, accounts: AccountsResource) -> None: self.list_login_providers = to_raw_response_wrapper( accounts.list_login_providers, ) + self.list_sso_logins = to_raw_response_wrapper( + accounts.list_sso_logins, + ) class AsyncAccountsResourceWithRawResponse: @@ -743,6 +905,9 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.list_login_providers = async_to_raw_response_wrapper( accounts.list_login_providers, ) + self.list_sso_logins = async_to_raw_response_wrapper( + accounts.list_sso_logins, + ) class AccountsResourceWithStreamingResponse: @@ -764,6 +929,9 @@ def __init__(self, accounts: AccountsResource) -> None: self.list_login_providers = to_streamed_response_wrapper( accounts.list_login_providers, ) + self.list_sso_logins = to_streamed_response_wrapper( + accounts.list_sso_logins, + ) class AsyncAccountsResourceWithStreamingResponse: @@ -785,3 +953,6 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.list_login_providers = async_to_streamed_response_wrapper( accounts.list_login_providers, ) + self.list_sso_logins = async_to_streamed_response_wrapper( + accounts.list_sso_logins, + ) diff --git a/src/gitpod/resources/agents.py b/src/gitpod/resources/agents.py new file mode 100644 index 00000000..3fdedd49 --- /dev/null +++ b/src/gitpod/resources/agents.py @@ -0,0 +1,1516 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..types import ( + AgentMode, + agent_list_prompts_params, + agent_create_prompt_params, + agent_delete_prompt_params, + agent_update_prompt_params, + agent_stop_execution_params, + agent_list_executions_params, + agent_retrieve_prompt_params, + agent_start_execution_params, + agent_delete_execution_params, + agent_send_to_execution_params, + agent_retrieve_execution_params, + agent_create_execution_conversation_token_params, +) +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncPromptsPage, AsyncPromptsPage, SyncAgentExecutionsPage, AsyncAgentExecutionsPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.prompt import Prompt +from ..types.agent_mode import AgentMode +from ..types.agent_execution import AgentExecution +from ..types.user_input_block_param import UserInputBlockParam +from ..types.agent_code_context_param import AgentCodeContextParam +from ..types.agent_create_prompt_response import AgentCreatePromptResponse +from ..types.agent_update_prompt_response import AgentUpdatePromptResponse +from ..types.agent_retrieve_prompt_response import AgentRetrievePromptResponse +from ..types.agent_start_execution_response import AgentStartExecutionResponse +from ..types.agent_retrieve_execution_response import AgentRetrieveExecutionResponse +from ..types.agent_create_execution_conversation_token_response import AgentCreateExecutionConversationTokenResponse + +__all__ = ["AgentsResource", "AsyncAgentsResource"] + + +class AgentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AgentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AgentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AgentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AgentsResourceWithStreamingResponse(self) + + def create_execution_conversation_token( + self, + *, + agent_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentCreateExecutionConversationTokenResponse: + """ + Creates a token for conversation access with a specific agent run. + + This method generates a temporary token that can be used to securely connect to + an ongoing agent conversation, for example in a web UI. + + ### Examples + + - Create a token to join an agent run conversation in a front-end application: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/CreateAgentExecutionConversationToken", + body=maybe_transform( + {"agent_execution_id": agent_execution_id}, + agent_create_execution_conversation_token_params.AgentCreateExecutionConversationTokenParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentCreateExecutionConversationTokenResponse, + ) + + def create_prompt( + self, + *, + command: str | Omit = omit, + description: str | Omit = omit, + is_command: bool | Omit = omit, + is_template: bool | Omit = omit, + name: str | Omit = omit, + prompt: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentCreatePromptResponse: + """ + Creates a new prompt. + + Use this method to: + + - Define new prompts for templates or commands + - Set up organization-wide prompt libraries + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/CreatePrompt", + body=maybe_transform( + { + "command": command, + "description": description, + "is_command": is_command, + "is_template": is_template, + "name": name, + "prompt": prompt, + }, + agent_create_prompt_params.AgentCreatePromptParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentCreatePromptResponse, + ) + + def delete_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes an agent run. + + Use this method to: + + - Clean up agent runs that are no longer needed + + ### Examples + + - Delete an agent run by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/DeleteAgentExecution", + body=maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_delete_execution_params.AgentDeleteExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def delete_prompt( + self, + *, + prompt_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a prompt. + + Use this method to: + + - Remove unused prompts + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/DeletePrompt", + body=maybe_transform({"prompt_id": prompt_id}, agent_delete_prompt_params.AgentDeletePromptParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_executions( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: agent_list_executions_params.Filter | Omit = omit, + pagination: agent_list_executions_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncAgentExecutionsPage[AgentExecution]: + """ + Lists all agent runs matching the specified filter. + + Use this method to track multiple agent runs and their associated resources. + Results are ordered by their creation time with the newest first. + + ### Examples + + - List agent runs by agent ID: + + ```yaml + filter: + agentIds: ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"] + pagination: + pageSize: 10 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AgentService/ListAgentExecutions", + page=SyncAgentExecutionsPage[AgentExecution], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + agent_list_executions_params.AgentListExecutionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + agent_list_executions_params.AgentListExecutionsParams, + ), + ), + model=AgentExecution, + method="post", + ) + + def list_prompts( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: agent_list_prompts_params.Filter | Omit = omit, + pagination: agent_list_prompts_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPromptsPage[Prompt]: + """ + Lists all prompts matching the specified criteria. + + Use this method to find and browse prompts across your organization. Results are + ordered by their creation time with the newest first. + + ### Examples + + - List all prompts: + + Retrieves all prompts with pagination. + + ```yaml + pagination: + pageSize: 10 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AgentService/ListPrompts", + page=SyncPromptsPage[Prompt], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + agent_list_prompts_params.AgentListPromptsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + agent_list_prompts_params.AgentListPromptsParams, + ), + ), + model=Prompt, + method="post", + ) + + def retrieve_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRetrieveExecutionResponse: + """ + Gets details about a specific agent run, including its metadata, specification, + and status (phase, error messages, and usage statistics). + + Use this method to: + + - Monitor the run's progress + - Retrieve the agent's conversation URL + - Check if an agent run is actively producing output + + ### Examples + + - Get agent run details by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/GetAgentExecution", + body=maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_retrieve_execution_params.AgentRetrieveExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRetrieveExecutionResponse, + ) + + def retrieve_prompt( + self, + *, + prompt_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRetrievePromptResponse: + """ + Gets details about a specific prompt including name, description, and prompt + content. + + Use this method to: + + - Retrieve prompt details for editing + - Get prompt content for execution + + ### Examples + + - Get prompt details: + + ```yaml + promptId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/GetPrompt", + body=maybe_transform({"prompt_id": prompt_id}, agent_retrieve_prompt_params.AgentRetrievePromptParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRetrievePromptResponse, + ) + + def send_to_execution( + self, + *, + agent_execution_id: str | Omit = omit, + user_input: UserInputBlockParam | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Sends user input to an active agent run. + + This method is used to provide interactive or conversation-based input to an + agent. The agent can respond with output blocks containing text, file changes, + or tool usage requests. + + ### Examples + + - Send a text message to an agent: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + userInput: + text: + content: "Generate a report based on the latest logs." + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/SendToAgentExecution", + body=maybe_transform( + { + "agent_execution_id": agent_execution_id, + "user_input": user_input, + }, + agent_send_to_execution_params.AgentSendToExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def start_execution( + self, + *, + agent_id: str | Omit = omit, + code_context: AgentCodeContextParam | Omit = omit, + mode: AgentMode | Omit = omit, + name: str | Omit = omit, + workflow_action_id: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentStartExecutionResponse: + """ + Starts (or triggers) an agent run using a provided agent. + + Use this method to: + + - Launch an agent based on a known agent + + ### Examples + + - Start an agent with a project ID: + + ```yaml + agentId: "b8a64cfa-43e2-4b9d-9fb3-07edc63f5971" + codeContext: + projectId: "2d22e4eb-31da-467f-882c-27e21550992f" + ``` + + Args: + mode: mode specifies the operational mode for this agent execution If not specified, + defaults to AGENT_MODE_EXECUTION + + workflow_action_id: workflow_action_id is an optional reference to the workflow execution action + that created this agent execution. Used for tracking and event correlation. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/StartAgent", + body=maybe_transform( + { + "agent_id": agent_id, + "code_context": code_context, + "mode": mode, + "name": name, + "workflow_action_id": workflow_action_id, + }, + agent_start_execution_params.AgentStartExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentStartExecutionResponse, + ) + + def stop_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Stops an active agent execution. + + Use this method to: + + - Stop an agent that is currently running + - Prevent further processing or resource usage + + ### Examples + + - Stop an agent execution by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/StopAgentExecution", + body=maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_stop_execution_params.AgentStopExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def update_prompt( + self, + *, + metadata: Optional[agent_update_prompt_params.Metadata] | Omit = omit, + prompt_id: str | Omit = omit, + spec: Optional[agent_update_prompt_params.Spec] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentUpdatePromptResponse: + """ + Updates an existing prompt. + + Use this method to: + + - Modify prompt content or metadata + - Change prompt type (template/command) + + Args: + metadata: Metadata updates + + prompt_id: The ID of the prompt to update + + spec: Spec updates + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/UpdatePrompt", + body=maybe_transform( + { + "metadata": metadata, + "prompt_id": prompt_id, + "spec": spec, + }, + agent_update_prompt_params.AgentUpdatePromptParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentUpdatePromptResponse, + ) + + +class AsyncAgentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAgentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncAgentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAgentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncAgentsResourceWithStreamingResponse(self) + + async def create_execution_conversation_token( + self, + *, + agent_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentCreateExecutionConversationTokenResponse: + """ + Creates a token for conversation access with a specific agent run. + + This method generates a temporary token that can be used to securely connect to + an ongoing agent conversation, for example in a web UI. + + ### Examples + + - Create a token to join an agent run conversation in a front-end application: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/CreateAgentExecutionConversationToken", + body=await async_maybe_transform( + {"agent_execution_id": agent_execution_id}, + agent_create_execution_conversation_token_params.AgentCreateExecutionConversationTokenParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentCreateExecutionConversationTokenResponse, + ) + + async def create_prompt( + self, + *, + command: str | Omit = omit, + description: str | Omit = omit, + is_command: bool | Omit = omit, + is_template: bool | Omit = omit, + name: str | Omit = omit, + prompt: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentCreatePromptResponse: + """ + Creates a new prompt. + + Use this method to: + + - Define new prompts for templates or commands + - Set up organization-wide prompt libraries + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/CreatePrompt", + body=await async_maybe_transform( + { + "command": command, + "description": description, + "is_command": is_command, + "is_template": is_template, + "name": name, + "prompt": prompt, + }, + agent_create_prompt_params.AgentCreatePromptParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentCreatePromptResponse, + ) + + async def delete_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes an agent run. + + Use this method to: + + - Clean up agent runs that are no longer needed + + ### Examples + + - Delete an agent run by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/DeleteAgentExecution", + body=await async_maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_delete_execution_params.AgentDeleteExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def delete_prompt( + self, + *, + prompt_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a prompt. + + Use this method to: + + - Remove unused prompts + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/DeletePrompt", + body=await async_maybe_transform( + {"prompt_id": prompt_id}, agent_delete_prompt_params.AgentDeletePromptParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_executions( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: agent_list_executions_params.Filter | Omit = omit, + pagination: agent_list_executions_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[AgentExecution, AsyncAgentExecutionsPage[AgentExecution]]: + """ + Lists all agent runs matching the specified filter. + + Use this method to track multiple agent runs and their associated resources. + Results are ordered by their creation time with the newest first. + + ### Examples + + - List agent runs by agent ID: + + ```yaml + filter: + agentIds: ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"] + pagination: + pageSize: 10 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AgentService/ListAgentExecutions", + page=AsyncAgentExecutionsPage[AgentExecution], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + agent_list_executions_params.AgentListExecutionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + agent_list_executions_params.AgentListExecutionsParams, + ), + ), + model=AgentExecution, + method="post", + ) + + def list_prompts( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: agent_list_prompts_params.Filter | Omit = omit, + pagination: agent_list_prompts_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Prompt, AsyncPromptsPage[Prompt]]: + """ + Lists all prompts matching the specified criteria. + + Use this method to find and browse prompts across your organization. Results are + ordered by their creation time with the newest first. + + ### Examples + + - List all prompts: + + Retrieves all prompts with pagination. + + ```yaml + pagination: + pageSize: 10 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AgentService/ListPrompts", + page=AsyncPromptsPage[Prompt], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + agent_list_prompts_params.AgentListPromptsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + agent_list_prompts_params.AgentListPromptsParams, + ), + ), + model=Prompt, + method="post", + ) + + async def retrieve_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRetrieveExecutionResponse: + """ + Gets details about a specific agent run, including its metadata, specification, + and status (phase, error messages, and usage statistics). + + Use this method to: + + - Monitor the run's progress + - Retrieve the agent's conversation URL + - Check if an agent run is actively producing output + + ### Examples + + - Get agent run details by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/GetAgentExecution", + body=await async_maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_retrieve_execution_params.AgentRetrieveExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRetrieveExecutionResponse, + ) + + async def retrieve_prompt( + self, + *, + prompt_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRetrievePromptResponse: + """ + Gets details about a specific prompt including name, description, and prompt + content. + + Use this method to: + + - Retrieve prompt details for editing + - Get prompt content for execution + + ### Examples + + - Get prompt details: + + ```yaml + promptId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/GetPrompt", + body=await async_maybe_transform( + {"prompt_id": prompt_id}, agent_retrieve_prompt_params.AgentRetrievePromptParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRetrievePromptResponse, + ) + + async def send_to_execution( + self, + *, + agent_execution_id: str | Omit = omit, + user_input: UserInputBlockParam | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Sends user input to an active agent run. + + This method is used to provide interactive or conversation-based input to an + agent. The agent can respond with output blocks containing text, file changes, + or tool usage requests. + + ### Examples + + - Send a text message to an agent: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + userInput: + text: + content: "Generate a report based on the latest logs." + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/SendToAgentExecution", + body=await async_maybe_transform( + { + "agent_execution_id": agent_execution_id, + "user_input": user_input, + }, + agent_send_to_execution_params.AgentSendToExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def start_execution( + self, + *, + agent_id: str | Omit = omit, + code_context: AgentCodeContextParam | Omit = omit, + mode: AgentMode | Omit = omit, + name: str | Omit = omit, + workflow_action_id: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentStartExecutionResponse: + """ + Starts (or triggers) an agent run using a provided agent. + + Use this method to: + + - Launch an agent based on a known agent + + ### Examples + + - Start an agent with a project ID: + + ```yaml + agentId: "b8a64cfa-43e2-4b9d-9fb3-07edc63f5971" + codeContext: + projectId: "2d22e4eb-31da-467f-882c-27e21550992f" + ``` + + Args: + mode: mode specifies the operational mode for this agent execution If not specified, + defaults to AGENT_MODE_EXECUTION + + workflow_action_id: workflow_action_id is an optional reference to the workflow execution action + that created this agent execution. Used for tracking and event correlation. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/StartAgent", + body=await async_maybe_transform( + { + "agent_id": agent_id, + "code_context": code_context, + "mode": mode, + "name": name, + "workflow_action_id": workflow_action_id, + }, + agent_start_execution_params.AgentStartExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentStartExecutionResponse, + ) + + async def stop_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Stops an active agent execution. + + Use this method to: + + - Stop an agent that is currently running + - Prevent further processing or resource usage + + ### Examples + + - Stop an agent execution by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/StopAgentExecution", + body=await async_maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_stop_execution_params.AgentStopExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def update_prompt( + self, + *, + metadata: Optional[agent_update_prompt_params.Metadata] | Omit = omit, + prompt_id: str | Omit = omit, + spec: Optional[agent_update_prompt_params.Spec] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentUpdatePromptResponse: + """ + Updates an existing prompt. + + Use this method to: + + - Modify prompt content or metadata + - Change prompt type (template/command) + + Args: + metadata: Metadata updates + + prompt_id: The ID of the prompt to update + + spec: Spec updates + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/UpdatePrompt", + body=await async_maybe_transform( + { + "metadata": metadata, + "prompt_id": prompt_id, + "spec": spec, + }, + agent_update_prompt_params.AgentUpdatePromptParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentUpdatePromptResponse, + ) + + +class AgentsResourceWithRawResponse: + def __init__(self, agents: AgentsResource) -> None: + self._agents = agents + + self.create_execution_conversation_token = to_raw_response_wrapper( + agents.create_execution_conversation_token, + ) + self.create_prompt = to_raw_response_wrapper( + agents.create_prompt, + ) + self.delete_execution = to_raw_response_wrapper( + agents.delete_execution, + ) + self.delete_prompt = to_raw_response_wrapper( + agents.delete_prompt, + ) + self.list_executions = to_raw_response_wrapper( + agents.list_executions, + ) + self.list_prompts = to_raw_response_wrapper( + agents.list_prompts, + ) + self.retrieve_execution = to_raw_response_wrapper( + agents.retrieve_execution, + ) + self.retrieve_prompt = to_raw_response_wrapper( + agents.retrieve_prompt, + ) + self.send_to_execution = to_raw_response_wrapper( + agents.send_to_execution, + ) + self.start_execution = to_raw_response_wrapper( + agents.start_execution, + ) + self.stop_execution = to_raw_response_wrapper( + agents.stop_execution, + ) + self.update_prompt = to_raw_response_wrapper( + agents.update_prompt, + ) + + +class AsyncAgentsResourceWithRawResponse: + def __init__(self, agents: AsyncAgentsResource) -> None: + self._agents = agents + + self.create_execution_conversation_token = async_to_raw_response_wrapper( + agents.create_execution_conversation_token, + ) + self.create_prompt = async_to_raw_response_wrapper( + agents.create_prompt, + ) + self.delete_execution = async_to_raw_response_wrapper( + agents.delete_execution, + ) + self.delete_prompt = async_to_raw_response_wrapper( + agents.delete_prompt, + ) + self.list_executions = async_to_raw_response_wrapper( + agents.list_executions, + ) + self.list_prompts = async_to_raw_response_wrapper( + agents.list_prompts, + ) + self.retrieve_execution = async_to_raw_response_wrapper( + agents.retrieve_execution, + ) + self.retrieve_prompt = async_to_raw_response_wrapper( + agents.retrieve_prompt, + ) + self.send_to_execution = async_to_raw_response_wrapper( + agents.send_to_execution, + ) + self.start_execution = async_to_raw_response_wrapper( + agents.start_execution, + ) + self.stop_execution = async_to_raw_response_wrapper( + agents.stop_execution, + ) + self.update_prompt = async_to_raw_response_wrapper( + agents.update_prompt, + ) + + +class AgentsResourceWithStreamingResponse: + def __init__(self, agents: AgentsResource) -> None: + self._agents = agents + + self.create_execution_conversation_token = to_streamed_response_wrapper( + agents.create_execution_conversation_token, + ) + self.create_prompt = to_streamed_response_wrapper( + agents.create_prompt, + ) + self.delete_execution = to_streamed_response_wrapper( + agents.delete_execution, + ) + self.delete_prompt = to_streamed_response_wrapper( + agents.delete_prompt, + ) + self.list_executions = to_streamed_response_wrapper( + agents.list_executions, + ) + self.list_prompts = to_streamed_response_wrapper( + agents.list_prompts, + ) + self.retrieve_execution = to_streamed_response_wrapper( + agents.retrieve_execution, + ) + self.retrieve_prompt = to_streamed_response_wrapper( + agents.retrieve_prompt, + ) + self.send_to_execution = to_streamed_response_wrapper( + agents.send_to_execution, + ) + self.start_execution = to_streamed_response_wrapper( + agents.start_execution, + ) + self.stop_execution = to_streamed_response_wrapper( + agents.stop_execution, + ) + self.update_prompt = to_streamed_response_wrapper( + agents.update_prompt, + ) + + +class AsyncAgentsResourceWithStreamingResponse: + def __init__(self, agents: AsyncAgentsResource) -> None: + self._agents = agents + + self.create_execution_conversation_token = async_to_streamed_response_wrapper( + agents.create_execution_conversation_token, + ) + self.create_prompt = async_to_streamed_response_wrapper( + agents.create_prompt, + ) + self.delete_execution = async_to_streamed_response_wrapper( + agents.delete_execution, + ) + self.delete_prompt = async_to_streamed_response_wrapper( + agents.delete_prompt, + ) + self.list_executions = async_to_streamed_response_wrapper( + agents.list_executions, + ) + self.list_prompts = async_to_streamed_response_wrapper( + agents.list_prompts, + ) + self.retrieve_execution = async_to_streamed_response_wrapper( + agents.retrieve_execution, + ) + self.retrieve_prompt = async_to_streamed_response_wrapper( + agents.retrieve_prompt, + ) + self.send_to_execution = async_to_streamed_response_wrapper( + agents.send_to_execution, + ) + self.start_execution = async_to_streamed_response_wrapper( + agents.start_execution, + ) + self.stop_execution = async_to_streamed_response_wrapper( + agents.stop_execution, + ) + self.update_prompt = async_to_streamed_response_wrapper( + agents.update_prompt, + ) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index a66b33f4..70fcbbf0 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -187,6 +187,7 @@ def resolve_url( editor_id: str, environment_id: str, organization_id: str, + version: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -223,6 +224,11 @@ def resolve_url( organization_id: organizationId is the ID of the organization to resolve the URL for + version: version is the editor version to use If not provided, the latest version will be + installed + + Examples for JetBrains: 2025.2 + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -238,6 +244,7 @@ def resolve_url( "editor_id": editor_id, "environment_id": environment_id, "organization_id": organization_id, + "version": version, }, editor_resolve_url_params.EditorResolveURLParams, ), @@ -411,6 +418,7 @@ async def resolve_url( editor_id: str, environment_id: str, organization_id: str, + version: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -447,6 +455,11 @@ async def resolve_url( organization_id: organizationId is the ID of the organization to resolve the URL for + version: version is the editor version to use If not provided, the latest version will be + installed + + Examples for JetBrains: 2025.2 + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -462,6 +475,7 @@ async def resolve_url( "editor_id": editor_id, "environment_id": environment_id, "organization_id": organization_id, + "version": version, }, editor_resolve_url_params.EditorResolveURLParams, ), diff --git a/src/gitpod/resources/errors.py b/src/gitpod/resources/errors.py new file mode 100644 index 00000000..220301f2 --- /dev/null +++ b/src/gitpod/resources/errors.py @@ -0,0 +1,199 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable + +import httpx + +from ..types import error_report_errors_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.error_event_param import ErrorEventParam + +__all__ = ["ErrorsResource", "AsyncErrorsResource"] + + +class ErrorsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ErrorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return ErrorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ErrorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return ErrorsResourceWithStreamingResponse(self) + + def report_errors( + self, + *, + events: Iterable[ErrorEventParam] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + ReportErrors allows clients to report batches of errors that will be sent to + error reporting systems. The structure is fully compatible with Sentry's event + payload format. + + Use this method to: + + - Report client-side errors and exceptions + - Track application crashes and panics + - Send error context and metadata for debugging + + ### Examples + + - Report a JavaScript error with Sentry-compatible structure: The service + accepts events with comprehensive error information including stack traces, + identity context, breadcrumbs, and metadata that align with Sentry's event + payload format. + + Args: + events: Error events to be reported (batch) - now using Sentry-compatible structure + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.ErrorsService/ReportErrors", + body=maybe_transform({"events": events}, error_report_errors_params.ErrorReportErrorsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncErrorsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncErrorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncErrorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncErrorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncErrorsResourceWithStreamingResponse(self) + + async def report_errors( + self, + *, + events: Iterable[ErrorEventParam] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + ReportErrors allows clients to report batches of errors that will be sent to + error reporting systems. The structure is fully compatible with Sentry's event + payload format. + + Use this method to: + + - Report client-side errors and exceptions + - Track application crashes and panics + - Send error context and metadata for debugging + + ### Examples + + - Report a JavaScript error with Sentry-compatible structure: The service + accepts events with comprehensive error information including stack traces, + identity context, breadcrumbs, and metadata that align with Sentry's event + payload format. + + Args: + events: Error events to be reported (batch) - now using Sentry-compatible structure + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.ErrorsService/ReportErrors", + body=await async_maybe_transform({"events": events}, error_report_errors_params.ErrorReportErrorsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class ErrorsResourceWithRawResponse: + def __init__(self, errors: ErrorsResource) -> None: + self._errors = errors + + self.report_errors = to_raw_response_wrapper( + errors.report_errors, + ) + + +class AsyncErrorsResourceWithRawResponse: + def __init__(self, errors: AsyncErrorsResource) -> None: + self._errors = errors + + self.report_errors = async_to_raw_response_wrapper( + errors.report_errors, + ) + + +class ErrorsResourceWithStreamingResponse: + def __init__(self, errors: ErrorsResource) -> None: + self._errors = errors + + self.report_errors = to_streamed_response_wrapper( + errors.report_errors, + ) + + +class AsyncErrorsResourceWithStreamingResponse: + def __init__(self, errors: AsyncErrorsResource) -> None: + self._errors = errors + + self.report_errors = async_to_streamed_response_wrapper( + errors.report_errors, + ) diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py deleted file mode 100644 index 36e2ed43..00000000 --- a/src/gitpod/resources/groups.py +++ /dev/null @@ -1,252 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..types import group_list_params -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..pagination import SyncGroupsPage, AsyncGroupsPage -from ..types.group import Group -from .._base_client import AsyncPaginator, make_request_options - -__all__ = ["GroupsResource", "AsyncGroupsResource"] - - -class GroupsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> GroupsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers - """ - return GroupsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response - """ - return GroupsResourceWithStreamingResponse(self) - - def list( - self, - *, - token: str | Omit = omit, - page_size: int | Omit = omit, - pagination: group_list_params.Pagination | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncGroupsPage[Group]: - """ - Lists groups with optional pagination. - - Use this method to: - - - View all groups - - Check group memberships - - Monitor group configurations - - Audit group access - - ### Examples - - - List all groups: - - Shows all groups with pagination. - - ```yaml - pagination: - pageSize: 20 - ``` - - - List with custom page size: - - Shows groups with specified page size. - - ```yaml - pagination: - pageSize: 50 - token: "next-page-token-from-previous-response" - ``` - - Args: - pagination: pagination contains the pagination options for listing groups - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/gitpod.v1.GroupService/ListGroups", - page=SyncGroupsPage[Group], - body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "token": token, - "page_size": page_size, - }, - group_list_params.GroupListParams, - ), - ), - model=Group, - method="post", - ) - - -class AsyncGroupsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers - """ - return AsyncGroupsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response - """ - return AsyncGroupsResourceWithStreamingResponse(self) - - def list( - self, - *, - token: str | Omit = omit, - page_size: int | Omit = omit, - pagination: group_list_params.Pagination | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[Group, AsyncGroupsPage[Group]]: - """ - Lists groups with optional pagination. - - Use this method to: - - - View all groups - - Check group memberships - - Monitor group configurations - - Audit group access - - ### Examples - - - List all groups: - - Shows all groups with pagination. - - ```yaml - pagination: - pageSize: 20 - ``` - - - List with custom page size: - - Shows groups with specified page size. - - ```yaml - pagination: - pageSize: 50 - token: "next-page-token-from-previous-response" - ``` - - Args: - pagination: pagination contains the pagination options for listing groups - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/gitpod.v1.GroupService/ListGroups", - page=AsyncGroupsPage[Group], - body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "token": token, - "page_size": page_size, - }, - group_list_params.GroupListParams, - ), - ), - model=Group, - method="post", - ) - - -class GroupsResourceWithRawResponse: - def __init__(self, groups: GroupsResource) -> None: - self._groups = groups - - self.list = to_raw_response_wrapper( - groups.list, - ) - - -class AsyncGroupsResourceWithRawResponse: - def __init__(self, groups: AsyncGroupsResource) -> None: - self._groups = groups - - self.list = async_to_raw_response_wrapper( - groups.list, - ) - - -class GroupsResourceWithStreamingResponse: - def __init__(self, groups: GroupsResource) -> None: - self._groups = groups - - self.list = to_streamed_response_wrapper( - groups.list, - ) - - -class AsyncGroupsResourceWithStreamingResponse: - def __init__(self, groups: AsyncGroupsResource) -> None: - self._groups = groups - - self.list = async_to_streamed_response_wrapper( - groups.list, - ) diff --git a/src/gitpod/resources/groups/__init__.py b/src/gitpod/resources/groups/__init__.py new file mode 100644 index 00000000..83c3111d --- /dev/null +++ b/src/gitpod/resources/groups/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .groups import ( + GroupsResource, + AsyncGroupsResource, + GroupsResourceWithRawResponse, + AsyncGroupsResourceWithRawResponse, + GroupsResourceWithStreamingResponse, + AsyncGroupsResourceWithStreamingResponse, +) +from .memberships import ( + MembershipsResource, + AsyncMembershipsResource, + MembershipsResourceWithRawResponse, + AsyncMembershipsResourceWithRawResponse, + MembershipsResourceWithStreamingResponse, + AsyncMembershipsResourceWithStreamingResponse, +) +from .role_assignments import ( + RoleAssignmentsResource, + AsyncRoleAssignmentsResource, + RoleAssignmentsResourceWithRawResponse, + AsyncRoleAssignmentsResourceWithRawResponse, + RoleAssignmentsResourceWithStreamingResponse, + AsyncRoleAssignmentsResourceWithStreamingResponse, +) + +__all__ = [ + "MembershipsResource", + "AsyncMembershipsResource", + "MembershipsResourceWithRawResponse", + "AsyncMembershipsResourceWithRawResponse", + "MembershipsResourceWithStreamingResponse", + "AsyncMembershipsResourceWithStreamingResponse", + "RoleAssignmentsResource", + "AsyncRoleAssignmentsResource", + "RoleAssignmentsResourceWithRawResponse", + "AsyncRoleAssignmentsResourceWithRawResponse", + "RoleAssignmentsResourceWithStreamingResponse", + "AsyncRoleAssignmentsResourceWithStreamingResponse", + "GroupsResource", + "AsyncGroupsResource", + "GroupsResourceWithRawResponse", + "AsyncGroupsResourceWithRawResponse", + "GroupsResourceWithStreamingResponse", + "AsyncGroupsResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/groups/groups.py b/src/gitpod/resources/groups/groups.py new file mode 100644 index 00000000..4a57994e --- /dev/null +++ b/src/gitpod/resources/groups/groups.py @@ -0,0 +1,843 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ...types import ( + group_list_params, + group_create_params, + group_delete_params, + group_update_params, + group_retrieve_params, +) +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .memberships import ( + MembershipsResource, + AsyncMembershipsResource, + MembershipsResourceWithRawResponse, + AsyncMembershipsResourceWithRawResponse, + MembershipsResourceWithStreamingResponse, + AsyncMembershipsResourceWithStreamingResponse, +) +from ...pagination import SyncGroupsPage, AsyncGroupsPage +from ...types.group import Group +from ..._base_client import AsyncPaginator, make_request_options +from .role_assignments import ( + RoleAssignmentsResource, + AsyncRoleAssignmentsResource, + RoleAssignmentsResourceWithRawResponse, + AsyncRoleAssignmentsResourceWithRawResponse, + RoleAssignmentsResourceWithStreamingResponse, + AsyncRoleAssignmentsResourceWithStreamingResponse, +) +from ...types.group_create_response import GroupCreateResponse +from ...types.group_update_response import GroupUpdateResponse +from ...types.group_retrieve_response import GroupRetrieveResponse + +__all__ = ["GroupsResource", "AsyncGroupsResource"] + + +class GroupsResource(SyncAPIResource): + @cached_property + def memberships(self) -> MembershipsResource: + return MembershipsResource(self._client) + + @cached_property + def role_assignments(self) -> RoleAssignmentsResource: + return RoleAssignmentsResource(self._client) + + @cached_property + def with_raw_response(self) -> GroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return GroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return GroupsResourceWithStreamingResponse(self) + + def create( + self, + *, + description: str | Omit = omit, + name: str | Omit = omit, + organization_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupCreateResponse: + """ + Creates a new group within an organization. + + Use this method to: + + - Create teams for access control + - Organize users by department or function + - Set up role-based access groups + + ### Examples + + - Create a basic group: + + Creates a group with name and description. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "Backend Team" + description: "Backend engineering team" + ``` + + ### Authorization + + Requires `org:admin` role on the organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/CreateGroup", + body=maybe_transform( + { + "description": description, + "name": name, + "organization_id": organization_id, + }, + group_create_params.GroupCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupCreateResponse, + ) + + def retrieve( + self, + *, + group_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupRetrieveResponse: + """ + Gets information about a specific group. + + Use this method to: + + - Retrieve group details and metadata + - Check group configuration + - View member count + + ### Examples + + - Get group details: + + Retrieves information about a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + ### Authorization + + All organization members can view group information (transparency model). + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/GetGroup", + body=maybe_transform({"group_id": group_id}, group_retrieve_params.GroupRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupRetrieveResponse, + ) + + def update( + self, + *, + description: str | Omit = omit, + group_id: str | Omit = omit, + name: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupUpdateResponse: + """ + Updates group information. + + Use this method to: + + - Rename a group + - Update group description + + ### Examples + + - Update group name: + + Changes the name of an existing group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + name: "Platform Team" + description: "Platform engineering team" + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/UpdateGroup", + body=maybe_transform( + { + "description": description, + "group_id": group_id, + "name": name, + }, + group_update_params.GroupUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupUpdateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: group_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncGroupsPage[Group]: + """ + Lists groups with optional pagination. + + Use this method to: + + - View all groups in an organization + - Check group memberships + - Monitor group configurations + - Audit group access + + ### Examples + + - List all groups: + + Shows all groups with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List with custom page size: + + Shows groups with specified page size. + + ```yaml + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` + + ### Authorization + + All organization members can list groups (transparency model). + + Args: + pagination: pagination contains the pagination options for listing groups + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListGroups", + page=SyncGroupsPage[Group], + body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + group_list_params.GroupListParams, + ), + ), + model=Group, + method="post", + ) + + def delete( + self, + *, + group_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a group and removes all its resource assignments. + + When a group is deleted, all resource assignments revert to org-level scope. + + Use this method to: + + - Remove unused groups + - Clean up after team reorganization + + ### Examples + + - Delete a group: + + Permanently removes a group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + ### Authorization + + Requires `org:admin` role on the organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/DeleteGroup", + body=maybe_transform({"group_id": group_id}, group_delete_params.GroupDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncGroupsResource(AsyncAPIResource): + @cached_property + def memberships(self) -> AsyncMembershipsResource: + return AsyncMembershipsResource(self._client) + + @cached_property + def role_assignments(self) -> AsyncRoleAssignmentsResource: + return AsyncRoleAssignmentsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncGroupsResourceWithStreamingResponse(self) + + async def create( + self, + *, + description: str | Omit = omit, + name: str | Omit = omit, + organization_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupCreateResponse: + """ + Creates a new group within an organization. + + Use this method to: + + - Create teams for access control + - Organize users by department or function + - Set up role-based access groups + + ### Examples + + - Create a basic group: + + Creates a group with name and description. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "Backend Team" + description: "Backend engineering team" + ``` + + ### Authorization + + Requires `org:admin` role on the organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/CreateGroup", + body=await async_maybe_transform( + { + "description": description, + "name": name, + "organization_id": organization_id, + }, + group_create_params.GroupCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupCreateResponse, + ) + + async def retrieve( + self, + *, + group_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupRetrieveResponse: + """ + Gets information about a specific group. + + Use this method to: + + - Retrieve group details and metadata + - Check group configuration + - View member count + + ### Examples + + - Get group details: + + Retrieves information about a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + ### Authorization + + All organization members can view group information (transparency model). + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/GetGroup", + body=await async_maybe_transform({"group_id": group_id}, group_retrieve_params.GroupRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupRetrieveResponse, + ) + + async def update( + self, + *, + description: str | Omit = omit, + group_id: str | Omit = omit, + name: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupUpdateResponse: + """ + Updates group information. + + Use this method to: + + - Rename a group + - Update group description + + ### Examples + + - Update group name: + + Changes the name of an existing group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + name: "Platform Team" + description: "Platform engineering team" + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/UpdateGroup", + body=await async_maybe_transform( + { + "description": description, + "group_id": group_id, + "name": name, + }, + group_update_params.GroupUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupUpdateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: group_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Group, AsyncGroupsPage[Group]]: + """ + Lists groups with optional pagination. + + Use this method to: + + - View all groups in an organization + - Check group memberships + - Monitor group configurations + - Audit group access + + ### Examples + + - List all groups: + + Shows all groups with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List with custom page size: + + Shows groups with specified page size. + + ```yaml + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` + + ### Authorization + + All organization members can list groups (transparency model). + + Args: + pagination: pagination contains the pagination options for listing groups + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListGroups", + page=AsyncGroupsPage[Group], + body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + group_list_params.GroupListParams, + ), + ), + model=Group, + method="post", + ) + + async def delete( + self, + *, + group_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a group and removes all its resource assignments. + + When a group is deleted, all resource assignments revert to org-level scope. + + Use this method to: + + - Remove unused groups + - Clean up after team reorganization + + ### Examples + + - Delete a group: + + Permanently removes a group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + ### Authorization + + Requires `org:admin` role on the organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/DeleteGroup", + body=await async_maybe_transform({"group_id": group_id}, group_delete_params.GroupDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class GroupsResourceWithRawResponse: + def __init__(self, groups: GroupsResource) -> None: + self._groups = groups + + self.create = to_raw_response_wrapper( + groups.create, + ) + self.retrieve = to_raw_response_wrapper( + groups.retrieve, + ) + self.update = to_raw_response_wrapper( + groups.update, + ) + self.list = to_raw_response_wrapper( + groups.list, + ) + self.delete = to_raw_response_wrapper( + groups.delete, + ) + + @cached_property + def memberships(self) -> MembershipsResourceWithRawResponse: + return MembershipsResourceWithRawResponse(self._groups.memberships) + + @cached_property + def role_assignments(self) -> RoleAssignmentsResourceWithRawResponse: + return RoleAssignmentsResourceWithRawResponse(self._groups.role_assignments) + + +class AsyncGroupsResourceWithRawResponse: + def __init__(self, groups: AsyncGroupsResource) -> None: + self._groups = groups + + self.create = async_to_raw_response_wrapper( + groups.create, + ) + self.retrieve = async_to_raw_response_wrapper( + groups.retrieve, + ) + self.update = async_to_raw_response_wrapper( + groups.update, + ) + self.list = async_to_raw_response_wrapper( + groups.list, + ) + self.delete = async_to_raw_response_wrapper( + groups.delete, + ) + + @cached_property + def memberships(self) -> AsyncMembershipsResourceWithRawResponse: + return AsyncMembershipsResourceWithRawResponse(self._groups.memberships) + + @cached_property + def role_assignments(self) -> AsyncRoleAssignmentsResourceWithRawResponse: + return AsyncRoleAssignmentsResourceWithRawResponse(self._groups.role_assignments) + + +class GroupsResourceWithStreamingResponse: + def __init__(self, groups: GroupsResource) -> None: + self._groups = groups + + self.create = to_streamed_response_wrapper( + groups.create, + ) + self.retrieve = to_streamed_response_wrapper( + groups.retrieve, + ) + self.update = to_streamed_response_wrapper( + groups.update, + ) + self.list = to_streamed_response_wrapper( + groups.list, + ) + self.delete = to_streamed_response_wrapper( + groups.delete, + ) + + @cached_property + def memberships(self) -> MembershipsResourceWithStreamingResponse: + return MembershipsResourceWithStreamingResponse(self._groups.memberships) + + @cached_property + def role_assignments(self) -> RoleAssignmentsResourceWithStreamingResponse: + return RoleAssignmentsResourceWithStreamingResponse(self._groups.role_assignments) + + +class AsyncGroupsResourceWithStreamingResponse: + def __init__(self, groups: AsyncGroupsResource) -> None: + self._groups = groups + + self.create = async_to_streamed_response_wrapper( + groups.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + groups.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + groups.update, + ) + self.list = async_to_streamed_response_wrapper( + groups.list, + ) + self.delete = async_to_streamed_response_wrapper( + groups.delete, + ) + + @cached_property + def memberships(self) -> AsyncMembershipsResourceWithStreamingResponse: + return AsyncMembershipsResourceWithStreamingResponse(self._groups.memberships) + + @cached_property + def role_assignments(self) -> AsyncRoleAssignmentsResourceWithStreamingResponse: + return AsyncRoleAssignmentsResourceWithStreamingResponse(self._groups.role_assignments) diff --git a/src/gitpod/resources/groups/memberships.py b/src/gitpod/resources/groups/memberships.py new file mode 100644 index 00000000..11b07f11 --- /dev/null +++ b/src/gitpod/resources/groups/memberships.py @@ -0,0 +1,516 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncMembersPage, AsyncMembersPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.groups import membership_list_params, membership_create_params, membership_delete_params +from ...types.shared_params.subject import Subject +from ...types.groups.group_membership import GroupMembership +from ...types.groups.membership_create_response import MembershipCreateResponse + +__all__ = ["MembershipsResource", "AsyncMembershipsResource"] + + +class MembershipsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> MembershipsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return MembershipsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> MembershipsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return MembershipsResourceWithStreamingResponse(self) + + def create( + self, + *, + group_id: str | Omit = omit, + subject: Subject | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MembershipCreateResponse: + """ + Creates a membership for a user in a group. + + Use this method to: + + - Add users to groups + - Grant group-based permissions to users + + ### Examples + + - Add a user to a group: + + Creates a membership for a user in a group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + subject: + id: "f53d2330-3795-4c5d-a1f3-453121af9c60" + principal: PRINCIPAL_USER + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + subject: Subject to add to the group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/CreateMembership", + body=maybe_transform( + { + "group_id": group_id, + "subject": subject, + }, + membership_create_params.MembershipCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MembershipCreateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + group_id: str | Omit = omit, + pagination: membership_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncMembersPage[GroupMembership]: + """ + Lists all memberships of a group. + + Use this method to: + + - View all members of a group + - Audit group membership + + ### Examples + + - List group members: + + Shows all members of a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` + + ### Authorization + + All organization members can view group membership (transparency model). + + Args: + pagination: pagination contains the pagination options for listing memberships + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListMemberships", + page=SyncMembersPage[GroupMembership], + body=maybe_transform( + { + "group_id": group_id, + "pagination": pagination, + }, + membership_list_params.MembershipListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + membership_list_params.MembershipListParams, + ), + ), + model=GroupMembership, + method="post", + ) + + def delete( + self, + *, + membership_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a membership for a user in a group. + + Use this method to: + + - Remove users from groups + - Revoke group-based permissions + + ### Examples + + - Remove a user from a group: + + Deletes a membership by its ID. + + ```yaml + membershipId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + membership_id: The membership to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/DeleteMembership", + body=maybe_transform({"membership_id": membership_id}, membership_delete_params.MembershipDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncMembershipsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncMembershipsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncMembershipsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncMembershipsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncMembershipsResourceWithStreamingResponse(self) + + async def create( + self, + *, + group_id: str | Omit = omit, + subject: Subject | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MembershipCreateResponse: + """ + Creates a membership for a user in a group. + + Use this method to: + + - Add users to groups + - Grant group-based permissions to users + + ### Examples + + - Add a user to a group: + + Creates a membership for a user in a group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + subject: + id: "f53d2330-3795-4c5d-a1f3-453121af9c60" + principal: PRINCIPAL_USER + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + subject: Subject to add to the group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/CreateMembership", + body=await async_maybe_transform( + { + "group_id": group_id, + "subject": subject, + }, + membership_create_params.MembershipCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MembershipCreateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + group_id: str | Omit = omit, + pagination: membership_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[GroupMembership, AsyncMembersPage[GroupMembership]]: + """ + Lists all memberships of a group. + + Use this method to: + + - View all members of a group + - Audit group membership + + ### Examples + + - List group members: + + Shows all members of a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` + + ### Authorization + + All organization members can view group membership (transparency model). + + Args: + pagination: pagination contains the pagination options for listing memberships + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListMemberships", + page=AsyncMembersPage[GroupMembership], + body=maybe_transform( + { + "group_id": group_id, + "pagination": pagination, + }, + membership_list_params.MembershipListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + membership_list_params.MembershipListParams, + ), + ), + model=GroupMembership, + method="post", + ) + + async def delete( + self, + *, + membership_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a membership for a user in a group. + + Use this method to: + + - Remove users from groups + - Revoke group-based permissions + + ### Examples + + - Remove a user from a group: + + Deletes a membership by its ID. + + ```yaml + membershipId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + membership_id: The membership to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/DeleteMembership", + body=await async_maybe_transform( + {"membership_id": membership_id}, membership_delete_params.MembershipDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class MembershipsResourceWithRawResponse: + def __init__(self, memberships: MembershipsResource) -> None: + self._memberships = memberships + + self.create = to_raw_response_wrapper( + memberships.create, + ) + self.list = to_raw_response_wrapper( + memberships.list, + ) + self.delete = to_raw_response_wrapper( + memberships.delete, + ) + + +class AsyncMembershipsResourceWithRawResponse: + def __init__(self, memberships: AsyncMembershipsResource) -> None: + self._memberships = memberships + + self.create = async_to_raw_response_wrapper( + memberships.create, + ) + self.list = async_to_raw_response_wrapper( + memberships.list, + ) + self.delete = async_to_raw_response_wrapper( + memberships.delete, + ) + + +class MembershipsResourceWithStreamingResponse: + def __init__(self, memberships: MembershipsResource) -> None: + self._memberships = memberships + + self.create = to_streamed_response_wrapper( + memberships.create, + ) + self.list = to_streamed_response_wrapper( + memberships.list, + ) + self.delete = to_streamed_response_wrapper( + memberships.delete, + ) + + +class AsyncMembershipsResourceWithStreamingResponse: + def __init__(self, memberships: AsyncMembershipsResource) -> None: + self._memberships = memberships + + self.create = async_to_streamed_response_wrapper( + memberships.create, + ) + self.list = async_to_streamed_response_wrapper( + memberships.list, + ) + self.delete = async_to_streamed_response_wrapper( + memberships.delete, + ) diff --git a/src/gitpod/resources/groups/role_assignments.py b/src/gitpod/resources/groups/role_assignments.py new file mode 100644 index 00000000..754dad37 --- /dev/null +++ b/src/gitpod/resources/groups/role_assignments.py @@ -0,0 +1,580 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncAssignmentsPage, AsyncAssignmentsPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.groups import ( + ResourceRole, + role_assignment_list_params, + role_assignment_create_params, + role_assignment_delete_params, +) +from ...types.groups.resource_role import ResourceRole +from ...types.shared.resource_type import ResourceType +from ...types.groups.role_assignment import RoleAssignment +from ...types.groups.role_assignment_create_response import RoleAssignmentCreateResponse + +__all__ = ["RoleAssignmentsResource", "AsyncRoleAssignmentsResource"] + + +class RoleAssignmentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RoleAssignmentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return RoleAssignmentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RoleAssignmentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return RoleAssignmentsResourceWithStreamingResponse(self) + + def create( + self, + *, + group_id: str | Omit = omit, + resource_id: str | Omit = omit, + resource_role: ResourceRole | Omit = omit, + resource_type: ResourceType | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RoleAssignmentCreateResponse: + """ + Creates a role assignment for a group on a resource. + + Use this method to: + + - Assign specific roles to groups on runners, projects, or environments + - Grant group-based access to resources + + ### Examples + + - Assign admin role on a runner: + + Grants the group admin access to a runner. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + resourceRole: RESOURCE_ROLE_RUNNER_ADMIN + ``` + + - Assign user role on a project: + + Grants the group user access to a project. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + resourceType: RESOURCE_TYPE_PROJECT + resourceId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + resourceRole: RESOURCE_ROLE_PROJECT_USER + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + resource_role: ResourceRole represents roles that can be assigned to groups on resources These + map directly to the roles defined in backend/db/rule/rbac/role/role.go + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/CreateRoleAssignment", + body=maybe_transform( + { + "group_id": group_id, + "resource_id": resource_id, + "resource_role": resource_role, + "resource_type": resource_type, + }, + role_assignment_create_params.RoleAssignmentCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RoleAssignmentCreateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: role_assignment_list_params.Filter | Omit = omit, + pagination: role_assignment_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncAssignmentsPage[RoleAssignment]: + """ + Lists role assignments for a group or resource. + + Use this method to: + + - View all role assignments for a group + - Audit resource access + - Check which groups have access to resources + + ### Examples + + - List role assignments for a group: + + Shows all role assignments for a specific group. + + ```yaml + filter: + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` + + - List role assignments by resource type: + + Shows all role assignments for runners. + + ```yaml + filter: + resourceTypes: + - RESOURCE_TYPE_RUNNER + pagination: + pageSize: 20 + ``` + + ### Authorization + + All organization members can view role assignments (transparency model). + + Args: + filter: Filter parameters + + pagination: Pagination parameters + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListRoleAssignments", + page=SyncAssignmentsPage[RoleAssignment], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + role_assignment_list_params.RoleAssignmentListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + role_assignment_list_params.RoleAssignmentListParams, + ), + ), + model=RoleAssignment, + method="post", + ) + + def delete( + self, + *, + assignment_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a role assignment. + + Use this method to: + + - Remove group access to resources + - Revoke role-based permissions + + ### Examples + + - Delete a role assignment: + + Removes a role assignment by its ID. + + ```yaml + assignmentId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/DeleteRoleAssignment", + body=maybe_transform( + {"assignment_id": assignment_id}, role_assignment_delete_params.RoleAssignmentDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncRoleAssignmentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRoleAssignmentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncRoleAssignmentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRoleAssignmentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncRoleAssignmentsResourceWithStreamingResponse(self) + + async def create( + self, + *, + group_id: str | Omit = omit, + resource_id: str | Omit = omit, + resource_role: ResourceRole | Omit = omit, + resource_type: ResourceType | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RoleAssignmentCreateResponse: + """ + Creates a role assignment for a group on a resource. + + Use this method to: + + - Assign specific roles to groups on runners, projects, or environments + - Grant group-based access to resources + + ### Examples + + - Assign admin role on a runner: + + Grants the group admin access to a runner. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + resourceRole: RESOURCE_ROLE_RUNNER_ADMIN + ``` + + - Assign user role on a project: + + Grants the group user access to a project. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + resourceType: RESOURCE_TYPE_PROJECT + resourceId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + resourceRole: RESOURCE_ROLE_PROJECT_USER + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + resource_role: ResourceRole represents roles that can be assigned to groups on resources These + map directly to the roles defined in backend/db/rule/rbac/role/role.go + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/CreateRoleAssignment", + body=await async_maybe_transform( + { + "group_id": group_id, + "resource_id": resource_id, + "resource_role": resource_role, + "resource_type": resource_type, + }, + role_assignment_create_params.RoleAssignmentCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RoleAssignmentCreateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: role_assignment_list_params.Filter | Omit = omit, + pagination: role_assignment_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[RoleAssignment, AsyncAssignmentsPage[RoleAssignment]]: + """ + Lists role assignments for a group or resource. + + Use this method to: + + - View all role assignments for a group + - Audit resource access + - Check which groups have access to resources + + ### Examples + + - List role assignments for a group: + + Shows all role assignments for a specific group. + + ```yaml + filter: + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` + + - List role assignments by resource type: + + Shows all role assignments for runners. + + ```yaml + filter: + resourceTypes: + - RESOURCE_TYPE_RUNNER + pagination: + pageSize: 20 + ``` + + ### Authorization + + All organization members can view role assignments (transparency model). + + Args: + filter: Filter parameters + + pagination: Pagination parameters + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListRoleAssignments", + page=AsyncAssignmentsPage[RoleAssignment], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + role_assignment_list_params.RoleAssignmentListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + role_assignment_list_params.RoleAssignmentListParams, + ), + ), + model=RoleAssignment, + method="post", + ) + + async def delete( + self, + *, + assignment_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a role assignment. + + Use this method to: + + - Remove group access to resources + - Revoke role-based permissions + + ### Examples + + - Delete a role assignment: + + Removes a role assignment by its ID. + + ```yaml + assignmentId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/DeleteRoleAssignment", + body=await async_maybe_transform( + {"assignment_id": assignment_id}, role_assignment_delete_params.RoleAssignmentDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class RoleAssignmentsResourceWithRawResponse: + def __init__(self, role_assignments: RoleAssignmentsResource) -> None: + self._role_assignments = role_assignments + + self.create = to_raw_response_wrapper( + role_assignments.create, + ) + self.list = to_raw_response_wrapper( + role_assignments.list, + ) + self.delete = to_raw_response_wrapper( + role_assignments.delete, + ) + + +class AsyncRoleAssignmentsResourceWithRawResponse: + def __init__(self, role_assignments: AsyncRoleAssignmentsResource) -> None: + self._role_assignments = role_assignments + + self.create = async_to_raw_response_wrapper( + role_assignments.create, + ) + self.list = async_to_raw_response_wrapper( + role_assignments.list, + ) + self.delete = async_to_raw_response_wrapper( + role_assignments.delete, + ) + + +class RoleAssignmentsResourceWithStreamingResponse: + def __init__(self, role_assignments: RoleAssignmentsResource) -> None: + self._role_assignments = role_assignments + + self.create = to_streamed_response_wrapper( + role_assignments.create, + ) + self.list = to_streamed_response_wrapper( + role_assignments.list, + ) + self.delete = to_streamed_response_wrapper( + role_assignments.delete, + ) + + +class AsyncRoleAssignmentsResourceWithStreamingResponse: + def __init__(self, role_assignments: AsyncRoleAssignmentsResource) -> None: + self._role_assignments = role_assignments + + self.create = async_to_streamed_response_wrapper( + role_assignments.create, + ) + self.list = async_to_streamed_response_wrapper( + role_assignments.list, + ) + self.delete = async_to_streamed_response_wrapper( + role_assignments.delete, + ) diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py index 28e5eedf..84d6bdee 100644 --- a/src/gitpod/resources/organizations/__init__.py +++ b/src/gitpod/resources/organizations/__init__.py @@ -24,6 +24,14 @@ OrganizationsResourceWithStreamingResponse, AsyncOrganizationsResourceWithStreamingResponse, ) +from .custom_domains import ( + CustomDomainsResource, + AsyncCustomDomainsResource, + CustomDomainsResourceWithRawResponse, + AsyncCustomDomainsResourceWithRawResponse, + CustomDomainsResourceWithStreamingResponse, + AsyncCustomDomainsResourceWithStreamingResponse, +) from .sso_configurations import ( SSOConfigurationsResource, AsyncSSOConfigurationsResource, @@ -42,6 +50,12 @@ ) __all__ = [ + "CustomDomainsResource", + "AsyncCustomDomainsResource", + "CustomDomainsResourceWithRawResponse", + "AsyncCustomDomainsResourceWithRawResponse", + "CustomDomainsResourceWithStreamingResponse", + "AsyncCustomDomainsResourceWithStreamingResponse", "DomainVerificationsResource", "AsyncDomainVerificationsResource", "DomainVerificationsResourceWithRawResponse", diff --git a/src/gitpod/resources/organizations/custom_domains.py b/src/gitpod/resources/organizations/custom_domains.py new file mode 100644 index 00000000..3e6e9752 --- /dev/null +++ b/src/gitpod/resources/organizations/custom_domains.py @@ -0,0 +1,636 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.organizations import ( + CustomDomainProvider, + custom_domain_create_params, + custom_domain_delete_params, + custom_domain_update_params, + custom_domain_retrieve_params, +) +from ...types.organizations.custom_domain_provider import CustomDomainProvider +from ...types.organizations.custom_domain_create_response import CustomDomainCreateResponse +from ...types.organizations.custom_domain_update_response import CustomDomainUpdateResponse +from ...types.organizations.custom_domain_retrieve_response import CustomDomainRetrieveResponse + +__all__ = ["CustomDomainsResource", "AsyncCustomDomainsResource"] + + +class CustomDomainsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CustomDomainsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return CustomDomainsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CustomDomainsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return CustomDomainsResourceWithStreamingResponse(self) + + def create( + self, + *, + domain_name: str, + organization_id: str, + aws_account_id: Optional[str] | Omit = omit, + cloud_account_id: Optional[str] | Omit = omit, + provider: CustomDomainProvider | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainCreateResponse: + """ + Creates a custom domain configuration for an organization. + + Use this method to configure custom domains for organization workspaces + + ### Examples + + - Configure AWS custom domain: + + Sets up a custom domain with AWS provider. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domainName: "workspaces.acme-corp.com" + provider: CUSTOM_DOMAIN_PROVIDER_AWS + awsAccountId: "123456789012" + ``` + + Args: + domain_name: domain_name is the custom domain name + + organization_id: organization_id is the ID of the organization to create the custom domain for + + aws_account_id: aws_account_id is the AWS account ID (deprecated: use cloud_account_id) + + cloud_account_id: cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + + provider: provider is the cloud provider for this custom domain + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/CreateCustomDomain", + body=maybe_transform( + { + "domain_name": domain_name, + "organization_id": organization_id, + "aws_account_id": aws_account_id, + "cloud_account_id": cloud_account_id, + "provider": provider, + }, + custom_domain_create_params.CustomDomainCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainCreateResponse, + ) + + def retrieve( + self, + *, + organization_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainRetrieveResponse: + """ + Retrieves a specific custom domain configuration. + + Use this method to view custom domain details + + ### Examples + + - Get custom domain configuration: + + Retrieves details of a specific custom domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to retrieve custom domain for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/GetCustomDomain", + body=maybe_transform( + {"organization_id": organization_id}, custom_domain_retrieve_params.CustomDomainRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainRetrieveResponse, + ) + + def update( + self, + *, + domain_name: str, + organization_id: str, + aws_account_id: Optional[str] | Omit = omit, + cloud_account_id: Optional[str] | Omit = omit, + provider: Optional[CustomDomainProvider] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainUpdateResponse: + """ + Updates custom domain configuration settings. + + Use this method to: + + - Update cloud provider settings + - Change AWS account ID + - Modify domain configuration + + ### Examples + + - Update AWS account ID: + + Changes the AWS account ID for the custom domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domainName: "workspaces.acme-corp.com" + awsAccountId: "987654321098" + ``` + + Args: + domain_name: domain_name is the custom domain name + + organization_id: organization_id is the ID of the organization to update custom domain for + + aws_account_id: aws_account_id is the AWS account ID (deprecated: use cloud_account_id) + + cloud_account_id: cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + + provider: provider is the cloud provider for this custom domain + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/UpdateCustomDomain", + body=maybe_transform( + { + "domain_name": domain_name, + "organization_id": organization_id, + "aws_account_id": aws_account_id, + "cloud_account_id": cloud_account_id, + "provider": provider, + }, + custom_domain_update_params.CustomDomainUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainUpdateResponse, + ) + + def delete( + self, + *, + organization_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Removes a custom domain configuration from an organization. + + Use this method to: + + - Disable custom domain functionality + - Remove outdated configurations + - Clean up unused domains + + ### Examples + + - Delete custom domain configuration: + + Removes a specific custom domain configuration. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to delete custom domain for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/DeleteCustomDomain", + body=maybe_transform( + {"organization_id": organization_id}, custom_domain_delete_params.CustomDomainDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncCustomDomainsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCustomDomainsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncCustomDomainsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCustomDomainsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncCustomDomainsResourceWithStreamingResponse(self) + + async def create( + self, + *, + domain_name: str, + organization_id: str, + aws_account_id: Optional[str] | Omit = omit, + cloud_account_id: Optional[str] | Omit = omit, + provider: CustomDomainProvider | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainCreateResponse: + """ + Creates a custom domain configuration for an organization. + + Use this method to configure custom domains for organization workspaces + + ### Examples + + - Configure AWS custom domain: + + Sets up a custom domain with AWS provider. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domainName: "workspaces.acme-corp.com" + provider: CUSTOM_DOMAIN_PROVIDER_AWS + awsAccountId: "123456789012" + ``` + + Args: + domain_name: domain_name is the custom domain name + + organization_id: organization_id is the ID of the organization to create the custom domain for + + aws_account_id: aws_account_id is the AWS account ID (deprecated: use cloud_account_id) + + cloud_account_id: cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + + provider: provider is the cloud provider for this custom domain + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/CreateCustomDomain", + body=await async_maybe_transform( + { + "domain_name": domain_name, + "organization_id": organization_id, + "aws_account_id": aws_account_id, + "cloud_account_id": cloud_account_id, + "provider": provider, + }, + custom_domain_create_params.CustomDomainCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainCreateResponse, + ) + + async def retrieve( + self, + *, + organization_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainRetrieveResponse: + """ + Retrieves a specific custom domain configuration. + + Use this method to view custom domain details + + ### Examples + + - Get custom domain configuration: + + Retrieves details of a specific custom domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to retrieve custom domain for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/GetCustomDomain", + body=await async_maybe_transform( + {"organization_id": organization_id}, custom_domain_retrieve_params.CustomDomainRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainRetrieveResponse, + ) + + async def update( + self, + *, + domain_name: str, + organization_id: str, + aws_account_id: Optional[str] | Omit = omit, + cloud_account_id: Optional[str] | Omit = omit, + provider: Optional[CustomDomainProvider] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainUpdateResponse: + """ + Updates custom domain configuration settings. + + Use this method to: + + - Update cloud provider settings + - Change AWS account ID + - Modify domain configuration + + ### Examples + + - Update AWS account ID: + + Changes the AWS account ID for the custom domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domainName: "workspaces.acme-corp.com" + awsAccountId: "987654321098" + ``` + + Args: + domain_name: domain_name is the custom domain name + + organization_id: organization_id is the ID of the organization to update custom domain for + + aws_account_id: aws_account_id is the AWS account ID (deprecated: use cloud_account_id) + + cloud_account_id: cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + + provider: provider is the cloud provider for this custom domain + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/UpdateCustomDomain", + body=await async_maybe_transform( + { + "domain_name": domain_name, + "organization_id": organization_id, + "aws_account_id": aws_account_id, + "cloud_account_id": cloud_account_id, + "provider": provider, + }, + custom_domain_update_params.CustomDomainUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainUpdateResponse, + ) + + async def delete( + self, + *, + organization_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Removes a custom domain configuration from an organization. + + Use this method to: + + - Disable custom domain functionality + - Remove outdated configurations + - Clean up unused domains + + ### Examples + + - Delete custom domain configuration: + + Removes a specific custom domain configuration. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to delete custom domain for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/DeleteCustomDomain", + body=await async_maybe_transform( + {"organization_id": organization_id}, custom_domain_delete_params.CustomDomainDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class CustomDomainsResourceWithRawResponse: + def __init__(self, custom_domains: CustomDomainsResource) -> None: + self._custom_domains = custom_domains + + self.create = to_raw_response_wrapper( + custom_domains.create, + ) + self.retrieve = to_raw_response_wrapper( + custom_domains.retrieve, + ) + self.update = to_raw_response_wrapper( + custom_domains.update, + ) + self.delete = to_raw_response_wrapper( + custom_domains.delete, + ) + + +class AsyncCustomDomainsResourceWithRawResponse: + def __init__(self, custom_domains: AsyncCustomDomainsResource) -> None: + self._custom_domains = custom_domains + + self.create = async_to_raw_response_wrapper( + custom_domains.create, + ) + self.retrieve = async_to_raw_response_wrapper( + custom_domains.retrieve, + ) + self.update = async_to_raw_response_wrapper( + custom_domains.update, + ) + self.delete = async_to_raw_response_wrapper( + custom_domains.delete, + ) + + +class CustomDomainsResourceWithStreamingResponse: + def __init__(self, custom_domains: CustomDomainsResource) -> None: + self._custom_domains = custom_domains + + self.create = to_streamed_response_wrapper( + custom_domains.create, + ) + self.retrieve = to_streamed_response_wrapper( + custom_domains.retrieve, + ) + self.update = to_streamed_response_wrapper( + custom_domains.update, + ) + self.delete = to_streamed_response_wrapper( + custom_domains.delete, + ) + + +class AsyncCustomDomainsResourceWithStreamingResponse: + def __init__(self, custom_domains: AsyncCustomDomainsResource) -> None: + self._custom_domains = custom_domains + + self.create = async_to_streamed_response_wrapper( + custom_domains.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + custom_domains.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + custom_domains.update, + ) + self.delete = async_to_streamed_response_wrapper( + custom_domains.delete, + ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 28312caa..c1ec57eb 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -44,6 +44,14 @@ ) from ...pagination import SyncMembersPage, AsyncMembersPage from ..._base_client import AsyncPaginator, make_request_options +from .custom_domains import ( + CustomDomainsResource, + AsyncCustomDomainsResource, + CustomDomainsResourceWithRawResponse, + AsyncCustomDomainsResourceWithRawResponse, + CustomDomainsResourceWithStreamingResponse, + AsyncCustomDomainsResourceWithStreamingResponse, +) from .sso_configurations import ( SSOConfigurationsResource, AsyncSSOConfigurationsResource, @@ -72,6 +80,10 @@ class OrganizationsResource(SyncAPIResource): + @cached_property + def custom_domains(self) -> CustomDomainsResource: + return CustomDomainsResource(self._client) + @cached_property def domain_verifications(self) -> DomainVerificationsResource: return DomainVerificationsResource(self._client) @@ -493,6 +505,7 @@ def list_members( organization_id: str, token: str | Omit = omit, page_size: int | Omit = omit, + filter: organization_list_members_params.Filter | Omit = omit, pagination: organization_list_members_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -552,6 +565,7 @@ def list_members( body=maybe_transform( { "organization_id": organization_id, + "filter": filter, "pagination": pagination, }, organization_list_members_params.OrganizationListMembersParams, @@ -645,6 +659,10 @@ def set_role( class AsyncOrganizationsResource(AsyncAPIResource): + @cached_property + def custom_domains(self) -> AsyncCustomDomainsResource: + return AsyncCustomDomainsResource(self._client) + @cached_property def domain_verifications(self) -> AsyncDomainVerificationsResource: return AsyncDomainVerificationsResource(self._client) @@ -1066,6 +1084,7 @@ def list_members( organization_id: str, token: str | Omit = omit, page_size: int | Omit = omit, + filter: organization_list_members_params.Filter | Omit = omit, pagination: organization_list_members_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1125,6 +1144,7 @@ def list_members( body=maybe_transform( { "organization_id": organization_id, + "filter": filter, "pagination": pagination, }, organization_list_members_params.OrganizationListMembersParams, @@ -1246,6 +1266,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def custom_domains(self) -> CustomDomainsResourceWithRawResponse: + return CustomDomainsResourceWithRawResponse(self._organizations.custom_domains) + @cached_property def domain_verifications(self) -> DomainVerificationsResourceWithRawResponse: return DomainVerificationsResourceWithRawResponse(self._organizations.domain_verifications) @@ -1292,6 +1316,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def custom_domains(self) -> AsyncCustomDomainsResourceWithRawResponse: + return AsyncCustomDomainsResourceWithRawResponse(self._organizations.custom_domains) + @cached_property def domain_verifications(self) -> AsyncDomainVerificationsResourceWithRawResponse: return AsyncDomainVerificationsResourceWithRawResponse(self._organizations.domain_verifications) @@ -1338,6 +1366,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def custom_domains(self) -> CustomDomainsResourceWithStreamingResponse: + return CustomDomainsResourceWithStreamingResponse(self._organizations.custom_domains) + @cached_property def domain_verifications(self) -> DomainVerificationsResourceWithStreamingResponse: return DomainVerificationsResourceWithStreamingResponse(self._organizations.domain_verifications) @@ -1384,6 +1416,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def custom_domains(self) -> AsyncCustomDomainsResourceWithStreamingResponse: + return AsyncCustomDomainsResourceWithStreamingResponse(self._organizations.custom_domains) + @cached_property def domain_verifications(self) -> AsyncDomainVerificationsResourceWithStreamingResponse: return AsyncDomainVerificationsResourceWithStreamingResponse(self._organizations.domain_verifications) diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 70d3b52d..93b785e9 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional import httpx @@ -97,16 +97,22 @@ def update( self, *, organization_id: str, + agent_policy: Optional[policy_update_params.AgentPolicy] | Omit = omit, allowed_editor_ids: SequenceNotStr[str] | Omit = omit, allow_local_runners: Optional[bool] | Omit = omit, default_editor_id: Optional[str] | Omit = omit, default_environment_image: Optional[str] | Omit = omit, + delete_archived_environments_after: Optional[str] | Omit = omit, + editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, + maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, maximum_running_environments_per_user: Optional[str] | Omit = omit, members_create_projects: Optional[bool] | Omit = omit, members_require_projects: Optional[bool] | Omit = omit, port_sharing_disabled: Optional[bool] | Omit = omit, + require_custom_domain_access: Optional[bool] | Omit = omit, + security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -152,6 +158,8 @@ def update( Args: organization_id: organization_id is the ID of the organization to update policies for + agent_policy: agent_policy contains agent-specific policy settings + allowed_editor_ids: allowed_editor_ids is the list of editor IDs that are allowed to be used in the organization @@ -164,12 +172,23 @@ def update( default_environment_image: default_environment_image is the default container image when none is defined in repo + delete_archived_environments_after: delete_archived_environments_after controls how long archived environments are + kept before automatic deletion. 0 means no automatic deletion. Maximum duration + is 4 weeks (2419200 seconds). + + editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps + editor ID to version policy with allowed major versions. + + maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to + be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 + seconds). + maximum_environments_per_user: maximum_environments_per_user limits total environments (running or stopped) per user maximum_environment_timeout: maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes. + minutes (1800 seconds). maximum_running_environments_per_user: maximum_running_environments_per_user limits simultaneously running environments per user @@ -182,6 +201,11 @@ def update( port_sharing_disabled: port_sharing_disabled controls whether port sharing is disabled in the organization + require_custom_domain_access: require_custom_domain_access controls whether users must access via custom + domain when one is configured. When true, access via app.gitpod.io is blocked. + + security_agent_policy: security_agent_policy contains security agent configuration updates + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -195,16 +219,22 @@ def update( body=maybe_transform( { "organization_id": organization_id, + "agent_policy": agent_policy, "allowed_editor_ids": allowed_editor_ids, "allow_local_runners": allow_local_runners, "default_editor_id": default_editor_id, "default_environment_image": default_environment_image, + "delete_archived_environments_after": delete_archived_environments_after, + "editor_version_restrictions": editor_version_restrictions, + "maximum_environment_lifetime": maximum_environment_lifetime, "maximum_environments_per_user": maximum_environments_per_user, "maximum_environment_timeout": maximum_environment_timeout, "maximum_running_environments_per_user": maximum_running_environments_per_user, "members_create_projects": members_create_projects, "members_require_projects": members_require_projects, "port_sharing_disabled": port_sharing_disabled, + "require_custom_domain_access": require_custom_domain_access, + "security_agent_policy": security_agent_policy, }, policy_update_params.PolicyUpdateParams, ), @@ -291,16 +321,22 @@ async def update( self, *, organization_id: str, + agent_policy: Optional[policy_update_params.AgentPolicy] | Omit = omit, allowed_editor_ids: SequenceNotStr[str] | Omit = omit, allow_local_runners: Optional[bool] | Omit = omit, default_editor_id: Optional[str] | Omit = omit, default_environment_image: Optional[str] | Omit = omit, + delete_archived_environments_after: Optional[str] | Omit = omit, + editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, + maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, maximum_running_environments_per_user: Optional[str] | Omit = omit, members_create_projects: Optional[bool] | Omit = omit, members_require_projects: Optional[bool] | Omit = omit, port_sharing_disabled: Optional[bool] | Omit = omit, + require_custom_domain_access: Optional[bool] | Omit = omit, + security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -346,6 +382,8 @@ async def update( Args: organization_id: organization_id is the ID of the organization to update policies for + agent_policy: agent_policy contains agent-specific policy settings + allowed_editor_ids: allowed_editor_ids is the list of editor IDs that are allowed to be used in the organization @@ -358,12 +396,23 @@ async def update( default_environment_image: default_environment_image is the default container image when none is defined in repo + delete_archived_environments_after: delete_archived_environments_after controls how long archived environments are + kept before automatic deletion. 0 means no automatic deletion. Maximum duration + is 4 weeks (2419200 seconds). + + editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps + editor ID to version policy with allowed major versions. + + maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to + be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 + seconds). + maximum_environments_per_user: maximum_environments_per_user limits total environments (running or stopped) per user maximum_environment_timeout: maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes. + minutes (1800 seconds). maximum_running_environments_per_user: maximum_running_environments_per_user limits simultaneously running environments per user @@ -376,6 +425,11 @@ async def update( port_sharing_disabled: port_sharing_disabled controls whether port sharing is disabled in the organization + require_custom_domain_access: require_custom_domain_access controls whether users must access via custom + domain when one is configured. When true, access via app.gitpod.io is blocked. + + security_agent_policy: security_agent_policy contains security agent configuration updates + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -389,16 +443,22 @@ async def update( body=await async_maybe_transform( { "organization_id": organization_id, + "agent_policy": agent_policy, "allowed_editor_ids": allowed_editor_ids, "allow_local_runners": allow_local_runners, "default_editor_id": default_editor_id, "default_environment_image": default_environment_image, + "delete_archived_environments_after": delete_archived_environments_after, + "editor_version_restrictions": editor_version_restrictions, + "maximum_environment_lifetime": maximum_environment_lifetime, "maximum_environments_per_user": maximum_environments_per_user, "maximum_environment_timeout": maximum_environment_timeout, "maximum_running_environments_per_user": maximum_running_environments_per_user, "members_create_projects": members_create_projects, "members_require_projects": members_require_projects, "port_sharing_disabled": port_sharing_disabled, + "require_custom_domain_access": require_custom_domain_access, + "security_agent_policy": security_agent_policy, }, policy_update_params.PolicyUpdateParams, ), diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index c0f1dad1..7d9796cc 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -6,7 +6,7 @@ import httpx -from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -59,9 +59,11 @@ def create( *, client_id: str, client_secret: str, - email_domain: str, issuer_url: str, organization_id: str, + display_name: str | Omit = omit, + email_domain: Optional[str] | Omit = omit, + email_domains: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -110,10 +112,10 @@ def create( client_secret: client_secret is the client secret of the OIDC application set on the IdP - email_domain: email_domain is the domain that is allowed to sign in to the organization - issuer_url: issuer_url is the URL of the IdP issuer + email_domain: email_domain is the domain that is allowed to sign in to the organization + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -128,9 +130,11 @@ def create( { "client_id": client_id, "client_secret": client_secret, - "email_domain": email_domain, "issuer_url": issuer_url, "organization_id": organization_id, + "display_name": display_name, + "email_domain": email_domain, + "email_domains": email_domains, }, sso_configuration_create_params.SSOConfigurationCreateParams, ), @@ -200,7 +204,9 @@ def update( claims: Dict[str, str] | Omit = omit, client_id: Optional[str] | Omit = omit, client_secret: Optional[str] | Omit = omit, + display_name: Optional[str] | Omit = omit, email_domain: Optional[str] | Omit = omit, + email_domains: SequenceNotStr[str] | Omit = omit, issuer_url: Optional[str] | Omit = omit, state: Optional[SSOConfigurationState] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -271,7 +277,9 @@ def update( "claims": claims, "client_id": client_id, "client_secret": client_secret, + "display_name": display_name, "email_domain": email_domain, + "email_domains": email_domains, "issuer_url": issuer_url, "state": state, }, @@ -445,9 +453,11 @@ async def create( *, client_id: str, client_secret: str, - email_domain: str, issuer_url: str, organization_id: str, + display_name: str | Omit = omit, + email_domain: Optional[str] | Omit = omit, + email_domains: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -496,10 +506,10 @@ async def create( client_secret: client_secret is the client secret of the OIDC application set on the IdP - email_domain: email_domain is the domain that is allowed to sign in to the organization - issuer_url: issuer_url is the URL of the IdP issuer + email_domain: email_domain is the domain that is allowed to sign in to the organization + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -514,9 +524,11 @@ async def create( { "client_id": client_id, "client_secret": client_secret, - "email_domain": email_domain, "issuer_url": issuer_url, "organization_id": organization_id, + "display_name": display_name, + "email_domain": email_domain, + "email_domains": email_domains, }, sso_configuration_create_params.SSOConfigurationCreateParams, ), @@ -586,7 +598,9 @@ async def update( claims: Dict[str, str] | Omit = omit, client_id: Optional[str] | Omit = omit, client_secret: Optional[str] | Omit = omit, + display_name: Optional[str] | Omit = omit, email_domain: Optional[str] | Omit = omit, + email_domains: SequenceNotStr[str] | Omit = omit, issuer_url: Optional[str] | Omit = omit, state: Optional[SSOConfigurationState] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -657,7 +671,9 @@ async def update( "claims": claims, "client_id": client_id, "client_secret": client_secret, + "display_name": display_name, "email_domain": email_domain, + "email_domains": email_domains, "issuer_url": issuer_url, "state": state, }, diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py new file mode 100644 index 00000000..c688d1a3 --- /dev/null +++ b/src/gitpod/resources/prebuilds.py @@ -0,0 +1,860 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..types import ( + prebuild_list_params, + prebuild_cancel_params, + prebuild_create_params, + prebuild_delete_params, + prebuild_retrieve_params, + prebuild_create_logs_token_params, +) +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncPrebuildsPage, AsyncPrebuildsPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.prebuild import Prebuild +from ..types.prebuild_spec_param import PrebuildSpecParam +from ..types.prebuild_cancel_response import PrebuildCancelResponse +from ..types.prebuild_create_response import PrebuildCreateResponse +from ..types.prebuild_retrieve_response import PrebuildRetrieveResponse +from ..types.prebuild_create_logs_token_response import PrebuildCreateLogsTokenResponse + +__all__ = ["PrebuildsResource", "AsyncPrebuildsResource"] + + +class PrebuildsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PrebuildsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return PrebuildsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PrebuildsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return PrebuildsResourceWithStreamingResponse(self) + + def create( + self, + *, + project_id: str, + spec: PrebuildSpecParam, + environment_class_id: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateResponse: + """ + Creates a prebuild for a project. + + Use this method to: + + - Create on-demand prebuilds for faster environment startup + - Trigger prebuilds after repository changes + - Generate prebuilds for specific environment classes + + The prebuild process creates an environment, runs the devcontainer prebuild + lifecycle, and creates a snapshot for future environment provisioning. + + ### Examples + + - Create basic prebuild: + + Creates a prebuild for a project using default settings. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + spec: + timeout: "3600s" # 60 minutes default + ``` + + - Create prebuild with custom environment class: + + Creates a prebuild with a specific environment class and timeout. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + spec: + timeout: "3600s" # 1 hour + ``` + + Args: + project_id: project_id specifies the project to create a prebuild for + + spec: spec contains the configuration for creating the prebuild + + environment_class_id: environment_class_id specifies which environment class to use for the prebuild. + If not specified, uses the project's default environment class. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/CreatePrebuild", + body=maybe_transform( + { + "project_id": project_id, + "spec": spec, + "environment_class_id": environment_class_id, + }, + prebuild_create_params.PrebuildCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateResponse, + ) + + def retrieve( + self, + *, + prebuild_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildRetrieveResponse: + """ + Gets details about a specific prebuild. + + Use this method to: + + - Check prebuild status and progress + - Access prebuild logs for debugging + + ### Examples + + - Get prebuild details: + + Retrieves comprehensive information about a prebuild. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to retrieve + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/GetPrebuild", + body=maybe_transform({"prebuild_id": prebuild_id}, prebuild_retrieve_params.PrebuildRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildRetrieveResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: prebuild_list_params.Filter | Omit = omit, + pagination: prebuild_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPrebuildsPage[Prebuild]: + """ + ListPrebuilds + + Args: + filter: filter contains the filter options for listing prebuilds + + pagination: pagination contains the pagination options for listing prebuilds + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.PrebuildService/ListPrebuilds", + page=SyncPrebuildsPage[Prebuild], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + prebuild_list_params.PrebuildListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + prebuild_list_params.PrebuildListParams, + ), + ), + model=Prebuild, + method="post", + ) + + def delete( + self, + *, + prebuild_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a prebuild. + + Prebuilds are automatically deleted after some time. + + Use this method to manually + delete a prebuild before automatic cleanup, for example to remove a prebuild + that should no longer be used. + + Deletion is processed asynchronously. The prebuild will be marked for deletion + and removed from the system in the background. + + ### Examples + + - Delete prebuild: + + Marks a prebuild for deletion and removes it from the system. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/DeletePrebuild", + body=maybe_transform({"prebuild_id": prebuild_id}, prebuild_delete_params.PrebuildDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def cancel( + self, + *, + prebuild_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCancelResponse: + """ + Cancels a running prebuild. + + Use this method to: + + - Stop prebuilds that are no longer needed + - Free up resources for other operations + + ### Examples + + - Cancel prebuild: + + Stops a running prebuild and cleans up resources. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to cancel + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/CancelPrebuild", + body=maybe_transform({"prebuild_id": prebuild_id}, prebuild_cancel_params.PrebuildCancelParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCancelResponse, + ) + + def create_logs_token( + self, + *, + prebuild_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateLogsTokenResponse: + """ + Creates a logs access token for a prebuild. + + Use this method to: + + - Stream logs from a running prebuild + - Access archived logs from completed prebuilds + + Generated tokens are valid for one hour. + + ### Examples + + - Create prebuild logs token: + + Generates a token for accessing prebuild logs. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild for which the logs token should be created. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/CreatePrebuildLogsToken", + body=maybe_transform( + {"prebuild_id": prebuild_id}, prebuild_create_logs_token_params.PrebuildCreateLogsTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateLogsTokenResponse, + ) + + +class AsyncPrebuildsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPrebuildsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncPrebuildsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPrebuildsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncPrebuildsResourceWithStreamingResponse(self) + + async def create( + self, + *, + project_id: str, + spec: PrebuildSpecParam, + environment_class_id: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateResponse: + """ + Creates a prebuild for a project. + + Use this method to: + + - Create on-demand prebuilds for faster environment startup + - Trigger prebuilds after repository changes + - Generate prebuilds for specific environment classes + + The prebuild process creates an environment, runs the devcontainer prebuild + lifecycle, and creates a snapshot for future environment provisioning. + + ### Examples + + - Create basic prebuild: + + Creates a prebuild for a project using default settings. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + spec: + timeout: "3600s" # 60 minutes default + ``` + + - Create prebuild with custom environment class: + + Creates a prebuild with a specific environment class and timeout. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + spec: + timeout: "3600s" # 1 hour + ``` + + Args: + project_id: project_id specifies the project to create a prebuild for + + spec: spec contains the configuration for creating the prebuild + + environment_class_id: environment_class_id specifies which environment class to use for the prebuild. + If not specified, uses the project's default environment class. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/CreatePrebuild", + body=await async_maybe_transform( + { + "project_id": project_id, + "spec": spec, + "environment_class_id": environment_class_id, + }, + prebuild_create_params.PrebuildCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateResponse, + ) + + async def retrieve( + self, + *, + prebuild_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildRetrieveResponse: + """ + Gets details about a specific prebuild. + + Use this method to: + + - Check prebuild status and progress + - Access prebuild logs for debugging + + ### Examples + + - Get prebuild details: + + Retrieves comprehensive information about a prebuild. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to retrieve + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/GetPrebuild", + body=await async_maybe_transform( + {"prebuild_id": prebuild_id}, prebuild_retrieve_params.PrebuildRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildRetrieveResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: prebuild_list_params.Filter | Omit = omit, + pagination: prebuild_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Prebuild, AsyncPrebuildsPage[Prebuild]]: + """ + ListPrebuilds + + Args: + filter: filter contains the filter options for listing prebuilds + + pagination: pagination contains the pagination options for listing prebuilds + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.PrebuildService/ListPrebuilds", + page=AsyncPrebuildsPage[Prebuild], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + prebuild_list_params.PrebuildListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + prebuild_list_params.PrebuildListParams, + ), + ), + model=Prebuild, + method="post", + ) + + async def delete( + self, + *, + prebuild_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a prebuild. + + Prebuilds are automatically deleted after some time. + + Use this method to manually + delete a prebuild before automatic cleanup, for example to remove a prebuild + that should no longer be used. + + Deletion is processed asynchronously. The prebuild will be marked for deletion + and removed from the system in the background. + + ### Examples + + - Delete prebuild: + + Marks a prebuild for deletion and removes it from the system. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/DeletePrebuild", + body=await async_maybe_transform({"prebuild_id": prebuild_id}, prebuild_delete_params.PrebuildDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def cancel( + self, + *, + prebuild_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCancelResponse: + """ + Cancels a running prebuild. + + Use this method to: + + - Stop prebuilds that are no longer needed + - Free up resources for other operations + + ### Examples + + - Cancel prebuild: + + Stops a running prebuild and cleans up resources. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to cancel + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/CancelPrebuild", + body=await async_maybe_transform({"prebuild_id": prebuild_id}, prebuild_cancel_params.PrebuildCancelParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCancelResponse, + ) + + async def create_logs_token( + self, + *, + prebuild_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateLogsTokenResponse: + """ + Creates a logs access token for a prebuild. + + Use this method to: + + - Stream logs from a running prebuild + - Access archived logs from completed prebuilds + + Generated tokens are valid for one hour. + + ### Examples + + - Create prebuild logs token: + + Generates a token for accessing prebuild logs. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild for which the logs token should be created. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/CreatePrebuildLogsToken", + body=await async_maybe_transform( + {"prebuild_id": prebuild_id}, prebuild_create_logs_token_params.PrebuildCreateLogsTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateLogsTokenResponse, + ) + + +class PrebuildsResourceWithRawResponse: + def __init__(self, prebuilds: PrebuildsResource) -> None: + self._prebuilds = prebuilds + + self.create = to_raw_response_wrapper( + prebuilds.create, + ) + self.retrieve = to_raw_response_wrapper( + prebuilds.retrieve, + ) + self.list = to_raw_response_wrapper( + prebuilds.list, + ) + self.delete = to_raw_response_wrapper( + prebuilds.delete, + ) + self.cancel = to_raw_response_wrapper( + prebuilds.cancel, + ) + self.create_logs_token = to_raw_response_wrapper( + prebuilds.create_logs_token, + ) + + +class AsyncPrebuildsResourceWithRawResponse: + def __init__(self, prebuilds: AsyncPrebuildsResource) -> None: + self._prebuilds = prebuilds + + self.create = async_to_raw_response_wrapper( + prebuilds.create, + ) + self.retrieve = async_to_raw_response_wrapper( + prebuilds.retrieve, + ) + self.list = async_to_raw_response_wrapper( + prebuilds.list, + ) + self.delete = async_to_raw_response_wrapper( + prebuilds.delete, + ) + self.cancel = async_to_raw_response_wrapper( + prebuilds.cancel, + ) + self.create_logs_token = async_to_raw_response_wrapper( + prebuilds.create_logs_token, + ) + + +class PrebuildsResourceWithStreamingResponse: + def __init__(self, prebuilds: PrebuildsResource) -> None: + self._prebuilds = prebuilds + + self.create = to_streamed_response_wrapper( + prebuilds.create, + ) + self.retrieve = to_streamed_response_wrapper( + prebuilds.retrieve, + ) + self.list = to_streamed_response_wrapper( + prebuilds.list, + ) + self.delete = to_streamed_response_wrapper( + prebuilds.delete, + ) + self.cancel = to_streamed_response_wrapper( + prebuilds.cancel, + ) + self.create_logs_token = to_streamed_response_wrapper( + prebuilds.create_logs_token, + ) + + +class AsyncPrebuildsResourceWithStreamingResponse: + def __init__(self, prebuilds: AsyncPrebuildsResource) -> None: + self._prebuilds = prebuilds + + self.create = async_to_streamed_response_wrapper( + prebuilds.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + prebuilds.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + prebuilds.list, + ) + self.delete = async_to_streamed_response_wrapper( + prebuilds.delete, + ) + self.cancel = async_to_streamed_response_wrapper( + prebuilds.cancel, + ) + self.create_logs_token = async_to_streamed_response_wrapper( + prebuilds.create_logs_token, + ) diff --git a/src/gitpod/resources/projects/__init__.py b/src/gitpod/resources/projects/__init__.py index da8b9644..d69f1ae8 100644 --- a/src/gitpod/resources/projects/__init__.py +++ b/src/gitpod/resources/projects/__init__.py @@ -16,8 +16,22 @@ ProjectsResourceWithStreamingResponse, AsyncProjectsResourceWithStreamingResponse, ) +from .environment_clases import ( + EnvironmentClasesResource, + AsyncEnvironmentClasesResource, + EnvironmentClasesResourceWithRawResponse, + AsyncEnvironmentClasesResourceWithRawResponse, + EnvironmentClasesResourceWithStreamingResponse, + AsyncEnvironmentClasesResourceWithStreamingResponse, +) __all__ = [ + "EnvironmentClasesResource", + "AsyncEnvironmentClasesResource", + "EnvironmentClasesResourceWithRawResponse", + "AsyncEnvironmentClasesResourceWithRawResponse", + "EnvironmentClasesResourceWithStreamingResponse", + "AsyncEnvironmentClasesResourceWithStreamingResponse", "PoliciesResource", "AsyncPoliciesResource", "PoliciesResourceWithRawResponse", diff --git a/src/gitpod/resources/projects/environment_clases.py b/src/gitpod/resources/projects/environment_clases.py new file mode 100644 index 00000000..94b1098c --- /dev/null +++ b/src/gitpod/resources/projects/environment_clases.py @@ -0,0 +1,385 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncProjectEnvironmentClassesPage, AsyncProjectEnvironmentClassesPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.projects import environment_clase_list_params, environment_clase_update_params +from ...types.shared.project_environment_class import ProjectEnvironmentClass as SharedProjectEnvironmentClass +from ...types.shared_params.project_environment_class import ( + ProjectEnvironmentClass as SharedParamsProjectEnvironmentClass, +) + +__all__ = ["EnvironmentClasesResource", "AsyncEnvironmentClasesResource"] + + +class EnvironmentClasesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EnvironmentClasesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentClasesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentClasesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return EnvironmentClasesResourceWithStreamingResponse(self) + + def update( + self, + *, + project_environment_classes: Iterable[SharedParamsProjectEnvironmentClass] | Omit = omit, + project_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Updates all environment classes of a project. + + Use this method to: + + - Modify all environment classea of a project + + ### Examples + + - Update project environment classes: + + Updates all environment classes for a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + projectEnvironmentClasses: + - environmentClassId: "b0e12f6c-4c67-429d-a4a6-d9838b5da041" + order: 0 + - localRunner: true + order: 1 + ``` + + Args: + project_id: project_id specifies the project identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.ProjectService/UpdateProjectEnvironmentClasses", + body=maybe_transform( + { + "project_environment_classes": project_environment_classes, + "project_id": project_id, + }, + environment_clase_update_params.EnvironmentClaseUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: environment_clase_list_params.Pagination | Omit = omit, + project_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncProjectEnvironmentClassesPage[SharedProjectEnvironmentClass]: + """ + Lists environment classes of a project. + + Use this method to: + + - View all environment classes of a project + + ### Examples + + - List project environment classes: + + Shows all environment classes of a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + Args: + pagination: pagination contains the pagination options for listing project policies + + project_id: project_id specifies the project identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.ProjectService/ListProjectEnvironmentClasses", + page=SyncProjectEnvironmentClassesPage[SharedProjectEnvironmentClass], + body=maybe_transform( + { + "pagination": pagination, + "project_id": project_id, + }, + environment_clase_list_params.EnvironmentClaseListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + environment_clase_list_params.EnvironmentClaseListParams, + ), + ), + model=SharedProjectEnvironmentClass, + method="post", + ) + + +class AsyncEnvironmentClasesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEnvironmentClasesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncEnvironmentClasesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEnvironmentClasesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncEnvironmentClasesResourceWithStreamingResponse(self) + + async def update( + self, + *, + project_environment_classes: Iterable[SharedParamsProjectEnvironmentClass] | Omit = omit, + project_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Updates all environment classes of a project. + + Use this method to: + + - Modify all environment classea of a project + + ### Examples + + - Update project environment classes: + + Updates all environment classes for a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + projectEnvironmentClasses: + - environmentClassId: "b0e12f6c-4c67-429d-a4a6-d9838b5da041" + order: 0 + - localRunner: true + order: 1 + ``` + + Args: + project_id: project_id specifies the project identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.ProjectService/UpdateProjectEnvironmentClasses", + body=await async_maybe_transform( + { + "project_environment_classes": project_environment_classes, + "project_id": project_id, + }, + environment_clase_update_params.EnvironmentClaseUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: environment_clase_list_params.Pagination | Omit = omit, + project_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ + SharedProjectEnvironmentClass, AsyncProjectEnvironmentClassesPage[SharedProjectEnvironmentClass] + ]: + """ + Lists environment classes of a project. + + Use this method to: + + - View all environment classes of a project + + ### Examples + + - List project environment classes: + + Shows all environment classes of a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` + + Args: + pagination: pagination contains the pagination options for listing project policies + + project_id: project_id specifies the project identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.ProjectService/ListProjectEnvironmentClasses", + page=AsyncProjectEnvironmentClassesPage[SharedProjectEnvironmentClass], + body=maybe_transform( + { + "pagination": pagination, + "project_id": project_id, + }, + environment_clase_list_params.EnvironmentClaseListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + environment_clase_list_params.EnvironmentClaseListParams, + ), + ), + model=SharedProjectEnvironmentClass, + method="post", + ) + + +class EnvironmentClasesResourceWithRawResponse: + def __init__(self, environment_clases: EnvironmentClasesResource) -> None: + self._environment_clases = environment_clases + + self.update = to_raw_response_wrapper( + environment_clases.update, + ) + self.list = to_raw_response_wrapper( + environment_clases.list, + ) + + +class AsyncEnvironmentClasesResourceWithRawResponse: + def __init__(self, environment_clases: AsyncEnvironmentClasesResource) -> None: + self._environment_clases = environment_clases + + self.update = async_to_raw_response_wrapper( + environment_clases.update, + ) + self.list = async_to_raw_response_wrapper( + environment_clases.list, + ) + + +class EnvironmentClasesResourceWithStreamingResponse: + def __init__(self, environment_clases: EnvironmentClasesResource) -> None: + self._environment_clases = environment_clases + + self.update = to_streamed_response_wrapper( + environment_clases.update, + ) + self.list = to_streamed_response_wrapper( + environment_clases.list, + ) + + +class AsyncEnvironmentClasesResourceWithStreamingResponse: + def __init__(self, environment_clases: AsyncEnvironmentClasesResource) -> None: + self._environment_clases = environment_clases + + self.update = async_to_streamed_response_wrapper( + environment_clases.update, + ) + self.list = async_to_streamed_response_wrapper( + environment_clases.list, + ) diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index d8d61de5..4a4bd619 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -35,17 +35,29 @@ from ...pagination import SyncProjectsPage, AsyncProjectsPage from ..._base_client import AsyncPaginator, make_request_options from ...types.project import Project +from .environment_clases import ( + EnvironmentClasesResource, + AsyncEnvironmentClasesResource, + EnvironmentClasesResourceWithRawResponse, + AsyncEnvironmentClasesResourceWithRawResponse, + EnvironmentClasesResourceWithStreamingResponse, + AsyncEnvironmentClasesResourceWithStreamingResponse, +) from ...types.project_create_response import ProjectCreateResponse from ...types.project_update_response import ProjectUpdateResponse from ...types.project_retrieve_response import ProjectRetrieveResponse from ...types.environment_initializer_param import EnvironmentInitializerParam -from ...types.project_environment_class_param import ProjectEnvironmentClassParam +from ...types.project_prebuild_configuration_param import ProjectPrebuildConfigurationParam from ...types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse __all__ = ["ProjectsResource", "AsyncProjectsResource"] class ProjectsResource(SyncAPIResource): + @cached_property + def environment_clases(self) -> EnvironmentClasesResource: + return EnvironmentClasesResource(self._client) + @cached_property def policies(self) -> PoliciesResource: return PoliciesResource(self._client) @@ -72,11 +84,11 @@ def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: def create( self, *, - environment_class: ProjectEnvironmentClassParam, initializer: EnvironmentInitializerParam, automations_file_path: str | Omit = omit, devcontainer_file_path: str | Omit = omit, name: str | Omit = omit, + prebuild_configuration: ProjectPrebuildConfigurationParam | Omit = omit, technical_description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -103,8 +115,6 @@ def create( ```yaml name: "Web Application" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" initializer: specs: - git: @@ -117,8 +127,6 @@ def create( ```yaml name: "Backend Service" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" initializer: specs: - git: @@ -144,6 +152,9 @@ def create( this.matches("^$|^[^/].*") ``` + prebuild_configuration: prebuild_configuration defines how prebuilds are created for this project. If + not set, prebuilds are disabled for the project. + technical_description: technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max @@ -159,11 +170,11 @@ def create( "/gitpod.v1.ProjectService/CreateProject", body=maybe_transform( { - "environment_class": environment_class, "initializer": initializer, "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, "name": name, + "prebuild_configuration": prebuild_configuration, "technical_description": technical_description, }, project_create_params.ProjectCreateParams, @@ -229,9 +240,9 @@ def update( *, automations_file_path: Optional[str] | Omit = omit, devcontainer_file_path: Optional[str] | Omit = omit, - environment_class: Optional[ProjectEnvironmentClassParam] | Omit = omit, initializer: Optional[EnvironmentInitializerParam] | Omit = omit, name: Optional[str] | Omit = omit, + prebuild_configuration: Optional[ProjectPrebuildConfigurationParam] | Omit = omit, project_id: str | Omit = omit, technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -250,6 +261,7 @@ def update( - Update environment class - Change project name - Configure initializers + - Configure prebuild settings ### Examples @@ -262,14 +274,20 @@ def update( name: "New Project Name" ``` - - Update environment class: + - Enable prebuilds with daily schedule: - Changes the project's environment class. + Configures prebuilds to run daily at 2 AM UTC. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + prebuildConfiguration: + enabled: true + environmentClassIds: + - "b0e12f6c-4c67-429d-a4a6-d9838b5da041" + timeout: "3600s" + trigger: + dailySchedule: + hourUtc: 2 ``` Args: @@ -289,6 +307,10 @@ def update( initializer: initializer is the content initializer + prebuild_configuration: prebuild_configuration defines how prebuilds are created for this project. If + not provided, the existing prebuild configuration is not modified. To disable + prebuilds, set enabled to false. + project_id: project_id specifies the project identifier technical_description: technical_description is a detailed technical description of the project This @@ -308,9 +330,9 @@ def update( { "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, - "environment_class": environment_class, "initializer": initializer, "name": name, + "prebuild_configuration": prebuild_configuration, "project_id": project_id, "technical_description": technical_description, }, @@ -504,6 +526,10 @@ def create_from_environment( class AsyncProjectsResource(AsyncAPIResource): + @cached_property + def environment_clases(self) -> AsyncEnvironmentClasesResource: + return AsyncEnvironmentClasesResource(self._client) + @cached_property def policies(self) -> AsyncPoliciesResource: return AsyncPoliciesResource(self._client) @@ -530,11 +556,11 @@ def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: async def create( self, *, - environment_class: ProjectEnvironmentClassParam, initializer: EnvironmentInitializerParam, automations_file_path: str | Omit = omit, devcontainer_file_path: str | Omit = omit, name: str | Omit = omit, + prebuild_configuration: ProjectPrebuildConfigurationParam | Omit = omit, technical_description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -561,8 +587,6 @@ async def create( ```yaml name: "Web Application" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" initializer: specs: - git: @@ -575,8 +599,6 @@ async def create( ```yaml name: "Backend Service" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" initializer: specs: - git: @@ -602,6 +624,9 @@ async def create( this.matches("^$|^[^/].*") ``` + prebuild_configuration: prebuild_configuration defines how prebuilds are created for this project. If + not set, prebuilds are disabled for the project. + technical_description: technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max @@ -617,11 +642,11 @@ async def create( "/gitpod.v1.ProjectService/CreateProject", body=await async_maybe_transform( { - "environment_class": environment_class, "initializer": initializer, "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, "name": name, + "prebuild_configuration": prebuild_configuration, "technical_description": technical_description, }, project_create_params.ProjectCreateParams, @@ -687,9 +712,9 @@ async def update( *, automations_file_path: Optional[str] | Omit = omit, devcontainer_file_path: Optional[str] | Omit = omit, - environment_class: Optional[ProjectEnvironmentClassParam] | Omit = omit, initializer: Optional[EnvironmentInitializerParam] | Omit = omit, name: Optional[str] | Omit = omit, + prebuild_configuration: Optional[ProjectPrebuildConfigurationParam] | Omit = omit, project_id: str | Omit = omit, technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -708,6 +733,7 @@ async def update( - Update environment class - Change project name - Configure initializers + - Configure prebuild settings ### Examples @@ -720,14 +746,20 @@ async def update( name: "New Project Name" ``` - - Update environment class: + - Enable prebuilds with daily schedule: - Changes the project's environment class. + Configures prebuilds to run daily at 2 AM UTC. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + prebuildConfiguration: + enabled: true + environmentClassIds: + - "b0e12f6c-4c67-429d-a4a6-d9838b5da041" + timeout: "3600s" + trigger: + dailySchedule: + hourUtc: 2 ``` Args: @@ -747,6 +779,10 @@ async def update( initializer: initializer is the content initializer + prebuild_configuration: prebuild_configuration defines how prebuilds are created for this project. If + not provided, the existing prebuild configuration is not modified. To disable + prebuilds, set enabled to false. + project_id: project_id specifies the project identifier technical_description: technical_description is a detailed technical description of the project This @@ -766,9 +802,9 @@ async def update( { "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, - "environment_class": environment_class, "initializer": initializer, "name": name, + "prebuild_configuration": prebuild_configuration, "project_id": project_id, "technical_description": technical_description, }, @@ -984,6 +1020,10 @@ def __init__(self, projects: ProjectsResource) -> None: projects.create_from_environment, ) + @cached_property + def environment_clases(self) -> EnvironmentClasesResourceWithRawResponse: + return EnvironmentClasesResourceWithRawResponse(self._projects.environment_clases) + @cached_property def policies(self) -> PoliciesResourceWithRawResponse: return PoliciesResourceWithRawResponse(self._projects.policies) @@ -1012,6 +1052,10 @@ def __init__(self, projects: AsyncProjectsResource) -> None: projects.create_from_environment, ) + @cached_property + def environment_clases(self) -> AsyncEnvironmentClasesResourceWithRawResponse: + return AsyncEnvironmentClasesResourceWithRawResponse(self._projects.environment_clases) + @cached_property def policies(self) -> AsyncPoliciesResourceWithRawResponse: return AsyncPoliciesResourceWithRawResponse(self._projects.policies) @@ -1040,6 +1084,10 @@ def __init__(self, projects: ProjectsResource) -> None: projects.create_from_environment, ) + @cached_property + def environment_clases(self) -> EnvironmentClasesResourceWithStreamingResponse: + return EnvironmentClasesResourceWithStreamingResponse(self._projects.environment_clases) + @cached_property def policies(self) -> PoliciesResourceWithStreamingResponse: return PoliciesResourceWithStreamingResponse(self._projects.policies) @@ -1068,6 +1116,10 @@ def __init__(self, projects: AsyncProjectsResource) -> None: projects.create_from_environment, ) + @cached_property + def environment_clases(self) -> AsyncEnvironmentClasesResourceWithStreamingResponse: + return AsyncEnvironmentClasesResourceWithStreamingResponse(self._projects.environment_clases) + @cached_property def policies(self) -> AsyncPoliciesResourceWithStreamingResponse: return AsyncPoliciesResourceWithStreamingResponse(self._projects.policies) diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 1c77a680..ab747fd0 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -7,7 +7,7 @@ import httpx -from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -19,6 +19,7 @@ ) from ....pagination import SyncTokensPage, AsyncTokensPage from ...._base_client import AsyncPaginator, make_request_options +from ....types.shared_params.subject import Subject from ....types.runners.configurations import ( HostAuthenticationTokenSource, host_authentication_token_list_params, @@ -65,9 +66,12 @@ def create( token: str | Omit = omit, expires_at: Union[str, datetime] | Omit = omit, host: str | Omit = omit, + integration_id: str | Omit = omit, refresh_token: str | Omit = omit, runner_id: str | Omit = omit, + scopes: SequenceNotStr[str] | Omit = omit, source: HostAuthenticationTokenSource | Omit = omit, + subject: Subject | Omit = omit, user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -102,6 +106,8 @@ def create( ``` Args: + token: stored encrypted, retrieved via GetHostAuthenticationTokenValue + expires_at: A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, @@ -191,6 +197,14 @@ def create( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. + refresh_token: stored encrypted, retrieved via GetHostAuthenticationTokenValue + + scopes: Maximum 100 scopes allowed (101 for validation purposes) + + subject: Subject identifies the principal (user or service account) for the token + + user_id: Deprecated: Use principal_id and principal_type instead + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -206,9 +220,12 @@ def create( "token": token, "expires_at": expires_at, "host": host, + "integration_id": integration_id, "refresh_token": refresh_token, "runner_id": runner_id, + "scopes": scopes, "source": source, + "subject": subject, "user_id": user_id, }, host_authentication_token_create_params.HostAuthenticationTokenCreateParams, @@ -276,6 +293,7 @@ def update( token: Optional[str] | Omit = omit, expires_at: Union[str, datetime, None] | Omit = omit, refresh_token: Optional[str] | Omit = omit, + scopes: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -411,6 +429,7 @@ def update( "token": token, "expires_at": expires_at, "refresh_token": refresh_token, + "scopes": scopes, }, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, ), @@ -578,9 +597,12 @@ async def create( token: str | Omit = omit, expires_at: Union[str, datetime] | Omit = omit, host: str | Omit = omit, + integration_id: str | Omit = omit, refresh_token: str | Omit = omit, runner_id: str | Omit = omit, + scopes: SequenceNotStr[str] | Omit = omit, source: HostAuthenticationTokenSource | Omit = omit, + subject: Subject | Omit = omit, user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -615,6 +637,8 @@ async def create( ``` Args: + token: stored encrypted, retrieved via GetHostAuthenticationTokenValue + expires_at: A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, @@ -704,6 +728,14 @@ async def create( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. + refresh_token: stored encrypted, retrieved via GetHostAuthenticationTokenValue + + scopes: Maximum 100 scopes allowed (101 for validation purposes) + + subject: Subject identifies the principal (user or service account) for the token + + user_id: Deprecated: Use principal_id and principal_type instead + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -719,9 +751,12 @@ async def create( "token": token, "expires_at": expires_at, "host": host, + "integration_id": integration_id, "refresh_token": refresh_token, "runner_id": runner_id, + "scopes": scopes, "source": source, + "subject": subject, "user_id": user_id, }, host_authentication_token_create_params.HostAuthenticationTokenCreateParams, @@ -789,6 +824,7 @@ async def update( token: Optional[str] | Omit = omit, expires_at: Union[str, datetime, None] | Omit = omit, refresh_token: Optional[str] | Omit = omit, + scopes: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -924,6 +960,7 @@ async def update( "token": token, "expires_at": expires_at, "refresh_token": refresh_token, + "scopes": scopes, }, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, ), diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 2f5f82ad..12c4b9e7 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -62,6 +62,7 @@ def create( pat: bool | Omit = omit, runner_id: str | Omit = omit, scm_id: str | Omit = omit, + virtual_directory: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -105,6 +106,11 @@ def create( scm_id: scm_id references the scm_id in the runner's configuration schema that this integration is for + virtual_directory: virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -124,6 +130,7 @@ def create( "pat": pat, "runner_id": runner_id, "scm_id": scm_id, + "virtual_directory": virtual_directory, }, scm_integration_create_params.ScmIntegrationCreateParams, ), @@ -189,6 +196,7 @@ def update( oauth_client_id: Optional[str] | Omit = omit, oauth_plaintext_client_secret: Optional[str] | Omit = omit, pat: Optional[bool] | Omit = omit, + virtual_directory: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -238,6 +246,11 @@ def update( This might lead to users being unable to access their repositories until they re-authenticate. + virtual_directory: virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -255,6 +268,7 @@ def update( "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, + "virtual_directory": virtual_directory, }, scm_integration_update_params.ScmIntegrationUpdateParams, ), @@ -417,6 +431,7 @@ async def create( pat: bool | Omit = omit, runner_id: str | Omit = omit, scm_id: str | Omit = omit, + virtual_directory: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -460,6 +475,11 @@ async def create( scm_id: scm_id references the scm_id in the runner's configuration schema that this integration is for + virtual_directory: virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -479,6 +499,7 @@ async def create( "pat": pat, "runner_id": runner_id, "scm_id": scm_id, + "virtual_directory": virtual_directory, }, scm_integration_create_params.ScmIntegrationCreateParams, ), @@ -544,6 +565,7 @@ async def update( oauth_client_id: Optional[str] | Omit = omit, oauth_plaintext_client_secret: Optional[str] | Omit = omit, pat: Optional[bool] | Omit = omit, + virtual_directory: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -593,6 +615,11 @@ async def update( This might lead to users being unable to access their repositories until they re-authenticate. + virtual_directory: virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -610,6 +637,7 @@ async def update( "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, + "virtual_directory": virtual_directory, }, scm_integration_update_params.ScmIntegrationUpdateParams, ), diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 5b44c562..1c445f8e 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -8,14 +8,17 @@ from ...types import ( RunnerKind, + SearchMode, RunnerProvider, runner_list_params, runner_create_params, runner_delete_params, runner_update_params, runner_retrieve_params, + runner_create_logs_token_params, runner_parse_context_url_params, runner_create_runner_token_params, + runner_search_repositories_params, runner_check_authentication_for_host_params, ) from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given @@ -40,6 +43,7 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.runner import Runner from ...types.runner_kind import RunnerKind +from ...types.search_mode import SearchMode from ...types.runner_provider import RunnerProvider from ...types.runner_spec_param import RunnerSpecParam from .configurations.configurations import ( @@ -52,8 +56,10 @@ ) from ...types.runner_create_response import RunnerCreateResponse from ...types.runner_retrieve_response import RunnerRetrieveResponse +from ...types.runner_create_logs_token_response import RunnerCreateLogsTokenResponse from ...types.runner_parse_context_url_response import RunnerParseContextURLResponse from ...types.runner_create_runner_token_response import RunnerCreateRunnerTokenResponse +from ...types.runner_search_repositories_response import RunnerSearchRepositoriesResponse from ...types.runner_check_authentication_for_host_response import RunnerCheckAuthenticationForHostResponse __all__ = ["RunnersResource", "AsyncRunnersResource"] @@ -502,6 +508,54 @@ def check_authentication_for_host( cast_to=RunnerCheckAuthenticationForHostResponse, ) + def create_logs_token( + self, + *, + runner_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerCreateLogsTokenResponse: + """ + Creates an access token for runner logs and debug information. + + Generated tokens are valid for one hour and provide runner-specific access + permissions. The token is scoped to a specific runner and can be used to access + support bundles. + + ### Examples + + - Generate runner logs token: + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + runner_id: runner_id specifies the runner for which the logs token should be created. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.RunnerService/CreateRunnerLogsToken", + body=maybe_transform({"runner_id": runner_id}, runner_create_logs_token_params.RunnerCreateLogsTokenParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCreateLogsTokenResponse, + ) + def create_runner_token( self, *, @@ -616,6 +670,94 @@ def parse_context_url( cast_to=RunnerParseContextURLResponse, ) + def search_repositories( + self, + *, + limit: int | Omit = omit, + pagination: runner_search_repositories_params.Pagination | Omit = omit, + runner_id: str | Omit = omit, + scm_host: str | Omit = omit, + search_mode: SearchMode | Omit = omit, + search_string: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerSearchRepositoriesResponse: + """ + Searches for repositories across all authenticated SCM hosts. + + Use this method to: + + - List available repositories + - Search repositories by name or content + - Discover repositories for environment creation + + Returns repositories from all authenticated SCM hosts in natural sort order. If + no repositories are found, returns an empty list. + + ### Examples + + - List all repositories: + + Returns up to 25 repositories from all authenticated hosts. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + - Search repositories: + + Searches for repositories matching the query across all hosts. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + searchString: "my-project" + limit: 10 + ``` + + Args: + limit: + Maximum number of repositories to return. Default: 25, Maximum: 100 Deprecated: + Use pagination.page_size instead + + pagination: Pagination parameters for repository search + + scm_host: The SCM's host to retrieve repositories from + + search_mode: Search mode determines how search_string is interpreted + + search_string: Search query - interpretation depends on search_mode + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.RunnerService/SearchRepositories", + body=maybe_transform( + { + "limit": limit, + "pagination": pagination, + "runner_id": runner_id, + "scm_host": scm_host, + "search_mode": search_mode, + "search_string": search_string, + }, + runner_search_repositories_params.RunnerSearchRepositoriesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerSearchRepositoriesResponse, + ) + class AsyncRunnersResource(AsyncAPIResource): @cached_property @@ -1060,6 +1202,56 @@ async def check_authentication_for_host( cast_to=RunnerCheckAuthenticationForHostResponse, ) + async def create_logs_token( + self, + *, + runner_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerCreateLogsTokenResponse: + """ + Creates an access token for runner logs and debug information. + + Generated tokens are valid for one hour and provide runner-specific access + permissions. The token is scoped to a specific runner and can be used to access + support bundles. + + ### Examples + + - Generate runner logs token: + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + runner_id: runner_id specifies the runner for which the logs token should be created. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.RunnerService/CreateRunnerLogsToken", + body=await async_maybe_transform( + {"runner_id": runner_id}, runner_create_logs_token_params.RunnerCreateLogsTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCreateLogsTokenResponse, + ) + async def create_runner_token( self, *, @@ -1174,6 +1366,94 @@ async def parse_context_url( cast_to=RunnerParseContextURLResponse, ) + async def search_repositories( + self, + *, + limit: int | Omit = omit, + pagination: runner_search_repositories_params.Pagination | Omit = omit, + runner_id: str | Omit = omit, + scm_host: str | Omit = omit, + search_mode: SearchMode | Omit = omit, + search_string: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerSearchRepositoriesResponse: + """ + Searches for repositories across all authenticated SCM hosts. + + Use this method to: + + - List available repositories + - Search repositories by name or content + - Discover repositories for environment creation + + Returns repositories from all authenticated SCM hosts in natural sort order. If + no repositories are found, returns an empty list. + + ### Examples + + - List all repositories: + + Returns up to 25 repositories from all authenticated hosts. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + - Search repositories: + + Searches for repositories matching the query across all hosts. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + searchString: "my-project" + limit: 10 + ``` + + Args: + limit: + Maximum number of repositories to return. Default: 25, Maximum: 100 Deprecated: + Use pagination.page_size instead + + pagination: Pagination parameters for repository search + + scm_host: The SCM's host to retrieve repositories from + + search_mode: Search mode determines how search_string is interpreted + + search_string: Search query - interpretation depends on search_mode + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.RunnerService/SearchRepositories", + body=await async_maybe_transform( + { + "limit": limit, + "pagination": pagination, + "runner_id": runner_id, + "scm_host": scm_host, + "search_mode": search_mode, + "search_string": search_string, + }, + runner_search_repositories_params.RunnerSearchRepositoriesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerSearchRepositoriesResponse, + ) + class RunnersResourceWithRawResponse: def __init__(self, runners: RunnersResource) -> None: @@ -1197,12 +1477,18 @@ def __init__(self, runners: RunnersResource) -> None: self.check_authentication_for_host = to_raw_response_wrapper( runners.check_authentication_for_host, ) + self.create_logs_token = to_raw_response_wrapper( + runners.create_logs_token, + ) self.create_runner_token = to_raw_response_wrapper( runners.create_runner_token, ) self.parse_context_url = to_raw_response_wrapper( runners.parse_context_url, ) + self.search_repositories = to_raw_response_wrapper( + runners.search_repositories, + ) @cached_property def configurations(self) -> ConfigurationsResourceWithRawResponse: @@ -1235,12 +1521,18 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.check_authentication_for_host = async_to_raw_response_wrapper( runners.check_authentication_for_host, ) + self.create_logs_token = async_to_raw_response_wrapper( + runners.create_logs_token, + ) self.create_runner_token = async_to_raw_response_wrapper( runners.create_runner_token, ) self.parse_context_url = async_to_raw_response_wrapper( runners.parse_context_url, ) + self.search_repositories = async_to_raw_response_wrapper( + runners.search_repositories, + ) @cached_property def configurations(self) -> AsyncConfigurationsResourceWithRawResponse: @@ -1273,12 +1565,18 @@ def __init__(self, runners: RunnersResource) -> None: self.check_authentication_for_host = to_streamed_response_wrapper( runners.check_authentication_for_host, ) + self.create_logs_token = to_streamed_response_wrapper( + runners.create_logs_token, + ) self.create_runner_token = to_streamed_response_wrapper( runners.create_runner_token, ) self.parse_context_url = to_streamed_response_wrapper( runners.parse_context_url, ) + self.search_repositories = to_streamed_response_wrapper( + runners.search_repositories, + ) @cached_property def configurations(self) -> ConfigurationsResourceWithStreamingResponse: @@ -1311,12 +1609,18 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.check_authentication_for_host = async_to_streamed_response_wrapper( runners.check_authentication_for_host, ) + self.create_logs_token = async_to_streamed_response_wrapper( + runners.create_logs_token, + ) self.create_runner_token = async_to_streamed_response_wrapper( runners.create_runner_token, ) self.parse_context_url = async_to_streamed_response_wrapper( runners.parse_context_url, ) + self.search_repositories = async_to_streamed_response_wrapper( + runners.search_repositories, + ) @cached_property def configurations(self) -> AsyncConfigurationsResourceWithStreamingResponse: diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 16dcd675..6367df25 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -54,6 +54,7 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: def create( self, *, + api_only: bool | Omit = omit, container_registry_basic_auth_host: str | Omit = omit, environment_variable: bool | Omit = omit, file_path: str | Omit = omit, @@ -114,6 +115,10 @@ def create( ``` Args: + api_only: api_only indicates the secret is only available via API/CLI. These secrets are + NOT automatically injected into services or devcontainers. Useful for secrets + that should only be consumed programmatically (e.g., by security agents). + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have the docker registry host @@ -145,6 +150,7 @@ def create( "/gitpod.v1.SecretService/CreateSecret", body=maybe_transform( { + "api_only": api_only, "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, @@ -424,6 +430,7 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: async def create( self, *, + api_only: bool | Omit = omit, container_registry_basic_auth_host: str | Omit = omit, environment_variable: bool | Omit = omit, file_path: str | Omit = omit, @@ -484,6 +491,10 @@ async def create( ``` Args: + api_only: api_only indicates the secret is only available via API/CLI. These secrets are + NOT automatically injected into services or devcontainers. Useful for secrets + that should only be consumed programmatically (e.g., by security agents). + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have the docker registry host @@ -515,6 +526,7 @@ async def create( "/gitpod.v1.SecretService/CreateSecret", body=await async_maybe_transform( { + "api_only": api_only, "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index 2fae4522..4303cf66 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -12,7 +12,12 @@ PatsResourceWithStreamingResponse, AsyncPatsResourceWithStreamingResponse, ) -from ...types import user_set_suspended_params, user_get_authenticated_user_params +from ...types import ( + user_get_user_params, + user_delete_user_params, + user_set_suspended_params, + user_get_authenticated_user_params, +) from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .dotfiles import ( @@ -32,6 +37,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options +from ...types.user_get_user_response import UserGetUserResponse from ...types.user_get_authenticated_user_response import UserGetAuthenticatedUserResponse __all__ = ["UsersResource", "AsyncUsersResource"] @@ -65,6 +71,40 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: """ return UsersResourceWithStreamingResponse(self) + def delete_user( + self, + *, + user_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a user. + + If the User comes from an organization's SSO provider, the + Account will also be deleted. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.UserService/DeleteUser", + body=maybe_transform({"user_id": user_id}, user_delete_user_params.UserDeleteUserParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + def get_authenticated_user( self, *, @@ -114,6 +154,54 @@ def get_authenticated_user( cast_to=UserGetAuthenticatedUserResponse, ) + def get_user( + self, + *, + user_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> UserGetUserResponse: + """ + Gets basic information about a specific user by their ID. + + Use this method to: + + - Retrieve user profile information + - Get user details for display purposes + - Fetch user metadata for administrative tasks + + ### Examples + + - Get user by ID: + + Retrieves basic user information by user ID. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.UserService/GetUser", + body=maybe_transform({"user_id": user_id}, user_get_user_params.UserGetUserParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=UserGetUserResponse, + ) + def set_suspended( self, *, @@ -208,6 +296,40 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: """ return AsyncUsersResourceWithStreamingResponse(self) + async def delete_user( + self, + *, + user_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a user. + + If the User comes from an organization's SSO provider, the + Account will also be deleted. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.UserService/DeleteUser", + body=await async_maybe_transform({"user_id": user_id}, user_delete_user_params.UserDeleteUserParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + async def get_authenticated_user( self, *, @@ -259,6 +381,54 @@ async def get_authenticated_user( cast_to=UserGetAuthenticatedUserResponse, ) + async def get_user( + self, + *, + user_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> UserGetUserResponse: + """ + Gets basic information about a specific user by their ID. + + Use this method to: + + - Retrieve user profile information + - Get user details for display purposes + - Fetch user metadata for administrative tasks + + ### Examples + + - Get user by ID: + + Retrieves basic user information by user ID. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.UserService/GetUser", + body=await async_maybe_transform({"user_id": user_id}, user_get_user_params.UserGetUserParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=UserGetUserResponse, + ) + async def set_suspended( self, *, @@ -329,9 +499,15 @@ class UsersResourceWithRawResponse: def __init__(self, users: UsersResource) -> None: self._users = users + self.delete_user = to_raw_response_wrapper( + users.delete_user, + ) self.get_authenticated_user = to_raw_response_wrapper( users.get_authenticated_user, ) + self.get_user = to_raw_response_wrapper( + users.get_user, + ) self.set_suspended = to_raw_response_wrapper( users.set_suspended, ) @@ -349,9 +525,15 @@ class AsyncUsersResourceWithRawResponse: def __init__(self, users: AsyncUsersResource) -> None: self._users = users + self.delete_user = async_to_raw_response_wrapper( + users.delete_user, + ) self.get_authenticated_user = async_to_raw_response_wrapper( users.get_authenticated_user, ) + self.get_user = async_to_raw_response_wrapper( + users.get_user, + ) self.set_suspended = async_to_raw_response_wrapper( users.set_suspended, ) @@ -369,9 +551,15 @@ class UsersResourceWithStreamingResponse: def __init__(self, users: UsersResource) -> None: self._users = users + self.delete_user = to_streamed_response_wrapper( + users.delete_user, + ) self.get_authenticated_user = to_streamed_response_wrapper( users.get_authenticated_user, ) + self.get_user = to_streamed_response_wrapper( + users.get_user, + ) self.set_suspended = to_streamed_response_wrapper( users.set_suspended, ) @@ -389,9 +577,15 @@ class AsyncUsersResourceWithStreamingResponse: def __init__(self, users: AsyncUsersResource) -> None: self._users = users + self.delete_user = async_to_streamed_response_wrapper( + users.delete_user, + ) self.get_authenticated_user = async_to_streamed_response_wrapper( users.get_authenticated_user, ) + self.get_user = async_to_streamed_response_wrapper( + users.get_user, + ) self.set_suspended = async_to_streamed_response_wrapper( users.set_suspended, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index cfa1c5d7..c3748784 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -5,6 +5,7 @@ from .user import User as User from .group import Group as Group from .editor import Editor as Editor +from .prompt import Prompt as Prompt from .runner import Runner as Runner from .secret import Secret as Secret from .shared import ( @@ -15,8 +16,10 @@ TaskSpec as TaskSpec, ErrorCode as ErrorCode, Principal as Principal, + SecretRef as SecretRef, FieldValue as FieldValue, UserStatus as UserStatus, + ResourceType as ResourceType, TaskMetadata as TaskMetadata, TaskExecution as TaskExecution, EnvironmentClass as EnvironmentClass, @@ -26,54 +29,87 @@ TaskExecutionPhase as TaskExecutionPhase, TaskExecutionStatus as TaskExecutionStatus, TaskExecutionMetadata as TaskExecutionMetadata, + EnvironmentVariableItem as EnvironmentVariableItem, + ProjectEnvironmentClass as ProjectEnvironmentClass, + EnvironmentVariableSource as EnvironmentVariableSource, ) from .account import Account as Account from .project import Project as Project +from .prebuild import Prebuild as Prebuild from .log_level import LogLevel as LogLevel +from .agent_mode import AgentMode as AgentMode from .environment import Environment as Environment +from .error_level import ErrorLevel as ErrorLevel +from .prompt_spec import PromptSpec as PromptSpec from .runner_kind import RunnerKind as RunnerKind from .runner_spec import RunnerSpec as RunnerSpec +from .search_mode import SearchMode as SearchMode from .gateway_info import GatewayInfo as GatewayInfo from .organization import Organization as Organization from .runner_phase import RunnerPhase as RunnerPhase from .secret_scope import SecretScope as SecretScope -from .resource_type import ResourceType as ResourceType +from .prebuild_spec import PrebuildSpec as PrebuildSpec +from .project_phase import ProjectPhase as ProjectPhase from .runner_status import RunnerStatus as RunnerStatus +from .editor_version import EditorVersion as EditorVersion from .invite_domains import InviteDomains as InviteDomains from .login_provider import LoginProvider as LoginProvider +from .prebuild_phase import PrebuildPhase as PrebuildPhase +from .runner_variant import RunnerVariant as RunnerVariant from .admission_level import AdmissionLevel as AdmissionLevel +from .agent_execution import AgentExecution as AgentExecution +from .prebuild_status import PrebuildStatus as PrebuildStatus +from .prompt_metadata import PromptMetadata as PromptMetadata from .runner_provider import RunnerProvider as RunnerProvider +from .breadcrumb_param import BreadcrumbParam as BreadcrumbParam +from .environment_role import EnvironmentRole as EnvironmentRole from .environment_spec import EnvironmentSpec as EnvironmentSpec from .id_token_version import IDTokenVersion as IDTokenVersion +from .prebuild_trigger import PrebuildTrigger as PrebuildTrigger from .project_metadata import ProjectMetadata as ProjectMetadata from .environment_phase import EnvironmentPhase as EnvironmentPhase +from .error_event_param import ErrorEventParam as ErrorEventParam from .event_list_params import EventListParams as EventListParams from .group_list_params import GroupListParams as GroupListParams from .organization_tier import OrganizationTier as OrganizationTier +from .prebuild_metadata import PrebuildMetadata as PrebuildMetadata from .runner_capability import RunnerCapability as RunnerCapability from .runner_spec_param import RunnerSpecParam as RunnerSpecParam +from .stack_frame_param import StackFrameParam as StackFrameParam from .account_membership import AccountMembership as AccountMembership +from .agent_code_context import AgentCodeContext as AgentCodeContext from .editor_list_params import EditorListParams as EditorListParams from .environment_status import EnvironmentStatus as EnvironmentStatus from .event_watch_params import EventWatchParams as EventWatchParams +from .request_info_param import RequestInfoParam as RequestInfoParam from .resource_operation import ResourceOperation as ResourceOperation from .runner_list_params import RunnerListParams as RunnerListParams from .secret_list_params import SecretListParams as SecretListParams from .secret_scope_param import SecretScopeParam as SecretScopeParam from .event_list_response import EventListResponse as EventListResponse from .gateway_list_params import GatewayListParams as GatewayListParams +from .group_create_params import GroupCreateParams as GroupCreateParams +from .group_delete_params import GroupDeleteParams as GroupDeleteParams +from .group_update_params import GroupUpdateParams as GroupUpdateParams from .organization_member import OrganizationMember as OrganizationMember +from .prebuild_spec_param import PrebuildSpecParam as PrebuildSpecParam from .project_list_params import ProjectListParams as ProjectListParams from .environment_metadata import EnvironmentMetadata as EnvironmentMetadata from .event_watch_response import EventWatchResponse as EventWatchResponse +from .exception_info_param import ExceptionInfoParam as ExceptionInfoParam from .invite_domains_param import InviteDomainsParam as InviteDomainsParam +from .prebuild_list_params import PrebuildListParams as PrebuildListParams from .runner_configuration import RunnerConfiguration as RunnerConfiguration from .runner_create_params import RunnerCreateParams as RunnerCreateParams from .runner_delete_params import RunnerDeleteParams as RunnerDeleteParams from .runner_update_params import RunnerUpdateParams as RunnerUpdateParams from .secret_create_params import SecretCreateParams as SecretCreateParams from .secret_delete_params import SecretDeleteParams as SecretDeleteParams +from .user_get_user_params import UserGetUserParams as UserGetUserParams from .account_delete_params import AccountDeleteParams as AccountDeleteParams +from .group_create_response import GroupCreateResponse as GroupCreateResponse +from .group_retrieve_params import GroupRetrieveParams as GroupRetrieveParams +from .group_update_response import GroupUpdateResponse as GroupUpdateResponse from .joinable_organization import JoinableOrganization as JoinableOrganization from .metrics_configuration import MetricsConfiguration as MetricsConfiguration from .project_create_params import ProjectCreateParams as ProjectCreateParams @@ -81,69 +117,107 @@ from .project_update_params import ProjectUpdateParams as ProjectUpdateParams from .editor_retrieve_params import EditorRetrieveParams as EditorRetrieveParams from .environment_spec_param import EnvironmentSpecParam as EnvironmentSpecParam +from .prebuild_cancel_params import PrebuildCancelParams as PrebuildCancelParams +from .prebuild_create_params import PrebuildCreateParams as PrebuildCreateParams +from .prebuild_delete_params import PrebuildDeleteParams as PrebuildDeleteParams from .runner_create_response import RunnerCreateResponse as RunnerCreateResponse from .runner_release_channel import RunnerReleaseChannel as RunnerReleaseChannel from .runner_retrieve_params import RunnerRetrieveParams as RunnerRetrieveParams from .secret_create_response import SecretCreateResponse as SecretCreateResponse +from .user_get_user_response import UserGetUserResponse as UserGetUserResponse +from .user_input_block_param import UserInputBlockParam as UserInputBlockParam from .account_retrieve_params import AccountRetrieveParams as AccountRetrieveParams from .environment_initializer import EnvironmentInitializer as EnvironmentInitializer from .environment_list_params import EnvironmentListParams as EnvironmentListParams from .environment_stop_params import EnvironmentStopParams as EnvironmentStopParams +from .group_retrieve_response import GroupRetrieveResponse as GroupRetrieveResponse from .project_create_response import ProjectCreateResponse as ProjectCreateResponse from .project_retrieve_params import ProjectRetrieveParams as ProjectRetrieveParams from .project_update_response import ProjectUpdateResponse as ProjectUpdateResponse from .secret_get_value_params import SecretGetValueParams as SecretGetValueParams +from .user_delete_user_params import UserDeleteUserParams as UserDeleteUserParams +from .agent_code_context_param import AgentCodeContextParam as AgentCodeContextParam from .editor_retrieve_response import EditorRetrieveResponse as EditorRetrieveResponse from .environment_start_params import EnvironmentStartParams as EnvironmentStartParams from .environment_usage_record import EnvironmentUsageRecord as EnvironmentUsageRecord from .organization_join_params import OrganizationJoinParams as OrganizationJoinParams +from .prebuild_cancel_response import PrebuildCancelResponse as PrebuildCancelResponse +from .prebuild_create_response import PrebuildCreateResponse as PrebuildCreateResponse +from .prebuild_retrieve_params import PrebuildRetrieveParams as PrebuildRetrieveParams from .runner_retrieve_response import RunnerRetrieveResponse as RunnerRetrieveResponse from .account_retrieve_response import AccountRetrieveResponse as AccountRetrieveResponse +from .agent_list_prompts_params import AgentListPromptsParams as AgentListPromptsParams from .editor_resolve_url_params import EditorResolveURLParams as EditorResolveURLParams from .environment_create_params import EnvironmentCreateParams as EnvironmentCreateParams from .environment_delete_params import EnvironmentDeleteParams as EnvironmentDeleteParams from .environment_update_params import EnvironmentUpdateParams as EnvironmentUpdateParams +from .exception_mechanism_param import ExceptionMechanismParam as ExceptionMechanismParam from .organization_leave_params import OrganizationLeaveParams as OrganizationLeaveParams -from .project_environment_class import ProjectEnvironmentClass as ProjectEnvironmentClass from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse from .secret_get_value_response import SecretGetValueResponse as SecretGetValueResponse from .user_set_suspended_params import UserSetSuspendedParams as UserSetSuspendedParams +from .agent_create_prompt_params import AgentCreatePromptParams as AgentCreatePromptParams +from .agent_delete_prompt_params import AgentDeletePromptParams as AgentDeletePromptParams +from .agent_update_prompt_params import AgentUpdatePromptParams as AgentUpdatePromptParams +from .error_report_errors_params import ErrorReportErrorsParams as ErrorReportErrorsParams from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams from .organization_delete_params import OrganizationDeleteParams as OrganizationDeleteParams from .organization_join_response import OrganizationJoinResponse as OrganizationJoinResponse from .organization_update_params import OrganizationUpdateParams as OrganizationUpdateParams +from .prebuild_retrieve_response import PrebuildRetrieveResponse as PrebuildRetrieveResponse from .runner_configuration_param import RunnerConfigurationParam as RunnerConfigurationParam from .secret_update_value_params import SecretUpdateValueParams as SecretUpdateValueParams +from .agent_stop_execution_params import AgentStopExecutionParams as AgentStopExecutionParams from .editor_resolve_url_response import EditorResolveURLResponse as EditorResolveURLResponse from .environment_activity_signal import EnvironmentActivitySignal as EnvironmentActivitySignal from .environment_create_response import EnvironmentCreateResponse as EnvironmentCreateResponse from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams from .metrics_configuration_param import MetricsConfigurationParam as MetricsConfigurationParam +from .agent_create_prompt_response import AgentCreatePromptResponse as AgentCreatePromptResponse +from .agent_list_executions_params import AgentListExecutionsParams as AgentListExecutionsParams +from .agent_retrieve_prompt_params import AgentRetrievePromptParams as AgentRetrievePromptParams +from .agent_start_execution_params import AgentStartExecutionParams as AgentStartExecutionParams +from .agent_update_prompt_response import AgentUpdatePromptResponse as AgentUpdatePromptResponse from .environment_unarchive_params import EnvironmentUnarchiveParams as EnvironmentUnarchiveParams from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams from .organization_create_response import OrganizationCreateResponse as OrganizationCreateResponse from .organization_retrieve_params import OrganizationRetrieveParams as OrganizationRetrieveParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams from .organization_update_response import OrganizationUpdateResponse as OrganizationUpdateResponse +from .agent_delete_execution_params import AgentDeleteExecutionParams as AgentDeleteExecutionParams from .environment_initializer_param import EnvironmentInitializerParam as EnvironmentInitializerParam from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse +from .account_list_sso_logins_params import AccountListSSOLoginsParams as AccountListSSOLoginsParams +from .agent_retrieve_prompt_response import AgentRetrievePromptResponse as AgentRetrievePromptResponse +from .agent_send_to_execution_params import AgentSendToExecutionParams as AgentSendToExecutionParams +from .agent_start_execution_response import AgentStartExecutionResponse as AgentStartExecutionResponse from .environment_mark_active_params import EnvironmentMarkActiveParams as EnvironmentMarkActiveParams from .identity_exchange_token_params import IdentityExchangeTokenParams as IdentityExchangeTokenParams from .identity_get_id_token_response import IdentityGetIDTokenResponse as IdentityGetIDTokenResponse from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse -from .project_environment_class_param import ProjectEnvironmentClassParam as ProjectEnvironmentClassParam +from .project_prebuild_configuration import ProjectPrebuildConfiguration as ProjectPrebuildConfiguration +from .agent_retrieve_execution_params import AgentRetrieveExecutionParams as AgentRetrieveExecutionParams +from .runner_create_logs_token_params import RunnerCreateLogsTokenParams as RunnerCreateLogsTokenParams from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams from .account_get_sso_login_url_params import AccountGetSSOLoginURLParams as AccountGetSSOLoginURLParams +from .account_list_sso_logins_response import AccountListSSOLoginsResponse as AccountListSSOLoginsResponse from .identity_exchange_token_response import IdentityExchangeTokenResponse as IdentityExchangeTokenResponse from .organization_list_members_params import OrganizationListMembersParams as OrganizationListMembersParams +from .agent_retrieve_execution_response import AgentRetrieveExecutionResponse as AgentRetrieveExecutionResponse from .environment_activity_signal_param import EnvironmentActivitySignalParam as EnvironmentActivitySignalParam +from .prebuild_create_logs_token_params import PrebuildCreateLogsTokenParams as PrebuildCreateLogsTokenParams +from .runner_create_logs_token_response import RunnerCreateLogsTokenResponse as RunnerCreateLogsTokenResponse from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse +from .runner_search_repositories_params import RunnerSearchRepositoriesParams as RunnerSearchRepositoriesParams from .account_get_sso_login_url_response import AccountGetSSOLoginURLResponse as AccountGetSSOLoginURLResponse from .user_get_authenticated_user_params import UserGetAuthenticatedUserParams as UserGetAuthenticatedUserParams from .account_list_login_providers_params import AccountListLoginProvidersParams as AccountListLoginProvidersParams +from .prebuild_create_logs_token_response import PrebuildCreateLogsTokenResponse as PrebuildCreateLogsTokenResponse from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse +from .runner_search_repositories_response import RunnerSearchRepositoriesResponse as RunnerSearchRepositoriesResponse from .environment_create_logs_token_params import EnvironmentCreateLogsTokenParams as EnvironmentCreateLogsTokenParams +from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam as ProjectPrebuildConfigurationParam from .user_get_authenticated_user_response import UserGetAuthenticatedUserResponse as UserGetAuthenticatedUserResponse from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, @@ -172,9 +246,6 @@ from .runner_check_authentication_for_host_params import ( RunnerCheckAuthenticationForHostParams as RunnerCheckAuthenticationForHostParams, ) -from .account_list_joinable_organizations_response import ( - AccountListJoinableOrganizationsResponse as AccountListJoinableOrganizationsResponse, -) from .identity_get_authenticated_identity_response import ( IdentityGetAuthenticatedIdentityResponse as IdentityGetAuthenticatedIdentityResponse, ) @@ -187,3 +258,9 @@ from .usage_list_environment_runtime_records_params import ( UsageListEnvironmentRuntimeRecordsParams as UsageListEnvironmentRuntimeRecordsParams, ) +from .agent_create_execution_conversation_token_params import ( + AgentCreateExecutionConversationTokenParams as AgentCreateExecutionConversationTokenParams, +) +from .agent_create_execution_conversation_token_response import ( + AgentCreateExecutionConversationTokenResponse as AgentCreateExecutionConversationTokenResponse, +) diff --git a/src/gitpod/types/account_delete_params.py b/src/gitpod/types/account_delete_params.py index a0491320..9b0ca700 100644 --- a/src/gitpod/types/account_delete_params.py +++ b/src/gitpod/types/account_delete_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -11,3 +12,6 @@ class AccountDeleteParams(TypedDict, total=False): account_id: Required[Annotated[str, PropertyInfo(alias="accountId")]] + + reason: Optional[str] + """reason is an optional field for the reason for account deletion""" diff --git a/src/gitpod/types/account_list_joinable_organizations_params.py b/src/gitpod/types/account_list_joinable_organizations_params.py index d4531fb7..8550eb06 100644 --- a/src/gitpod/types/account_list_joinable_organizations_params.py +++ b/src/gitpod/types/account_list_joinable_organizations_params.py @@ -6,7 +6,7 @@ from .._utils import PropertyInfo -__all__ = ["AccountListJoinableOrganizationsParams"] +__all__ = ["AccountListJoinableOrganizationsParams", "Pagination"] class AccountListJoinableOrganizationsParams(TypedDict, total=False): @@ -14,4 +14,21 @@ class AccountListJoinableOrganizationsParams(TypedDict, total=False): page_size: Annotated[int, PropertyInfo(alias="pageSize")] - empty: bool + pagination: Pagination + """pagination contains the pagination options for listing joinable organizations""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing joinable organizations""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/account_list_joinable_organizations_response.py b/src/gitpod/types/account_list_joinable_organizations_response.py deleted file mode 100644 index 3253ba5c..00000000 --- a/src/gitpod/types/account_list_joinable_organizations_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel -from .joinable_organization import JoinableOrganization - -__all__ = ["AccountListJoinableOrganizationsResponse"] - - -class AccountListJoinableOrganizationsResponse(BaseModel): - joinable_organizations: Optional[List[JoinableOrganization]] = FieldInfo( - alias="joinableOrganizations", default=None - ) diff --git a/src/gitpod/types/account_list_login_providers_params.py b/src/gitpod/types/account_list_login_providers_params.py index 87a93493..badbfe8e 100644 --- a/src/gitpod/types/account_list_login_providers_params.py +++ b/src/gitpod/types/account_list_login_providers_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -24,7 +25,10 @@ class AccountListLoginProvidersParams(TypedDict, total=False): class Filter(TypedDict, total=False): """filter contains the filter options for listing login methods""" - invite_id: Annotated[str, PropertyInfo(alias="inviteId")] + email: Optional[str] + """email is the email address to filter SSO providers by""" + + invite_id: Annotated[Optional[str], PropertyInfo(alias="inviteId")] """invite_id is the ID of the invite URL the user wants to login with""" diff --git a/src/gitpod/types/account_list_sso_logins_params.py b/src/gitpod/types/account_list_sso_logins_params.py new file mode 100644 index 00000000..970e6ba4 --- /dev/null +++ b/src/gitpod/types/account_list_sso_logins_params.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AccountListSSOLoginsParams", "Pagination"] + + +class AccountListSSOLoginsParams(TypedDict, total=False): + email: Required[str] + """email is the email the user wants to login with""" + + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + pagination: Pagination + """pagination contains the pagination options for listing SSO logins""" + + return_to: Annotated[Optional[str], PropertyInfo(alias="returnTo")] + """return_to is the URL the user will be redirected to after login""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing SSO logins""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/account_list_sso_logins_response.py b/src/gitpod/types/account_list_sso_logins_response.py new file mode 100644 index 00000000..253f0f87 --- /dev/null +++ b/src/gitpod/types/account_list_sso_logins_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AccountListSSOLoginsResponse"] + + +class AccountListSSOLoginsResponse(BaseModel): + display_name: str = FieldInfo(alias="displayName") + """provider is the provider used by this login method, e.g. + + "github", "google", "custom" + """ + + login_url: str = FieldInfo(alias="loginUrl") + """login_url is the URL to redirect the user to for SSO login""" diff --git a/src/gitpod/types/agent_code_context.py b/src/gitpod/types/agent_code_context.py new file mode 100644 index 00000000..05c18322 --- /dev/null +++ b/src/gitpod/types/agent_code_context.py @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AgentCodeContext", "ContextURL", "PullRequest", "PullRequestRepository"] + + +class ContextURL(BaseModel): + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + + url: Optional[str] = None + + +class PullRequestRepository(BaseModel): + """Repository information""" + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + + host: Optional[str] = None + + name: Optional[str] = None + + owner: Optional[str] = None + + +class PullRequest(BaseModel): + """ + Pull request context - optional metadata about the PR being worked on + This is populated when the agent execution is triggered by a PR workflow + or when explicitly provided through the browser extension + """ + + id: Optional[str] = None + """Unique identifier from the source system (e.g., "123" for GitHub PR #123)""" + + author: Optional[str] = None + """Author name as provided by the SCM system""" + + from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None) + """Source branch name (the branch being merged from)""" + + repository: Optional[PullRequestRepository] = None + """Repository information""" + + title: Optional[str] = None + """Pull request title""" + + to_branch: Optional[str] = FieldInfo(alias="toBranch", default=None) + """Target branch name (the branch being merged into)""" + + url: Optional[str] = None + """Pull request URL (e.g., "https://github.com/owner/repo/pull/123")""" + + +class AgentCodeContext(BaseModel): + context_url: Optional[ContextURL] = FieldInfo(alias="contextUrl", default=None) + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + + pull_request: Optional[PullRequest] = FieldInfo(alias="pullRequest", default=None) + """ + Pull request context - optional metadata about the PR being worked on This is + populated when the agent execution is triggered by a PR workflow or when + explicitly provided through the browser extension + """ diff --git a/src/gitpod/types/agent_code_context_param.py b/src/gitpod/types/agent_code_context_param.py new file mode 100644 index 00000000..8080145f --- /dev/null +++ b/src/gitpod/types/agent_code_context_param.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentCodeContextParam", "ContextURL", "PullRequest", "PullRequestRepository"] + + +class ContextURL(TypedDict, total=False): + environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] + + url: str + + +class PullRequestRepository(TypedDict, total=False): + """Repository information""" + + clone_url: Annotated[str, PropertyInfo(alias="cloneUrl")] + + host: str + + name: str + + owner: str + + +class PullRequest(TypedDict, total=False): + """ + Pull request context - optional metadata about the PR being worked on + This is populated when the agent execution is triggered by a PR workflow + or when explicitly provided through the browser extension + """ + + id: str + """Unique identifier from the source system (e.g., "123" for GitHub PR #123)""" + + author: str + """Author name as provided by the SCM system""" + + from_branch: Annotated[str, PropertyInfo(alias="fromBranch")] + """Source branch name (the branch being merged from)""" + + repository: PullRequestRepository + """Repository information""" + + title: str + """Pull request title""" + + to_branch: Annotated[str, PropertyInfo(alias="toBranch")] + """Target branch name (the branch being merged into)""" + + url: str + """Pull request URL (e.g., "https://github.com/owner/repo/pull/123")""" + + +class AgentCodeContextParam(TypedDict, total=False): + context_url: Annotated[ContextURL, PropertyInfo(alias="contextUrl")] + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + + pull_request: Annotated[Optional[PullRequest], PropertyInfo(alias="pullRequest")] + """ + Pull request context - optional metadata about the PR being worked on This is + populated when the agent execution is triggered by a PR workflow or when + explicitly provided through the browser extension + """ diff --git a/src/gitpod/types/agent_create_execution_conversation_token_params.py b/src/gitpod/types/agent_create_execution_conversation_token_params.py new file mode 100644 index 00000000..68a8988a --- /dev/null +++ b/src/gitpod/types/agent_create_execution_conversation_token_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentCreateExecutionConversationTokenParams"] + + +class AgentCreateExecutionConversationTokenParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] diff --git a/src/gitpod/types/agent_create_execution_conversation_token_response.py b/src/gitpod/types/agent_create_execution_conversation_token_response.py new file mode 100644 index 00000000..395ddfb7 --- /dev/null +++ b/src/gitpod/types/agent_create_execution_conversation_token_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["AgentCreateExecutionConversationTokenResponse"] + + +class AgentCreateExecutionConversationTokenResponse(BaseModel): + token: Optional[str] = None diff --git a/src/gitpod/types/agent_create_prompt_params.py b/src/gitpod/types/agent_create_prompt_params.py new file mode 100644 index 00000000..c5b22317 --- /dev/null +++ b/src/gitpod/types/agent_create_prompt_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentCreatePromptParams"] + + +class AgentCreatePromptParams(TypedDict, total=False): + command: str + + description: str + + is_command: Annotated[bool, PropertyInfo(alias="isCommand")] + + is_template: Annotated[bool, PropertyInfo(alias="isTemplate")] + + name: str + + prompt: str diff --git a/src/gitpod/types/agent_create_prompt_response.py b/src/gitpod/types/agent_create_prompt_response.py new file mode 100644 index 00000000..ef5b625b --- /dev/null +++ b/src/gitpod/types/agent_create_prompt_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .prompt import Prompt +from .._models import BaseModel + +__all__ = ["AgentCreatePromptResponse"] + + +class AgentCreatePromptResponse(BaseModel): + prompt: Optional[Prompt] = None diff --git a/src/gitpod/types/agent_delete_execution_params.py b/src/gitpod/types/agent_delete_execution_params.py new file mode 100644 index 00000000..f5590561 --- /dev/null +++ b/src/gitpod/types/agent_delete_execution_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentDeleteExecutionParams"] + + +class AgentDeleteExecutionParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] diff --git a/src/gitpod/types/agent_delete_prompt_params.py b/src/gitpod/types/agent_delete_prompt_params.py new file mode 100644 index 00000000..f6cffb7e --- /dev/null +++ b/src/gitpod/types/agent_delete_prompt_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentDeletePromptParams"] + + +class AgentDeletePromptParams(TypedDict, total=False): + prompt_id: Annotated[str, PropertyInfo(alias="promptId")] diff --git a/src/gitpod/types/agent_execution.py b/src/gitpod/types/agent_execution.py new file mode 100644 index 00000000..384da908 --- /dev/null +++ b/src/gitpod/types/agent_execution.py @@ -0,0 +1,439 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .agent_mode import AgentMode +from .shared.subject import Subject +from .agent_code_context import AgentCodeContext + +__all__ = [ + "AgentExecution", + "Metadata", + "Spec", + "SpecLimits", + "Status", + "StatusCurrentOperation", + "StatusCurrentOperationLlm", + "StatusCurrentOperationToolUse", + "StatusOutputs", + "StatusUsedEnvironment", +] + + +class Metadata(BaseModel): + """ + Metadata is data associated with this agent that's required for other + parts of Gitpod to function + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[Subject] = None + + description: Optional[str] = None + + name: Optional[str] = None + + role: Optional[ + Literal["AGENT_EXECUTION_ROLE_UNSPECIFIED", "AGENT_EXECUTION_ROLE_DEFAULT", "AGENT_EXECUTION_ROLE_WORKFLOW"] + ] = None + """role is the role of the agent execution""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + workflow_action_id: Optional[str] = FieldInfo(alias="workflowActionId", default=None) + """ + workflow_action_id is set when this agent execution was created as part of a + workflow. Used to correlate agent executions with their parent workflow + execution action. + """ + + +class SpecLimits(BaseModel): + max_input_tokens: Optional[str] = FieldInfo(alias="maxInputTokens", default=None) + + max_iterations: Optional[str] = FieldInfo(alias="maxIterations", default=None) + + max_output_tokens: Optional[str] = FieldInfo(alias="maxOutputTokens", default=None) + + +class Spec(BaseModel): + """ + Spec is the configuration of the agent that's required for the + runner to start the agent + """ + + agent_id: Optional[str] = FieldInfo(alias="agentId", default=None) + + code_context: Optional[AgentCodeContext] = FieldInfo(alias="codeContext", default=None) + + desired_phase: Optional[ + Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", "PHASE_WAITING_FOR_INPUT", "PHASE_STOPPED"] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the desired phase of the agent run""" + + limits: Optional[SpecLimits] = None + + mode: Optional[AgentMode] = None + """mode is the operational mode for this agent execution""" + + session: Optional[str] = None + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + +class StatusCurrentOperationLlm(BaseModel): + complete: Optional[bool] = None + + +class StatusCurrentOperationToolUse(BaseModel): + complete: Optional[bool] = None + + tool_name: Optional[str] = FieldInfo(alias="toolName", default=None) + + +class StatusCurrentOperation(BaseModel): + """current_operation is the current operation of the agent execution.""" + + llm: Optional[StatusCurrentOperationLlm] = None + + retries: Optional[str] = None + """retries is the number of times the agent run has retried one or more steps""" + + session: Optional[str] = None + + tool_use: Optional[StatusCurrentOperationToolUse] = FieldInfo(alias="toolUse", default=None) + + +class StatusOutputs(BaseModel): + bool_value: Optional[bool] = FieldInfo(alias="boolValue", default=None) + + float_value: Optional[float] = FieldInfo(alias="floatValue", default=None) + + int_value: Optional[str] = FieldInfo(alias="intValue", default=None) + + string_value: Optional[str] = FieldInfo(alias="stringValue", default=None) + + +class StatusUsedEnvironment(BaseModel): + created_by_agent: Optional[bool] = FieldInfo(alias="createdByAgent", default=None) + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + +class Status(BaseModel): + """Status is the current status of the agent""" + + cached_creation_tokens_used: Optional[str] = FieldInfo(alias="cachedCreationTokensUsed", default=None) + + cached_input_tokens_used: Optional[str] = FieldInfo(alias="cachedInputTokensUsed", default=None) + + context_window_length: Optional[str] = FieldInfo(alias="contextWindowLength", default=None) + + conversation_url: Optional[str] = FieldInfo(alias="conversationUrl", default=None) + """ + conversation_url is the URL to the conversation (all messages exchanged between + the agent and the user) of the agent run. + """ + + current_activity: Optional[str] = FieldInfo(alias="currentActivity", default=None) + """current_activity is the current activity description of the agent execution.""" + + current_operation: Optional[StatusCurrentOperation] = FieldInfo(alias="currentOperation", default=None) + """current_operation is the current operation of the agent execution.""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the agent run failed to operate.""" + + failure_reason: Optional[ + Literal[ + "AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED", + "AGENT_EXECUTION_FAILURE_REASON_ENVIRONMENT", + "AGENT_EXECUTION_FAILURE_REASON_SERVICE", + "AGENT_EXECUTION_FAILURE_REASON_LLM_INTEGRATION", + "AGENT_EXECUTION_FAILURE_REASON_INTERNAL", + "AGENT_EXECUTION_FAILURE_REASON_AGENT_EXECUTION", + ] + ] = FieldInfo(alias="failureReason", default=None) + """failure_reason contains a structured reason code for the failure.""" + + input_tokens_used: Optional[str] = FieldInfo(alias="inputTokensUsed", default=None) + + iterations: Optional[str] = None + + judgement: Optional[str] = None + """judgement is the judgement of the agent run produced by the judgement prompt.""" + + outputs: Optional[Dict[str, StatusOutputs]] = None + """ + outputs is a map of key-value pairs that can be set by the agent during + execution. Similar to task execution outputs, but with typed values for + structured data. + """ + + output_tokens_used: Optional[str] = FieldInfo(alias="outputTokensUsed", default=None) + + phase: Optional[ + Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", "PHASE_WAITING_FOR_INPUT", "PHASE_STOPPED"] + ] = None + + session: Optional[str] = None + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """version of the status. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.status_version < + b.status_version then a was the status before b. + """ + + supported_model: Optional[ + Literal[ + "SUPPORTED_MODEL_UNSPECIFIED", + "SUPPORTED_MODEL_SONNET_3_5", + "SUPPORTED_MODEL_SONNET_3_7", + "SUPPORTED_MODEL_SONNET_3_7_EXTENDED", + "SUPPORTED_MODEL_SONNET_4", + "SUPPORTED_MODEL_SONNET_4_EXTENDED", + "SUPPORTED_MODEL_SONNET_4_5", + "SUPPORTED_MODEL_SONNET_4_5_EXTENDED", + "SUPPORTED_MODEL_OPUS_4", + "SUPPORTED_MODEL_OPUS_4_EXTENDED", + "SUPPORTED_MODEL_OPUS_4_5", + "SUPPORTED_MODEL_OPUS_4_5_EXTENDED", + "SUPPORTED_MODEL_OPENAI_4O", + "SUPPORTED_MODEL_OPENAI_4O_MINI", + "SUPPORTED_MODEL_OPENAI_O1", + "SUPPORTED_MODEL_OPENAI_O1_MINI", + ] + ] = FieldInfo(alias="supportedModel", default=None) + """supported_model is the LLM model being used by the agent execution.""" + + transcript_url: Optional[str] = FieldInfo(alias="transcriptUrl", default=None) + """ + transcript_url is the URL to the LLM transcript (all messages exchanged between + the agent and the LLM) of the agent run. + """ + + used_environments: Optional[List[StatusUsedEnvironment]] = FieldInfo(alias="usedEnvironments", default=None) + """ + used_environments is the list of environments that were used by the agent + execution. + """ + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. when the LLM is overloaded.""" + + +class AgentExecution(BaseModel): + id: Optional[str] = None + """ID is a unique identifier of this agent run. + + No other agent run with the same name must be managed by this agent manager + """ + + metadata: Optional[Metadata] = None + """ + Metadata is data associated with this agent that's required for other parts of + Gitpod to function + """ + + spec: Optional[Spec] = None + """ + Spec is the configuration of the agent that's required for the runner to start + the agent + """ + + status: Optional[Status] = None + """Status is the current status of the agent""" diff --git a/src/gitpod/types/agent_list_executions_params.py b/src/gitpod/types/agent_list_executions_params.py new file mode 100644 index 00000000..3a613411 --- /dev/null +++ b/src/gitpod/types/agent_list_executions_params.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = ["AgentListExecutionsParams", "Filter", "Pagination"] + + +class AgentListExecutionsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + + +class Filter(TypedDict, total=False): + agent_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="agentIds")] + + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] + + environment_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentIds")] + + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] + + roles: List[ + Literal["AGENT_EXECUTION_ROLE_UNSPECIFIED", "AGENT_EXECUTION_ROLE_DEFAULT", "AGENT_EXECUTION_ROLE_WORKFLOW"] + ] + + status_phases: Annotated[ + List[ + Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", "PHASE_WAITING_FOR_INPUT", "PHASE_STOPPED"] + ], + PropertyInfo(alias="statusPhases"), + ] + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/agent_list_prompts_params.py b/src/gitpod/types/agent_list_prompts_params.py new file mode 100644 index 00000000..9756b72a --- /dev/null +++ b/src/gitpod/types/agent_list_prompts_params.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentListPromptsParams", "Filter", "Pagination"] + + +class AgentListPromptsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + + +class Filter(TypedDict, total=False): + command: str + + command_prefix: Annotated[str, PropertyInfo(alias="commandPrefix")] + + is_command: Annotated[bool, PropertyInfo(alias="isCommand")] + + is_template: Annotated[bool, PropertyInfo(alias="isTemplate")] + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/agent_mode.py b/src/gitpod/types/agent_mode.py new file mode 100644 index 00000000..de414c76 --- /dev/null +++ b/src/gitpod/types/agent_mode.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["AgentMode"] + +AgentMode: TypeAlias = Literal["AGENT_MODE_UNSPECIFIED", "AGENT_MODE_EXECUTION", "AGENT_MODE_PLANNING"] diff --git a/src/gitpod/types/agent_retrieve_execution_params.py b/src/gitpod/types/agent_retrieve_execution_params.py new file mode 100644 index 00000000..22c896b9 --- /dev/null +++ b/src/gitpod/types/agent_retrieve_execution_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentRetrieveExecutionParams"] + + +class AgentRetrieveExecutionParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] diff --git a/src/gitpod/types/agent_retrieve_execution_response.py b/src/gitpod/types/agent_retrieve_execution_response.py new file mode 100644 index 00000000..b66ad83f --- /dev/null +++ b/src/gitpod/types/agent_retrieve_execution_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .agent_execution import AgentExecution + +__all__ = ["AgentRetrieveExecutionResponse"] + + +class AgentRetrieveExecutionResponse(BaseModel): + agent_execution: Optional[AgentExecution] = FieldInfo(alias="agentExecution", default=None) diff --git a/src/gitpod/types/agent_retrieve_prompt_params.py b/src/gitpod/types/agent_retrieve_prompt_params.py new file mode 100644 index 00000000..c8dcd123 --- /dev/null +++ b/src/gitpod/types/agent_retrieve_prompt_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentRetrievePromptParams"] + + +class AgentRetrievePromptParams(TypedDict, total=False): + prompt_id: Annotated[str, PropertyInfo(alias="promptId")] diff --git a/src/gitpod/types/agent_retrieve_prompt_response.py b/src/gitpod/types/agent_retrieve_prompt_response.py new file mode 100644 index 00000000..621f5dc2 --- /dev/null +++ b/src/gitpod/types/agent_retrieve_prompt_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .prompt import Prompt +from .._models import BaseModel + +__all__ = ["AgentRetrievePromptResponse"] + + +class AgentRetrievePromptResponse(BaseModel): + prompt: Optional[Prompt] = None diff --git a/src/gitpod/types/agent_send_to_execution_params.py b/src/gitpod/types/agent_send_to_execution_params.py new file mode 100644 index 00000000..27c14294 --- /dev/null +++ b/src/gitpod/types/agent_send_to_execution_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .user_input_block_param import UserInputBlockParam + +__all__ = ["AgentSendToExecutionParams"] + + +class AgentSendToExecutionParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] + + user_input: Annotated[UserInputBlockParam, PropertyInfo(alias="userInput")] diff --git a/src/gitpod/types/agent_start_execution_params.py b/src/gitpod/types/agent_start_execution_params.py new file mode 100644 index 00000000..b021f7ed --- /dev/null +++ b/src/gitpod/types/agent_start_execution_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .agent_mode import AgentMode +from .agent_code_context_param import AgentCodeContextParam + +__all__ = ["AgentStartExecutionParams"] + + +class AgentStartExecutionParams(TypedDict, total=False): + agent_id: Annotated[str, PropertyInfo(alias="agentId")] + + code_context: Annotated[AgentCodeContextParam, PropertyInfo(alias="codeContext")] + + mode: AgentMode + """ + mode specifies the operational mode for this agent execution If not specified, + defaults to AGENT_MODE_EXECUTION + """ + + name: str + + workflow_action_id: Annotated[Optional[str], PropertyInfo(alias="workflowActionId")] + """ + workflow_action_id is an optional reference to the workflow execution action + that created this agent execution. Used for tracking and event correlation. + """ diff --git a/src/gitpod/types/agent_start_execution_response.py b/src/gitpod/types/agent_start_execution_response.py new file mode 100644 index 00000000..d8561792 --- /dev/null +++ b/src/gitpod/types/agent_start_execution_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AgentStartExecutionResponse"] + + +class AgentStartExecutionResponse(BaseModel): + agent_execution_id: Optional[str] = FieldInfo(alias="agentExecutionId", default=None) diff --git a/src/gitpod/types/agent_stop_execution_params.py b/src/gitpod/types/agent_stop_execution_params.py new file mode 100644 index 00000000..ec765d11 --- /dev/null +++ b/src/gitpod/types/agent_stop_execution_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentStopExecutionParams"] + + +class AgentStopExecutionParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] diff --git a/src/gitpod/types/agent_update_prompt_params.py b/src/gitpod/types/agent_update_prompt_params.py new file mode 100644 index 00000000..8d5e292b --- /dev/null +++ b/src/gitpod/types/agent_update_prompt_params.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentUpdatePromptParams", "Metadata", "Spec"] + + +class AgentUpdatePromptParams(TypedDict, total=False): + metadata: Optional[Metadata] + """Metadata updates""" + + prompt_id: Annotated[str, PropertyInfo(alias="promptId")] + """The ID of the prompt to update""" + + spec: Optional[Spec] + """Spec updates""" + + +class Metadata(TypedDict, total=False): + """Metadata updates""" + + description: Optional[str] + """A description of what the prompt does""" + + name: Optional[str] + """The name of the prompt""" + + +class Spec(TypedDict, total=False): + """Spec updates""" + + command: Optional[str] + """The command string (unique within organization)""" + + is_command: Annotated[Optional[bool], PropertyInfo(alias="isCommand")] + """Whether this prompt is a command""" + + is_template: Annotated[Optional[bool], PropertyInfo(alias="isTemplate")] + """Whether this prompt is a template""" + + prompt: Optional[str] + """The prompt content""" diff --git a/src/gitpod/types/agent_update_prompt_response.py b/src/gitpod/types/agent_update_prompt_response.py new file mode 100644 index 00000000..353a4ca9 --- /dev/null +++ b/src/gitpod/types/agent_update_prompt_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .prompt import Prompt +from .._models import BaseModel + +__all__ = ["AgentUpdatePromptResponse"] + + +class AgentUpdatePromptResponse(BaseModel): + prompt: Optional[Prompt] = None diff --git a/src/gitpod/types/breadcrumb_param.py b/src/gitpod/types/breadcrumb_param.py new file mode 100644 index 00000000..cef8444d --- /dev/null +++ b/src/gitpod/types/breadcrumb_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .error_level import ErrorLevel + +__all__ = ["BreadcrumbParam"] + + +class BreadcrumbParam(TypedDict, total=False): + """Breadcrumb information (Sentry-compatible)""" + + category: str + """Breadcrumb category""" + + data: Dict[str, str] + """Additional breadcrumb data""" + + level: ErrorLevel + """Breadcrumb level""" + + message: str + """Breadcrumb message""" + + timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """When the breadcrumb occurred""" + + type: str + """Breadcrumb type (e.g., "navigation", "http", "user", "error")""" diff --git a/src/gitpod/types/editor.py b/src/gitpod/types/editor.py index 96eebfa8..1d05f8f4 100644 --- a/src/gitpod/types/editor.py +++ b/src/gitpod/types/editor.py @@ -1,10 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from pydantic import Field as FieldInfo from .._models import BaseModel +from .editor_version import EditorVersion __all__ = ["Editor"] @@ -23,3 +24,6 @@ class Editor(BaseModel): icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) + + versions: Optional[List[EditorVersion]] = None + """versions contains the list of available versions for this editor""" diff --git a/src/gitpod/types/editor_resolve_url_params.py b/src/gitpod/types/editor_resolve_url_params.py index de698ba0..2ddfd2ab 100644 --- a/src/gitpod/types/editor_resolve_url_params.py +++ b/src/gitpod/types/editor_resolve_url_params.py @@ -18,3 +18,11 @@ class EditorResolveURLParams(TypedDict, total=False): organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organizationId is the ID of the organization to resolve the URL for""" + + version: str + """ + version is the editor version to use If not provided, the latest version will be + installed + + Examples for JetBrains: 2025.2 + """ diff --git a/src/gitpod/types/editor_version.py b/src/gitpod/types/editor_version.py new file mode 100644 index 00000000..0f9637fb --- /dev/null +++ b/src/gitpod/types/editor_version.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["EditorVersion"] + + +class EditorVersion(BaseModel): + version: str + """version is the version string of the editor Examples for JetBrains: 2025.2""" diff --git a/src/gitpod/types/environment_initializer.py b/src/gitpod/types/environment_initializer.py index 17d42ca5..12f6ef29 100644 --- a/src/gitpod/types/environment_initializer.py +++ b/src/gitpod/types/environment_initializer.py @@ -34,6 +34,7 @@ class SpecGit(BaseModel): "CLONE_TARGET_MODE_REMOTE_COMMIT", "CLONE_TARGET_MODE_REMOTE_BRANCH", "CLONE_TARGET_MODE_LOCAL_BRANCH", + "CLONE_TARGET_MODE_REMOTE_TAG", ] ] = FieldInfo(alias="targetMode", default=None) """the target mode determines what gets checked out""" diff --git a/src/gitpod/types/environment_initializer_param.py b/src/gitpod/types/environment_initializer_param.py index b9a8a978..3e54419a 100644 --- a/src/gitpod/types/environment_initializer_param.py +++ b/src/gitpod/types/environment_initializer_param.py @@ -34,6 +34,7 @@ class SpecGit(TypedDict, total=False): "CLONE_TARGET_MODE_REMOTE_COMMIT", "CLONE_TARGET_MODE_REMOTE_BRANCH", "CLONE_TARGET_MODE_LOCAL_BRANCH", + "CLONE_TARGET_MODE_REMOTE_TAG", ], PropertyInfo(alias="targetMode"), ] diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index e0ff12ed..0b5d21a1 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -2,12 +2,14 @@ from __future__ import annotations -from typing import List, Optional +from typing import List, Union, Optional +from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict from .._types import SequenceNotStr from .._utils import PropertyInfo from .runner_kind import RunnerKind +from .environment_role import EnvironmentRole from .environment_phase import EnvironmentPhase __all__ = ["EnvironmentListParams", "Filter", "Pagination"] @@ -38,6 +40,9 @@ class Filter(TypedDict, total=False): ] """archival_status filters the response based on environment archive status""" + created_before: Annotated[Union[str, datetime, None], PropertyInfo(alias="createdBefore", format="iso8601")] + """created_before filters environments created before this timestamp""" + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] """ creator_ids filters the response to only Environments created by specified @@ -50,6 +55,9 @@ class Filter(TypedDict, total=False): specified projects """ + roles: List[EnvironmentRole] + """roles filters the response to only Environments with the specified roles""" + runner_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="runnerIds")] """ runner_ids filters the response to only Environments running on these Runner IDs diff --git a/src/gitpod/types/environment_metadata.py b/src/gitpod/types/environment_metadata.py index 38cb520a..302dded8 100644 --- a/src/gitpod/types/environment_metadata.py +++ b/src/gitpod/types/environment_metadata.py @@ -7,6 +7,7 @@ from .._models import BaseModel from .shared.subject import Subject +from .environment_role import EnvironmentRole __all__ = ["EnvironmentMetadata"] @@ -53,11 +54,20 @@ class EnvironmentMetadata(BaseModel): created """ + prebuild_id: Optional[str] = FieldInfo(alias="prebuildId", default=None) + """ + prebuild_id is the ID of the prebuild this environment was created from. Only + set if the environment was created from a prebuild. + """ + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) """ If the Environment was started from a project, the project_id will reference the project. """ + role: Optional[EnvironmentRole] = None + """role is the role of the environment""" + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) """Runner is the ID of the runner that runs this environment.""" diff --git a/src/gitpod/types/environment_role.py b/src/gitpod/types/environment_role.py new file mode 100644 index 00000000..2dd22df2 --- /dev/null +++ b/src/gitpod/types/environment_role.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["EnvironmentRole"] + +EnvironmentRole: TypeAlias = Literal[ + "ENVIRONMENT_ROLE_UNSPECIFIED", "ENVIRONMENT_ROLE_DEFAULT", "ENVIRONMENT_ROLE_PREBUILD", "ENVIRONMENT_ROLE_WORKFLOW" +] diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index 3e14a5a6..679336f4 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -8,6 +9,7 @@ from .admission_level import AdmissionLevel from .environment_phase import EnvironmentPhase from .environment_initializer import EnvironmentInitializer +from .shared.automation_trigger import AutomationTrigger __all__ = [ "EnvironmentSpec", @@ -39,6 +41,13 @@ class AutomationsFile(BaseModel): session: Optional[str] = None + trigger_filter: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggerFilter", default=None) + """ + trigger_filter specifies which automation triggers should execute. When set, + only automations matching these triggers will run. If empty/unset, all triggers + are evaluated normally. + """ + class Content(BaseModel): """content is the content spec of the environment""" @@ -84,6 +93,14 @@ class Devcontainer(BaseModel): dotfiles: Optional[DevcontainerDotfiles] = None """Experimental: dotfiles is the dotfiles configuration of the devcontainer""" + lifecycle_stage: Optional[ + Literal["LIFECYCLE_STAGE_UNSPECIFIED", "LIFECYCLE_STAGE_FULL", "LIFECYCLE_STAGE_PREBUILD"] + ] = FieldInfo(alias="lifecycleStage", default=None) + """ + lifecycle_stage controls which devcontainer lifecycle commands are executed. + Defaults to FULL if not specified. + """ + session: Optional[str] = None @@ -106,11 +123,24 @@ class Port(BaseModel): port: Optional[int] = None """port number""" + protocol: Optional[Literal["PROTOCOL_UNSPECIFIED", "PROTOCOL_HTTP", "PROTOCOL_HTTPS"]] = None + """ + protocol for communication (Gateway proxy → user environment service). this + setting only affects the protocol used between Gateway and user environment + services. + """ + class Secret(BaseModel): id: Optional[str] = None """id is the unique identifier of the secret.""" + api_only: Optional[bool] = FieldInfo(alias="apiOnly", default=None) + """ + api_only indicates the secret is only available via API/CLI. These secrets are + resolved but NOT automatically injected into services or devcontainers. + """ + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) """ container_registry_basic_auth_host is the hostname of the container registry @@ -183,7 +213,7 @@ class EnvironmentSpec(BaseModel): """machine is the machine spec of the environment""" ports: Optional[List[Port]] = None - """ports is the set of ports which ought to be exposed to the internet""" + """ports is the set of ports which ought to be exposed to your network""" secrets: Optional[List[Secret]] = None """secrets are confidential data that is mounted into the environment""" @@ -201,3 +231,9 @@ class EnvironmentSpec(BaseModel): timeout: Optional[Timeout] = None """Timeout configures the environment timeout""" + + workflow_action_id: Optional[str] = FieldInfo(alias="workflowActionId", default=None) + """ + workflow_action_id is an optional reference to the workflow execution action + that created this environment. Used for tracking and event correlation. + """ diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index e2fb03ce..3c10dbd3 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Required, Annotated, TypedDict +from typing import Iterable, Optional +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo from .admission_level import AdmissionLevel from .environment_phase import EnvironmentPhase from .environment_initializer_param import EnvironmentInitializerParam +from .shared_params.automation_trigger import AutomationTrigger __all__ = [ "EnvironmentSpecParam", @@ -40,6 +41,13 @@ class AutomationsFile(TypedDict, total=False): session: str + trigger_filter: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggerFilter")] + """ + trigger_filter specifies which automation triggers should execute. When set, + only automations matching these triggers will run. If empty/unset, all triggers + are evaluated normally. + """ + class Content(TypedDict, total=False): """content is the content spec of the environment""" @@ -85,6 +93,15 @@ class Devcontainer(TypedDict, total=False): dotfiles: DevcontainerDotfiles """Experimental: dotfiles is the dotfiles configuration of the devcontainer""" + lifecycle_stage: Annotated[ + Literal["LIFECYCLE_STAGE_UNSPECIFIED", "LIFECYCLE_STAGE_FULL", "LIFECYCLE_STAGE_PREBUILD"], + PropertyInfo(alias="lifecycleStage"), + ] + """ + lifecycle_stage controls which devcontainer lifecycle commands are executed. + Defaults to FULL if not specified. + """ + session: str @@ -113,11 +130,24 @@ class Port(TypedDict, total=False): port: int """port number""" + protocol: Literal["PROTOCOL_UNSPECIFIED", "PROTOCOL_HTTP", "PROTOCOL_HTTPS"] + """ + protocol for communication (Gateway proxy → user environment service). this + setting only affects the protocol used between Gateway and user environment + services. + """ + class Secret(TypedDict, total=False): id: str """id is the unique identifier of the secret.""" + api_only: Annotated[bool, PropertyInfo(alias="apiOnly")] + """ + api_only indicates the secret is only available via API/CLI. These secrets are + resolved but NOT automatically injected into services or devcontainers. + """ + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] """ container_registry_basic_auth_host is the hostname of the container registry @@ -190,7 +220,7 @@ class EnvironmentSpecParam(TypedDict, total=False): """machine is the machine spec of the environment""" ports: Iterable[Port] - """ports is the set of ports which ought to be exposed to the internet""" + """ports is the set of ports which ought to be exposed to your network""" secrets: Iterable[Secret] """secrets are confidential data that is mounted into the environment""" @@ -208,3 +238,9 @@ class EnvironmentSpecParam(TypedDict, total=False): timeout: Timeout """Timeout configures the environment timeout""" + + workflow_action_id: Annotated[Optional[str], PropertyInfo(alias="workflowActionId")] + """ + workflow_action_id is an optional reference to the workflow execution action + that created this environment. Used for tracking and event correlation. + """ diff --git a/src/gitpod/types/environment_status.py b/src/gitpod/types/environment_status.py index aae1b3a4..45ad12ca 100644 --- a/src/gitpod/types/environment_status.py +++ b/src/gitpod/types/environment_status.py @@ -58,6 +58,7 @@ class AutomationsFile(BaseModel): "CONTENT_PHASE_READY", "CONTENT_PHASE_UPDATING", "CONTENT_PHASE_FAILED", + "CONTENT_PHASE_UNAVAILABLE", ] ] = None """phase is the current phase of the automations file.""" @@ -155,6 +156,7 @@ class Content(BaseModel): "CONTENT_PHASE_READY", "CONTENT_PHASE_UPDATING", "CONTENT_PHASE_FAILED", + "CONTENT_PHASE_UNAVAILABLE", ] ] = None """phase is the current phase of the environment content""" @@ -257,15 +259,26 @@ class EnvironmentURLs(BaseModel): logs: Optional[str] = None """logs is the URL at which the environment logs can be accessed.""" + ops: Optional[str] = None + """ops is the URL at which the environment ops service can be accessed.""" + ports: Optional[List[EnvironmentURLsPort]] = None ssh: Optional[EnvironmentURLsSSH] = None """SSH is the URL at which the environment can be accessed via SSH.""" + support_bundle: Optional[str] = FieldInfo(alias="supportBundle", default=None) + """ + support_bundle is the URL at which the environment support bundle can be + accessed. + """ + class MachineVersions(BaseModel): """versions contains the versions of components in the machine.""" + ami_id: Optional[str] = FieldInfo(alias="amiId", default=None) + supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) @@ -345,6 +358,7 @@ class Secret(BaseModel): "CONTENT_PHASE_READY", "CONTENT_PHASE_UPDATING", "CONTENT_PHASE_FAILED", + "CONTENT_PHASE_UNAVAILABLE", ] ] = None @@ -372,6 +386,7 @@ class SSHPublicKey(BaseModel): "CONTENT_PHASE_READY", "CONTENT_PHASE_UPDATING", "CONTENT_PHASE_FAILED", + "CONTENT_PHASE_UNAVAILABLE", ] ] = None """phase is the current phase of the public key""" diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index 172877e9..904aa438 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable, Optional -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo from .admission_level import AdmissionLevel @@ -95,6 +95,13 @@ class SpecPort(TypedDict, total=False): port: int """port number""" + protocol: Literal["PROTOCOL_UNSPECIFIED", "PROTOCOL_HTTP", "PROTOCOL_HTTPS"] + """ + protocol for communication (Gateway proxy → user environment service). this + setting only affects the protocol used between Gateway and user environment + services. + """ + class SpecSSHPublicKey(TypedDict, total=False): id: str diff --git a/src/gitpod/types/environments/automations/__init__.py b/src/gitpod/types/environments/automations/__init__.py index d6c647a7..d907df0f 100644 --- a/src/gitpod/types/environments/automations/__init__.py +++ b/src/gitpod/types/environments/automations/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .service import Service as Service +from .service_role import ServiceRole as ServiceRole from .service_spec import ServiceSpec as ServiceSpec from .service_phase import ServicePhase as ServicePhase from .service_status import ServiceStatus as ServiceStatus diff --git a/src/gitpod/types/environments/automations/service_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py index 8a91cdc6..0d1e7cf4 100644 --- a/src/gitpod/types/environments/automations/service_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -2,10 +2,12 @@ from __future__ import annotations +from typing import List from typing_extensions import Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo +from .service_role import ServiceRole __all__ = ["ServiceListParams", "Filter", "Pagination"] @@ -31,6 +33,9 @@ class Filter(TypedDict, total=False): references: SequenceNotStr[str] """references filters the response to only services with these references""" + roles: List[ServiceRole] + """roles filters the response to only services with these roles""" + service_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="serviceIds")] """service_ids filters the response to only services with these IDs""" diff --git a/src/gitpod/types/environments/automations/service_metadata.py b/src/gitpod/types/environments/automations/service_metadata.py index 4555022d..accddd3d 100644 --- a/src/gitpod/types/environments/automations/service_metadata.py +++ b/src/gitpod/types/environments/automations/service_metadata.py @@ -6,6 +6,7 @@ from pydantic import Field as FieldInfo from ...._models import BaseModel +from .service_role import ServiceRole from ...shared.subject import Subject from ...shared.automation_trigger import AutomationTrigger @@ -39,5 +40,8 @@ class ServiceMetadata(BaseModel): identify the service in user interactions (e.g. the CLI). """ + role: Optional[ServiceRole] = None + """role specifies the intended role or purpose of the service.""" + triggered_by: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_metadata_param.py b/src/gitpod/types/environments/automations/service_metadata_param.py index 669b250a..b8e47969 100644 --- a/src/gitpod/types/environments/automations/service_metadata_param.py +++ b/src/gitpod/types/environments/automations/service_metadata_param.py @@ -7,6 +7,7 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from .service_role import ServiceRole from ...shared_params.subject import Subject from ...shared_params.automation_trigger import AutomationTrigger @@ -40,5 +41,8 @@ class ServiceMetadataParam(TypedDict, total=False): identify the service in user interactions (e.g. the CLI). """ + role: ServiceRole + """role specifies the intended role or purpose of the service.""" + triggered_by: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggeredBy")] """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_role.py b/src/gitpod/types/environments/automations/service_role.py new file mode 100644 index 00000000..0b333444 --- /dev/null +++ b/src/gitpod/types/environments/automations/service_role.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ServiceRole"] + +ServiceRole: TypeAlias = Literal[ + "SERVICE_ROLE_UNSPECIFIED", + "SERVICE_ROLE_DEFAULT", + "SERVICE_ROLE_EDITOR", + "SERVICE_ROLE_AI_AGENT", + "SERVICE_ROLE_SECURITY_AGENT", +] diff --git a/src/gitpod/types/environments/automations/service_spec.py b/src/gitpod/types/environments/automations/service_spec.py index 6240b462..98b9b1f6 100644 --- a/src/gitpod/types/environments/automations/service_spec.py +++ b/src/gitpod/types/environments/automations/service_spec.py @@ -1,12 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from pydantic import Field as FieldInfo from ...._models import BaseModel from .service_phase import ServicePhase from ...shared.runs_on import RunsOn +from ...shared.environment_variable_item import EnvironmentVariableItem __all__ = ["ServiceSpec", "Commands"] @@ -58,6 +59,9 @@ class ServiceSpec(BaseModel): Used to start or stop the service. """ + env: Optional[List[EnvironmentVariableItem]] = None + """env specifies environment variables for the service.""" + runs_on: Optional[RunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the service should run on.""" diff --git a/src/gitpod/types/environments/automations/service_spec_param.py b/src/gitpod/types/environments/automations/service_spec_param.py index b08445b4..93bed6a8 100644 --- a/src/gitpod/types/environments/automations/service_spec_param.py +++ b/src/gitpod/types/environments/automations/service_spec_param.py @@ -2,11 +2,13 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo from .service_phase import ServicePhase from ...shared_params.runs_on import RunsOn +from ...shared_params.environment_variable_item import EnvironmentVariableItem __all__ = ["ServiceSpecParam", "Commands"] @@ -58,6 +60,9 @@ class ServiceSpecParam(TypedDict, total=False): Used to start or stop the service. """ + env: Iterable[EnvironmentVariableItem] + """env specifies environment variables for the service.""" + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] """runs_on specifies the environment the service should run on.""" diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index a1c08a83..7ec0e436 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -6,9 +6,11 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from .service_role import ServiceRole from .service_phase import ServicePhase from ...shared_params.runs_on import RunsOn from ...shared_params.automation_trigger import AutomationTrigger +from ...shared_params.environment_variable_item import EnvironmentVariableItem __all__ = ["ServiceUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec", "SpecCommands", "Status"] @@ -42,6 +44,8 @@ class Metadata(TypedDict, total=False): name: Optional[str] + role: Optional[ServiceRole] + triggered_by: Annotated[Optional[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] @@ -63,6 +67,8 @@ class Spec(TypedDict, total=False): commands: Optional[SpecCommands] + env: Iterable[EnvironmentVariableItem] + runs_on: Annotated[Optional[RunsOn], PropertyInfo(alias="runsOn")] diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index 43d66208..10f30ca2 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -9,6 +9,7 @@ from ...._utils import PropertyInfo from ...shared_params.runs_on import RunsOn from ...shared_params.automation_trigger import AutomationTrigger +from ...shared_params.environment_variable_item import EnvironmentVariableItem __all__ = ["TaskUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec"] @@ -39,4 +40,6 @@ class Metadata(TypedDict, total=False): class Spec(TypedDict, total=False): command: Optional[str] + env: Iterable[EnvironmentVariableItem] + runs_on: Annotated[Optional[RunsOn], PropertyInfo(alias="runsOn")] diff --git a/src/gitpod/types/environments/automations_file_param.py b/src/gitpod/types/environments/automations_file_param.py index 7d4a2562..226782ce 100644 --- a/src/gitpod/types/environments/automations_file_param.py +++ b/src/gitpod/types/environments/automations_file_param.py @@ -49,6 +49,8 @@ class Services(TypedDict, total=False): name: str + role: Literal["", "default", "editor", "ai-agent"] + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] triggered_by: Annotated[ @@ -68,7 +70,8 @@ class Tasks(TypedDict, total=False): runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] triggered_by: Annotated[ - List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart"]], PropertyInfo(alias="triggeredBy") + List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart", "prebuild"]], + PropertyInfo(alias="triggeredBy"), ] diff --git a/src/gitpod/types/error_event_param.py b/src/gitpod/types/error_event_param.py new file mode 100644 index 00000000..5b909e4c --- /dev/null +++ b/src/gitpod/types/error_event_param.py @@ -0,0 +1,74 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo +from .error_level import ErrorLevel +from .breadcrumb_param import BreadcrumbParam +from .request_info_param import RequestInfoParam +from .exception_info_param import ExceptionInfoParam + +__all__ = ["ErrorEventParam"] + + +class ErrorEventParam(TypedDict, total=False): + """ErrorEvent contains comprehensive error information (Sentry-compatible)""" + + breadcrumbs: Iterable[BreadcrumbParam] + """Breadcrumbs leading up to the error""" + + environment: str + """Environment (e.g., "production", "staging", "development")""" + + event_id: Annotated[str, PropertyInfo(alias="eventId")] + """Unique event identifier (required by Sentry)""" + + exceptions: Iterable[ExceptionInfoParam] + """Exception information (primary error data)""" + + extra: Dict[str, str] + """Additional arbitrary metadata""" + + fingerprint: SequenceNotStr[str] + """Custom fingerprint for grouping""" + + identity_id: Annotated[str, PropertyInfo(alias="identityId")] + """Identity ID of the user (UUID)""" + + level: ErrorLevel + """Error severity level""" + + logger: str + """Logger name""" + + modules: Dict[str, str] + """Modules/dependencies information""" + + platform: str + """Platform identifier (required by Sentry)""" + + release: str + """Release version""" + + request: RequestInfoParam + """Request information""" + + sdk: Dict[str, str] + """SDK information""" + + server_name: Annotated[str, PropertyInfo(alias="serverName")] + """Server/host name""" + + tags: Dict[str, str] + """Tags for filtering and grouping""" + + timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """When the event occurred (required by Sentry)""" + + transaction: str + """Transaction name (e.g., route name, function name)""" diff --git a/src/gitpod/types/error_level.py b/src/gitpod/types/error_level.py new file mode 100644 index 00000000..573d3f85 --- /dev/null +++ b/src/gitpod/types/error_level.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ErrorLevel"] + +ErrorLevel: TypeAlias = Literal[ + "ERROR_LEVEL_UNSPECIFIED", + "ERROR_LEVEL_DEBUG", + "ERROR_LEVEL_INFO", + "ERROR_LEVEL_WARNING", + "ERROR_LEVEL_ERROR", + "ERROR_LEVEL_FATAL", +] diff --git a/src/gitpod/types/error_report_errors_params.py b/src/gitpod/types/error_report_errors_params.py new file mode 100644 index 00000000..6aa61989 --- /dev/null +++ b/src/gitpod/types/error_report_errors_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import TypedDict + +from .error_event_param import ErrorEventParam + +__all__ = ["ErrorReportErrorsParams"] + + +class ErrorReportErrorsParams(TypedDict, total=False): + events: Iterable[ErrorEventParam] + """Error events to be reported (batch) - now using Sentry-compatible structure""" diff --git a/src/gitpod/types/event_list_params.py b/src/gitpod/types/event_list_params.py index 51ddc544..21246d50 100644 --- a/src/gitpod/types/event_list_params.py +++ b/src/gitpod/types/event_list_params.py @@ -7,8 +7,8 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo -from .resource_type import ResourceType from .shared.principal import Principal +from .shared.resource_type import ResourceType __all__ = ["EventListParams", "Filter", "Pagination"] diff --git a/src/gitpod/types/event_list_response.py b/src/gitpod/types/event_list_response.py index ce8fb8b2..a5d723d3 100644 --- a/src/gitpod/types/event_list_response.py +++ b/src/gitpod/types/event_list_response.py @@ -6,8 +6,8 @@ from pydantic import Field as FieldInfo from .._models import BaseModel -from .resource_type import ResourceType from .shared.principal import Principal +from .shared.resource_type import ResourceType __all__ = ["EventListResponse"] diff --git a/src/gitpod/types/event_watch_response.py b/src/gitpod/types/event_watch_response.py index 9780ee13..e8e02cc1 100644 --- a/src/gitpod/types/event_watch_response.py +++ b/src/gitpod/types/event_watch_response.py @@ -5,8 +5,8 @@ from pydantic import Field as FieldInfo from .._models import BaseModel -from .resource_type import ResourceType from .resource_operation import ResourceOperation +from .shared.resource_type import ResourceType __all__ = ["EventWatchResponse"] diff --git a/src/gitpod/types/exception_info_param.py b/src/gitpod/types/exception_info_param.py new file mode 100644 index 00000000..ee6f2291 --- /dev/null +++ b/src/gitpod/types/exception_info_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .stack_frame_param import StackFrameParam +from .exception_mechanism_param import ExceptionMechanismParam + +__all__ = ["ExceptionInfoParam"] + + +class ExceptionInfoParam(TypedDict, total=False): + """Exception information (Sentry-compatible)""" + + mechanism: ExceptionMechanismParam + """Exception mechanism""" + + module: str + """Module or package where the exception type is defined""" + + stacktrace: Iterable[StackFrameParam] + """Stack trace frames""" + + thread_id: Annotated[str, PropertyInfo(alias="threadId")] + """Thread ID if applicable""" + + type: str + """Exception type/class name""" + + value: str + """Exception message/value""" diff --git a/src/gitpod/types/exception_mechanism_param.py b/src/gitpod/types/exception_mechanism_param.py new file mode 100644 index 00000000..1fd017ac --- /dev/null +++ b/src/gitpod/types/exception_mechanism_param.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import TypedDict + +__all__ = ["ExceptionMechanismParam"] + + +class ExceptionMechanismParam(TypedDict, total=False): + """Exception mechanism information (Sentry-compatible)""" + + data: Dict[str, str] + """Additional mechanism-specific data""" + + description: str + """Human-readable description of the mechanism""" + + handled: bool + """Whether the exception was handled by user code""" + + synthetic: bool + """Whether this is a synthetic exception (created by SDK)""" + + type: str + """Type of mechanism (e.g., "generic", "promise", "onerror")""" diff --git a/src/gitpod/types/group.py b/src/gitpod/types/group.py index a98b80b7..ac727d0f 100644 --- a/src/gitpod/types/group.py +++ b/src/gitpod/types/group.py @@ -105,6 +105,11 @@ class Group(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ + description: Optional[str] = None + + member_count: Optional[int] = FieldInfo(alias="memberCount", default=None) + """member_count is the total number of members in this group""" + name: Optional[str] = None organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) diff --git a/src/gitpod/types/group_create_params.py b/src/gitpod/types/group_create_params.py new file mode 100644 index 00000000..43e2dd66 --- /dev/null +++ b/src/gitpod/types/group_create_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GroupCreateParams"] + + +class GroupCreateParams(TypedDict, total=False): + description: str + + name: str + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] diff --git a/src/gitpod/types/group_create_response.py b/src/gitpod/types/group_create_response.py new file mode 100644 index 00000000..de7d97db --- /dev/null +++ b/src/gitpod/types/group_create_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .group import Group +from .._models import BaseModel + +__all__ = ["GroupCreateResponse"] + + +class GroupCreateResponse(BaseModel): + group: Optional[Group] = None diff --git a/src/gitpod/types/group_delete_params.py b/src/gitpod/types/group_delete_params.py new file mode 100644 index 00000000..6d0899d0 --- /dev/null +++ b/src/gitpod/types/group_delete_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GroupDeleteParams"] + + +class GroupDeleteParams(TypedDict, total=False): + group_id: Annotated[str, PropertyInfo(alias="groupId")] diff --git a/src/gitpod/types/group_retrieve_params.py b/src/gitpod/types/group_retrieve_params.py new file mode 100644 index 00000000..0e039801 --- /dev/null +++ b/src/gitpod/types/group_retrieve_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GroupRetrieveParams"] + + +class GroupRetrieveParams(TypedDict, total=False): + group_id: Annotated[str, PropertyInfo(alias="groupId")] diff --git a/src/gitpod/types/group_retrieve_response.py b/src/gitpod/types/group_retrieve_response.py new file mode 100644 index 00000000..a4fe9908 --- /dev/null +++ b/src/gitpod/types/group_retrieve_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .group import Group +from .._models import BaseModel + +__all__ = ["GroupRetrieveResponse"] + + +class GroupRetrieveResponse(BaseModel): + group: Optional[Group] = None diff --git a/src/gitpod/types/group_update_params.py b/src/gitpod/types/group_update_params.py new file mode 100644 index 00000000..f5221b7e --- /dev/null +++ b/src/gitpod/types/group_update_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GroupUpdateParams"] + + +class GroupUpdateParams(TypedDict, total=False): + description: str + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + + name: str diff --git a/src/gitpod/types/group_update_response.py b/src/gitpod/types/group_update_response.py new file mode 100644 index 00000000..b19579b5 --- /dev/null +++ b/src/gitpod/types/group_update_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .group import Group +from .._models import BaseModel + +__all__ = ["GroupUpdateResponse"] + + +class GroupUpdateResponse(BaseModel): + group: Optional[Group] = None diff --git a/src/gitpod/types/groups/__init__.py b/src/gitpod/types/groups/__init__.py new file mode 100644 index 00000000..f689e45d --- /dev/null +++ b/src/gitpod/types/groups/__init__.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .resource_role import ResourceRole as ResourceRole +from .role_assignment import RoleAssignment as RoleAssignment +from .group_membership import GroupMembership as GroupMembership +from .membership_list_params import MembershipListParams as MembershipListParams +from .membership_create_params import MembershipCreateParams as MembershipCreateParams +from .membership_delete_params import MembershipDeleteParams as MembershipDeleteParams +from .membership_create_response import MembershipCreateResponse as MembershipCreateResponse +from .role_assignment_list_params import RoleAssignmentListParams as RoleAssignmentListParams +from .role_assignment_create_params import RoleAssignmentCreateParams as RoleAssignmentCreateParams +from .role_assignment_delete_params import RoleAssignmentDeleteParams as RoleAssignmentDeleteParams +from .role_assignment_create_response import RoleAssignmentCreateResponse as RoleAssignmentCreateResponse diff --git a/src/gitpod/types/groups/group_membership.py b/src/gitpod/types/groups/group_membership.py new file mode 100644 index 00000000..667b6ebb --- /dev/null +++ b/src/gitpod/types/groups/group_membership.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from ..shared.subject import Subject + +__all__ = ["GroupMembership"] + + +class GroupMembership(BaseModel): + """GroupMembership represents a subject's membership in a group""" + + id: Optional[str] = None + """Unique identifier for the group membership""" + + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + """Subject's avatar URL""" + + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + """Group identifier""" + + name: Optional[str] = None + """Subject's display name""" + + subject: Optional[Subject] = None + """Subject (user, runner, environment, service account, etc.)""" diff --git a/src/gitpod/types/groups/membership_create_params.py b/src/gitpod/types/groups/membership_create_params.py new file mode 100644 index 00000000..90b03674 --- /dev/null +++ b/src/gitpod/types/groups/membership_create_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from ..shared_params.subject import Subject + +__all__ = ["MembershipCreateParams"] + + +class MembershipCreateParams(TypedDict, total=False): + group_id: Annotated[str, PropertyInfo(alias="groupId")] + + subject: Subject + """Subject to add to the group""" diff --git a/src/gitpod/types/groups/membership_create_response.py b/src/gitpod/types/groups/membership_create_response.py new file mode 100644 index 00000000..23494130 --- /dev/null +++ b/src/gitpod/types/groups/membership_create_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .group_membership import GroupMembership + +__all__ = ["MembershipCreateResponse"] + + +class MembershipCreateResponse(BaseModel): + member: Optional[GroupMembership] = None + """GroupMembership represents a subject's membership in a group""" diff --git a/src/gitpod/types/groups/membership_delete_params.py b/src/gitpod/types/groups/membership_delete_params.py new file mode 100644 index 00000000..befcf479 --- /dev/null +++ b/src/gitpod/types/groups/membership_delete_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["MembershipDeleteParams"] + + +class MembershipDeleteParams(TypedDict, total=False): + membership_id: Annotated[str, PropertyInfo(alias="membershipId")] + """The membership to delete""" diff --git a/src/gitpod/types/groups/membership_list_params.py b/src/gitpod/types/groups/membership_list_params.py new file mode 100644 index 00000000..e2f90e2d --- /dev/null +++ b/src/gitpod/types/groups/membership_list_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["MembershipListParams", "Pagination"] + + +class MembershipListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + + pagination: Pagination + """pagination contains the pagination options for listing memberships""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing memberships""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/groups/resource_role.py b/src/gitpod/types/groups/resource_role.py new file mode 100644 index 00000000..17dcb324 --- /dev/null +++ b/src/gitpod/types/groups/resource_role.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResourceRole"] + +ResourceRole: TypeAlias = Literal[ + "RESOURCE_ROLE_UNSPECIFIED", + "RESOURCE_ROLE_ORG_ADMIN", + "RESOURCE_ROLE_ORG_MEMBER", + "RESOURCE_ROLE_GROUP_ADMIN", + "RESOURCE_ROLE_GROUP_VIEWER", + "RESOURCE_ROLE_USER_IDENTITY", + "RESOURCE_ROLE_USER_VIEWER", + "RESOURCE_ROLE_USER_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_IDENTITY", + "RESOURCE_ROLE_ENVIRONMENT_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_USER", + "RESOURCE_ROLE_ENVIRONMENT_VIEWER", + "RESOURCE_ROLE_ENVIRONMENT_RUNNER", + "RESOURCE_ROLE_RUNNER_IDENTITY", + "RESOURCE_ROLE_RUNNER_ADMIN", + "RESOURCE_ROLE_RUNNER_LOCAL_ADMIN", + "RESOURCE_ROLE_RUNNER_MANAGED_ADMIN", + "RESOURCE_ROLE_RUNNER_USER", + "RESOURCE_ROLE_RUNNER_CONFIGURATION_READER", + "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN", + "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER", + "RESOURCE_ROLE_PROJECT_ADMIN", + "RESOURCE_ROLE_PROJECT_USER", + "RESOURCE_ROLE_PROJECT_EDITOR", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV", + "RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER", + "RESOURCE_ROLE_ENVIRONMENT_TASK_USER", + "RESOURCE_ROLE_ENVIRONMENT_TASK_ENV", + "RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY", + "RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN", + "RESOURCE_ROLE_AGENT_EXECUTION_IDENTITY", + "RESOURCE_ROLE_AGENT_EXECUTION_USER", + "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", + "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", + "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER", + "RESOURCE_ROLE_AGENT_ADMIN", + "RESOURCE_ROLE_AGENT_VIEWER", + "RESOURCE_ROLE_AGENT_EXECUTOR", + "RESOURCE_ROLE_WORKFLOW_ADMIN", + "RESOURCE_ROLE_WORKFLOW_USER", + "RESOURCE_ROLE_WORKFLOW_VIEWER", + "RESOURCE_ROLE_WORKFLOW_EXECUTOR", + "RESOURCE_ROLE_SNAPSHOT_ADMIN", + "RESOURCE_ROLE_SNAPSHOT_RUNNER", +] diff --git a/src/gitpod/types/groups/role_assignment.py b/src/gitpod/types/groups/role_assignment.py new file mode 100644 index 00000000..38e30ea8 --- /dev/null +++ b/src/gitpod/types/groups/role_assignment.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .resource_role import ResourceRole +from ..shared.resource_type import ResourceType + +__all__ = ["RoleAssignment"] + + +class RoleAssignment(BaseModel): + """RoleAssignment represents a role assigned to a group on a specific resource""" + + id: Optional[str] = None + """Unique identifier for the role assignment""" + + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + """Group identifier""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """Organization identifier""" + + resource_id: Optional[str] = FieldInfo(alias="resourceId", default=None) + """Resource identifier""" + + resource_role: Optional[ResourceRole] = FieldInfo(alias="resourceRole", default=None) + """Role assigned to the group on this resource""" + + resource_type: Optional[ResourceType] = FieldInfo(alias="resourceType", default=None) + """Type of resource (runner, project, environment, etc.)""" diff --git a/src/gitpod/types/groups/role_assignment_create_params.py b/src/gitpod/types/groups/role_assignment_create_params.py new file mode 100644 index 00000000..d036e80d --- /dev/null +++ b/src/gitpod/types/groups/role_assignment_create_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from .resource_role import ResourceRole +from ..shared.resource_type import ResourceType + +__all__ = ["RoleAssignmentCreateParams"] + + +class RoleAssignmentCreateParams(TypedDict, total=False): + group_id: Annotated[str, PropertyInfo(alias="groupId")] + + resource_id: Annotated[str, PropertyInfo(alias="resourceId")] + + resource_role: Annotated[ResourceRole, PropertyInfo(alias="resourceRole")] + """ + ResourceRole represents roles that can be assigned to groups on resources These + map directly to the roles defined in backend/db/rule/rbac/role/role.go + """ + + resource_type: Annotated[ResourceType, PropertyInfo(alias="resourceType")] diff --git a/src/gitpod/types/groups/role_assignment_create_response.py b/src/gitpod/types/groups/role_assignment_create_response.py new file mode 100644 index 00000000..a10b25bf --- /dev/null +++ b/src/gitpod/types/groups/role_assignment_create_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .role_assignment import RoleAssignment + +__all__ = ["RoleAssignmentCreateResponse"] + + +class RoleAssignmentCreateResponse(BaseModel): + assignment: Optional[RoleAssignment] = None + """RoleAssignment represents a role assigned to a group on a specific resource""" diff --git a/src/gitpod/types/groups/role_assignment_delete_params.py b/src/gitpod/types/groups/role_assignment_delete_params.py new file mode 100644 index 00000000..5e5bd851 --- /dev/null +++ b/src/gitpod/types/groups/role_assignment_delete_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["RoleAssignmentDeleteParams"] + + +class RoleAssignmentDeleteParams(TypedDict, total=False): + assignment_id: Annotated[str, PropertyInfo(alias="assignmentId")] diff --git a/src/gitpod/types/groups/role_assignment_list_params.py b/src/gitpod/types/groups/role_assignment_list_params.py new file mode 100644 index 00000000..23c236b5 --- /dev/null +++ b/src/gitpod/types/groups/role_assignment_list_params.py @@ -0,0 +1,68 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from .resource_role import ResourceRole +from ..shared.resource_type import ResourceType + +__all__ = ["RoleAssignmentListParams", "Filter", "Pagination"] + + +class RoleAssignmentListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + """Filter parameters""" + + pagination: Pagination + """Pagination parameters""" + + +class Filter(TypedDict, total=False): + """Filter parameters""" + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + """ + group_id filters the response to only role assignments for this specific group + Empty string is allowed and means no filtering by group + """ + + resource_roles: Annotated[List[ResourceRole], PropertyInfo(alias="resourceRoles")] + """ + resource_roles filters the response to only role assignments with these specific + roles + """ + + resource_types: Annotated[List[ResourceType], PropertyInfo(alias="resourceTypes")] + """ + resource_types filters the response to only role assignments for these resource + types + """ + + user_id: Annotated[str, PropertyInfo(alias="userId")] + """ + user_id filters the response to only role assignments for groups that this user + is a member of Empty string is allowed and means no filtering by user + """ + + +class Pagination(TypedDict, total=False): + """Pagination parameters""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/organization.py b/src/gitpod/types/organization.py index 9ecda14c..edf88f15 100644 --- a/src/gitpod/types/organization.py +++ b/src/gitpod/types/organization.py @@ -110,7 +110,7 @@ class Organization(BaseModel): name: str tier: OrganizationTier - """The tier of the organization - free or enterprise""" + """The tier of the organization - free, enterprise or core""" updated_at: datetime = FieldInfo(alias="updatedAt") """ diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index ad8d4495..06c529e8 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -6,7 +6,7 @@ from .._utils import PropertyInfo -__all__ = ["OrganizationListMembersParams", "Pagination"] +__all__ = ["OrganizationListMembersParams", "Filter", "Pagination"] class OrganizationListMembersParams(TypedDict, total=False): @@ -17,10 +17,17 @@ class OrganizationListMembersParams(TypedDict, total=False): page_size: Annotated[int, PropertyInfo(alias="pageSize")] + filter: Filter + pagination: Pagination """pagination contains the pagination options for listing members""" +class Filter(TypedDict, total=False): + search: str + """search performs case-insensitive search across member name and email""" + + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing members""" diff --git a/src/gitpod/types/organization_tier.py b/src/gitpod/types/organization_tier.py index ea000b24..c1c70936 100644 --- a/src/gitpod/types/organization_tier.py +++ b/src/gitpod/types/organization_tier.py @@ -5,5 +5,9 @@ __all__ = ["OrganizationTier"] OrganizationTier: TypeAlias = Literal[ - "ORGANIZATION_TIER_UNSPECIFIED", "ORGANIZATION_TIER_FREE", "ORGANIZATION_TIER_ENTERPRISE" + "ORGANIZATION_TIER_UNSPECIFIED", + "ORGANIZATION_TIER_FREE", + "ORGANIZATION_TIER_ENTERPRISE", + "ORGANIZATION_TIER_CORE", + "ORGANIZATION_TIER_FREE_ONA", ] diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index edd5451d..ba4b2b58 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -2,13 +2,18 @@ from __future__ import annotations +from .agent_policy import AgentPolicy as AgentPolicy +from .custom_domain import CustomDomain as CustomDomain from .provider_type import ProviderType as ProviderType from .sso_configuration import SSOConfiguration as SSOConfiguration +from .crowd_strike_config import CrowdStrikeConfig as CrowdStrikeConfig from .domain_verification import DomainVerification as DomainVerification from .organization_invite import OrganizationInvite as OrganizationInvite from .invite_create_params import InviteCreateParams as InviteCreateParams from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams from .organization_policies import OrganizationPolicies as OrganizationPolicies +from .security_agent_policy import SecurityAgentPolicy as SecurityAgentPolicy +from .custom_domain_provider import CustomDomainProvider as CustomDomainProvider from .invite_create_response import InviteCreateResponse as InviteCreateResponse from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams from .policy_retrieve_params import PolicyRetrieveParams as PolicyRetrieveParams @@ -17,8 +22,15 @@ from .policy_retrieve_response import PolicyRetrieveResponse as PolicyRetrieveResponse from .domain_verification_state import DomainVerificationState as DomainVerificationState from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams +from .custom_domain_create_params import CustomDomainCreateParams as CustomDomainCreateParams +from .custom_domain_delete_params import CustomDomainDeleteParams as CustomDomainDeleteParams +from .custom_domain_update_params import CustomDomainUpdateParams as CustomDomainUpdateParams from .invite_get_summary_response import InviteGetSummaryResponse as InviteGetSummaryResponse +from .custom_domain_create_response import CustomDomainCreateResponse as CustomDomainCreateResponse +from .custom_domain_retrieve_params import CustomDomainRetrieveParams as CustomDomainRetrieveParams +from .custom_domain_update_response import CustomDomainUpdateResponse as CustomDomainUpdateResponse from .sso_configuration_list_params import SSOConfigurationListParams as SSOConfigurationListParams +from .custom_domain_retrieve_response import CustomDomainRetrieveResponse as CustomDomainRetrieveResponse from .domain_verification_list_params import DomainVerificationListParams as DomainVerificationListParams from .sso_configuration_create_params import SSOConfigurationCreateParams as SSOConfigurationCreateParams from .sso_configuration_delete_params import SSOConfigurationDeleteParams as SSOConfigurationDeleteParams diff --git a/src/gitpod/types/organizations/agent_policy.py b/src/gitpod/types/organizations/agent_policy.py new file mode 100644 index 00000000..7f5e1de9 --- /dev/null +++ b/src/gitpod/types/organizations/agent_policy.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["AgentPolicy"] + + +class AgentPolicy(BaseModel): + """AgentPolicy contains agent-specific policy settings for an organization""" + + command_deny_list: List[str] = FieldInfo(alias="commandDenyList") + """ + command_deny_list contains a list of commands that agents are not allowed to + execute + """ + + mcp_disabled: bool = FieldInfo(alias="mcpDisabled") + """ + mcp_disabled controls whether MCP (Model Context Protocol) is disabled for + agents + """ + + scm_tools_disabled: bool = FieldInfo(alias="scmToolsDisabled") + """ + scm_tools_disabled controls whether SCM (Source Control Management) tools are + disabled for agents + """ diff --git a/src/gitpod/types/organizations/crowd_strike_config.py b/src/gitpod/types/organizations/crowd_strike_config.py new file mode 100644 index 00000000..2afe1119 --- /dev/null +++ b/src/gitpod/types/organizations/crowd_strike_config.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CrowdStrikeConfig"] + + +class CrowdStrikeConfig(BaseModel): + """CrowdStrikeConfig configures CrowdStrike Falcon sensor deployment""" + + additional_options: Optional[Dict[str, str]] = FieldInfo(alias="additionalOptions", default=None) + """ + additional*options contains additional FALCONCTL_OPT*\\** options as key-value + pairs. Keys should NOT include the FALCONCTL*OPT* prefix. + """ + + cid_secret_id: Optional[str] = FieldInfo(alias="cidSecretId", default=None) + """ + cid_secret_id references an organization secret containing the Customer ID + (CID). + """ + + enabled: Optional[bool] = None + """enabled controls whether CrowdStrike Falcon is deployed to environments""" + + image: Optional[str] = None + """image is the CrowdStrike Falcon sensor container image reference""" + + tags: Optional[str] = None + """tags are optional tags to apply to the Falcon sensor (comma-separated)""" diff --git a/src/gitpod/types/organizations/custom_domain.py b/src/gitpod/types/organizations/custom_domain.py new file mode 100644 index 00000000..80f99740 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .custom_domain_provider import CustomDomainProvider + +__all__ = ["CustomDomain"] + + +class CustomDomain(BaseModel): + """CustomDomain represents a custom domain configuration for an organization""" + + id: str + """id is the unique identifier of the custom domain""" + + created_at: datetime = FieldInfo(alias="createdAt") + """created_at is when the custom domain was created""" + + domain_name: str = FieldInfo(alias="domainName") + """domain_name is the custom domain name""" + + organization_id: str = FieldInfo(alias="organizationId") + """organization_id is the ID of the organization this custom domain belongs to""" + + updated_at: datetime = FieldInfo(alias="updatedAt") + """updated_at is when the custom domain was last updated""" + + aws_account_id: Optional[str] = FieldInfo(alias="awsAccountId", default=None) + """aws_account_id is the AWS account ID (deprecated: use cloud_account_id)""" + + cloud_account_id: Optional[str] = FieldInfo(alias="cloudAccountId", default=None) + """ + cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + """ + + provider: Optional[CustomDomainProvider] = None + """provider is the cloud provider for this custom domain""" diff --git a/src/gitpod/types/organizations/custom_domain_create_params.py b/src/gitpod/types/organizations/custom_domain_create_params.py new file mode 100644 index 00000000..f0016613 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_create_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .custom_domain_provider import CustomDomainProvider + +__all__ = ["CustomDomainCreateParams"] + + +class CustomDomainCreateParams(TypedDict, total=False): + domain_name: Required[Annotated[str, PropertyInfo(alias="domainName")]] + """domain_name is the custom domain name""" + + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to create the custom domain for""" + + aws_account_id: Annotated[Optional[str], PropertyInfo(alias="awsAccountId")] + """aws_account_id is the AWS account ID (deprecated: use cloud_account_id)""" + + cloud_account_id: Annotated[Optional[str], PropertyInfo(alias="cloudAccountId")] + """ + cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + """ + + provider: CustomDomainProvider + """provider is the cloud provider for this custom domain""" diff --git a/src/gitpod/types/organizations/custom_domain_create_response.py b/src/gitpod/types/organizations/custom_domain_create_response.py new file mode 100644 index 00000000..e85efa98 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_create_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .custom_domain import CustomDomain + +__all__ = ["CustomDomainCreateResponse"] + + +class CustomDomainCreateResponse(BaseModel): + """CreateCustomDomainResponse is the response message for creating a custom domain""" + + custom_domain: CustomDomain = FieldInfo(alias="customDomain") + """custom_domain is the created custom domain""" diff --git a/src/gitpod/types/organizations/custom_domain_delete_params.py b/src/gitpod/types/organizations/custom_domain_delete_params.py new file mode 100644 index 00000000..45b6257f --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_delete_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["CustomDomainDeleteParams"] + + +class CustomDomainDeleteParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to delete custom domain for""" diff --git a/src/gitpod/types/organizations/custom_domain_provider.py b/src/gitpod/types/organizations/custom_domain_provider.py new file mode 100644 index 00000000..c67ad4d9 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_provider.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CustomDomainProvider"] + +CustomDomainProvider: TypeAlias = Literal[ + "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED", "CUSTOM_DOMAIN_PROVIDER_AWS", "CUSTOM_DOMAIN_PROVIDER_GCP" +] diff --git a/src/gitpod/types/organizations/custom_domain_retrieve_params.py b/src/gitpod/types/organizations/custom_domain_retrieve_params.py new file mode 100644 index 00000000..9ff0e3d5 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_retrieve_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["CustomDomainRetrieveParams"] + + +class CustomDomainRetrieveParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to retrieve custom domain for""" diff --git a/src/gitpod/types/organizations/custom_domain_retrieve_response.py b/src/gitpod/types/organizations/custom_domain_retrieve_response.py new file mode 100644 index 00000000..52edd20e --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_retrieve_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .custom_domain import CustomDomain + +__all__ = ["CustomDomainRetrieveResponse"] + + +class CustomDomainRetrieveResponse(BaseModel): + custom_domain: CustomDomain = FieldInfo(alias="customDomain") + """CustomDomain represents a custom domain configuration for an organization""" diff --git a/src/gitpod/types/organizations/custom_domain_update_params.py b/src/gitpod/types/organizations/custom_domain_update_params.py new file mode 100644 index 00000000..9c5b64ce --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_update_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .custom_domain_provider import CustomDomainProvider + +__all__ = ["CustomDomainUpdateParams"] + + +class CustomDomainUpdateParams(TypedDict, total=False): + domain_name: Required[Annotated[str, PropertyInfo(alias="domainName")]] + """domain_name is the custom domain name""" + + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to update custom domain for""" + + aws_account_id: Annotated[Optional[str], PropertyInfo(alias="awsAccountId")] + """aws_account_id is the AWS account ID (deprecated: use cloud_account_id)""" + + cloud_account_id: Annotated[Optional[str], PropertyInfo(alias="cloudAccountId")] + """ + cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + """ + + provider: Optional[CustomDomainProvider] + """provider is the cloud provider for this custom domain""" diff --git a/src/gitpod/types/organizations/custom_domain_update_response.py b/src/gitpod/types/organizations/custom_domain_update_response.py new file mode 100644 index 00000000..0a206c1c --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_update_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .custom_domain import CustomDomain + +__all__ = ["CustomDomainUpdateResponse"] + + +class CustomDomainUpdateResponse(BaseModel): + """UpdateCustomDomainResponse is the response message for updating a custom domain""" + + custom_domain: CustomDomain = FieldInfo(alias="customDomain") + """custom_domain is the updated custom domain""" diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py index 673c7561..e84968b0 100644 --- a/src/gitpod/types/organizations/organization_policies.py +++ b/src/gitpod/types/organizations/organization_policies.py @@ -1,15 +1,32 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from pydantic import Field as FieldInfo from ..._models import BaseModel +from .agent_policy import AgentPolicy +from .security_agent_policy import SecurityAgentPolicy -__all__ = ["OrganizationPolicies"] +__all__ = ["OrganizationPolicies", "EditorVersionRestrictions"] + + +class EditorVersionRestrictions(BaseModel): + """EditorVersionPolicy defines the version policy for a specific editor""" + + allowed_versions: Optional[List[str]] = FieldInfo(alias="allowedVersions", default=None) + """ + allowed_versions lists the versions that are allowed If empty, we will use the + latest version of the editor + + Examples for JetBrains: `["2025.2", "2025.1", "2024.3"]` + """ class OrganizationPolicies(BaseModel): + agent_policy: AgentPolicy = FieldInfo(alias="agentPolicy") + """agent_policy contains agent-specific policy settings""" + allowed_editor_ids: List[str] = FieldInfo(alias="allowedEditorIds") """ allowed_editor_ids is the list of editor IDs that are allowed to be used in the @@ -64,9 +81,46 @@ class OrganizationPolicies(BaseModel): organization """ + require_custom_domain_access: bool = FieldInfo(alias="requireCustomDomainAccess") + """ + require_custom_domain_access controls whether users must access via custom + domain when one is configured. When true, access via app.gitpod.io is blocked. + """ + + delete_archived_environments_after: Optional[str] = FieldInfo(alias="deleteArchivedEnvironmentsAfter", default=None) + """ + delete_archived_environments_after controls how long archived environments are + kept before automatic deletion. 0 means no automatic deletion. Maximum duration + is 4 weeks (2419200 seconds). + """ + + editor_version_restrictions: Optional[Dict[str, EditorVersionRestrictions]] = FieldInfo( + alias="editorVersionRestrictions", default=None + ) + """ + editor_version_restrictions restricts which editor versions can be used. Maps + editor ID to version policy, editor_version_restrictions not set means no + restrictions. If empty or not set for an editor, we will use the latest version + of the editor + """ + + maximum_environment_lifetime: Optional[str] = FieldInfo(alias="maximumEnvironmentLifetime", default=None) + """ + maximum_environment_lifetime controls for how long environments are allowed to + be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 + seconds). + """ + maximum_environment_timeout: Optional[str] = FieldInfo(alias="maximumEnvironmentTimeout", default=None) """ maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes. + minutes (1800 seconds). + """ + + security_agent_policy: Optional[SecurityAgentPolicy] = FieldInfo(alias="securityAgentPolicy", default=None) + """ + security_agent_policy contains security agent configuration for the + organization. When configured, security agents are automatically deployed to all + environments. """ diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index acd315bd..50cfaae4 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -2,19 +2,28 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional from typing_extensions import Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo -__all__ = ["PolicyUpdateParams"] +__all__ = [ + "PolicyUpdateParams", + "AgentPolicy", + "EditorVersionRestrictions", + "SecurityAgentPolicy", + "SecurityAgentPolicyCrowdstrike", +] class PolicyUpdateParams(TypedDict, total=False): organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organization_id is the ID of the organization to update policies for""" + agent_policy: Annotated[Optional[AgentPolicy], PropertyInfo(alias="agentPolicy")] + """agent_policy contains agent-specific policy settings""" + allowed_editor_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="allowedEditorIds")] """ allowed_editor_ids is the list of editor IDs that are allowed to be used in the @@ -39,6 +48,28 @@ class PolicyUpdateParams(TypedDict, total=False): repo """ + delete_archived_environments_after: Annotated[Optional[str], PropertyInfo(alias="deleteArchivedEnvironmentsAfter")] + """ + delete_archived_environments_after controls how long archived environments are + kept before automatic deletion. 0 means no automatic deletion. Maximum duration + is 4 weeks (2419200 seconds). + """ + + editor_version_restrictions: Annotated[ + Dict[str, EditorVersionRestrictions], PropertyInfo(alias="editorVersionRestrictions") + ] + """ + editor_version_restrictions restricts which editor versions can be used. Maps + editor ID to version policy with allowed major versions. + """ + + maximum_environment_lifetime: Annotated[Optional[str], PropertyInfo(alias="maximumEnvironmentLifetime")] + """ + maximum_environment_lifetime controls for how long environments are allowed to + be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 + seconds). + """ + maximum_environments_per_user: Annotated[Optional[str], PropertyInfo(alias="maximumEnvironmentsPerUser")] """ maximum_environments_per_user limits total environments (running or stopped) per @@ -49,7 +80,7 @@ class PolicyUpdateParams(TypedDict, total=False): """ maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes. + minutes (1800 seconds). """ maximum_running_environments_per_user: Annotated[ @@ -74,3 +105,77 @@ class PolicyUpdateParams(TypedDict, total=False): port_sharing_disabled controls whether port sharing is disabled in the organization """ + + require_custom_domain_access: Annotated[Optional[bool], PropertyInfo(alias="requireCustomDomainAccess")] + """ + require_custom_domain_access controls whether users must access via custom + domain when one is configured. When true, access via app.gitpod.io is blocked. + """ + + security_agent_policy: Annotated[Optional[SecurityAgentPolicy], PropertyInfo(alias="securityAgentPolicy")] + """security_agent_policy contains security agent configuration updates""" + + +class AgentPolicy(TypedDict, total=False): + """agent_policy contains agent-specific policy settings""" + + command_deny_list: Annotated[SequenceNotStr[str], PropertyInfo(alias="commandDenyList")] + """ + command_deny_list contains a list of commands that agents are not allowed to + execute + """ + + mcp_disabled: Annotated[Optional[bool], PropertyInfo(alias="mcpDisabled")] + """ + mcp_disabled controls whether MCP (Model Context Protocol) is disabled for + agents + """ + + scm_tools_disabled: Annotated[Optional[bool], PropertyInfo(alias="scmToolsDisabled")] + """ + scm_tools_disabled controls whether SCM (Source Control Management) tools are + disabled for agents + """ + + +class EditorVersionRestrictions(TypedDict, total=False): + """EditorVersionPolicy defines the version policy for a specific editor""" + + allowed_versions: Annotated[SequenceNotStr[str], PropertyInfo(alias="allowedVersions")] + """ + allowed_versions lists the versions that are allowed If empty, we will use the + latest version of the editor + + Examples for JetBrains: `["2025.2", "2025.1", "2024.3"]` + """ + + +class SecurityAgentPolicyCrowdstrike(TypedDict, total=False): + """crowdstrike contains CrowdStrike Falcon configuration updates""" + + additional_options: Annotated[Dict[str, str], PropertyInfo(alias="additionalOptions")] + """ + additional*options contains additional FALCONCTL_OPT*\\** options as key-value + pairs + """ + + cid_secret_id: Annotated[Optional[str], PropertyInfo(alias="cidSecretId")] + """ + cid_secret_id references an organization secret containing the Customer ID (CID) + """ + + enabled: Optional[bool] + """enabled controls whether CrowdStrike Falcon is deployed to environments""" + + image: Optional[str] + """image is the CrowdStrike Falcon sensor container image reference""" + + tags: Optional[str] + """tags are optional tags to apply to the Falcon sensor""" + + +class SecurityAgentPolicy(TypedDict, total=False): + """security_agent_policy contains security agent configuration updates""" + + crowdstrike: Optional[SecurityAgentPolicyCrowdstrike] + """crowdstrike contains CrowdStrike Falcon configuration updates""" diff --git a/src/gitpod/types/organizations/security_agent_policy.py b/src/gitpod/types/organizations/security_agent_policy.py new file mode 100644 index 00000000..f10c816e --- /dev/null +++ b/src/gitpod/types/organizations/security_agent_policy.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .crowd_strike_config import CrowdStrikeConfig + +__all__ = ["SecurityAgentPolicy"] + + +class SecurityAgentPolicy(BaseModel): + """ + SecurityAgentPolicy contains security agent configuration for an organization. + When enabled, security agents are automatically deployed to all environments. + """ + + crowdstrike: Optional[CrowdStrikeConfig] = None + """crowdstrike contains CrowdStrike Falcon configuration""" diff --git a/src/gitpod/types/organizations/sso_configuration.py b/src/gitpod/types/organizations/sso_configuration.py index 4ae99127..7f7f70b7 100644 --- a/src/gitpod/types/organizations/sso_configuration.py +++ b/src/gitpod/types/organizations/sso_configuration.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from pydantic import Field as FieldInfo @@ -32,4 +32,8 @@ class SSOConfiguration(BaseModel): client_id: Optional[str] = FieldInfo(alias="clientId", default=None) """client_id is the client ID of the OIDC application set on the IdP""" + display_name: Optional[str] = FieldInfo(alias="displayName", default=None) + email_domain: Optional[str] = FieldInfo(alias="emailDomain", default=None) + + email_domains: Optional[List[str]] = FieldInfo(alias="emailDomains", default=None) diff --git a/src/gitpod/types/organizations/sso_configuration_create_params.py b/src/gitpod/types/organizations/sso_configuration_create_params.py index cd14f5c0..04f39fb1 100644 --- a/src/gitpod/types/organizations/sso_configuration_create_params.py +++ b/src/gitpod/types/organizations/sso_configuration_create_params.py @@ -2,8 +2,10 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo __all__ = ["SSOConfigurationCreateParams"] @@ -16,10 +18,14 @@ class SSOConfigurationCreateParams(TypedDict, total=False): client_secret: Required[Annotated[str, PropertyInfo(alias="clientSecret")]] """client_secret is the client secret of the OIDC application set on the IdP""" - email_domain: Required[Annotated[str, PropertyInfo(alias="emailDomain")]] - """email_domain is the domain that is allowed to sign in to the organization""" - issuer_url: Required[Annotated[str, PropertyInfo(alias="issuerUrl")]] """issuer_url is the URL of the IdP issuer""" organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + + display_name: Annotated[str, PropertyInfo(alias="displayName")] + + email_domain: Annotated[Optional[str], PropertyInfo(alias="emailDomain")] + """email_domain is the domain that is allowed to sign in to the organization""" + + email_domains: Annotated[SequenceNotStr[str], PropertyInfo(alias="emailDomains")] diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py index 4af2dab7..998789ab 100644 --- a/src/gitpod/types/organizations/sso_configuration_update_params.py +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -5,6 +5,7 @@ from typing import Dict, Optional from typing_extensions import Required, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo from .sso_configuration_state import SSOConfigurationState @@ -24,8 +25,12 @@ class SSOConfigurationUpdateParams(TypedDict, total=False): client_secret: Annotated[Optional[str], PropertyInfo(alias="clientSecret")] """client_secret is the client secret of the SSO provider""" + display_name: Annotated[Optional[str], PropertyInfo(alias="displayName")] + email_domain: Annotated[Optional[str], PropertyInfo(alias="emailDomain")] + email_domains: Annotated[SequenceNotStr[str], PropertyInfo(alias="emailDomains")] + issuer_url: Annotated[Optional[str], PropertyInfo(alias="issuerUrl")] """issuer_url is the URL of the IdP issuer""" diff --git a/src/gitpod/types/prebuild.py b/src/gitpod/types/prebuild.py new file mode 100644 index 00000000..eb1eaddd --- /dev/null +++ b/src/gitpod/types/prebuild.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .prebuild_spec import PrebuildSpec +from .prebuild_status import PrebuildStatus +from .prebuild_metadata import PrebuildMetadata + +__all__ = ["Prebuild"] + + +class Prebuild(BaseModel): + """ + Prebuild represents a prebuild for a project that creates a snapshot + for faster environment startup times. + """ + + metadata: PrebuildMetadata + """metadata contains organizational and ownership information""" + + spec: PrebuildSpec + """spec contains the configuration used to create this prebuild""" + + status: PrebuildStatus + """status contains the current status and progress of the prebuild""" + + id: Optional[str] = None + """id is the unique identifier for the prebuild""" diff --git a/src/gitpod/types/prebuild_cancel_params.py b/src/gitpod/types/prebuild_cancel_params.py new file mode 100644 index 00000000..476eb099 --- /dev/null +++ b/src/gitpod/types/prebuild_cancel_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildCancelParams"] + + +class PrebuildCancelParams(TypedDict, total=False): + prebuild_id: Required[Annotated[str, PropertyInfo(alias="prebuildId")]] + """prebuild_id specifies the prebuild to cancel""" diff --git a/src/gitpod/types/prebuild_cancel_response.py b/src/gitpod/types/prebuild_cancel_response.py new file mode 100644 index 00000000..9f388e17 --- /dev/null +++ b/src/gitpod/types/prebuild_cancel_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel +from .prebuild import Prebuild + +__all__ = ["PrebuildCancelResponse"] + + +class PrebuildCancelResponse(BaseModel): + prebuild: Prebuild + """ + Prebuild represents a prebuild for a project that creates a snapshot for faster + environment startup times. + """ diff --git a/src/gitpod/types/prebuild_create_logs_token_params.py b/src/gitpod/types/prebuild_create_logs_token_params.py new file mode 100644 index 00000000..ea9f1e18 --- /dev/null +++ b/src/gitpod/types/prebuild_create_logs_token_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildCreateLogsTokenParams"] + + +class PrebuildCreateLogsTokenParams(TypedDict, total=False): + prebuild_id: Required[Annotated[str, PropertyInfo(alias="prebuildId")]] + """prebuild_id specifies the prebuild for which the logs token should be created. + + +required + """ diff --git a/src/gitpod/types/prebuild_create_logs_token_response.py b/src/gitpod/types/prebuild_create_logs_token_response.py new file mode 100644 index 00000000..afbbaafc --- /dev/null +++ b/src/gitpod/types/prebuild_create_logs_token_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["PrebuildCreateLogsTokenResponse"] + + +class PrebuildCreateLogsTokenResponse(BaseModel): + access_token: str = FieldInfo(alias="accessToken") + """access_token is the token that can be used to access the logs of the prebuild""" diff --git a/src/gitpod/types/prebuild_create_params.py b/src/gitpod/types/prebuild_create_params.py new file mode 100644 index 00000000..038f30e4 --- /dev/null +++ b/src/gitpod/types/prebuild_create_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo +from .prebuild_spec_param import PrebuildSpecParam + +__all__ = ["PrebuildCreateParams"] + + +class PrebuildCreateParams(TypedDict, total=False): + project_id: Required[Annotated[str, PropertyInfo(alias="projectId")]] + """project_id specifies the project to create a prebuild for""" + + spec: Required[PrebuildSpecParam] + """spec contains the configuration for creating the prebuild""" + + environment_class_id: Annotated[Optional[str], PropertyInfo(alias="environmentClassId")] + """ + environment_class_id specifies which environment class to use for the prebuild. + If not specified, uses the project's default environment class. + """ diff --git a/src/gitpod/types/prebuild_create_response.py b/src/gitpod/types/prebuild_create_response.py new file mode 100644 index 00000000..c7fdef0d --- /dev/null +++ b/src/gitpod/types/prebuild_create_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel +from .prebuild import Prebuild + +__all__ = ["PrebuildCreateResponse"] + + +class PrebuildCreateResponse(BaseModel): + prebuild: Prebuild + """ + Prebuild represents a prebuild for a project that creates a snapshot for faster + environment startup times. + """ diff --git a/src/gitpod/types/prebuild_delete_params.py b/src/gitpod/types/prebuild_delete_params.py new file mode 100644 index 00000000..8b19ddc7 --- /dev/null +++ b/src/gitpod/types/prebuild_delete_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildDeleteParams"] + + +class PrebuildDeleteParams(TypedDict, total=False): + prebuild_id: Required[Annotated[str, PropertyInfo(alias="prebuildId")]] + """prebuild_id specifies the prebuild to delete""" diff --git a/src/gitpod/types/prebuild_list_params.py b/src/gitpod/types/prebuild_list_params.py new file mode 100644 index 00000000..59075354 --- /dev/null +++ b/src/gitpod/types/prebuild_list_params.py @@ -0,0 +1,50 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo +from .prebuild_phase import PrebuildPhase + +__all__ = ["PrebuildListParams", "Filter", "Pagination"] + + +class PrebuildListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + """filter contains the filter options for listing prebuilds""" + + pagination: Pagination + """pagination contains the pagination options for listing prebuilds""" + + +class Filter(TypedDict, total=False): + """filter contains the filter options for listing prebuilds""" + + phases: List[PrebuildPhase] + """phases filters prebuilds by their current phase""" + + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] + """project_ids filters prebuilds to specific projects""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing prebuilds""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/prebuild_metadata.py b/src/gitpod/types/prebuild_metadata.py new file mode 100644 index 00000000..80e89bd4 --- /dev/null +++ b/src/gitpod/types/prebuild_metadata.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject +from .prebuild_trigger import PrebuildTrigger + +__all__ = ["PrebuildMetadata"] + + +class PrebuildMetadata(BaseModel): + """PrebuildMetadata contains metadata about the prebuild""" + + created_at: datetime = FieldInfo(alias="createdAt") + """created_at is when the prebuild was created""" + + creator: Subject + """ + creator is the identity of who created the prebuild. For manual prebuilds, this + is the user who triggered it. For scheduled prebuilds, this is the configured + executor. + """ + + updated_at: datetime = FieldInfo(alias="updatedAt") + """updated_at is when the prebuild was last updated""" + + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """ + environment_class_id is the environment class used to create this prebuild. + While the prebuild is created with a specific environment class, environments + with different classes (e.g., smaller or larger instance sizes) can be created + from the same prebuild, as long as they run on the same runner. If not specified + in create requests, uses the project's default environment class. + """ + + executor: Optional[Subject] = None + """ + executor is the identity used to run the prebuild. The executor's SCM + credentials are used to clone the repository. If not set, the creator's identity + is used. + """ + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that owns the prebuild""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """project_id is the ID of the project this prebuild was created for""" + + triggered_by: Optional[PrebuildTrigger] = FieldInfo(alias="triggeredBy", default=None) + """trigger describes the trigger that created this prebuild.""" diff --git a/src/gitpod/types/prebuild_phase.py b/src/gitpod/types/prebuild_phase.py new file mode 100644 index 00000000..f4066cf4 --- /dev/null +++ b/src/gitpod/types/prebuild_phase.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["PrebuildPhase"] + +PrebuildPhase: TypeAlias = Literal[ + "PREBUILD_PHASE_UNSPECIFIED", + "PREBUILD_PHASE_PENDING", + "PREBUILD_PHASE_STARTING", + "PREBUILD_PHASE_RUNNING", + "PREBUILD_PHASE_STOPPING", + "PREBUILD_PHASE_SNAPSHOTTING", + "PREBUILD_PHASE_COMPLETED", + "PREBUILD_PHASE_FAILED", + "PREBUILD_PHASE_CANCELLING", + "PREBUILD_PHASE_CANCELLED", + "PREBUILD_PHASE_DELETING", + "PREBUILD_PHASE_DELETED", +] diff --git a/src/gitpod/types/prebuild_retrieve_params.py b/src/gitpod/types/prebuild_retrieve_params.py new file mode 100644 index 00000000..36f2f51d --- /dev/null +++ b/src/gitpod/types/prebuild_retrieve_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildRetrieveParams"] + + +class PrebuildRetrieveParams(TypedDict, total=False): + prebuild_id: Required[Annotated[str, PropertyInfo(alias="prebuildId")]] + """prebuild_id specifies the prebuild to retrieve""" diff --git a/src/gitpod/types/prebuild_retrieve_response.py b/src/gitpod/types/prebuild_retrieve_response.py new file mode 100644 index 00000000..d3a23009 --- /dev/null +++ b/src/gitpod/types/prebuild_retrieve_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel +from .prebuild import Prebuild + +__all__ = ["PrebuildRetrieveResponse"] + + +class PrebuildRetrieveResponse(BaseModel): + prebuild: Prebuild + """ + Prebuild represents a prebuild for a project that creates a snapshot for faster + environment startup times. + """ diff --git a/src/gitpod/types/prebuild_spec.py b/src/gitpod/types/prebuild_spec.py new file mode 100644 index 00000000..478bdd62 --- /dev/null +++ b/src/gitpod/types/prebuild_spec.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .prebuild_phase import PrebuildPhase + +__all__ = ["PrebuildSpec"] + + +class PrebuildSpec(BaseModel): + """PrebuildSpec contains the configuration used to create a prebuild""" + + desired_phase: Optional[PrebuildPhase] = FieldInfo(alias="desiredPhase", default=None) + """ + desired_phase is the desired phase of the prebuild. Used to signal cancellation + or other state changes. This field is managed by the API and reconciler. + """ + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + """ + spec_version is incremented each time the spec is updated. Used for optimistic + concurrency control. + """ + + timeout: Optional[str] = None + """ + timeout is the maximum time allowed for the prebuild to complete. Defaults to 60 + minutes if not specified. Maximum allowed timeout is 2 hours. + """ diff --git a/src/gitpod/types/prebuild_spec_param.py b/src/gitpod/types/prebuild_spec_param.py new file mode 100644 index 00000000..3894f048 --- /dev/null +++ b/src/gitpod/types/prebuild_spec_param.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .prebuild_phase import PrebuildPhase + +__all__ = ["PrebuildSpecParam"] + + +class PrebuildSpecParam(TypedDict, total=False): + """PrebuildSpec contains the configuration used to create a prebuild""" + + desired_phase: Annotated[PrebuildPhase, PropertyInfo(alias="desiredPhase")] + """ + desired_phase is the desired phase of the prebuild. Used to signal cancellation + or other state changes. This field is managed by the API and reconciler. + """ + + spec_version: Annotated[str, PropertyInfo(alias="specVersion")] + """ + spec_version is incremented each time the spec is updated. Used for optimistic + concurrency control. + """ + + timeout: str + """ + timeout is the maximum time allowed for the prebuild to complete. Defaults to 60 + minutes if not specified. Maximum allowed timeout is 2 hours. + """ diff --git a/src/gitpod/types/prebuild_status.py b/src/gitpod/types/prebuild_status.py new file mode 100644 index 00000000..70592150 --- /dev/null +++ b/src/gitpod/types/prebuild_status.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .prebuild_phase import PrebuildPhase + +__all__ = ["PrebuildStatus"] + + +class PrebuildStatus(BaseModel): + """PrebuildStatus contains the current status and progress of a prebuild""" + + phase: PrebuildPhase + """phase is the current phase of the prebuild lifecycle""" + + completion_time: Optional[datetime] = FieldInfo(alias="completionTime", default=None) + """completion_time is when the prebuild completed (successfully or with failure)""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """ + environment_id is the ID of the environment used to create this prebuild. This + field is set when the prebuild environment is created. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains details about why the prebuild failed""" + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """ + log_url provides access to prebuild logs. During prebuild execution, this + references the environment logs. After completion, this may reference archived + logs. + """ + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """ + status_version is incremented each time the status is updated. Used for + optimistic concurrency control. + """ + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """ + warning_message contains warnings from the prebuild environment that indicate + something went wrong but the prebuild could still complete. For example, the + devcontainer failed to build but the environment is still usable. These warnings + will likely affect any environment started from this prebuild. + """ diff --git a/src/gitpod/types/prebuild_trigger.py b/src/gitpod/types/prebuild_trigger.py new file mode 100644 index 00000000..dc961c88 --- /dev/null +++ b/src/gitpod/types/prebuild_trigger.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["PrebuildTrigger"] + +PrebuildTrigger: TypeAlias = Literal[ + "PREBUILD_TRIGGER_UNSPECIFIED", "PREBUILD_TRIGGER_MANUAL", "PREBUILD_TRIGGER_SCHEDULED" +] diff --git a/src/gitpod/types/project.py b/src/gitpod/types/project.py index 80e2586f..f5039be5 100644 --- a/src/gitpod/types/project.py +++ b/src/gitpod/types/project.py @@ -5,10 +5,12 @@ from pydantic import Field as FieldInfo from .._models import BaseModel +from .project_phase import ProjectPhase from .shared.subject import Subject from .project_metadata import ProjectMetadata from .environment_initializer import EnvironmentInitializer -from .project_environment_class import ProjectEnvironmentClass +from .project_prebuild_configuration import ProjectPrebuildConfiguration +from .shared.project_environment_class import ProjectEnvironmentClass __all__ = ["Project", "UsedBy"] @@ -26,6 +28,7 @@ class UsedBy(BaseModel): class Project(BaseModel): environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") + """Use `environment_classes` instead.""" id: Optional[str] = None """id is the unique identifier for the project""" @@ -36,17 +39,31 @@ class Project(BaseModel): root """ + desired_phase: Optional[ProjectPhase] = FieldInfo(alias="desiredPhase", default=None) + """ + desired_phase is the desired phase of the project When set to DELETED, the + project is pending deletion + """ + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo root """ + environment_classes: Optional[List[ProjectEnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) + """environment_classes is the list of environment classes for the project""" + initializer: Optional[EnvironmentInitializer] = None """initializer is the content initializer""" metadata: Optional[ProjectMetadata] = None + prebuild_configuration: Optional[ProjectPrebuildConfiguration] = FieldInfo( + alias="prebuildConfiguration", default=None + ) + """prebuild_configuration defines how prebuilds are created for this project.""" + technical_description: Optional[str] = FieldInfo(alias="technicalDescription", default=None) """ technical_description is a detailed technical description of the project This diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index ff3b8b27..fa9ed5b0 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -6,14 +6,12 @@ from .._utils import PropertyInfo from .environment_initializer_param import EnvironmentInitializerParam -from .project_environment_class_param import ProjectEnvironmentClassParam +from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam __all__ = ["ProjectCreateParams"] class ProjectCreateParams(TypedDict, total=False): - environment_class: Required[Annotated[ProjectEnvironmentClassParam, PropertyInfo(alias="environmentClass")]] - initializer: Required[EnvironmentInitializerParam] """initializer is the content initializer""" @@ -39,6 +37,12 @@ class ProjectCreateParams(TypedDict, total=False): name: str + prebuild_configuration: Annotated[ProjectPrebuildConfigurationParam, PropertyInfo(alias="prebuildConfiguration")] + """ + prebuild_configuration defines how prebuilds are created for this project. If + not set, prebuilds are disabled for the project. + """ + technical_description: Annotated[str, PropertyInfo(alias="technicalDescription")] """ technical_description is a detailed technical description of the project This diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py index ccd432f5..ea25cc93 100644 --- a/src/gitpod/types/project_list_params.py +++ b/src/gitpod/types/project_list_params.py @@ -25,6 +25,18 @@ class Filter(TypedDict, total=False): project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] """project_ids filters the response to only projects with these IDs""" + runner_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="runnerIds")] + """ + runner_ids filters the response to only projects that use environment classes + from these runners + """ + + search: str + """ + search performs case-insensitive search across project name, project ID, and + repository name + """ + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing organizations""" diff --git a/src/gitpod/types/project_phase.py b/src/gitpod/types/project_phase.py new file mode 100644 index 00000000..b6f34bae --- /dev/null +++ b/src/gitpod/types/project_phase.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ProjectPhase"] + +ProjectPhase: TypeAlias = Literal["PROJECT_PHASE_UNSPECIFIED", "PROJECT_PHASE_ACTIVE", "PROJECT_PHASE_DELETED"] diff --git a/src/gitpod/types/project_prebuild_configuration.py b/src/gitpod/types/project_prebuild_configuration.py new file mode 100644 index 00000000..53a227de --- /dev/null +++ b/src/gitpod/types/project_prebuild_configuration.py @@ -0,0 +1,74 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject + +__all__ = ["ProjectPrebuildConfiguration", "Trigger", "TriggerDailySchedule"] + + +class TriggerDailySchedule(BaseModel): + """ + daily_schedule triggers a prebuild once per day at the specified hour (UTC). + The actual start time may vary slightly to distribute system load. + """ + + hour_utc: Optional[int] = FieldInfo(alias="hourUtc", default=None) + """ + hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The + actual start time may be adjusted by a few minutes to balance system load. + """ + + +class Trigger(BaseModel): + """trigger defines when prebuilds should be created.""" + + daily_schedule: TriggerDailySchedule = FieldInfo(alias="dailySchedule") + """ + daily_schedule triggers a prebuild once per day at the specified hour (UTC). The + actual start time may vary slightly to distribute system load. + """ + + +class ProjectPrebuildConfiguration(BaseModel): + """ + ProjectPrebuildConfiguration defines how prebuilds are created for a project. + Prebuilds create environment snapshots that enable faster environment startup times. + """ + + enabled: Optional[bool] = None + """ + enabled controls whether prebuilds are created for this project. When disabled, + no automatic prebuilds will be triggered. + """ + + enable_jetbrains_warmup: Optional[bool] = FieldInfo(alias="enableJetbrainsWarmup", default=None) + """ + enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during + prebuilds. + """ + + environment_class_ids: Optional[List[str]] = FieldInfo(alias="environmentClassIds", default=None) + """ + environment_class_ids specifies which environment classes should have prebuilds + created. If empty, no prebuilds are created. + """ + + executor: Optional[Subject] = None + """ + executor specifies who runs prebuilds for this project. The executor's SCM + credentials are used to clone the repository. If not set, defaults to the + project creator. + """ + + timeout: Optional[str] = None + """ + timeout is the maximum duration allowed for a prebuild to complete. If not + specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. + """ + + trigger: Optional[Trigger] = None + """trigger defines when prebuilds should be created.""" diff --git a/src/gitpod/types/project_prebuild_configuration_param.py b/src/gitpod/types/project_prebuild_configuration_param.py new file mode 100644 index 00000000..a39e531a --- /dev/null +++ b/src/gitpod/types/project_prebuild_configuration_param.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo +from .shared_params.subject import Subject + +__all__ = ["ProjectPrebuildConfigurationParam", "Trigger", "TriggerDailySchedule"] + + +class TriggerDailySchedule(TypedDict, total=False): + """ + daily_schedule triggers a prebuild once per day at the specified hour (UTC). + The actual start time may vary slightly to distribute system load. + """ + + hour_utc: Annotated[int, PropertyInfo(alias="hourUtc")] + """ + hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The + actual start time may be adjusted by a few minutes to balance system load. + """ + + +class Trigger(TypedDict, total=False): + """trigger defines when prebuilds should be created.""" + + daily_schedule: Required[Annotated[TriggerDailySchedule, PropertyInfo(alias="dailySchedule")]] + """ + daily_schedule triggers a prebuild once per day at the specified hour (UTC). The + actual start time may vary slightly to distribute system load. + """ + + +class ProjectPrebuildConfigurationParam(TypedDict, total=False): + """ + ProjectPrebuildConfiguration defines how prebuilds are created for a project. + Prebuilds create environment snapshots that enable faster environment startup times. + """ + + enabled: bool + """ + enabled controls whether prebuilds are created for this project. When disabled, + no automatic prebuilds will be triggered. + """ + + enable_jetbrains_warmup: Annotated[bool, PropertyInfo(alias="enableJetbrainsWarmup")] + """ + enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during + prebuilds. + """ + + environment_class_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentClassIds")] + """ + environment_class_ids specifies which environment classes should have prebuilds + created. If empty, no prebuilds are created. + """ + + executor: Subject + """ + executor specifies who runs prebuilds for this project. The executor's SCM + credentials are used to clone the repository. If not set, defaults to the + project creator. + """ + + timeout: str + """ + timeout is the maximum duration allowed for a prebuild to complete. If not + specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. + """ + + trigger: Trigger + """trigger defines when prebuilds should be created.""" diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py index 214d3fa8..c27e98a6 100644 --- a/src/gitpod/types/project_update_params.py +++ b/src/gitpod/types/project_update_params.py @@ -7,7 +7,7 @@ from .._utils import PropertyInfo from .environment_initializer_param import EnvironmentInitializerParam -from .project_environment_class_param import ProjectEnvironmentClassParam +from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam __all__ = ["ProjectUpdateParams"] @@ -33,13 +33,20 @@ class ProjectUpdateParams(TypedDict, total=False): ``` """ - environment_class: Annotated[Optional[ProjectEnvironmentClassParam], PropertyInfo(alias="environmentClass")] - initializer: Optional[EnvironmentInitializerParam] """initializer is the content initializer""" name: Optional[str] + prebuild_configuration: Annotated[ + Optional[ProjectPrebuildConfigurationParam], PropertyInfo(alias="prebuildConfiguration") + ] + """ + prebuild_configuration defines how prebuilds are created for this project. If + not provided, the existing prebuild configuration is not modified. To disable + prebuilds, set enabled to false. + """ + project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" diff --git a/src/gitpod/types/projects/__init__.py b/src/gitpod/types/projects/__init__.py index f6f8d0b8..2620dfc9 100644 --- a/src/gitpod/types/projects/__init__.py +++ b/src/gitpod/types/projects/__init__.py @@ -10,3 +10,5 @@ from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse from .policy_update_response import PolicyUpdateResponse as PolicyUpdateResponse +from .environment_clase_list_params import EnvironmentClaseListParams as EnvironmentClaseListParams +from .environment_clase_update_params import EnvironmentClaseUpdateParams as EnvironmentClaseUpdateParams diff --git a/src/gitpod/types/projects/environment_clase_list_params.py b/src/gitpod/types/projects/environment_clase_list_params.py new file mode 100644 index 00000000..01df8bf0 --- /dev/null +++ b/src/gitpod/types/projects/environment_clase_list_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["EnvironmentClaseListParams", "Pagination"] + + +class EnvironmentClaseListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + pagination: Pagination + """pagination contains the pagination options for listing project policies""" + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing project policies""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/projects/environment_clase_update_params.py b/src/gitpod/types/projects/environment_clase_update_params.py new file mode 100644 index 00000000..754fcc02 --- /dev/null +++ b/src/gitpod/types/projects/environment_clase_update_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from ..shared_params.project_environment_class import ProjectEnvironmentClass + +__all__ = ["EnvironmentClaseUpdateParams"] + + +class EnvironmentClaseUpdateParams(TypedDict, total=False): + project_environment_classes: Annotated[ + Iterable[ProjectEnvironmentClass], PropertyInfo(alias="projectEnvironmentClasses") + ] + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" diff --git a/src/gitpod/types/prompt.py b/src/gitpod/types/prompt.py new file mode 100644 index 00000000..963771ee --- /dev/null +++ b/src/gitpod/types/prompt.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .prompt_spec import PromptSpec +from .prompt_metadata import PromptMetadata + +__all__ = ["Prompt"] + + +class Prompt(BaseModel): + id: Optional[str] = None + + metadata: Optional[PromptMetadata] = None + + spec: Optional[PromptSpec] = None diff --git a/src/gitpod/types/prompt_metadata.py b/src/gitpod/types/prompt_metadata.py new file mode 100644 index 00000000..66d65b16 --- /dev/null +++ b/src/gitpod/types/prompt_metadata.py @@ -0,0 +1,209 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject + +__all__ = ["PromptMetadata"] + + +class PromptMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[Subject] = None + """creator is the identity of the prompt creator""" + + description: Optional[str] = None + """description is a description of what the prompt does""" + + name: Optional[str] = None + """name is the human readable name of the prompt""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the prompt""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ diff --git a/src/gitpod/types/prompt_spec.py b/src/gitpod/types/prompt_spec.py new file mode 100644 index 00000000..7db3c112 --- /dev/null +++ b/src/gitpod/types/prompt_spec.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["PromptSpec"] + + +class PromptSpec(BaseModel): + command: Optional[str] = None + """command is the unique command string within the organization""" + + is_command: Optional[bool] = FieldInfo(alias="isCommand", default=None) + """is_command indicates if this prompt is a command""" + + is_template: Optional[bool] = FieldInfo(alias="isTemplate", default=None) + """is_template indicates if this prompt is a template""" + + prompt: Optional[str] = None + """prompt is the content of the prompt""" diff --git a/src/gitpod/types/request_info_param.py b/src/gitpod/types/request_info_param.py new file mode 100644 index 00000000..8e764855 --- /dev/null +++ b/src/gitpod/types/request_info_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RequestInfoParam"] + + +class RequestInfoParam(TypedDict, total=False): + """Request information (Sentry-compatible)""" + + data: str + """Request body (truncated if large)""" + + headers: Dict[str, str] + """Request headers""" + + method: str + """HTTP method""" + + query_string: Annotated[Dict[str, str], PropertyInfo(alias="queryString")] + """Query parameters""" + + url: str + """Request URL""" diff --git a/src/gitpod/types/runner.py b/src/gitpod/types/runner.py index ec169a36..ff396c37 100644 --- a/src/gitpod/types/runner.py +++ b/src/gitpod/types/runner.py @@ -33,6 +33,12 @@ class Runner(BaseModel): runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + runner_manager_id: Optional[str] = FieldInfo(alias="runnerManagerId", default=None) + """ + The runner manager id specifies the runner manager for the managed runner. This + field is only set for managed runners. + """ + spec: Optional[RunnerSpec] = None """The runner's specification""" diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py index 0a668725..b63ac784 100644 --- a/src/gitpod/types/runner_capability.py +++ b/src/gitpod/types/runner_capability.py @@ -11,4 +11,5 @@ "RUNNER_CAPABILITY_AGENT_EXECUTION", "RUNNER_CAPABILITY_ALLOW_ENV_TOKEN_POPULATION", "RUNNER_CAPABILITY_DEFAULT_DEV_CONTAINER_IMAGE", + "RUNNER_CAPABILITY_ENVIRONMENT_SNAPSHOT", ] diff --git a/src/gitpod/types/runner_configuration.py b/src/gitpod/types/runner_configuration.py index 4f91d552..4e4cf1e6 100644 --- a/src/gitpod/types/runner_configuration.py +++ b/src/gitpod/types/runner_configuration.py @@ -20,7 +20,7 @@ class RunnerConfiguration(BaseModel): """ devcontainer_image_cache_enabled controls whether the devcontainer build cache is enabled for this runner. Only takes effect on supported runners, currently - only AWS EC2 runners. + only AWS EC2 and Gitpod-managed runners. """ log_level: Optional[LogLevel] = FieldInfo(alias="logLevel", default=None) diff --git a/src/gitpod/types/runner_configuration_param.py b/src/gitpod/types/runner_configuration_param.py index 7ba49ee7..d29c11fc 100644 --- a/src/gitpod/types/runner_configuration_param.py +++ b/src/gitpod/types/runner_configuration_param.py @@ -20,7 +20,7 @@ class RunnerConfigurationParam(TypedDict, total=False): """ devcontainer_image_cache_enabled controls whether the devcontainer build cache is enabled for this runner. Only takes effect on supported runners, currently - only AWS EC2 runners. + only AWS EC2 and Gitpod-managed runners. """ log_level: Annotated[LogLevel, PropertyInfo(alias="logLevel")] diff --git a/src/gitpod/types/runner_create_logs_token_params.py b/src/gitpod/types/runner_create_logs_token_params.py new file mode 100644 index 00000000..33e853b7 --- /dev/null +++ b/src/gitpod/types/runner_create_logs_token_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerCreateLogsTokenParams"] + + +class RunnerCreateLogsTokenParams(TypedDict, total=False): + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """runner_id specifies the runner for which the logs token should be created. + + +required + """ diff --git a/src/gitpod/types/runner_create_logs_token_response.py b/src/gitpod/types/runner_create_logs_token_response.py new file mode 100644 index 00000000..8bfe41f7 --- /dev/null +++ b/src/gitpod/types/runner_create_logs_token_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerCreateLogsTokenResponse"] + + +class RunnerCreateLogsTokenResponse(BaseModel): + access_token: str = FieldInfo(alias="accessToken") + """ + access_token is the token that can be used to access the logs and support bundle + of the runner + """ diff --git a/src/gitpod/types/runner_parse_context_url_response.py b/src/gitpod/types/runner_parse_context_url_response.py index e34f770b..c712e408 100644 --- a/src/gitpod/types/runner_parse_context_url_response.py +++ b/src/gitpod/types/runner_parse_context_url_response.py @@ -6,7 +6,7 @@ from .._models import BaseModel -__all__ = ["RunnerParseContextURLResponse", "Git"] +__all__ = ["RunnerParseContextURLResponse", "Git", "Issue", "Pr", "PullRequest", "PullRequestRepository"] class Git(BaseModel): @@ -22,13 +22,93 @@ class Git(BaseModel): repo: Optional[str] = None + tag: Optional[str] = None + upstream_remote_url: Optional[str] = FieldInfo(alias="upstreamRemoteUrl", default=None) +class Issue(BaseModel): + id: Optional[str] = None + """id is the source system's ID of this issue, e.g. BNFRD-6100""" + + title: Optional[str] = None + + +class Pr(BaseModel): + """Deprecated: Use top-level PullRequest message instead""" + + id: Optional[str] = None + + from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None) + + title: Optional[str] = None + + to_branch: Optional[str] = FieldInfo(alias="toBranch", default=None) + + +class PullRequestRepository(BaseModel): + """Repository information""" + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + + host: Optional[str] = None + + name: Optional[str] = None + + owner: Optional[str] = None + + +class PullRequest(BaseModel): + """ + PullRequest represents pull request metadata from source control systems. + This message is used across workflow triggers, executions, and agent contexts + to maintain consistent PR information throughout the system. + """ + + id: Optional[str] = None + """Unique identifier from the source system (e.g., "123" for GitHub PR #123)""" + + author: Optional[str] = None + """Author name as provided by the SCM system""" + + from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None) + """Source branch name (the branch being merged from)""" + + repository: Optional[PullRequestRepository] = None + """Repository information""" + + title: Optional[str] = None + """Pull request title""" + + to_branch: Optional[str] = FieldInfo(alias="toBranch", default=None) + """Target branch name (the branch being merged into)""" + + url: Optional[str] = None + """Pull request URL (e.g., "https://github.com/owner/repo/pull/123")""" + + class RunnerParseContextURLResponse(BaseModel): git: Optional[Git] = None + issue: Optional[Issue] = None + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + pr: Optional[Pr] = None + """Deprecated: Use top-level PullRequest message instead""" + project_ids: Optional[List[str]] = FieldInfo(alias="projectIds", default=None) """project_ids is a list of projects to which the context URL belongs to.""" + + pull_request: Optional[PullRequest] = FieldInfo(alias="pullRequest", default=None) + """ + PullRequest represents pull request metadata from source control systems. This + message is used across workflow triggers, executions, and agent contexts to + maintain consistent PR information throughout the system. + """ + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + """ + scm_id is the unique identifier of the SCM provider (e.g., "github", "gitlab", + "bitbucket") + """ diff --git a/src/gitpod/types/runner_provider.py b/src/gitpod/types/runner_provider.py index 8f8efef0..f0730df4 100644 --- a/src/gitpod/types/runner_provider.py +++ b/src/gitpod/types/runner_provider.py @@ -10,4 +10,5 @@ "RUNNER_PROVIDER_LINUX_HOST", "RUNNER_PROVIDER_DESKTOP_MAC", "RUNNER_PROVIDER_MANAGED", + "RUNNER_PROVIDER_GCP", ] diff --git a/src/gitpod/types/runner_search_repositories_params.py b/src/gitpod/types/runner_search_repositories_params.py new file mode 100644 index 00000000..4b73cd0a --- /dev/null +++ b/src/gitpod/types/runner_search_repositories_params.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .search_mode import SearchMode + +__all__ = ["RunnerSearchRepositoriesParams", "Pagination"] + + +class RunnerSearchRepositoriesParams(TypedDict, total=False): + limit: int + """ + Maximum number of repositories to return. Default: 25, Maximum: 100 Deprecated: + Use pagination.page_size instead + """ + + pagination: Pagination + """Pagination parameters for repository search""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + scm_host: Annotated[str, PropertyInfo(alias="scmHost")] + """The SCM's host to retrieve repositories from""" + + search_mode: Annotated[SearchMode, PropertyInfo(alias="searchMode")] + """Search mode determines how search_string is interpreted""" + + search_string: Annotated[str, PropertyInfo(alias="searchString")] + """Search query - interpretation depends on search_mode""" + + +class Pagination(TypedDict, total=False): + """Pagination parameters for repository search""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runner_search_repositories_response.py b/src/gitpod/types/runner_search_repositories_response.py new file mode 100644 index 00000000..65597de3 --- /dev/null +++ b/src/gitpod/types/runner_search_repositories_response.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerSearchRepositoriesResponse", "Pagination", "Repository"] + + +class Pagination(BaseModel): + """Pagination information for the response""" + + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retrieving the next set of results. + + Empty if there are no more results + """ + + +class Repository(BaseModel): + name: Optional[str] = None + """Repository name (e.g., "my-project")""" + + url: Optional[str] = None + """Repository URL (e.g., "https://github.com/owner/my-project")""" + + +class RunnerSearchRepositoriesResponse(BaseModel): + last_page: Optional[int] = FieldInfo(alias="lastPage", default=None) + """Last page in the responses""" + + pagination: Optional[Pagination] = None + """Pagination information for the response""" + + repositories: Optional[List[Repository]] = None + """List of repositories matching the search criteria""" diff --git a/src/gitpod/types/runner_spec.py b/src/gitpod/types/runner_spec.py index 9fb48111..82da9949 100644 --- a/src/gitpod/types/runner_spec.py +++ b/src/gitpod/types/runner_spec.py @@ -6,6 +6,7 @@ from .._models import BaseModel from .runner_phase import RunnerPhase +from .runner_variant import RunnerVariant from .runner_configuration import RunnerConfiguration __all__ = ["RunnerSpec"] @@ -17,3 +18,6 @@ class RunnerSpec(BaseModel): desired_phase: Optional[RunnerPhase] = FieldInfo(alias="desiredPhase", default=None) """RunnerPhase represents the phase a runner is in""" + + variant: Optional[RunnerVariant] = None + """The runner's variant""" diff --git a/src/gitpod/types/runner_spec_param.py b/src/gitpod/types/runner_spec_param.py index c356eb32..bf953fdd 100644 --- a/src/gitpod/types/runner_spec_param.py +++ b/src/gitpod/types/runner_spec_param.py @@ -6,6 +6,7 @@ from .._utils import PropertyInfo from .runner_phase import RunnerPhase +from .runner_variant import RunnerVariant from .runner_configuration_param import RunnerConfigurationParam __all__ = ["RunnerSpecParam"] @@ -17,3 +18,6 @@ class RunnerSpecParam(TypedDict, total=False): desired_phase: Annotated[RunnerPhase, PropertyInfo(alias="desiredPhase")] """RunnerPhase represents the phase a runner is in""" + + variant: RunnerVariant + """The runner's variant""" diff --git a/src/gitpod/types/runner_status.py b/src/gitpod/types/runner_status.py index d1d2971f..cabcb489 100644 --- a/src/gitpod/types/runner_status.py +++ b/src/gitpod/types/runner_status.py @@ -29,6 +29,9 @@ class RunnerStatus(BaseModel): gateway_info: Optional[GatewayInfo] = FieldInfo(alias="gatewayInfo", default=None) """gateway_info is information about the gateway to which the runner is connected.""" + llm_url: Optional[str] = FieldInfo(alias="llmUrl", default=None) + """llm_url is the URL of the LLM service to which the runner is connected.""" + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) message: Optional[str] = None @@ -40,9 +43,19 @@ class RunnerStatus(BaseModel): phase: Optional[RunnerPhase] = None """The runner's reported phase""" + public_key: Optional[str] = FieldInfo(alias="publicKey", default=None) + """public_key is the runner's public key used for encryption (32 bytes)""" + region: Optional[str] = None """region is the region the runner is running in, if applicable.""" + support_bundle_url: Optional[str] = FieldInfo(alias="supportBundleUrl", default=None) + """ + support_bundle_url is the URL at which the runner support bundle can be + accessed. This URL provides access to pprof profiles and other debug + information. Only available for standalone runners. + """ + system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) diff --git a/src/gitpod/types/runner_variant.py b/src/gitpod/types/runner_variant.py new file mode 100644 index 00000000..da164aef --- /dev/null +++ b/src/gitpod/types/runner_variant.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["RunnerVariant"] + +RunnerVariant: TypeAlias = Literal["RUNNER_VARIANT_UNSPECIFIED", "RUNNER_VARIANT_STANDARD", "RUNNER_VARIANT_ENTERPRISE"] diff --git a/src/gitpod/types/runners/configuration_validate_params.py b/src/gitpod/types/runners/configuration_validate_params.py index 8afdbe5d..68c1664a 100644 --- a/src/gitpod/types/runners/configuration_validate_params.py +++ b/src/gitpod/types/runners/configuration_validate_params.py @@ -64,5 +64,13 @@ class ScmIntegration(TypedDict, total=False): integration is for """ + virtual_directory: Annotated[Optional[str], PropertyInfo(alias="virtualDirectory")] + """ + virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + """ + set_pydantic_config(ScmIntegration, {"arbitrary_types_allowed": True}) diff --git a/src/gitpod/types/runners/configurations/host_authentication_token.py b/src/gitpod/types/runners/configurations/host_authentication_token.py index 22e57609..1c531be8 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token.py @@ -1,11 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from datetime import datetime from pydantic import Field as FieldInfo from ...._models import BaseModel +from ...shared.subject import Subject from .host_authentication_token_source import HostAuthenticationTokenSource __all__ = ["HostAuthenticationToken"] @@ -108,8 +109,23 @@ class HostAuthenticationToken(BaseModel): host: Optional[str] = None + integration_id: Optional[str] = FieldInfo(alias="integrationId", default=None) + """links to integration instance""" + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + scopes: Optional[List[str]] = None + """token permissions""" + source: Optional[HostAuthenticationTokenSource] = None + """auth_type""" + + subject: Optional[Subject] = None + """ + Subject identifies the principal (user or service account) for the token Note: + actual token and refresh_token values are retrieved via + GetHostAuthenticationTokenValue API + """ user_id: Optional[str] = FieldInfo(alias="userId", default=None) + """Deprecated: Use principal_id and principal_type instead principal (user)""" diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py index f0ba68ee..9728b363 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py @@ -6,7 +6,9 @@ from datetime import datetime from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo +from ...shared_params.subject import Subject from .host_authentication_token_source import HostAuthenticationTokenSource __all__ = ["HostAuthenticationTokenCreateParams"] @@ -14,6 +16,7 @@ class HostAuthenticationTokenCreateParams(TypedDict, total=False): token: str + """stored encrypted, retrieved via GetHostAuthenticationTokenValue""" expires_at: Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")] """ @@ -109,10 +112,20 @@ class HostAuthenticationTokenCreateParams(TypedDict, total=False): host: str + integration_id: Annotated[str, PropertyInfo(alias="integrationId")] + refresh_token: Annotated[str, PropertyInfo(alias="refreshToken")] + """stored encrypted, retrieved via GetHostAuthenticationTokenValue""" runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + scopes: SequenceNotStr[str] + """Maximum 100 scopes allowed (101 for validation purposes)""" + source: HostAuthenticationTokenSource + subject: Subject + """Subject identifies the principal (user or service account) for the token""" + user_id: Annotated[str, PropertyInfo(alias="userId")] + """Deprecated: Use principal_id and principal_type instead""" diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py index 2576f40c..34a1fd4c 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py @@ -23,7 +23,11 @@ class HostAuthenticationTokenListParams(TypedDict, total=False): class Filter(TypedDict, total=False): runner_id: Annotated[Optional[str], PropertyInfo(alias="runnerId")] + subject_id: Annotated[Optional[str], PropertyInfo(alias="subjectId")] + """Filter by subject (user or service account)""" + user_id: Annotated[Optional[str], PropertyInfo(alias="userId")] + """Deprecated: Use principal_id instead""" class Pagination(TypedDict, total=False): diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py index 50dfcd27..eeb7ed93 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py @@ -6,6 +6,7 @@ from datetime import datetime from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo __all__ = ["HostAuthenticationTokenUpdateParams"] @@ -109,3 +110,5 @@ class HostAuthenticationTokenUpdateParams(TypedDict, total=False): """ refresh_token: Annotated[Optional[str], PropertyInfo(alias="refreshToken")] + + scopes: SequenceNotStr[str] diff --git a/src/gitpod/types/runners/configurations/scm_integration.py b/src/gitpod/types/runners/configurations/scm_integration.py index 05841dc2..f9ed1e61 100644 --- a/src/gitpod/types/runners/configurations/scm_integration.py +++ b/src/gitpod/types/runners/configurations/scm_integration.py @@ -27,3 +27,11 @@ class ScmIntegration(BaseModel): scm_id references the scm_id in the runner's configuration schema that this integration is for """ + + virtual_directory: Optional[str] = FieldInfo(alias="virtualDirectory", default=None) + """ + virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + """ diff --git a/src/gitpod/types/runners/configurations/scm_integration_create_params.py b/src/gitpod/types/runners/configurations/scm_integration_create_params.py index 8cbddf05..b9a0c846 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_create_params.py @@ -40,3 +40,11 @@ class ScmIntegrationCreateParams(TypedDict, total=False): scm_id references the scm_id in the runner's configuration schema that this integration is for """ + + virtual_directory: Annotated[Optional[str], PropertyInfo(alias="virtualDirectory")] + """ + virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + """ diff --git a/src/gitpod/types/runners/configurations/scm_integration_update_params.py b/src/gitpod/types/runners/configurations/scm_integration_update_params.py index 706496de..887fa077 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_update_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_update_params.py @@ -44,3 +44,11 @@ class ScmIntegrationUpdateParams(TypedDict, total=False): This might lead to users being unable to access their repositories until they re-authenticate. """ + + virtual_directory: Annotated[Optional[str], PropertyInfo(alias="virtualDirectory")] + """ + virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + """ diff --git a/src/gitpod/types/search_mode.py b/src/gitpod/types/search_mode.py new file mode 100644 index 00000000..5d2ba5bc --- /dev/null +++ b/src/gitpod/types/search_mode.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SearchMode"] + +SearchMode: TypeAlias = Literal["SEARCH_MODE_UNSPECIFIED", "SEARCH_MODE_KEYWORD", "SEARCH_MODE_NATIVE"] diff --git a/src/gitpod/types/secret.py b/src/gitpod/types/secret.py index f7bdd151..052d62a9 100644 --- a/src/gitpod/types/secret.py +++ b/src/gitpod/types/secret.py @@ -15,6 +15,9 @@ class Secret(BaseModel): id: Optional[str] = None + api_only: Optional[bool] = FieldInfo(alias="apiOnly", default=None) + """api_only indicates the secret is only available via API/CLI""" + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) """secret will be mounted as a registry secret""" diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index 61487b0c..37c24627 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -11,6 +11,13 @@ class SecretCreateParams(TypedDict, total=False): + api_only: Annotated[bool, PropertyInfo(alias="apiOnly")] + """ + api_only indicates the secret is only available via API/CLI. These secrets are + NOT automatically injected into services or devcontainers. Useful for secrets + that should only be consumed programmatically (e.g., by security agents). + """ + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] """ secret will be mounted as a docker config in the environment VM, mount will have diff --git a/src/gitpod/types/secret_scope.py b/src/gitpod/types/secret_scope.py index 0c5bc664..f66b6726 100644 --- a/src/gitpod/types/secret_scope.py +++ b/src/gitpod/types/secret_scope.py @@ -10,6 +10,9 @@ class SecretScope(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the Organization ID this Secret belongs to""" + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) """project_id is the Project ID this Secret belongs to""" diff --git a/src/gitpod/types/secret_scope_param.py b/src/gitpod/types/secret_scope_param.py index 85ee9a40..d68e56b5 100644 --- a/src/gitpod/types/secret_scope_param.py +++ b/src/gitpod/types/secret_scope_param.py @@ -10,6 +10,9 @@ class SecretScopeParam(TypedDict, total=False): + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the Organization ID this Secret belongs to""" + project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id is the Project ID this Secret belongs to""" diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index 4a5d70aa..50c13152 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -7,8 +7,10 @@ from .principal import Principal as Principal from .task_spec import TaskSpec as TaskSpec from .error_code import ErrorCode as ErrorCode +from .secret_ref import SecretRef as SecretRef from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus +from .resource_type import ResourceType as ResourceType from .task_metadata import TaskMetadata as TaskMetadata from .task_execution import TaskExecution as TaskExecution from .environment_class import EnvironmentClass as EnvironmentClass @@ -18,3 +20,6 @@ from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase from .task_execution_status import TaskExecutionStatus as TaskExecutionStatus from .task_execution_metadata import TaskExecutionMetadata as TaskExecutionMetadata +from .environment_variable_item import EnvironmentVariableItem as EnvironmentVariableItem +from .project_environment_class import ProjectEnvironmentClass as ProjectEnvironmentClass +from .environment_variable_source import EnvironmentVariableSource as EnvironmentVariableSource diff --git a/src/gitpod/types/shared/automation_trigger.py b/src/gitpod/types/shared/automation_trigger.py index d319ff02..c21e923e 100644 --- a/src/gitpod/types/shared/automation_trigger.py +++ b/src/gitpod/types/shared/automation_trigger.py @@ -12,8 +12,13 @@ class AutomationTrigger(BaseModel): """ An AutomationTrigger represents a trigger for an automation action. - The `post_environment_start` field indicates that the automation should be triggered after the environment has started. + The `manual` field shows a start button in the UI for manually triggering the automation. + The `post_machine_start` field indicates that the automation should be triggered after the machine has started, before the devcontainer is ready. + This is used for machine-level services like security agents that need to start early. + The `post_environment_start` field indicates that the automation should be triggered after the environment has started (devcontainer ready). The `post_devcontainer_start` field indicates that the automation should be triggered after the dev container has started. + The `prebuild` field starts the automation during a prebuild of an environment. This phase does not have user secrets available. + Note: The prebuild trigger can only be used with tasks, not services. """ manual: Optional[bool] = None @@ -21,3 +26,7 @@ class AutomationTrigger(BaseModel): post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + + post_machine_start: Optional[bool] = FieldInfo(alias="postMachineStart", default=None) + + prebuild: Optional[bool] = None diff --git a/src/gitpod/types/shared/environment_variable_item.py b/src/gitpod/types/shared/environment_variable_item.py new file mode 100644 index 00000000..171db36b --- /dev/null +++ b/src/gitpod/types/shared/environment_variable_item.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .environment_variable_source import EnvironmentVariableSource + +__all__ = ["EnvironmentVariableItem"] + + +class EnvironmentVariableItem(BaseModel): + """ + EnvironmentVariableItem represents an environment variable that can be set + either from a literal value or from a secret reference. + """ + + name: Optional[str] = None + """name is the environment variable name.""" + + value: Optional[str] = None + """value is a literal string value.""" + + value_from: Optional[EnvironmentVariableSource] = FieldInfo(alias="valueFrom", default=None) + """value_from specifies a source for the value.""" diff --git a/src/gitpod/types/shared/environment_variable_source.py b/src/gitpod/types/shared/environment_variable_source.py new file mode 100644 index 00000000..09df6528 --- /dev/null +++ b/src/gitpod/types/shared/environment_variable_source.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .secret_ref import SecretRef + +__all__ = ["EnvironmentVariableSource"] + + +class EnvironmentVariableSource(BaseModel): + """EnvironmentVariableSource specifies a source for an environment variable value.""" + + secret_ref: SecretRef = FieldInfo(alias="secretRef") + """secret_ref references a secret by ID.""" diff --git a/src/gitpod/types/shared/principal.py b/src/gitpod/types/shared/principal.py index 5300b520..b71334f8 100644 --- a/src/gitpod/types/shared/principal.py +++ b/src/gitpod/types/shared/principal.py @@ -12,4 +12,5 @@ "PRINCIPAL_ENVIRONMENT", "PRINCIPAL_SERVICE_ACCOUNT", "PRINCIPAL_RUNNER_MANAGER", + "PRINCIPAL_AGENT_EXECUTION", ] diff --git a/src/gitpod/types/project_environment_class.py b/src/gitpod/types/shared/project_environment_class.py similarity index 83% rename from src/gitpod/types/project_environment_class.py rename to src/gitpod/types/shared/project_environment_class.py index a969845a..52c5e008 100644 --- a/src/gitpod/types/project_environment_class.py +++ b/src/gitpod/types/shared/project_environment_class.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from .._models import BaseModel +from ..._models import BaseModel __all__ = ["ProjectEnvironmentClass"] @@ -18,3 +18,6 @@ class ProjectEnvironmentClass(BaseModel): local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) """Use a local runner for the user""" + + order: Optional[int] = None + """order is the priority of this entry""" diff --git a/src/gitpod/types/resource_type.py b/src/gitpod/types/shared/resource_type.py similarity index 63% rename from src/gitpod/types/resource_type.py rename to src/gitpod/types/shared/resource_type.py index c273d47a..5aec70eb 100644 --- a/src/gitpod/types/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -30,4 +30,21 @@ "RESOURCE_TYPE_ENVIRONMENT_SESSION", "RESOURCE_TYPE_USER_SECRET", "RESOURCE_TYPE_ORGANIZATION_POLICY", + "RESOURCE_TYPE_ORGANIZATION_SECRET", + "RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_BILLING", + "RESOURCE_TYPE_PROMPT", + "RESOURCE_TYPE_COUPON", + "RESOURCE_TYPE_COUPON_REDEMPTION", + "RESOURCE_TYPE_ACCOUNT", + "RESOURCE_TYPE_INTEGRATION", + "RESOURCE_TYPE_WORKFLOW", + "RESOURCE_TYPE_WORKFLOW_EXECUTION", + "RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION", + "RESOURCE_TYPE_SNAPSHOT", + "RESOURCE_TYPE_PREBUILD", + "RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION", + "RESOURCE_TYPE_CUSTOM_DOMAIN", + "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED", + "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", ] diff --git a/src/gitpod/types/shared/runs_on.py b/src/gitpod/types/shared/runs_on.py index 7702279d..33cf1bd5 100644 --- a/src/gitpod/types/shared/runs_on.py +++ b/src/gitpod/types/shared/runs_on.py @@ -14,4 +14,7 @@ class Docker(BaseModel): class RunsOn(BaseModel): - docker: Docker + docker: Optional[Docker] = None + + machine: Optional[object] = None + """Machine runs the service/task directly on the VM/machine level.""" diff --git a/src/gitpod/types/shared/secret_ref.py b/src/gitpod/types/shared/secret_ref.py new file mode 100644 index 00000000..20904f1b --- /dev/null +++ b/src/gitpod/types/shared/secret_ref.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["SecretRef"] + + +class SecretRef(BaseModel): + """SecretRef references a secret by its ID.""" + + id: Optional[str] = None + """id is the UUID of the secret to reference.""" diff --git a/src/gitpod/types/shared/task_spec.py b/src/gitpod/types/shared/task_spec.py index c69815fb..9c30234e 100644 --- a/src/gitpod/types/shared/task_spec.py +++ b/src/gitpod/types/shared/task_spec.py @@ -1,11 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from pydantic import Field as FieldInfo from .runs_on import RunsOn from ..._models import BaseModel +from .environment_variable_item import EnvironmentVariableItem __all__ = ["TaskSpec"] @@ -14,5 +15,8 @@ class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" + env: Optional[List[EnvironmentVariableItem]] = None + """env specifies environment variables for the task.""" + runs_on: Optional[RunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index 51915e7a..4673c768 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -4,9 +4,14 @@ from .subject import Subject as Subject from .principal import Principal as Principal from .task_spec import TaskSpec as TaskSpec +from .secret_ref import SecretRef as SecretRef from .field_value import FieldValue as FieldValue +from .resource_type import ResourceType as ResourceType from .task_metadata import TaskMetadata as TaskMetadata from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole from .automation_trigger import AutomationTrigger as AutomationTrigger from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase +from .environment_variable_item import EnvironmentVariableItem as EnvironmentVariableItem +from .project_environment_class import ProjectEnvironmentClass as ProjectEnvironmentClass +from .environment_variable_source import EnvironmentVariableSource as EnvironmentVariableSource diff --git a/src/gitpod/types/shared_params/automation_trigger.py b/src/gitpod/types/shared_params/automation_trigger.py index 2327173a..0c840fe9 100644 --- a/src/gitpod/types/shared_params/automation_trigger.py +++ b/src/gitpod/types/shared_params/automation_trigger.py @@ -12,8 +12,13 @@ class AutomationTrigger(TypedDict, total=False): """ An AutomationTrigger represents a trigger for an automation action. - The `post_environment_start` field indicates that the automation should be triggered after the environment has started. + The `manual` field shows a start button in the UI for manually triggering the automation. + The `post_machine_start` field indicates that the automation should be triggered after the machine has started, before the devcontainer is ready. + This is used for machine-level services like security agents that need to start early. + The `post_environment_start` field indicates that the automation should be triggered after the environment has started (devcontainer ready). The `post_devcontainer_start` field indicates that the automation should be triggered after the dev container has started. + The `prebuild` field starts the automation during a prebuild of an environment. This phase does not have user secrets available. + Note: The prebuild trigger can only be used with tasks, not services. """ manual: bool @@ -21,3 +26,7 @@ class AutomationTrigger(TypedDict, total=False): post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] + + post_machine_start: Annotated[bool, PropertyInfo(alias="postMachineStart")] + + prebuild: bool diff --git a/src/gitpod/types/shared_params/environment_variable_item.py b/src/gitpod/types/shared_params/environment_variable_item.py new file mode 100644 index 00000000..c4d3b5ed --- /dev/null +++ b/src/gitpod/types/shared_params/environment_variable_item.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from .environment_variable_source import EnvironmentVariableSource + +__all__ = ["EnvironmentVariableItem"] + + +class EnvironmentVariableItem(TypedDict, total=False): + """ + EnvironmentVariableItem represents an environment variable that can be set + either from a literal value or from a secret reference. + """ + + name: str + """name is the environment variable name.""" + + value: str + """value is a literal string value.""" + + value_from: Annotated[EnvironmentVariableSource, PropertyInfo(alias="valueFrom")] + """value_from specifies a source for the value.""" diff --git a/src/gitpod/types/shared_params/environment_variable_source.py b/src/gitpod/types/shared_params/environment_variable_source.py new file mode 100644 index 00000000..2e5b3244 --- /dev/null +++ b/src/gitpod/types/shared_params/environment_variable_source.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .secret_ref import SecretRef + +__all__ = ["EnvironmentVariableSource"] + + +class EnvironmentVariableSource(TypedDict, total=False): + """EnvironmentVariableSource specifies a source for an environment variable value.""" + + secret_ref: Required[Annotated[SecretRef, PropertyInfo(alias="secretRef")]] + """secret_ref references a secret by ID.""" diff --git a/src/gitpod/types/shared_params/principal.py b/src/gitpod/types/shared_params/principal.py index 3cefcfa1..465d7b21 100644 --- a/src/gitpod/types/shared_params/principal.py +++ b/src/gitpod/types/shared_params/principal.py @@ -14,4 +14,5 @@ "PRINCIPAL_ENVIRONMENT", "PRINCIPAL_SERVICE_ACCOUNT", "PRINCIPAL_RUNNER_MANAGER", + "PRINCIPAL_AGENT_EXECUTION", ] diff --git a/src/gitpod/types/project_environment_class_param.py b/src/gitpod/types/shared_params/project_environment_class.py similarity index 72% rename from src/gitpod/types/project_environment_class_param.py rename to src/gitpod/types/shared_params/project_environment_class.py index c6e29185..84194873 100644 --- a/src/gitpod/types/project_environment_class_param.py +++ b/src/gitpod/types/shared_params/project_environment_class.py @@ -4,12 +4,12 @@ from typing_extensions import Annotated, TypedDict -from .._utils import PropertyInfo +from ..._utils import PropertyInfo -__all__ = ["ProjectEnvironmentClassParam"] +__all__ = ["ProjectEnvironmentClass"] -class ProjectEnvironmentClassParam(TypedDict, total=False): +class ProjectEnvironmentClass(TypedDict, total=False): environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] """Use a fixed environment class on a given Runner. @@ -18,3 +18,6 @@ class ProjectEnvironmentClassParam(TypedDict, total=False): local_runner: Annotated[bool, PropertyInfo(alias="localRunner")] """Use a local runner for the user""" + + order: int + """order is the priority of this entry""" diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py new file mode 100644 index 00000000..4c567f1c --- /dev/null +++ b/src/gitpod/types/shared_params/resource_type.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResourceType"] + +ResourceType: TypeAlias = Literal[ + "RESOURCE_TYPE_UNSPECIFIED", + "RESOURCE_TYPE_ENVIRONMENT", + "RESOURCE_TYPE_RUNNER", + "RESOURCE_TYPE_PROJECT", + "RESOURCE_TYPE_TASK", + "RESOURCE_TYPE_TASK_EXECUTION", + "RESOURCE_TYPE_SERVICE", + "RESOURCE_TYPE_ORGANIZATION", + "RESOURCE_TYPE_USER", + "RESOURCE_TYPE_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION", + "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN", + "RESOURCE_TYPE_GROUP", + "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN", + "RESOURCE_TYPE_USER_PREFERENCE", + "RESOURCE_TYPE_SERVICE_ACCOUNT", + "RESOURCE_TYPE_SECRET", + "RESOURCE_TYPE_SSO_CONFIG", + "RESOURCE_TYPE_DOMAIN_VERIFICATION", + "RESOURCE_TYPE_AGENT_EXECUTION", + "RESOURCE_TYPE_RUNNER_LLM_INTEGRATION", + "RESOURCE_TYPE_AGENT", + "RESOURCE_TYPE_ENVIRONMENT_SESSION", + "RESOURCE_TYPE_USER_SECRET", + "RESOURCE_TYPE_ORGANIZATION_POLICY", + "RESOURCE_TYPE_ORGANIZATION_SECRET", + "RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_BILLING", + "RESOURCE_TYPE_PROMPT", + "RESOURCE_TYPE_COUPON", + "RESOURCE_TYPE_COUPON_REDEMPTION", + "RESOURCE_TYPE_ACCOUNT", + "RESOURCE_TYPE_INTEGRATION", + "RESOURCE_TYPE_WORKFLOW", + "RESOURCE_TYPE_WORKFLOW_EXECUTION", + "RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION", + "RESOURCE_TYPE_SNAPSHOT", + "RESOURCE_TYPE_PREBUILD", + "RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION", + "RESOURCE_TYPE_CUSTOM_DOMAIN", + "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED", + "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", +] diff --git a/src/gitpod/types/shared_params/runs_on.py b/src/gitpod/types/shared_params/runs_on.py index 733d8286..8fc0fd3c 100644 --- a/src/gitpod/types/shared_params/runs_on.py +++ b/src/gitpod/types/shared_params/runs_on.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict from ..._types import SequenceNotStr @@ -16,4 +16,7 @@ class Docker(TypedDict, total=False): class RunsOn(TypedDict, total=False): - docker: Required[Docker] + docker: Docker + + machine: object + """Machine runs the service/task directly on the VM/machine level.""" diff --git a/src/gitpod/types/shared_params/secret_ref.py b/src/gitpod/types/shared_params/secret_ref.py new file mode 100644 index 00000000..cbfc6e6a --- /dev/null +++ b/src/gitpod/types/shared_params/secret_ref.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["SecretRef"] + + +class SecretRef(TypedDict, total=False): + """SecretRef references a secret by its ID.""" + + id: str + """id is the UUID of the secret to reference.""" diff --git a/src/gitpod/types/shared_params/task_spec.py b/src/gitpod/types/shared_params/task_spec.py index 5f40eef4..691ba57b 100644 --- a/src/gitpod/types/shared_params/task_spec.py +++ b/src/gitpod/types/shared_params/task_spec.py @@ -2,10 +2,12 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Annotated, TypedDict from .runs_on import RunsOn from ..._utils import PropertyInfo +from .environment_variable_item import EnvironmentVariableItem __all__ = ["TaskSpec"] @@ -14,5 +16,8 @@ class TaskSpec(TypedDict, total=False): command: str """command contains the command the task should execute""" + env: Iterable[EnvironmentVariableItem] + """env specifies environment variables for the task.""" + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/stack_frame_param.py b/src/gitpod/types/stack_frame_param.py new file mode 100644 index 00000000..6ce75870 --- /dev/null +++ b/src/gitpod/types/stack_frame_param.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = ["StackFrameParam"] + + +class StackFrameParam(TypedDict, total=False): + """Stack trace frame information (Sentry-compatible)""" + + colno: int + """Column number in the line""" + + context_line: Annotated[str, PropertyInfo(alias="contextLine")] + + filename: str + """File name or path""" + + function: str + """Function name""" + + in_app: Annotated[bool, PropertyInfo(alias="inApp")] + """Whether this frame is in application code (vs library/framework code)""" + + lineno: int + """Line number in the file""" + + module: str + """Module or package name""" + + post_context: Annotated[SequenceNotStr[str], PropertyInfo(alias="postContext")] + + pre_context: Annotated[SequenceNotStr[str], PropertyInfo(alias="preContext")] + """Source code context around the error line""" + + vars: Dict[str, str] + """Additional frame-specific variables/locals""" diff --git a/src/gitpod/types/user.py b/src/gitpod/types/user.py index a8ce63f8..7bb441f2 100644 --- a/src/gitpod/types/user.py +++ b/src/gitpod/types/user.py @@ -21,6 +21,9 @@ class User(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """created_at is the creation time""" + email: Optional[str] = None + """email is the user's email address""" + name: Optional[str] = None """name is the full name of the user""" diff --git a/src/gitpod/types/user_delete_user_params.py b/src/gitpod/types/user_delete_user_params.py new file mode 100644 index 00000000..9c9639aa --- /dev/null +++ b/src/gitpod/types/user_delete_user_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["UserDeleteUserParams"] + + +class UserDeleteUserParams(TypedDict, total=False): + user_id: Annotated[str, PropertyInfo(alias="userId")] diff --git a/src/gitpod/types/user_get_user_params.py b/src/gitpod/types/user_get_user_params.py new file mode 100644 index 00000000..c4657c6d --- /dev/null +++ b/src/gitpod/types/user_get_user_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["UserGetUserParams"] + + +class UserGetUserParams(TypedDict, total=False): + user_id: Annotated[str, PropertyInfo(alias="userId")] diff --git a/src/gitpod/types/user_get_user_response.py b/src/gitpod/types/user_get_user_response.py new file mode 100644 index 00000000..ba5a8735 --- /dev/null +++ b/src/gitpod/types/user_get_user_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .user import User +from .._models import BaseModel + +__all__ = ["UserGetUserResponse"] + + +class UserGetUserResponse(BaseModel): + user: User diff --git a/src/gitpod/types/user_input_block_param.py b/src/gitpod/types/user_input_block_param.py new file mode 100644 index 00000000..e62eecf3 --- /dev/null +++ b/src/gitpod/types/user_input_block_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["UserInputBlockParam", "Text"] + + +class Text(TypedDict, total=False): + content: str + + +class UserInputBlockParam(TypedDict, total=False): + text: Required[Text] + + id: str + + created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] + """Timestamp when this block was created. Used for debugging and support bundles.""" diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index d4b9aebc..650c04b9 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -37,17 +37,20 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { - "id": "id", + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", }, "description": "Runs the development web server", "name": "Web Server", "reference": "web-server", + "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": [ { "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ], }, @@ -58,11 +61,19 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "stop": "stop", }, "desired_phase": "SERVICE_PHASE_UNSPECIFIED", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "session": "session", "spec_version": "specVersion", @@ -142,12 +153,15 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: metadata={ "description": "description", "name": "x", + "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": { "trigger": [ { "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ] }, @@ -158,11 +172,19 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "start": "npm run start:dev", "stop": "stop", }, + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, status={ @@ -212,6 +234,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["web-server", "database"], + "roles": ["SERVICE_ROLE_UNSPECIFIED"], "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ @@ -372,17 +395,20 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { - "id": "id", + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", }, "description": "Runs the development web server", "name": "Web Server", "reference": "web-server", + "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": [ { "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ], }, @@ -393,11 +419,19 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "stop": "stop", }, "desired_phase": "SERVICE_PHASE_UNSPECIFIED", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "session": "session", "spec_version": "specVersion", @@ -477,12 +511,15 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> metadata={ "description": "description", "name": "x", + "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": { "trigger": [ { "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ] }, @@ -493,11 +530,19 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "start": "npm run start:dev", "stop": "stop", }, + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, status={ @@ -547,6 +592,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["web-server", "database"], + "roles": ["SERVICE_ROLE_UNSPECIFIED"], "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 58ec8c1d..057d1a17 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { - "id": "id", + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", }, "description": "Builds the project artifacts", @@ -50,16 +50,26 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ], }, spec={ "command": "npm run build", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, ) @@ -144,17 +154,27 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ] }, }, spec={ "command": "npm run test:coverage", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, ) @@ -321,7 +341,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { - "id": "id", + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", }, "description": "Builds the project artifacts", @@ -332,16 +352,26 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ], }, spec={ "command": "npm run build", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, ) @@ -426,17 +456,27 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ] }, }, spec={ "command": "npm run test:coverage", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, ) diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 8a2f0551..8a1bfcfb 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -37,11 +37,13 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: }, "description": "Development web server", "name": "Web Server", + "role": "", "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "triggered_by": ["postDevcontainerStart"], } @@ -56,7 +58,8 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "triggered_by": ["postEnvironmentStart"], } @@ -114,11 +117,13 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> }, "description": "Development web server", "name": "Web Server", + "role": "", "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "triggered_by": ["postDevcontainerStart"], } @@ -133,7 +138,8 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "triggered_by": ["postEnvironmentStart"], } diff --git a/tests/api_resources/groups/__init__.py b/tests/api_resources/groups/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/groups/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/groups/test_memberships.py b/tests/api_resources/groups/test_memberships.py new file mode 100644 index 00000000..b0de9f54 --- /dev/null +++ b/tests/api_resources/groups/test_memberships.py @@ -0,0 +1,264 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.pagination import SyncMembersPage, AsyncMembersPage +from gitpod.types.groups import ( + GroupMembership, + MembershipCreateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestMemberships: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + membership = client.groups.memberships.create() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + membership = client.groups.memberships.create( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + subject={ + "id": "f53d2330-3795-4c5d-a1f3-453121af9c60", + "principal": "PRINCIPAL_USER", + }, + ) + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.groups.memberships.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = response.parse() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.groups.memberships.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = response.parse() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + membership = client.groups.memberships.list() + assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + membership = client.groups.memberships.list( + token="token", + page_size=0, + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.groups.memberships.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = response.parse() + assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.groups.memberships.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = response.parse() + assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + membership = client.groups.memberships.delete() + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + membership = client.groups.memberships.delete( + membership_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + ) + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.groups.memberships.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = response.parse() + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.groups.memberships.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = response.parse() + assert_matches_type(object, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncMemberships: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.create() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.create( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + subject={ + "id": "f53d2330-3795-4c5d-a1f3-453121af9c60", + "principal": "PRINCIPAL_USER", + }, + ) + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.memberships.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = await response.parse() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.memberships.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = await response.parse() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.list() + assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.list( + token="token", + page_size=0, + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.memberships.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = await response.parse() + assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.memberships.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = await response.parse() + assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.delete() + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.delete( + membership_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + ) + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.memberships.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = await response.parse() + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.memberships.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = await response.parse() + assert_matches_type(object, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/groups/test_role_assignments.py b/tests/api_resources/groups/test_role_assignments.py new file mode 100644 index 00000000..23940822 --- /dev/null +++ b/tests/api_resources/groups/test_role_assignments.py @@ -0,0 +1,272 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.pagination import SyncAssignmentsPage, AsyncAssignmentsPage +from gitpod.types.groups import ( + RoleAssignment, + RoleAssignmentCreateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRoleAssignments: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.create() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.create( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + resource_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + resource_role="RESOURCE_ROLE_RUNNER_ADMIN", + resource_type="RESOURCE_TYPE_RUNNER", + ) + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.groups.role_assignments.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = response.parse() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.groups.role_assignments.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = response.parse() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.list() + assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.list( + token="token", + page_size=0, + filter={ + "group_id": "groupId", + "resource_roles": ["RESOURCE_ROLE_UNSPECIFIED"], + "resource_types": ["RESOURCE_TYPE_RUNNER"], + "user_id": "userId", + }, + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.groups.role_assignments.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = response.parse() + assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.groups.role_assignments.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = response.parse() + assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.delete() + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.delete( + assignment_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + ) + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.groups.role_assignments.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = response.parse() + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.groups.role_assignments.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = response.parse() + assert_matches_type(object, role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncRoleAssignments: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.create() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.create( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + resource_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + resource_role="RESOURCE_ROLE_RUNNER_ADMIN", + resource_type="RESOURCE_TYPE_RUNNER", + ) + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.role_assignments.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = await response.parse() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.role_assignments.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = await response.parse() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.list() + assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.list( + token="token", + page_size=0, + filter={ + "group_id": "groupId", + "resource_roles": ["RESOURCE_ROLE_UNSPECIFIED"], + "resource_types": ["RESOURCE_TYPE_RUNNER"], + "user_id": "userId", + }, + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.role_assignments.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = await response.parse() + assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.role_assignments.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = await response.parse() + assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.delete() + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.delete( + assignment_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + ) + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.role_assignments.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = await response.parse() + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.role_assignments.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = await response.parse() + assert_matches_type(object, role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_custom_domains.py b/tests/api_resources/organizations/test_custom_domains.py new file mode 100644 index 00000000..dd7d86bc --- /dev/null +++ b/tests/api_resources/organizations/test_custom_domains.py @@ -0,0 +1,360 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.organizations import ( + CustomDomainCreateResponse, + CustomDomainUpdateResponse, + CustomDomainRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestCustomDomains: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + aws_account_id="123456789012", + cloud_account_id="cloudAccountId", + provider="CUSTOM_DOMAIN_PROVIDER_AWS", + ) + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.organizations.custom_domains.with_raw_response.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = response.parse() + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.organizations.custom_domains.with_streaming_response.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = response.parse() + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.custom_domains.with_raw_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = response.parse() + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.custom_domains.with_streaming_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = response.parse() + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + aws_account_id="987654321098", + cloud_account_id="cloudAccountId", + provider="CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED", + ) + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.organizations.custom_domains.with_raw_response.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = response.parse() + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.organizations.custom_domains.with_streaming_response.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = response.parse() + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.organizations.custom_domains.with_raw_response.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = response.parse() + assert_matches_type(object, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.organizations.custom_domains.with_streaming_response.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = response.parse() + assert_matches_type(object, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncCustomDomains: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + aws_account_id="123456789012", + cloud_account_id="cloudAccountId", + provider="CUSTOM_DOMAIN_PROVIDER_AWS", + ) + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.custom_domains.with_raw_response.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = await response.parse() + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.custom_domains.with_streaming_response.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = await response.parse() + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.custom_domains.with_raw_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = await response.parse() + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.custom_domains.with_streaming_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = await response.parse() + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + aws_account_id="987654321098", + cloud_account_id="cloudAccountId", + provider="CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED", + ) + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.custom_domains.with_raw_response.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = await response.parse() + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.custom_domains.with_streaming_response.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = await response.parse() + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.custom_domains.with_raw_response.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = await response.parse() + assert_matches_type(object, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.custom_domains.with_streaming_response.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = await response.parse() + assert_matches_type(object, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index cf7c13ff..1d743341 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -64,16 +64,34 @@ def test_method_update(self, client: Gitpod) -> None: def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.organizations.policies.update( organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + agent_policy={ + "command_deny_list": ["string"], + "mcp_disabled": True, + "scm_tools_disabled": True, + }, allowed_editor_ids=["string"], allow_local_runners=True, default_editor_id="defaultEditorId", default_environment_image="defaultEnvironmentImage", + delete_archived_environments_after="+9125115.360s", + editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, + maximum_environment_lifetime="+9125115.360s", maximum_environments_per_user="20", maximum_environment_timeout="3600s", maximum_running_environments_per_user="5", members_create_projects=True, members_require_projects=True, port_sharing_disabled=True, + require_custom_domain_access=True, + security_agent_policy={ + "crowdstrike": { + "additional_options": {"foo": "string"}, + "cid_secret_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "enabled": True, + "image": "image", + "tags": "tags", + } + }, ) assert_matches_type(object, policy, path=["response"]) @@ -156,16 +174,34 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.organizations.policies.update( organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + agent_policy={ + "command_deny_list": ["string"], + "mcp_disabled": True, + "scm_tools_disabled": True, + }, allowed_editor_ids=["string"], allow_local_runners=True, default_editor_id="defaultEditorId", default_environment_image="defaultEnvironmentImage", + delete_archived_environments_after="+9125115.360s", + editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, + maximum_environment_lifetime="+9125115.360s", maximum_environments_per_user="20", maximum_environment_timeout="3600s", maximum_running_environments_per_user="5", members_create_projects=True, members_require_projects=True, port_sharing_disabled=True, + require_custom_domain_access=True, + security_agent_policy={ + "crowdstrike": { + "additional_options": {"foo": "string"}, + "cid_secret_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "enabled": True, + "image": "image", + "tags": "tags", + } + }, ) assert_matches_type(object, policy, path=["response"]) diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 415fd137..9e10ff80 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -28,19 +28,31 @@ def test_method_create(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.create( + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + display_name="displayName", + email_domain="acme-corp.com", + email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], + ) + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) @@ -56,7 +68,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: @@ -118,7 +129,9 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: claims={"foo": "string"}, client_id="new-client-id", client_secret="new-client-secret", + display_name="displayName", email_domain="xxxx", + email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], issuer_url="https://example.com", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", ) @@ -244,19 +257,31 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.create( + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + display_name="displayName", + email_domain="acme-corp.com", + email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], + ) + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) @@ -272,7 +297,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non async with async_client.organizations.sso_configurations.with_streaming_response.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: @@ -334,7 +358,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> claims={"foo": "string"}, client_id="new-client-id", client_secret="new-client-secret", + display_name="displayName", email_domain="xxxx", + email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], issuer_url="https://example.com", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", ) diff --git a/tests/api_resources/projects/test_environment_clases.py b/tests/api_resources/projects/test_environment_clases.py new file mode 100644 index 00000000..fada14da --- /dev/null +++ b/tests/api_resources/projects/test_environment_clases.py @@ -0,0 +1,221 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.pagination import SyncProjectEnvironmentClassesPage, AsyncProjectEnvironmentClassesPage +from gitpod.types.shared import ProjectEnvironmentClass + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEnvironmentClases: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Gitpod) -> None: + environment_clase = client.projects.environment_clases.update() + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + environment_clase = client.projects.environment_clases.update( + project_environment_classes=[ + { + "environment_class_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da041", + "local_runner": True, + "order": 0, + }, + { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + "order": 1, + }, + ], + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.projects.environment_clases.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_clase = response.parse() + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.projects.environment_clases.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_clase = response.parse() + assert_matches_type(object, environment_clase, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + environment_clase = client.projects.environment_clases.list() + assert_matches_type( + SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + environment_clase = client.projects.environment_clases.list( + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 20, + }, + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type( + SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.projects.environment_clases.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_clase = response.parse() + assert_matches_type( + SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.projects.environment_clases.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_clase = response.parse() + assert_matches_type( + SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEnvironmentClases: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + environment_clase = await async_client.projects.environment_clases.update() + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_clase = await async_client.projects.environment_clases.update( + project_environment_classes=[ + { + "environment_class_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da041", + "local_runner": True, + "order": 0, + }, + { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + "order": 1, + }, + ], + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.environment_clases.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_clase = await response.parse() + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.environment_clases.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_clase = await response.parse() + assert_matches_type(object, environment_clase, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + environment_clase = await async_client.projects.environment_clases.list() + assert_matches_type( + AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_clase = await async_client.projects.environment_clases.list( + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 20, + }, + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type( + AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.environment_clases.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_clase = await response.parse() + assert_matches_type( + AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.environment_clases.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_clase = await response.parse() + assert_matches_type( + AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 3e24dbc1..ccfcf9f2 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -36,9 +36,15 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: token="gho_xxxxxxxxxxxx", expires_at=parse_datetime("2024-12-31T23:59:59Z"), host="github.com", + integration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", refresh_token="ghr_xxxxxxxxxxxx", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scopes=["string"], source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + subject={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -115,6 +121,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: token="gho_xxxxxxxxxxxx", expires_at=parse_datetime("2024-12-31T23:59:59Z"), refresh_token="ghr_xxxxxxxxxxxx", + scopes=["string"], ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -154,6 +161,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "runner_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", + "subject_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, pagination={ @@ -240,9 +248,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> token="gho_xxxxxxxxxxxx", expires_at=parse_datetime("2024-12-31T23:59:59Z"), host="github.com", + integration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", refresh_token="ghr_xxxxxxxxxxxx", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scopes=["string"], source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + subject={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -323,6 +337,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> token="gho_xxxxxxxxxxxx", expires_at=parse_datetime("2024-12-31T23:59:59Z"), refresh_token="ghr_xxxxxxxxxxxx", + scopes=["string"], ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -364,6 +379,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "runner_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", + "subject_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, pagination={ diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index 36bf74fd..d68d3e88 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -39,6 +39,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: pat=True, runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", scm_id="github", + virtual_directory="virtualDirectory", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -115,6 +116,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: oauth_client_id="new_client_id", oauth_plaintext_client_secret="new_client_secret", pat=True, + virtual_directory="virtualDirectory", ) assert_matches_type(object, scm_integration, path=["response"]) @@ -241,6 +243,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> pat=True, runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", scm_id="github", + virtual_directory="virtualDirectory", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -317,6 +320,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> oauth_client_id="new_client_id", oauth_plaintext_client_secret="new_client_secret", pat=True, + virtual_directory="virtualDirectory", ) assert_matches_type(object, scm_integration, path=["response"]) diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index cebba5e7..0672e8e1 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -50,6 +50,7 @@ def test_method_validate_with_all_params(self, client: Gitpod) -> None: "oauth_plaintext_client_secret": "client_secret", "pat": True, "scm_id": "github", + "virtual_directory": "virtualDirectory", }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -115,6 +116,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) "oauth_plaintext_client_secret": "client_secret", "pat": True, "scm_id": "github", + "virtual_directory": "virtualDirectory", }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 31390ba9..41f2192e 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -11,11 +11,19 @@ from tests.utils import assert_matches_type from gitpod.types import ( LoginProvider, + JoinableOrganization, AccountRetrieveResponse, + AccountListSSOLoginsResponse, AccountGetSSOLoginURLResponse, - AccountListJoinableOrganizationsResponse, ) -from gitpod.pagination import SyncLoginProvidersPage, AsyncLoginProvidersPage +from gitpod.pagination import ( + SyncLoginsPage, + AsyncLoginsPage, + SyncLoginProvidersPage, + AsyncLoginProvidersPage, + SyncJoinableOrganizationsPage, + AsyncJoinableOrganizationsPage, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -67,6 +75,15 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.delete( + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + reason="reason", + ) + assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: @@ -140,7 +157,7 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_method_list_joinable_organizations(self, client: Gitpod) -> None: account = client.accounts.list_joinable_organizations() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -148,9 +165,12 @@ def test_method_list_joinable_organizations_with_all_params(self, client: Gitpod account = client.accounts.list_joinable_organizations( token="token", page_size=0, - empty=True, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -160,7 +180,7 @@ def test_raw_response_list_joinable_organizations(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -170,7 +190,7 @@ def test_streaming_response_list_joinable_organizations(self, client: Gitpod) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) assert cast(Any, response.is_closed) is True @@ -186,7 +206,10 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No account = client.accounts.list_login_providers( token="token", page_size=0, - filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + filter={ + "email": "email", + "invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, pagination={ "token": "token", "page_size": 20, @@ -216,6 +239,55 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_sso_logins(self, client: Gitpod) -> None: + account = client.accounts.list_sso_logins( + email="dev@stainless.com", + ) + assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_sso_logins_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.list_sso_logins( + email="dev@stainless.com", + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + return_to="https://example.com", + ) + assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list_sso_logins(self, client: Gitpod) -> None: + response = client.accounts.with_raw_response.list_sso_logins( + email="dev@stainless.com", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = response.parse() + assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list_sso_logins(self, client: Gitpod) -> None: + with client.accounts.with_streaming_response.list_sso_logins( + email="dev@stainless.com", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = response.parse() + assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncAccounts: parametrize = pytest.mark.parametrize( @@ -266,6 +338,15 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.delete( + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + reason="reason", + ) + assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @@ -339,7 +420,7 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit @parametrize async def test_method_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_joinable_organizations() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -347,9 +428,12 @@ async def test_method_list_joinable_organizations_with_all_params(self, async_cl account = await async_client.accounts.list_joinable_organizations( token="token", page_size=0, - empty=True, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -359,7 +443,7 @@ async def test_raw_response_list_joinable_organizations(self, async_client: Asyn assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -369,7 +453,7 @@ async def test_streaming_response_list_joinable_organizations(self, async_client assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) assert cast(Any, response.is_closed) is True @@ -385,7 +469,10 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A account = await async_client.accounts.list_login_providers( token="token", page_size=0, - filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + filter={ + "email": "email", + "invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, pagination={ "token": "token", "page_size": 20, @@ -414,3 +501,52 @@ async def test_streaming_response_list_login_providers(self, async_client: Async assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_sso_logins(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.list_sso_logins( + email="dev@stainless.com", + ) + assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_sso_logins_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.list_sso_logins( + email="dev@stainless.com", + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + return_to="https://example.com", + ) + assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list_sso_logins(self, async_client: AsyncGitpod) -> None: + response = await async_client.accounts.with_raw_response.list_sso_logins( + email="dev@stainless.com", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = await response.parse() + assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list_sso_logins(self, async_client: AsyncGitpod) -> None: + async with async_client.accounts.with_streaming_response.list_sso_logins( + email="dev@stainless.com", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = await response.parse() + assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py new file mode 100644 index 00000000..9a37aaf8 --- /dev/null +++ b/tests/api_resources/test_agents.py @@ -0,0 +1,1037 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + Prompt, + AgentExecution, + AgentCreatePromptResponse, + AgentUpdatePromptResponse, + AgentRetrievePromptResponse, + AgentStartExecutionResponse, + AgentRetrieveExecutionResponse, + AgentCreateExecutionConversationTokenResponse, +) +from gitpod._utils import parse_datetime +from gitpod.pagination import SyncPromptsPage, AsyncPromptsPage, SyncAgentExecutionsPage, AsyncAgentExecutionsPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAgents: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_execution_conversation_token(self, client: Gitpod) -> None: + agent = client.agents.create_execution_conversation_token() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_execution_conversation_token_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.create_execution_conversation_token( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_execution_conversation_token(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.create_execution_conversation_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_execution_conversation_token(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.create_execution_conversation_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_prompt(self, client: Gitpod) -> None: + agent = client.agents.create_prompt() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_prompt_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.create_prompt( + command="command", + description="x", + is_command=True, + is_template=True, + name="x", + prompt="x", + ) + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_prompt(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.create_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_prompt(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.create_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_execution(self, client: Gitpod) -> None: + agent = client.agents.delete_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.delete_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.delete_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.delete_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_prompt(self, client: Gitpod) -> None: + agent = client.agents.delete_prompt() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_prompt_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.delete_prompt( + prompt_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete_prompt(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.delete_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete_prompt(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.delete_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_executions(self, client: Gitpod) -> None: + agent = client.agents.list_executions() + assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_executions_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.list_executions( + token="token", + page_size=0, + filter={ + "agent_ids": ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"], + "creator_ids": ["string"], + "environment_ids": ["string"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "roles": ["AGENT_EXECUTION_ROLE_UNSPECIFIED"], + "status_phases": ["PHASE_UNSPECIFIED"], + }, + pagination={ + "token": "token", + "page_size": 10, + }, + ) + assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list_executions(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.list_executions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list_executions(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.list_executions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_prompts(self, client: Gitpod) -> None: + agent = client.agents.list_prompts() + assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_prompts_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.list_prompts( + token="token", + page_size=0, + filter={ + "command": "command", + "command_prefix": "commandPrefix", + "is_command": True, + "is_template": True, + }, + pagination={ + "token": "token", + "page_size": 10, + }, + ) + assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list_prompts(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.list_prompts() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list_prompts(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.list_prompts() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_execution(self, client: Gitpod) -> None: + agent = client.agents.retrieve_execution() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.retrieve_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.retrieve_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.retrieve_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_prompt(self, client: Gitpod) -> None: + agent = client.agents.retrieve_prompt() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_prompt_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.retrieve_prompt( + prompt_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve_prompt(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.retrieve_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve_prompt(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.retrieve_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_send_to_execution(self, client: Gitpod) -> None: + agent = client.agents.send_to_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.send_to_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + user_input={ + "text": {"content": "Generate a report based on the latest logs."}, + "id": "id", + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_send_to_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.send_to_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_send_to_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.send_to_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_start_execution(self, client: Gitpod) -> None: + agent = client.agents.start_execution() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.start_execution( + agent_id="b8a64cfa-43e2-4b9d-9fb3-07edc63f5971", + code_context={ + "context_url": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "url": "https://example.com", + }, + "environment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "project_id": "2d22e4eb-31da-467f-882c-27e21550992f", + "pull_request": { + "id": "id", + "author": "author", + "from_branch": "fromBranch", + "repository": { + "clone_url": "cloneUrl", + "host": "host", + "name": "name", + "owner": "owner", + }, + "title": "title", + "to_branch": "toBranch", + "url": "url", + }, + }, + mode="AGENT_MODE_UNSPECIFIED", + name="name", + workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_start_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.start_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_start_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.start_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_stop_execution(self, client: Gitpod) -> None: + agent = client.agents.stop_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_stop_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.stop_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_stop_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.stop_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_stop_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.stop_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_prompt(self, client: Gitpod) -> None: + agent = client.agents.update_prompt() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_prompt_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.update_prompt( + metadata={ + "description": "x", + "name": "name", + }, + prompt_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + spec={ + "command": "command", + "is_command": True, + "is_template": True, + "prompt": "prompt", + }, + ) + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update_prompt(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.update_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update_prompt(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.update_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncAgents: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_execution_conversation_token(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.create_execution_conversation_token() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_execution_conversation_token_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.create_execution_conversation_token( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_execution_conversation_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.create_execution_conversation_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_execution_conversation_token(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.create_execution_conversation_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_prompt(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.create_prompt() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.create_prompt( + command="command", + description="x", + is_command=True, + is_template=True, + name="x", + prompt="x", + ) + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_prompt(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.create_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_prompt(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.create_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.delete_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.delete_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.delete_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.delete_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_prompt(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.delete_prompt() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.delete_prompt( + prompt_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete_prompt(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.delete_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete_prompt(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.delete_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_executions(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.list_executions() + assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_executions_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.list_executions( + token="token", + page_size=0, + filter={ + "agent_ids": ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"], + "creator_ids": ["string"], + "environment_ids": ["string"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "roles": ["AGENT_EXECUTION_ROLE_UNSPECIFIED"], + "status_phases": ["PHASE_UNSPECIFIED"], + }, + pagination={ + "token": "token", + "page_size": 10, + }, + ) + assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list_executions(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.list_executions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list_executions(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.list_executions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_prompts(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.list_prompts() + assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_prompts_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.list_prompts( + token="token", + page_size=0, + filter={ + "command": "command", + "command_prefix": "commandPrefix", + "is_command": True, + "is_template": True, + }, + pagination={ + "token": "token", + "page_size": 10, + }, + ) + assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list_prompts(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.list_prompts() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list_prompts(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.list_prompts() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.retrieve_execution() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.retrieve_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.retrieve_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.retrieve_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_prompt(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.retrieve_prompt() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.retrieve_prompt( + prompt_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve_prompt(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.retrieve_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve_prompt(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.retrieve_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_send_to_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.send_to_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_send_to_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.send_to_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + user_input={ + "text": {"content": "Generate a report based on the latest logs."}, + "id": "id", + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_send_to_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.send_to_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_send_to_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.send_to_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_start_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.start_execution() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_start_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.start_execution( + agent_id="b8a64cfa-43e2-4b9d-9fb3-07edc63f5971", + code_context={ + "context_url": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "url": "https://example.com", + }, + "environment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "project_id": "2d22e4eb-31da-467f-882c-27e21550992f", + "pull_request": { + "id": "id", + "author": "author", + "from_branch": "fromBranch", + "repository": { + "clone_url": "cloneUrl", + "host": "host", + "name": "name", + "owner": "owner", + }, + "title": "title", + "to_branch": "toBranch", + "url": "url", + }, + }, + mode="AGENT_MODE_UNSPECIFIED", + name="name", + workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_start_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.start_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_start_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.start_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_stop_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.stop_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_stop_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.stop_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_stop_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.stop_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_stop_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.stop_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_prompt(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.update_prompt() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.update_prompt( + metadata={ + "description": "x", + "name": "name", + }, + prompt_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + spec={ + "command": "command", + "is_command": True, + "is_template": True, + "prompt": "prompt", + }, + ) + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update_prompt(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.update_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update_prompt(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.update_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 45b7012c..5a6ebcd0 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -108,6 +108,17 @@ def test_method_resolve_url(self, client: Gitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: + editor = client.editors.resolve_url( + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + version="version", + ) + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: @@ -230,6 +241,17 @@ async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.resolve_url( + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + version="version", + ) + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index d7876b0e..127cc4b8 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -41,6 +41,15 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "automations_file": { "automations_file_path": "automationsFilePath", "session": "session", + "trigger_filter": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, + } + ], }, "content": { "git_email": "gitEmail", @@ -66,6 +75,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, + "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, "machine": { @@ -76,12 +86,14 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "secrets": [ { "id": "id", + "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -100,6 +112,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: } ], "timeout": {"disconnected": "+9125115.360s"}, + "workflow_action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @@ -204,7 +217,8 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "ssh_public_keys": [ @@ -254,8 +268,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "archival_status": "ARCHIVAL_STATUS_UNSPECIFIED", + "created_before": parse_datetime("2019-12-27T18:11:19.117Z"), "creator_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "roles": ["ENVIRONMENT_ROLE_UNSPECIFIED"], "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], @@ -376,6 +392,15 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "automations_file": { "automations_file_path": "automationsFilePath", "session": "session", + "trigger_filter": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, + } + ], }, "content": { "git_email": "gitEmail", @@ -401,6 +426,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, + "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, "machine": { @@ -411,12 +437,14 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "secrets": [ { "id": "id", + "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -435,6 +463,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non } ], "timeout": {"disconnected": "14400s"}, + "workflow_action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @@ -666,6 +695,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "automations_file": { "automations_file_path": "automationsFilePath", "session": "session", + "trigger_filter": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, + } + ], }, "content": { "git_email": "gitEmail", @@ -691,6 +729,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, + "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, "machine": { @@ -701,12 +740,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "secrets": [ { "id": "id", + "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -725,6 +766,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> } ], "timeout": {"disconnected": "+9125115.360s"}, + "workflow_action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @@ -829,7 +871,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "ssh_public_keys": [ @@ -879,8 +922,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "archival_status": "ARCHIVAL_STATUS_UNSPECIFIED", + "created_before": parse_datetime("2019-12-27T18:11:19.117Z"), "creator_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "roles": ["ENVIRONMENT_ROLE_UNSPECIFIED"], "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], @@ -1001,6 +1046,15 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "automations_file": { "automations_file_path": "automationsFilePath", "session": "session", + "trigger_filter": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, + } + ], }, "content": { "git_email": "gitEmail", @@ -1026,6 +1080,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, + "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, "machine": { @@ -1036,12 +1091,14 @@ async def test_method_create_from_project_with_all_params(self, async_client: As { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "secrets": [ { "id": "id", + "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -1060,6 +1117,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As } ], "timeout": {"disconnected": "14400s"}, + "workflow_action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) diff --git a/tests/api_resources/test_errors.py b/tests/api_resources/test_errors.py new file mode 100644 index 00000000..4cc33cae --- /dev/null +++ b/tests/api_resources/test_errors.py @@ -0,0 +1,224 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod._utils import parse_datetime + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestErrors: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_report_errors(self, client: Gitpod) -> None: + error = client.errors.report_errors() + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_report_errors_with_all_params(self, client: Gitpod) -> None: + error = client.errors.report_errors( + events=[ + { + "breadcrumbs": [ + { + "category": "category", + "data": {"foo": "string"}, + "level": "ERROR_LEVEL_UNSPECIFIED", + "message": "message", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "type": "type", + } + ], + "environment": "environment", + "event_id": "210b9798eb53baa4e69d31c1071cf03d", + "exceptions": [ + { + "mechanism": { + "data": {"foo": "string"}, + "description": "description", + "handled": True, + "synthetic": True, + "type": "x", + }, + "module": "module", + "stacktrace": [ + { + "colno": 0, + "context_line": "contextLine", + "filename": "filename", + "function": "function", + "in_app": True, + "lineno": 0, + "module": "module", + "post_context": ["string"], + "pre_context": ["string"], + "vars": {"foo": "string"}, + } + ], + "thread_id": "threadId", + "type": "x", + "value": "value", + } + ], + "extra": {"foo": "string"}, + "fingerprint": ["x"], + "identity_id": "ecc2efdd-ddfa-31a9-c6f1-b833d337aa7c", + "level": "ERROR_LEVEL_UNSPECIFIED", + "logger": "logger", + "modules": {"foo": "string"}, + "platform": "x", + "release": "release", + "request": { + "data": "data", + "headers": {"foo": "string"}, + "method": "method", + "query_string": {"foo": "string"}, + "url": "url", + }, + "sdk": {"foo": "string"}, + "server_name": "serverName", + "tags": {"foo": "string"}, + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "transaction": "transaction", + } + ], + ) + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_report_errors(self, client: Gitpod) -> None: + response = client.errors.with_raw_response.report_errors() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + error = response.parse() + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_report_errors(self, client: Gitpod) -> None: + with client.errors.with_streaming_response.report_errors() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + error = response.parse() + assert_matches_type(object, error, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncErrors: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_report_errors(self, async_client: AsyncGitpod) -> None: + error = await async_client.errors.report_errors() + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_report_errors_with_all_params(self, async_client: AsyncGitpod) -> None: + error = await async_client.errors.report_errors( + events=[ + { + "breadcrumbs": [ + { + "category": "category", + "data": {"foo": "string"}, + "level": "ERROR_LEVEL_UNSPECIFIED", + "message": "message", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "type": "type", + } + ], + "environment": "environment", + "event_id": "210b9798eb53baa4e69d31c1071cf03d", + "exceptions": [ + { + "mechanism": { + "data": {"foo": "string"}, + "description": "description", + "handled": True, + "synthetic": True, + "type": "x", + }, + "module": "module", + "stacktrace": [ + { + "colno": 0, + "context_line": "contextLine", + "filename": "filename", + "function": "function", + "in_app": True, + "lineno": 0, + "module": "module", + "post_context": ["string"], + "pre_context": ["string"], + "vars": {"foo": "string"}, + } + ], + "thread_id": "threadId", + "type": "x", + "value": "value", + } + ], + "extra": {"foo": "string"}, + "fingerprint": ["x"], + "identity_id": "ecc2efdd-ddfa-31a9-c6f1-b833d337aa7c", + "level": "ERROR_LEVEL_UNSPECIFIED", + "logger": "logger", + "modules": {"foo": "string"}, + "platform": "x", + "release": "release", + "request": { + "data": "data", + "headers": {"foo": "string"}, + "method": "method", + "query_string": {"foo": "string"}, + "url": "url", + }, + "sdk": {"foo": "string"}, + "server_name": "serverName", + "tags": {"foo": "string"}, + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "transaction": "transaction", + } + ], + ) + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_report_errors(self, async_client: AsyncGitpod) -> None: + response = await async_client.errors.with_raw_response.report_errors() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + error = await response.parse() + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_report_errors(self, async_client: AsyncGitpod) -> None: + async with async_client.errors.with_streaming_response.report_errors() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + error = await response.parse() + assert_matches_type(object, error, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index dd784b4e..4a8a1bb4 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -9,7 +9,12 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import Group +from gitpod.types import ( + Group, + GroupCreateResponse, + GroupUpdateResponse, + GroupRetrieveResponse, +) from gitpod.pagination import SyncGroupsPage, AsyncGroupsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -18,6 +23,118 @@ class TestGroups: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + group = client.groups.create() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + group = client.groups.create( + description="Backend engineering team", + name="Backend Team", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.groups.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.groups.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + group = client.groups.retrieve() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + group = client.groups.retrieve( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.groups.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.groups.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Gitpod) -> None: + group = client.groups.update() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + group = client.groups.update( + description="Platform engineering team", + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + name="Platform Team", + ) + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.groups.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.groups.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: @@ -59,12 +176,160 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + group = client.groups.delete() + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + group = client.groups.delete( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.groups.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.groups.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(object, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncGroups: parametrize = pytest.mark.parametrize( "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.create() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.create( + description="Backend engineering team", + name="Backend Team", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.retrieve() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.retrieve( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.update() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.update( + description="Platform engineering team", + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + name="Platform Team", + ) + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: @@ -105,3 +370,39 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.delete() + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.delete( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(object, group, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index ff2df938..8cda4e70 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -266,6 +266,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, + filter={"search": "search"}, pagination={ "token": "token", "page_size": 20, @@ -594,6 +595,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, + filter={"search": "search"}, pagination={ "token": "token", "page_size": 20, diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py new file mode 100644 index 00000000..258dcef1 --- /dev/null +++ b/tests/api_resources/test_prebuilds.py @@ -0,0 +1,495 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + Prebuild, + PrebuildCancelResponse, + PrebuildCreateResponse, + PrebuildRetrieveResponse, + PrebuildCreateLogsTokenResponse, +) +from gitpod.pagination import SyncPrebuildsPage, AsyncPrebuildsPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPrebuilds: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + prebuild = client.prebuilds.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + prebuild = client.prebuilds.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={ + "desired_phase": "PREBUILD_PHASE_UNSPECIFIED", + "spec_version": "specVersion", + "timeout": "3600s", + }, + environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + prebuild = client.prebuilds.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + prebuild = client.prebuilds.list() + assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + prebuild = client.prebuilds.list( + token="token", + page_size=0, + filter={ + "phases": ["PREBUILD_PHASE_UNSPECIFIED"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + prebuild = client.prebuilds.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_cancel(self, client: Gitpod) -> None: + prebuild = client.prebuilds.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_cancel(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_cancel(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_logs_token(self, client: Gitpod) -> None: + prebuild = client.prebuilds.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_logs_token(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncPrebuilds: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={ + "desired_phase": "PREBUILD_PHASE_UNSPECIFIED", + "spec_version": "specVersion", + "timeout": "3600s", + }, + environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.list() + assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.list( + token="token", + page_size=0, + filter={ + "phases": ["PREBUILD_PHASE_UNSPECIFIED"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_cancel(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_cancel(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_cancel(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 217a8453..0408e8a1 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -28,7 +28,6 @@ class TestProjects: @parametrize def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={}, initializer={}, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -37,10 +36,6 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={ - "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", - "local_runner": True, - }, initializer={ "specs": [ { @@ -58,6 +53,17 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="Web Application", + prebuild_configuration={ + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, technical_description="technicalDescription", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -66,7 +72,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( - environment_class={}, initializer={}, ) @@ -79,7 +84,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( - environment_class={}, initializer={}, ) as response: assert not response.is_closed @@ -138,10 +142,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: project = client.projects.update( automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - environment_class={ - "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", - "local_runner": True, - }, initializer={ "specs": [ { @@ -157,6 +157,17 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ] }, name="x", + prebuild_configuration={ + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da041"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "3600s", + "trigger": {"daily_schedule": {"hour_utc": 2}}, + }, project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", technical_description="technicalDescription", ) @@ -196,7 +207,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: project = client.projects.list( token="token", page_size=0, - filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={ + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "search": "search", + }, pagination={ "token": "token", "page_size": 20, @@ -309,7 +324,6 @@ class TestAsyncProjects: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={}, initializer={}, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -318,10 +332,6 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={ - "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", - "local_runner": True, - }, initializer={ "specs": [ { @@ -339,6 +349,17 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="Web Application", + prebuild_configuration={ + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, technical_description="technicalDescription", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -347,7 +368,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( - environment_class={}, initializer={}, ) @@ -360,7 +380,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create( - environment_class={}, initializer={}, ) as response: assert not response.is_closed @@ -419,10 +438,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> project = await async_client.projects.update( automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - environment_class={ - "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", - "local_runner": True, - }, initializer={ "specs": [ { @@ -438,6 +453,17 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ] }, name="x", + prebuild_configuration={ + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da041"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "3600s", + "trigger": {"daily_schedule": {"hour_utc": 2}}, + }, project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", technical_description="technicalDescription", ) @@ -477,7 +503,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N project = await async_client.projects.list( token="token", page_size=0, - filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={ + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "search": "search", + }, pagination={ "token": "token", "page_size": 20, diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 56e374ae..9ce4674b 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -13,8 +13,10 @@ Runner, RunnerCreateResponse, RunnerRetrieveResponse, + RunnerCreateLogsTokenResponse, RunnerParseContextURLResponse, RunnerCreateRunnerTokenResponse, + RunnerSearchRepositoriesResponse, RunnerCheckAuthenticationForHostResponse, ) from gitpod.pagination import SyncRunnersPage, AsyncRunnersPage @@ -54,6 +56,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, "desired_phase": "RUNNER_PHASE_ACTIVE", + "variant": "RUNNER_VARIANT_UNSPECIFIED", }, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @@ -288,6 +291,42 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_logs_token(self, client: Gitpod) -> None: + runner = client.runners.create_logs_token() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.create_logs_token( + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_logs_token(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.create_logs_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.create_logs_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: @@ -361,6 +400,50 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_search_repositories(self, client: Gitpod) -> None: + runner = client.runners.search_repositories() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_search_repositories_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.search_repositories( + limit=1, + pagination={ + "token": "token", + "page_size": 100, + }, + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_host="scmHost", + search_mode="SEARCH_MODE_UNSPECIFIED", + search_string="searchString", + ) + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_search_repositories(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.search_repositories() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_search_repositories(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.search_repositories() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncRunners: parametrize = pytest.mark.parametrize( @@ -396,6 +479,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, "desired_phase": "RUNNER_PHASE_ACTIVE", + "variant": "RUNNER_VARIANT_UNSPECIFIED", }, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @@ -630,6 +714,42 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create_logs_token() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create_logs_token( + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.create_logs_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.create_logs_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: @@ -702,3 +822,47 @@ async def test_streaming_response_parse_context_url(self, async_client: AsyncGit assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_search_repositories(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.search_repositories() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_search_repositories_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.search_repositories( + limit=1, + pagination={ + "token": "token", + "page_size": 100, + }, + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_host="scmHost", + search_mode="SEARCH_MODE_UNSPECIFIED", + search_string="searchString", + ) + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_search_repositories(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.search_repositories() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_search_repositories(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.search_repositories() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index ddaaae29..6a54d360 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -32,12 +32,14 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( + api_only=True, container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="DATABASE_URL", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", scope={ + "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, @@ -82,6 +84,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "scope": { + "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, @@ -240,12 +243,14 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( + api_only=True, container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="DATABASE_URL", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", scope={ + "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, @@ -290,6 +295,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "scope": { + "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index cfe22b3d..576deff0 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -9,7 +9,10 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import UserGetAuthenticatedUserResponse +from gitpod.types import ( + UserGetUserResponse, + UserGetAuthenticatedUserResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,6 +20,42 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_user(self, client: Gitpod) -> None: + user = client.users.delete_user() + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_user_with_all_params(self, client: Gitpod) -> None: + user = client.users.delete_user( + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete_user(self, client: Gitpod) -> None: + response = client.users.with_raw_response.delete_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete_user(self, client: Gitpod) -> None: + with client.users.with_streaming_response.delete_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(object, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_authenticated_user(self, client: Gitpod) -> None: @@ -53,6 +92,42 @@ def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_user(self, client: Gitpod) -> None: + user = client.users.get_user() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_user_with_all_params(self, client: Gitpod) -> None: + user = client.users.get_user( + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + ) + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_get_user(self, client: Gitpod) -> None: + response = client.users.with_raw_response.get_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_get_user(self, client: Gitpod) -> None: + with client.users.with_streaming_response.get_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_set_suspended(self, client: Gitpod) -> None: @@ -96,6 +171,42 @@ class TestAsyncUsers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_user(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.delete_user() + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_user_with_all_params(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.delete_user( + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete_user(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.with_raw_response.delete_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete_user(self, async_client: AsyncGitpod) -> None: + async with async_client.users.with_streaming_response.delete_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(object, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: @@ -132,6 +243,42 @@ async def test_streaming_response_get_authenticated_user(self, async_client: Asy assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_user(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.get_user() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_user_with_all_params(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.get_user( + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + ) + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_get_user(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.with_raw_response.get_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_get_user(self, async_client: AsyncGitpod) -> None: + async with async_client.users.with_streaming_response.get_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: From d33207cbfcb433f2e72e7d5b49145f0629f02a94 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:01:25 +0000 Subject: [PATCH 227/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0c02950d..2aca35ae 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.4" + ".": "0.5.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5b178f85..d2f97698 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.4.4" +version = "0.5.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index fb7ab941..b934a8eb 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.4.4" # x-release-please-version +__version__ = "0.5.0" # x-release-please-version From 123c13dcaa735a01c59d22fbbedd35d5f6a118fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 19:19:41 +0000 Subject: [PATCH 228/505] chore(internal): add missing files argument to base client --- src/gitpod/_base_client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index e817a04e..a1f4ce1c 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -1247,9 +1247,12 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1767,9 +1770,12 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return await self.request(cast_to, opts) async def put( From d0d8695e35e6896715099f1c39c87140a35b4b0d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 06:30:52 +0000 Subject: [PATCH 229/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2aca35ae..d04f223f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.0" + ".": "0.5.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d2f97698..74ab4bcb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.5.0" +version = "0.5.1" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index b934a8eb..33773aa7 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.5.0" # x-release-please-version +__version__ = "0.5.1" # x-release-please-version From 6e4fbb373221a8be81ecafce683846b4f252191c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 17:21:39 +0000 Subject: [PATCH 230/505] chore: speedup initial import --- src/gitpod/_client.py | 786 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 640 insertions(+), 146 deletions(-) diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 40bb8763..e1319a29 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Mapping +from typing import TYPE_CHECKING, Any, Mapping from typing_extensions import Self, override import httpx @@ -20,8 +20,8 @@ not_given, ) from ._utils import is_given, get_async_library +from ._compat import cached_property from ._version import __version__ -from .resources import usage, agents, errors, events, editors, secrets, accounts, gateways, identity, prebuilds from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import GitpodError, APIStatusError from ._base_client import ( @@ -29,36 +29,47 @@ SyncAPIClient, AsyncAPIClient, ) -from .resources.users import users -from .resources.groups import groups -from .resources.runners import runners -from .resources.projects import projects -from .resources.environments import environments -from .resources.organizations import organizations + +if TYPE_CHECKING: + from .resources import ( + usage, + users, + agents, + errors, + events, + groups, + editors, + runners, + secrets, + accounts, + gateways, + identity, + projects, + prebuilds, + environments, + organizations, + ) + from .resources.usage import UsageResource, AsyncUsageResource + from .resources.agents import AgentsResource, AsyncAgentsResource + from .resources.errors import ErrorsResource, AsyncErrorsResource + from .resources.events import EventsResource, AsyncEventsResource + from .resources.editors import EditorsResource, AsyncEditorsResource + from .resources.secrets import SecretsResource, AsyncSecretsResource + from .resources.accounts import AccountsResource, AsyncAccountsResource + from .resources.gateways import GatewaysResource, AsyncGatewaysResource + from .resources.identity import IdentityResource, AsyncIdentityResource + from .resources.prebuilds import PrebuildsResource, AsyncPrebuildsResource + from .resources.users.users import UsersResource, AsyncUsersResource + from .resources.groups.groups import GroupsResource, AsyncGroupsResource + from .resources.runners.runners import RunnersResource, AsyncRunnersResource + from .resources.projects.projects import ProjectsResource, AsyncProjectsResource + from .resources.environments.environments import EnvironmentsResource, AsyncEnvironmentsResource + from .resources.organizations.organizations import OrganizationsResource, AsyncOrganizationsResource __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gitpod", "AsyncGitpod", "Client", "AsyncClient"] class Gitpod(SyncAPIClient): - accounts: accounts.AccountsResource - agents: agents.AgentsResource - editors: editors.EditorsResource - environments: environments.EnvironmentsResource - errors: errors.ErrorsResource - events: events.EventsResource - gateways: gateways.GatewaysResource - groups: groups.GroupsResource - identity: identity.IdentityResource - organizations: organizations.OrganizationsResource - prebuilds: prebuilds.PrebuildsResource - projects: projects.ProjectsResource - runners: runners.RunnersResource - secrets: secrets.SecretsResource - usage: usage.UsageResource - users: users.UsersResource - with_raw_response: GitpodWithRawResponse - with_streaming_response: GitpodWithStreamedResponse - # client options bearer_token: str @@ -113,24 +124,109 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.accounts = accounts.AccountsResource(self) - self.agents = agents.AgentsResource(self) - self.editors = editors.EditorsResource(self) - self.environments = environments.EnvironmentsResource(self) - self.errors = errors.ErrorsResource(self) - self.events = events.EventsResource(self) - self.gateways = gateways.GatewaysResource(self) - self.groups = groups.GroupsResource(self) - self.identity = identity.IdentityResource(self) - self.organizations = organizations.OrganizationsResource(self) - self.prebuilds = prebuilds.PrebuildsResource(self) - self.projects = projects.ProjectsResource(self) - self.runners = runners.RunnersResource(self) - self.secrets = secrets.SecretsResource(self) - self.usage = usage.UsageResource(self) - self.users = users.UsersResource(self) - self.with_raw_response = GitpodWithRawResponse(self) - self.with_streaming_response = GitpodWithStreamedResponse(self) + @cached_property + def accounts(self) -> AccountsResource: + from .resources.accounts import AccountsResource + + return AccountsResource(self) + + @cached_property + def agents(self) -> AgentsResource: + from .resources.agents import AgentsResource + + return AgentsResource(self) + + @cached_property + def editors(self) -> EditorsResource: + from .resources.editors import EditorsResource + + return EditorsResource(self) + + @cached_property + def environments(self) -> EnvironmentsResource: + from .resources.environments import EnvironmentsResource + + return EnvironmentsResource(self) + + @cached_property + def errors(self) -> ErrorsResource: + from .resources.errors import ErrorsResource + + return ErrorsResource(self) + + @cached_property + def events(self) -> EventsResource: + from .resources.events import EventsResource + + return EventsResource(self) + + @cached_property + def gateways(self) -> GatewaysResource: + from .resources.gateways import GatewaysResource + + return GatewaysResource(self) + + @cached_property + def groups(self) -> GroupsResource: + from .resources.groups import GroupsResource + + return GroupsResource(self) + + @cached_property + def identity(self) -> IdentityResource: + from .resources.identity import IdentityResource + + return IdentityResource(self) + + @cached_property + def organizations(self) -> OrganizationsResource: + from .resources.organizations import OrganizationsResource + + return OrganizationsResource(self) + + @cached_property + def prebuilds(self) -> PrebuildsResource: + from .resources.prebuilds import PrebuildsResource + + return PrebuildsResource(self) + + @cached_property + def projects(self) -> ProjectsResource: + from .resources.projects import ProjectsResource + + return ProjectsResource(self) + + @cached_property + def runners(self) -> RunnersResource: + from .resources.runners import RunnersResource + + return RunnersResource(self) + + @cached_property + def secrets(self) -> SecretsResource: + from .resources.secrets import SecretsResource + + return SecretsResource(self) + + @cached_property + def usage(self) -> UsageResource: + from .resources.usage import UsageResource + + return UsageResource(self) + + @cached_property + def users(self) -> UsersResource: + from .resources.users import UsersResource + + return UsersResource(self) + + @cached_property + def with_raw_response(self) -> GitpodWithRawResponse: + return GitpodWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GitpodWithStreamedResponse: + return GitpodWithStreamedResponse(self) @property @override @@ -238,25 +334,6 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): - accounts: accounts.AsyncAccountsResource - agents: agents.AsyncAgentsResource - editors: editors.AsyncEditorsResource - environments: environments.AsyncEnvironmentsResource - errors: errors.AsyncErrorsResource - events: events.AsyncEventsResource - gateways: gateways.AsyncGatewaysResource - groups: groups.AsyncGroupsResource - identity: identity.AsyncIdentityResource - organizations: organizations.AsyncOrganizationsResource - prebuilds: prebuilds.AsyncPrebuildsResource - projects: projects.AsyncProjectsResource - runners: runners.AsyncRunnersResource - secrets: secrets.AsyncSecretsResource - usage: usage.AsyncUsageResource - users: users.AsyncUsersResource - with_raw_response: AsyncGitpodWithRawResponse - with_streaming_response: AsyncGitpodWithStreamedResponse - # client options bearer_token: str @@ -311,24 +388,109 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.accounts = accounts.AsyncAccountsResource(self) - self.agents = agents.AsyncAgentsResource(self) - self.editors = editors.AsyncEditorsResource(self) - self.environments = environments.AsyncEnvironmentsResource(self) - self.errors = errors.AsyncErrorsResource(self) - self.events = events.AsyncEventsResource(self) - self.gateways = gateways.AsyncGatewaysResource(self) - self.groups = groups.AsyncGroupsResource(self) - self.identity = identity.AsyncIdentityResource(self) - self.organizations = organizations.AsyncOrganizationsResource(self) - self.prebuilds = prebuilds.AsyncPrebuildsResource(self) - self.projects = projects.AsyncProjectsResource(self) - self.runners = runners.AsyncRunnersResource(self) - self.secrets = secrets.AsyncSecretsResource(self) - self.usage = usage.AsyncUsageResource(self) - self.users = users.AsyncUsersResource(self) - self.with_raw_response = AsyncGitpodWithRawResponse(self) - self.with_streaming_response = AsyncGitpodWithStreamedResponse(self) + @cached_property + def accounts(self) -> AsyncAccountsResource: + from .resources.accounts import AsyncAccountsResource + + return AsyncAccountsResource(self) + + @cached_property + def agents(self) -> AsyncAgentsResource: + from .resources.agents import AsyncAgentsResource + + return AsyncAgentsResource(self) + + @cached_property + def editors(self) -> AsyncEditorsResource: + from .resources.editors import AsyncEditorsResource + + return AsyncEditorsResource(self) + + @cached_property + def environments(self) -> AsyncEnvironmentsResource: + from .resources.environments import AsyncEnvironmentsResource + + return AsyncEnvironmentsResource(self) + + @cached_property + def errors(self) -> AsyncErrorsResource: + from .resources.errors import AsyncErrorsResource + + return AsyncErrorsResource(self) + + @cached_property + def events(self) -> AsyncEventsResource: + from .resources.events import AsyncEventsResource + + return AsyncEventsResource(self) + + @cached_property + def gateways(self) -> AsyncGatewaysResource: + from .resources.gateways import AsyncGatewaysResource + + return AsyncGatewaysResource(self) + + @cached_property + def groups(self) -> AsyncGroupsResource: + from .resources.groups import AsyncGroupsResource + + return AsyncGroupsResource(self) + + @cached_property + def identity(self) -> AsyncIdentityResource: + from .resources.identity import AsyncIdentityResource + + return AsyncIdentityResource(self) + + @cached_property + def organizations(self) -> AsyncOrganizationsResource: + from .resources.organizations import AsyncOrganizationsResource + + return AsyncOrganizationsResource(self) + + @cached_property + def prebuilds(self) -> AsyncPrebuildsResource: + from .resources.prebuilds import AsyncPrebuildsResource + + return AsyncPrebuildsResource(self) + + @cached_property + def projects(self) -> AsyncProjectsResource: + from .resources.projects import AsyncProjectsResource + + return AsyncProjectsResource(self) + + @cached_property + def runners(self) -> AsyncRunnersResource: + from .resources.runners import AsyncRunnersResource + + return AsyncRunnersResource(self) + + @cached_property + def secrets(self) -> AsyncSecretsResource: + from .resources.secrets import AsyncSecretsResource + + return AsyncSecretsResource(self) + + @cached_property + def usage(self) -> AsyncUsageResource: + from .resources.usage import AsyncUsageResource + + return AsyncUsageResource(self) + + @cached_property + def users(self) -> AsyncUsersResource: + from .resources.users import AsyncUsersResource + + return AsyncUsersResource(self) + + @cached_property + def with_raw_response(self) -> AsyncGitpodWithRawResponse: + return AsyncGitpodWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGitpodWithStreamedResponse: + return AsyncGitpodWithStreamedResponse(self) @property @override @@ -436,83 +598,415 @@ def _make_status_error( class GitpodWithRawResponse: + _client: Gitpod + def __init__(self, client: Gitpod) -> None: - self.accounts = accounts.AccountsResourceWithRawResponse(client.accounts) - self.agents = agents.AgentsResourceWithRawResponse(client.agents) - self.editors = editors.EditorsResourceWithRawResponse(client.editors) - self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) - self.errors = errors.ErrorsResourceWithRawResponse(client.errors) - self.events = events.EventsResourceWithRawResponse(client.events) - self.gateways = gateways.GatewaysResourceWithRawResponse(client.gateways) - self.groups = groups.GroupsResourceWithRawResponse(client.groups) - self.identity = identity.IdentityResourceWithRawResponse(client.identity) - self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations) - self.prebuilds = prebuilds.PrebuildsResourceWithRawResponse(client.prebuilds) - self.projects = projects.ProjectsResourceWithRawResponse(client.projects) - self.runners = runners.RunnersResourceWithRawResponse(client.runners) - self.secrets = secrets.SecretsResourceWithRawResponse(client.secrets) - self.usage = usage.UsageResourceWithRawResponse(client.usage) - self.users = users.UsersResourceWithRawResponse(client.users) + self._client = client + + @cached_property + def accounts(self) -> accounts.AccountsResourceWithRawResponse: + from .resources.accounts import AccountsResourceWithRawResponse + + return AccountsResourceWithRawResponse(self._client.accounts) + + @cached_property + def agents(self) -> agents.AgentsResourceWithRawResponse: + from .resources.agents import AgentsResourceWithRawResponse + + return AgentsResourceWithRawResponse(self._client.agents) + + @cached_property + def editors(self) -> editors.EditorsResourceWithRawResponse: + from .resources.editors import EditorsResourceWithRawResponse + + return EditorsResourceWithRawResponse(self._client.editors) + + @cached_property + def environments(self) -> environments.EnvironmentsResourceWithRawResponse: + from .resources.environments import EnvironmentsResourceWithRawResponse + + return EnvironmentsResourceWithRawResponse(self._client.environments) + + @cached_property + def errors(self) -> errors.ErrorsResourceWithRawResponse: + from .resources.errors import ErrorsResourceWithRawResponse + + return ErrorsResourceWithRawResponse(self._client.errors) + + @cached_property + def events(self) -> events.EventsResourceWithRawResponse: + from .resources.events import EventsResourceWithRawResponse + + return EventsResourceWithRawResponse(self._client.events) + + @cached_property + def gateways(self) -> gateways.GatewaysResourceWithRawResponse: + from .resources.gateways import GatewaysResourceWithRawResponse + + return GatewaysResourceWithRawResponse(self._client.gateways) + + @cached_property + def groups(self) -> groups.GroupsResourceWithRawResponse: + from .resources.groups import GroupsResourceWithRawResponse + + return GroupsResourceWithRawResponse(self._client.groups) + + @cached_property + def identity(self) -> identity.IdentityResourceWithRawResponse: + from .resources.identity import IdentityResourceWithRawResponse + + return IdentityResourceWithRawResponse(self._client.identity) + + @cached_property + def organizations(self) -> organizations.OrganizationsResourceWithRawResponse: + from .resources.organizations import OrganizationsResourceWithRawResponse + + return OrganizationsResourceWithRawResponse(self._client.organizations) + + @cached_property + def prebuilds(self) -> prebuilds.PrebuildsResourceWithRawResponse: + from .resources.prebuilds import PrebuildsResourceWithRawResponse + + return PrebuildsResourceWithRawResponse(self._client.prebuilds) + + @cached_property + def projects(self) -> projects.ProjectsResourceWithRawResponse: + from .resources.projects import ProjectsResourceWithRawResponse + + return ProjectsResourceWithRawResponse(self._client.projects) + + @cached_property + def runners(self) -> runners.RunnersResourceWithRawResponse: + from .resources.runners import RunnersResourceWithRawResponse + + return RunnersResourceWithRawResponse(self._client.runners) + + @cached_property + def secrets(self) -> secrets.SecretsResourceWithRawResponse: + from .resources.secrets import SecretsResourceWithRawResponse + + return SecretsResourceWithRawResponse(self._client.secrets) + + @cached_property + def usage(self) -> usage.UsageResourceWithRawResponse: + from .resources.usage import UsageResourceWithRawResponse + + return UsageResourceWithRawResponse(self._client.usage) + + @cached_property + def users(self) -> users.UsersResourceWithRawResponse: + from .resources.users import UsersResourceWithRawResponse + + return UsersResourceWithRawResponse(self._client.users) class AsyncGitpodWithRawResponse: + _client: AsyncGitpod + def __init__(self, client: AsyncGitpod) -> None: - self.accounts = accounts.AsyncAccountsResourceWithRawResponse(client.accounts) - self.agents = agents.AsyncAgentsResourceWithRawResponse(client.agents) - self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors) - self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) - self.errors = errors.AsyncErrorsResourceWithRawResponse(client.errors) - self.events = events.AsyncEventsResourceWithRawResponse(client.events) - self.gateways = gateways.AsyncGatewaysResourceWithRawResponse(client.gateways) - self.groups = groups.AsyncGroupsResourceWithRawResponse(client.groups) - self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity) - self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations) - self.prebuilds = prebuilds.AsyncPrebuildsResourceWithRawResponse(client.prebuilds) - self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) - self.runners = runners.AsyncRunnersResourceWithRawResponse(client.runners) - self.secrets = secrets.AsyncSecretsResourceWithRawResponse(client.secrets) - self.usage = usage.AsyncUsageResourceWithRawResponse(client.usage) - self.users = users.AsyncUsersResourceWithRawResponse(client.users) + self._client = client + + @cached_property + def accounts(self) -> accounts.AsyncAccountsResourceWithRawResponse: + from .resources.accounts import AsyncAccountsResourceWithRawResponse + + return AsyncAccountsResourceWithRawResponse(self._client.accounts) + + @cached_property + def agents(self) -> agents.AsyncAgentsResourceWithRawResponse: + from .resources.agents import AsyncAgentsResourceWithRawResponse + + return AsyncAgentsResourceWithRawResponse(self._client.agents) + + @cached_property + def editors(self) -> editors.AsyncEditorsResourceWithRawResponse: + from .resources.editors import AsyncEditorsResourceWithRawResponse + + return AsyncEditorsResourceWithRawResponse(self._client.editors) + + @cached_property + def environments(self) -> environments.AsyncEnvironmentsResourceWithRawResponse: + from .resources.environments import AsyncEnvironmentsResourceWithRawResponse + + return AsyncEnvironmentsResourceWithRawResponse(self._client.environments) + + @cached_property + def errors(self) -> errors.AsyncErrorsResourceWithRawResponse: + from .resources.errors import AsyncErrorsResourceWithRawResponse + + return AsyncErrorsResourceWithRawResponse(self._client.errors) + + @cached_property + def events(self) -> events.AsyncEventsResourceWithRawResponse: + from .resources.events import AsyncEventsResourceWithRawResponse + + return AsyncEventsResourceWithRawResponse(self._client.events) + + @cached_property + def gateways(self) -> gateways.AsyncGatewaysResourceWithRawResponse: + from .resources.gateways import AsyncGatewaysResourceWithRawResponse + + return AsyncGatewaysResourceWithRawResponse(self._client.gateways) + + @cached_property + def groups(self) -> groups.AsyncGroupsResourceWithRawResponse: + from .resources.groups import AsyncGroupsResourceWithRawResponse + + return AsyncGroupsResourceWithRawResponse(self._client.groups) + + @cached_property + def identity(self) -> identity.AsyncIdentityResourceWithRawResponse: + from .resources.identity import AsyncIdentityResourceWithRawResponse + + return AsyncIdentityResourceWithRawResponse(self._client.identity) + + @cached_property + def organizations(self) -> organizations.AsyncOrganizationsResourceWithRawResponse: + from .resources.organizations import AsyncOrganizationsResourceWithRawResponse + + return AsyncOrganizationsResourceWithRawResponse(self._client.organizations) + + @cached_property + def prebuilds(self) -> prebuilds.AsyncPrebuildsResourceWithRawResponse: + from .resources.prebuilds import AsyncPrebuildsResourceWithRawResponse + + return AsyncPrebuildsResourceWithRawResponse(self._client.prebuilds) + + @cached_property + def projects(self) -> projects.AsyncProjectsResourceWithRawResponse: + from .resources.projects import AsyncProjectsResourceWithRawResponse + + return AsyncProjectsResourceWithRawResponse(self._client.projects) + + @cached_property + def runners(self) -> runners.AsyncRunnersResourceWithRawResponse: + from .resources.runners import AsyncRunnersResourceWithRawResponse + + return AsyncRunnersResourceWithRawResponse(self._client.runners) + + @cached_property + def secrets(self) -> secrets.AsyncSecretsResourceWithRawResponse: + from .resources.secrets import AsyncSecretsResourceWithRawResponse + + return AsyncSecretsResourceWithRawResponse(self._client.secrets) + + @cached_property + def usage(self) -> usage.AsyncUsageResourceWithRawResponse: + from .resources.usage import AsyncUsageResourceWithRawResponse + + return AsyncUsageResourceWithRawResponse(self._client.usage) + + @cached_property + def users(self) -> users.AsyncUsersResourceWithRawResponse: + from .resources.users import AsyncUsersResourceWithRawResponse + + return AsyncUsersResourceWithRawResponse(self._client.users) class GitpodWithStreamedResponse: + _client: Gitpod + def __init__(self, client: Gitpod) -> None: - self.accounts = accounts.AccountsResourceWithStreamingResponse(client.accounts) - self.agents = agents.AgentsResourceWithStreamingResponse(client.agents) - self.editors = editors.EditorsResourceWithStreamingResponse(client.editors) - self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) - self.errors = errors.ErrorsResourceWithStreamingResponse(client.errors) - self.events = events.EventsResourceWithStreamingResponse(client.events) - self.gateways = gateways.GatewaysResourceWithStreamingResponse(client.gateways) - self.groups = groups.GroupsResourceWithStreamingResponse(client.groups) - self.identity = identity.IdentityResourceWithStreamingResponse(client.identity) - self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations) - self.prebuilds = prebuilds.PrebuildsResourceWithStreamingResponse(client.prebuilds) - self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) - self.runners = runners.RunnersResourceWithStreamingResponse(client.runners) - self.secrets = secrets.SecretsResourceWithStreamingResponse(client.secrets) - self.usage = usage.UsageResourceWithStreamingResponse(client.usage) - self.users = users.UsersResourceWithStreamingResponse(client.users) + self._client = client + + @cached_property + def accounts(self) -> accounts.AccountsResourceWithStreamingResponse: + from .resources.accounts import AccountsResourceWithStreamingResponse + + return AccountsResourceWithStreamingResponse(self._client.accounts) + + @cached_property + def agents(self) -> agents.AgentsResourceWithStreamingResponse: + from .resources.agents import AgentsResourceWithStreamingResponse + + return AgentsResourceWithStreamingResponse(self._client.agents) + + @cached_property + def editors(self) -> editors.EditorsResourceWithStreamingResponse: + from .resources.editors import EditorsResourceWithStreamingResponse + + return EditorsResourceWithStreamingResponse(self._client.editors) + + @cached_property + def environments(self) -> environments.EnvironmentsResourceWithStreamingResponse: + from .resources.environments import EnvironmentsResourceWithStreamingResponse + + return EnvironmentsResourceWithStreamingResponse(self._client.environments) + + @cached_property + def errors(self) -> errors.ErrorsResourceWithStreamingResponse: + from .resources.errors import ErrorsResourceWithStreamingResponse + + return ErrorsResourceWithStreamingResponse(self._client.errors) + + @cached_property + def events(self) -> events.EventsResourceWithStreamingResponse: + from .resources.events import EventsResourceWithStreamingResponse + + return EventsResourceWithStreamingResponse(self._client.events) + + @cached_property + def gateways(self) -> gateways.GatewaysResourceWithStreamingResponse: + from .resources.gateways import GatewaysResourceWithStreamingResponse + + return GatewaysResourceWithStreamingResponse(self._client.gateways) + + @cached_property + def groups(self) -> groups.GroupsResourceWithStreamingResponse: + from .resources.groups import GroupsResourceWithStreamingResponse + + return GroupsResourceWithStreamingResponse(self._client.groups) + + @cached_property + def identity(self) -> identity.IdentityResourceWithStreamingResponse: + from .resources.identity import IdentityResourceWithStreamingResponse + + return IdentityResourceWithStreamingResponse(self._client.identity) + + @cached_property + def organizations(self) -> organizations.OrganizationsResourceWithStreamingResponse: + from .resources.organizations import OrganizationsResourceWithStreamingResponse + + return OrganizationsResourceWithStreamingResponse(self._client.organizations) + + @cached_property + def prebuilds(self) -> prebuilds.PrebuildsResourceWithStreamingResponse: + from .resources.prebuilds import PrebuildsResourceWithStreamingResponse + + return PrebuildsResourceWithStreamingResponse(self._client.prebuilds) + + @cached_property + def projects(self) -> projects.ProjectsResourceWithStreamingResponse: + from .resources.projects import ProjectsResourceWithStreamingResponse + + return ProjectsResourceWithStreamingResponse(self._client.projects) + + @cached_property + def runners(self) -> runners.RunnersResourceWithStreamingResponse: + from .resources.runners import RunnersResourceWithStreamingResponse + + return RunnersResourceWithStreamingResponse(self._client.runners) + + @cached_property + def secrets(self) -> secrets.SecretsResourceWithStreamingResponse: + from .resources.secrets import SecretsResourceWithStreamingResponse + + return SecretsResourceWithStreamingResponse(self._client.secrets) + + @cached_property + def usage(self) -> usage.UsageResourceWithStreamingResponse: + from .resources.usage import UsageResourceWithStreamingResponse + + return UsageResourceWithStreamingResponse(self._client.usage) + + @cached_property + def users(self) -> users.UsersResourceWithStreamingResponse: + from .resources.users import UsersResourceWithStreamingResponse + + return UsersResourceWithStreamingResponse(self._client.users) class AsyncGitpodWithStreamedResponse: + _client: AsyncGitpod + def __init__(self, client: AsyncGitpod) -> None: - self.accounts = accounts.AsyncAccountsResourceWithStreamingResponse(client.accounts) - self.agents = agents.AsyncAgentsResourceWithStreamingResponse(client.agents) - self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors) - self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) - self.errors = errors.AsyncErrorsResourceWithStreamingResponse(client.errors) - self.events = events.AsyncEventsResourceWithStreamingResponse(client.events) - self.gateways = gateways.AsyncGatewaysResourceWithStreamingResponse(client.gateways) - self.groups = groups.AsyncGroupsResourceWithStreamingResponse(client.groups) - self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity) - self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) - self.prebuilds = prebuilds.AsyncPrebuildsResourceWithStreamingResponse(client.prebuilds) - self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) - self.runners = runners.AsyncRunnersResourceWithStreamingResponse(client.runners) - self.secrets = secrets.AsyncSecretsResourceWithStreamingResponse(client.secrets) - self.usage = usage.AsyncUsageResourceWithStreamingResponse(client.usage) - self.users = users.AsyncUsersResourceWithStreamingResponse(client.users) + self._client = client + + @cached_property + def accounts(self) -> accounts.AsyncAccountsResourceWithStreamingResponse: + from .resources.accounts import AsyncAccountsResourceWithStreamingResponse + + return AsyncAccountsResourceWithStreamingResponse(self._client.accounts) + + @cached_property + def agents(self) -> agents.AsyncAgentsResourceWithStreamingResponse: + from .resources.agents import AsyncAgentsResourceWithStreamingResponse + + return AsyncAgentsResourceWithStreamingResponse(self._client.agents) + + @cached_property + def editors(self) -> editors.AsyncEditorsResourceWithStreamingResponse: + from .resources.editors import AsyncEditorsResourceWithStreamingResponse + + return AsyncEditorsResourceWithStreamingResponse(self._client.editors) + + @cached_property + def environments(self) -> environments.AsyncEnvironmentsResourceWithStreamingResponse: + from .resources.environments import AsyncEnvironmentsResourceWithStreamingResponse + + return AsyncEnvironmentsResourceWithStreamingResponse(self._client.environments) + + @cached_property + def errors(self) -> errors.AsyncErrorsResourceWithStreamingResponse: + from .resources.errors import AsyncErrorsResourceWithStreamingResponse + + return AsyncErrorsResourceWithStreamingResponse(self._client.errors) + + @cached_property + def events(self) -> events.AsyncEventsResourceWithStreamingResponse: + from .resources.events import AsyncEventsResourceWithStreamingResponse + + return AsyncEventsResourceWithStreamingResponse(self._client.events) + + @cached_property + def gateways(self) -> gateways.AsyncGatewaysResourceWithStreamingResponse: + from .resources.gateways import AsyncGatewaysResourceWithStreamingResponse + + return AsyncGatewaysResourceWithStreamingResponse(self._client.gateways) + + @cached_property + def groups(self) -> groups.AsyncGroupsResourceWithStreamingResponse: + from .resources.groups import AsyncGroupsResourceWithStreamingResponse + + return AsyncGroupsResourceWithStreamingResponse(self._client.groups) + + @cached_property + def identity(self) -> identity.AsyncIdentityResourceWithStreamingResponse: + from .resources.identity import AsyncIdentityResourceWithStreamingResponse + + return AsyncIdentityResourceWithStreamingResponse(self._client.identity) + + @cached_property + def organizations(self) -> organizations.AsyncOrganizationsResourceWithStreamingResponse: + from .resources.organizations import AsyncOrganizationsResourceWithStreamingResponse + + return AsyncOrganizationsResourceWithStreamingResponse(self._client.organizations) + + @cached_property + def prebuilds(self) -> prebuilds.AsyncPrebuildsResourceWithStreamingResponse: + from .resources.prebuilds import AsyncPrebuildsResourceWithStreamingResponse + + return AsyncPrebuildsResourceWithStreamingResponse(self._client.prebuilds) + + @cached_property + def projects(self) -> projects.AsyncProjectsResourceWithStreamingResponse: + from .resources.projects import AsyncProjectsResourceWithStreamingResponse + + return AsyncProjectsResourceWithStreamingResponse(self._client.projects) + + @cached_property + def runners(self) -> runners.AsyncRunnersResourceWithStreamingResponse: + from .resources.runners import AsyncRunnersResourceWithStreamingResponse + + return AsyncRunnersResourceWithStreamingResponse(self._client.runners) + + @cached_property + def secrets(self) -> secrets.AsyncSecretsResourceWithStreamingResponse: + from .resources.secrets import AsyncSecretsResourceWithStreamingResponse + + return AsyncSecretsResourceWithStreamingResponse(self._client.secrets) + + @cached_property + def usage(self) -> usage.AsyncUsageResourceWithStreamingResponse: + from .resources.usage import AsyncUsageResourceWithStreamingResponse + + return AsyncUsageResourceWithStreamingResponse(self._client.usage) + + @cached_property + def users(self) -> users.AsyncUsersResourceWithStreamingResponse: + from .resources.users import AsyncUsersResourceWithStreamingResponse + + return AsyncUsersResourceWithStreamingResponse(self._client.users) Client = Gitpod From 8546231f38ad2dcfc1cfb4a25f0a07ccedcc5ec7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 08:16:53 +0000 Subject: [PATCH 231/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d04f223f..383dd5a3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.1" + ".": "0.5.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 74ab4bcb..5bf0feb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.5.1" +version = "0.5.2" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 33773aa7..de507a36 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.5.1" # x-release-please-version +__version__ = "0.5.2" # x-release-please-version From b2a726eabee678d6bb58e0d1d101846f7ebd175c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 12:11:17 +0000 Subject: [PATCH 232/505] feat(agent): add group-based SCM tools access control --- .stats.yml | 8 +- api.md | 7 +- src/gitpod/resources/groups/memberships.py | 146 +++++++++++++++++- src/gitpod/types/groups/__init__.py | 2 + .../groups/membership_retrieve_params.py | 17 ++ .../groups/membership_retrieve_response.py | 13 ++ .../types/organizations/agent_policy.py | 8 +- .../organizations/policy_update_params.py | 6 + src/gitpod/types/project_list_params.py | 8 + .../api_resources/groups/test_memberships.py | 93 +++++++++++ .../organizations/test_policies.py | 2 + tests/api_resources/test_projects.py | 2 + 12 files changed, 305 insertions(+), 7 deletions(-) create mode 100644 src/gitpod/types/groups/membership_retrieve_params.py create mode 100644 src/gitpod/types/groups/membership_retrieve_response.py diff --git a/.stats.yml b/.stats.yml index 0fdb5b62..2b7ac984 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 159 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d62ef4b9187c1f3d36f428abc4b31d8a09ffd36e93d39b8136c60c8f463c838e.yml -openapi_spec_hash: d7f01b6f24e88eb46d744ecd28061f26 -config_hash: 26e4a10dfc6ec809322e60d889d15414 +configured_endpoints: 160 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a19818e87979929d5484f97ec50318899c659c73733b4a700a41f28687ee2632.yml +openapi_spec_hash: f2d83905d1ed19d50c2f4641ecf29204 +config_hash: e84bdcd3fab4b185dd3dd79f70ea527d diff --git a/api.md b/api.md index 54769280..fc5a1570 100644 --- a/api.md +++ b/api.md @@ -281,12 +281,17 @@ Methods: Types: ```python -from gitpod.types.groups import GroupMembership, MembershipCreateResponse +from gitpod.types.groups import ( + GroupMembership, + MembershipCreateResponse, + MembershipRetrieveResponse, +) ``` Methods: - client.groups.memberships.create(\*\*params) -> MembershipCreateResponse +- client.groups.memberships.retrieve(\*\*params) -> MembershipRetrieveResponse - client.groups.memberships.list(\*\*params) -> SyncMembersPage[GroupMembership] - client.groups.memberships.delete(\*\*params) -> object diff --git a/src/gitpod/resources/groups/memberships.py b/src/gitpod/resources/groups/memberships.py index 11b07f11..9ccee3ce 100644 --- a/src/gitpod/resources/groups/memberships.py +++ b/src/gitpod/resources/groups/memberships.py @@ -16,10 +16,16 @@ ) from ...pagination import SyncMembersPage, AsyncMembersPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.groups import membership_list_params, membership_create_params, membership_delete_params +from ...types.groups import ( + membership_list_params, + membership_create_params, + membership_delete_params, + membership_retrieve_params, +) from ...types.shared_params.subject import Subject from ...types.groups.group_membership import GroupMembership from ...types.groups.membership_create_response import MembershipCreateResponse +from ...types.groups.membership_retrieve_response import MembershipRetrieveResponse __all__ = ["MembershipsResource", "AsyncMembershipsResource"] @@ -108,6 +114,69 @@ def create( cast_to=MembershipCreateResponse, ) + def retrieve( + self, + *, + subject: Subject, + group_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MembershipRetrieveResponse: + """ + Gets a specific membership by group ID and subject. + + Use this method to: + + - Check if a user or service account is a member of a group + - Verify group membership for access control + + ### Examples + + - Check user membership: + + Checks if a user is a member of a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + subject: + id: "f53d2330-3795-4c5d-a1f3-453121af9c60" + principal: PRINCIPAL_USER + ``` + + ### Authorization + + All organization members can check group membership (transparency model). + + Args: + subject: Subject to check membership for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/GetMembership", + body=maybe_transform( + { + "subject": subject, + "group_id": group_id, + }, + membership_retrieve_params.MembershipRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MembershipRetrieveResponse, + ) + def list( self, *, @@ -323,6 +392,69 @@ async def create( cast_to=MembershipCreateResponse, ) + async def retrieve( + self, + *, + subject: Subject, + group_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MembershipRetrieveResponse: + """ + Gets a specific membership by group ID and subject. + + Use this method to: + + - Check if a user or service account is a member of a group + - Verify group membership for access control + + ### Examples + + - Check user membership: + + Checks if a user is a member of a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + subject: + id: "f53d2330-3795-4c5d-a1f3-453121af9c60" + principal: PRINCIPAL_USER + ``` + + ### Authorization + + All organization members can check group membership (transparency model). + + Args: + subject: Subject to check membership for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/GetMembership", + body=await async_maybe_transform( + { + "subject": subject, + "group_id": group_id, + }, + membership_retrieve_params.MembershipRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MembershipRetrieveResponse, + ) + def list( self, *, @@ -463,6 +595,9 @@ def __init__(self, memberships: MembershipsResource) -> None: self.create = to_raw_response_wrapper( memberships.create, ) + self.retrieve = to_raw_response_wrapper( + memberships.retrieve, + ) self.list = to_raw_response_wrapper( memberships.list, ) @@ -478,6 +613,9 @@ def __init__(self, memberships: AsyncMembershipsResource) -> None: self.create = async_to_raw_response_wrapper( memberships.create, ) + self.retrieve = async_to_raw_response_wrapper( + memberships.retrieve, + ) self.list = async_to_raw_response_wrapper( memberships.list, ) @@ -493,6 +631,9 @@ def __init__(self, memberships: MembershipsResource) -> None: self.create = to_streamed_response_wrapper( memberships.create, ) + self.retrieve = to_streamed_response_wrapper( + memberships.retrieve, + ) self.list = to_streamed_response_wrapper( memberships.list, ) @@ -508,6 +649,9 @@ def __init__(self, memberships: AsyncMembershipsResource) -> None: self.create = async_to_streamed_response_wrapper( memberships.create, ) + self.retrieve = async_to_streamed_response_wrapper( + memberships.retrieve, + ) self.list = async_to_streamed_response_wrapper( memberships.list, ) diff --git a/src/gitpod/types/groups/__init__.py b/src/gitpod/types/groups/__init__.py index f689e45d..abbe99fe 100644 --- a/src/gitpod/types/groups/__init__.py +++ b/src/gitpod/types/groups/__init__.py @@ -9,7 +9,9 @@ from .membership_create_params import MembershipCreateParams as MembershipCreateParams from .membership_delete_params import MembershipDeleteParams as MembershipDeleteParams from .membership_create_response import MembershipCreateResponse as MembershipCreateResponse +from .membership_retrieve_params import MembershipRetrieveParams as MembershipRetrieveParams from .role_assignment_list_params import RoleAssignmentListParams as RoleAssignmentListParams +from .membership_retrieve_response import MembershipRetrieveResponse as MembershipRetrieveResponse from .role_assignment_create_params import RoleAssignmentCreateParams as RoleAssignmentCreateParams from .role_assignment_delete_params import RoleAssignmentDeleteParams as RoleAssignmentDeleteParams from .role_assignment_create_response import RoleAssignmentCreateResponse as RoleAssignmentCreateResponse diff --git a/src/gitpod/types/groups/membership_retrieve_params.py b/src/gitpod/types/groups/membership_retrieve_params.py new file mode 100644 index 00000000..7934b5c8 --- /dev/null +++ b/src/gitpod/types/groups/membership_retrieve_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from ..shared_params.subject import Subject + +__all__ = ["MembershipRetrieveParams"] + + +class MembershipRetrieveParams(TypedDict, total=False): + subject: Required[Subject] + """Subject to check membership for""" + + group_id: Annotated[str, PropertyInfo(alias="groupId")] diff --git a/src/gitpod/types/groups/membership_retrieve_response.py b/src/gitpod/types/groups/membership_retrieve_response.py new file mode 100644 index 00000000..bfa92f8d --- /dev/null +++ b/src/gitpod/types/groups/membership_retrieve_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .group_membership import GroupMembership + +__all__ = ["MembershipRetrieveResponse"] + + +class MembershipRetrieveResponse(BaseModel): + member: Optional[GroupMembership] = None + """The membership if found, nil if subject is not a member""" diff --git a/src/gitpod/types/organizations/agent_policy.py b/src/gitpod/types/organizations/agent_policy.py index 7f5e1de9..92827dd2 100644 --- a/src/gitpod/types/organizations/agent_policy.py +++ b/src/gitpod/types/organizations/agent_policy.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from pydantic import Field as FieldInfo @@ -29,3 +29,9 @@ class AgentPolicy(BaseModel): scm_tools_disabled controls whether SCM (Source Control Management) tools are disabled for agents """ + + scm_tools_allowed_group_id: Optional[str] = FieldInfo(alias="scmToolsAllowedGroupId", default=None) + """ + scm_tools_allowed_group_id restricts SCM tools access to members of this group. + Empty means no restriction (all users can use SCM tools if not disabled). + """ diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index 50cfaae4..6c5f5ebb 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -131,6 +131,12 @@ class AgentPolicy(TypedDict, total=False): agents """ + scm_tools_allowed_group_id: Annotated[Optional[str], PropertyInfo(alias="scmToolsAllowedGroupId")] + """ + scm_tools_allowed_group_id restricts SCM tools access to members of this group. + Empty means no restriction (all users can use SCM tools if not disabled). + """ + scm_tools_disabled: Annotated[Optional[bool], PropertyInfo(alias="scmToolsDisabled")] """ scm_tools_disabled controls whether SCM (Source Control Management) tools are diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py index ea25cc93..0ce45e83 100644 --- a/src/gitpod/types/project_list_params.py +++ b/src/gitpod/types/project_list_params.py @@ -2,10 +2,12 @@ from __future__ import annotations +from typing import List from typing_extensions import Annotated, TypedDict from .._types import SequenceNotStr from .._utils import PropertyInfo +from .runner_kind import RunnerKind __all__ = ["ProjectListParams", "Filter", "Pagination"] @@ -31,6 +33,12 @@ class Filter(TypedDict, total=False): from these runners """ + runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] + """ + runner_kinds filters the response to only projects that use environment classes + from runners of these kinds + """ + search: str """ search performs case-insensitive search across project name, project ID, and diff --git a/tests/api_resources/groups/test_memberships.py b/tests/api_resources/groups/test_memberships.py index b0de9f54..88c7c32b 100644 --- a/tests/api_resources/groups/test_memberships.py +++ b/tests/api_resources/groups/test_memberships.py @@ -13,6 +13,7 @@ from gitpod.types.groups import ( GroupMembership, MembershipCreateResponse, + MembershipRetrieveResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -61,6 +62,52 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + membership = client.groups.memberships.retrieve( + subject={}, + ) + assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + membership = client.groups.memberships.retrieve( + subject={ + "id": "f53d2330-3795-4c5d-a1f3-453121af9c60", + "principal": "PRINCIPAL_USER", + }, + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.groups.memberships.with_raw_response.retrieve( + subject={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = response.parse() + assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.groups.memberships.with_streaming_response.retrieve( + subject={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = response.parse() + assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: @@ -185,6 +232,52 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.retrieve( + subject={}, + ) + assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.retrieve( + subject={ + "id": "f53d2330-3795-4c5d-a1f3-453121af9c60", + "principal": "PRINCIPAL_USER", + }, + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.memberships.with_raw_response.retrieve( + subject={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = await response.parse() + assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.memberships.with_streaming_response.retrieve( + subject={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = await response.parse() + assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index 1d743341..eed1d45d 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -67,6 +67,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: agent_policy={ "command_deny_list": ["string"], "mcp_disabled": True, + "scm_tools_allowed_group_id": "scmToolsAllowedGroupId", "scm_tools_disabled": True, }, allowed_editor_ids=["string"], @@ -177,6 +178,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> agent_policy={ "command_deny_list": ["string"], "mcp_disabled": True, + "scm_tools_allowed_group_id": "scmToolsAllowedGroupId", "scm_tools_disabled": True, }, allowed_editor_ids=["string"], diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 0408e8a1..6acd6e18 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -210,6 +210,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "search": "search", }, pagination={ @@ -506,6 +507,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "search": "search", }, pagination={ From c52383d5e84b1900a57f736cf6290e60f98f8023 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:47:55 +0000 Subject: [PATCH 233/505] fix: use async_to_httpx_files in patch method --- src/gitpod/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index a1f4ce1c..16139794 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -1774,7 +1774,7 @@ async def patch( options: RequestOptions = {}, ) -> ResponseT: opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) From a5535d0f371db90fddefc25a757d0680561a18c7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 22:25:09 +0000 Subject: [PATCH 234/505] chore(internal): codegen related update --- scripts/lint | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/lint b/scripts/lint index 6a98ee4f..1b2951be 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,13 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running lints" -rye run lint +if [ "$1" = "--fix" ]; then + echo "==> Running lints with --fix" + rye run fix:ruff +else + echo "==> Running lints" + rye run lint +fi echo "==> Making sure it imports" rye run python -c 'import gitpod' From e90a12c4a3eb26f5f73c37ec5c37379abe90a5c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 18:54:18 +0000 Subject: [PATCH 235/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b7ac984..f59d5bf5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a19818e87979929d5484f97ec50318899c659c73733b4a700a41f28687ee2632.yml -openapi_spec_hash: f2d83905d1ed19d50c2f4641ecf29204 -config_hash: e84bdcd3fab4b185dd3dd79f70ea527d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8b86b2ad546df57ba9b530cb8d31733d99c4b629bbcac61bc10775bbd577e6b4.yml +openapi_spec_hash: 9d895493e3b1ad702e554d9e2b19e8bc +config_hash: 8e1b089e9f5af438fd56b523014af4f2 From b786a6a96ac97a0f0e6384fa29a582dc8bf8f6b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 04:07:40 +0000 Subject: [PATCH 236/505] chore(internal): codegen related update --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 01fd4f23..30d8cd5d 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Gitpod + Copyright 2026 Gitpod Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 64deeba354a068c0d2a19d30cf89fa52c3b6d21c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 08:18:04 +0000 Subject: [PATCH 237/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f59d5bf5..756ee10e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8b86b2ad546df57ba9b530cb8d31733d99c4b629bbcac61bc10775bbd577e6b4.yml -openapi_spec_hash: 9d895493e3b1ad702e554d9e2b19e8bc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-de9c92c5d163d0aaf84f2638cda7e3715a36bf85c5dbe89cea6657fe94201b07.yml +openapi_spec_hash: d010871ad88365048994b21eed2c36d9 config_hash: 8e1b089e9f5af438fd56b523014af4f2 From 199882c217a59d88a0645aef6bcfeeb13a060c2c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 10:23:28 +0000 Subject: [PATCH 238/505] feat(skills): add organization-level skills support --- .stats.yml | 4 ++-- src/gitpod/resources/agents.py | 4 ++++ src/gitpod/types/agent_create_prompt_params.py | 2 ++ src/gitpod/types/agent_list_prompts_params.py | 2 ++ src/gitpod/types/agent_update_prompt_params.py | 3 +++ src/gitpod/types/prompt_spec.py | 3 +++ tests/api_resources/test_agents.py | 6 ++++++ 7 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 756ee10e..3c02fdfd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-de9c92c5d163d0aaf84f2638cda7e3715a36bf85c5dbe89cea6657fe94201b07.yml -openapi_spec_hash: d010871ad88365048994b21eed2c36d9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-643adebfc36ae5f3c31dc2305867f8259c9ec13420989ec37b78cdf87283a279.yml +openapi_spec_hash: 5d04ebe79f446da15639adddf9bffc9b config_hash: 8e1b089e9f5af438fd56b523014af4f2 diff --git a/src/gitpod/resources/agents.py b/src/gitpod/resources/agents.py index 3fdedd49..9c2e9d18 100644 --- a/src/gitpod/resources/agents.py +++ b/src/gitpod/resources/agents.py @@ -120,6 +120,7 @@ def create_prompt( command: str | Omit = omit, description: str | Omit = omit, is_command: bool | Omit = omit, + is_skill: bool | Omit = omit, is_template: bool | Omit = omit, name: str | Omit = omit, prompt: str | Omit = omit, @@ -154,6 +155,7 @@ def create_prompt( "command": command, "description": description, "is_command": is_command, + "is_skill": is_skill, "is_template": is_template, "name": name, "prompt": prompt, @@ -768,6 +770,7 @@ async def create_prompt( command: str | Omit = omit, description: str | Omit = omit, is_command: bool | Omit = omit, + is_skill: bool | Omit = omit, is_template: bool | Omit = omit, name: str | Omit = omit, prompt: str | Omit = omit, @@ -802,6 +805,7 @@ async def create_prompt( "command": command, "description": description, "is_command": is_command, + "is_skill": is_skill, "is_template": is_template, "name": name, "prompt": prompt, diff --git a/src/gitpod/types/agent_create_prompt_params.py b/src/gitpod/types/agent_create_prompt_params.py index c5b22317..ec2daa9d 100644 --- a/src/gitpod/types/agent_create_prompt_params.py +++ b/src/gitpod/types/agent_create_prompt_params.py @@ -16,6 +16,8 @@ class AgentCreatePromptParams(TypedDict, total=False): is_command: Annotated[bool, PropertyInfo(alias="isCommand")] + is_skill: Annotated[bool, PropertyInfo(alias="isSkill")] + is_template: Annotated[bool, PropertyInfo(alias="isTemplate")] name: str diff --git a/src/gitpod/types/agent_list_prompts_params.py b/src/gitpod/types/agent_list_prompts_params.py index 9756b72a..6c3ac239 100644 --- a/src/gitpod/types/agent_list_prompts_params.py +++ b/src/gitpod/types/agent_list_prompts_params.py @@ -26,6 +26,8 @@ class Filter(TypedDict, total=False): is_command: Annotated[bool, PropertyInfo(alias="isCommand")] + is_skill: Annotated[bool, PropertyInfo(alias="isSkill")] + is_template: Annotated[bool, PropertyInfo(alias="isTemplate")] diff --git a/src/gitpod/types/agent_update_prompt_params.py b/src/gitpod/types/agent_update_prompt_params.py index 8d5e292b..e4ade3ba 100644 --- a/src/gitpod/types/agent_update_prompt_params.py +++ b/src/gitpod/types/agent_update_prompt_params.py @@ -40,6 +40,9 @@ class Spec(TypedDict, total=False): is_command: Annotated[Optional[bool], PropertyInfo(alias="isCommand")] """Whether this prompt is a command""" + is_skill: Annotated[Optional[bool], PropertyInfo(alias="isSkill")] + """Whether this prompt is a skill""" + is_template: Annotated[Optional[bool], PropertyInfo(alias="isTemplate")] """Whether this prompt is a template""" diff --git a/src/gitpod/types/prompt_spec.py b/src/gitpod/types/prompt_spec.py index 7db3c112..ddeaacbf 100644 --- a/src/gitpod/types/prompt_spec.py +++ b/src/gitpod/types/prompt_spec.py @@ -16,6 +16,9 @@ class PromptSpec(BaseModel): is_command: Optional[bool] = FieldInfo(alias="isCommand", default=None) """is_command indicates if this prompt is a command""" + is_skill: Optional[bool] = FieldInfo(alias="isSkill", default=None) + """is_skill indicates if this prompt is a skill (workflow instructions for agents)""" + is_template: Optional[bool] = FieldInfo(alias="isTemplate", default=None) """is_template indicates if this prompt is a template""" diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 9a37aaf8..8314ecc0 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -77,6 +77,7 @@ def test_method_create_prompt_with_all_params(self, client: Gitpod) -> None: command="command", description="x", is_command=True, + is_skill=True, is_template=True, name="x", prompt="x", @@ -242,6 +243,7 @@ def test_method_list_prompts_with_all_params(self, client: Gitpod) -> None: "command": "command", "command_prefix": "commandPrefix", "is_command": True, + "is_skill": True, "is_template": True, }, pagination={ @@ -501,6 +503,7 @@ def test_method_update_prompt_with_all_params(self, client: Gitpod) -> None: spec={ "command": "command", "is_command": True, + "is_skill": True, "is_template": True, "prompt": "prompt", }, @@ -584,6 +587,7 @@ async def test_method_create_prompt_with_all_params(self, async_client: AsyncGit command="command", description="x", is_command=True, + is_skill=True, is_template=True, name="x", prompt="x", @@ -749,6 +753,7 @@ async def test_method_list_prompts_with_all_params(self, async_client: AsyncGitp "command": "command", "command_prefix": "commandPrefix", "is_command": True, + "is_skill": True, "is_template": True, }, pagination={ @@ -1008,6 +1013,7 @@ async def test_method_update_prompt_with_all_params(self, async_client: AsyncGit spec={ "command": "command", "is_command": True, + "is_skill": True, "is_template": True, "prompt": "prompt", }, From 739ea76b5f2421ba703334f304d4dced9922f61e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 12:15:32 +0000 Subject: [PATCH 239/505] feat(prebuild): expose snapshot completion percentage in prebuild status --- .stats.yml | 4 ++-- src/gitpod/types/prebuild_status.py | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3c02fdfd..4eb2c943 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-643adebfc36ae5f3c31dc2305867f8259c9ec13420989ec37b78cdf87283a279.yml -openapi_spec_hash: 5d04ebe79f446da15639adddf9bffc9b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3c080e16ecc8c0377535643430e1abc1425a0b8f474fd6f211cac5e617b7ba28.yml +openapi_spec_hash: 154065951ac8ea5188227ec10c2c10c8 config_hash: 8e1b089e9f5af438fd56b523014af4f2 diff --git a/src/gitpod/types/prebuild_status.py b/src/gitpod/types/prebuild_status.py index 70592150..dcb1fd07 100644 --- a/src/gitpod/types/prebuild_status.py +++ b/src/gitpod/types/prebuild_status.py @@ -36,6 +36,14 @@ class PrebuildStatus(BaseModel): logs. """ + snapshot_completion_percentage: Optional[int] = FieldInfo(alias="snapshotCompletionPercentage", default=None) + """ + snapshot_completion_percentage is the progress of snapshot creation (0-100). + Only populated when phase is SNAPSHOTTING and progress is available from the + cloud provider. This value may update infrequently or remain at 0 depending on + the provider. + """ + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """ status_version is incremented each time the status is updated. Used for From d11e3428cabdb87781bca84578dcb2668deaec3e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 10:08:22 +0000 Subject: [PATCH 240/505] feat(api): add ImageInput to UserInputBlock proto --- .stats.yml | 4 +-- src/gitpod/types/user_input_block_param.py | 29 +++++++++++++++++++--- tests/api_resources/test_agents.py | 6 +++-- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4eb2c943..9d944b97 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3c080e16ecc8c0377535643430e1abc1425a0b8f474fd6f211cac5e617b7ba28.yml -openapi_spec_hash: 154065951ac8ea5188227ec10c2c10c8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-665d1d0e7f0040c5fbbb664487724af4ecc58d3c702e8099ceef4a05ba589369.yml +openapi_spec_hash: 3688253b79ec0cf6d41ff586d71e9f07 config_hash: 8e1b089e9f5af438fd56b523014af4f2 diff --git a/src/gitpod/types/user_input_block_param.py b/src/gitpod/types/user_input_block_param.py index e62eecf3..5a6b87e1 100644 --- a/src/gitpod/types/user_input_block_param.py +++ b/src/gitpod/types/user_input_block_param.py @@ -4,11 +4,26 @@ from typing import Union from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict +from .._types import Base64FileInput from .._utils import PropertyInfo +from .._models import set_pydantic_config -__all__ = ["UserInputBlockParam", "Text"] +__all__ = ["UserInputBlockParam", "Image", "Text"] + + +class Image(TypedDict, total=False): + """ + ImageInput allows sending images to the agent. + Media type is inferred from magic bytes by the backend. + """ + + data: Annotated[Union[str, Base64FileInput], PropertyInfo(format="base64")] + """Raw image data (max 4MB). Supported formats: PNG, JPEG, WebP.""" + + +set_pydantic_config(Image, {"arbitrary_types_allowed": True}) class Text(TypedDict, total=False): @@ -16,9 +31,15 @@ class Text(TypedDict, total=False): class UserInputBlockParam(TypedDict, total=False): - text: Required[Text] - id: str created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] """Timestamp when this block was created. Used for debugging and support bundles.""" + + image: Image + """ + ImageInput allows sending images to the agent. Media type is inferred from magic + bytes by the backend. + """ + + text: Text diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 8314ecc0..b92173b6 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -359,9 +359,10 @@ def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: agent = client.agents.send_to_execution( agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", user_input={ - "text": {"content": "Generate a report based on the latest logs."}, "id": "id", "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "image": {"data": "U3RhaW5sZXNzIHJvY2tz"}, + "text": {"content": "Generate a report based on the latest logs."}, }, ) assert_matches_type(object, agent, path=["response"]) @@ -869,9 +870,10 @@ async def test_method_send_to_execution_with_all_params(self, async_client: Asyn agent = await async_client.agents.send_to_execution( agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", user_input={ - "text": {"content": "Generate a report based on the latest logs."}, "id": "id", "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "image": {"data": "U3RhaW5sZXNzIHJvY2tz"}, + "text": {"content": "Generate a report based on the latest logs."}, }, ) assert_matches_type(object, agent, path=["response"]) From e44c03c8b8b108df6e23ce3505b21bba62c2fa12 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 07:34:51 +0000 Subject: [PATCH 241/505] feat(api): add recommended editors configuration to project settings --- .stats.yml | 6 ++-- api.md | 1 + src/gitpod/resources/projects/projects.py | 13 ++++++++ src/gitpod/types/__init__.py | 2 ++ src/gitpod/types/project.py | 4 +++ src/gitpod/types/project_update_params.py | 8 +++++ src/gitpod/types/recommended_editors.py | 30 +++++++++++++++++ src/gitpod/types/recommended_editors_param.py | 33 +++++++++++++++++++ tests/api_resources/test_projects.py | 2 ++ 9 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/recommended_editors.py create mode 100644 src/gitpod/types/recommended_editors_param.py diff --git a/.stats.yml b/.stats.yml index 9d944b97..c430d10e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-665d1d0e7f0040c5fbbb664487724af4ecc58d3c702e8099ceef4a05ba589369.yml -openapi_spec_hash: 3688253b79ec0cf6d41ff586d71e9f07 -config_hash: 8e1b089e9f5af438fd56b523014af4f2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6f686822d27e00f05b67afc31efefd873ce20db2be25174500da54a30f650875.yml +openapi_spec_hash: 24bd6ab0ff2eed7121942da895863810 +config_hash: 06c6c8640b0bb0692f8f2361c6660f8a diff --git a/api.md b/api.md index fc5a1570..29f93a40 100644 --- a/api.md +++ b/api.md @@ -498,6 +498,7 @@ from gitpod.types import ( ProjectMetadata, ProjectPhase, ProjectPrebuildConfiguration, + RecommendedEditors, ProjectCreateResponse, ProjectRetrieveResponse, ProjectUpdateResponse, diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 4a4bd619..c3f7da6b 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -46,6 +46,7 @@ from ...types.project_create_response import ProjectCreateResponse from ...types.project_update_response import ProjectUpdateResponse from ...types.project_retrieve_response import ProjectRetrieveResponse +from ...types.recommended_editors_param import RecommendedEditorsParam from ...types.environment_initializer_param import EnvironmentInitializerParam from ...types.project_prebuild_configuration_param import ProjectPrebuildConfigurationParam from ...types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse @@ -244,6 +245,7 @@ def update( name: Optional[str] | Omit = omit, prebuild_configuration: Optional[ProjectPrebuildConfigurationParam] | Omit = omit, project_id: str | Omit = omit, + recommended_editors: Optional[RecommendedEditorsParam] | Omit = omit, technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -313,6 +315,10 @@ def update( project_id: project_id specifies the project identifier + recommended_editors: recommended_editors specifies the editors recommended for this project. If not + provided, the existing recommended editors are not modified. To clear all + recommended editors, set to an empty RecommendedEditors message. + technical_description: technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max @@ -334,6 +340,7 @@ def update( "name": name, "prebuild_configuration": prebuild_configuration, "project_id": project_id, + "recommended_editors": recommended_editors, "technical_description": technical_description, }, project_update_params.ProjectUpdateParams, @@ -716,6 +723,7 @@ async def update( name: Optional[str] | Omit = omit, prebuild_configuration: Optional[ProjectPrebuildConfigurationParam] | Omit = omit, project_id: str | Omit = omit, + recommended_editors: Optional[RecommendedEditorsParam] | Omit = omit, technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -785,6 +793,10 @@ async def update( project_id: project_id specifies the project identifier + recommended_editors: recommended_editors specifies the editors recommended for this project. If not + provided, the existing recommended editors are not modified. To clear all + recommended editors, set to an empty RecommendedEditors message. + technical_description: technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max @@ -806,6 +818,7 @@ async def update( "name": name, "prebuild_configuration": prebuild_configuration, "project_id": project_id, + "recommended_editors": recommended_editors, "technical_description": technical_description, }, project_update_params.ProjectUpdateParams, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index c3748784..bd85a245 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -94,6 +94,7 @@ from .organization_member import OrganizationMember as OrganizationMember from .prebuild_spec_param import PrebuildSpecParam as PrebuildSpecParam from .project_list_params import ProjectListParams as ProjectListParams +from .recommended_editors import RecommendedEditors as RecommendedEditors from .environment_metadata import EnvironmentMetadata as EnvironmentMetadata from .event_watch_response import EventWatchResponse as EventWatchResponse from .exception_info_param import ExceptionInfoParam as ExceptionInfoParam @@ -154,6 +155,7 @@ from .exception_mechanism_param import ExceptionMechanismParam as ExceptionMechanismParam from .organization_leave_params import OrganizationLeaveParams as OrganizationLeaveParams from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse +from .recommended_editors_param import RecommendedEditorsParam as RecommendedEditorsParam from .secret_get_value_response import SecretGetValueResponse as SecretGetValueResponse from .user_set_suspended_params import UserSetSuspendedParams as UserSetSuspendedParams from .agent_create_prompt_params import AgentCreatePromptParams as AgentCreatePromptParams diff --git a/src/gitpod/types/project.py b/src/gitpod/types/project.py index f5039be5..d8b80a11 100644 --- a/src/gitpod/types/project.py +++ b/src/gitpod/types/project.py @@ -8,6 +8,7 @@ from .project_phase import ProjectPhase from .shared.subject import Subject from .project_metadata import ProjectMetadata +from .recommended_editors import RecommendedEditors from .environment_initializer import EnvironmentInitializer from .project_prebuild_configuration import ProjectPrebuildConfiguration from .shared.project_environment_class import ProjectEnvironmentClass @@ -64,6 +65,9 @@ class Project(BaseModel): ) """prebuild_configuration defines how prebuilds are created for this project.""" + recommended_editors: Optional[RecommendedEditors] = FieldInfo(alias="recommendedEditors", default=None) + """recommended_editors specifies the editors recommended for this project.""" + technical_description: Optional[str] = FieldInfo(alias="technicalDescription", default=None) """ technical_description is a detailed technical description of the project This diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py index c27e98a6..64fb758d 100644 --- a/src/gitpod/types/project_update_params.py +++ b/src/gitpod/types/project_update_params.py @@ -6,6 +6,7 @@ from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .recommended_editors_param import RecommendedEditorsParam from .environment_initializer_param import EnvironmentInitializerParam from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam @@ -50,6 +51,13 @@ class ProjectUpdateParams(TypedDict, total=False): project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" + recommended_editors: Annotated[Optional[RecommendedEditorsParam], PropertyInfo(alias="recommendedEditors")] + """ + recommended_editors specifies the editors recommended for this project. If not + provided, the existing recommended editors are not modified. To clear all + recommended editors, set to an empty RecommendedEditors message. + """ + technical_description: Annotated[Optional[str], PropertyInfo(alias="technicalDescription")] """ technical_description is a detailed technical description of the project This diff --git a/src/gitpod/types/recommended_editors.py b/src/gitpod/types/recommended_editors.py new file mode 100644 index 00000000..0caf2539 --- /dev/null +++ b/src/gitpod/types/recommended_editors.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional + +from .._models import BaseModel + +__all__ = ["RecommendedEditors", "Editors"] + + +class Editors(BaseModel): + """EditorVersions contains the recommended versions for an editor.""" + + versions: Optional[List[str]] = None + """ + versions is the list of recommended versions for this editor. If empty, all + available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] + """ + + +class RecommendedEditors(BaseModel): + """RecommendedEditors contains the map of recommended editors and their versions.""" + + editors: Optional[Dict[str, Editors]] = None + """ + editors maps editor aliases to their recommended versions. Key is the editor + alias (e.g., "intellij", "goland", "vscode"). Value contains the list of + recommended versions for that editor. If versions list is empty, all available + versions are recommended. Example: {"intellij": {versions: ["2025.1", + "2024.3"]}, "goland": {}} + """ diff --git a/src/gitpod/types/recommended_editors_param.py b/src/gitpod/types/recommended_editors_param.py new file mode 100644 index 00000000..7da0daeb --- /dev/null +++ b/src/gitpod/types/recommended_editors_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import TypedDict + +from .._types import SequenceNotStr + +__all__ = ["RecommendedEditorsParam", "Editors"] + + +class Editors(TypedDict, total=False): + """EditorVersions contains the recommended versions for an editor.""" + + versions: SequenceNotStr[str] + """ + versions is the list of recommended versions for this editor. If empty, all + available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] + """ + + +class RecommendedEditorsParam(TypedDict, total=False): + """RecommendedEditors contains the map of recommended editors and their versions.""" + + editors: Dict[str, Editors] + """ + editors maps editor aliases to their recommended versions. Key is the editor + alias (e.g., "intellij", "goland", "vscode"). Value contains the list of + recommended versions for that editor. If versions list is empty, all available + versions are recommended. Example: {"intellij": {versions: ["2025.1", + "2024.3"]}, "goland": {}} + """ diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 6acd6e18..8e3985a4 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -169,6 +169,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "trigger": {"daily_schedule": {"hour_utc": 2}}, }, project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + recommended_editors={"editors": {"foo": {"versions": ["string"]}}}, technical_description="technicalDescription", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -466,6 +467,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "trigger": {"daily_schedule": {"hour_utc": 2}}, }, project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + recommended_editors={"editors": {"foo": {"versions": ["string"]}}}, technical_description="technicalDescription", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) From 1ae4bbdbf0dfeb399d6e763eafb287755cebde37 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 16:29:18 +0000 Subject: [PATCH 242/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index c430d10e..b40352b1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6f686822d27e00f05b67afc31efefd873ce20db2be25174500da54a30f650875.yml -openapi_spec_hash: 24bd6ab0ff2eed7121942da895863810 -config_hash: 06c6c8640b0bb0692f8f2361c6660f8a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d27df409d7979dbb29733500872b84823b37257c1b3a93f7ba2b0d95bd4faac6.yml +openapi_spec_hash: 1c7c624b62b6a216486c8150074d5237 +config_hash: d3267594264bfb76d2ee7e881d5f8a5a From 574935be94dd469b1d4fd76d68c29afaa1437044 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 12:48:03 +0000 Subject: [PATCH 243/505] feat(db): add webhooks table with trigger reference --- .stats.yml | 4 ++-- src/gitpod/types/groups/resource_role.py | 2 ++ src/gitpod/types/shared/resource_type.py | 1 + src/gitpod/types/shared_params/resource_type.py | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b40352b1..e42a5cae 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d27df409d7979dbb29733500872b84823b37257c1b3a93f7ba2b0d95bd4faac6.yml -openapi_spec_hash: 1c7c624b62b6a216486c8150074d5237 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3935e467f9c15925790aada293124db82bb5d6840eeac52d81fbac6a9b0fd154.yml +openapi_spec_hash: b417d7f10ea430216e9b70e4468a3212 config_hash: d3267594264bfb76d2ee7e881d5f8a5a diff --git a/src/gitpod/types/groups/resource_role.py b/src/gitpod/types/groups/resource_role.py index 17dcb324..cd2e1643 100644 --- a/src/gitpod/types/groups/resource_role.py +++ b/src/gitpod/types/groups/resource_role.py @@ -53,4 +53,6 @@ "RESOURCE_ROLE_WORKFLOW_EXECUTOR", "RESOURCE_ROLE_SNAPSHOT_ADMIN", "RESOURCE_ROLE_SNAPSHOT_RUNNER", + "RESOURCE_ROLE_WEBHOOK_ADMIN", + "RESOURCE_ROLE_WEBHOOK_VIEWER", ] diff --git a/src/gitpod/types/shared/resource_type.py b/src/gitpod/types/shared/resource_type.py index 5aec70eb..1a18f4e0 100644 --- a/src/gitpod/types/shared/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -47,4 +47,5 @@ "RESOURCE_TYPE_CUSTOM_DOMAIN", "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED", "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", + "RESOURCE_TYPE_WEBHOOK", ] diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py index 4c567f1c..793bab27 100644 --- a/src/gitpod/types/shared_params/resource_type.py +++ b/src/gitpod/types/shared_params/resource_type.py @@ -49,4 +49,5 @@ "RESOURCE_TYPE_CUSTOM_DOMAIN", "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED", "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", + "RESOURCE_TYPE_WEBHOOK", ] From 5c3ed1d427c6b58634a63625aa53a0e24fd999e4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 13:47:05 +0000 Subject: [PATCH 244/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 383dd5a3..4208b5cb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.2" + ".": "0.6.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5bf0feb3..84619e4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.5.2" +version = "0.6.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index de507a36..850eb95d 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.5.2" # x-release-please-version +__version__ = "0.6.0" # x-release-please-version From 158ba116f170bf5d783d1beb6605663ad4ceb6a7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 14:46:36 +0000 Subject: [PATCH 245/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e42a5cae..cf214ce6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3935e467f9c15925790aada293124db82bb5d6840eeac52d81fbac6a9b0fd154.yml -openapi_spec_hash: b417d7f10ea430216e9b70e4468a3212 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bc2d9ee7f9a0aea1a4305b5487eac32742d6aea1e515616a8a2eda759cbb5b8f.yml +openapi_spec_hash: 1832681b749df9e2a56e2ca728572575 config_hash: d3267594264bfb76d2ee7e881d5f8a5a From 964758eccba4e557f3089bb23adee08ccaa341de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 15:45:23 +0000 Subject: [PATCH 246/505] feat: Define SCIMConfiguration database schema --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_type.py | 1 + src/gitpod/types/shared_params/resource_type.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cf214ce6..df7a521d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bc2d9ee7f9a0aea1a4305b5487eac32742d6aea1e515616a8a2eda759cbb5b8f.yml -openapi_spec_hash: 1832681b749df9e2a56e2ca728572575 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f35d75f04023f8de20cc787ab5202c4853a79ea14fa8e639f598e034b312207f.yml +openapi_spec_hash: 0b2bf8b46a5bb29402fb9ae08ce6314f config_hash: d3267594264bfb76d2ee7e881d5f8a5a diff --git a/src/gitpod/types/shared/resource_type.py b/src/gitpod/types/shared/resource_type.py index 1a18f4e0..7531c05c 100644 --- a/src/gitpod/types/shared/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -48,4 +48,5 @@ "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED", "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", "RESOURCE_TYPE_WEBHOOK", + "RESOURCE_TYPE_SCIM_CONFIGURATION", ] diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py index 793bab27..34d2f8cd 100644 --- a/src/gitpod/types/shared_params/resource_type.py +++ b/src/gitpod/types/shared_params/resource_type.py @@ -50,4 +50,5 @@ "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED", "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", "RESOURCE_TYPE_WEBHOOK", + "RESOURCE_TYPE_SCIM_CONFIGURATION", ] From 8647514772841670b0a1868411bb65d4b48711bd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 17:15:56 +0000 Subject: [PATCH 247/505] feat(api): improve SearchRepositories pagination with next_page and total_count --- .stats.yml | 4 ++-- .../runner_search_repositories_response.py | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index df7a521d..7ce53777 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f35d75f04023f8de20cc787ab5202c4853a79ea14fa8e639f598e034b312207f.yml -openapi_spec_hash: 0b2bf8b46a5bb29402fb9ae08ce6314f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b40906da1a429be933f59cd9c3b2f7197aef9b302033558e7cbb65579357240a.yml +openapi_spec_hash: bc0aec8cac7bfb2a69792bb43cfe50d2 config_hash: d3267594264bfb76d2ee7e881d5f8a5a diff --git a/src/gitpod/types/runner_search_repositories_response.py b/src/gitpod/types/runner_search_repositories_response.py index 65597de3..e4f7350c 100644 --- a/src/gitpod/types/runner_search_repositories_response.py +++ b/src/gitpod/types/runner_search_repositories_response.py @@ -10,7 +10,12 @@ class Pagination(BaseModel): - """Pagination information for the response""" + """ + Pagination information for the response. + Token format: "NEXT_PAGE/TOTAL_PAGES/TOTAL_COUNT" (e.g., "2/40/1000"). + Use -1 for unknown values (e.g., "2/-1/-1" when totals unavailable). + Empty token means no more pages. + """ next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) """Token passed for retrieving the next set of results. @@ -29,10 +34,18 @@ class Repository(BaseModel): class RunnerSearchRepositoriesResponse(BaseModel): last_page: Optional[int] = FieldInfo(alias="lastPage", default=None) - """Last page in the responses""" + """Deprecated: Use pagination token instead. + + Total pages can be extracted from token. + """ pagination: Optional[Pagination] = None - """Pagination information for the response""" + """ + Pagination information for the response. Token format: + "NEXT_PAGE/TOTAL_PAGES/TOTAL_COUNT" (e.g., "2/40/1000"). Use -1 for unknown + values (e.g., "2/-1/-1" when totals unavailable). Empty token means no more + pages. + """ repositories: Optional[List[Repository]] = None """List of repositories matching the search criteria""" From 43a8a27496cf9d83fd6b175879efdf39e6f1b7ff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 11:28:32 +0000 Subject: [PATCH 248/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7ce53777..d535149d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b40906da1a429be933f59cd9c3b2f7197aef9b302033558e7cbb65579357240a.yml -openapi_spec_hash: bc0aec8cac7bfb2a69792bb43cfe50d2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-46e0124fe8e07933a6ea784e81b4d02086696c246f519aaa34b087f46410c818.yml +openapi_spec_hash: fe98c15ea1e320c05593cd57457e4af5 config_hash: d3267594264bfb76d2ee7e881d5f8a5a From 1b9b5e11013b00665d9af6a3fc5199d6a504b1de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 18:36:02 +0000 Subject: [PATCH 249/505] feat(client): add support for binary request streaming --- src/gitpod/_base_client.py | 145 +++++++++++++++++++++++++--- src/gitpod/_models.py | 17 +++- src/gitpod/_types.py | 9 ++ tests/test_client.py | 187 ++++++++++++++++++++++++++++++++++++- 4 files changed, 344 insertions(+), 14 deletions(-) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 16139794..e6ccedfa 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -9,6 +9,7 @@ import inspect import logging import platform +import warnings import email.utils from types import TracebackType from random import random @@ -51,9 +52,11 @@ ResponseT, AnyMapping, PostParser, + BinaryTypes, RequestFiles, HttpxSendArgs, RequestOptions, + AsyncBinaryTypes, HttpxRequestFiles, ModelBuilderProtocol, not_given, @@ -477,8 +480,19 @@ def _build_request( retries_taken: int = 0, ) -> httpx.Request: if log.isEnabledFor(logging.DEBUG): - log.debug("Request options: %s", model_dump(options, exclude_unset=True)) - + log.debug( + "Request options: %s", + model_dump( + options, + exclude_unset=True, + # Pydantic v1 can't dump every type we support in content, so we exclude it for now. + exclude={ + "content", + } + if PYDANTIC_V1 + else {}, + ), + ) kwargs: dict[str, Any] = {} json_data = options.json_data @@ -532,7 +546,13 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - if isinstance(json_data, bytes): + if options.content is not None and json_data is not None: + raise TypeError("Passing both `content` and `json_data` is not supported") + if options.content is not None and files is not None: + raise TypeError("Passing both `content` and `files` is not supported") + if options.content is not None: + kwargs["content"] = options.content + elif isinstance(json_data, bytes): kwargs["content"] = json_data else: kwargs["json"] = json_data if is_given(json_data) else None @@ -1194,6 +1214,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[False] = False, @@ -1206,6 +1227,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[True], @@ -1219,6 +1241,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool, @@ -1231,13 +1254,25 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool = False, stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=to_httpx_files(files), **options + method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) @@ -1247,11 +1282,23 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return self.request(cast_to, opts) @@ -1261,11 +1308,23 @@ def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=to_httpx_files(files), **options + method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return self.request(cast_to, opts) @@ -1275,9 +1334,19 @@ def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return self.request(cast_to, opts) def get_api_list( @@ -1717,6 +1786,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[False] = False, @@ -1729,6 +1799,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[True], @@ -1742,6 +1813,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool, @@ -1754,13 +1826,25 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool = False, stream_cls: type[_AsyncStreamT] | None = None, ) -> ResponseT | _AsyncStreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) @@ -1770,11 +1854,28 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="patch", + url=path, + json_data=body, + content=content, + files=await async_to_httpx_files(files), + **options, ) return await self.request(cast_to, opts) @@ -1784,11 +1885,23 @@ async def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) @@ -1798,9 +1911,19 @@ async def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return await self.request(cast_to, opts) def get_api_list( diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index ca9500b2..29070e05 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -3,7 +3,20 @@ import os import inspect import weakref -from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast +from typing import ( + IO, + TYPE_CHECKING, + Any, + Type, + Union, + Generic, + TypeVar, + Callable, + Iterable, + Optional, + AsyncIterable, + cast, +) from datetime import date, datetime from typing_extensions import ( List, @@ -787,6 +800,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): timeout: float | Timeout | None files: HttpxRequestFiles | None idempotency_key: str + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] json_data: Body extra_json: AnyMapping follow_redirects: bool @@ -805,6 +819,7 @@ class FinalRequestOptions(pydantic.BaseModel): post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() follow_redirects: Union[bool, None] = None + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] = None # It should be noted that we cannot use `json` here as that would override # a BaseModel method in an incompatible fashion. json_data: Union[Body, None] = None diff --git a/src/gitpod/_types.py b/src/gitpod/_types.py index ab7cbe2a..dbebac09 100644 --- a/src/gitpod/_types.py +++ b/src/gitpod/_types.py @@ -13,9 +13,11 @@ Mapping, TypeVar, Callable, + Iterable, Iterator, Optional, Sequence, + AsyncIterable, ) from typing_extensions import ( Set, @@ -56,6 +58,13 @@ else: Base64FileInput = Union[IO[bytes], PathLike] FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. + + +# Used for sending raw binary data / streaming data in request bodies +# e.g. for file uploads without multipart encoding +BinaryTypes = Union[bytes, bytearray, IO[bytes], Iterable[bytes]] +AsyncBinaryTypes = Union[bytes, bytearray, IO[bytes], AsyncIterable[bytes]] + FileTypes = Union[ # file (or bytes) FileContent, diff --git a/tests/test_client.py b/tests/test_client.py index f948b8a0..81db6c83 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -8,10 +8,11 @@ import json import asyncio import inspect +import dataclasses import tracemalloc -from typing import Any, Union, cast +from typing import Any, Union, TypeVar, Callable, Iterable, Iterator, Optional, Coroutine, cast from unittest import mock -from typing_extensions import Literal +from typing_extensions import Literal, AsyncIterator, override import httpx import pytest @@ -36,6 +37,7 @@ from .utils import update_env +T = TypeVar("T") base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") bearer_token = "My Bearer Token" @@ -50,6 +52,57 @@ def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: return 0.1 +def mirror_request_content(request: httpx.Request) -> httpx.Response: + return httpx.Response(200, content=request.content) + + +# note: we can't use the httpx.MockTransport class as it consumes the request +# body itself, which means we can't test that the body is read lazily +class MockTransport(httpx.BaseTransport, httpx.AsyncBaseTransport): + def __init__( + self, + handler: Callable[[httpx.Request], httpx.Response] + | Callable[[httpx.Request], Coroutine[Any, Any, httpx.Response]], + ) -> None: + self.handler = handler + + @override + def handle_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert not inspect.iscoroutinefunction(self.handler), "handler must not be a coroutine function" + assert inspect.isfunction(self.handler), "handler must be a function" + return self.handler(request) + + @override + async def handle_async_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert inspect.iscoroutinefunction(self.handler), "handler must be a coroutine function" + return await self.handler(request) + + +@dataclasses.dataclass +class Counter: + value: int = 0 + + +def _make_sync_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> Iterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + +async def _make_async_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> AsyncIterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + def _get_open_connections(client: Gitpod | AsyncGitpod) -> int: transport = client._client._transport assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) @@ -511,6 +564,70 @@ def test_multipart_repeating_array(self, client: Gitpod) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload(self, respx_mock: MockRouter, client: Gitpod) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + def test_binary_content_upload_with_iterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_sync_iterator([file_content], counter=counter) + + def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=request.read()) + + with Gitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.Client(transport=MockTransport(handler=mock_handler)), + ) as client: + response = client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload_with_body_is_deprecated(self, respx_mock: MockRouter, client: Gitpod) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) def test_basic_union_response(self, respx_mock: MockRouter, client: Gitpod) -> None: class Model1(BaseModel): @@ -1364,6 +1481,72 @@ def test_multipart_repeating_array(self, async_client: AsyncGitpod) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = await async_client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + async def test_binary_content_upload_with_asynciterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_async_iterator([file_content], counter=counter) + + async def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=await request.aread()) + + async with AsyncGitpod( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.AsyncClient(transport=MockTransport(handler=mock_handler)), + ) as client: + response = await client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload_with_body_is_deprecated( + self, respx_mock: MockRouter, async_client: AsyncGitpod + ) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = await async_client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: class Model1(BaseModel): From ae7a9671b904aa7ebff5ef9a5570d917ca0430f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 05:26:53 +0000 Subject: [PATCH 250/505] feat: move agent mode from Spec to Status, add AgentModeChange signals --- .stats.yml | 4 ++-- src/gitpod/types/agent_execution.py | 9 ++++++--- src/gitpod/types/agent_mode.py | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index d535149d..a59a9477 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-46e0124fe8e07933a6ea784e81b4d02086696c246f519aaa34b087f46410c818.yml -openapi_spec_hash: fe98c15ea1e320c05593cd57457e4af5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cad9422301ea573f7fdbcf5047e421a0a6e963468a9d8f464e47ed1800a8fc75.yml +openapi_spec_hash: b2e5072d4659a5c4fb5d2e8916388af9 config_hash: d3267594264bfb76d2ee7e881d5f8a5a diff --git a/src/gitpod/types/agent_execution.py b/src/gitpod/types/agent_execution.py index 384da908..ad119381 100644 --- a/src/gitpod/types/agent_execution.py +++ b/src/gitpod/types/agent_execution.py @@ -259,9 +259,6 @@ class Spec(BaseModel): limits: Optional[SpecLimits] = None - mode: Optional[AgentMode] = None - """mode is the operational mode for this agent execution""" - session: Optional[str] = None spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) @@ -355,6 +352,12 @@ class Status(BaseModel): judgement: Optional[str] = None """judgement is the judgement of the agent run produced by the judgement prompt.""" + mode: Optional[AgentMode] = None + """ + mode is the current operational mode of the agent execution. This is set by the + agent when entering different modes (e.g., Ralph mode via /ona:ralph command). + """ + outputs: Optional[Dict[str, StatusOutputs]] = None """ outputs is a map of key-value pairs that can be set by the agent during diff --git a/src/gitpod/types/agent_mode.py b/src/gitpod/types/agent_mode.py index de414c76..d7bd23bc 100644 --- a/src/gitpod/types/agent_mode.py +++ b/src/gitpod/types/agent_mode.py @@ -4,4 +4,6 @@ __all__ = ["AgentMode"] -AgentMode: TypeAlias = Literal["AGENT_MODE_UNSPECIFIED", "AGENT_MODE_EXECUTION", "AGENT_MODE_PLANNING"] +AgentMode: TypeAlias = Literal[ + "AGENT_MODE_UNSPECIFIED", "AGENT_MODE_EXECUTION", "AGENT_MODE_PLANNING", "AGENT_MODE_RALPH" +] From 621dad4adeca4789141c85c51f484bc27db24ecd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 15:02:52 +0000 Subject: [PATCH 251/505] feat(api): add draft and state fields to PullRequest proto --- .stats.yml | 6 +++--- api.md | 1 + src/gitpod/types/__init__.py | 1 + src/gitpod/types/agent_code_context.py | 7 +++++++ src/gitpod/types/agent_code_context_param.py | 7 +++++++ src/gitpod/types/runner_parse_context_url_response.py | 7 +++++++ src/gitpod/types/shared/__init__.py | 1 + src/gitpod/types/shared/state.py | 7 +++++++ src/gitpod/types/shared_params/__init__.py | 1 + src/gitpod/types/shared_params/state.py | 9 +++++++++ tests/api_resources/test_agents.py | 4 ++++ 11 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/shared/state.py create mode 100644 src/gitpod/types/shared_params/state.py diff --git a/.stats.yml b/.stats.yml index a59a9477..90045573 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cad9422301ea573f7fdbcf5047e421a0a6e963468a9d8f464e47ed1800a8fc75.yml -openapi_spec_hash: b2e5072d4659a5c4fb5d2e8916388af9 -config_hash: d3267594264bfb76d2ee7e881d5f8a5a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-47577991d03c0dab9d0f219bd3f6cf8cb3ea386a919a10c949318091aca5b10f.yml +openapi_spec_hash: ad236fd154210c60d9aca150a3fd51bc +config_hash: f36d04c8359fe8baec226396a18b309e diff --git a/api.md b/api.md index 29f93a40..36e24037 100644 --- a/api.md +++ b/api.md @@ -15,6 +15,7 @@ from gitpod.types import ( ResourceType, RunsOn, SecretRef, + State, Subject, Task, TaskExecution, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index bd85a245..954f9dfb 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -10,6 +10,7 @@ from .secret import Secret as Secret from .shared import ( Task as Task, + State as State, RunsOn as RunsOn, Gateway as Gateway, Subject as Subject, diff --git a/src/gitpod/types/agent_code_context.py b/src/gitpod/types/agent_code_context.py index 05c18322..ece73094 100644 --- a/src/gitpod/types/agent_code_context.py +++ b/src/gitpod/types/agent_code_context.py @@ -5,6 +5,7 @@ from pydantic import Field as FieldInfo from .._models import BaseModel +from .shared.state import State __all__ = ["AgentCodeContext", "ContextURL", "PullRequest", "PullRequestRepository"] @@ -40,12 +41,18 @@ class PullRequest(BaseModel): author: Optional[str] = None """Author name as provided by the SCM system""" + draft: Optional[bool] = None + """Whether this is a draft pull request""" + from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None) """Source branch name (the branch being merged from)""" repository: Optional[PullRequestRepository] = None """Repository information""" + state: Optional[State] = None + """Current state of the pull request""" + title: Optional[str] = None """Pull request title""" diff --git a/src/gitpod/types/agent_code_context_param.py b/src/gitpod/types/agent_code_context_param.py index 8080145f..821f296e 100644 --- a/src/gitpod/types/agent_code_context_param.py +++ b/src/gitpod/types/agent_code_context_param.py @@ -6,6 +6,7 @@ from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .shared.state import State __all__ = ["AgentCodeContextParam", "ContextURL", "PullRequest", "PullRequestRepository"] @@ -41,12 +42,18 @@ class PullRequest(TypedDict, total=False): author: str """Author name as provided by the SCM system""" + draft: bool + """Whether this is a draft pull request""" + from_branch: Annotated[str, PropertyInfo(alias="fromBranch")] """Source branch name (the branch being merged from)""" repository: PullRequestRepository """Repository information""" + state: State + """Current state of the pull request""" + title: str """Pull request title""" diff --git a/src/gitpod/types/runner_parse_context_url_response.py b/src/gitpod/types/runner_parse_context_url_response.py index c712e408..c18fd7d7 100644 --- a/src/gitpod/types/runner_parse_context_url_response.py +++ b/src/gitpod/types/runner_parse_context_url_response.py @@ -5,6 +5,7 @@ from pydantic import Field as FieldInfo from .._models import BaseModel +from .shared.state import State __all__ = ["RunnerParseContextURLResponse", "Git", "Issue", "Pr", "PullRequest", "PullRequestRepository"] @@ -71,12 +72,18 @@ class PullRequest(BaseModel): author: Optional[str] = None """Author name as provided by the SCM system""" + draft: Optional[bool] = None + """Whether this is a draft pull request""" + from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None) """Source branch name (the branch being merged from)""" repository: Optional[PullRequestRepository] = None """Repository information""" + state: Optional[State] = None + """Current state of the pull request""" + title: Optional[str] = None """Pull request title""" diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index 50c13152..5bfea28d 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .task import Task as Task +from .state import State as State from .gateway import Gateway as Gateway from .runs_on import RunsOn as RunsOn from .subject import Subject as Subject diff --git a/src/gitpod/types/shared/state.py b/src/gitpod/types/shared/state.py new file mode 100644 index 00000000..92aa0de5 --- /dev/null +++ b/src/gitpod/types/shared/state.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["State"] + +State: TypeAlias = Literal["STATE_UNSPECIFIED", "STATE_OPEN", "STATE_CLOSED", "STATE_MERGED"] diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index 4673c768..e91ec611 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .state import State as State from .runs_on import RunsOn as RunsOn from .subject import Subject as Subject from .principal import Principal as Principal diff --git a/src/gitpod/types/shared_params/state.py b/src/gitpod/types/shared_params/state.py new file mode 100644 index 00000000..1d81f948 --- /dev/null +++ b/src/gitpod/types/shared_params/state.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypeAlias + +__all__ = ["State"] + +State: TypeAlias = Literal["STATE_UNSPECIFIED", "STATE_OPEN", "STATE_CLOSED", "STATE_MERGED"] diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index b92173b6..f4f2aad5 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -410,6 +410,7 @@ def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: "pull_request": { "id": "id", "author": "author", + "draft": True, "from_branch": "fromBranch", "repository": { "clone_url": "cloneUrl", @@ -417,6 +418,7 @@ def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: "name": "name", "owner": "owner", }, + "state": "STATE_UNSPECIFIED", "title": "title", "to_branch": "toBranch", "url": "url", @@ -921,6 +923,7 @@ async def test_method_start_execution_with_all_params(self, async_client: AsyncG "pull_request": { "id": "id", "author": "author", + "draft": True, "from_branch": "fromBranch", "repository": { "clone_url": "cloneUrl", @@ -928,6 +931,7 @@ async def test_method_start_execution_with_all_params(self, async_client: AsyncG "name": "name", "owner": "owner", }, + "state": "STATE_UNSPECIFIED", "title": "title", "to_branch": "toBranch", "url": "url", From f1646c2f8b5d2343ecc9e8f2f124518107a2154a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:04:27 +0000 Subject: [PATCH 252/505] feat: [api] sorting for `ListMembers` --- .stats.yml | 4 +-- .../resources/organizations/organizations.py | 14 ++++++++++ .../types/organization_list_members_params.py | 27 +++++++++++++++++-- tests/api_resources/test_organizations.py | 8 ++++++ 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 90045573..3117cef8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-47577991d03c0dab9d0f219bd3f6cf8cb3ea386a919a10c949318091aca5b10f.yml -openapi_spec_hash: ad236fd154210c60d9aca150a3fd51bc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3a8fb9d6b9645a483a08206e944cc388325e210f0bd54daa9e15ee561a37fabc.yml +openapi_spec_hash: fe42cbf3b012e4aebf56f64a675c3dd3 config_hash: f36d04c8359fe8baec226396a18b309e diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index c1ec57eb..c9de4ae3 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -507,6 +507,7 @@ def list_members( page_size: int | Omit = omit, filter: organization_list_members_params.Filter | Omit = omit, pagination: organization_list_members_params.Pagination | Omit = omit, + sort: organization_list_members_params.Sort | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -551,6 +552,11 @@ def list_members( pagination: pagination contains the pagination options for listing members + sort: sort specifies the order of results. When unspecified, the authenticated user is + returned first, followed by other members sorted by name ascending. When an + explicit sort is specified, results are sorted purely by the requested field + without any special handling for the authenticated user. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -567,6 +573,7 @@ def list_members( "organization_id": organization_id, "filter": filter, "pagination": pagination, + "sort": sort, }, organization_list_members_params.OrganizationListMembersParams, ), @@ -1086,6 +1093,7 @@ def list_members( page_size: int | Omit = omit, filter: organization_list_members_params.Filter | Omit = omit, pagination: organization_list_members_params.Pagination | Omit = omit, + sort: organization_list_members_params.Sort | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1130,6 +1138,11 @@ def list_members( pagination: pagination contains the pagination options for listing members + sort: sort specifies the order of results. When unspecified, the authenticated user is + returned first, followed by other members sorted by name ascending. When an + explicit sort is specified, results are sorted purely by the requested field + without any special handling for the authenticated user. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1146,6 +1159,7 @@ def list_members( "organization_id": organization_id, "filter": filter, "pagination": pagination, + "sort": sort, }, organization_list_members_params.OrganizationListMembersParams, ), diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 06c529e8..16d5cbac 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["OrganizationListMembersParams", "Filter", "Pagination"] +__all__ = ["OrganizationListMembersParams", "Filter", "Pagination", "Sort"] class OrganizationListMembersParams(TypedDict, total=False): @@ -22,6 +22,15 @@ class OrganizationListMembersParams(TypedDict, total=False): pagination: Pagination """pagination contains the pagination options for listing members""" + sort: Sort + """sort specifies the order of results. + + When unspecified, the authenticated user is returned first, followed by other + members sorted by name ascending. When an explicit sort is specified, results + are sorted purely by the requested field without any special handling for the + authenticated user. + """ + class Filter(TypedDict, total=False): search: str @@ -42,3 +51,17 @@ class Pagination(TypedDict, total=False): Maximum 100. """ + + +class Sort(TypedDict, total=False): + """sort specifies the order of results. + + When unspecified, the authenticated user is + returned first, followed by other members sorted by name ascending. When an explicit + sort is specified, results are sorted purely by the requested field without any + special handling for the authenticated user. + """ + + field: Literal["SORT_FIELD_UNSPECIFIED", "SORT_FIELD_NAME", "SORT_FIELD_DATE_JOINED"] + + order: Literal["SORT_ORDER_UNSPECIFIED", "SORT_ORDER_ASC", "SORT_ORDER_DESC"] diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 8cda4e70..644ccbb4 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -271,6 +271,10 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 20, }, + sort={ + "field": "SORT_FIELD_UNSPECIFIED", + "order": "SORT_ORDER_UNSPECIFIED", + }, ) assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) @@ -600,6 +604,10 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp "token": "token", "page_size": 20, }, + sort={ + "field": "SORT_FIELD_UNSPECIFIED", + "order": "SORT_ORDER_UNSPECIFIED", + }, ) assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) From 686c0a7f68b871064bc9cb668327c10ec2eecd3d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 19:42:10 +0000 Subject: [PATCH 253/505] feat: [backend] Introduce role and member status filtering for `ListMembers` --- .stats.yml | 4 ++-- src/gitpod/types/organization_list_members_params.py | 9 +++++++++ src/gitpod/types/shared_params/__init__.py | 1 + src/gitpod/types/shared_params/user_status.py | 11 +++++++++++ tests/api_resources/test_organizations.py | 12 ++++++++++-- 5 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 src/gitpod/types/shared_params/user_status.py diff --git a/.stats.yml b/.stats.yml index 3117cef8..f36c8c01 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3a8fb9d6b9645a483a08206e944cc388325e210f0bd54daa9e15ee561a37fabc.yml -openapi_spec_hash: fe42cbf3b012e4aebf56f64a675c3dd3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-13ed0159480c5c02ed02394764e7c528c1110cdc42d2a0ff5fac228f48403a08.yml +openapi_spec_hash: e1b4c20a8a5faee0f2dd22b449e7a106 config_hash: f36d04c8359fe8baec226396a18b309e diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 16d5cbac..2e5f87ec 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -2,9 +2,12 @@ from __future__ import annotations +from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo +from .shared.user_status import UserStatus +from .shared.organization_role import OrganizationRole __all__ = ["OrganizationListMembersParams", "Filter", "Pagination", "Sort"] @@ -33,9 +36,15 @@ class OrganizationListMembersParams(TypedDict, total=False): class Filter(TypedDict, total=False): + roles: List[OrganizationRole] + """roles filters members by their organization role""" + search: str """search performs case-insensitive search across member name and email""" + statuses: List[UserStatus] + """status filters members by their user status""" + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing members""" diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index e91ec611..093bf765 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -7,6 +7,7 @@ from .task_spec import TaskSpec as TaskSpec from .secret_ref import SecretRef as SecretRef from .field_value import FieldValue as FieldValue +from .user_status import UserStatus as UserStatus from .resource_type import ResourceType as ResourceType from .task_metadata import TaskMetadata as TaskMetadata from .environment_class import EnvironmentClass as EnvironmentClass diff --git a/src/gitpod/types/shared_params/user_status.py b/src/gitpod/types/shared_params/user_status.py new file mode 100644 index 00000000..fd8ac192 --- /dev/null +++ b/src/gitpod/types/shared_params/user_status.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypeAlias + +__all__ = ["UserStatus"] + +UserStatus: TypeAlias = Literal[ + "USER_STATUS_UNSPECIFIED", "USER_STATUS_ACTIVE", "USER_STATUS_SUSPENDED", "USER_STATUS_LEFT" +] diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 644ccbb4..b404eb78 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -266,7 +266,11 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, - filter={"search": "search"}, + filter={ + "roles": ["ORGANIZATION_ROLE_UNSPECIFIED"], + "search": "search", + "statuses": ["USER_STATUS_UNSPECIFIED"], + }, pagination={ "token": "token", "page_size": 20, @@ -599,7 +603,11 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, - filter={"search": "search"}, + filter={ + "roles": ["ORGANIZATION_ROLE_UNSPECIFIED"], + "search": "search", + "statuses": ["USER_STATUS_UNSPECIFIED"], + }, pagination={ "token": "token", "page_size": 20, From 6ced97491520ed02bf13ebde06b298d7f6f400d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:11:51 +0000 Subject: [PATCH 254/505] feat(dashboard): show tier badge in org selector --- .stats.yml | 6 +++--- api.md | 2 +- src/gitpod/types/__init__.py | 2 +- src/gitpod/types/account_membership.py | 8 ++++++-- src/gitpod/types/organization.py | 2 +- src/gitpod/types/shared/__init__.py | 1 + src/gitpod/types/{ => shared}/organization_tier.py | 0 7 files changed, 13 insertions(+), 8 deletions(-) rename src/gitpod/types/{ => shared}/organization_tier.py (100%) diff --git a/.stats.yml b/.stats.yml index f36c8c01..5770e670 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-13ed0159480c5c02ed02394764e7c528c1110cdc42d2a0ff5fac228f48403a08.yml -openapi_spec_hash: e1b4c20a8a5faee0f2dd22b449e7a106 -config_hash: f36d04c8359fe8baec226396a18b309e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-504fab16d01ad7f81914542fd0523f4dfefce87813891da391b97b1b0a70f563.yml +openapi_spec_hash: 84d9d652cac365c646e01111cee89afc +config_hash: acfe8cf5d6e4b26387e4fefa3bff8409 diff --git a/api.md b/api.md index 36e24037..9b1a07d7 100644 --- a/api.md +++ b/api.md @@ -10,6 +10,7 @@ from gitpod.types import ( FieldValue, Gateway, OrganizationRole, + OrganizationTier, Principal, ProjectEnvironmentClass, ResourceType, @@ -338,7 +339,6 @@ from gitpod.types import ( InviteDomains, Organization, OrganizationMember, - OrganizationTier, OrganizationCreateResponse, OrganizationRetrieveResponse, OrganizationUpdateResponse, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 954f9dfb..842817b3 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -25,6 +25,7 @@ TaskExecution as TaskExecution, EnvironmentClass as EnvironmentClass, OrganizationRole as OrganizationRole, + OrganizationTier as OrganizationTier, AutomationTrigger as AutomationTrigger, TaskExecutionSpec as TaskExecutionSpec, TaskExecutionPhase as TaskExecutionPhase, @@ -72,7 +73,6 @@ from .error_event_param import ErrorEventParam as ErrorEventParam from .event_list_params import EventListParams as EventListParams from .group_list_params import GroupListParams as GroupListParams -from .organization_tier import OrganizationTier as OrganizationTier from .prebuild_metadata import PrebuildMetadata as PrebuildMetadata from .runner_capability import RunnerCapability as RunnerCapability from .runner_spec_param import RunnerSpecParam as RunnerSpecParam diff --git a/src/gitpod/types/account_membership.py b/src/gitpod/types/account_membership.py index 10f26031..6f443a8f 100644 --- a/src/gitpod/types/account_membership.py +++ b/src/gitpod/types/account_membership.py @@ -6,6 +6,7 @@ from .._models import BaseModel from .shared.organization_role import OrganizationRole +from .shared.organization_tier import OrganizationTier __all__ = ["AccountMembership"] @@ -25,6 +26,9 @@ class AccountMembership(BaseModel): organization_member_count: Optional[int] = FieldInfo(alias="organizationMemberCount", default=None) """ - organization_name is the member count of the organization the user is a member - of + organization_member_count is the member count of the organization the user is a + member of """ + + organization_tier: Optional[OrganizationTier] = FieldInfo(alias="organizationTier", default=None) + """organization_tier is the tier of the organization (Free, Core, Enterprise)""" diff --git a/src/gitpod/types/organization.py b/src/gitpod/types/organization.py index edf88f15..e833b096 100644 --- a/src/gitpod/types/organization.py +++ b/src/gitpod/types/organization.py @@ -7,7 +7,7 @@ from .._models import BaseModel from .invite_domains import InviteDomains -from .organization_tier import OrganizationTier +from .shared.organization_tier import OrganizationTier __all__ = ["Organization"] diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index 5bfea28d..de9766f4 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -16,6 +16,7 @@ from .task_execution import TaskExecution as TaskExecution from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole +from .organization_tier import OrganizationTier as OrganizationTier from .automation_trigger import AutomationTrigger as AutomationTrigger from .task_execution_spec import TaskExecutionSpec as TaskExecutionSpec from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase diff --git a/src/gitpod/types/organization_tier.py b/src/gitpod/types/shared/organization_tier.py similarity index 100% rename from src/gitpod/types/organization_tier.py rename to src/gitpod/types/shared/organization_tier.py From 62a12989dc765eabcc4894818f3dc08ebdec0d17 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 11:17:51 +0000 Subject: [PATCH 255/505] feat(secrets): add ServiceAccountSecret entity with full support --- .stats.yml | 4 ++-- src/gitpod/types/secret_scope.py | 3 +++ src/gitpod/types/secret_scope_param.py | 3 +++ src/gitpod/types/shared/resource_type.py | 1 + src/gitpod/types/shared_params/resource_type.py | 1 + tests/api_resources/test_secrets.py | 4 ++++ 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5770e670..a1fa096e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-504fab16d01ad7f81914542fd0523f4dfefce87813891da391b97b1b0a70f563.yml -openapi_spec_hash: 84d9d652cac365c646e01111cee89afc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8a0189eebf423961bd98075dab28db4377c3a939da1dcf237d1b3958724e6dcf.yml +openapi_spec_hash: 48004e7605cf720584e822ec11a2eb8b config_hash: acfe8cf5d6e4b26387e4fefa3bff8409 diff --git a/src/gitpod/types/secret_scope.py b/src/gitpod/types/secret_scope.py index f66b6726..1d01cb37 100644 --- a/src/gitpod/types/secret_scope.py +++ b/src/gitpod/types/secret_scope.py @@ -16,5 +16,8 @@ class SecretScope(BaseModel): project_id: Optional[str] = FieldInfo(alias="projectId", default=None) """project_id is the Project ID this Secret belongs to""" + service_account_id: Optional[str] = FieldInfo(alias="serviceAccountId", default=None) + """service_account_id is the Service Account ID this Secret belongs to""" + user_id: Optional[str] = FieldInfo(alias="userId", default=None) """user_id is the User ID this Secret belongs to""" diff --git a/src/gitpod/types/secret_scope_param.py b/src/gitpod/types/secret_scope_param.py index d68e56b5..b7cf4f48 100644 --- a/src/gitpod/types/secret_scope_param.py +++ b/src/gitpod/types/secret_scope_param.py @@ -16,5 +16,8 @@ class SecretScopeParam(TypedDict, total=False): project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id is the Project ID this Secret belongs to""" + service_account_id: Annotated[str, PropertyInfo(alias="serviceAccountId")] + """service_account_id is the Service Account ID this Secret belongs to""" + user_id: Annotated[str, PropertyInfo(alias="userId")] """user_id is the User ID this Secret belongs to""" diff --git a/src/gitpod/types/shared/resource_type.py b/src/gitpod/types/shared/resource_type.py index 7531c05c..599108b9 100644 --- a/src/gitpod/types/shared/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -49,4 +49,5 @@ "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", "RESOURCE_TYPE_WEBHOOK", "RESOURCE_TYPE_SCIM_CONFIGURATION", + "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET", ] diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py index 34d2f8cd..9d489e4d 100644 --- a/src/gitpod/types/shared_params/resource_type.py +++ b/src/gitpod/types/shared_params/resource_type.py @@ -51,4 +51,5 @@ "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", "RESOURCE_TYPE_WEBHOOK", "RESOURCE_TYPE_SCIM_CONFIGURATION", + "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET", ] diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 6a54d360..680a9d7c 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -41,6 +41,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: scope={ "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "service_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, value="postgresql://user:pass@localhost:5432/db", @@ -86,6 +87,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "scope": { "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", + "service_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, }, @@ -252,6 +254,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> scope={ "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "service_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, value="postgresql://user:pass@localhost:5432/db", @@ -297,6 +300,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "scope": { "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", + "service_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, }, From 3eb25becbf57acf7b7fefccd7e4662b3a19d45c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 15:08:30 +0000 Subject: [PATCH 256/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a1fa096e..65355847 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8a0189eebf423961bd98075dab28db4377c3a939da1dcf237d1b3958724e6dcf.yml -openapi_spec_hash: 48004e7605cf720584e822ec11a2eb8b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e5c85c471bd3b69f4237abeba5f04212621408955a347de366cfd294a05b2b80.yml +openapi_spec_hash: 2a09889ff17121827dad73c3d318a921 config_hash: acfe8cf5d6e4b26387e4fefa3bff8409 From 6843cf7a0d8cd4153e74524d200fcffcb7199257 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:42:29 +0000 Subject: [PATCH 257/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 65355847..2b051f47 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e5c85c471bd3b69f4237abeba5f04212621408955a347de366cfd294a05b2b80.yml -openapi_spec_hash: 2a09889ff17121827dad73c3d318a921 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-978712dd212465a9a1633be0a7981cfad4dd3836827e7d98eeac1a4f14224f94.yml +openapi_spec_hash: 2f9436918b0af97785377ce80b4b2782 config_hash: acfe8cf5d6e4b26387e4fefa3bff8409 From 5d51716e1c3133c3403e8b7141801f88ed83ca7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:20:34 +0000 Subject: [PATCH 258/505] feat(api): add search, creator, and status filters to ListWorkflows --- .stats.yml | 4 ++-- src/gitpod/types/groups/resource_role.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b051f47..ba16c23e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-978712dd212465a9a1633be0a7981cfad4dd3836827e7d98eeac1a4f14224f94.yml -openapi_spec_hash: 2f9436918b0af97785377ce80b4b2782 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-247b6e1af7faefcf2f0ad1f1a012b45fd566be64e313d92648311bac4cda8b8e.yml +openapi_spec_hash: 5eb6026ee5764b077a65c26e85e4a84a config_hash: acfe8cf5d6e4b26387e4fefa3bff8409 diff --git a/src/gitpod/types/groups/resource_role.py b/src/gitpod/types/groups/resource_role.py index cd2e1643..33ecbb72 100644 --- a/src/gitpod/types/groups/resource_role.py +++ b/src/gitpod/types/groups/resource_role.py @@ -8,6 +8,7 @@ "RESOURCE_ROLE_UNSPECIFIED", "RESOURCE_ROLE_ORG_ADMIN", "RESOURCE_ROLE_ORG_MEMBER", + "RESOURCE_ROLE_ORG_RUNNERS_ADMIN", "RESOURCE_ROLE_GROUP_ADMIN", "RESOURCE_ROLE_GROUP_VIEWER", "RESOURCE_ROLE_USER_IDENTITY", From 2f18c5ab7cbe70f55f3a7128ef6d414f081190d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:59:40 +0000 Subject: [PATCH 259/505] feat(api): add ListSCMOrganizations endpoint --- .stats.yml | 8 +- api.md | 2 + src/gitpod/resources/runners/runners.py | 152 ++++++++++++++++++ src/gitpod/types/__init__.py | 4 + .../runner_list_scm_organizations_params.py | 20 +++ .../runner_list_scm_organizations_response.py | 28 ++++ tests/api_resources/test_runners.py | 79 +++++++++ 7 files changed, 289 insertions(+), 4 deletions(-) create mode 100644 src/gitpod/types/runner_list_scm_organizations_params.py create mode 100644 src/gitpod/types/runner_list_scm_organizations_response.py diff --git a/.stats.yml b/.stats.yml index ba16c23e..d64cbf29 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 160 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-247b6e1af7faefcf2f0ad1f1a012b45fd566be64e313d92648311bac4cda8b8e.yml -openapi_spec_hash: 5eb6026ee5764b077a65c26e85e4a84a -config_hash: acfe8cf5d6e4b26387e4fefa3bff8409 +configured_endpoints: 161 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-baa13045a9492d958fc06db0dcee2fd99972435f8b9a707831cf4da8d84db194.yml +openapi_spec_hash: 5e7adb5d5cdf924eb7c0e4ddf1b81260 +config_hash: d930f7e17a525d153b810339251607b7 diff --git a/api.md b/api.md index 9b1a07d7..ed7817a3 100644 --- a/api.md +++ b/api.md @@ -568,6 +568,7 @@ from gitpod.types import ( RunnerCheckAuthenticationForHostResponse, RunnerCreateLogsTokenResponse, RunnerCreateRunnerTokenResponse, + RunnerListScmOrganizationsResponse, RunnerParseContextURLResponse, RunnerSearchRepositoriesResponse, ) @@ -583,6 +584,7 @@ Methods: - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse - client.runners.create_logs_token(\*\*params) -> RunnerCreateLogsTokenResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse +- client.runners.list_scm_organizations(\*\*params) -> RunnerListScmOrganizationsResponse - client.runners.parse_context_url(\*\*params) -> RunnerParseContextURLResponse - client.runners.search_repositories(\*\*params) -> RunnerSearchRepositoriesResponse diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 1c445f8e..0ba69c1d 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -19,6 +19,7 @@ runner_parse_context_url_params, runner_create_runner_token_params, runner_search_repositories_params, + runner_list_scm_organizations_params, runner_check_authentication_for_host_params, ) from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given @@ -60,6 +61,7 @@ from ...types.runner_parse_context_url_response import RunnerParseContextURLResponse from ...types.runner_create_runner_token_response import RunnerCreateRunnerTokenResponse from ...types.runner_search_repositories_response import RunnerSearchRepositoriesResponse +from ...types.runner_list_scm_organizations_response import RunnerListScmOrganizationsResponse from ...types.runner_check_authentication_for_host_response import RunnerCheckAuthenticationForHostResponse __all__ = ["RunnersResource", "AsyncRunnersResource"] @@ -608,6 +610,75 @@ def create_runner_token( cast_to=RunnerCreateRunnerTokenResponse, ) + def list_scm_organizations( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + runner_id: str | Omit = omit, + scm_host: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerListScmOrganizationsResponse: + """ + Lists SCM organizations the user belongs to. + + Use this method to: + + - Get all organizations for a user on a specific SCM host + - Check organization admin permissions for webhook creation + + ### Examples + + - List GitHub organizations: + + Lists all organizations the user belongs to on GitHub. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmHost: "github.com" + ``` + + Args: + scm_host: The SCM host to list organizations from (e.g., "github.com", "gitlab.com") + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.RunnerService/ListSCMOrganizations", + body=maybe_transform( + { + "runner_id": runner_id, + "scm_host": scm_host, + }, + runner_list_scm_organizations_params.RunnerListScmOrganizationsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + runner_list_scm_organizations_params.RunnerListScmOrganizationsParams, + ), + ), + cast_to=RunnerListScmOrganizationsResponse, + ) + def parse_context_url( self, *, @@ -1304,6 +1375,75 @@ async def create_runner_token( cast_to=RunnerCreateRunnerTokenResponse, ) + async def list_scm_organizations( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + runner_id: str | Omit = omit, + scm_host: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerListScmOrganizationsResponse: + """ + Lists SCM organizations the user belongs to. + + Use this method to: + + - Get all organizations for a user on a specific SCM host + - Check organization admin permissions for webhook creation + + ### Examples + + - List GitHub organizations: + + Lists all organizations the user belongs to on GitHub. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmHost: "github.com" + ``` + + Args: + scm_host: The SCM host to list organizations from (e.g., "github.com", "gitlab.com") + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.RunnerService/ListSCMOrganizations", + body=await async_maybe_transform( + { + "runner_id": runner_id, + "scm_host": scm_host, + }, + runner_list_scm_organizations_params.RunnerListScmOrganizationsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "token": token, + "page_size": page_size, + }, + runner_list_scm_organizations_params.RunnerListScmOrganizationsParams, + ), + ), + cast_to=RunnerListScmOrganizationsResponse, + ) + async def parse_context_url( self, *, @@ -1483,6 +1623,9 @@ def __init__(self, runners: RunnersResource) -> None: self.create_runner_token = to_raw_response_wrapper( runners.create_runner_token, ) + self.list_scm_organizations = to_raw_response_wrapper( + runners.list_scm_organizations, + ) self.parse_context_url = to_raw_response_wrapper( runners.parse_context_url, ) @@ -1527,6 +1670,9 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.create_runner_token = async_to_raw_response_wrapper( runners.create_runner_token, ) + self.list_scm_organizations = async_to_raw_response_wrapper( + runners.list_scm_organizations, + ) self.parse_context_url = async_to_raw_response_wrapper( runners.parse_context_url, ) @@ -1571,6 +1717,9 @@ def __init__(self, runners: RunnersResource) -> None: self.create_runner_token = to_streamed_response_wrapper( runners.create_runner_token, ) + self.list_scm_organizations = to_streamed_response_wrapper( + runners.list_scm_organizations, + ) self.parse_context_url = to_streamed_response_wrapper( runners.parse_context_url, ) @@ -1615,6 +1764,9 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.create_runner_token = async_to_streamed_response_wrapper( runners.create_runner_token, ) + self.list_scm_organizations = async_to_streamed_response_wrapper( + runners.list_scm_organizations, + ) self.parse_context_url = async_to_streamed_response_wrapper( runners.parse_context_url, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 842817b3..73065136 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -221,6 +221,7 @@ from .runner_search_repositories_response import RunnerSearchRepositoriesResponse as RunnerSearchRepositoriesResponse from .environment_create_logs_token_params import EnvironmentCreateLogsTokenParams as EnvironmentCreateLogsTokenParams from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam as ProjectPrebuildConfigurationParam +from .runner_list_scm_organizations_params import RunnerListScmOrganizationsParams as RunnerListScmOrganizationsParams from .user_get_authenticated_user_response import UserGetAuthenticatedUserResponse as UserGetAuthenticatedUserResponse from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, @@ -231,6 +232,9 @@ from .project_create_from_environment_params import ( ProjectCreateFromEnvironmentParams as ProjectCreateFromEnvironmentParams, ) +from .runner_list_scm_organizations_response import ( + RunnerListScmOrganizationsResponse as RunnerListScmOrganizationsResponse, +) from .environment_create_from_project_response import ( EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, ) diff --git a/src/gitpod/types/runner_list_scm_organizations_params.py b/src/gitpod/types/runner_list_scm_organizations_params.py new file mode 100644 index 00000000..bd1f788b --- /dev/null +++ b/src/gitpod/types/runner_list_scm_organizations_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerListScmOrganizationsParams"] + + +class RunnerListScmOrganizationsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + scm_host: Annotated[str, PropertyInfo(alias="scmHost")] + """The SCM host to list organizations from (e.g., "github.com", "gitlab.com")""" diff --git a/src/gitpod/types/runner_list_scm_organizations_response.py b/src/gitpod/types/runner_list_scm_organizations_response.py new file mode 100644 index 00000000..8e9db077 --- /dev/null +++ b/src/gitpod/types/runner_list_scm_organizations_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerListScmOrganizationsResponse", "Organization"] + + +class Organization(BaseModel): + is_admin: Optional[bool] = FieldInfo(alias="isAdmin", default=None) + """ + Whether the user has admin permissions in this organization. Admin permissions + typically allow creating organization-level webhooks. + """ + + name: Optional[str] = None + """Organization name/slug (e.g., "gitpod-io")""" + + url: Optional[str] = None + """Organization URL (e.g., "https://github.com/gitpod-io")""" + + +class RunnerListScmOrganizationsResponse(BaseModel): + organizations: Optional[List[Organization]] = None + """List of organizations the user belongs to""" diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 9ce4674b..5cf72fe0 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -17,6 +17,7 @@ RunnerParseContextURLResponse, RunnerCreateRunnerTokenResponse, RunnerSearchRepositoriesResponse, + RunnerListScmOrganizationsResponse, RunnerCheckAuthenticationForHostResponse, ) from gitpod.pagination import SyncRunnersPage, AsyncRunnersPage @@ -363,6 +364,45 @@ def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_scm_organizations(self, client: Gitpod) -> None: + runner = client.runners.list_scm_organizations() + assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_scm_organizations_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.list_scm_organizations( + token="token", + page_size=0, + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_host="github.com", + ) + assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list_scm_organizations(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.list_scm_organizations() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list_scm_organizations(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.list_scm_organizations() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_parse_context_url(self, client: Gitpod) -> None: @@ -786,6 +826,45 @@ async def test_streaming_response_create_runner_token(self, async_client: AsyncG assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_scm_organizations(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.list_scm_organizations() + assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_scm_organizations_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.list_scm_organizations( + token="token", + page_size=0, + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_host="github.com", + ) + assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list_scm_organizations(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.list_scm_organizations() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list_scm_organizations(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.list_scm_organizations() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: From e40a68c2a20ecc15dc0066de27f8fe9afb438bd6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:33:55 +0000 Subject: [PATCH 260/505] chore(internal): update `actions/checkout` version --- .github/workflows/ci.yml | 6 +++--- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d60bafb6..36b6d22c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/gitpod-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -44,7 +44,7 @@ jobs: id-token: write runs-on: ${{ github.repository == 'stainless-sdks/gitpod-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -81,7 +81,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/gitpod-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 6cd33a62..1b0fbd98 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index f7fa2813..5493ca70 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'gitpod-io/gitpod-sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | From 04097e6ef8eab5795fef2c34878e499fce66491e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 19:01:09 +0000 Subject: [PATCH 261/505] feat: API for SCIM configuration management --- .stats.yml | 8 +- api.md | 23 + src/gitpod/pagination.py | 53 + .../resources/organizations/__init__.py | 14 + .../resources/organizations/organizations.py | 32 + .../organizations/scim_configurations.py | 909 ++++++++++++++++++ src/gitpod/types/organizations/__init__.py | 15 + .../types/organizations/scim_configuration.py | 37 + .../scim_configuration_create_params.py | 27 + .../scim_configuration_create_response.py | 19 + .../scim_configuration_delete_params.py | 14 + .../scim_configuration_list_params.py | 31 + ...m_configuration_regenerate_token_params.py | 17 + ...configuration_regenerate_token_response.py | 13 + .../scim_configuration_retrieve_params.py | 14 + .../scim_configuration_retrieve_response.py | 13 + .../scim_configuration_update_params.py | 24 + .../scim_configuration_update_response.py | 13 + .../organizations/test_scim_configurations.py | 501 ++++++++++ 19 files changed, 1773 insertions(+), 4 deletions(-) create mode 100644 src/gitpod/resources/organizations/scim_configurations.py create mode 100644 src/gitpod/types/organizations/scim_configuration.py create mode 100644 src/gitpod/types/organizations/scim_configuration_create_params.py create mode 100644 src/gitpod/types/organizations/scim_configuration_create_response.py create mode 100644 src/gitpod/types/organizations/scim_configuration_delete_params.py create mode 100644 src/gitpod/types/organizations/scim_configuration_list_params.py create mode 100644 src/gitpod/types/organizations/scim_configuration_regenerate_token_params.py create mode 100644 src/gitpod/types/organizations/scim_configuration_regenerate_token_response.py create mode 100644 src/gitpod/types/organizations/scim_configuration_retrieve_params.py create mode 100644 src/gitpod/types/organizations/scim_configuration_retrieve_response.py create mode 100644 src/gitpod/types/organizations/scim_configuration_update_params.py create mode 100644 src/gitpod/types/organizations/scim_configuration_update_response.py create mode 100644 tests/api_resources/organizations/test_scim_configurations.py diff --git a/.stats.yml b/.stats.yml index d64cbf29..c7d8a2f9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 161 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-baa13045a9492d958fc06db0dcee2fd99972435f8b9a707831cf4da8d84db194.yml -openapi_spec_hash: 5e7adb5d5cdf924eb7c0e4ddf1b81260 -config_hash: d930f7e17a525d153b810339251607b7 +configured_endpoints: 167 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-40c6617e0b944168058135c9325d556b21c2edde19518090aefa542c76afcdb3.yml +openapi_spec_hash: 235404d99aa56e51b933261d195dc206 +config_hash: cec4ffca97dd72023c573623499bc35b diff --git a/api.md b/api.md index ed7817a3..8c0b90a0 100644 --- a/api.md +++ b/api.md @@ -438,6 +438,29 @@ Methods: - client.organizations.policies.retrieve(\*\*params) -> PolicyRetrieveResponse - client.organizations.policies.update(\*\*params) -> object +## ScimConfigurations + +Types: + +```python +from gitpod.types.organizations import ( + ScimConfiguration, + ScimConfigurationCreateResponse, + ScimConfigurationRetrieveResponse, + ScimConfigurationUpdateResponse, + ScimConfigurationRegenerateTokenResponse, +) +``` + +Methods: + +- client.organizations.scim_configurations.create(\*\*params) -> ScimConfigurationCreateResponse +- client.organizations.scim_configurations.retrieve(\*\*params) -> ScimConfigurationRetrieveResponse +- client.organizations.scim_configurations.update(\*\*params) -> ScimConfigurationUpdateResponse +- client.organizations.scim_configurations.list(\*\*params) -> SyncScimConfigurationsPage[ScimConfiguration] +- client.organizations.scim_configurations.delete(\*\*params) -> object +- client.organizations.scim_configurations.regenerate_token(\*\*params) -> ScimConfigurationRegenerateTokenResponse + ## SSOConfigurations Types: diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index c8d007ff..0ffd69d7 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -78,6 +78,9 @@ "RunnersPagePagination", "SyncRunnersPage", "AsyncRunnersPage", + "ScimConfigurationsPagePagination", + "SyncScimConfigurationsPage", + "AsyncScimConfigurationsPage", "SecretsPagePagination", "SyncSecretsPage", "AsyncSecretsPage", @@ -1251,6 +1254,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class ScimConfigurationsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncScimConfigurationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ScimConfigurationsPagePagination] = None + scim_configurations: List[_T] = FieldInfo(alias="scimConfigurations") + + @override + def _get_page_items(self) -> List[_T]: + scim_configurations = self.scim_configurations + if not scim_configurations: + return [] + return scim_configurations + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncScimConfigurationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ScimConfigurationsPagePagination] = None + scim_configurations: List[_T] = FieldInfo(alias="scimConfigurations") + + @override + def _get_page_items(self) -> List[_T]: + scim_configurations = self.scim_configurations + if not scim_configurations: + return [] + return scim_configurations + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class SecretsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py index 84d6bdee..21debecf 100644 --- a/src/gitpod/resources/organizations/__init__.py +++ b/src/gitpod/resources/organizations/__init__.py @@ -40,6 +40,14 @@ SSOConfigurationsResourceWithStreamingResponse, AsyncSSOConfigurationsResourceWithStreamingResponse, ) +from .scim_configurations import ( + ScimConfigurationsResource, + AsyncScimConfigurationsResource, + ScimConfigurationsResourceWithRawResponse, + AsyncScimConfigurationsResourceWithRawResponse, + ScimConfigurationsResourceWithStreamingResponse, + AsyncScimConfigurationsResourceWithStreamingResponse, +) from .domain_verifications import ( DomainVerificationsResource, AsyncDomainVerificationsResource, @@ -74,6 +82,12 @@ "AsyncPoliciesResourceWithRawResponse", "PoliciesResourceWithStreamingResponse", "AsyncPoliciesResourceWithStreamingResponse", + "ScimConfigurationsResource", + "AsyncScimConfigurationsResource", + "ScimConfigurationsResourceWithRawResponse", + "AsyncScimConfigurationsResourceWithRawResponse", + "ScimConfigurationsResourceWithStreamingResponse", + "AsyncScimConfigurationsResourceWithStreamingResponse", "SSOConfigurationsResource", "AsyncSSOConfigurationsResource", "SSOConfigurationsResourceWithRawResponse", diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index c9de4ae3..c45b8a54 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -60,6 +60,14 @@ SSOConfigurationsResourceWithStreamingResponse, AsyncSSOConfigurationsResourceWithStreamingResponse, ) +from .scim_configurations import ( + ScimConfigurationsResource, + AsyncScimConfigurationsResource, + ScimConfigurationsResourceWithRawResponse, + AsyncScimConfigurationsResourceWithRawResponse, + ScimConfigurationsResourceWithStreamingResponse, + AsyncScimConfigurationsResourceWithStreamingResponse, +) from .domain_verifications import ( DomainVerificationsResource, AsyncDomainVerificationsResource, @@ -96,6 +104,10 @@ def invites(self) -> InvitesResource: def policies(self) -> PoliciesResource: return PoliciesResource(self._client) + @cached_property + def scim_configurations(self) -> ScimConfigurationsResource: + return ScimConfigurationsResource(self._client) + @cached_property def sso_configurations(self) -> SSOConfigurationsResource: return SSOConfigurationsResource(self._client) @@ -682,6 +694,10 @@ def invites(self) -> AsyncInvitesResource: def policies(self) -> AsyncPoliciesResource: return AsyncPoliciesResource(self._client) + @cached_property + def scim_configurations(self) -> AsyncScimConfigurationsResource: + return AsyncScimConfigurationsResource(self._client) + @cached_property def sso_configurations(self) -> AsyncSSOConfigurationsResource: return AsyncSSOConfigurationsResource(self._client) @@ -1296,6 +1312,10 @@ def invites(self) -> InvitesResourceWithRawResponse: def policies(self) -> PoliciesResourceWithRawResponse: return PoliciesResourceWithRawResponse(self._organizations.policies) + @cached_property + def scim_configurations(self) -> ScimConfigurationsResourceWithRawResponse: + return ScimConfigurationsResourceWithRawResponse(self._organizations.scim_configurations) + @cached_property def sso_configurations(self) -> SSOConfigurationsResourceWithRawResponse: return SSOConfigurationsResourceWithRawResponse(self._organizations.sso_configurations) @@ -1346,6 +1366,10 @@ def invites(self) -> AsyncInvitesResourceWithRawResponse: def policies(self) -> AsyncPoliciesResourceWithRawResponse: return AsyncPoliciesResourceWithRawResponse(self._organizations.policies) + @cached_property + def scim_configurations(self) -> AsyncScimConfigurationsResourceWithRawResponse: + return AsyncScimConfigurationsResourceWithRawResponse(self._organizations.scim_configurations) + @cached_property def sso_configurations(self) -> AsyncSSOConfigurationsResourceWithRawResponse: return AsyncSSOConfigurationsResourceWithRawResponse(self._organizations.sso_configurations) @@ -1396,6 +1420,10 @@ def invites(self) -> InvitesResourceWithStreamingResponse: def policies(self) -> PoliciesResourceWithStreamingResponse: return PoliciesResourceWithStreamingResponse(self._organizations.policies) + @cached_property + def scim_configurations(self) -> ScimConfigurationsResourceWithStreamingResponse: + return ScimConfigurationsResourceWithStreamingResponse(self._organizations.scim_configurations) + @cached_property def sso_configurations(self) -> SSOConfigurationsResourceWithStreamingResponse: return SSOConfigurationsResourceWithStreamingResponse(self._organizations.sso_configurations) @@ -1446,6 +1474,10 @@ def invites(self) -> AsyncInvitesResourceWithStreamingResponse: def policies(self) -> AsyncPoliciesResourceWithStreamingResponse: return AsyncPoliciesResourceWithStreamingResponse(self._organizations.policies) + @cached_property + def scim_configurations(self) -> AsyncScimConfigurationsResourceWithStreamingResponse: + return AsyncScimConfigurationsResourceWithStreamingResponse(self._organizations.scim_configurations) + @cached_property def sso_configurations(self) -> AsyncSSOConfigurationsResourceWithStreamingResponse: return AsyncSSOConfigurationsResourceWithStreamingResponse(self._organizations.sso_configurations) diff --git a/src/gitpod/resources/organizations/scim_configurations.py b/src/gitpod/resources/organizations/scim_configurations.py new file mode 100644 index 00000000..529ae165 --- /dev/null +++ b/src/gitpod/resources/organizations/scim_configurations.py @@ -0,0 +1,909 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncScimConfigurationsPage, AsyncScimConfigurationsPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.organizations import ( + scim_configuration_list_params, + scim_configuration_create_params, + scim_configuration_delete_params, + scim_configuration_update_params, + scim_configuration_retrieve_params, + scim_configuration_regenerate_token_params, +) +from ...types.organizations.scim_configuration import ScimConfiguration +from ...types.organizations.scim_configuration_create_response import ScimConfigurationCreateResponse +from ...types.organizations.scim_configuration_update_response import ScimConfigurationUpdateResponse +from ...types.organizations.scim_configuration_retrieve_response import ScimConfigurationRetrieveResponse +from ...types.organizations.scim_configuration_regenerate_token_response import ScimConfigurationRegenerateTokenResponse + +__all__ = ["ScimConfigurationsResource", "AsyncScimConfigurationsResource"] + + +class ScimConfigurationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ScimConfigurationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return ScimConfigurationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ScimConfigurationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return ScimConfigurationsResourceWithStreamingResponse(self) + + def create( + self, + *, + organization_id: str, + sso_configuration_id: str, + name: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScimConfigurationCreateResponse: + """ + Creates a new SCIM configuration for automated user provisioning. + + Use this method to: + + - Set up SCIM 2.0 provisioning from an identity provider + - Generate a bearer token for SCIM API authentication + - Link SCIM provisioning to an existing SSO configuration + + ### Examples + + - Create basic SCIM configuration: + + Creates a SCIM configuration linked to an SSO provider. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + organization_id: organization_id is the ID of the organization to create the SCIM configuration + for + + sso_configuration_id: sso_configuration_id is the SSO configuration to link (required for user + provisioning) + + name: name is a human-readable name for the SCIM configuration + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/CreateSCIMConfiguration", + body=maybe_transform( + { + "organization_id": organization_id, + "sso_configuration_id": sso_configuration_id, + "name": name, + }, + scim_configuration_create_params.ScimConfigurationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScimConfigurationCreateResponse, + ) + + def retrieve( + self, + *, + scim_configuration_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScimConfigurationRetrieveResponse: + """ + Retrieves a specific SCIM configuration. + + Use this method to: + + - View SCIM configuration details + - Check if SCIM is enabled + - Verify SSO linkage + + ### Examples + + - Get SCIM configuration: + + Retrieves details of a specific SCIM configuration. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to get + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/GetSCIMConfiguration", + body=maybe_transform( + {"scim_configuration_id": scim_configuration_id}, + scim_configuration_retrieve_params.ScimConfigurationRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScimConfigurationRetrieveResponse, + ) + + def update( + self, + *, + scim_configuration_id: str, + enabled: Optional[bool] | Omit = omit, + name: Optional[str] | Omit = omit, + sso_configuration_id: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScimConfigurationUpdateResponse: + """ + Updates a SCIM configuration. + + Use this method to: + + - Enable or disable SCIM provisioning + - Link or unlink SSO configuration + - Update configuration name + + ### Examples + + - Disable SCIM: + + Disables SCIM provisioning. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + enabled: false + ``` + + - Link to SSO: + + Links SCIM configuration to an SSO provider. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ssoConfigurationId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + Args: + scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to update + + enabled: enabled controls whether SCIM provisioning is active + + name: name is a human-readable name for the SCIM configuration + + sso_configuration_id: sso_configuration_id is the SSO configuration to link + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/UpdateSCIMConfiguration", + body=maybe_transform( + { + "scim_configuration_id": scim_configuration_id, + "enabled": enabled, + "name": name, + "sso_configuration_id": sso_configuration_id, + }, + scim_configuration_update_params.ScimConfigurationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScimConfigurationUpdateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: scim_configuration_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncScimConfigurationsPage[ScimConfiguration]: + """ + Lists SCIM configurations for an organization. + + Use this method to: + + - View all SCIM configurations + - Monitor provisioning status + - Audit SCIM settings + + ### Examples + + - List SCIM configurations: + + Shows all SCIM configurations for an organization. + + ```yaml + pagination: + pageSize: 20 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListSCIMConfigurations", + page=SyncScimConfigurationsPage[ScimConfiguration], + body=maybe_transform( + {"pagination": pagination}, scim_configuration_list_params.ScimConfigurationListParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + scim_configuration_list_params.ScimConfigurationListParams, + ), + ), + model=ScimConfiguration, + method="post", + ) + + def delete( + self, + *, + scim_configuration_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Removes a SCIM configuration from an organization. + + Use this method to: + + - Disable SCIM provisioning completely + - Remove unused configurations + - Clean up after migration + + ### Examples + + - Delete SCIM configuration: + + Removes a specific SCIM configuration. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/DeleteSCIMConfiguration", + body=maybe_transform( + {"scim_configuration_id": scim_configuration_id}, + scim_configuration_delete_params.ScimConfigurationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def regenerate_token( + self, + *, + scim_configuration_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScimConfigurationRegenerateTokenResponse: + """ + Regenerates the bearer token for a SCIM configuration. + + Use this method to: + + - Rotate SCIM credentials + - Recover from token compromise + - Update IdP configuration + + ### Examples + + - Regenerate token: + + Creates a new bearer token, invalidating the old one. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to regenerate token + for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/RegenerateSCIMToken", + body=maybe_transform( + {"scim_configuration_id": scim_configuration_id}, + scim_configuration_regenerate_token_params.ScimConfigurationRegenerateTokenParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScimConfigurationRegenerateTokenResponse, + ) + + +class AsyncScimConfigurationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncScimConfigurationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncScimConfigurationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncScimConfigurationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncScimConfigurationsResourceWithStreamingResponse(self) + + async def create( + self, + *, + organization_id: str, + sso_configuration_id: str, + name: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScimConfigurationCreateResponse: + """ + Creates a new SCIM configuration for automated user provisioning. + + Use this method to: + + - Set up SCIM 2.0 provisioning from an identity provider + - Generate a bearer token for SCIM API authentication + - Link SCIM provisioning to an existing SSO configuration + + ### Examples + + - Create basic SCIM configuration: + + Creates a SCIM configuration linked to an SSO provider. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + organization_id: organization_id is the ID of the organization to create the SCIM configuration + for + + sso_configuration_id: sso_configuration_id is the SSO configuration to link (required for user + provisioning) + + name: name is a human-readable name for the SCIM configuration + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/CreateSCIMConfiguration", + body=await async_maybe_transform( + { + "organization_id": organization_id, + "sso_configuration_id": sso_configuration_id, + "name": name, + }, + scim_configuration_create_params.ScimConfigurationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScimConfigurationCreateResponse, + ) + + async def retrieve( + self, + *, + scim_configuration_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScimConfigurationRetrieveResponse: + """ + Retrieves a specific SCIM configuration. + + Use this method to: + + - View SCIM configuration details + - Check if SCIM is enabled + - Verify SSO linkage + + ### Examples + + - Get SCIM configuration: + + Retrieves details of a specific SCIM configuration. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to get + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/GetSCIMConfiguration", + body=await async_maybe_transform( + {"scim_configuration_id": scim_configuration_id}, + scim_configuration_retrieve_params.ScimConfigurationRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScimConfigurationRetrieveResponse, + ) + + async def update( + self, + *, + scim_configuration_id: str, + enabled: Optional[bool] | Omit = omit, + name: Optional[str] | Omit = omit, + sso_configuration_id: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScimConfigurationUpdateResponse: + """ + Updates a SCIM configuration. + + Use this method to: + + - Enable or disable SCIM provisioning + - Link or unlink SSO configuration + - Update configuration name + + ### Examples + + - Disable SCIM: + + Disables SCIM provisioning. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + enabled: false + ``` + + - Link to SSO: + + Links SCIM configuration to an SSO provider. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ssoConfigurationId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + Args: + scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to update + + enabled: enabled controls whether SCIM provisioning is active + + name: name is a human-readable name for the SCIM configuration + + sso_configuration_id: sso_configuration_id is the SSO configuration to link + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/UpdateSCIMConfiguration", + body=await async_maybe_transform( + { + "scim_configuration_id": scim_configuration_id, + "enabled": enabled, + "name": name, + "sso_configuration_id": sso_configuration_id, + }, + scim_configuration_update_params.ScimConfigurationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScimConfigurationUpdateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: scim_configuration_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ScimConfiguration, AsyncScimConfigurationsPage[ScimConfiguration]]: + """ + Lists SCIM configurations for an organization. + + Use this method to: + + - View all SCIM configurations + - Monitor provisioning status + - Audit SCIM settings + + ### Examples + + - List SCIM configurations: + + Shows all SCIM configurations for an organization. + + ```yaml + pagination: + pageSize: 20 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.OrganizationService/ListSCIMConfigurations", + page=AsyncScimConfigurationsPage[ScimConfiguration], + body=maybe_transform( + {"pagination": pagination}, scim_configuration_list_params.ScimConfigurationListParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + scim_configuration_list_params.ScimConfigurationListParams, + ), + ), + model=ScimConfiguration, + method="post", + ) + + async def delete( + self, + *, + scim_configuration_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Removes a SCIM configuration from an organization. + + Use this method to: + + - Disable SCIM provisioning completely + - Remove unused configurations + - Clean up after migration + + ### Examples + + - Delete SCIM configuration: + + Removes a specific SCIM configuration. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/DeleteSCIMConfiguration", + body=await async_maybe_transform( + {"scim_configuration_id": scim_configuration_id}, + scim_configuration_delete_params.ScimConfigurationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def regenerate_token( + self, + *, + scim_configuration_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScimConfigurationRegenerateTokenResponse: + """ + Regenerates the bearer token for a SCIM configuration. + + Use this method to: + + - Rotate SCIM credentials + - Recover from token compromise + - Update IdP configuration + + ### Examples + + - Regenerate token: + + Creates a new bearer token, invalidating the old one. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to regenerate token + for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/RegenerateSCIMToken", + body=await async_maybe_transform( + {"scim_configuration_id": scim_configuration_id}, + scim_configuration_regenerate_token_params.ScimConfigurationRegenerateTokenParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScimConfigurationRegenerateTokenResponse, + ) + + +class ScimConfigurationsResourceWithRawResponse: + def __init__(self, scim_configurations: ScimConfigurationsResource) -> None: + self._scim_configurations = scim_configurations + + self.create = to_raw_response_wrapper( + scim_configurations.create, + ) + self.retrieve = to_raw_response_wrapper( + scim_configurations.retrieve, + ) + self.update = to_raw_response_wrapper( + scim_configurations.update, + ) + self.list = to_raw_response_wrapper( + scim_configurations.list, + ) + self.delete = to_raw_response_wrapper( + scim_configurations.delete, + ) + self.regenerate_token = to_raw_response_wrapper( + scim_configurations.regenerate_token, + ) + + +class AsyncScimConfigurationsResourceWithRawResponse: + def __init__(self, scim_configurations: AsyncScimConfigurationsResource) -> None: + self._scim_configurations = scim_configurations + + self.create = async_to_raw_response_wrapper( + scim_configurations.create, + ) + self.retrieve = async_to_raw_response_wrapper( + scim_configurations.retrieve, + ) + self.update = async_to_raw_response_wrapper( + scim_configurations.update, + ) + self.list = async_to_raw_response_wrapper( + scim_configurations.list, + ) + self.delete = async_to_raw_response_wrapper( + scim_configurations.delete, + ) + self.regenerate_token = async_to_raw_response_wrapper( + scim_configurations.regenerate_token, + ) + + +class ScimConfigurationsResourceWithStreamingResponse: + def __init__(self, scim_configurations: ScimConfigurationsResource) -> None: + self._scim_configurations = scim_configurations + + self.create = to_streamed_response_wrapper( + scim_configurations.create, + ) + self.retrieve = to_streamed_response_wrapper( + scim_configurations.retrieve, + ) + self.update = to_streamed_response_wrapper( + scim_configurations.update, + ) + self.list = to_streamed_response_wrapper( + scim_configurations.list, + ) + self.delete = to_streamed_response_wrapper( + scim_configurations.delete, + ) + self.regenerate_token = to_streamed_response_wrapper( + scim_configurations.regenerate_token, + ) + + +class AsyncScimConfigurationsResourceWithStreamingResponse: + def __init__(self, scim_configurations: AsyncScimConfigurationsResource) -> None: + self._scim_configurations = scim_configurations + + self.create = async_to_streamed_response_wrapper( + scim_configurations.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + scim_configurations.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + scim_configurations.update, + ) + self.list = async_to_streamed_response_wrapper( + scim_configurations.list, + ) + self.delete = async_to_streamed_response_wrapper( + scim_configurations.delete, + ) + self.regenerate_token = async_to_streamed_response_wrapper( + scim_configurations.regenerate_token, + ) diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index ba4b2b58..60c60ebe 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -6,6 +6,7 @@ from .custom_domain import CustomDomain as CustomDomain from .provider_type import ProviderType as ProviderType from .sso_configuration import SSOConfiguration as SSOConfiguration +from .scim_configuration import ScimConfiguration as ScimConfiguration from .crowd_strike_config import CrowdStrikeConfig as CrowdStrikeConfig from .domain_verification import DomainVerification as DomainVerification from .organization_invite import OrganizationInvite as OrganizationInvite @@ -30,20 +31,34 @@ from .custom_domain_retrieve_params import CustomDomainRetrieveParams as CustomDomainRetrieveParams from .custom_domain_update_response import CustomDomainUpdateResponse as CustomDomainUpdateResponse from .sso_configuration_list_params import SSOConfigurationListParams as SSOConfigurationListParams +from .scim_configuration_list_params import ScimConfigurationListParams as ScimConfigurationListParams from .custom_domain_retrieve_response import CustomDomainRetrieveResponse as CustomDomainRetrieveResponse from .domain_verification_list_params import DomainVerificationListParams as DomainVerificationListParams from .sso_configuration_create_params import SSOConfigurationCreateParams as SSOConfigurationCreateParams from .sso_configuration_delete_params import SSOConfigurationDeleteParams as SSOConfigurationDeleteParams from .sso_configuration_update_params import SSOConfigurationUpdateParams as SSOConfigurationUpdateParams +from .scim_configuration_create_params import ScimConfigurationCreateParams as ScimConfigurationCreateParams +from .scim_configuration_delete_params import ScimConfigurationDeleteParams as ScimConfigurationDeleteParams +from .scim_configuration_update_params import ScimConfigurationUpdateParams as ScimConfigurationUpdateParams from .domain_verification_create_params import DomainVerificationCreateParams as DomainVerificationCreateParams from .domain_verification_delete_params import DomainVerificationDeleteParams as DomainVerificationDeleteParams from .domain_verification_verify_params import DomainVerificationVerifyParams as DomainVerificationVerifyParams from .sso_configuration_create_response import SSOConfigurationCreateResponse as SSOConfigurationCreateResponse from .sso_configuration_retrieve_params import SSOConfigurationRetrieveParams as SSOConfigurationRetrieveParams +from .scim_configuration_create_response import ScimConfigurationCreateResponse as ScimConfigurationCreateResponse +from .scim_configuration_retrieve_params import ScimConfigurationRetrieveParams as ScimConfigurationRetrieveParams +from .scim_configuration_update_response import ScimConfigurationUpdateResponse as ScimConfigurationUpdateResponse from .domain_verification_create_response import DomainVerificationCreateResponse as DomainVerificationCreateResponse from .domain_verification_retrieve_params import DomainVerificationRetrieveParams as DomainVerificationRetrieveParams from .domain_verification_verify_response import DomainVerificationVerifyResponse as DomainVerificationVerifyResponse from .sso_configuration_retrieve_response import SSOConfigurationRetrieveResponse as SSOConfigurationRetrieveResponse +from .scim_configuration_retrieve_response import ScimConfigurationRetrieveResponse as ScimConfigurationRetrieveResponse from .domain_verification_retrieve_response import ( DomainVerificationRetrieveResponse as DomainVerificationRetrieveResponse, ) +from .scim_configuration_regenerate_token_params import ( + ScimConfigurationRegenerateTokenParams as ScimConfigurationRegenerateTokenParams, +) +from .scim_configuration_regenerate_token_response import ( + ScimConfigurationRegenerateTokenResponse as ScimConfigurationRegenerateTokenResponse, +) diff --git a/src/gitpod/types/organizations/scim_configuration.py b/src/gitpod/types/organizations/scim_configuration.py new file mode 100644 index 00000000..289db0f5 --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["ScimConfiguration"] + + +class ScimConfiguration(BaseModel): + """SCIMConfiguration represents a SCIM 2.0 provisioning configuration""" + + id: str + """id is the unique identifier of the SCIM configuration""" + + created_at: datetime = FieldInfo(alias="createdAt") + """created_at is when the SCIM configuration was created""" + + organization_id: str = FieldInfo(alias="organizationId") + """ + organization_id is the ID of the organization this SCIM configuration belongs to + """ + + updated_at: datetime = FieldInfo(alias="updatedAt") + """updated_at is when the SCIM configuration was last updated""" + + enabled: Optional[bool] = None + """enabled indicates if SCIM provisioning is active""" + + name: Optional[str] = None + """name is a human-readable name for the SCIM configuration""" + + sso_configuration_id: Optional[str] = FieldInfo(alias="ssoConfigurationId", default=None) + """sso_configuration_id is the linked SSO configuration (optional)""" diff --git a/src/gitpod/types/organizations/scim_configuration_create_params.py b/src/gitpod/types/organizations/scim_configuration_create_params.py new file mode 100644 index 00000000..fae33808 --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_create_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ScimConfigurationCreateParams"] + + +class ScimConfigurationCreateParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """ + organization_id is the ID of the organization to create the SCIM configuration + for + """ + + sso_configuration_id: Required[Annotated[str, PropertyInfo(alias="ssoConfigurationId")]] + """ + sso_configuration_id is the SSO configuration to link (required for user + provisioning) + """ + + name: Optional[str] + """name is a human-readable name for the SCIM configuration""" diff --git a/src/gitpod/types/organizations/scim_configuration_create_response.py b/src/gitpod/types/organizations/scim_configuration_create_response.py new file mode 100644 index 00000000..95ba89b9 --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_create_response.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .scim_configuration import ScimConfiguration + +__all__ = ["ScimConfigurationCreateResponse"] + + +class ScimConfigurationCreateResponse(BaseModel): + token: str + """ + token is the bearer token for SCIM API authentication. This is only returned + once during creation - store it securely. + """ + + scim_configuration: ScimConfiguration = FieldInfo(alias="scimConfiguration") + """scim_configuration is the created SCIM configuration""" diff --git a/src/gitpod/types/organizations/scim_configuration_delete_params.py b/src/gitpod/types/organizations/scim_configuration_delete_params.py new file mode 100644 index 00000000..51972cb6 --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_delete_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ScimConfigurationDeleteParams"] + + +class ScimConfigurationDeleteParams(TypedDict, total=False): + scim_configuration_id: Required[Annotated[str, PropertyInfo(alias="scimConfigurationId")]] + """scim_configuration_id is the ID of the SCIM configuration to delete""" diff --git a/src/gitpod/types/organizations/scim_configuration_list_params.py b/src/gitpod/types/organizations/scim_configuration_list_params.py new file mode 100644 index 00000000..199d3d36 --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_list_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ScimConfigurationListParams", "Pagination"] + + +class ScimConfigurationListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + pagination: Pagination + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/organizations/scim_configuration_regenerate_token_params.py b/src/gitpod/types/organizations/scim_configuration_regenerate_token_params.py new file mode 100644 index 00000000..b6cedadf --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_regenerate_token_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ScimConfigurationRegenerateTokenParams"] + + +class ScimConfigurationRegenerateTokenParams(TypedDict, total=False): + scim_configuration_id: Required[Annotated[str, PropertyInfo(alias="scimConfigurationId")]] + """ + scim_configuration_id is the ID of the SCIM configuration to regenerate token + for + """ diff --git a/src/gitpod/types/organizations/scim_configuration_regenerate_token_response.py b/src/gitpod/types/organizations/scim_configuration_regenerate_token_response.py new file mode 100644 index 00000000..0af03b1e --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_regenerate_token_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["ScimConfigurationRegenerateTokenResponse"] + + +class ScimConfigurationRegenerateTokenResponse(BaseModel): + token: str + """ + token is the new bearer token for SCIM API authentication. This invalidates the + previous token - store it securely. + """ diff --git a/src/gitpod/types/organizations/scim_configuration_retrieve_params.py b/src/gitpod/types/organizations/scim_configuration_retrieve_params.py new file mode 100644 index 00000000..f020f21c --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_retrieve_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ScimConfigurationRetrieveParams"] + + +class ScimConfigurationRetrieveParams(TypedDict, total=False): + scim_configuration_id: Required[Annotated[str, PropertyInfo(alias="scimConfigurationId")]] + """scim_configuration_id is the ID of the SCIM configuration to get""" diff --git a/src/gitpod/types/organizations/scim_configuration_retrieve_response.py b/src/gitpod/types/organizations/scim_configuration_retrieve_response.py new file mode 100644 index 00000000..55bb90ac --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_retrieve_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .scim_configuration import ScimConfiguration + +__all__ = ["ScimConfigurationRetrieveResponse"] + + +class ScimConfigurationRetrieveResponse(BaseModel): + scim_configuration: ScimConfiguration = FieldInfo(alias="scimConfiguration") + """scim_configuration is the SCIM configuration identified by the ID""" diff --git a/src/gitpod/types/organizations/scim_configuration_update_params.py b/src/gitpod/types/organizations/scim_configuration_update_params.py new file mode 100644 index 00000000..da919176 --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_update_params.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ScimConfigurationUpdateParams"] + + +class ScimConfigurationUpdateParams(TypedDict, total=False): + scim_configuration_id: Required[Annotated[str, PropertyInfo(alias="scimConfigurationId")]] + """scim_configuration_id is the ID of the SCIM configuration to update""" + + enabled: Optional[bool] + """enabled controls whether SCIM provisioning is active""" + + name: Optional[str] + """name is a human-readable name for the SCIM configuration""" + + sso_configuration_id: Annotated[Optional[str], PropertyInfo(alias="ssoConfigurationId")] + """sso_configuration_id is the SSO configuration to link""" diff --git a/src/gitpod/types/organizations/scim_configuration_update_response.py b/src/gitpod/types/organizations/scim_configuration_update_response.py new file mode 100644 index 00000000..4c4d0ac7 --- /dev/null +++ b/src/gitpod/types/organizations/scim_configuration_update_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .scim_configuration import ScimConfiguration + +__all__ = ["ScimConfigurationUpdateResponse"] + + +class ScimConfigurationUpdateResponse(BaseModel): + scim_configuration: ScimConfiguration = FieldInfo(alias="scimConfiguration") + """scim_configuration is the updated SCIM configuration""" diff --git a/tests/api_resources/organizations/test_scim_configurations.py b/tests/api_resources/organizations/test_scim_configurations.py new file mode 100644 index 00000000..16c6e252 --- /dev/null +++ b/tests/api_resources/organizations/test_scim_configurations.py @@ -0,0 +1,501 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.pagination import SyncScimConfigurationsPage, AsyncScimConfigurationsPage +from gitpod.types.organizations import ( + ScimConfiguration, + ScimConfigurationCreateResponse, + ScimConfigurationUpdateResponse, + ScimConfigurationRetrieveResponse, + ScimConfigurationRegenerateTokenResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestScimConfigurations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.create( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.create( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + name="name", + ) + assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.organizations.scim_configurations.with_raw_response.create( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = response.parse() + assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.organizations.scim_configurations.with_streaming_response.create( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = response.parse() + assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.retrieve( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.scim_configurations.with_raw_response.retrieve( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = response.parse() + assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.scim_configurations.with_streaming_response.retrieve( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = response.parse() + assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.update( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.update( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + enabled=False, + name="name", + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.organizations.scim_configurations.with_raw_response.update( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = response.parse() + assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.organizations.scim_configurations.with_streaming_response.update( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = response.parse() + assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.list() + assert_matches_type(SyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.list( + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(SyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.organizations.scim_configurations.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = response.parse() + assert_matches_type(SyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.organizations.scim_configurations.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = response.parse() + assert_matches_type(SyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.delete( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(object, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.organizations.scim_configurations.with_raw_response.delete( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = response.parse() + assert_matches_type(object, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.organizations.scim_configurations.with_streaming_response.delete( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = response.parse() + assert_matches_type(object, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_regenerate_token(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.regenerate_token( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_regenerate_token(self, client: Gitpod) -> None: + response = client.organizations.scim_configurations.with_raw_response.regenerate_token( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = response.parse() + assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_regenerate_token(self, client: Gitpod) -> None: + with client.organizations.scim_configurations.with_streaming_response.regenerate_token( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = response.parse() + assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncScimConfigurations: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.create( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.create( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + name="name", + ) + assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.scim_configurations.with_raw_response.create( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = await response.parse() + assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.scim_configurations.with_streaming_response.create( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = await response.parse() + assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.retrieve( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.scim_configurations.with_raw_response.retrieve( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = await response.parse() + assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.scim_configurations.with_streaming_response.retrieve( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = await response.parse() + assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.update( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.update( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + enabled=False, + name="name", + sso_configuration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.scim_configurations.with_raw_response.update( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = await response.parse() + assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.scim_configurations.with_streaming_response.update( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = await response.parse() + assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.list() + assert_matches_type(AsyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.list( + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(AsyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.scim_configurations.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = await response.parse() + assert_matches_type(AsyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.scim_configurations.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = await response.parse() + assert_matches_type(AsyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.delete( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(object, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.scim_configurations.with_raw_response.delete( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = await response.parse() + assert_matches_type(object, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.scim_configurations.with_streaming_response.delete( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = await response.parse() + assert_matches_type(object, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_regenerate_token(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.regenerate_token( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_regenerate_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.scim_configurations.with_raw_response.regenerate_token( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scim_configuration = await response.parse() + assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_regenerate_token(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.scim_configurations.with_streaming_response.regenerate_token( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scim_configuration = await response.parse() + assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + + assert cast(Any, response.is_closed) is True From 855c0a1a688364460d26bc9c20e5e9ff28be8ffc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 08:02:26 +0000 Subject: [PATCH 262/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index c7d8a2f9..c836904e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 167 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-40c6617e0b944168058135c9325d556b21c2edde19518090aefa542c76afcdb3.yml -openapi_spec_hash: 235404d99aa56e51b933261d195dc206 -config_hash: cec4ffca97dd72023c573623499bc35b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-041f3ba8dd0f5670e5fe37a61d725bd162d53c10c768bd3aa9b95ddc6d43926a.yml +openapi_spec_hash: 770ce1f0289034006cbe5279535dbbf3 +config_hash: 21bab2a4731f1e55c0a2c62588576282 From 0a9e8d763491cec3ae8c6206c11ab47b55357c18 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 11:34:35 +0000 Subject: [PATCH 263/505] feat(automations): add before_snapshot trigger type --- .stats.yml | 4 ++-- src/gitpod/types/runner_capability.py | 1 + src/gitpod/types/shared/automation_trigger.py | 6 +++++- src/gitpod/types/shared_params/automation_trigger.py | 6 +++++- .../api_resources/environments/automations/test_services.py | 4 ++++ tests/api_resources/environments/automations/test_tasks.py | 4 ++++ tests/api_resources/test_environments.py | 4 ++++ 7 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index c836904e..0df29b87 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 167 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-041f3ba8dd0f5670e5fe37a61d725bd162d53c10c768bd3aa9b95ddc6d43926a.yml -openapi_spec_hash: 770ce1f0289034006cbe5279535dbbf3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a7829781a00de0869ad8536dcd67bdbbf224a42f5f3f922065a44e73b0534bbf.yml +openapi_spec_hash: 59381e16e5de8d6de09f92abc0433e02 config_hash: 21bab2a4731f1e55c0a2c62588576282 diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py index b63ac784..36bb1f9b 100644 --- a/src/gitpod/types/runner_capability.py +++ b/src/gitpod/types/runner_capability.py @@ -12,4 +12,5 @@ "RUNNER_CAPABILITY_ALLOW_ENV_TOKEN_POPULATION", "RUNNER_CAPABILITY_DEFAULT_DEV_CONTAINER_IMAGE", "RUNNER_CAPABILITY_ENVIRONMENT_SNAPSHOT", + "RUNNER_CAPABILITY_PREBUILDS_BEFORE_SNAPSHOT_TRIGGER", ] diff --git a/src/gitpod/types/shared/automation_trigger.py b/src/gitpod/types/shared/automation_trigger.py index c21e923e..8ffd732b 100644 --- a/src/gitpod/types/shared/automation_trigger.py +++ b/src/gitpod/types/shared/automation_trigger.py @@ -18,9 +18,13 @@ class AutomationTrigger(BaseModel): The `post_environment_start` field indicates that the automation should be triggered after the environment has started (devcontainer ready). The `post_devcontainer_start` field indicates that the automation should be triggered after the dev container has started. The `prebuild` field starts the automation during a prebuild of an environment. This phase does not have user secrets available. - Note: The prebuild trigger can only be used with tasks, not services. + The `before_snapshot` field triggers the automation after all prebuild tasks complete but before the snapshot is taken. + This is used for tasks that need to run last during prebuilds, such as IDE warmup. + Note: The prebuild and before_snapshot triggers can only be used with tasks, not services. """ + before_snapshot: Optional[bool] = FieldInfo(alias="beforeSnapshot", default=None) + manual: Optional[bool] = None post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) diff --git a/src/gitpod/types/shared_params/automation_trigger.py b/src/gitpod/types/shared_params/automation_trigger.py index 0c840fe9..27dc462b 100644 --- a/src/gitpod/types/shared_params/automation_trigger.py +++ b/src/gitpod/types/shared_params/automation_trigger.py @@ -18,9 +18,13 @@ class AutomationTrigger(TypedDict, total=False): The `post_environment_start` field indicates that the automation should be triggered after the environment has started (devcontainer ready). The `post_devcontainer_start` field indicates that the automation should be triggered after the dev container has started. The `prebuild` field starts the automation during a prebuild of an environment. This phase does not have user secrets available. - Note: The prebuild trigger can only be used with tasks, not services. + The `before_snapshot` field triggers the automation after all prebuild tasks complete but before the snapshot is taken. + This is used for tasks that need to run last during prebuilds, such as IDE warmup. + Note: The prebuild and before_snapshot triggers can only be used with tasks, not services. """ + before_snapshot: Annotated[bool, PropertyInfo(alias="beforeSnapshot")] + manual: bool post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 650c04b9..c0db2dcd 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -46,6 +46,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, @@ -157,6 +158,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "triggered_by": { "trigger": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, @@ -404,6 +406,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, @@ -515,6 +518,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "triggered_by": { "trigger": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 057d1a17..289d4f4c 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -47,6 +47,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "reference": "build", "triggered_by": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, @@ -151,6 +152,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "triggered_by": { "trigger": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, @@ -349,6 +351,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "reference": "build", "triggered_by": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, @@ -453,6 +456,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "triggered_by": { "trigger": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 127cc4b8..b2a37f6f 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -43,6 +43,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "session": "session", "trigger_filter": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, @@ -394,6 +395,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "session": "session", "trigger_filter": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, @@ -697,6 +699,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "session": "session", "trigger_filter": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, @@ -1048,6 +1051,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "session": "session", "trigger_filter": [ { + "before_snapshot": True, "manual": True, "post_devcontainer_start": True, "post_environment_start": True, From 57c37da874fbba1969dcbbe2e14ccc3cd2a08e22 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 03:19:40 +0000 Subject: [PATCH 264/505] feat: [backend] Adding direct_share field to groups --- .stats.yml | 4 ++-- src/gitpod/types/group.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0df29b87..52fe54a6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 167 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a7829781a00de0869ad8536dcd67bdbbf224a42f5f3f922065a44e73b0534bbf.yml -openapi_spec_hash: 59381e16e5de8d6de09f92abc0433e02 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dfd13e2785a9e0e662f79aab0c03d45144d803fedd87510ec27791b79ede6162.yml +openapi_spec_hash: 8dcab0c2c65f9eb778e9b2cf3c44bf5c config_hash: 21bab2a4731f1e55c0a2c62588576282 diff --git a/src/gitpod/types/group.py b/src/gitpod/types/group.py index ac727d0f..1b70f57b 100644 --- a/src/gitpod/types/group.py +++ b/src/gitpod/types/group.py @@ -107,6 +107,12 @@ class Group(BaseModel): description: Optional[str] = None + direct_share: Optional[bool] = FieldInfo(alias="directShare", default=None) + """ + direct_share indicates that this group is used for direct user sharing on + resources. These groups are hidden from regular group listings. + """ + member_count: Optional[int] = FieldInfo(alias="memberCount", default=None) """member_count is the total number of members in this group""" From 2e4a5850603733f31cd1b836d9dad028c521d314 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 05:13:42 +0000 Subject: [PATCH 265/505] feat: [api] Introduce RPCs to share resources with individual users --- .stats.yml | 8 +- api.md | 10 +- src/gitpod/resources/groups/__init__.py | 14 + src/gitpod/resources/groups/groups.py | 32 ++ .../resources/groups/role_assignments.py | 9 +- src/gitpod/resources/groups/shares.py | 441 ++++++++++++++++++ src/gitpod/types/__init__.py | 1 + src/gitpod/types/groups/__init__.py | 3 +- src/gitpod/types/groups/role_assignment.py | 2 +- .../groups/role_assignment_create_params.py | 2 +- .../groups/role_assignment_list_params.py | 2 +- .../types/groups/share_create_params.py | 29 ++ .../types/groups/share_delete_params.py | 25 + src/gitpod/types/shared/__init__.py | 1 + .../types/{groups => shared}/resource_role.py | 0 src/gitpod/types/shared_params/__init__.py | 1 + .../types/shared_params/resource_role.py | 61 +++ tests/api_resources/groups/test_shares.py | 181 +++++++ 18 files changed, 806 insertions(+), 16 deletions(-) create mode 100644 src/gitpod/resources/groups/shares.py create mode 100644 src/gitpod/types/groups/share_create_params.py create mode 100644 src/gitpod/types/groups/share_delete_params.py rename src/gitpod/types/{groups => shared}/resource_role.py (100%) create mode 100644 src/gitpod/types/shared_params/resource_role.py create mode 100644 tests/api_resources/groups/test_shares.py diff --git a/.stats.yml b/.stats.yml index 52fe54a6..896d8f20 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 167 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dfd13e2785a9e0e662f79aab0c03d45144d803fedd87510ec27791b79ede6162.yml -openapi_spec_hash: 8dcab0c2c65f9eb778e9b2cf3c44bf5c -config_hash: 21bab2a4731f1e55c0a2c62588576282 +configured_endpoints: 169 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6b80aebab53bff73bb7b87c5f91f98c6dd5db2d623b6c613aaa5e61252b74d75.yml +openapi_spec_hash: 9636e315ac739c1ab9cba65a7ead6559 +config_hash: 73893621fd64bbd87b86671decf334e6 diff --git a/api.md b/api.md index 8c0b90a0..796ab4b4 100644 --- a/api.md +++ b/api.md @@ -13,6 +13,7 @@ from gitpod.types import ( OrganizationTier, Principal, ProjectEnvironmentClass, + ResourceRole, ResourceType, RunsOn, SecretRef, @@ -302,7 +303,7 @@ Methods: Types: ```python -from gitpod.types.groups import ResourceRole, RoleAssignment, RoleAssignmentCreateResponse +from gitpod.types.groups import RoleAssignment, RoleAssignmentCreateResponse ``` Methods: @@ -311,6 +312,13 @@ Methods: - client.groups.role_assignments.list(\*\*params) -> SyncAssignmentsPage[RoleAssignment] - client.groups.role_assignments.delete(\*\*params) -> object +## Shares + +Methods: + +- client.groups.shares.create(\*\*params) -> object +- client.groups.shares.delete(\*\*params) -> object + # Identity Types: diff --git a/src/gitpod/resources/groups/__init__.py b/src/gitpod/resources/groups/__init__.py index 83c3111d..363f4ea2 100644 --- a/src/gitpod/resources/groups/__init__.py +++ b/src/gitpod/resources/groups/__init__.py @@ -8,6 +8,14 @@ GroupsResourceWithStreamingResponse, AsyncGroupsResourceWithStreamingResponse, ) +from .shares import ( + SharesResource, + AsyncSharesResource, + SharesResourceWithRawResponse, + AsyncSharesResourceWithRawResponse, + SharesResourceWithStreamingResponse, + AsyncSharesResourceWithStreamingResponse, +) from .memberships import ( MembershipsResource, AsyncMembershipsResource, @@ -38,6 +46,12 @@ "AsyncRoleAssignmentsResourceWithRawResponse", "RoleAssignmentsResourceWithStreamingResponse", "AsyncRoleAssignmentsResourceWithStreamingResponse", + "SharesResource", + "AsyncSharesResource", + "SharesResourceWithRawResponse", + "AsyncSharesResourceWithRawResponse", + "SharesResourceWithStreamingResponse", + "AsyncSharesResourceWithStreamingResponse", "GroupsResource", "AsyncGroupsResource", "GroupsResourceWithRawResponse", diff --git a/src/gitpod/resources/groups/groups.py b/src/gitpod/resources/groups/groups.py index 4a57994e..bebd369b 100644 --- a/src/gitpod/resources/groups/groups.py +++ b/src/gitpod/resources/groups/groups.py @@ -4,6 +4,14 @@ import httpx +from .shares import ( + SharesResource, + AsyncSharesResource, + SharesResourceWithRawResponse, + AsyncSharesResourceWithRawResponse, + SharesResourceWithStreamingResponse, + AsyncSharesResourceWithStreamingResponse, +) from ...types import ( group_list_params, group_create_params, @@ -56,6 +64,10 @@ def memberships(self) -> MembershipsResource: def role_assignments(self) -> RoleAssignmentsResource: return RoleAssignmentsResource(self._client) + @cached_property + def shares(self) -> SharesResource: + return SharesResource(self._client) + @cached_property def with_raw_response(self) -> GroupsResourceWithRawResponse: """ @@ -396,6 +408,10 @@ def memberships(self) -> AsyncMembershipsResource: def role_assignments(self) -> AsyncRoleAssignmentsResource: return AsyncRoleAssignmentsResource(self._client) + @cached_property + def shares(self) -> AsyncSharesResource: + return AsyncSharesResource(self._client) + @cached_property def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: """ @@ -755,6 +771,10 @@ def memberships(self) -> MembershipsResourceWithRawResponse: def role_assignments(self) -> RoleAssignmentsResourceWithRawResponse: return RoleAssignmentsResourceWithRawResponse(self._groups.role_assignments) + @cached_property + def shares(self) -> SharesResourceWithRawResponse: + return SharesResourceWithRawResponse(self._groups.shares) + class AsyncGroupsResourceWithRawResponse: def __init__(self, groups: AsyncGroupsResource) -> None: @@ -784,6 +804,10 @@ def memberships(self) -> AsyncMembershipsResourceWithRawResponse: def role_assignments(self) -> AsyncRoleAssignmentsResourceWithRawResponse: return AsyncRoleAssignmentsResourceWithRawResponse(self._groups.role_assignments) + @cached_property + def shares(self) -> AsyncSharesResourceWithRawResponse: + return AsyncSharesResourceWithRawResponse(self._groups.shares) + class GroupsResourceWithStreamingResponse: def __init__(self, groups: GroupsResource) -> None: @@ -813,6 +837,10 @@ def memberships(self) -> MembershipsResourceWithStreamingResponse: def role_assignments(self) -> RoleAssignmentsResourceWithStreamingResponse: return RoleAssignmentsResourceWithStreamingResponse(self._groups.role_assignments) + @cached_property + def shares(self) -> SharesResourceWithStreamingResponse: + return SharesResourceWithStreamingResponse(self._groups.shares) + class AsyncGroupsResourceWithStreamingResponse: def __init__(self, groups: AsyncGroupsResource) -> None: @@ -841,3 +869,7 @@ def memberships(self) -> AsyncMembershipsResourceWithStreamingResponse: @cached_property def role_assignments(self) -> AsyncRoleAssignmentsResourceWithStreamingResponse: return AsyncRoleAssignmentsResourceWithStreamingResponse(self._groups.role_assignments) + + @cached_property + def shares(self) -> AsyncSharesResourceWithStreamingResponse: + return AsyncSharesResourceWithStreamingResponse(self._groups.shares) diff --git a/src/gitpod/resources/groups/role_assignments.py b/src/gitpod/resources/groups/role_assignments.py index 754dad37..0dde1df9 100644 --- a/src/gitpod/resources/groups/role_assignments.py +++ b/src/gitpod/resources/groups/role_assignments.py @@ -16,13 +16,8 @@ ) from ...pagination import SyncAssignmentsPage, AsyncAssignmentsPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.groups import ( - ResourceRole, - role_assignment_list_params, - role_assignment_create_params, - role_assignment_delete_params, -) -from ...types.groups.resource_role import ResourceRole +from ...types.groups import role_assignment_list_params, role_assignment_create_params, role_assignment_delete_params +from ...types.shared.resource_role import ResourceRole from ...types.shared.resource_type import ResourceType from ...types.groups.role_assignment import RoleAssignment from ...types.groups.role_assignment_create_response import RoleAssignmentCreateResponse diff --git a/src/gitpod/resources/groups/shares.py b/src/gitpod/resources/groups/shares.py new file mode 100644 index 00000000..fc0c308a --- /dev/null +++ b/src/gitpod/resources/groups/shares.py @@ -0,0 +1,441 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.groups import share_create_params, share_delete_params +from ...types.shared.principal import Principal +from ...types.shared.resource_role import ResourceRole +from ...types.shared.resource_type import ResourceType + +__all__ = ["SharesResource", "AsyncSharesResource"] + + +class SharesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SharesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return SharesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SharesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return SharesResourceWithStreamingResponse(self) + + def create( + self, + *, + principal: Principal | Omit = omit, + principal_id: str | Omit = omit, + resource_id: str | Omit = omit, + resource_type: ResourceType | Omit = omit, + role: ResourceRole | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Shares a resource directly with a principal (user or service account). + + Use this method to: + + - Grant a user or service account direct access to a runner, project, or other + resource + - Share resources without creating and managing groups manually + + ### Examples + + - Share a runner with a user: + + Grants admin access to a runner for a specific user. + + ```yaml + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + principal: PRINCIPAL_USER + principalId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RESOURCE_ROLE_RUNNER_ADMIN + ``` + + - Share a runner with a service account: + + Grants user access to a runner for a service account. + + ```yaml + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + principal: PRINCIPAL_SERVICE_ACCOUNT + principalId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + role: RESOURCE_ROLE_RUNNER_USER + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + principal: Type of principal to share with (user or service account) + + principal_id: ID of the principal (user or service account) to share with + + resource_id: ID of the resource to share + + resource_type: Type of resource to share (runner, project, etc.) + + role: Role to grant the principal on the resource + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/ShareResourceWithPrincipal", + body=maybe_transform( + { + "principal": principal, + "principal_id": principal_id, + "resource_id": resource_id, + "resource_type": resource_type, + "role": role, + }, + share_create_params.ShareCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def delete( + self, + *, + principal: Principal | Omit = omit, + principal_id: str | Omit = omit, + resource_id: str | Omit = omit, + resource_type: ResourceType | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Removes direct access for a principal (user or service account) from a resource. + + Use this method to: + + - Revoke a principal's direct access to a resource + - Remove sharing without affecting group-based access + + ### Examples + + - Remove user access from a runner: + + Revokes a user's direct access to a runner. + + ```yaml + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + principal: PRINCIPAL_USER + principalId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + principal: Type of principal to remove access from (user or service account) + + principal_id: ID of the principal (user or service account) to remove access from + + resource_id: ID of the resource to unshare + + resource_type: Type of resource to unshare + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/UnshareResourceWithPrincipal", + body=maybe_transform( + { + "principal": principal, + "principal_id": principal_id, + "resource_id": resource_id, + "resource_type": resource_type, + }, + share_delete_params.ShareDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncSharesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSharesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncSharesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSharesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncSharesResourceWithStreamingResponse(self) + + async def create( + self, + *, + principal: Principal | Omit = omit, + principal_id: str | Omit = omit, + resource_id: str | Omit = omit, + resource_type: ResourceType | Omit = omit, + role: ResourceRole | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Shares a resource directly with a principal (user or service account). + + Use this method to: + + - Grant a user or service account direct access to a runner, project, or other + resource + - Share resources without creating and managing groups manually + + ### Examples + + - Share a runner with a user: + + Grants admin access to a runner for a specific user. + + ```yaml + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + principal: PRINCIPAL_USER + principalId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RESOURCE_ROLE_RUNNER_ADMIN + ``` + + - Share a runner with a service account: + + Grants user access to a runner for a service account. + + ```yaml + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + principal: PRINCIPAL_SERVICE_ACCOUNT + principalId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + role: RESOURCE_ROLE_RUNNER_USER + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + principal: Type of principal to share with (user or service account) + + principal_id: ID of the principal (user or service account) to share with + + resource_id: ID of the resource to share + + resource_type: Type of resource to share (runner, project, etc.) + + role: Role to grant the principal on the resource + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/ShareResourceWithPrincipal", + body=await async_maybe_transform( + { + "principal": principal, + "principal_id": principal_id, + "resource_id": resource_id, + "resource_type": resource_type, + "role": role, + }, + share_create_params.ShareCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def delete( + self, + *, + principal: Principal | Omit = omit, + principal_id: str | Omit = omit, + resource_id: str | Omit = omit, + resource_type: ResourceType | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Removes direct access for a principal (user or service account) from a resource. + + Use this method to: + + - Revoke a principal's direct access to a resource + - Remove sharing without affecting group-based access + + ### Examples + + - Remove user access from a runner: + + Revokes a user's direct access to a runner. + + ```yaml + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + principal: PRINCIPAL_USER + principalId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + principal: Type of principal to remove access from (user or service account) + + principal_id: ID of the principal (user or service account) to remove access from + + resource_id: ID of the resource to unshare + + resource_type: Type of resource to unshare + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/UnshareResourceWithPrincipal", + body=await async_maybe_transform( + { + "principal": principal, + "principal_id": principal_id, + "resource_id": resource_id, + "resource_type": resource_type, + }, + share_delete_params.ShareDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class SharesResourceWithRawResponse: + def __init__(self, shares: SharesResource) -> None: + self._shares = shares + + self.create = to_raw_response_wrapper( + shares.create, + ) + self.delete = to_raw_response_wrapper( + shares.delete, + ) + + +class AsyncSharesResourceWithRawResponse: + def __init__(self, shares: AsyncSharesResource) -> None: + self._shares = shares + + self.create = async_to_raw_response_wrapper( + shares.create, + ) + self.delete = async_to_raw_response_wrapper( + shares.delete, + ) + + +class SharesResourceWithStreamingResponse: + def __init__(self, shares: SharesResource) -> None: + self._shares = shares + + self.create = to_streamed_response_wrapper( + shares.create, + ) + self.delete = to_streamed_response_wrapper( + shares.delete, + ) + + +class AsyncSharesResourceWithStreamingResponse: + def __init__(self, shares: AsyncSharesResource) -> None: + self._shares = shares + + self.create = async_to_streamed_response_wrapper( + shares.create, + ) + self.delete = async_to_streamed_response_wrapper( + shares.delete, + ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 73065136..41613c29 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -20,6 +20,7 @@ SecretRef as SecretRef, FieldValue as FieldValue, UserStatus as UserStatus, + ResourceRole as ResourceRole, ResourceType as ResourceType, TaskMetadata as TaskMetadata, TaskExecution as TaskExecution, diff --git a/src/gitpod/types/groups/__init__.py b/src/gitpod/types/groups/__init__.py index abbe99fe..384b0a76 100644 --- a/src/gitpod/types/groups/__init__.py +++ b/src/gitpod/types/groups/__init__.py @@ -2,9 +2,10 @@ from __future__ import annotations -from .resource_role import ResourceRole as ResourceRole from .role_assignment import RoleAssignment as RoleAssignment from .group_membership import GroupMembership as GroupMembership +from .share_create_params import ShareCreateParams as ShareCreateParams +from .share_delete_params import ShareDeleteParams as ShareDeleteParams from .membership_list_params import MembershipListParams as MembershipListParams from .membership_create_params import MembershipCreateParams as MembershipCreateParams from .membership_delete_params import MembershipDeleteParams as MembershipDeleteParams diff --git a/src/gitpod/types/groups/role_assignment.py b/src/gitpod/types/groups/role_assignment.py index 38e30ea8..39512d04 100644 --- a/src/gitpod/types/groups/role_assignment.py +++ b/src/gitpod/types/groups/role_assignment.py @@ -5,7 +5,7 @@ from pydantic import Field as FieldInfo from ..._models import BaseModel -from .resource_role import ResourceRole +from ..shared.resource_role import ResourceRole from ..shared.resource_type import ResourceType __all__ = ["RoleAssignment"] diff --git a/src/gitpod/types/groups/role_assignment_create_params.py b/src/gitpod/types/groups/role_assignment_create_params.py index d036e80d..deee1882 100644 --- a/src/gitpod/types/groups/role_assignment_create_params.py +++ b/src/gitpod/types/groups/role_assignment_create_params.py @@ -5,7 +5,7 @@ from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo -from .resource_role import ResourceRole +from ..shared.resource_role import ResourceRole from ..shared.resource_type import ResourceType __all__ = ["RoleAssignmentCreateParams"] diff --git a/src/gitpod/types/groups/role_assignment_list_params.py b/src/gitpod/types/groups/role_assignment_list_params.py index 23c236b5..63b97bd1 100644 --- a/src/gitpod/types/groups/role_assignment_list_params.py +++ b/src/gitpod/types/groups/role_assignment_list_params.py @@ -6,7 +6,7 @@ from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo -from .resource_role import ResourceRole +from ..shared.resource_role import ResourceRole from ..shared.resource_type import ResourceType __all__ = ["RoleAssignmentListParams", "Filter", "Pagination"] diff --git a/src/gitpod/types/groups/share_create_params.py b/src/gitpod/types/groups/share_create_params.py new file mode 100644 index 00000000..3aba19d3 --- /dev/null +++ b/src/gitpod/types/groups/share_create_params.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from ..shared.principal import Principal +from ..shared.resource_role import ResourceRole +from ..shared.resource_type import ResourceType + +__all__ = ["ShareCreateParams"] + + +class ShareCreateParams(TypedDict, total=False): + principal: Principal + """Type of principal to share with (user or service account)""" + + principal_id: Annotated[str, PropertyInfo(alias="principalId")] + """ID of the principal (user or service account) to share with""" + + resource_id: Annotated[str, PropertyInfo(alias="resourceId")] + """ID of the resource to share""" + + resource_type: Annotated[ResourceType, PropertyInfo(alias="resourceType")] + """Type of resource to share (runner, project, etc.)""" + + role: ResourceRole + """Role to grant the principal on the resource""" diff --git a/src/gitpod/types/groups/share_delete_params.py b/src/gitpod/types/groups/share_delete_params.py new file mode 100644 index 00000000..e855a216 --- /dev/null +++ b/src/gitpod/types/groups/share_delete_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from ..shared.principal import Principal +from ..shared.resource_type import ResourceType + +__all__ = ["ShareDeleteParams"] + + +class ShareDeleteParams(TypedDict, total=False): + principal: Principal + """Type of principal to remove access from (user or service account)""" + + principal_id: Annotated[str, PropertyInfo(alias="principalId")] + """ID of the principal (user or service account) to remove access from""" + + resource_id: Annotated[str, PropertyInfo(alias="resourceId")] + """ID of the resource to unshare""" + + resource_type: Annotated[ResourceType, PropertyInfo(alias="resourceType")] + """Type of resource to unshare""" diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index de9766f4..04e206d4 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -11,6 +11,7 @@ from .secret_ref import SecretRef as SecretRef from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus +from .resource_role import ResourceRole as ResourceRole from .resource_type import ResourceType as ResourceType from .task_metadata import TaskMetadata as TaskMetadata from .task_execution import TaskExecution as TaskExecution diff --git a/src/gitpod/types/groups/resource_role.py b/src/gitpod/types/shared/resource_role.py similarity index 100% rename from src/gitpod/types/groups/resource_role.py rename to src/gitpod/types/shared/resource_role.py diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index 093bf765..1d82dedc 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -8,6 +8,7 @@ from .secret_ref import SecretRef as SecretRef from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus +from .resource_role import ResourceRole as ResourceRole from .resource_type import ResourceType as ResourceType from .task_metadata import TaskMetadata as TaskMetadata from .environment_class import EnvironmentClass as EnvironmentClass diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py new file mode 100644 index 00000000..053e9545 --- /dev/null +++ b/src/gitpod/types/shared_params/resource_role.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResourceRole"] + +ResourceRole: TypeAlias = Literal[ + "RESOURCE_ROLE_UNSPECIFIED", + "RESOURCE_ROLE_ORG_ADMIN", + "RESOURCE_ROLE_ORG_MEMBER", + "RESOURCE_ROLE_ORG_RUNNERS_ADMIN", + "RESOURCE_ROLE_GROUP_ADMIN", + "RESOURCE_ROLE_GROUP_VIEWER", + "RESOURCE_ROLE_USER_IDENTITY", + "RESOURCE_ROLE_USER_VIEWER", + "RESOURCE_ROLE_USER_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_IDENTITY", + "RESOURCE_ROLE_ENVIRONMENT_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_USER", + "RESOURCE_ROLE_ENVIRONMENT_VIEWER", + "RESOURCE_ROLE_ENVIRONMENT_RUNNER", + "RESOURCE_ROLE_RUNNER_IDENTITY", + "RESOURCE_ROLE_RUNNER_ADMIN", + "RESOURCE_ROLE_RUNNER_LOCAL_ADMIN", + "RESOURCE_ROLE_RUNNER_MANAGED_ADMIN", + "RESOURCE_ROLE_RUNNER_USER", + "RESOURCE_ROLE_RUNNER_CONFIGURATION_READER", + "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN", + "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER", + "RESOURCE_ROLE_PROJECT_ADMIN", + "RESOURCE_ROLE_PROJECT_USER", + "RESOURCE_ROLE_PROJECT_EDITOR", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV", + "RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER", + "RESOURCE_ROLE_ENVIRONMENT_TASK_USER", + "RESOURCE_ROLE_ENVIRONMENT_TASK_ENV", + "RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY", + "RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN", + "RESOURCE_ROLE_AGENT_EXECUTION_IDENTITY", + "RESOURCE_ROLE_AGENT_EXECUTION_USER", + "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", + "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", + "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER", + "RESOURCE_ROLE_AGENT_ADMIN", + "RESOURCE_ROLE_AGENT_VIEWER", + "RESOURCE_ROLE_AGENT_EXECUTOR", + "RESOURCE_ROLE_WORKFLOW_ADMIN", + "RESOURCE_ROLE_WORKFLOW_USER", + "RESOURCE_ROLE_WORKFLOW_VIEWER", + "RESOURCE_ROLE_WORKFLOW_EXECUTOR", + "RESOURCE_ROLE_SNAPSHOT_ADMIN", + "RESOURCE_ROLE_SNAPSHOT_RUNNER", + "RESOURCE_ROLE_WEBHOOK_ADMIN", + "RESOURCE_ROLE_WEBHOOK_VIEWER", +] diff --git a/tests/api_resources/groups/test_shares.py b/tests/api_resources/groups/test_shares.py new file mode 100644 index 00000000..3e0c57f4 --- /dev/null +++ b/tests/api_resources/groups/test_shares.py @@ -0,0 +1,181 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestShares: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + share = client.groups.shares.create() + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + share = client.groups.shares.create( + principal="PRINCIPAL_SERVICE_ACCOUNT", + principal_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + resource_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + resource_type="RESOURCE_TYPE_RUNNER", + role="RESOURCE_ROLE_RUNNER_USER", + ) + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.groups.shares.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + share = response.parse() + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.groups.shares.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + share = response.parse() + assert_matches_type(object, share, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + share = client.groups.shares.delete() + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + share = client.groups.shares.delete( + principal="PRINCIPAL_USER", + principal_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + resource_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + resource_type="RESOURCE_TYPE_RUNNER", + ) + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.groups.shares.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + share = response.parse() + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.groups.shares.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + share = response.parse() + assert_matches_type(object, share, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncShares: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + share = await async_client.groups.shares.create() + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + share = await async_client.groups.shares.create( + principal="PRINCIPAL_SERVICE_ACCOUNT", + principal_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + resource_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + resource_type="RESOURCE_TYPE_RUNNER", + role="RESOURCE_ROLE_RUNNER_USER", + ) + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.shares.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + share = await response.parse() + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.shares.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + share = await response.parse() + assert_matches_type(object, share, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + share = await async_client.groups.shares.delete() + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + share = await async_client.groups.shares.delete( + principal="PRINCIPAL_USER", + principal_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + resource_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + resource_type="RESOURCE_TYPE_RUNNER", + ) + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.shares.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + share = await response.parse() + assert_matches_type(object, share, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.shares.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + share = await response.parse() + assert_matches_type(object, share, path=["response"]) + + assert cast(Any, response.is_closed) is True From 52538a16977190180dd4749bf2d3d2f167ddc40a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 08:59:29 +0000 Subject: [PATCH 266/505] feat(api): add CheckRepositoryAccess API for repository access validation --- .stats.yml | 8 +- api.md | 2 + src/gitpod/resources/runners/runners.py | 142 ++++++++++++++++++ src/gitpod/types/__init__.py | 6 + .../runner_check_repository_access_params.py | 19 +++ ...runner_check_repository_access_response.py | 20 +++ tests/api_resources/test_runners.py | 75 +++++++++ 7 files changed, 268 insertions(+), 4 deletions(-) create mode 100644 src/gitpod/types/runner_check_repository_access_params.py create mode 100644 src/gitpod/types/runner_check_repository_access_response.py diff --git a/.stats.yml b/.stats.yml index 896d8f20..d4501236 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 169 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6b80aebab53bff73bb7b87c5f91f98c6dd5db2d623b6c613aaa5e61252b74d75.yml -openapi_spec_hash: 9636e315ac739c1ab9cba65a7ead6559 -config_hash: 73893621fd64bbd87b86671decf334e6 +configured_endpoints: 170 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-024993504dfc744ff138b0d1b1a151e28129f9f5a8b55adff4c7b559b0556c62.yml +openapi_spec_hash: 4773277eb2a6ac6be0b2e8f89a2201d8 +config_hash: 942ffc968ca0131e192c1a7ac5dd8990 diff --git a/api.md b/api.md index 796ab4b4..0b70b7bf 100644 --- a/api.md +++ b/api.md @@ -597,6 +597,7 @@ from gitpod.types import ( RunnerCreateResponse, RunnerRetrieveResponse, RunnerCheckAuthenticationForHostResponse, + RunnerCheckRepositoryAccessResponse, RunnerCreateLogsTokenResponse, RunnerCreateRunnerTokenResponse, RunnerListScmOrganizationsResponse, @@ -613,6 +614,7 @@ Methods: - client.runners.list(\*\*params) -> SyncRunnersPage[Runner] - client.runners.delete(\*\*params) -> object - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse +- client.runners.check_repository_access(\*\*params) -> RunnerCheckRepositoryAccessResponse - client.runners.create_logs_token(\*\*params) -> RunnerCreateLogsTokenResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse - client.runners.list_scm_organizations(\*\*params) -> RunnerListScmOrganizationsResponse diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 0ba69c1d..5a0ee2e4 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -20,6 +20,7 @@ runner_create_runner_token_params, runner_search_repositories_params, runner_list_scm_organizations_params, + runner_check_repository_access_params, runner_check_authentication_for_host_params, ) from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given @@ -62,6 +63,7 @@ from ...types.runner_create_runner_token_response import RunnerCreateRunnerTokenResponse from ...types.runner_search_repositories_response import RunnerSearchRepositoriesResponse from ...types.runner_list_scm_organizations_response import RunnerListScmOrganizationsResponse +from ...types.runner_check_repository_access_response import RunnerCheckRepositoryAccessResponse from ...types.runner_check_authentication_for_host_response import RunnerCheckAuthenticationForHostResponse __all__ = ["RunnersResource", "AsyncRunnersResource"] @@ -510,6 +512,70 @@ def check_authentication_for_host( cast_to=RunnerCheckAuthenticationForHostResponse, ) + def check_repository_access( + self, + *, + repository_url: str | Omit = omit, + runner_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerCheckRepositoryAccessResponse: + """ + Checks if a principal has read access to a repository. + + Use this method to: + + - Validate repository access before workflow execution + - Verify executor credentials for automation bindings + + Returns: + + - has_access: true if the principal can read the repository + - FAILED_PRECONDITION if authentication is required + - INVALID_ARGUMENT if the repository URL is invalid + + ### Examples + + - Check access: + + Verifies read access to a repository. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + repositoryUrl: "https://github.com/org/repo" + ``` + + Args: + repository_url: repository_url is the URL of the repository to check access for. Can be a clone + URL (https://github.com/org/repo.git) or web URL (https://github.com/org/repo). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.RunnerService/CheckRepositoryAccess", + body=maybe_transform( + { + "repository_url": repository_url, + "runner_id": runner_id, + }, + runner_check_repository_access_params.RunnerCheckRepositoryAccessParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCheckRepositoryAccessResponse, + ) + def create_logs_token( self, *, @@ -1273,6 +1339,70 @@ async def check_authentication_for_host( cast_to=RunnerCheckAuthenticationForHostResponse, ) + async def check_repository_access( + self, + *, + repository_url: str | Omit = omit, + runner_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerCheckRepositoryAccessResponse: + """ + Checks if a principal has read access to a repository. + + Use this method to: + + - Validate repository access before workflow execution + - Verify executor credentials for automation bindings + + Returns: + + - has_access: true if the principal can read the repository + - FAILED_PRECONDITION if authentication is required + - INVALID_ARGUMENT if the repository URL is invalid + + ### Examples + + - Check access: + + Verifies read access to a repository. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + repositoryUrl: "https://github.com/org/repo" + ``` + + Args: + repository_url: repository_url is the URL of the repository to check access for. Can be a clone + URL (https://github.com/org/repo.git) or web URL (https://github.com/org/repo). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.RunnerService/CheckRepositoryAccess", + body=await async_maybe_transform( + { + "repository_url": repository_url, + "runner_id": runner_id, + }, + runner_check_repository_access_params.RunnerCheckRepositoryAccessParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCheckRepositoryAccessResponse, + ) + async def create_logs_token( self, *, @@ -1617,6 +1747,9 @@ def __init__(self, runners: RunnersResource) -> None: self.check_authentication_for_host = to_raw_response_wrapper( runners.check_authentication_for_host, ) + self.check_repository_access = to_raw_response_wrapper( + runners.check_repository_access, + ) self.create_logs_token = to_raw_response_wrapper( runners.create_logs_token, ) @@ -1664,6 +1797,9 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.check_authentication_for_host = async_to_raw_response_wrapper( runners.check_authentication_for_host, ) + self.check_repository_access = async_to_raw_response_wrapper( + runners.check_repository_access, + ) self.create_logs_token = async_to_raw_response_wrapper( runners.create_logs_token, ) @@ -1711,6 +1847,9 @@ def __init__(self, runners: RunnersResource) -> None: self.check_authentication_for_host = to_streamed_response_wrapper( runners.check_authentication_for_host, ) + self.check_repository_access = to_streamed_response_wrapper( + runners.check_repository_access, + ) self.create_logs_token = to_streamed_response_wrapper( runners.create_logs_token, ) @@ -1758,6 +1897,9 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.check_authentication_for_host = async_to_streamed_response_wrapper( runners.check_authentication_for_host, ) + self.check_repository_access = async_to_streamed_response_wrapper( + runners.check_repository_access, + ) self.create_logs_token = async_to_streamed_response_wrapper( runners.create_logs_token, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 41613c29..4b195c70 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -224,6 +224,9 @@ from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam as ProjectPrebuildConfigurationParam from .runner_list_scm_organizations_params import RunnerListScmOrganizationsParams as RunnerListScmOrganizationsParams from .user_get_authenticated_user_response import UserGetAuthenticatedUserResponse as UserGetAuthenticatedUserResponse +from .runner_check_repository_access_params import ( + RunnerCheckRepositoryAccessParams as RunnerCheckRepositoryAccessParams, +) from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, ) @@ -236,6 +239,9 @@ from .runner_list_scm_organizations_response import ( RunnerListScmOrganizationsResponse as RunnerListScmOrganizationsResponse, ) +from .runner_check_repository_access_response import ( + RunnerCheckRepositoryAccessResponse as RunnerCheckRepositoryAccessResponse, +) from .environment_create_from_project_response import ( EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, ) diff --git a/src/gitpod/types/runner_check_repository_access_params.py b/src/gitpod/types/runner_check_repository_access_params.py new file mode 100644 index 00000000..d1184290 --- /dev/null +++ b/src/gitpod/types/runner_check_repository_access_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerCheckRepositoryAccessParams"] + + +class RunnerCheckRepositoryAccessParams(TypedDict, total=False): + repository_url: Annotated[str, PropertyInfo(alias="repositoryUrl")] + """ + repository_url is the URL of the repository to check access for. Can be a clone + URL (https://github.com/org/repo.git) or web URL (https://github.com/org/repo). + """ + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] diff --git a/src/gitpod/types/runner_check_repository_access_response.py b/src/gitpod/types/runner_check_repository_access_response.py new file mode 100644 index 00000000..11b75362 --- /dev/null +++ b/src/gitpod/types/runner_check_repository_access_response.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerCheckRepositoryAccessResponse"] + + +class RunnerCheckRepositoryAccessResponse(BaseModel): + error_message: Optional[str] = FieldInfo(alias="errorMessage", default=None) + """ + error_message provides details when access check fails. Empty when has_access is + true. + """ + + has_access: Optional[bool] = FieldInfo(alias="hasAccess", default=None) + """has_access indicates whether the principal has read access to the repository.""" diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 5cf72fe0..eaf96b9e 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -18,6 +18,7 @@ RunnerCreateRunnerTokenResponse, RunnerSearchRepositoriesResponse, RunnerListScmOrganizationsResponse, + RunnerCheckRepositoryAccessResponse, RunnerCheckAuthenticationForHostResponse, ) from gitpod.pagination import SyncRunnersPage, AsyncRunnersPage @@ -292,6 +293,43 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_check_repository_access(self, client: Gitpod) -> None: + runner = client.runners.check_repository_access() + assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_check_repository_access_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.check_repository_access( + repository_url="https://github.com/org/repo", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_check_repository_access(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.check_repository_access() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_check_repository_access(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.check_repository_access() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_logs_token(self, client: Gitpod) -> None: @@ -754,6 +792,43 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_check_repository_access(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.check_repository_access() + assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_check_repository_access_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.check_repository_access( + repository_url="https://github.com/org/repo", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_check_repository_access(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.check_repository_access() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_check_repository_access(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.check_repository_access() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: From 11a16cfbd0fb83f88b9f822b7a9471056ad0b4cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 09:21:58 +0000 Subject: [PATCH 267/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index d4501236..718b9101 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-024993504dfc744ff138b0d1b1a151e28129f9f5a8b55adff4c7b559b0556c62.yml -openapi_spec_hash: 4773277eb2a6ac6be0b2e8f89a2201d8 -config_hash: 942ffc968ca0131e192c1a7ac5dd8990 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-eeec67988ceb123d93514d894e04b0fa00dbf0c4678b95baa80868c103aaa0c1.yml +openapi_spec_hash: 3bf178a4e70c15f12fdc23531fe81aea +config_hash: d726afb2a92132197e4eae04303e8041 From ad905391b8516fdca249e3672226c03bdb1adba8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 13:28:15 +0000 Subject: [PATCH 268/505] feat(api): add inputs array to UserInputBlock proto --- .stats.yml | 4 +- src/gitpod/types/user_input_block_param.py | 47 ++++++++++++++++++---- tests/api_resources/test_agents.py | 28 ++++++++++++- 3 files changed, 68 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index 718b9101..de7a9632 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-eeec67988ceb123d93514d894e04b0fa00dbf0c4678b95baa80868c103aaa0c1.yml -openapi_spec_hash: 3bf178a4e70c15f12fdc23531fe81aea +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f838b3c6096ed0143c969fcdd6acf63cb619865ef707e1213194d3b82afe10bf.yml +openapi_spec_hash: 00a77c0d2749b833f8e29c8493b7ea98 config_hash: d726afb2a92132197e4eae04303e8041 diff --git a/src/gitpod/types/user_input_block_param.py b/src/gitpod/types/user_input_block_param.py index 5a6b87e1..905b9285 100644 --- a/src/gitpod/types/user_input_block_param.py +++ b/src/gitpod/types/user_input_block_param.py @@ -2,30 +2,61 @@ from __future__ import annotations -from typing import Union +from typing import Union, Iterable from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._types import Base64FileInput from .._utils import PropertyInfo from .._models import set_pydantic_config -__all__ = ["UserInputBlockParam", "Image", "Text"] +__all__ = ["UserInputBlockParam", "Image", "Input", "InputImage", "InputText", "Text"] class Image(TypedDict, total=False): """ ImageInput allows sending images to the agent. - Media type is inferred from magic bytes by the backend. + Client must provide the MIME type; backend validates against magic bytes. """ data: Annotated[Union[str, Base64FileInput], PropertyInfo(format="base64")] - """Raw image data (max 4MB). Supported formats: PNG, JPEG, WebP.""" + """Raw image data (max 4MB). Supported formats: PNG, JPEG.""" + + mime_type: Annotated[Literal["image/png", "image/jpeg"], PropertyInfo(alias="mimeType")] set_pydantic_config(Image, {"arbitrary_types_allowed": True}) +class InputImage(TypedDict, total=False): + """ + ImageInput allows sending images to the agent. + Client must provide the MIME type; backend validates against magic bytes. + """ + + data: Annotated[Union[str, Base64FileInput], PropertyInfo(format="base64")] + """Raw image data (max 4MB). Supported formats: PNG, JPEG.""" + + mime_type: Annotated[Literal["image/png", "image/jpeg"], PropertyInfo(alias="mimeType")] + + +set_pydantic_config(InputImage, {"arbitrary_types_allowed": True}) + + +class InputText(TypedDict, total=False): + content: str + + +class Input(TypedDict, total=False): + image: InputImage + """ + ImageInput allows sending images to the agent. Client must provide the MIME + type; backend validates against magic bytes. + """ + + text: InputText + + class Text(TypedDict, total=False): content: str @@ -38,8 +69,10 @@ class UserInputBlockParam(TypedDict, total=False): image: Image """ - ImageInput allows sending images to the agent. Media type is inferred from magic - bytes by the backend. + ImageInput allows sending images to the agent. Client must provide the MIME + type; backend validates against magic bytes. """ + inputs: Iterable[Input] + text: Text diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index f4f2aad5..e006c3cf 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -361,7 +361,19 @@ def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: user_input={ "id": "id", "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "image": {"data": "U3RhaW5sZXNzIHJvY2tz"}, + "image": { + "data": "U3RhaW5sZXNzIHJvY2tz", + "mime_type": "image/png", + }, + "inputs": [ + { + "image": { + "data": "U3RhaW5sZXNzIHJvY2tz", + "mime_type": "image/png", + }, + "text": {"content": "x"}, + } + ], "text": {"content": "Generate a report based on the latest logs."}, }, ) @@ -874,7 +886,19 @@ async def test_method_send_to_execution_with_all_params(self, async_client: Asyn user_input={ "id": "id", "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "image": {"data": "U3RhaW5sZXNzIHJvY2tz"}, + "image": { + "data": "U3RhaW5sZXNzIHJvY2tz", + "mime_type": "image/png", + }, + "inputs": [ + { + "image": { + "data": "U3RhaW5sZXNzIHJvY2tz", + "mime_type": "image/png", + }, + "text": {"content": "x"}, + } + ], "text": {"content": "Generate a report based on the latest logs."}, }, ) From 0d54c951956c3f8e48f75f2b23294da34de5331d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 13:43:59 +0000 Subject: [PATCH 269/505] feat(agent): add spec mode for planning before interactive implementation --- .stats.yml | 4 ++-- src/gitpod/types/agent_mode.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index de7a9632..bec4a22b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f838b3c6096ed0143c969fcdd6acf63cb619865ef707e1213194d3b82afe10bf.yml -openapi_spec_hash: 00a77c0d2749b833f8e29c8493b7ea98 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-df34fde966f11e17c7e733280ca1e0aeda7ee786ca7de6d245d649970fa71764.yml +openapi_spec_hash: 9c8c2465318c2d732de64a455cbd7704 config_hash: d726afb2a92132197e4eae04303e8041 diff --git a/src/gitpod/types/agent_mode.py b/src/gitpod/types/agent_mode.py index d7bd23bc..a58c3798 100644 --- a/src/gitpod/types/agent_mode.py +++ b/src/gitpod/types/agent_mode.py @@ -5,5 +5,5 @@ __all__ = ["AgentMode"] AgentMode: TypeAlias = Literal[ - "AGENT_MODE_UNSPECIFIED", "AGENT_MODE_EXECUTION", "AGENT_MODE_PLANNING", "AGENT_MODE_RALPH" + "AGENT_MODE_UNSPECIFIED", "AGENT_MODE_EXECUTION", "AGENT_MODE_PLANNING", "AGENT_MODE_RALPH", "AGENT_MODE_SPEC" ] From d6d6bd4c6e46b323fd953f0ea3f5f5a09c752c4a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 13:58:17 +0000 Subject: [PATCH 270/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bec4a22b..886c83c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-df34fde966f11e17c7e733280ca1e0aeda7ee786ca7de6d245d649970fa71764.yml -openapi_spec_hash: 9c8c2465318c2d732de64a455cbd7704 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2423c089f280cdf34a987d40531692097a69f4aa971c6adf9aeec4fd7984cec2.yml +openapi_spec_hash: 24037c3ab9ceca689150d07ecec7aa80 config_hash: d726afb2a92132197e4eae04303e8041 From 15955f3c7aedc888765cd291b8806c51ed397072 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:30:32 +0000 Subject: [PATCH 271/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4208b5cb..1b77f506 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.0" + ".": "0.7.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 84619e4f..ba9cda3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.6.0" +version = "0.7.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 850eb95d..88739dd6 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.6.0" # x-release-please-version +__version__ = "0.7.0" # x-release-please-version From fc882fc067ce65a6a760a793b840eb8f6f72c77b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:12:32 +0000 Subject: [PATCH 272/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 886c83c4..510aff08 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2423c089f280cdf34a987d40531692097a69f4aa971c6adf9aeec4fd7984cec2.yml -openapi_spec_hash: 24037c3ab9ceca689150d07ecec7aa80 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7657a825edb92ab1d6515f88597c70ad1a00446852373c186c325a2d3d6151a5.yml +openapi_spec_hash: 81125dd322b408fef14d282061dab10e config_hash: d726afb2a92132197e4eae04303e8041 From b73e7ab47adc61f3a92a687d0bb133ab4ee9a9bd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:24:51 +0000 Subject: [PATCH 273/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 510aff08..ffe2f10f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7657a825edb92ab1d6515f88597c70ad1a00446852373c186c325a2d3d6151a5.yml -openapi_spec_hash: 81125dd322b408fef14d282061dab10e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ad1f784d86ac9f5bdb080855e79d772c943a6647a3e8dc9d83fff22abe98d6e3.yml +openapi_spec_hash: 1a61bba422186929693832be53f0a985 config_hash: d726afb2a92132197e4eae04303e8041 From 49ad77ff12a643402cd8174d61a476a6231e687e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 17:25:48 +0000 Subject: [PATCH 274/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index ffe2f10f..c7103fba 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ad1f784d86ac9f5bdb080855e79d772c943a6647a3e8dc9d83fff22abe98d6e3.yml -openapi_spec_hash: 1a61bba422186929693832be53f0a985 -config_hash: d726afb2a92132197e4eae04303e8041 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7094f695e14998d4c22ae9f95f44c57d551a1499bcee445df15d7d55999ded39.yml +openapi_spec_hash: d156e0330620815b6f5f0e20f29d74c6 +config_hash: 83bee2a76e377c5645fe54cd8edec02d From ebdab52f534f4de78e813aab785ff7feec228cc9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 05:11:12 +0000 Subject: [PATCH 275/505] feat(api): add announcement banner fields to organization proto --- .stats.yml | 8 +- api.md | 17 + .../resources/organizations/__init__.py | 14 + .../organizations/announcement_banner.py | 342 ++++++++++++++++++ .../resources/organizations/organizations.py | 32 ++ src/gitpod/types/organizations/__init__.py | 5 + .../organizations/announcement_banner.py | 20 + .../announcement_banner_get_params.py | 14 + .../announcement_banner_get_response.py | 11 + .../announcement_banner_update_params.py | 24 ++ .../announcement_banner_update_response.py | 11 + .../organizations/test_announcement_banner.py | 183 ++++++++++ 12 files changed, 677 insertions(+), 4 deletions(-) create mode 100644 src/gitpod/resources/organizations/announcement_banner.py create mode 100644 src/gitpod/types/organizations/announcement_banner.py create mode 100644 src/gitpod/types/organizations/announcement_banner_get_params.py create mode 100644 src/gitpod/types/organizations/announcement_banner_get_response.py create mode 100644 src/gitpod/types/organizations/announcement_banner_update_params.py create mode 100644 src/gitpod/types/organizations/announcement_banner_update_response.py create mode 100644 tests/api_resources/organizations/test_announcement_banner.py diff --git a/.stats.yml b/.stats.yml index c7103fba..eb5040a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7094f695e14998d4c22ae9f95f44c57d551a1499bcee445df15d7d55999ded39.yml -openapi_spec_hash: d156e0330620815b6f5f0e20f29d74c6 -config_hash: 83bee2a76e377c5645fe54cd8edec02d +configured_endpoints: 172 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b1f3c630c150b9219800d95b3bb4df29bede775d34f46fc2eb3af34cb91110b5.yml +openapi_spec_hash: 49ece69cbfc81e6172f62a7542b2541a +config_hash: dad4ee53c894c682895d6d045c4c2105 diff --git a/api.md b/api.md index 0b70b7bf..57eff1c5 100644 --- a/api.md +++ b/api.md @@ -365,6 +365,23 @@ Methods: - client.organizations.list_members(\*\*params) -> SyncMembersPage[OrganizationMember] - client.organizations.set_role(\*\*params) -> object +## AnnouncementBanner + +Types: + +```python +from gitpod.types.organizations import ( + AnnouncementBanner, + AnnouncementBannerUpdateResponse, + AnnouncementBannerGetResponse, +) +``` + +Methods: + +- client.organizations.announcement_banner.update(\*\*params) -> AnnouncementBannerUpdateResponse +- client.organizations.announcement_banner.get(\*\*params) -> AnnouncementBannerGetResponse + ## CustomDomains Types: diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py index 21debecf..c0a5e791 100644 --- a/src/gitpod/resources/organizations/__init__.py +++ b/src/gitpod/resources/organizations/__init__.py @@ -40,6 +40,14 @@ SSOConfigurationsResourceWithStreamingResponse, AsyncSSOConfigurationsResourceWithStreamingResponse, ) +from .announcement_banner import ( + AnnouncementBannerResource, + AsyncAnnouncementBannerResource, + AnnouncementBannerResourceWithRawResponse, + AsyncAnnouncementBannerResourceWithRawResponse, + AnnouncementBannerResourceWithStreamingResponse, + AsyncAnnouncementBannerResourceWithStreamingResponse, +) from .scim_configurations import ( ScimConfigurationsResource, AsyncScimConfigurationsResource, @@ -58,6 +66,12 @@ ) __all__ = [ + "AnnouncementBannerResource", + "AsyncAnnouncementBannerResource", + "AnnouncementBannerResourceWithRawResponse", + "AsyncAnnouncementBannerResourceWithRawResponse", + "AnnouncementBannerResourceWithStreamingResponse", + "AsyncAnnouncementBannerResourceWithStreamingResponse", "CustomDomainsResource", "AsyncCustomDomainsResource", "CustomDomainsResourceWithRawResponse", diff --git a/src/gitpod/resources/organizations/announcement_banner.py b/src/gitpod/resources/organizations/announcement_banner.py new file mode 100644 index 00000000..e8ab3a97 --- /dev/null +++ b/src/gitpod/resources/organizations/announcement_banner.py @@ -0,0 +1,342 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.organizations import announcement_banner_get_params, announcement_banner_update_params +from ...types.organizations.announcement_banner_get_response import AnnouncementBannerGetResponse +from ...types.organizations.announcement_banner_update_response import AnnouncementBannerUpdateResponse + +__all__ = ["AnnouncementBannerResource", "AsyncAnnouncementBannerResource"] + + +class AnnouncementBannerResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AnnouncementBannerResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AnnouncementBannerResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AnnouncementBannerResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AnnouncementBannerResourceWithStreamingResponse(self) + + def update( + self, + *, + organization_id: str, + enabled: Optional[bool] | Omit = omit, + message: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AnnouncementBannerUpdateResponse: + """ + Updates the announcement banner configuration for an organization. + + Use this method to configure the announcement banner displayed to all users. + Only organization admins can update the banner. Requires Enterprise tier. + + ### Examples + + - Enable announcement banner: + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + message: "Scheduled maintenance on Saturday 10pm-2am UTC" + enabled: true + ``` + + - Disable announcement banner: + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + enabled: false + ``` + + Args: + organization_id: organization_id is the ID of the organization + + enabled: enabled controls whether the banner is displayed + + message: message is the banner message. Supports basic Markdown. Maximum 1000 characters. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/UpdateAnnouncementBanner", + body=maybe_transform( + { + "organization_id": organization_id, + "enabled": enabled, + "message": message, + }, + announcement_banner_update_params.AnnouncementBannerUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AnnouncementBannerUpdateResponse, + ) + + def get( + self, + *, + organization_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AnnouncementBannerGetResponse: + """ + Retrieves the announcement banner configuration for an organization. + + Use this method to fetch the current announcement banner settings. All + organization members can read the banner configuration. + + ### Examples + + - Get announcement banner: + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/GetAnnouncementBanner", + body=maybe_transform( + {"organization_id": organization_id}, announcement_banner_get_params.AnnouncementBannerGetParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AnnouncementBannerGetResponse, + ) + + +class AsyncAnnouncementBannerResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAnnouncementBannerResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncAnnouncementBannerResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAnnouncementBannerResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncAnnouncementBannerResourceWithStreamingResponse(self) + + async def update( + self, + *, + organization_id: str, + enabled: Optional[bool] | Omit = omit, + message: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AnnouncementBannerUpdateResponse: + """ + Updates the announcement banner configuration for an organization. + + Use this method to configure the announcement banner displayed to all users. + Only organization admins can update the banner. Requires Enterprise tier. + + ### Examples + + - Enable announcement banner: + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + message: "Scheduled maintenance on Saturday 10pm-2am UTC" + enabled: true + ``` + + - Disable announcement banner: + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + enabled: false + ``` + + Args: + organization_id: organization_id is the ID of the organization + + enabled: enabled controls whether the banner is displayed + + message: message is the banner message. Supports basic Markdown. Maximum 1000 characters. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/UpdateAnnouncementBanner", + body=await async_maybe_transform( + { + "organization_id": organization_id, + "enabled": enabled, + "message": message, + }, + announcement_banner_update_params.AnnouncementBannerUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AnnouncementBannerUpdateResponse, + ) + + async def get( + self, + *, + organization_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AnnouncementBannerGetResponse: + """ + Retrieves the announcement banner configuration for an organization. + + Use this method to fetch the current announcement banner settings. All + organization members can read the banner configuration. + + ### Examples + + - Get announcement banner: + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/GetAnnouncementBanner", + body=await async_maybe_transform( + {"organization_id": organization_id}, announcement_banner_get_params.AnnouncementBannerGetParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AnnouncementBannerGetResponse, + ) + + +class AnnouncementBannerResourceWithRawResponse: + def __init__(self, announcement_banner: AnnouncementBannerResource) -> None: + self._announcement_banner = announcement_banner + + self.update = to_raw_response_wrapper( + announcement_banner.update, + ) + self.get = to_raw_response_wrapper( + announcement_banner.get, + ) + + +class AsyncAnnouncementBannerResourceWithRawResponse: + def __init__(self, announcement_banner: AsyncAnnouncementBannerResource) -> None: + self._announcement_banner = announcement_banner + + self.update = async_to_raw_response_wrapper( + announcement_banner.update, + ) + self.get = async_to_raw_response_wrapper( + announcement_banner.get, + ) + + +class AnnouncementBannerResourceWithStreamingResponse: + def __init__(self, announcement_banner: AnnouncementBannerResource) -> None: + self._announcement_banner = announcement_banner + + self.update = to_streamed_response_wrapper( + announcement_banner.update, + ) + self.get = to_streamed_response_wrapper( + announcement_banner.get, + ) + + +class AsyncAnnouncementBannerResourceWithStreamingResponse: + def __init__(self, announcement_banner: AsyncAnnouncementBannerResource) -> None: + self._announcement_banner = announcement_banner + + self.update = async_to_streamed_response_wrapper( + announcement_banner.update, + ) + self.get = async_to_streamed_response_wrapper( + announcement_banner.get, + ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index c45b8a54..d1a9f666 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -60,6 +60,14 @@ SSOConfigurationsResourceWithStreamingResponse, AsyncSSOConfigurationsResourceWithStreamingResponse, ) +from .announcement_banner import ( + AnnouncementBannerResource, + AsyncAnnouncementBannerResource, + AnnouncementBannerResourceWithRawResponse, + AsyncAnnouncementBannerResourceWithRawResponse, + AnnouncementBannerResourceWithStreamingResponse, + AsyncAnnouncementBannerResourceWithStreamingResponse, +) from .scim_configurations import ( ScimConfigurationsResource, AsyncScimConfigurationsResource, @@ -88,6 +96,10 @@ class OrganizationsResource(SyncAPIResource): + @cached_property + def announcement_banner(self) -> AnnouncementBannerResource: + return AnnouncementBannerResource(self._client) + @cached_property def custom_domains(self) -> CustomDomainsResource: return CustomDomainsResource(self._client) @@ -678,6 +690,10 @@ def set_role( class AsyncOrganizationsResource(AsyncAPIResource): + @cached_property + def announcement_banner(self) -> AsyncAnnouncementBannerResource: + return AsyncAnnouncementBannerResource(self._client) + @cached_property def custom_domains(self) -> AsyncCustomDomainsResource: return AsyncCustomDomainsResource(self._client) @@ -1296,6 +1312,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def announcement_banner(self) -> AnnouncementBannerResourceWithRawResponse: + return AnnouncementBannerResourceWithRawResponse(self._organizations.announcement_banner) + @cached_property def custom_domains(self) -> CustomDomainsResourceWithRawResponse: return CustomDomainsResourceWithRawResponse(self._organizations.custom_domains) @@ -1350,6 +1370,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def announcement_banner(self) -> AsyncAnnouncementBannerResourceWithRawResponse: + return AsyncAnnouncementBannerResourceWithRawResponse(self._organizations.announcement_banner) + @cached_property def custom_domains(self) -> AsyncCustomDomainsResourceWithRawResponse: return AsyncCustomDomainsResourceWithRawResponse(self._organizations.custom_domains) @@ -1404,6 +1428,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def announcement_banner(self) -> AnnouncementBannerResourceWithStreamingResponse: + return AnnouncementBannerResourceWithStreamingResponse(self._organizations.announcement_banner) + @cached_property def custom_domains(self) -> CustomDomainsResourceWithStreamingResponse: return CustomDomainsResourceWithStreamingResponse(self._organizations.custom_domains) @@ -1458,6 +1486,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def announcement_banner(self) -> AsyncAnnouncementBannerResourceWithStreamingResponse: + return AsyncAnnouncementBannerResourceWithStreamingResponse(self._organizations.announcement_banner) + @cached_property def custom_domains(self) -> AsyncCustomDomainsResourceWithStreamingResponse: return AsyncCustomDomainsResourceWithStreamingResponse(self._organizations.custom_domains) diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index 60c60ebe..a0d0c8ff 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -7,6 +7,7 @@ from .provider_type import ProviderType as ProviderType from .sso_configuration import SSOConfiguration as SSOConfiguration from .scim_configuration import ScimConfiguration as ScimConfiguration +from .announcement_banner import AnnouncementBanner as AnnouncementBanner from .crowd_strike_config import CrowdStrikeConfig as CrowdStrikeConfig from .domain_verification import DomainVerification as DomainVerification from .organization_invite import OrganizationInvite as OrganizationInvite @@ -31,15 +32,18 @@ from .custom_domain_retrieve_params import CustomDomainRetrieveParams as CustomDomainRetrieveParams from .custom_domain_update_response import CustomDomainUpdateResponse as CustomDomainUpdateResponse from .sso_configuration_list_params import SSOConfigurationListParams as SSOConfigurationListParams +from .announcement_banner_get_params import AnnouncementBannerGetParams as AnnouncementBannerGetParams from .scim_configuration_list_params import ScimConfigurationListParams as ScimConfigurationListParams from .custom_domain_retrieve_response import CustomDomainRetrieveResponse as CustomDomainRetrieveResponse from .domain_verification_list_params import DomainVerificationListParams as DomainVerificationListParams from .sso_configuration_create_params import SSOConfigurationCreateParams as SSOConfigurationCreateParams from .sso_configuration_delete_params import SSOConfigurationDeleteParams as SSOConfigurationDeleteParams from .sso_configuration_update_params import SSOConfigurationUpdateParams as SSOConfigurationUpdateParams +from .announcement_banner_get_response import AnnouncementBannerGetResponse as AnnouncementBannerGetResponse from .scim_configuration_create_params import ScimConfigurationCreateParams as ScimConfigurationCreateParams from .scim_configuration_delete_params import ScimConfigurationDeleteParams as ScimConfigurationDeleteParams from .scim_configuration_update_params import ScimConfigurationUpdateParams as ScimConfigurationUpdateParams +from .announcement_banner_update_params import AnnouncementBannerUpdateParams as AnnouncementBannerUpdateParams from .domain_verification_create_params import DomainVerificationCreateParams as DomainVerificationCreateParams from .domain_verification_delete_params import DomainVerificationDeleteParams as DomainVerificationDeleteParams from .domain_verification_verify_params import DomainVerificationVerifyParams as DomainVerificationVerifyParams @@ -48,6 +52,7 @@ from .scim_configuration_create_response import ScimConfigurationCreateResponse as ScimConfigurationCreateResponse from .scim_configuration_retrieve_params import ScimConfigurationRetrieveParams as ScimConfigurationRetrieveParams from .scim_configuration_update_response import ScimConfigurationUpdateResponse as ScimConfigurationUpdateResponse +from .announcement_banner_update_response import AnnouncementBannerUpdateResponse as AnnouncementBannerUpdateResponse from .domain_verification_create_response import DomainVerificationCreateResponse as DomainVerificationCreateResponse from .domain_verification_retrieve_params import DomainVerificationRetrieveParams as DomainVerificationRetrieveParams from .domain_verification_verify_response import DomainVerificationVerifyResponse as DomainVerificationVerifyResponse diff --git a/src/gitpod/types/organizations/announcement_banner.py b/src/gitpod/types/organizations/announcement_banner.py new file mode 100644 index 00000000..299540a9 --- /dev/null +++ b/src/gitpod/types/organizations/announcement_banner.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["AnnouncementBanner"] + + +class AnnouncementBanner(BaseModel): + organization_id: str = FieldInfo(alias="organizationId") + """organization_id is the ID of the organization""" + + enabled: Optional[bool] = None + """enabled controls whether the banner is displayed""" + + message: Optional[str] = None + """message is the banner message displayed to users. Supports basic Markdown.""" diff --git a/src/gitpod/types/organizations/announcement_banner_get_params.py b/src/gitpod/types/organizations/announcement_banner_get_params.py new file mode 100644 index 00000000..59c75b8f --- /dev/null +++ b/src/gitpod/types/organizations/announcement_banner_get_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["AnnouncementBannerGetParams"] + + +class AnnouncementBannerGetParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization""" diff --git a/src/gitpod/types/organizations/announcement_banner_get_response.py b/src/gitpod/types/organizations/announcement_banner_get_response.py new file mode 100644 index 00000000..da432404 --- /dev/null +++ b/src/gitpod/types/organizations/announcement_banner_get_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel +from .announcement_banner import AnnouncementBanner + +__all__ = ["AnnouncementBannerGetResponse"] + + +class AnnouncementBannerGetResponse(BaseModel): + banner: AnnouncementBanner + """banner is the announcement banner configuration""" diff --git a/src/gitpod/types/organizations/announcement_banner_update_params.py b/src/gitpod/types/organizations/announcement_banner_update_params.py new file mode 100644 index 00000000..7dfe53fb --- /dev/null +++ b/src/gitpod/types/organizations/announcement_banner_update_params.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["AnnouncementBannerUpdateParams"] + + +class AnnouncementBannerUpdateParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization""" + + enabled: Optional[bool] + """enabled controls whether the banner is displayed""" + + message: Optional[str] + """message is the banner message. + + Supports basic Markdown. Maximum 1000 characters. + """ diff --git a/src/gitpod/types/organizations/announcement_banner_update_response.py b/src/gitpod/types/organizations/announcement_banner_update_response.py new file mode 100644 index 00000000..d4701890 --- /dev/null +++ b/src/gitpod/types/organizations/announcement_banner_update_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel +from .announcement_banner import AnnouncementBanner + +__all__ = ["AnnouncementBannerUpdateResponse"] + + +class AnnouncementBannerUpdateResponse(BaseModel): + banner: AnnouncementBanner + """banner is the updated announcement banner configuration""" diff --git a/tests/api_resources/organizations/test_announcement_banner.py b/tests/api_resources/organizations/test_announcement_banner.py new file mode 100644 index 00000000..2e1c5b8e --- /dev/null +++ b/tests/api_resources/organizations/test_announcement_banner.py @@ -0,0 +1,183 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.organizations import ( + AnnouncementBannerGetResponse, + AnnouncementBannerUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAnnouncementBanner: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Gitpod) -> None: + announcement_banner = client.organizations.announcement_banner.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + announcement_banner = client.organizations.announcement_banner.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + enabled=False, + message="message", + ) + assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.organizations.announcement_banner.with_raw_response.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + announcement_banner = response.parse() + assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.organizations.announcement_banner.with_streaming_response.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + announcement_banner = response.parse() + assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get(self, client: Gitpod) -> None: + announcement_banner = client.organizations.announcement_banner.get( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_get(self, client: Gitpod) -> None: + response = client.organizations.announcement_banner.with_raw_response.get( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + announcement_banner = response.parse() + assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_get(self, client: Gitpod) -> None: + with client.organizations.announcement_banner.with_streaming_response.get( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + announcement_banner = response.parse() + assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncAnnouncementBanner: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + announcement_banner = await async_client.organizations.announcement_banner.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + announcement_banner = await async_client.organizations.announcement_banner.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + enabled=False, + message="message", + ) + assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.announcement_banner.with_raw_response.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + announcement_banner = await response.parse() + assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.announcement_banner.with_streaming_response.update( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + announcement_banner = await response.parse() + assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get(self, async_client: AsyncGitpod) -> None: + announcement_banner = await async_client.organizations.announcement_banner.get( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.announcement_banner.with_raw_response.get( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + announcement_banner = await response.parse() + assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.announcement_banner.with_streaming_response.get( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + announcement_banner = await response.parse() + assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) + + assert cast(Any, response.is_closed) is True From 672ef8ca833dcdf02c80e7e3536a779c20ab006e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 10:54:17 +0000 Subject: [PATCH 276/505] feat(api): implement GetAnnouncementBanner and UpdateAnnouncementBanner handlers --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_type.py | 1 + src/gitpod/types/shared_params/resource_type.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eb5040a7..ac19f875 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b1f3c630c150b9219800d95b3bb4df29bede775d34f46fc2eb3af34cb91110b5.yml -openapi_spec_hash: 49ece69cbfc81e6172f62a7542b2541a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7a8e71d8c69a12f718bf1357225cab2970088b6b35f2980569ae4f459cb235a3.yml +openapi_spec_hash: 5bc62dbddf307449c2ae1f43503725fd config_hash: dad4ee53c894c682895d6d045c4c2105 diff --git a/src/gitpod/types/shared/resource_type.py b/src/gitpod/types/shared/resource_type.py index 599108b9..dd44b4e4 100644 --- a/src/gitpod/types/shared/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -50,4 +50,5 @@ "RESOURCE_TYPE_WEBHOOK", "RESOURCE_TYPE_SCIM_CONFIGURATION", "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET", + "RESOURCE_TYPE_ANNOUNCEMENT_BANNER", ] diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py index 9d489e4d..6b260e83 100644 --- a/src/gitpod/types/shared_params/resource_type.py +++ b/src/gitpod/types/shared_params/resource_type.py @@ -52,4 +52,5 @@ "RESOURCE_TYPE_WEBHOOK", "RESOURCE_TYPE_SCIM_CONFIGURATION", "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET", + "RESOURCE_TYPE_ANNOUNCEMENT_BANNER", ] From 92233dba7c950989f71d95faa2a7d0b31f954326 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 10:56:14 +0000 Subject: [PATCH 277/505] feat(api): add filters to ListPrebuilds for inventory page --- .stats.yml | 4 ++-- src/gitpod/types/prebuild_list_params.py | 10 ++++++++++ tests/api_resources/test_prebuilds.py | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ac19f875..7817249f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7a8e71d8c69a12f718bf1357225cab2970088b6b35f2980569ae4f459cb235a3.yml -openapi_spec_hash: 5bc62dbddf307449c2ae1f43503725fd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-37c2e5cd0ac1442c376f5744c957f93ef39c3baf64b5443b99296a937f79889b.yml +openapi_spec_hash: e4e981e4d61a227ca326eb776e81c6d0 config_hash: dad4ee53c894c682895d6d045c4c2105 diff --git a/src/gitpod/types/prebuild_list_params.py b/src/gitpod/types/prebuild_list_params.py index 59075354..68931404 100644 --- a/src/gitpod/types/prebuild_list_params.py +++ b/src/gitpod/types/prebuild_list_params.py @@ -8,6 +8,7 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo from .prebuild_phase import PrebuildPhase +from .prebuild_trigger import PrebuildTrigger __all__ = ["PrebuildListParams", "Filter", "Pagination"] @@ -27,12 +28,21 @@ class PrebuildListParams(TypedDict, total=False): class Filter(TypedDict, total=False): """filter contains the filter options for listing prebuilds""" + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] + """creator_ids filters prebuilds by who created them""" + + executor_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="executorIds")] + """executor_ids filters prebuilds by whose credentials were used to run them""" + phases: List[PrebuildPhase] """phases filters prebuilds by their current phase""" project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] """project_ids filters prebuilds to specific projects""" + triggered_by: Annotated[List[PrebuildTrigger], PropertyInfo(alias="triggeredBy")] + """triggered_by filters prebuilds by how they were triggered""" + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing prebuilds""" diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py index 258dcef1..8d1518e7 100644 --- a/tests/api_resources/test_prebuilds.py +++ b/tests/api_resources/test_prebuilds.py @@ -122,8 +122,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "phases": ["PREBUILD_PHASE_UNSPECIFIED"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "triggered_by": ["PREBUILD_TRIGGER_UNSPECIFIED"], }, pagination={ "token": "token", @@ -360,8 +363,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "phases": ["PREBUILD_PHASE_UNSPECIFIED"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "triggered_by": ["PREBUILD_TRIGGER_UNSPECIFIED"], }, pagination={ "token": "token", From d7d135bdf24d612a33d3f969b9205c203ae4afe9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:52:52 +0000 Subject: [PATCH 278/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7817249f..04dee8d3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-37c2e5cd0ac1442c376f5744c957f93ef39c3baf64b5443b99296a937f79889b.yml -openapi_spec_hash: e4e981e4d61a227ca326eb776e81c6d0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4a034f8dd3f618814ce17b264d78b40176f613d34f806f8add5425792e36c34d.yml +openapi_spec_hash: 5f1f4678b4956c4afa3ffc8539443ef7 config_hash: dad4ee53c894c682895d6d045c4c2105 From 8a030e1ebd63583a73415e1eb2f057c1fa642b1b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 18:18:36 +0000 Subject: [PATCH 279/505] chore(ci): upgrade `actions/github-script` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36b6d22c..e5fc12d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/gitpod-python' id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); From 22f643534e91ec5cf72ea8712c78e6b0da4e5ac1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 05:26:40 +0000 Subject: [PATCH 280/505] feat: Introduce projects admin org role --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_role.py | 1 + src/gitpod/types/shared_params/resource_role.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 04dee8d3..69e12976 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4a034f8dd3f618814ce17b264d78b40176f613d34f806f8add5425792e36c34d.yml -openapi_spec_hash: 5f1f4678b4956c4afa3ffc8539443ef7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2b59584e6f2208d43b822d9b2663f2fde4267d5c450f45e3dc71ff8d931b1cb2.yml +openapi_spec_hash: f32f71e9a724ff4b52530544272a2f46 config_hash: dad4ee53c894c682895d6d045c4c2105 diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 33ecbb72..7672e1fb 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -9,6 +9,7 @@ "RESOURCE_ROLE_ORG_ADMIN", "RESOURCE_ROLE_ORG_MEMBER", "RESOURCE_ROLE_ORG_RUNNERS_ADMIN", + "RESOURCE_ROLE_ORG_PROJECTS_ADMIN", "RESOURCE_ROLE_GROUP_ADMIN", "RESOURCE_ROLE_GROUP_VIEWER", "RESOURCE_ROLE_USER_IDENTITY", diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index 053e9545..8dcf94cb 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -11,6 +11,7 @@ "RESOURCE_ROLE_ORG_ADMIN", "RESOURCE_ROLE_ORG_MEMBER", "RESOURCE_ROLE_ORG_RUNNERS_ADMIN", + "RESOURCE_ROLE_ORG_PROJECTS_ADMIN", "RESOURCE_ROLE_GROUP_ADMIN", "RESOURCE_ROLE_GROUP_VIEWER", "RESOURCE_ROLE_USER_IDENTITY", From 063f4444c18ca6b00f311900a4dc6b2ad18b21e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 08:58:42 +0000 Subject: [PATCH 281/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 69e12976..cea9e137 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2b59584e6f2208d43b822d9b2663f2fde4267d5c450f45e3dc71ff8d931b1cb2.yml -openapi_spec_hash: f32f71e9a724ff4b52530544272a2f46 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ac7e3ba3e07fad875460961471c263abe93f9971b034558faa5a0846c4fd4f2f.yml +openapi_spec_hash: 54bc57f020c614b93cab8d24671fb203 config_hash: dad4ee53c894c682895d6d045c4c2105 From 09a1c905e13e66d9e785e437a1eafc6b0a596777 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 10:00:36 +0000 Subject: [PATCH 282/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cea9e137..2d6bc6a5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ac7e3ba3e07fad875460961471c263abe93f9971b034558faa5a0846c4fd4f2f.yml -openapi_spec_hash: 54bc57f020c614b93cab8d24671fb203 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b85d561f28323dda832b888ad3ead86484bc492883f8cb3eaaf44334415cbe0c.yml +openapi_spec_hash: 2ca796526c9421c3162a69749305e5bf config_hash: dad4ee53c894c682895d6d045c4c2105 From 345cf249d75512036a1832cb7fcc4b70312ab41d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 10:57:03 +0000 Subject: [PATCH 283/505] feat(cli): add --name flag to environment create command --- .stats.yml | 4 +-- .../resources/environments/environments.py | 34 +++++++++++++++++-- .../environment_create_from_project_params.py | 7 ++++ src/gitpod/types/environment_create_params.py | 7 ++++ tests/api_resources/test_environments.py | 4 +++ 5 files changed, 52 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2d6bc6a5..354e22d8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b85d561f28323dda832b888ad3ead86484bc492883f8cb3eaaf44334415cbe0c.yml -openapi_spec_hash: 2ca796526c9421c3162a69749305e5bf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b43acdb0d7e591ca6dc119778dfc405afa6c4d5aeb43d06fc6aff9f941c552b6.yml +openapi_spec_hash: f52b33b13c9efa8f5941d40dc6315e80 config_hash: dad4ee53c894c682895d6d045c4c2105 diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 6de9f762..3f5defc8 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -91,6 +91,7 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: def create( self, *, + name: Optional[str] | Omit = omit, spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -164,6 +165,9 @@ def create( ``` Args: + name: name is a user-defined identifier for the environment. If not specified, the + system will generate a name. + spec: spec is the configuration of the environment that's required for the to start the environment @@ -177,7 +181,13 @@ def create( """ return self._post( "/gitpod.v1.EnvironmentService/CreateEnvironment", - body=maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), + body=maybe_transform( + { + "name": name, + "spec": spec, + }, + environment_create_params.EnvironmentCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -549,6 +559,7 @@ def create_environment_token( def create_from_project( self, *, + name: Optional[str] | Omit = omit, project_id: str | Omit = omit, spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -591,6 +602,9 @@ def create_from_project( ``` Args: + name: name is a user-defined identifier for the environment. If not specified, the + system will generate a name. + spec: Spec is the configuration of the environment that's required for the runner to start the environment Configuration already defined in the Project will override parts of the spec, if set @@ -607,6 +621,7 @@ def create_from_project( "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", body=maybe_transform( { + "name": name, "project_id": project_id, "spec": spec, }, @@ -905,6 +920,7 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo async def create( self, *, + name: Optional[str] | Omit = omit, spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -978,6 +994,9 @@ async def create( ``` Args: + name: name is a user-defined identifier for the environment. If not specified, the + system will generate a name. + spec: spec is the configuration of the environment that's required for the to start the environment @@ -991,7 +1010,13 @@ async def create( """ return await self._post( "/gitpod.v1.EnvironmentService/CreateEnvironment", - body=await async_maybe_transform({"spec": spec}, environment_create_params.EnvironmentCreateParams), + body=await async_maybe_transform( + { + "name": name, + "spec": spec, + }, + environment_create_params.EnvironmentCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1363,6 +1388,7 @@ async def create_environment_token( async def create_from_project( self, *, + name: Optional[str] | Omit = omit, project_id: str | Omit = omit, spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1405,6 +1431,9 @@ async def create_from_project( ``` Args: + name: name is a user-defined identifier for the environment. If not specified, the + system will generate a name. + spec: Spec is the configuration of the environment that's required for the runner to start the environment Configuration already defined in the Project will override parts of the spec, if set @@ -1421,6 +1450,7 @@ async def create_from_project( "/gitpod.v1.EnvironmentService/CreateEnvironmentFromProject", body=await async_maybe_transform( { + "name": name, "project_id": project_id, "spec": spec, }, diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index 2c9806f7..4a26228d 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -11,6 +12,12 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False): + name: Optional[str] + """ + name is a user-defined identifier for the environment. If not specified, the + system will generate a name. + """ + project_id: Annotated[str, PropertyInfo(alias="projectId")] spec: EnvironmentSpecParam diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index e49a7d27..d5c55e8e 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import TypedDict from .environment_spec_param import EnvironmentSpecParam @@ -10,6 +11,12 @@ class EnvironmentCreateParams(TypedDict, total=False): + name: Optional[str] + """ + name is a user-defined identifier for the environment. If not specified, the + system will generate a name. + """ + spec: EnvironmentSpecParam """ spec is the configuration of the environment that's required for the to start diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index b2a37f6f..c1e64421 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -36,6 +36,7 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( + name="name", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -387,6 +388,7 @@ def test_method_create_from_project(self, client: Gitpod) -> None: @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( + name="name", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", @@ -692,6 +694,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( + name="name", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -1043,6 +1046,7 @@ async def test_method_create_from_project(self, async_client: AsyncGitpod) -> No @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( + name="name", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", From 7a5de703aaae98c3255876ca6c6465c1bba1a020 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 15:35:39 +0000 Subject: [PATCH 284/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 354e22d8..5662495d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b43acdb0d7e591ca6dc119778dfc405afa6c4d5aeb43d06fc6aff9f941c552b6.yml -openapi_spec_hash: f52b33b13c9efa8f5941d40dc6315e80 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e4b65aac5cad420f0090e1925de4d9c576b7cae6e839120963c94b5b245e335.yml +openapi_spec_hash: ebc6921eaa311aaaff497646f16adf10 config_hash: dad4ee53c894c682895d6d045c4c2105 From 14a91aa8370e9fc58ed501583f16977c2d77f536 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 13:06:01 +0000 Subject: [PATCH 285/505] feat: [backend] Resource admin should be able to see all resource shares --- .stats.yml | 4 ++-- src/gitpod/types/groups/role_assignment_list_params.py | 8 ++++++++ tests/api_resources/groups/test_role_assignments.py | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5662495d..7bf05da0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e4b65aac5cad420f0090e1925de4d9c576b7cae6e839120963c94b5b245e335.yml -openapi_spec_hash: ebc6921eaa311aaaff497646f16adf10 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-23f7678921f123913793223b36eb15c9f483ec734e49f2ba25f771dba409e781.yml +openapi_spec_hash: cad5d5f46f759aea198ce46ba9c16aeb config_hash: dad4ee53c894c682895d6d045c4c2105 diff --git a/src/gitpod/types/groups/role_assignment_list_params.py b/src/gitpod/types/groups/role_assignment_list_params.py index 63b97bd1..52ceaacb 100644 --- a/src/gitpod/types/groups/role_assignment_list_params.py +++ b/src/gitpod/types/groups/role_assignment_list_params.py @@ -33,6 +33,14 @@ class Filter(TypedDict, total=False): Empty string is allowed and means no filtering by group """ + resource_id: Annotated[str, PropertyInfo(alias="resourceId")] + """ + resource_id filters the response to only role assignments for this specific + resource When provided, users with :grant permission on the resource can see its + role assignments even if they don't belong to the assigned groups Empty string + is allowed and means no filtering by resource + """ + resource_roles: Annotated[List[ResourceRole], PropertyInfo(alias="resourceRoles")] """ resource_roles filters the response to only role assignments with these specific diff --git a/tests/api_resources/groups/test_role_assignments.py b/tests/api_resources/groups/test_role_assignments.py index 23940822..a21be7e3 100644 --- a/tests/api_resources/groups/test_role_assignments.py +++ b/tests/api_resources/groups/test_role_assignments.py @@ -74,6 +74,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "group_id": "groupId", + "resource_id": "resourceId", "resource_roles": ["RESOURCE_ROLE_UNSPECIFIED"], "resource_types": ["RESOURCE_TYPE_RUNNER"], "user_id": "userId", @@ -202,6 +203,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "group_id": "groupId", + "resource_id": "resourceId", "resource_roles": ["RESOURCE_ROLE_UNSPECIFIED"], "resource_types": ["RESOURCE_TYPE_RUNNER"], "user_id": "userId", From 40ff6f90666abb5ef9c634194b40a6454b3f7b1b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 18:22:47 +0000 Subject: [PATCH 286/505] feat(runner): add capability check for ListSCMOrganizations --- .stats.yml | 4 ++-- src/gitpod/types/runner_capability.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7bf05da0..2fcbd42c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-23f7678921f123913793223b36eb15c9f483ec734e49f2ba25f771dba409e781.yml -openapi_spec_hash: cad5d5f46f759aea198ce46ba9c16aeb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f7bb80f4a382bf0cb03a48cd955c2f342cd4686874cb9f7b9ad93f92e2d18cd3.yml +openapi_spec_hash: 2557264a73db1a756fc118125e0df2a9 config_hash: dad4ee53c894c682895d6d045c4c2105 diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py index 36bb1f9b..be53db06 100644 --- a/src/gitpod/types/runner_capability.py +++ b/src/gitpod/types/runner_capability.py @@ -13,4 +13,6 @@ "RUNNER_CAPABILITY_DEFAULT_DEV_CONTAINER_IMAGE", "RUNNER_CAPABILITY_ENVIRONMENT_SNAPSHOT", "RUNNER_CAPABILITY_PREBUILDS_BEFORE_SNAPSHOT_TRIGGER", + "RUNNER_CAPABILITY_LIST_SCM_ORGANIZATIONS", + "RUNNER_CAPABILITY_CHECK_REPOSITORY_ACCESS", ] From 411522911a4357076d1779113e1afeb061455463 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 21:46:16 +0000 Subject: [PATCH 287/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2fcbd42c..4420dc0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f7bb80f4a382bf0cb03a48cd955c2f342cd4686874cb9f7b9ad93f92e2d18cd3.yml -openapi_spec_hash: 2557264a73db1a756fc118125e0df2a9 -config_hash: dad4ee53c894c682895d6d045c4c2105 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7162cd0506e2dffc69faa98d90ed024d399d1cf5bf07eb3eb13e5adac38402b2.yml +openapi_spec_hash: 900845b2595725d999cc97313c553f78 +config_hash: 61a10ac1c19e2a6506f9da8d8f8a105e From 1972bc1a04b3b6b1beb922a01dc57163da45a078 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:35:03 +0000 Subject: [PATCH 288/505] feat: [SCIM] Configurable token expiration duration --- .stats.yml | 4 +- .../organizations/scim_configurations.py | 78 +++++++++++++++++-- .../types/organizations/scim_configuration.py | 3 + .../scim_configuration_create_params.py | 6 ++ .../scim_configuration_create_response.py | 5 ++ ...m_configuration_regenerate_token_params.py | 7 ++ ...configuration_regenerate_token_response.py | 7 ++ .../organizations/test_scim_configurations.py | 20 +++++ 8 files changed, 122 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4420dc0a..cb487452 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7162cd0506e2dffc69faa98d90ed024d399d1cf5bf07eb3eb13e5adac38402b2.yml -openapi_spec_hash: 900845b2595725d999cc97313c553f78 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cc01e9c2ffeff54bdab399a593a4acd28e453872b55f5c63abfb1349e0e8cc56.yml +openapi_spec_hash: 7d97d74ff265e0d6062b16094a289974 config_hash: 61a10ac1c19e2a6506f9da8d8f8a105e diff --git a/src/gitpod/resources/organizations/scim_configurations.py b/src/gitpod/resources/organizations/scim_configurations.py index 529ae165..6176c402 100644 --- a/src/gitpod/resources/organizations/scim_configurations.py +++ b/src/gitpod/resources/organizations/scim_configurations.py @@ -61,6 +61,7 @@ def create( organization_id: str, sso_configuration_id: str, name: Optional[str] | Omit = omit, + token_expires_in: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -81,13 +82,24 @@ def create( - Create basic SCIM configuration: - Creates a SCIM configuration linked to an SSO provider. + Creates a SCIM configuration linked to an SSO provider with default 1 year + token expiration. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` + - Create SCIM configuration with custom token expiration: + + Creates a SCIM configuration with a 90-day token expiration. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + tokenExpiresIn: "7776000s" + ``` + Args: organization_id: organization_id is the ID of the organization to create the SCIM configuration for @@ -97,6 +109,9 @@ def create( name: name is a human-readable name for the SCIM configuration + token_expires_in: token_expires_in is the duration until the token expires. Defaults to 1 year. + Minimum 1 day, maximum 2 years. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -112,6 +127,7 @@ def create( "organization_id": organization_id, "sso_configuration_id": sso_configuration_id, "name": name, + "token_expires_in": token_expires_in, }, scim_configuration_create_params.ScimConfigurationCreateParams, ), @@ -373,6 +389,7 @@ def regenerate_token( self, *, scim_configuration_id: str, + token_expires_in: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -393,16 +410,29 @@ def regenerate_token( - Regenerate token: - Creates a new bearer token, invalidating the old one. + Creates a new bearer token with the same expiration duration as the previous + token. ```yaml scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` + - Regenerate token with new expiration: + + Creates a new bearer token with a custom 180-day expiration. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + tokenExpiresIn: "15552000s" + ``` + Args: scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to regenerate token for + token_expires_in: token_expires_in is the duration until the new token expires. If not specified, + uses the same duration as the previous token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -414,7 +444,10 @@ def regenerate_token( return self._post( "/gitpod.v1.OrganizationService/RegenerateSCIMToken", body=maybe_transform( - {"scim_configuration_id": scim_configuration_id}, + { + "scim_configuration_id": scim_configuration_id, + "token_expires_in": token_expires_in, + }, scim_configuration_regenerate_token_params.ScimConfigurationRegenerateTokenParams, ), options=make_request_options( @@ -450,6 +483,7 @@ async def create( organization_id: str, sso_configuration_id: str, name: Optional[str] | Omit = omit, + token_expires_in: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -470,13 +504,24 @@ async def create( - Create basic SCIM configuration: - Creates a SCIM configuration linked to an SSO provider. + Creates a SCIM configuration linked to an SSO provider with default 1 year + token expiration. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` + - Create SCIM configuration with custom token expiration: + + Creates a SCIM configuration with a 90-day token expiration. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + tokenExpiresIn: "7776000s" + ``` + Args: organization_id: organization_id is the ID of the organization to create the SCIM configuration for @@ -486,6 +531,9 @@ async def create( name: name is a human-readable name for the SCIM configuration + token_expires_in: token_expires_in is the duration until the token expires. Defaults to 1 year. + Minimum 1 day, maximum 2 years. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -501,6 +549,7 @@ async def create( "organization_id": organization_id, "sso_configuration_id": sso_configuration_id, "name": name, + "token_expires_in": token_expires_in, }, scim_configuration_create_params.ScimConfigurationCreateParams, ), @@ -762,6 +811,7 @@ async def regenerate_token( self, *, scim_configuration_id: str, + token_expires_in: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -782,16 +832,29 @@ async def regenerate_token( - Regenerate token: - Creates a new bearer token, invalidating the old one. + Creates a new bearer token with the same expiration duration as the previous + token. ```yaml scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` + - Regenerate token with new expiration: + + Creates a new bearer token with a custom 180-day expiration. + + ```yaml + scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + tokenExpiresIn: "15552000s" + ``` + Args: scim_configuration_id: scim_configuration_id is the ID of the SCIM configuration to regenerate token for + token_expires_in: token_expires_in is the duration until the new token expires. If not specified, + uses the same duration as the previous token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -803,7 +866,10 @@ async def regenerate_token( return await self._post( "/gitpod.v1.OrganizationService/RegenerateSCIMToken", body=await async_maybe_transform( - {"scim_configuration_id": scim_configuration_id}, + { + "scim_configuration_id": scim_configuration_id, + "token_expires_in": token_expires_in, + }, scim_configuration_regenerate_token_params.ScimConfigurationRegenerateTokenParams, ), options=make_request_options( diff --git a/src/gitpod/types/organizations/scim_configuration.py b/src/gitpod/types/organizations/scim_configuration.py index 289db0f5..8b12ff05 100644 --- a/src/gitpod/types/organizations/scim_configuration.py +++ b/src/gitpod/types/organizations/scim_configuration.py @@ -24,6 +24,9 @@ class ScimConfiguration(BaseModel): organization_id is the ID of the organization this SCIM configuration belongs to """ + token_expires_at: datetime = FieldInfo(alias="tokenExpiresAt") + """token_expires_at is when the current SCIM token expires""" + updated_at: datetime = FieldInfo(alias="updatedAt") """updated_at is when the SCIM configuration was last updated""" diff --git a/src/gitpod/types/organizations/scim_configuration_create_params.py b/src/gitpod/types/organizations/scim_configuration_create_params.py index fae33808..e8f5a2ee 100644 --- a/src/gitpod/types/organizations/scim_configuration_create_params.py +++ b/src/gitpod/types/organizations/scim_configuration_create_params.py @@ -25,3 +25,9 @@ class ScimConfigurationCreateParams(TypedDict, total=False): name: Optional[str] """name is a human-readable name for the SCIM configuration""" + + token_expires_in: Annotated[Optional[str], PropertyInfo(alias="tokenExpiresIn")] + """token_expires_in is the duration until the token expires. Defaults to 1 year. + + Minimum 1 day, maximum 2 years. + """ diff --git a/src/gitpod/types/organizations/scim_configuration_create_response.py b/src/gitpod/types/organizations/scim_configuration_create_response.py index 95ba89b9..af949703 100644 --- a/src/gitpod/types/organizations/scim_configuration_create_response.py +++ b/src/gitpod/types/organizations/scim_configuration_create_response.py @@ -1,5 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from datetime import datetime + from pydantic import Field as FieldInfo from ..._models import BaseModel @@ -17,3 +19,6 @@ class ScimConfigurationCreateResponse(BaseModel): scim_configuration: ScimConfiguration = FieldInfo(alias="scimConfiguration") """scim_configuration is the created SCIM configuration""" + + token_expires_at: datetime = FieldInfo(alias="tokenExpiresAt") + """token_expires_at is when the token will expire""" diff --git a/src/gitpod/types/organizations/scim_configuration_regenerate_token_params.py b/src/gitpod/types/organizations/scim_configuration_regenerate_token_params.py index b6cedadf..42dc8056 100644 --- a/src/gitpod/types/organizations/scim_configuration_regenerate_token_params.py +++ b/src/gitpod/types/organizations/scim_configuration_regenerate_token_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -15,3 +16,9 @@ class ScimConfigurationRegenerateTokenParams(TypedDict, total=False): scim_configuration_id is the ID of the SCIM configuration to regenerate token for """ + + token_expires_in: Annotated[Optional[str], PropertyInfo(alias="tokenExpiresIn")] + """ + token_expires_in is the duration until the new token expires. If not specified, + uses the same duration as the previous token. + """ diff --git a/src/gitpod/types/organizations/scim_configuration_regenerate_token_response.py b/src/gitpod/types/organizations/scim_configuration_regenerate_token_response.py index 0af03b1e..16d79ab0 100644 --- a/src/gitpod/types/organizations/scim_configuration_regenerate_token_response.py +++ b/src/gitpod/types/organizations/scim_configuration_regenerate_token_response.py @@ -1,5 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from datetime import datetime + +from pydantic import Field as FieldInfo + from ..._models import BaseModel __all__ = ["ScimConfigurationRegenerateTokenResponse"] @@ -11,3 +15,6 @@ class ScimConfigurationRegenerateTokenResponse(BaseModel): token is the new bearer token for SCIM API authentication. This invalidates the previous token - store it securely. """ + + token_expires_at: datetime = FieldInfo(alias="tokenExpiresAt") + """token_expires_at is when the new token will expire""" diff --git a/tests/api_resources/organizations/test_scim_configurations.py b/tests/api_resources/organizations/test_scim_configurations.py index 16c6e252..4404e237 100644 --- a/tests/api_resources/organizations/test_scim_configurations.py +++ b/tests/api_resources/organizations/test_scim_configurations.py @@ -40,6 +40,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", name="name", + token_expires_in="+9125115.360s", ) assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) @@ -233,6 +234,15 @@ def test_method_regenerate_token(self, client: Gitpod) -> None: ) assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_regenerate_token_with_all_params(self, client: Gitpod) -> None: + scim_configuration = client.organizations.scim_configurations.regenerate_token( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + token_expires_in="+9125115.360s", + ) + assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_regenerate_token(self, client: Gitpod) -> None: @@ -281,6 +291,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", name="name", + token_expires_in="+9125115.360s", ) assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) @@ -474,6 +485,15 @@ async def test_method_regenerate_token(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_regenerate_token_with_all_params(self, async_client: AsyncGitpod) -> None: + scim_configuration = await async_client.organizations.scim_configurations.regenerate_token( + scim_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + token_expires_in="+9125115.360s", + ) + assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_regenerate_token(self, async_client: AsyncGitpod) -> None: From b8980e6922e1da821501c31ad261cc43858ce2ff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 13:28:11 +0000 Subject: [PATCH 289/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cb487452..7021534c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cc01e9c2ffeff54bdab399a593a4acd28e453872b55f5c63abfb1349e0e8cc56.yml -openapi_spec_hash: 7d97d74ff265e0d6062b16094a289974 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-95efb8e364af30d5c9a4972eb6d834df95697b08917ada62478aa37086f51e57.yml +openapi_spec_hash: 114d42f049c4bb734d3c2a923c603895 config_hash: 61a10ac1c19e2a6506f9da8d8f8a105e From 62230cd4c6f39ed78c9a272b6a0853b53f59b7dc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 14:54:14 +0000 Subject: [PATCH 290/505] feat(db): add service_account_tokens table --- .stats.yml | 6 +++--- src/gitpod/types/shared/resource_type.py | 1 + src/gitpod/types/shared_params/resource_type.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7021534c..25570169 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-95efb8e364af30d5c9a4972eb6d834df95697b08917ada62478aa37086f51e57.yml -openapi_spec_hash: 114d42f049c4bb734d3c2a923c603895 -config_hash: 61a10ac1c19e2a6506f9da8d8f8a105e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-888178c57cb0f9d7aede8f3fc5ec24bd62f619b728f00716f352b3b5a2fa306d.yml +openapi_spec_hash: 701f004e9dcb6dd3472d8468a789c338 +config_hash: 8758ac1f8d8913bd960a98b4f05d6391 diff --git a/src/gitpod/types/shared/resource_type.py b/src/gitpod/types/shared/resource_type.py index dd44b4e4..aca1888a 100644 --- a/src/gitpod/types/shared/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -51,4 +51,5 @@ "RESOURCE_TYPE_SCIM_CONFIGURATION", "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET", "RESOURCE_TYPE_ANNOUNCEMENT_BANNER", + "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN", ] diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py index 6b260e83..b5036ffd 100644 --- a/src/gitpod/types/shared_params/resource_type.py +++ b/src/gitpod/types/shared_params/resource_type.py @@ -53,4 +53,5 @@ "RESOURCE_TYPE_SCIM_CONFIGURATION", "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET", "RESOURCE_TYPE_ANNOUNCEMENT_BANNER", + "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN", ] From 85f545af017871e579756c2a41b061eac39ae48a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 17:07:12 +0000 Subject: [PATCH 291/505] feat(chat): add Pylon identity verification for chat widget --- .stats.yml | 8 +- api.md | 2 + src/gitpod/resources/accounts.py | 118 ++++++++++++++++++ src/gitpod/types/__init__.py | 6 + .../account_get_chat_identity_token_params.py | 11 ++ ...ccount_get_chat_identity_token_response.py | 15 +++ tests/api_resources/test_accounts.py | 73 +++++++++++ 7 files changed, 229 insertions(+), 4 deletions(-) create mode 100644 src/gitpod/types/account_get_chat_identity_token_params.py create mode 100644 src/gitpod/types/account_get_chat_identity_token_response.py diff --git a/.stats.yml b/.stats.yml index 25570169..1f254762 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-888178c57cb0f9d7aede8f3fc5ec24bd62f619b728f00716f352b3b5a2fa306d.yml -openapi_spec_hash: 701f004e9dcb6dd3472d8468a789c338 -config_hash: 8758ac1f8d8913bd960a98b4f05d6391 +configured_endpoints: 173 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-51c0e9db3fb9e3aadf35fb4fcf76107a2fcd9da1b8ff6cd593c1ae23d1a24bc3.yml +openapi_spec_hash: db222df8620e2270763bef95ff247445 +config_hash: 2fa5dd58c6ab4dd15de320fa0f85dde8 diff --git a/api.md b/api.md index 57eff1c5..a7861fc6 100644 --- a/api.md +++ b/api.md @@ -42,6 +42,7 @@ from gitpod.types import ( JoinableOrganization, LoginProvider, AccountRetrieveResponse, + AccountGetChatIdentityTokenResponse, AccountGetSSOLoginURLResponse, AccountListSSOLoginsResponse, ) @@ -51,6 +52,7 @@ Methods: - client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse - client.accounts.delete(\*\*params) -> object +- client.accounts.get_chat_identity_token(\*\*params) -> AccountGetChatIdentityTokenResponse - client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse - client.accounts.list_joinable_organizations(\*\*params) -> SyncJoinableOrganizationsPage[JoinableOrganization] - client.accounts.list_login_providers(\*\*params) -> SyncLoginProvidersPage[LoginProvider] diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 69b48155..275e61dd 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -12,6 +12,7 @@ account_list_sso_logins_params, account_get_sso_login_url_params, account_list_login_providers_params, + account_get_chat_identity_token_params, account_list_joinable_organizations_params, ) from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given @@ -38,6 +39,7 @@ from ..types.account_retrieve_response import AccountRetrieveResponse from ..types.account_list_sso_logins_response import AccountListSSOLoginsResponse from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse +from ..types.account_get_chat_identity_token_response import AccountGetChatIdentityTokenResponse __all__ = ["AccountsResource", "AsyncAccountsResource"] @@ -170,6 +172,58 @@ def delete( cast_to=object, ) + def get_chat_identity_token( + self, + *, + empty: bool | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AccountGetChatIdentityTokenResponse: + """ + Gets the chat identity token for the currently authenticated account. + + Use this method to: + + - Obtain a verification hash for in-app chat identity verification + - Secure chat sessions against impersonation + + The returned hash is an HMAC-SHA256 signature of the account's email, used by + the chat widget to verify user identity. + + ### Examples + + - Get chat identity token: + + Retrieves the identity verification hash for the authenticated account. + + ```yaml + {} + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AccountService/GetChatIdentityToken", + body=maybe_transform( + {"empty": empty}, account_get_chat_identity_token_params.AccountGetChatIdentityTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AccountGetChatIdentityTokenResponse, + ) + def get_sso_login_url( self, *, @@ -580,6 +634,58 @@ async def delete( cast_to=object, ) + async def get_chat_identity_token( + self, + *, + empty: bool | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AccountGetChatIdentityTokenResponse: + """ + Gets the chat identity token for the currently authenticated account. + + Use this method to: + + - Obtain a verification hash for in-app chat identity verification + - Secure chat sessions against impersonation + + The returned hash is an HMAC-SHA256 signature of the account's email, used by + the chat widget to verify user identity. + + ### Examples + + - Get chat identity token: + + Retrieves the identity verification hash for the authenticated account. + + ```yaml + {} + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AccountService/GetChatIdentityToken", + body=await async_maybe_transform( + {"empty": empty}, account_get_chat_identity_token_params.AccountGetChatIdentityTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AccountGetChatIdentityTokenResponse, + ) + async def get_sso_login_url( self, *, @@ -872,6 +978,9 @@ def __init__(self, accounts: AccountsResource) -> None: self.delete = to_raw_response_wrapper( accounts.delete, ) + self.get_chat_identity_token = to_raw_response_wrapper( + accounts.get_chat_identity_token, + ) self.get_sso_login_url = to_raw_response_wrapper( accounts.get_sso_login_url, ) @@ -896,6 +1005,9 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.delete = async_to_raw_response_wrapper( accounts.delete, ) + self.get_chat_identity_token = async_to_raw_response_wrapper( + accounts.get_chat_identity_token, + ) self.get_sso_login_url = async_to_raw_response_wrapper( accounts.get_sso_login_url, ) @@ -920,6 +1032,9 @@ def __init__(self, accounts: AccountsResource) -> None: self.delete = to_streamed_response_wrapper( accounts.delete, ) + self.get_chat_identity_token = to_streamed_response_wrapper( + accounts.get_chat_identity_token, + ) self.get_sso_login_url = to_streamed_response_wrapper( accounts.get_sso_login_url, ) @@ -944,6 +1059,9 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.delete = async_to_streamed_response_wrapper( accounts.delete, ) + self.get_chat_identity_token = async_to_streamed_response_wrapper( + accounts.get_chat_identity_token, + ) self.get_sso_login_url = async_to_streamed_response_wrapper( accounts.get_sso_login_url, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 4b195c70..45f7428a 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -227,6 +227,9 @@ from .runner_check_repository_access_params import ( RunnerCheckRepositoryAccessParams as RunnerCheckRepositoryAccessParams, ) +from .account_get_chat_identity_token_params import ( + AccountGetChatIdentityTokenParams as AccountGetChatIdentityTokenParams, +) from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, ) @@ -242,6 +245,9 @@ from .runner_check_repository_access_response import ( RunnerCheckRepositoryAccessResponse as RunnerCheckRepositoryAccessResponse, ) +from .account_get_chat_identity_token_response import ( + AccountGetChatIdentityTokenResponse as AccountGetChatIdentityTokenResponse, +) from .environment_create_from_project_response import ( EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, ) diff --git a/src/gitpod/types/account_get_chat_identity_token_params.py b/src/gitpod/types/account_get_chat_identity_token_params.py new file mode 100644 index 00000000..a63c4cca --- /dev/null +++ b/src/gitpod/types/account_get_chat_identity_token_params.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["AccountGetChatIdentityTokenParams"] + + +class AccountGetChatIdentityTokenParams(TypedDict, total=False): + empty: bool diff --git a/src/gitpod/types/account_get_chat_identity_token_response.py b/src/gitpod/types/account_get_chat_identity_token_response.py new file mode 100644 index 00000000..30e15a72 --- /dev/null +++ b/src/gitpod/types/account_get_chat_identity_token_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AccountGetChatIdentityTokenResponse"] + + +class AccountGetChatIdentityTokenResponse(BaseModel): + email_hash: str = FieldInfo(alias="emailHash") + """ + email_hash is the HMAC-SHA256 hash of the account's email address, used for chat + widget identity verification + """ diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 41f2192e..ff2f15a0 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -15,6 +15,7 @@ AccountRetrieveResponse, AccountListSSOLoginsResponse, AccountGetSSOLoginURLResponse, + AccountGetChatIdentityTokenResponse, ) from gitpod.pagination import ( SyncLoginsPage, @@ -110,6 +111,42 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_chat_identity_token(self, client: Gitpod) -> None: + account = client.accounts.get_chat_identity_token() + assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_chat_identity_token_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.get_chat_identity_token( + empty=True, + ) + assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_get_chat_identity_token(self, client: Gitpod) -> None: + response = client.accounts.with_raw_response.get_chat_identity_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = response.parse() + assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_get_chat_identity_token(self, client: Gitpod) -> None: + with client.accounts.with_streaming_response.get_chat_identity_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = response.parse() + assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: @@ -373,6 +410,42 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_chat_identity_token(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.get_chat_identity_token() + assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_chat_identity_token_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.get_chat_identity_token( + empty=True, + ) + assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_get_chat_identity_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.accounts.with_raw_response.get_chat_identity_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = await response.parse() + assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_get_chat_identity_token(self, async_client: AsyncGitpod) -> None: + async with async_client.accounts.with_streaming_response.get_chat_identity_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = await response.parse() + assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: From 1c590e7b781e4e2cb99000431bc27092763dd635 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 17:21:20 +0000 Subject: [PATCH 292/505] chore: update OpenAPI spec to e50946de8cddc549be7f7423903ad444632abce6 --- .stats.yml | 4 +- api.md | 2 - src/gitpod/resources/accounts.py | 118 ------------------ src/gitpod/types/__init__.py | 6 - .../account_get_chat_identity_token_params.py | 11 -- ...ccount_get_chat_identity_token_response.py | 15 --- tests/api_resources/test_accounts.py | 73 ----------- 7 files changed, 2 insertions(+), 227 deletions(-) delete mode 100644 src/gitpod/types/account_get_chat_identity_token_params.py delete mode 100644 src/gitpod/types/account_get_chat_identity_token_response.py diff --git a/.stats.yml b/.stats.yml index 1f254762..fd035636 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 173 +configured_endpoints: 172 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-51c0e9db3fb9e3aadf35fb4fcf76107a2fcd9da1b8ff6cd593c1ae23d1a24bc3.yml openapi_spec_hash: db222df8620e2270763bef95ff247445 -config_hash: 2fa5dd58c6ab4dd15de320fa0f85dde8 +config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/api.md b/api.md index a7861fc6..57eff1c5 100644 --- a/api.md +++ b/api.md @@ -42,7 +42,6 @@ from gitpod.types import ( JoinableOrganization, LoginProvider, AccountRetrieveResponse, - AccountGetChatIdentityTokenResponse, AccountGetSSOLoginURLResponse, AccountListSSOLoginsResponse, ) @@ -52,7 +51,6 @@ Methods: - client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse - client.accounts.delete(\*\*params) -> object -- client.accounts.get_chat_identity_token(\*\*params) -> AccountGetChatIdentityTokenResponse - client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse - client.accounts.list_joinable_organizations(\*\*params) -> SyncJoinableOrganizationsPage[JoinableOrganization] - client.accounts.list_login_providers(\*\*params) -> SyncLoginProvidersPage[LoginProvider] diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 275e61dd..69b48155 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -12,7 +12,6 @@ account_list_sso_logins_params, account_get_sso_login_url_params, account_list_login_providers_params, - account_get_chat_identity_token_params, account_list_joinable_organizations_params, ) from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given @@ -39,7 +38,6 @@ from ..types.account_retrieve_response import AccountRetrieveResponse from ..types.account_list_sso_logins_response import AccountListSSOLoginsResponse from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse -from ..types.account_get_chat_identity_token_response import AccountGetChatIdentityTokenResponse __all__ = ["AccountsResource", "AsyncAccountsResource"] @@ -172,58 +170,6 @@ def delete( cast_to=object, ) - def get_chat_identity_token( - self, - *, - empty: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AccountGetChatIdentityTokenResponse: - """ - Gets the chat identity token for the currently authenticated account. - - Use this method to: - - - Obtain a verification hash for in-app chat identity verification - - Secure chat sessions against impersonation - - The returned hash is an HMAC-SHA256 signature of the account's email, used by - the chat widget to verify user identity. - - ### Examples - - - Get chat identity token: - - Retrieves the identity verification hash for the authenticated account. - - ```yaml - {} - ``` - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._post( - "/gitpod.v1.AccountService/GetChatIdentityToken", - body=maybe_transform( - {"empty": empty}, account_get_chat_identity_token_params.AccountGetChatIdentityTokenParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=AccountGetChatIdentityTokenResponse, - ) - def get_sso_login_url( self, *, @@ -634,58 +580,6 @@ async def delete( cast_to=object, ) - async def get_chat_identity_token( - self, - *, - empty: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AccountGetChatIdentityTokenResponse: - """ - Gets the chat identity token for the currently authenticated account. - - Use this method to: - - - Obtain a verification hash for in-app chat identity verification - - Secure chat sessions against impersonation - - The returned hash is an HMAC-SHA256 signature of the account's email, used by - the chat widget to verify user identity. - - ### Examples - - - Get chat identity token: - - Retrieves the identity verification hash for the authenticated account. - - ```yaml - {} - ``` - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._post( - "/gitpod.v1.AccountService/GetChatIdentityToken", - body=await async_maybe_transform( - {"empty": empty}, account_get_chat_identity_token_params.AccountGetChatIdentityTokenParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=AccountGetChatIdentityTokenResponse, - ) - async def get_sso_login_url( self, *, @@ -978,9 +872,6 @@ def __init__(self, accounts: AccountsResource) -> None: self.delete = to_raw_response_wrapper( accounts.delete, ) - self.get_chat_identity_token = to_raw_response_wrapper( - accounts.get_chat_identity_token, - ) self.get_sso_login_url = to_raw_response_wrapper( accounts.get_sso_login_url, ) @@ -1005,9 +896,6 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.delete = async_to_raw_response_wrapper( accounts.delete, ) - self.get_chat_identity_token = async_to_raw_response_wrapper( - accounts.get_chat_identity_token, - ) self.get_sso_login_url = async_to_raw_response_wrapper( accounts.get_sso_login_url, ) @@ -1032,9 +920,6 @@ def __init__(self, accounts: AccountsResource) -> None: self.delete = to_streamed_response_wrapper( accounts.delete, ) - self.get_chat_identity_token = to_streamed_response_wrapper( - accounts.get_chat_identity_token, - ) self.get_sso_login_url = to_streamed_response_wrapper( accounts.get_sso_login_url, ) @@ -1059,9 +944,6 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.delete = async_to_streamed_response_wrapper( accounts.delete, ) - self.get_chat_identity_token = async_to_streamed_response_wrapper( - accounts.get_chat_identity_token, - ) self.get_sso_login_url = async_to_streamed_response_wrapper( accounts.get_sso_login_url, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 45f7428a..4b195c70 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -227,9 +227,6 @@ from .runner_check_repository_access_params import ( RunnerCheckRepositoryAccessParams as RunnerCheckRepositoryAccessParams, ) -from .account_get_chat_identity_token_params import ( - AccountGetChatIdentityTokenParams as AccountGetChatIdentityTokenParams, -) from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, ) @@ -245,9 +242,6 @@ from .runner_check_repository_access_response import ( RunnerCheckRepositoryAccessResponse as RunnerCheckRepositoryAccessResponse, ) -from .account_get_chat_identity_token_response import ( - AccountGetChatIdentityTokenResponse as AccountGetChatIdentityTokenResponse, -) from .environment_create_from_project_response import ( EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, ) diff --git a/src/gitpod/types/account_get_chat_identity_token_params.py b/src/gitpod/types/account_get_chat_identity_token_params.py deleted file mode 100644 index a63c4cca..00000000 --- a/src/gitpod/types/account_get_chat_identity_token_params.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["AccountGetChatIdentityTokenParams"] - - -class AccountGetChatIdentityTokenParams(TypedDict, total=False): - empty: bool diff --git a/src/gitpod/types/account_get_chat_identity_token_response.py b/src/gitpod/types/account_get_chat_identity_token_response.py deleted file mode 100644 index 30e15a72..00000000 --- a/src/gitpod/types/account_get_chat_identity_token_response.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["AccountGetChatIdentityTokenResponse"] - - -class AccountGetChatIdentityTokenResponse(BaseModel): - email_hash: str = FieldInfo(alias="emailHash") - """ - email_hash is the HMAC-SHA256 hash of the account's email address, used for chat - widget identity verification - """ diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index ff2f15a0..41f2192e 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -15,7 +15,6 @@ AccountRetrieveResponse, AccountListSSOLoginsResponse, AccountGetSSOLoginURLResponse, - AccountGetChatIdentityTokenResponse, ) from gitpod.pagination import ( SyncLoginsPage, @@ -111,42 +110,6 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - def test_method_get_chat_identity_token(self, client: Gitpod) -> None: - account = client.accounts.get_chat_identity_token() - assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - def test_method_get_chat_identity_token_with_all_params(self, client: Gitpod) -> None: - account = client.accounts.get_chat_identity_token( - empty=True, - ) - assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - def test_raw_response_get_chat_identity_token(self, client: Gitpod) -> None: - response = client.accounts.with_raw_response.get_chat_identity_token() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account = response.parse() - assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - def test_streaming_response_get_chat_identity_token(self, client: Gitpod) -> None: - with client.accounts.with_streaming_response.get_chat_identity_token() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account = response.parse() - assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) - - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: @@ -410,42 +373,6 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - async def test_method_get_chat_identity_token(self, async_client: AsyncGitpod) -> None: - account = await async_client.accounts.get_chat_identity_token() - assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - async def test_method_get_chat_identity_token_with_all_params(self, async_client: AsyncGitpod) -> None: - account = await async_client.accounts.get_chat_identity_token( - empty=True, - ) - assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - async def test_raw_response_get_chat_identity_token(self, async_client: AsyncGitpod) -> None: - response = await async_client.accounts.with_raw_response.get_chat_identity_token() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account = await response.parse() - assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - async def test_streaming_response_get_chat_identity_token(self, async_client: AsyncGitpod) -> None: - async with async_client.accounts.with_streaming_response.get_chat_identity_token() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account = await response.parse() - assert_matches_type(AccountGetChatIdentityTokenResponse, account, path=["response"]) - - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: From 8f53eceac38641307a8e3d0d60846314b16c5139 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 29 Jan 2026 09:14:41 +0000 Subject: [PATCH 293/505] feat(types): add RoleAssignment value to ResourceType enum --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_type.py | 1 + src/gitpod/types/shared_params/resource_type.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fd035636..a8492aa2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-51c0e9db3fb9e3aadf35fb4fcf76107a2fcd9da1b8ff6cd593c1ae23d1a24bc3.yml -openapi_spec_hash: db222df8620e2270763bef95ff247445 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-871abe56c856169257435fbf85a09a3c075c2677671282c92606590e0a1bfc54.yml +openapi_spec_hash: 7d0d7816110fc899f755a9d39770c044 config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/types/shared/resource_type.py b/src/gitpod/types/shared/resource_type.py index aca1888a..9bd2c135 100644 --- a/src/gitpod/types/shared/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -52,4 +52,5 @@ "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET", "RESOURCE_TYPE_ANNOUNCEMENT_BANNER", "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN", + "RESOURCE_TYPE_ROLE_ASSIGNMENT", ] diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py index b5036ffd..19a20e40 100644 --- a/src/gitpod/types/shared_params/resource_type.py +++ b/src/gitpod/types/shared_params/resource_type.py @@ -54,4 +54,5 @@ "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET", "RESOURCE_TYPE_ANNOUNCEMENT_BANNER", "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN", + "RESOURCE_TYPE_ROLE_ASSIGNMENT", ] From 604537c684f7cf0140dc74675fe0d8bfa31546d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 29 Jan 2026 13:07:17 +0000 Subject: [PATCH 294/505] feat(api): add dev_runner_id to agents, dev_environment_id and provider to runners --- .stats.yml | 4 ++-- src/gitpod/resources/agents.py | 12 ++++++++++++ src/gitpod/types/agent_start_execution_params.py | 7 +++++++ src/gitpod/types/runner_provider.py | 1 + tests/api_resources/test_agents.py | 2 ++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a8492aa2..dbb17fb2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-871abe56c856169257435fbf85a09a3c075c2677671282c92606590e0a1bfc54.yml -openapi_spec_hash: 7d0d7816110fc899f755a9d39770c044 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-700cd47eae87ca42bbbdc8b39e84e864226d169f0c369f414680f9eda694d3a5.yml +openapi_spec_hash: 9364ced18661e420a15fb1be5203da4b config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/resources/agents.py b/src/gitpod/resources/agents.py index 9c2e9d18..eaea47ce 100644 --- a/src/gitpod/resources/agents.py +++ b/src/gitpod/resources/agents.py @@ -540,6 +540,7 @@ def start_execution( code_context: AgentCodeContextParam | Omit = omit, mode: AgentMode | Omit = omit, name: str | Omit = omit, + runner_id: str | Omit = omit, workflow_action_id: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -569,6 +570,10 @@ def start_execution( mode: mode specifies the operational mode for this agent execution If not specified, defaults to AGENT_MODE_EXECUTION + runner_id: runner_id specifies a runner for this agent execution. When set, the agent + execution is routed to this runner instead of the runner associated with the + environment. + workflow_action_id: workflow_action_id is an optional reference to the workflow execution action that created this agent execution. Used for tracking and event correlation. @@ -588,6 +593,7 @@ def start_execution( "code_context": code_context, "mode": mode, "name": name, + "runner_id": runner_id, "workflow_action_id": workflow_action_id, }, agent_start_execution_params.AgentStartExecutionParams, @@ -1194,6 +1200,7 @@ async def start_execution( code_context: AgentCodeContextParam | Omit = omit, mode: AgentMode | Omit = omit, name: str | Omit = omit, + runner_id: str | Omit = omit, workflow_action_id: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1223,6 +1230,10 @@ async def start_execution( mode: mode specifies the operational mode for this agent execution If not specified, defaults to AGENT_MODE_EXECUTION + runner_id: runner_id specifies a runner for this agent execution. When set, the agent + execution is routed to this runner instead of the runner associated with the + environment. + workflow_action_id: workflow_action_id is an optional reference to the workflow execution action that created this agent execution. Used for tracking and event correlation. @@ -1242,6 +1253,7 @@ async def start_execution( "code_context": code_context, "mode": mode, "name": name, + "runner_id": runner_id, "workflow_action_id": workflow_action_id, }, agent_start_execution_params.AgentStartExecutionParams, diff --git a/src/gitpod/types/agent_start_execution_params.py b/src/gitpod/types/agent_start_execution_params.py index b021f7ed..83308be6 100644 --- a/src/gitpod/types/agent_start_execution_params.py +++ b/src/gitpod/types/agent_start_execution_params.py @@ -25,6 +25,13 @@ class AgentStartExecutionParams(TypedDict, total=False): name: str + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """ + runner_id specifies a runner for this agent execution. When set, the agent + execution is routed to this runner instead of the runner associated with the + environment. + """ + workflow_action_id: Annotated[Optional[str], PropertyInfo(alias="workflowActionId")] """ workflow_action_id is an optional reference to the workflow execution action diff --git a/src/gitpod/types/runner_provider.py b/src/gitpod/types/runner_provider.py index f0730df4..4d40404b 100644 --- a/src/gitpod/types/runner_provider.py +++ b/src/gitpod/types/runner_provider.py @@ -11,4 +11,5 @@ "RUNNER_PROVIDER_DESKTOP_MAC", "RUNNER_PROVIDER_MANAGED", "RUNNER_PROVIDER_GCP", + "RUNNER_PROVIDER_DEV_AGENT", ] diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index e006c3cf..98229f19 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -438,6 +438,7 @@ def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: }, mode="AGENT_MODE_UNSPECIFIED", name="name", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) @@ -963,6 +964,7 @@ async def test_method_start_execution_with_all_params(self, async_client: AsyncG }, mode="AGENT_MODE_UNSPECIFIED", name="name", + runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) From 8aa64783102f0b3313e899918ecddf3a5b8d450e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:33:56 +0000 Subject: [PATCH 295/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index dbb17fb2..0b009358 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-700cd47eae87ca42bbbdc8b39e84e864226d169f0c369f414680f9eda694d3a5.yml -openapi_spec_hash: 9364ced18661e420a15fb1be5203da4b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-00ba82d543cfbd7d43712fb508d286a0a07b2aad1c6edf8084d794a903b09e3b.yml +openapi_spec_hash: 381d9164ae462351125af601e9f5c951 config_hash: ad1db65b32248aecda41b64586aac9ce From fa659c2b134ccb7e50df644dbdfea2c20dd627a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:57:44 +0000 Subject: [PATCH 296/505] feat(client): add custom JSON encoder for extended type support --- src/gitpod/_base_client.py | 7 +- src/gitpod/_compat.py | 6 +- src/gitpod/_utils/_json.py | 35 ++++++++++ tests/test_utils/test_json.py | 126 ++++++++++++++++++++++++++++++++++ 4 files changed, 169 insertions(+), 5 deletions(-) create mode 100644 src/gitpod/_utils/_json.py create mode 100644 tests/test_utils/test_json.py diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index e6ccedfa..cc7f8af2 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -86,6 +86,7 @@ APIConnectionError, APIResponseValidationError, ) +from ._utils._json import openapi_dumps log: logging.Logger = logging.getLogger(__name__) @@ -554,8 +555,10 @@ def _build_request( kwargs["content"] = options.content elif isinstance(json_data, bytes): kwargs["content"] = json_data - else: - kwargs["json"] = json_data if is_given(json_data) else None + elif not files: + # Don't set content when JSON is sent as multipart/form-data, + # since httpx's content param overrides other body arguments + kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/gitpod/_compat.py b/src/gitpod/_compat.py index bdef67f0..786ff42a 100644 --- a/src/gitpod/_compat.py +++ b/src/gitpod/_compat.py @@ -139,6 +139,7 @@ def model_dump( exclude_defaults: bool = False, warnings: bool = True, mode: Literal["json", "python"] = "python", + by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( @@ -148,13 +149,12 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, + by_alias=by_alias, ) return cast( "dict[str, Any]", model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - exclude=exclude, - exclude_unset=exclude_unset, - exclude_defaults=exclude_defaults, + exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias) ), ) diff --git a/src/gitpod/_utils/_json.py b/src/gitpod/_utils/_json.py new file mode 100644 index 00000000..60584214 --- /dev/null +++ b/src/gitpod/_utils/_json.py @@ -0,0 +1,35 @@ +import json +from typing import Any +from datetime import datetime +from typing_extensions import override + +import pydantic + +from .._compat import model_dump + + +def openapi_dumps(obj: Any) -> bytes: + """ + Serialize an object to UTF-8 encoded JSON bytes. + + Extends the standard json.dumps with support for additional types + commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc. + """ + return json.dumps( + obj, + cls=_CustomEncoder, + # Uses the same defaults as httpx's JSON serialization + ensure_ascii=False, + separators=(",", ":"), + allow_nan=False, + ).encode() + + +class _CustomEncoder(json.JSONEncoder): + @override + def default(self, o: Any) -> Any: + if isinstance(o, datetime): + return o.isoformat() + if isinstance(o, pydantic.BaseModel): + return model_dump(o, exclude_unset=True, mode="json", by_alias=True) + return super().default(o) diff --git a/tests/test_utils/test_json.py b/tests/test_utils/test_json.py new file mode 100644 index 00000000..28f61d20 --- /dev/null +++ b/tests/test_utils/test_json.py @@ -0,0 +1,126 @@ +from __future__ import annotations + +import datetime +from typing import Union + +import pydantic + +from gitpod import _compat +from gitpod._utils._json import openapi_dumps + + +class TestOpenapiDumps: + def test_basic(self) -> None: + data = {"key": "value", "number": 42} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"key":"value","number":42}' + + def test_datetime_serialization(self) -> None: + dt = datetime.datetime(2023, 1, 1, 12, 0, 0) + data = {"datetime": dt} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"datetime":"2023-01-01T12:00:00"}' + + def test_pydantic_model_serialization(self) -> None: + class User(pydantic.BaseModel): + first_name: str + last_name: str + age: int + + model_instance = User(first_name="John", last_name="Kramer", age=83) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"first_name":"John","last_name":"Kramer","age":83}}' + + def test_pydantic_model_with_default_values(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + score: int = 0 + + model_instance = User(name="Alice") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Alice"}}' + + def test_pydantic_model_with_default_values_overridden(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + + model_instance = User(name="Bob", role="admin", active=False) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Bob","role":"admin","active":false}}' + + def test_pydantic_model_with_alias(self) -> None: + class User(pydantic.BaseModel): + first_name: str = pydantic.Field(alias="firstName") + last_name: str = pydantic.Field(alias="lastName") + + model_instance = User(firstName="John", lastName="Doe") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"firstName":"John","lastName":"Doe"}}' + + def test_pydantic_model_with_alias_and_default(self) -> None: + class User(pydantic.BaseModel): + user_name: str = pydantic.Field(alias="userName") + user_role: str = pydantic.Field(default="member", alias="userRole") + is_active: bool = pydantic.Field(default=True, alias="isActive") + + model_instance = User(userName="charlie") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"charlie"}}' + + model_with_overrides = User(userName="diana", userRole="admin", isActive=False) + data = {"model": model_with_overrides} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"diana","userRole":"admin","isActive":false}}' + + def test_pydantic_model_with_nested_models_and_defaults(self) -> None: + class Address(pydantic.BaseModel): + street: str + city: str = "Unknown" + + class User(pydantic.BaseModel): + name: str + address: Address + verified: bool = False + + if _compat.PYDANTIC_V1: + # to handle forward references in Pydantic v1 + User.update_forward_refs(**locals()) # type: ignore[reportDeprecated] + + address = Address(street="123 Main St") + user = User(name="Diana", address=address) + data = {"user": user} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"user":{"name":"Diana","address":{"street":"123 Main St"}}}' + + address_with_city = Address(street="456 Oak Ave", city="Boston") + user_verified = User(name="Eve", address=address_with_city, verified=True) + data = {"user": user_verified} + json_bytes = openapi_dumps(data) + assert ( + json_bytes == b'{"user":{"name":"Eve","address":{"street":"456 Oak Ave","city":"Boston"},"verified":true}}' + ) + + def test_pydantic_model_with_optional_fields(self) -> None: + class User(pydantic.BaseModel): + name: str + email: Union[str, None] + phone: Union[str, None] + + model_with_none = User(name="Eve", email=None, phone=None) + data = {"model": model_with_none} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Eve","email":null,"phone":null}}' + + model_with_values = User(name="Frank", email="frank@example.com", phone=None) + data = {"model": model_with_values} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Frank","email":"frank@example.com","phone":null}}' From e20400517eca35649e2da0b6d94165f4b723193e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 29 Jan 2026 19:19:57 +0000 Subject: [PATCH 297/505] feat(agent): add annotations field to AgentExecution --- .stats.yml | 4 ++-- src/gitpod/resources/agents.py | 14 +++++++++++++- src/gitpod/types/agent_execution.py | 3 +++ src/gitpod/types/agent_list_executions_params.py | 9 ++++++++- src/gitpod/types/agent_start_execution_params.py | 9 ++++++++- tests/api_resources/test_agents.py | 4 ++++ 6 files changed, 38 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0b009358..bb139273 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-00ba82d543cfbd7d43712fb508d286a0a07b2aad1c6edf8084d794a903b09e3b.yml -openapi_spec_hash: 381d9164ae462351125af601e9f5c951 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e77dd932e4cfde041f712e0e130d6075754e2f5893bca0a03ee5cd0734b35089.yml +openapi_spec_hash: faa844cfe771c3762e3a4d79b476cebf config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/resources/agents.py b/src/gitpod/resources/agents.py index eaea47ce..3206d8ce 100644 --- a/src/gitpod/resources/agents.py +++ b/src/gitpod/resources/agents.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional import httpx @@ -537,6 +537,7 @@ def start_execution( self, *, agent_id: str | Omit = omit, + annotations: Dict[str, str] | Omit = omit, code_context: AgentCodeContextParam | Omit = omit, mode: AgentMode | Omit = omit, name: str | Omit = omit, @@ -567,6 +568,10 @@ def start_execution( ``` Args: + annotations: annotations are key-value pairs for tracking external context (e.g., Linear + session IDs, GitHub issue references). Keys should follow domain/name convention + (e.g., "linear.app/session-id"). + mode: mode specifies the operational mode for this agent execution If not specified, defaults to AGENT_MODE_EXECUTION @@ -590,6 +595,7 @@ def start_execution( body=maybe_transform( { "agent_id": agent_id, + "annotations": annotations, "code_context": code_context, "mode": mode, "name": name, @@ -1197,6 +1203,7 @@ async def start_execution( self, *, agent_id: str | Omit = omit, + annotations: Dict[str, str] | Omit = omit, code_context: AgentCodeContextParam | Omit = omit, mode: AgentMode | Omit = omit, name: str | Omit = omit, @@ -1227,6 +1234,10 @@ async def start_execution( ``` Args: + annotations: annotations are key-value pairs for tracking external context (e.g., Linear + session IDs, GitHub issue references). Keys should follow domain/name convention + (e.g., "linear.app/session-id"). + mode: mode specifies the operational mode for this agent execution If not specified, defaults to AGENT_MODE_EXECUTION @@ -1250,6 +1261,7 @@ async def start_execution( body=await async_maybe_transform( { "agent_id": agent_id, + "annotations": annotations, "code_context": code_context, "mode": mode, "name": name, diff --git a/src/gitpod/types/agent_execution.py b/src/gitpod/types/agent_execution.py index ad119381..4e4cd903 100644 --- a/src/gitpod/types/agent_execution.py +++ b/src/gitpod/types/agent_execution.py @@ -31,6 +31,9 @@ class Metadata(BaseModel): parts of Gitpod to function """ + annotations: Optional[Dict[str, str]] = None + """annotations are key-value pairs for tracking external context.""" + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local diff --git a/src/gitpod/types/agent_list_executions_params.py b/src/gitpod/types/agent_list_executions_params.py index 3a613411..f01aef28 100644 --- a/src/gitpod/types/agent_list_executions_params.py +++ b/src/gitpod/types/agent_list_executions_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List +from typing import Dict, List from typing_extensions import Literal, Annotated, TypedDict from .._types import SequenceNotStr @@ -24,6 +24,13 @@ class AgentListExecutionsParams(TypedDict, total=False): class Filter(TypedDict, total=False): agent_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="agentIds")] + annotations: Dict[str, str] + """annotations filters by key-value pairs. + + Only executions containing all specified annotations (with matching values) are + returned. + """ + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] environment_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentIds")] diff --git a/src/gitpod/types/agent_start_execution_params.py b/src/gitpod/types/agent_start_execution_params.py index 83308be6..4d9f640a 100644 --- a/src/gitpod/types/agent_start_execution_params.py +++ b/src/gitpod/types/agent_start_execution_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -15,6 +15,13 @@ class AgentStartExecutionParams(TypedDict, total=False): agent_id: Annotated[str, PropertyInfo(alias="agentId")] + annotations: Dict[str, str] + """ + annotations are key-value pairs for tracking external context (e.g., Linear + session IDs, GitHub issue references). Keys should follow domain/name convention + (e.g., "linear.app/session-id"). + """ + code_context: Annotated[AgentCodeContextParam, PropertyInfo(alias="codeContext")] mode: AgentMode diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 98229f19..979d8ae1 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -192,6 +192,7 @@ def test_method_list_executions_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "agent_ids": ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"], + "annotations": {"foo": "string"}, "creator_ids": ["string"], "environment_ids": ["string"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -412,6 +413,7 @@ def test_method_start_execution(self, client: Gitpod) -> None: def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: agent = client.agents.start_execution( agent_id="b8a64cfa-43e2-4b9d-9fb3-07edc63f5971", + annotations={"foo": "string"}, code_context={ "context_url": { "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -718,6 +720,7 @@ async def test_method_list_executions_with_all_params(self, async_client: AsyncG page_size=0, filter={ "agent_ids": ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"], + "annotations": {"foo": "string"}, "creator_ids": ["string"], "environment_ids": ["string"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -938,6 +941,7 @@ async def test_method_start_execution(self, async_client: AsyncGitpod) -> None: async def test_method_start_execution_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.start_execution( agent_id="b8a64cfa-43e2-4b9d-9fb3-07edc63f5971", + annotations={"foo": "string"}, code_context={ "context_url": { "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", From b87a3ff5781b84bb3f28550ef8f8ed660798c48a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 10:05:48 +0000 Subject: [PATCH 298/505] feat(api): add derivedFromOrgRole field to RoleAssignment --- .stats.yml | 4 ++-- src/gitpod/types/groups/role_assignment.py | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bb139273..09bb7b1a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e77dd932e4cfde041f712e0e130d6075754e2f5893bca0a03ee5cd0734b35089.yml -openapi_spec_hash: faa844cfe771c3762e3a4d79b476cebf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-92cecb570bf9966e9dc5cff1eedd2981a57121b013aa3b79d6b955d011e72e7e.yml +openapi_spec_hash: 2adc05896eb8bdc68ca146d1a84666d1 config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/types/groups/role_assignment.py b/src/gitpod/types/groups/role_assignment.py index 39512d04..89733094 100644 --- a/src/gitpod/types/groups/role_assignment.py +++ b/src/gitpod/types/groups/role_assignment.py @@ -17,6 +17,14 @@ class RoleAssignment(BaseModel): id: Optional[str] = None """Unique identifier for the role assignment""" + derived_from_org_role: Optional[ResourceRole] = FieldInfo(alias="derivedFromOrgRole", default=None) + """ + The org-level role that created this assignment, if any. + RESOURCE_ROLE_UNSPECIFIED means this is a direct share (manually created). + Non-zero (e.g., ORG_PROJECTS_ADMIN, ORG_RUNNERS_ADMIN) means this assignment was + derived from an org-level role. + """ + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) """Group identifier""" From f816edae27a8d1a5e5a64b52b13614c09f44bb66 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:57:22 +0000 Subject: [PATCH 299/505] feat(api): add mcp_integrations field and type to agent_execution --- .stats.yml | 4 +-- src/gitpod/types/agent_execution.py | 42 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 09bb7b1a..218acd87 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-92cecb570bf9966e9dc5cff1eedd2981a57121b013aa3b79d6b955d011e72e7e.yml -openapi_spec_hash: 2adc05896eb8bdc68ca146d1a84666d1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-09dc2c5238bcddd171d21ef3307566abc18e4958934f00e7331b8123a40d7f56.yml +openapi_spec_hash: 79e5524d84ea8e44eb2bde551eb9f3af config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/types/agent_execution.py b/src/gitpod/types/agent_execution.py index 4e4cd903..9c71cd3f 100644 --- a/src/gitpod/types/agent_execution.py +++ b/src/gitpod/types/agent_execution.py @@ -20,6 +20,7 @@ "StatusCurrentOperation", "StatusCurrentOperationLlm", "StatusCurrentOperationToolUse", + "StatusMcpIntegrationStatus", "StatusOutputs", "StatusUsedEnvironment", ] @@ -296,6 +297,39 @@ class StatusCurrentOperation(BaseModel): tool_use: Optional[StatusCurrentOperationToolUse] = FieldInfo(alias="toolUse", default=None) +class StatusMcpIntegrationStatus(BaseModel): + """ + MCPIntegrationStatus represents the status of a single MCP integration + within an agent execution context + """ + + id: Optional[str] = None + """id is the unique name of the MCP integration""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """ + failure_message contains the reason the MCP integration failed to connect or + operate + """ + + name: Optional[str] = None + """name is the unique name of the MCP integration (e.g., "linear", "notion")""" + + phase: Optional[ + Literal[ + "MCP_INTEGRATION_PHASE_UNSPECIFIED", + "MCP_INTEGRATION_PHASE_INITIALIZING", + "MCP_INTEGRATION_PHASE_READY", + "MCP_INTEGRATION_PHASE_FAILED", + "MCP_INTEGRATION_PHASE_UNAVAILABLE", + ] + ] = None + """phase is the current connection/health phase""" + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings (e.g., rate limiting, degraded performance)""" + + class StatusOutputs(BaseModel): bool_value: Optional[bool] = FieldInfo(alias="boolValue", default=None) @@ -355,6 +389,14 @@ class Status(BaseModel): judgement: Optional[str] = None """judgement is the judgement of the agent run produced by the judgement prompt.""" + mcp_integration_statuses: Optional[List[StatusMcpIntegrationStatus]] = FieldInfo( + alias="mcpIntegrationStatuses", default=None + ) + """ + mcp_integration_statuses contains the status of all MCP integrations used by + this agent execution + """ + mode: Optional[AgentMode] = None """ mode is the current operational mode of the agent execution. This is set by the From 33322f85c86cd4c11773f16c1075d15c27e2286e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:05:40 +0000 Subject: [PATCH 300/505] feat(api): add user_ids filter to organization list members method --- .stats.yml | 4 ++-- src/gitpod/types/organization_list_members_params.py | 4 ++++ tests/api_resources/test_organizations.py | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 218acd87..d76713e9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-09dc2c5238bcddd171d21ef3307566abc18e4958934f00e7331b8123a40d7f56.yml -openapi_spec_hash: 79e5524d84ea8e44eb2bde551eb9f3af +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8045c2fdd23dfc0829570bd933443e57b57b0960cc9ab24641aeb17a32af1181.yml +openapi_spec_hash: 70dd24a3356591fe5cc9eabec6efb7e3 config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 2e5f87ec..797d2777 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -5,6 +5,7 @@ from typing import List from typing_extensions import Literal, Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .shared.user_status import UserStatus from .shared.organization_role import OrganizationRole @@ -45,6 +46,9 @@ class Filter(TypedDict, total=False): statuses: List[UserStatus] """status filters members by their user status""" + user_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="userIds")] + """user_ids filters the response to only members with the specified user IDs""" + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing members""" diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index b404eb78..0bc4e4f9 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -270,6 +270,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: "roles": ["ORGANIZATION_ROLE_UNSPECIFIED"], "search": "search", "statuses": ["USER_STATUS_UNSPECIFIED"], + "user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", @@ -607,6 +608,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp "roles": ["ORGANIZATION_ROLE_UNSPECIFIED"], "search": "search", "statuses": ["USER_STATUS_UNSPECIFIED"], + "user_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ "token": "token", From 1cc432189f85e9bcc97e79b980a9b2525da1f105 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:15:02 +0000 Subject: [PATCH 301/505] feat(api): add ResourceRoleOrgAutomationsAdmin to ResourceRole enum --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_role.py | 1 + src/gitpod/types/shared_params/resource_role.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d76713e9..53b7b15a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8045c2fdd23dfc0829570bd933443e57b57b0960cc9ab24641aeb17a32af1181.yml -openapi_spec_hash: 70dd24a3356591fe5cc9eabec6efb7e3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-634e8b0ac8d6d0dd5b5a27d882bbbb1d41c51fc3a07e5da82f3f500b667aef54.yml +openapi_spec_hash: 70acf81c08d9692320671c10e7675114 config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 7672e1fb..6c12ed9f 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -10,6 +10,7 @@ "RESOURCE_ROLE_ORG_MEMBER", "RESOURCE_ROLE_ORG_RUNNERS_ADMIN", "RESOURCE_ROLE_ORG_PROJECTS_ADMIN", + "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN", "RESOURCE_ROLE_GROUP_ADMIN", "RESOURCE_ROLE_GROUP_VIEWER", "RESOURCE_ROLE_USER_IDENTITY", diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index 8dcf94cb..f481fd72 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -12,6 +12,7 @@ "RESOURCE_ROLE_ORG_MEMBER", "RESOURCE_ROLE_ORG_RUNNERS_ADMIN", "RESOURCE_ROLE_ORG_PROJECTS_ADMIN", + "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN", "RESOURCE_ROLE_GROUP_ADMIN", "RESOURCE_ROLE_GROUP_VIEWER", "RESOURCE_ROLE_USER_IDENTITY", From 5fd244c5436b5c365d6bc48c2f7db9e011c63028 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:50:28 +0000 Subject: [PATCH 302/505] feat(api): add ResourceRoleOrgGroupsAdmin to ResourceRole enum --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_role.py | 1 + src/gitpod/types/shared_params/resource_role.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 53b7b15a..dfe50d7a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-634e8b0ac8d6d0dd5b5a27d882bbbb1d41c51fc3a07e5da82f3f500b667aef54.yml -openapi_spec_hash: 70acf81c08d9692320671c10e7675114 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-937b2430bb562a8d67dfcb55bbc8d815912d3b5f6baba1e656fdaa8dc4bc1124.yml +openapi_spec_hash: 669bf5b86f4300c4ac35e0836406aa72 config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 6c12ed9f..0f967e86 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -11,6 +11,7 @@ "RESOURCE_ROLE_ORG_RUNNERS_ADMIN", "RESOURCE_ROLE_ORG_PROJECTS_ADMIN", "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN", + "RESOURCE_ROLE_ORG_GROUPS_ADMIN", "RESOURCE_ROLE_GROUP_ADMIN", "RESOURCE_ROLE_GROUP_VIEWER", "RESOURCE_ROLE_USER_IDENTITY", diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index f481fd72..9ce41336 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -13,6 +13,7 @@ "RESOURCE_ROLE_ORG_RUNNERS_ADMIN", "RESOURCE_ROLE_ORG_PROJECTS_ADMIN", "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN", + "RESOURCE_ROLE_ORG_GROUPS_ADMIN", "RESOURCE_ROLE_GROUP_ADMIN", "RESOURCE_ROLE_GROUP_VIEWER", "RESOURCE_ROLE_USER_IDENTITY", From 1a58b9543ff7cce3c0cc55b8b8f9fc6a7765e366 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 31 Jan 2026 12:08:44 +0000 Subject: [PATCH 303/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index dfe50d7a..b27dde56 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-937b2430bb562a8d67dfcb55bbc8d815912d3b5f6baba1e656fdaa8dc4bc1124.yml -openapi_spec_hash: 669bf5b86f4300c4ac35e0836406aa72 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-79f80f60df3a294748b8bd8ce2a759ae08637fab58abdc467e1de7238113b593.yml +openapi_spec_hash: cfbaa294580b6dd5f05c7f3b360bf51a config_hash: ad1db65b32248aecda41b64586aac9ce From a879ab4cf8e842f5870bdb23ba86e518715c8648 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 16:00:36 +0000 Subject: [PATCH 304/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b27dde56..8ff03451 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-79f80f60df3a294748b8bd8ce2a759ae08637fab58abdc467e1de7238113b593.yml -openapi_spec_hash: cfbaa294580b6dd5f05c7f3b360bf51a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f63ed183567d574cc063cf415990670e949f058ebc27c8f5b58a66c88a47f1b9.yml +openapi_spec_hash: 7ef9fdbaf346bf292cd40344c35915e5 config_hash: ad1db65b32248aecda41b64586aac9ce From 2d76a8f9db419e6b6d71aad77f4aaf508ef48167 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 08:57:16 +0000 Subject: [PATCH 305/505] fix(api): reject double-slash prefix in secret file paths --- .stats.yml | 4 ++-- src/gitpod/resources/secrets.py | 8 ++++---- src/gitpod/types/secret_create_params.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8ff03451..41efbf5d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f63ed183567d574cc063cf415990670e949f058ebc27c8f5b58a66c88a47f1b9.yml -openapi_spec_hash: 7ef9fdbaf346bf292cd40344c35915e5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-95f4b5f46092288bbcb7239f4645a5c4a8bab207af478d684bda7b1824302249.yml +openapi_spec_hash: 71d0bd114741dc44f319186f1bb29388 config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 6367df25..915a0c79 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -126,10 +126,10 @@ def create( secret file_path: absolute path to the file where the secret is mounted value must be an absolute - path (start with a /): + path (e.g. /path/to/file): ``` - this.matches("^/(?:[^/]*/)*.*$") + this.matches("^/[^/].*$") ``` project_id: project_id is the ProjectID this Secret belongs to Deprecated: use scope instead @@ -502,10 +502,10 @@ async def create( secret file_path: absolute path to the file where the secret is mounted value must be an absolute - path (start with a /): + path (e.g. /path/to/file): ``` - this.matches("^/(?:[^/]*/)*.*$") + this.matches("^/[^/].*$") ``` project_id: project_id is the ProjectID this Secret belongs to Deprecated: use scope instead diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index 37c24627..99e545f3 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -33,10 +33,10 @@ class SecretCreateParams(TypedDict, total=False): file_path: Annotated[str, PropertyInfo(alias="filePath")] """ absolute path to the file where the secret is mounted value must be an absolute - path (start with a /): + path (e.g. /path/to/file): ``` - this.matches('^/(?:[^/]*/)*.*$') + this.matches('^/[^/].*$') ``` """ From 7318f59edcf427d24be0dd2b55edb054198db3a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 10:38:19 +0000 Subject: [PATCH 306/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 41efbf5d..600ece75 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-95f4b5f46092288bbcb7239f4645a5c4a8bab207af478d684bda7b1824302249.yml -openapi_spec_hash: 71d0bd114741dc44f319186f1bb29388 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-583526ba88a23fb4f201caf9cb943ec686266f6d1a3824236e02bd8b8d0ac88b.yml +openapi_spec_hash: b5136c37f676a08ed07e14b39621ccd3 config_hash: ad1db65b32248aecda41b64586aac9ce From d7089446177d5b6d45d50d71eb27375aa77fe41d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 10:28:01 +0000 Subject: [PATCH 307/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 600ece75..6d84536b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-583526ba88a23fb4f201caf9cb943ec686266f6d1a3824236e02bd8b8d0ac88b.yml -openapi_spec_hash: b5136c37f676a08ed07e14b39621ccd3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-faa2b30146fbefb03cdd7d90cb77db52433bf688ab4af666a08a8adecb0f7886.yml +openapi_spec_hash: 98830e3ab84b8b43d56688a9cc5dfea9 config_hash: ad1db65b32248aecda41b64586aac9ce From bb1b18f021186e0fd6343d6ba05047a5c078fb90 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 11:40:42 +0000 Subject: [PATCH 308/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6d84536b..9870600e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-faa2b30146fbefb03cdd7d90cb77db52433bf688ab4af666a08a8adecb0f7886.yml -openapi_spec_hash: 98830e3ab84b8b43d56688a9cc5dfea9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cc8d238990c3a71d86bf784c242d790e73221f81df4e7cba974b869981830040.yml +openapi_spec_hash: 0796d9a99d8468b8047be4adb0521554 config_hash: ad1db65b32248aecda41b64586aac9ce From fd89b30b4e37ebe370a08bc880bfa96470a387e0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 13:32:43 +0000 Subject: [PATCH 309/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9870600e..9637de44 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cc8d238990c3a71d86bf784c242d790e73221f81df4e7cba974b869981830040.yml -openapi_spec_hash: 0796d9a99d8468b8047be4adb0521554 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-07e6f884c2d7d3023e23fce3a09bf303ab5edfbcafa0a41d5737008adc146058.yml +openapi_spec_hash: 5e3806700798b135ab378ad69a3a59a8 config_hash: ad1db65b32248aecda41b64586aac9ce From 4b4f6c78eb26b09ad5b68741785cc5dfb3a50416 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 13:36:02 +0000 Subject: [PATCH 310/505] feat(api): add restrict_account_creation_to_scim field to organization policy --- .stats.yml | 4 ++-- src/gitpod/resources/organizations/policies.py | 12 ++++++++++++ .../types/organizations/organization_policies.py | 7 +++++++ .../types/organizations/policy_update_params.py | 7 +++++++ tests/api_resources/organizations/test_policies.py | 2 ++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9637de44..d6f9a147 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-07e6f884c2d7d3023e23fce3a09bf303ab5edfbcafa0a41d5737008adc146058.yml -openapi_spec_hash: 5e3806700798b135ab378ad69a3a59a8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3b3f2a4c16effce7e3d18cb37a6210edfe1b4abc64e73103cccea8314d8231da.yml +openapi_spec_hash: 32fa6acbed5a7465fbd93c939c81a78f config_hash: ad1db65b32248aecda41b64586aac9ce diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 93b785e9..506afa86 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -112,6 +112,7 @@ def update( members_require_projects: Optional[bool] | Omit = omit, port_sharing_disabled: Optional[bool] | Omit = omit, require_custom_domain_access: Optional[bool] | Omit = omit, + restrict_account_creation_to_scim: Optional[bool] | Omit = omit, security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -204,6 +205,10 @@ def update( require_custom_domain_access: require_custom_domain_access controls whether users must access via custom domain when one is configured. When true, access via app.gitpod.io is blocked. + restrict_account_creation_to_scim: restrict_account_creation_to_scim controls whether account creation is + restricted to SCIM-provisioned users only. When true and SCIM is configured for + the organization, only users provisioned via SCIM can create accounts. + security_agent_policy: security_agent_policy contains security agent configuration updates extra_headers: Send extra headers @@ -234,6 +239,7 @@ def update( "members_require_projects": members_require_projects, "port_sharing_disabled": port_sharing_disabled, "require_custom_domain_access": require_custom_domain_access, + "restrict_account_creation_to_scim": restrict_account_creation_to_scim, "security_agent_policy": security_agent_policy, }, policy_update_params.PolicyUpdateParams, @@ -336,6 +342,7 @@ async def update( members_require_projects: Optional[bool] | Omit = omit, port_sharing_disabled: Optional[bool] | Omit = omit, require_custom_domain_access: Optional[bool] | Omit = omit, + restrict_account_creation_to_scim: Optional[bool] | Omit = omit, security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -428,6 +435,10 @@ async def update( require_custom_domain_access: require_custom_domain_access controls whether users must access via custom domain when one is configured. When true, access via app.gitpod.io is blocked. + restrict_account_creation_to_scim: restrict_account_creation_to_scim controls whether account creation is + restricted to SCIM-provisioned users only. When true and SCIM is configured for + the organization, only users provisioned via SCIM can create accounts. + security_agent_policy: security_agent_policy contains security agent configuration updates extra_headers: Send extra headers @@ -458,6 +469,7 @@ async def update( "members_require_projects": members_require_projects, "port_sharing_disabled": port_sharing_disabled, "require_custom_domain_access": require_custom_domain_access, + "restrict_account_creation_to_scim": restrict_account_creation_to_scim, "security_agent_policy": security_agent_policy, }, policy_update_params.PolicyUpdateParams, diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py index e84968b0..8572da7c 100644 --- a/src/gitpod/types/organizations/organization_policies.py +++ b/src/gitpod/types/organizations/organization_policies.py @@ -87,6 +87,13 @@ class OrganizationPolicies(BaseModel): domain when one is configured. When true, access via app.gitpod.io is blocked. """ + restrict_account_creation_to_scim: bool = FieldInfo(alias="restrictAccountCreationToScim") + """ + restrict_account_creation_to_scim controls whether account creation is + restricted to SCIM-provisioned users only. When true and SCIM is configured for + the organization, only users provisioned via SCIM can create accounts. + """ + delete_archived_environments_after: Optional[str] = FieldInfo(alias="deleteArchivedEnvironmentsAfter", default=None) """ delete_archived_environments_after controls how long archived environments are diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index 6c5f5ebb..312bc12f 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -112,6 +112,13 @@ class PolicyUpdateParams(TypedDict, total=False): domain when one is configured. When true, access via app.gitpod.io is blocked. """ + restrict_account_creation_to_scim: Annotated[Optional[bool], PropertyInfo(alias="restrictAccountCreationToScim")] + """ + restrict_account_creation_to_scim controls whether account creation is + restricted to SCIM-provisioned users only. When true and SCIM is configured for + the organization, only users provisioned via SCIM can create accounts. + """ + security_agent_policy: Annotated[Optional[SecurityAgentPolicy], PropertyInfo(alias="securityAgentPolicy")] """security_agent_policy contains security agent configuration updates""" diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index eed1d45d..1d7ba27d 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -84,6 +84,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: members_require_projects=True, port_sharing_disabled=True, require_custom_domain_access=True, + restrict_account_creation_to_scim=True, security_agent_policy={ "crowdstrike": { "additional_options": {"foo": "string"}, @@ -195,6 +196,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> members_require_projects=True, port_sharing_disabled=True, require_custom_domain_access=True, + restrict_account_creation_to_scim=True, security_agent_policy={ "crowdstrike": { "additional_options": {"foo": "string"}, From 18fed6ddd2447254fe152fe60b03a2cde81b7311 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 09:27:30 +0000 Subject: [PATCH 311/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d6f9a147..9bdc4e44 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3b3f2a4c16effce7e3d18cb37a6210edfe1b4abc64e73103cccea8314d8231da.yml -openapi_spec_hash: 32fa6acbed5a7465fbd93c939c81a78f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-92fffd301d2d050355d06eafcfdba8fc4a702de6c27c624460355ad24c84efab.yml +openapi_spec_hash: 2f357ec436f18dd0437372e87c65d719 config_hash: ad1db65b32248aecda41b64586aac9ce From c6a758704007efaf137a640513f93c4d6138b75d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 11:02:43 +0000 Subject: [PATCH 312/505] feat(api): add port access methods and organization admission level to environments --- .stats.yml | 6 +++--- src/gitpod/types/admission_level.py | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9bdc4e44..b05bd288 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-92fffd301d2d050355d06eafcfdba8fc4a702de6c27c624460355ad24c84efab.yml -openapi_spec_hash: 2f357ec436f18dd0437372e87c65d719 -config_hash: ad1db65b32248aecda41b64586aac9ce +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-67c67966cd1e08521239198f80dc006070947f4b5d91b77aa44bc0412a419707.yml +openapi_spec_hash: 9684b4d6977a2d6f135246ba0dd65ec1 +config_hash: 2b9740817f5ef36649d603ece3a30906 diff --git a/src/gitpod/types/admission_level.py b/src/gitpod/types/admission_level.py index 40ee48da..cfa4ee41 100644 --- a/src/gitpod/types/admission_level.py +++ b/src/gitpod/types/admission_level.py @@ -5,5 +5,9 @@ __all__ = ["AdmissionLevel"] AdmissionLevel: TypeAlias = Literal[ - "ADMISSION_LEVEL_UNSPECIFIED", "ADMISSION_LEVEL_OWNER_ONLY", "ADMISSION_LEVEL_EVERYONE" + "ADMISSION_LEVEL_UNSPECIFIED", + "ADMISSION_LEVEL_OWNER_ONLY", + "ADMISSION_LEVEL_EVERYONE", + "ADMISSION_LEVEL_ORGANIZATION", + "ADMISSION_LEVEL_CREATOR_ONLY", ] From d8411808a40a172a11d8a33943c887aeaa7b4087 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 20:14:06 +0000 Subject: [PATCH 313/505] feat(api): add opus 4.6 model variants to agent supported models --- .stats.yml | 4 ++-- src/gitpod/types/agent_execution.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b05bd288..5677a7c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-67c67966cd1e08521239198f80dc006070947f4b5d91b77aa44bc0412a419707.yml -openapi_spec_hash: 9684b4d6977a2d6f135246ba0dd65ec1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-51659fa76fd9f1e88225f9cf97af0e2ebf5a675728618460693d7456c281f9a7.yml +openapi_spec_hash: 84d0520cf93175c6993b93c8d3be2677 config_hash: 2b9740817f5ef36649d603ece3a30906 diff --git a/src/gitpod/types/agent_execution.py b/src/gitpod/types/agent_execution.py index 9c71cd3f..ee64847f 100644 --- a/src/gitpod/types/agent_execution.py +++ b/src/gitpod/types/agent_execution.py @@ -440,6 +440,8 @@ class Status(BaseModel): "SUPPORTED_MODEL_OPUS_4_EXTENDED", "SUPPORTED_MODEL_OPUS_4_5", "SUPPORTED_MODEL_OPUS_4_5_EXTENDED", + "SUPPORTED_MODEL_OPUS_4_6", + "SUPPORTED_MODEL_OPUS_4_6_EXTENDED", "SUPPORTED_MODEL_OPENAI_4O", "SUPPORTED_MODEL_OPENAI_4O_MINI", "SUPPORTED_MODEL_OPENAI_O1", From be1b2e27377a0261577e42667d68f8e1e285c18a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 10:45:12 +0000 Subject: [PATCH 314/505] feat(api): add ExecutableDenyList to environment and organization policy --- .stats.yml | 6 +-- api.md | 3 ++ .../resources/organizations/policies.py | 11 +++++ src/gitpod/types/__init__.py | 4 ++ src/gitpod/types/environment_spec.py | 4 ++ src/gitpod/types/environment_spec_param.py | 4 ++ src/gitpod/types/environment_update_params.py | 4 ++ src/gitpod/types/kernel_controls_config.py | 15 ++++++ .../types/kernel_controls_config_param.py | 16 +++++++ src/gitpod/types/organizations/__init__.py | 2 + .../organizations/executable_deny_list.py | 19 ++++++++ .../executable_deny_list_param.py | 21 ++++++++ .../organizations/organization_policies.py | 7 +++ .../organizations/policy_update_params.py | 7 +++ src/gitpod/types/veto.py | 24 ++++++++++ src/gitpod/types/veto_param.py | 26 ++++++++++ .../organizations/test_policies.py | 12 ++++- tests/api_resources/test_environments.py | 48 +++++++++++++++++++ 18 files changed, 229 insertions(+), 4 deletions(-) create mode 100644 src/gitpod/types/kernel_controls_config.py create mode 100644 src/gitpod/types/kernel_controls_config_param.py create mode 100644 src/gitpod/types/organizations/executable_deny_list.py create mode 100644 src/gitpod/types/organizations/executable_deny_list_param.py create mode 100644 src/gitpod/types/veto.py create mode 100644 src/gitpod/types/veto_param.py diff --git a/.stats.yml b/.stats.yml index 5677a7c3..23314318 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-51659fa76fd9f1e88225f9cf97af0e2ebf5a675728618460693d7456c281f9a7.yml -openapi_spec_hash: 84d0520cf93175c6993b93c8d3be2677 -config_hash: 2b9740817f5ef36649d603ece3a30906 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-912e6f9f02b4b4e145bd8c12e8ea65422246fb626abedb150c9791065d9407c1.yml +openapi_spec_hash: e1ffa39323c616de827752550560ee7c +config_hash: 1666c4673215d2af73eb14329610e026 diff --git a/api.md b/api.md index 57eff1c5..319c9df2 100644 --- a/api.md +++ b/api.md @@ -121,6 +121,8 @@ from gitpod.types import ( EnvironmentRole, EnvironmentSpec, EnvironmentStatus, + KernelControlsConfig, + Veto, EnvironmentCreateResponse, EnvironmentRetrieveResponse, EnvironmentCreateEnvironmentTokenResponse, @@ -452,6 +454,7 @@ Types: from gitpod.types.organizations import ( AgentPolicy, CrowdStrikeConfig, + ExecutableDenyList, OrganizationPolicies, SecurityAgentPolicy, PolicyRetrieveResponse, diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 506afa86..01230196 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -19,6 +19,7 @@ from ..._base_client import make_request_options from ...types.organizations import policy_update_params, policy_retrieve_params from ...types.organizations.policy_retrieve_response import PolicyRetrieveResponse +from ...types.organizations.executable_deny_list_param import ExecutableDenyListParam __all__ = ["PoliciesResource", "AsyncPoliciesResource"] @@ -104,6 +105,7 @@ def update( default_environment_image: Optional[str] | Omit = omit, delete_archived_environments_after: Optional[str] | Omit = omit, editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, + executable_deny_list: Optional[ExecutableDenyListParam] | Omit = omit, maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, @@ -180,6 +182,9 @@ def update( editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy with allowed major versions. + executable_deny_list: executable_deny_list contains executables that are blocked from execution in + environments. + maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 seconds). @@ -231,6 +236,7 @@ def update( "default_environment_image": default_environment_image, "delete_archived_environments_after": delete_archived_environments_after, "editor_version_restrictions": editor_version_restrictions, + "executable_deny_list": executable_deny_list, "maximum_environment_lifetime": maximum_environment_lifetime, "maximum_environments_per_user": maximum_environments_per_user, "maximum_environment_timeout": maximum_environment_timeout, @@ -334,6 +340,7 @@ async def update( default_environment_image: Optional[str] | Omit = omit, delete_archived_environments_after: Optional[str] | Omit = omit, editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, + executable_deny_list: Optional[ExecutableDenyListParam] | Omit = omit, maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, @@ -410,6 +417,9 @@ async def update( editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy with allowed major versions. + executable_deny_list: executable_deny_list contains executables that are blocked from execution in + environments. + maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 seconds). @@ -461,6 +471,7 @@ async def update( "default_environment_image": default_environment_image, "delete_archived_environments_after": delete_archived_environments_after, "editor_version_restrictions": editor_version_restrictions, + "executable_deny_list": executable_deny_list, "maximum_environment_lifetime": maximum_environment_lifetime, "maximum_environments_per_user": maximum_environments_per_user, "maximum_environment_timeout": maximum_environment_timeout, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 4b195c70..b6f524e5 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .user import User as User +from .veto import Veto as Veto from .group import Group as Group from .editor import Editor as Editor from .prompt import Prompt as Prompt @@ -41,6 +42,7 @@ from .prebuild import Prebuild as Prebuild from .log_level import LogLevel as LogLevel from .agent_mode import AgentMode as AgentMode +from .veto_param import VetoParam as VetoParam from .environment import Environment as Environment from .error_level import ErrorLevel as ErrorLevel from .prompt_spec import PromptSpec as PromptSpec @@ -120,6 +122,7 @@ from .project_update_params import ProjectUpdateParams as ProjectUpdateParams from .editor_retrieve_params import EditorRetrieveParams as EditorRetrieveParams from .environment_spec_param import EnvironmentSpecParam as EnvironmentSpecParam +from .kernel_controls_config import KernelControlsConfig as KernelControlsConfig from .prebuild_cancel_params import PrebuildCancelParams as PrebuildCancelParams from .prebuild_create_params import PrebuildCreateParams as PrebuildCreateParams from .prebuild_delete_params import PrebuildDeleteParams as PrebuildDeleteParams @@ -184,6 +187,7 @@ from .agent_update_prompt_response import AgentUpdatePromptResponse as AgentUpdatePromptResponse from .environment_unarchive_params import EnvironmentUnarchiveParams as EnvironmentUnarchiveParams from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams +from .kernel_controls_config_param import KernelControlsConfigParam as KernelControlsConfigParam from .organization_create_response import OrganizationCreateResponse as OrganizationCreateResponse from .organization_retrieve_params import OrganizationRetrieveParams as OrganizationRetrieveParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index 679336f4..9d565a1a 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -8,6 +8,7 @@ from .._models import BaseModel from .admission_level import AdmissionLevel from .environment_phase import EnvironmentPhase +from .kernel_controls_config import KernelControlsConfig from .environment_initializer import EnvironmentInitializer from .shared.automation_trigger import AutomationTrigger @@ -209,6 +210,9 @@ class EnvironmentSpec(BaseModel): devcontainer: Optional[Devcontainer] = None """devcontainer is the devcontainer spec of the environment""" + kernel_controls_config: Optional[KernelControlsConfig] = FieldInfo(alias="kernelControlsConfig", default=None) + """kernel_controls_config configures kernel-level controls for this environment""" + machine: Optional[Machine] = None """machine is the machine spec of the environment""" diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index 3c10dbd3..dc8b41f0 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -8,6 +8,7 @@ from .._utils import PropertyInfo from .admission_level import AdmissionLevel from .environment_phase import EnvironmentPhase +from .kernel_controls_config_param import KernelControlsConfigParam from .environment_initializer_param import EnvironmentInitializerParam from .shared_params.automation_trigger import AutomationTrigger @@ -216,6 +217,9 @@ class EnvironmentSpecParam(TypedDict, total=False): devcontainer: Devcontainer """devcontainer is the devcontainer spec of the environment""" + kernel_controls_config: Annotated[KernelControlsConfigParam, PropertyInfo(alias="kernelControlsConfig")] + """kernel_controls_config configures kernel-level controls for this environment""" + machine: Machine """machine is the machine spec of the environment""" diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index 904aa438..28879ebc 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -7,6 +7,7 @@ from .._utils import PropertyInfo from .admission_level import AdmissionLevel +from .kernel_controls_config_param import KernelControlsConfigParam from .environment_initializer_param import EnvironmentInitializerParam __all__ = [ @@ -132,6 +133,9 @@ class Spec(TypedDict, total=False): devcontainer: Optional[SpecDevcontainer] + kernel_controls_config: Annotated[Optional[KernelControlsConfigParam], PropertyInfo(alias="kernelControlsConfig")] + """kernel_controls_config configures kernel-level controls for this environment""" + ports: Iterable[SpecPort] """ports controls port sharing""" diff --git a/src/gitpod/types/kernel_controls_config.py b/src/gitpod/types/kernel_controls_config.py new file mode 100644 index 00000000..f8f06a94 --- /dev/null +++ b/src/gitpod/types/kernel_controls_config.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .veto import Veto +from .._models import BaseModel + +__all__ = ["KernelControlsConfig"] + + +class KernelControlsConfig(BaseModel): + """KernelControlsConfig configures kernel-level controls for the environment""" + + veto: Optional[Veto] = None + """veto controls blocking mechanisms""" diff --git a/src/gitpod/types/kernel_controls_config_param.py b/src/gitpod/types/kernel_controls_config_param.py new file mode 100644 index 00000000..11e6a86f --- /dev/null +++ b/src/gitpod/types/kernel_controls_config_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .veto_param import VetoParam + +__all__ = ["KernelControlsConfigParam"] + + +class KernelControlsConfigParam(TypedDict, total=False): + """KernelControlsConfig configures kernel-level controls for the environment""" + + veto: VetoParam + """veto controls blocking mechanisms""" diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index a0d0c8ff..71b61d53 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -11,6 +11,7 @@ from .crowd_strike_config import CrowdStrikeConfig as CrowdStrikeConfig from .domain_verification import DomainVerification as DomainVerification from .organization_invite import OrganizationInvite as OrganizationInvite +from .executable_deny_list import ExecutableDenyList as ExecutableDenyList from .invite_create_params import InviteCreateParams as InviteCreateParams from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams from .organization_policies import OrganizationPolicies as OrganizationPolicies @@ -24,6 +25,7 @@ from .policy_retrieve_response import PolicyRetrieveResponse as PolicyRetrieveResponse from .domain_verification_state import DomainVerificationState as DomainVerificationState from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams +from .executable_deny_list_param import ExecutableDenyListParam as ExecutableDenyListParam from .custom_domain_create_params import CustomDomainCreateParams as CustomDomainCreateParams from .custom_domain_delete_params import CustomDomainDeleteParams as CustomDomainDeleteParams from .custom_domain_update_params import CustomDomainUpdateParams as CustomDomainUpdateParams diff --git a/src/gitpod/types/organizations/executable_deny_list.py b/src/gitpod/types/organizations/executable_deny_list.py new file mode 100644 index 00000000..0fc4ea34 --- /dev/null +++ b/src/gitpod/types/organizations/executable_deny_list.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["ExecutableDenyList"] + + +class ExecutableDenyList(BaseModel): + """ + ExecutableDenyList contains executables that are blocked from execution in environments. + """ + + enabled: Optional[bool] = None + """enabled controls whether executable blocking is active""" + + executables: Optional[List[str]] = None + """executables is the list of executable paths or names to block""" diff --git a/src/gitpod/types/organizations/executable_deny_list_param.py b/src/gitpod/types/organizations/executable_deny_list_param.py new file mode 100644 index 00000000..bfe2677d --- /dev/null +++ b/src/gitpod/types/organizations/executable_deny_list_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from ..._types import SequenceNotStr + +__all__ = ["ExecutableDenyListParam"] + + +class ExecutableDenyListParam(TypedDict, total=False): + """ + ExecutableDenyList contains executables that are blocked from execution in environments. + """ + + enabled: bool + """enabled controls whether executable blocking is active""" + + executables: SequenceNotStr[str] + """executables is the list of executable paths or names to block""" diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py index 8572da7c..bf2c8141 100644 --- a/src/gitpod/types/organizations/organization_policies.py +++ b/src/gitpod/types/organizations/organization_policies.py @@ -6,6 +6,7 @@ from ..._models import BaseModel from .agent_policy import AgentPolicy +from .executable_deny_list import ExecutableDenyList from .security_agent_policy import SecurityAgentPolicy __all__ = ["OrganizationPolicies", "EditorVersionRestrictions"] @@ -111,6 +112,12 @@ class OrganizationPolicies(BaseModel): of the editor """ + executable_deny_list: Optional[ExecutableDenyList] = FieldInfo(alias="executableDenyList", default=None) + """ + executable_deny_list contains executables that are blocked from execution in + environments. + """ + maximum_environment_lifetime: Optional[str] = FieldInfo(alias="maximumEnvironmentLifetime", default=None) """ maximum_environment_lifetime controls for how long environments are allowed to diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index 312bc12f..d9dc1b25 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -7,6 +7,7 @@ from ..._types import SequenceNotStr from ..._utils import PropertyInfo +from .executable_deny_list_param import ExecutableDenyListParam __all__ = [ "PolicyUpdateParams", @@ -63,6 +64,12 @@ class PolicyUpdateParams(TypedDict, total=False): editor ID to version policy with allowed major versions. """ + executable_deny_list: Annotated[Optional[ExecutableDenyListParam], PropertyInfo(alias="executableDenyList")] + """ + executable_deny_list contains executables that are blocked from execution in + environments. + """ + maximum_environment_lifetime: Annotated[Optional[str], PropertyInfo(alias="maximumEnvironmentLifetime")] """ maximum_environment_lifetime controls for how long environments are allowed to diff --git a/src/gitpod/types/veto.py b/src/gitpod/types/veto.py new file mode 100644 index 00000000..e01f3abb --- /dev/null +++ b/src/gitpod/types/veto.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = ["Veto", "Exec"] + + +class Exec(BaseModel): + """exec controls executable blocking""" + + denylist: Optional[List[str]] = None + """denylist is the list of executable paths or names to block""" + + enabled: Optional[bool] = None + """enabled controls whether executable blocking is active""" + + +class Veto(BaseModel): + """Veto controls kernel-level blocking mechanisms""" + + exec: Optional[Exec] = None + """exec controls executable blocking""" diff --git a/src/gitpod/types/veto_param.py b/src/gitpod/types/veto_param.py new file mode 100644 index 00000000..ba6d52dd --- /dev/null +++ b/src/gitpod/types/veto_param.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .._types import SequenceNotStr + +__all__ = ["VetoParam", "Exec"] + + +class Exec(TypedDict, total=False): + """exec controls executable blocking""" + + denylist: SequenceNotStr[str] + """denylist is the list of executable paths or names to block""" + + enabled: bool + """enabled controls whether executable blocking is active""" + + +class VetoParam(TypedDict, total=False): + """Veto controls kernel-level blocking mechanisms""" + + exec: Exec + """exec controls executable blocking""" diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index 1d7ba27d..b7a74d82 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -9,7 +9,9 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types.organizations import PolicyRetrieveResponse +from gitpod.types.organizations import ( + PolicyRetrieveResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -76,6 +78,10 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: default_environment_image="defaultEnvironmentImage", delete_archived_environments_after="+9125115.360s", editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, + executable_deny_list={ + "enabled": True, + "executables": ["string"], + }, maximum_environment_lifetime="+9125115.360s", maximum_environments_per_user="20", maximum_environment_timeout="3600s", @@ -188,6 +194,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> default_environment_image="defaultEnvironmentImage", delete_archived_environments_after="+9125115.360s", editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, + executable_deny_list={ + "enabled": True, + "executables": ["string"], + }, maximum_environment_lifetime="+9125115.360s", maximum_environments_per_user="20", maximum_environment_timeout="3600s", diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index c1e64421..8ade45dc 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -80,6 +80,14 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, + "kernel_controls_config": { + "veto": { + "exec": { + "denylist": ["string"], + "enabled": True, + } + } + }, "machine": { "class": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "session": "session", @@ -215,6 +223,14 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "devcontainer_file_path": "devcontainerFilePath", "session": "session", }, + "kernel_controls_config": { + "veto": { + "exec": { + "denylist": ["string"], + "enabled": True, + } + } + }, "ports": [ { "admission": "ADMISSION_LEVEL_UNSPECIFIED", @@ -433,6 +449,14 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, + "kernel_controls_config": { + "veto": { + "exec": { + "denylist": ["string"], + "enabled": True, + } + } + }, "machine": { "class": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "session": "session", @@ -738,6 +762,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, + "kernel_controls_config": { + "veto": { + "exec": { + "denylist": ["string"], + "enabled": True, + } + } + }, "machine": { "class": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "session": "session", @@ -873,6 +905,14 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "devcontainer_file_path": "devcontainerFilePath", "session": "session", }, + "kernel_controls_config": { + "veto": { + "exec": { + "denylist": ["string"], + "enabled": True, + } + } + }, "ports": [ { "admission": "ADMISSION_LEVEL_UNSPECIFIED", @@ -1091,6 +1131,14 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, + "kernel_controls_config": { + "veto": { + "exec": { + "denylist": ["string"], + "enabled": True, + } + } + }, "machine": { "class": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "session": "session", From 825e6a95fe1493fa94b493fb6640dd13dcf87bf2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 12:45:25 +0000 Subject: [PATCH 315/505] feat(api): add scope field and enum to environment secrets --- .stats.yml | 4 ++-- src/gitpod/types/environment_spec.py | 15 +++++++++++++++ src/gitpod/types/environment_spec_param.py | 13 +++++++++++++ tests/api_resources/test_environments.py | 4 ++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 23314318..cb4b89a0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-912e6f9f02b4b4e145bd8c12e8ea65422246fb626abedb150c9791065d9407c1.yml -openapi_spec_hash: e1ffa39323c616de827752550560ee7c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e086ada0c2b3511c0c38525a98751d806ba816a451b62f7f9c2265862c871914.yml +openapi_spec_hash: 3c97cfd62d45e01dbadffb67fbfba1a3 config_hash: 1666c4673215d2af73eb14329610e026 diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index 9d565a1a..c4a10ecd 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -158,6 +158,21 @@ class Secret(BaseModel): name: Optional[str] = None """name is the human readable description of the secret""" + scope: Optional[ + Literal[ + "SCOPE_UNSPECIFIED", + "SCOPE_ORGANIZATION", + "SCOPE_PROJECT", + "SCOPE_USER", + "SCOPE_SERVICE_ACCOUNT", + "SCOPE_RUNNER", + ] + ] = None + """ + scope indicates where this secret originated from. Used to filter secrets during + build (only org and project secrets are injected). + """ + session: Optional[str] = None """ session indicated the current session of the secret. When the session does not diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index dc8b41f0..a646dac6 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -165,6 +165,19 @@ class Secret(TypedDict, total=False): name: str """name is the human readable description of the secret""" + scope: Literal[ + "SCOPE_UNSPECIFIED", + "SCOPE_ORGANIZATION", + "SCOPE_PROJECT", + "SCOPE_USER", + "SCOPE_SERVICE_ACCOUNT", + "SCOPE_RUNNER", + ] + """ + scope indicates where this secret originated from. Used to filter secrets during + build (only org and project secrets are injected). + """ + session: str """ session indicated the current session of the secret. When the session does not diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 8ade45dc..5c33ab50 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -109,6 +109,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "file_path": "filePath", "git_credential_host": "gitCredentialHost", "name": "name", + "scope": "SCOPE_UNSPECIFIED", "session": "session", "source": "source", "source_ref": "sourceRef", @@ -478,6 +479,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "file_path": "filePath", "git_credential_host": "gitCredentialHost", "name": "name", + "scope": "SCOPE_UNSPECIFIED", "session": "session", "source": "source", "source_ref": "sourceRef", @@ -791,6 +793,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "file_path": "filePath", "git_credential_host": "gitCredentialHost", "name": "name", + "scope": "SCOPE_UNSPECIFIED", "session": "session", "source": "source", "source_ref": "sourceRef", @@ -1160,6 +1163,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "file_path": "filePath", "git_credential_host": "gitCredentialHost", "name": "name", + "scope": "SCOPE_UNSPECIFIED", "session": "session", "source": "source", "source_ref": "sourceRef", From 14236bb871312508fc443fa97e4e1b42755e1764 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 16:51:37 +0000 Subject: [PATCH 316/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cb4b89a0..245dc82c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e086ada0c2b3511c0c38525a98751d806ba816a451b62f7f9c2265862c871914.yml -openapi_spec_hash: 3c97cfd62d45e01dbadffb67fbfba1a3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6e5f0e3fba6ca7b4fea95f8d634ed724bdc18a8b98fa1da473b18ac0a2931c27.yml +openapi_spec_hash: a53d29056c5ed38b26508ed2cb9050a3 config_hash: 1666c4673215d2af73eb14329610e026 From 9c42e68d9a92a961f8e7f1fe952dc171ef4afb97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 17:23:25 +0000 Subject: [PATCH 317/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 245dc82c..6e5d8824 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6e5f0e3fba6ca7b4fea95f8d634ed724bdc18a8b98fa1da473b18ac0a2931c27.yml -openapi_spec_hash: a53d29056c5ed38b26508ed2cb9050a3 -config_hash: 1666c4673215d2af73eb14329610e026 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bb4e6859a80947948a22daab52f6d72617c89201cc0d06f94e4fedfc95eb6dbd.yml +openapi_spec_hash: 76e9882895783cabd4c25a84c4c18ed0 +config_hash: 401f8a117c48e880889ed27a8403db29 From 92bda0211840a6295e6c0b624c0d547adf868d50 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Feb 2026 11:28:21 +0000 Subject: [PATCH 318/505] docs(api): clarify port_sharing_disabled behavior in organization policy --- .stats.yml | 4 ++-- src/gitpod/resources/organizations/policies.py | 10 ++++++---- .../types/organizations/organization_policies.py | 5 +++-- src/gitpod/types/organizations/policy_update_params.py | 5 +++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6e5d8824..5acbe2d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bb4e6859a80947948a22daab52f6d72617c89201cc0d06f94e4fedfc95eb6dbd.yml -openapi_spec_hash: 76e9882895783cabd4c25a84c4c18ed0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e76b45ac7aedb89d725b01fea9f009672c3f3b0117393178e034718095339a3.yml +openapi_spec_hash: 11437695b49cfe5d28bef5d4ee65d696 config_hash: 401f8a117c48e880889ed27a8403db29 diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 01230196..28d2142d 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -204,8 +204,9 @@ def update( members_require_projects: members_require_projects controls whether environments can only be created from projects by non-admin users - port_sharing_disabled: port_sharing_disabled controls whether port sharing is disabled in the - organization + port_sharing_disabled: port_sharing_disabled controls whether user-initiated port sharing is disabled + in the organization. System ports (VS Code Browser, agents) are always exempt + from this policy. require_custom_domain_access: require_custom_domain_access controls whether users must access via custom domain when one is configured. When true, access via app.gitpod.io is blocked. @@ -439,8 +440,9 @@ async def update( members_require_projects: members_require_projects controls whether environments can only be created from projects by non-admin users - port_sharing_disabled: port_sharing_disabled controls whether port sharing is disabled in the - organization + port_sharing_disabled: port_sharing_disabled controls whether user-initiated port sharing is disabled + in the organization. System ports (VS Code Browser, agents) are always exempt + from this policy. require_custom_domain_access: require_custom_domain_access controls whether users must access via custom domain when one is configured. When true, access via app.gitpod.io is blocked. diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py index bf2c8141..ea62f2eb 100644 --- a/src/gitpod/types/organizations/organization_policies.py +++ b/src/gitpod/types/organizations/organization_policies.py @@ -78,8 +78,9 @@ class OrganizationPolicies(BaseModel): port_sharing_disabled: bool = FieldInfo(alias="portSharingDisabled") """ - port_sharing_disabled controls whether port sharing is disabled in the - organization + port_sharing_disabled controls whether user-initiated port sharing is disabled + in the organization. System ports (VS Code Browser, agents) are always exempt + from this policy. """ require_custom_domain_access: bool = FieldInfo(alias="requireCustomDomainAccess") diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index d9dc1b25..33cc3143 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -109,8 +109,9 @@ class PolicyUpdateParams(TypedDict, total=False): port_sharing_disabled: Annotated[Optional[bool], PropertyInfo(alias="portSharingDisabled")] """ - port_sharing_disabled controls whether port sharing is disabled in the - organization + port_sharing_disabled controls whether user-initiated port sharing is disabled + in the organization. System ports (VS Code Browser, agents) are always exempt + from this policy. """ require_custom_domain_access: Annotated[Optional[bool], PropertyInfo(alias="requireCustomDomainAccess")] From 970e5770fcd90bbef7a52cce2e39ace925e8b926 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 10:35:00 +0000 Subject: [PATCH 319/505] feat(api): add additional_scopes to organization SSO configuration --- .stats.yml | 6 ++--- api.md | 1 + .../organizations/sso_configurations.py | 25 +++++++++++++++++++ src/gitpod/types/organizations/__init__.py | 1 + .../additional_scopes_update_param.py | 19 ++++++++++++++ .../types/organizations/sso_configuration.py | 6 +++++ .../sso_configuration_create_params.py | 7 ++++++ .../sso_configuration_update_params.py | 8 ++++++ .../organizations/test_sso_configurations.py | 4 +++ 9 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/organizations/additional_scopes_update_param.py diff --git a/.stats.yml b/.stats.yml index 5acbe2d5..003adc86 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e76b45ac7aedb89d725b01fea9f009672c3f3b0117393178e034718095339a3.yml -openapi_spec_hash: 11437695b49cfe5d28bef5d4ee65d696 -config_hash: 401f8a117c48e880889ed27a8403db29 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a6b5c6f4bd34c0b9cbb1321be432905e6120f4479ad2a53d35790f99c2e05b29.yml +openapi_spec_hash: 83b243294469b6646f0c4659566b3f48 +config_hash: 73b8de7922813d562151d404149c768d diff --git a/api.md b/api.md index 319c9df2..ce41da2a 100644 --- a/api.md +++ b/api.md @@ -495,6 +495,7 @@ Types: ```python from gitpod.types.organizations import ( + AdditionalScopesUpdate, ProviderType, SSOConfiguration, SSOConfigurationState, diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 7d9796cc..a6b0056b 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -28,6 +28,7 @@ ) from ...types.organizations.sso_configuration import SSOConfiguration from ...types.organizations.sso_configuration_state import SSOConfigurationState +from ...types.organizations.additional_scopes_update_param import AdditionalScopesUpdateParam from ...types.organizations.sso_configuration_create_response import SSOConfigurationCreateResponse from ...types.organizations.sso_configuration_retrieve_response import SSOConfigurationRetrieveResponse @@ -61,6 +62,7 @@ def create( client_secret: str, issuer_url: str, organization_id: str, + additional_scopes: SequenceNotStr[str] | Omit = omit, display_name: str | Omit = omit, email_domain: Optional[str] | Omit = omit, email_domains: SequenceNotStr[str] | Omit = omit, @@ -114,6 +116,10 @@ def create( issuer_url: issuer_url is the URL of the IdP issuer + additional_scopes: additional_scopes are extra OIDC scopes to request from the identity provider + during sign-in. These are appended to the default scopes (openid, email, + profile). + email_domain: email_domain is the domain that is allowed to sign in to the organization extra_headers: Send extra headers @@ -132,6 +138,7 @@ def create( "client_secret": client_secret, "issuer_url": issuer_url, "organization_id": organization_id, + "additional_scopes": additional_scopes, "display_name": display_name, "email_domain": email_domain, "email_domains": email_domains, @@ -201,6 +208,7 @@ def update( self, *, sso_configuration_id: str, + additional_scopes: Optional[AdditionalScopesUpdateParam] | Omit = omit, claims: Dict[str, str] | Omit = omit, client_id: Optional[str] | Omit = omit, client_secret: Optional[str] | Omit = omit, @@ -251,6 +259,10 @@ def update( Args: sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update + additional_scopes: additional_scopes replaces the configured OIDC scopes when present. When absent + (nil), scopes are left unchanged. When present with an empty scopes list, all + additional scopes are cleared. + claims: claims are key/value pairs that defines a mapping of claims issued by the IdP. client_id: client_id is the client ID of the SSO provider @@ -274,6 +286,7 @@ def update( body=maybe_transform( { "sso_configuration_id": sso_configuration_id, + "additional_scopes": additional_scopes, "claims": claims, "client_id": client_id, "client_secret": client_secret, @@ -455,6 +468,7 @@ async def create( client_secret: str, issuer_url: str, organization_id: str, + additional_scopes: SequenceNotStr[str] | Omit = omit, display_name: str | Omit = omit, email_domain: Optional[str] | Omit = omit, email_domains: SequenceNotStr[str] | Omit = omit, @@ -508,6 +522,10 @@ async def create( issuer_url: issuer_url is the URL of the IdP issuer + additional_scopes: additional_scopes are extra OIDC scopes to request from the identity provider + during sign-in. These are appended to the default scopes (openid, email, + profile). + email_domain: email_domain is the domain that is allowed to sign in to the organization extra_headers: Send extra headers @@ -526,6 +544,7 @@ async def create( "client_secret": client_secret, "issuer_url": issuer_url, "organization_id": organization_id, + "additional_scopes": additional_scopes, "display_name": display_name, "email_domain": email_domain, "email_domains": email_domains, @@ -595,6 +614,7 @@ async def update( self, *, sso_configuration_id: str, + additional_scopes: Optional[AdditionalScopesUpdateParam] | Omit = omit, claims: Dict[str, str] | Omit = omit, client_id: Optional[str] | Omit = omit, client_secret: Optional[str] | Omit = omit, @@ -645,6 +665,10 @@ async def update( Args: sso_configuration_id: sso_configuration_id is the ID of the SSO configuration to update + additional_scopes: additional_scopes replaces the configured OIDC scopes when present. When absent + (nil), scopes are left unchanged. When present with an empty scopes list, all + additional scopes are cleared. + claims: claims are key/value pairs that defines a mapping of claims issued by the IdP. client_id: client_id is the client ID of the SSO provider @@ -668,6 +692,7 @@ async def update( body=await async_maybe_transform( { "sso_configuration_id": sso_configuration_id, + "additional_scopes": additional_scopes, "claims": claims, "client_id": client_id, "client_secret": client_secret, diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index 71b61d53..86ec7aed 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -34,6 +34,7 @@ from .custom_domain_retrieve_params import CustomDomainRetrieveParams as CustomDomainRetrieveParams from .custom_domain_update_response import CustomDomainUpdateResponse as CustomDomainUpdateResponse from .sso_configuration_list_params import SSOConfigurationListParams as SSOConfigurationListParams +from .additional_scopes_update_param import AdditionalScopesUpdateParam as AdditionalScopesUpdateParam from .announcement_banner_get_params import AnnouncementBannerGetParams as AnnouncementBannerGetParams from .scim_configuration_list_params import ScimConfigurationListParams as ScimConfigurationListParams from .custom_domain_retrieve_response import CustomDomainRetrieveResponse as CustomDomainRetrieveResponse diff --git a/src/gitpod/types/organizations/additional_scopes_update_param.py b/src/gitpod/types/organizations/additional_scopes_update_param.py new file mode 100644 index 00000000..8c45b5e4 --- /dev/null +++ b/src/gitpod/types/organizations/additional_scopes_update_param.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from ..._types import SequenceNotStr + +__all__ = ["AdditionalScopesUpdateParam"] + + +class AdditionalScopesUpdateParam(TypedDict, total=False): + """ + AdditionalScopesUpdate wraps a list of OIDC scopes so that the update request + can distinguish "not changing scopes" (field absent) from "clearing all scopes" + (field present, empty list). + """ + + scopes: SequenceNotStr[str] diff --git a/src/gitpod/types/organizations/sso_configuration.py b/src/gitpod/types/organizations/sso_configuration.py index 7f7f70b7..f5dd4db4 100644 --- a/src/gitpod/types/organizations/sso_configuration.py +++ b/src/gitpod/types/organizations/sso_configuration.py @@ -26,6 +26,12 @@ class SSOConfiguration(BaseModel): state: SSOConfigurationState """state is the state of the SSO configuration""" + additional_scopes: Optional[List[str]] = FieldInfo(alias="additionalScopes", default=None) + """ + additional_scopes are extra OIDC scopes requested from the identity provider + during sign-in. + """ + claims: Optional[Dict[str, str]] = None """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" diff --git a/src/gitpod/types/organizations/sso_configuration_create_params.py b/src/gitpod/types/organizations/sso_configuration_create_params.py index 04f39fb1..16ffadb1 100644 --- a/src/gitpod/types/organizations/sso_configuration_create_params.py +++ b/src/gitpod/types/organizations/sso_configuration_create_params.py @@ -23,6 +23,13 @@ class SSOConfigurationCreateParams(TypedDict, total=False): organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + additional_scopes: Annotated[SequenceNotStr[str], PropertyInfo(alias="additionalScopes")] + """ + additional_scopes are extra OIDC scopes to request from the identity provider + during sign-in. These are appended to the default scopes (openid, email, + profile). + """ + display_name: Annotated[str, PropertyInfo(alias="displayName")] email_domain: Annotated[Optional[str], PropertyInfo(alias="emailDomain")] diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py index 998789ab..7f85387e 100644 --- a/src/gitpod/types/organizations/sso_configuration_update_params.py +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -8,6 +8,7 @@ from ..._types import SequenceNotStr from ..._utils import PropertyInfo from .sso_configuration_state import SSOConfigurationState +from .additional_scopes_update_param import AdditionalScopesUpdateParam __all__ = ["SSOConfigurationUpdateParams"] @@ -16,6 +17,13 @@ class SSOConfigurationUpdateParams(TypedDict, total=False): sso_configuration_id: Required[Annotated[str, PropertyInfo(alias="ssoConfigurationId")]] """sso_configuration_id is the ID of the SSO configuration to update""" + additional_scopes: Annotated[Optional[AdditionalScopesUpdateParam], PropertyInfo(alias="additionalScopes")] + """ + additional_scopes replaces the configured OIDC scopes when present. When absent + (nil), scopes are left unchanged. When present with an empty scopes list, all + additional scopes are cleared. + """ + claims: Dict[str, str] """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 9e10ff80..9dd1f95a 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -41,6 +41,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + additional_scopes=["x"], display_name="displayName", email_domain="acme-corp.com", email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], @@ -126,6 +127,7 @@ def test_method_update(self, client: Gitpod) -> None: def test_method_update_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + additional_scopes={"scopes": ["x"]}, claims={"foo": "string"}, client_id="new-client-id", client_secret="new-client-secret", @@ -270,6 +272,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + additional_scopes=["x"], display_name="displayName", email_domain="acme-corp.com", email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], @@ -355,6 +358,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + additional_scopes={"scopes": ["x"]}, claims={"foo": "string"}, client_id="new-client-id", client_secret="new-client-secret", From 221660003b45466615e80733bb433a7239277bbd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 14:38:26 +0000 Subject: [PATCH 320/505] chore(internal): bump dependencies --- requirements-dev.lock | 20 ++++++++++---------- requirements.lock | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 343a3daa..6911c2cf 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,14 +12,14 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.13.2 +aiohttp==3.13.3 # via gitpod-sdk # via httpx-aiohttp aiosignal==1.4.0 # via aiohttp annotated-types==0.7.0 # via pydantic -anyio==4.12.0 +anyio==4.12.1 # via gitpod-sdk # via httpx argcomplete==3.6.3 @@ -31,7 +31,7 @@ attrs==25.4.0 # via nox backports-asyncio-runner==1.2.0 # via pytest-asyncio -certifi==2025.11.12 +certifi==2026.1.4 # via httpcore # via httpx colorlog==6.10.1 @@ -61,7 +61,7 @@ httpx==0.28.1 # via gitpod-sdk # via httpx-aiohttp # via respx -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via gitpod-sdk humanize==4.13.0 # via nox @@ -69,7 +69,7 @@ idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==8.7.0 +importlib-metadata==8.7.1 iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 @@ -82,14 +82,14 @@ multidict==6.7.0 mypy==1.17.0 mypy-extensions==1.1.0 # via mypy -nodeenv==1.9.1 +nodeenv==1.10.0 # via pyright nox==2025.11.12 packaging==25.0 # via dependency-groups # via nox # via pytest -pathspec==0.12.1 +pathspec==1.0.3 # via mypy platformdirs==4.4.0 # via virtualenv @@ -115,13 +115,13 @@ python-dateutil==2.9.0.post0 # via time-machine respx==0.22.0 rich==14.2.0 -ruff==0.14.7 +ruff==0.14.13 six==1.17.0 # via python-dateutil sniffio==1.3.1 # via gitpod-sdk time-machine==2.19.0 -tomli==2.3.0 +tomli==2.4.0 # via dependency-groups # via mypy # via nox @@ -141,7 +141,7 @@ typing-extensions==4.15.0 # via virtualenv typing-inspection==0.4.2 # via pydantic -virtualenv==20.35.4 +virtualenv==20.36.1 # via nox yarl==1.22.0 # via aiohttp diff --git a/requirements.lock b/requirements.lock index 73d1ab78..009f1a16 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,21 +12,21 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.13.2 +aiohttp==3.13.3 # via gitpod-sdk # via httpx-aiohttp aiosignal==1.4.0 # via aiohttp annotated-types==0.7.0 # via pydantic -anyio==4.12.0 +anyio==4.12.1 # via gitpod-sdk # via httpx async-timeout==5.0.1 # via aiohttp attrs==25.4.0 # via aiohttp -certifi==2025.11.12 +certifi==2026.1.4 # via httpcore # via httpx distro==1.9.0 @@ -43,7 +43,7 @@ httpcore==1.0.9 httpx==0.28.1 # via gitpod-sdk # via httpx-aiohttp -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via gitpod-sdk idna==3.11 # via anyio From 734a7d304aa9c3e275943e805331dc32a35e835f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 09:21:57 +0000 Subject: [PATCH 321/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 003adc86..0be9cd83 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a6b5c6f4bd34c0b9cbb1321be432905e6120f4479ad2a53d35790f99c2e05b29.yml -openapi_spec_hash: 83b243294469b6646f0c4659566b3f48 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b965bf6fa31985d197c1898d68474d8089286972638497d1adcccb01b843cd18.yml +openapi_spec_hash: 75acb7e119f7eb4144c0df0f2f221afe config_hash: 73b8de7922813d562151d404149c768d From cc764e3c2c322a2a901c9a2928a71c01ee000578 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 09:59:34 +0000 Subject: [PATCH 322/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0be9cd83..bfc0571a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b965bf6fa31985d197c1898d68474d8089286972638497d1adcccb01b843cd18.yml -openapi_spec_hash: 75acb7e119f7eb4144c0df0f2f221afe -config_hash: 73b8de7922813d562151d404149c768d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2083161ba9b1eb8429e21c30b34c94ed1fc450095f54498a1dfeba19c4cb780f.yml +openapi_spec_hash: 675370d39672e735988f8501c9502dfc +config_hash: 2daf822ad8d9d03f0a72a8bf8adc92a1 From b3dfc2bdd5de3686d6339a362504480ddcd7c978 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 16:32:36 +0000 Subject: [PATCH 323/505] feat(api): add warm pools resource to prebuilds --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_role.py | 1 + src/gitpod/types/shared/resource_type.py | 1 + src/gitpod/types/shared_params/resource_role.py | 1 + src/gitpod/types/shared_params/resource_type.py | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bfc0571a..51dc30e8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2083161ba9b1eb8429e21c30b34c94ed1fc450095f54498a1dfeba19c4cb780f.yml -openapi_spec_hash: 675370d39672e735988f8501c9502dfc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c6bbc07d363a615337303ef6c5338faed25448b6963b992ed29418dba3de6136.yml +openapi_spec_hash: acc8bbf6f8313c075e9bdba83700baa7 config_hash: 2daf822ad8d9d03f0a72a8bf8adc92a1 diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 0f967e86..82289489 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -59,4 +59,5 @@ "RESOURCE_ROLE_SNAPSHOT_RUNNER", "RESOURCE_ROLE_WEBHOOK_ADMIN", "RESOURCE_ROLE_WEBHOOK_VIEWER", + "RESOURCE_ROLE_WARMPOOL_RUNNER", ] diff --git a/src/gitpod/types/shared/resource_type.py b/src/gitpod/types/shared/resource_type.py index 9bd2c135..0f7f7567 100644 --- a/src/gitpod/types/shared/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -53,4 +53,5 @@ "RESOURCE_TYPE_ANNOUNCEMENT_BANNER", "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN", "RESOURCE_TYPE_ROLE_ASSIGNMENT", + "RESOURCE_TYPE_WARM_POOL", ] diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index 9ce41336..dd7e43a1 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -61,4 +61,5 @@ "RESOURCE_ROLE_SNAPSHOT_RUNNER", "RESOURCE_ROLE_WEBHOOK_ADMIN", "RESOURCE_ROLE_WEBHOOK_VIEWER", + "RESOURCE_ROLE_WARMPOOL_RUNNER", ] diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py index 19a20e40..4928c237 100644 --- a/src/gitpod/types/shared_params/resource_type.py +++ b/src/gitpod/types/shared_params/resource_type.py @@ -55,4 +55,5 @@ "RESOURCE_TYPE_ANNOUNCEMENT_BANNER", "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN", "RESOURCE_TYPE_ROLE_ASSIGNMENT", + "RESOURCE_TYPE_WARM_POOL", ] From e12a415f5ea42197daa4c6bc070976457929b29a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 18:29:56 +0000 Subject: [PATCH 324/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 51dc30e8..838f379a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c6bbc07d363a615337303ef6c5338faed25448b6963b992ed29418dba3de6136.yml -openapi_spec_hash: acc8bbf6f8313c075e9bdba83700baa7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-66128ab1937fbbb10b33b62b505e301ca89640489a59f6c6ac03c58c3f67917e.yml +openapi_spec_hash: a3794565b067fe9f393a0f1be04d52a3 config_hash: 2daf822ad8d9d03f0a72a8bf8adc92a1 From c0572e2e23d6d40fc5c06d1a84fd991e9a4bc3a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 08:17:32 +0000 Subject: [PATCH 325/505] feat(api): add exclude_group_id filter to organization list members --- .stats.yml | 4 ++-- src/gitpod/types/organization_list_members_params.py | 6 ++++++ tests/api_resources/test_organizations.py | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 838f379a..b9611e2f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-66128ab1937fbbb10b33b62b505e301ca89640489a59f6c6ac03c58c3f67917e.yml -openapi_spec_hash: a3794565b067fe9f393a0f1be04d52a3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7a38c308f8e8c0c90f0804160e0b88d502f068508e2a198523432f8a7da988a6.yml +openapi_spec_hash: 1421eed0586bb7086b33e3506fd57c10 config_hash: 2daf822ad8d9d03f0a72a8bf8adc92a1 diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 797d2777..986af24e 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -37,6 +37,12 @@ class OrganizationListMembersParams(TypedDict, total=False): class Filter(TypedDict, total=False): + exclude_group_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="excludeGroupIds")] + """ + exclude_group_ids excludes members who are already in any of the specified + groups + """ + roles: List[OrganizationRole] """roles filters members by their organization role""" diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 0bc4e4f9..a8653c7c 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -267,6 +267,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ + "exclude_group_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "roles": ["ORGANIZATION_ROLE_UNSPECIFIED"], "search": "search", "statuses": ["USER_STATUS_UNSPECIFIED"], @@ -605,6 +606,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp token="token", page_size=0, filter={ + "exclude_group_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "roles": ["ORGANIZATION_ROLE_UNSPECIFIED"], "search": "search", "statuses": ["USER_STATUS_UNSPECIFIED"], From 63fb50410e6e2ce72a4722f8bce52b1c6462fae1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:39:08 +0000 Subject: [PATCH 326/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index b9611e2f..fbf4fbff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7a38c308f8e8c0c90f0804160e0b88d502f068508e2a198523432f8a7da988a6.yml -openapi_spec_hash: 1421eed0586bb7086b33e3506fd57c10 -config_hash: 2daf822ad8d9d03f0a72a8bf8adc92a1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-aae941ae291f8be9199f03c287a82feea38420d9f0e90415d05e2f03e1947abe.yml +openapi_spec_hash: 4e5d3e8aa0e731807a83f0e0638cdb37 +config_hash: f0929f1f3810f16d770af0e1ac268297 From 05d4ab44d7e6f87ee659add7e4b2ef9f7397310a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:57:23 +0000 Subject: [PATCH 327/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index fbf4fbff..592d8a4c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-aae941ae291f8be9199f03c287a82feea38420d9f0e90415d05e2f03e1947abe.yml -openapi_spec_hash: 4e5d3e8aa0e731807a83f0e0638cdb37 -config_hash: f0929f1f3810f16d770af0e1ac268297 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b97dcde84128bcf3740b0cf3c2c005e1dcd1cdac9b0768a28bd734f8d83c9fa2.yml +openapi_spec_hash: 1172889d2eb3f0453514c6caae3459b3 +config_hash: 49d499b8ab46cede0e3461ef7cd549ca From 1144aa900fb1c0c6c4993aebcfac984865d6ceb9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:18:40 +0000 Subject: [PATCH 328/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1b77f506..6538ca91 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.7.0" + ".": "0.8.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ba9cda3a..425c303f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.7.0" +version = "0.8.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 88739dd6..58df5031 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.7.0" # x-release-please-version +__version__ = "0.8.0" # x-release-please-version From 646dba2085e8d03ce0d88ffa3ee653effa8d0cad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:32:16 +0000 Subject: [PATCH 329/505] feat(api): add bulk_create/bulk_delete/bulk_update methods to projects --- .stats.yml | 8 +- api.md | 6 + src/gitpod/resources/projects/projects.py | 384 +++++++++++++- src/gitpod/types/__init__.py | 6 + .../types/project_bulk_create_params.py | 55 ++ .../types/project_bulk_create_response.py | 29 ++ .../types/project_bulk_delete_params.py | 14 + .../types/project_bulk_delete_response.py | 28 + .../types/project_bulk_update_params.py | 69 +++ .../types/project_bulk_update_response.py | 29 ++ tests/api_resources/test_projects.py | 479 ++++++++++++++++++ 11 files changed, 1101 insertions(+), 6 deletions(-) create mode 100644 src/gitpod/types/project_bulk_create_params.py create mode 100644 src/gitpod/types/project_bulk_create_response.py create mode 100644 src/gitpod/types/project_bulk_delete_params.py create mode 100644 src/gitpod/types/project_bulk_delete_response.py create mode 100644 src/gitpod/types/project_bulk_update_params.py create mode 100644 src/gitpod/types/project_bulk_update_response.py diff --git a/.stats.yml b/.stats.yml index 592d8a4c..cca37c72 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 172 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b97dcde84128bcf3740b0cf3c2c005e1dcd1cdac9b0768a28bd734f8d83c9fa2.yml -openapi_spec_hash: 1172889d2eb3f0453514c6caae3459b3 -config_hash: 49d499b8ab46cede0e3461ef7cd549ca +configured_endpoints: 175 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8f6ee769411e2d21a2f437d49eb2f16880fcef0db52ac1985f2a3963af45f6a0.yml +openapi_spec_hash: 28f2d9d7e36f1f0ecd13052054449249 +config_hash: 3f1278a7a2a9285f57e81f148743e99e diff --git a/api.md b/api.md index ce41da2a..cd3547f8 100644 --- a/api.md +++ b/api.md @@ -555,6 +555,9 @@ from gitpod.types import ( ProjectCreateResponse, ProjectRetrieveResponse, ProjectUpdateResponse, + ProjectBulkCreateResponse, + ProjectBulkDeleteResponse, + ProjectBulkUpdateResponse, ProjectCreateFromEnvironmentResponse, ) ``` @@ -566,6 +569,9 @@ Methods: - client.projects.update(\*\*params) -> ProjectUpdateResponse - client.projects.list(\*\*params) -> SyncProjectsPage[Project] - client.projects.delete(\*\*params) -> object +- client.projects.bulk_create(\*\*params) -> ProjectBulkCreateResponse +- client.projects.bulk_delete(\*\*params) -> ProjectBulkDeleteResponse +- client.projects.bulk_update(\*\*params) -> ProjectBulkUpdateResponse - client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse ## EnvironmentClases diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index c3f7da6b..ac2caee1 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Iterable, Optional import httpx @@ -12,9 +12,12 @@ project_delete_params, project_update_params, project_retrieve_params, + project_bulk_create_params, + project_bulk_delete_params, + project_bulk_update_params, project_create_from_environment_params, ) -from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, @@ -47,6 +50,9 @@ from ...types.project_update_response import ProjectUpdateResponse from ...types.project_retrieve_response import ProjectRetrieveResponse from ...types.recommended_editors_param import RecommendedEditorsParam +from ...types.project_bulk_create_response import ProjectBulkCreateResponse +from ...types.project_bulk_delete_response import ProjectBulkDeleteResponse +from ...types.project_bulk_update_response import ProjectBulkUpdateResponse from ...types.environment_initializer_param import EnvironmentInitializerParam from ...types.project_prebuild_configuration_param import ProjectPrebuildConfigurationParam from ...types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse @@ -473,6 +479,172 @@ def delete( cast_to=object, ) + def bulk_create( + self, + *, + projects: Iterable[project_bulk_create_params.Project] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ProjectBulkCreateResponse: + """ + Creates multiple projects in a single request. + + Use this method to: + + - Onboard multiple repositories at once + - Import a batch of projects during initial setup + + Returns successfully created projects and details about any failures. Each + project in the request is processed independently — partial success is possible. + + ### Examples + + - Create multiple projects: + + Creates several projects in one request. + + ```yaml + projects: + - name: "Frontend" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/frontend" + - name: "Backend" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/backend" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.ProjectService/CreateProjects", + body=maybe_transform({"projects": projects}, project_bulk_create_params.ProjectBulkCreateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectBulkCreateResponse, + ) + + def bulk_delete( + self, + *, + project_ids: SequenceNotStr[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ProjectBulkDeleteResponse: + """ + Deletes multiple projects in a single request. + + Use this method to: + + - Remove multiple unused projects at once + - Clean up projects in batch + + Returns successfully deleted project IDs and details about any failures. Each + project in the request is processed independently — partial success is possible. + + ### Examples + + - Delete multiple projects: + + Permanently removes several projects in one request. + + ```yaml + projectIds: + - "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + - "c1f23g7d-5d78-430e-b5b7-e0949c6eb158" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.ProjectService/DeleteProjects", + body=maybe_transform({"project_ids": project_ids}, project_bulk_delete_params.ProjectBulkDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectBulkDeleteResponse, + ) + + def bulk_update( + self, + *, + projects: Iterable[project_bulk_update_params.Project] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ProjectBulkUpdateResponse: + """ + Updates multiple projects in a single request. + + Use this method to: + + - Modify settings across multiple projects at once + - Apply configuration changes in batch + + Returns successfully updated projects and details about any failures. Each + project in the request is processed independently — partial success is possible. + + ### Examples + + - Update multiple projects: + + Updates several projects in one request. + + ```yaml + projects: + - projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "Updated Frontend" + - projectId: "c1f23g7d-5d78-430e-b5b7-e0949c6eb158" + name: "Updated Backend" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.ProjectService/UpdateProjects", + body=maybe_transform({"projects": projects}, project_bulk_update_params.ProjectBulkUpdateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectBulkUpdateResponse, + ) + def create_from_environment( self, *, @@ -951,6 +1123,178 @@ async def delete( cast_to=object, ) + async def bulk_create( + self, + *, + projects: Iterable[project_bulk_create_params.Project] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ProjectBulkCreateResponse: + """ + Creates multiple projects in a single request. + + Use this method to: + + - Onboard multiple repositories at once + - Import a batch of projects during initial setup + + Returns successfully created projects and details about any failures. Each + project in the request is processed independently — partial success is possible. + + ### Examples + + - Create multiple projects: + + Creates several projects in one request. + + ```yaml + projects: + - name: "Frontend" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/frontend" + - name: "Backend" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/backend" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.ProjectService/CreateProjects", + body=await async_maybe_transform( + {"projects": projects}, project_bulk_create_params.ProjectBulkCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectBulkCreateResponse, + ) + + async def bulk_delete( + self, + *, + project_ids: SequenceNotStr[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ProjectBulkDeleteResponse: + """ + Deletes multiple projects in a single request. + + Use this method to: + + - Remove multiple unused projects at once + - Clean up projects in batch + + Returns successfully deleted project IDs and details about any failures. Each + project in the request is processed independently — partial success is possible. + + ### Examples + + - Delete multiple projects: + + Permanently removes several projects in one request. + + ```yaml + projectIds: + - "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + - "c1f23g7d-5d78-430e-b5b7-e0949c6eb158" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.ProjectService/DeleteProjects", + body=await async_maybe_transform( + {"project_ids": project_ids}, project_bulk_delete_params.ProjectBulkDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectBulkDeleteResponse, + ) + + async def bulk_update( + self, + *, + projects: Iterable[project_bulk_update_params.Project] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ProjectBulkUpdateResponse: + """ + Updates multiple projects in a single request. + + Use this method to: + + - Modify settings across multiple projects at once + - Apply configuration changes in batch + + Returns successfully updated projects and details about any failures. Each + project in the request is processed independently — partial success is possible. + + ### Examples + + - Update multiple projects: + + Updates several projects in one request. + + ```yaml + projects: + - projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "Updated Frontend" + - projectId: "c1f23g7d-5d78-430e-b5b7-e0949c6eb158" + name: "Updated Backend" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.ProjectService/UpdateProjects", + body=await async_maybe_transform( + {"projects": projects}, project_bulk_update_params.ProjectBulkUpdateParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectBulkUpdateResponse, + ) + async def create_from_environment( self, *, @@ -1029,6 +1373,15 @@ def __init__(self, projects: ProjectsResource) -> None: self.delete = to_raw_response_wrapper( projects.delete, ) + self.bulk_create = to_raw_response_wrapper( + projects.bulk_create, + ) + self.bulk_delete = to_raw_response_wrapper( + projects.bulk_delete, + ) + self.bulk_update = to_raw_response_wrapper( + projects.bulk_update, + ) self.create_from_environment = to_raw_response_wrapper( projects.create_from_environment, ) @@ -1061,6 +1414,15 @@ def __init__(self, projects: AsyncProjectsResource) -> None: self.delete = async_to_raw_response_wrapper( projects.delete, ) + self.bulk_create = async_to_raw_response_wrapper( + projects.bulk_create, + ) + self.bulk_delete = async_to_raw_response_wrapper( + projects.bulk_delete, + ) + self.bulk_update = async_to_raw_response_wrapper( + projects.bulk_update, + ) self.create_from_environment = async_to_raw_response_wrapper( projects.create_from_environment, ) @@ -1093,6 +1455,15 @@ def __init__(self, projects: ProjectsResource) -> None: self.delete = to_streamed_response_wrapper( projects.delete, ) + self.bulk_create = to_streamed_response_wrapper( + projects.bulk_create, + ) + self.bulk_delete = to_streamed_response_wrapper( + projects.bulk_delete, + ) + self.bulk_update = to_streamed_response_wrapper( + projects.bulk_update, + ) self.create_from_environment = to_streamed_response_wrapper( projects.create_from_environment, ) @@ -1125,6 +1496,15 @@ def __init__(self, projects: AsyncProjectsResource) -> None: self.delete = async_to_streamed_response_wrapper( projects.delete, ) + self.bulk_create = async_to_streamed_response_wrapper( + projects.bulk_create, + ) + self.bulk_delete = async_to_streamed_response_wrapper( + projects.bulk_delete, + ) + self.bulk_update = async_to_streamed_response_wrapper( + projects.bulk_update, + ) self.create_from_environment = async_to_streamed_response_wrapper( projects.create_from_environment, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index b6f524e5..05178ab1 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -172,6 +172,9 @@ from .organization_join_response import OrganizationJoinResponse as OrganizationJoinResponse from .organization_update_params import OrganizationUpdateParams as OrganizationUpdateParams from .prebuild_retrieve_response import PrebuildRetrieveResponse as PrebuildRetrieveResponse +from .project_bulk_create_params import ProjectBulkCreateParams as ProjectBulkCreateParams +from .project_bulk_delete_params import ProjectBulkDeleteParams as ProjectBulkDeleteParams +from .project_bulk_update_params import ProjectBulkUpdateParams as ProjectBulkUpdateParams from .runner_configuration_param import RunnerConfigurationParam as RunnerConfigurationParam from .secret_update_value_params import SecretUpdateValueParams as SecretUpdateValueParams from .agent_stop_execution_params import AgentStopExecutionParams as AgentStopExecutionParams @@ -192,6 +195,9 @@ from .organization_retrieve_params import OrganizationRetrieveParams as OrganizationRetrieveParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams from .organization_update_response import OrganizationUpdateResponse as OrganizationUpdateResponse +from .project_bulk_create_response import ProjectBulkCreateResponse as ProjectBulkCreateResponse +from .project_bulk_delete_response import ProjectBulkDeleteResponse as ProjectBulkDeleteResponse +from .project_bulk_update_response import ProjectBulkUpdateResponse as ProjectBulkUpdateResponse from .agent_delete_execution_params import AgentDeleteExecutionParams as AgentDeleteExecutionParams from .environment_initializer_param import EnvironmentInitializerParam as EnvironmentInitializerParam from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse diff --git a/src/gitpod/types/project_bulk_create_params.py b/src/gitpod/types/project_bulk_create_params.py new file mode 100644 index 00000000..5a7eea40 --- /dev/null +++ b/src/gitpod/types/project_bulk_create_params.py @@ -0,0 +1,55 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo +from .environment_initializer_param import EnvironmentInitializerParam +from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam + +__all__ = ["ProjectBulkCreateParams", "Project"] + + +class ProjectBulkCreateParams(TypedDict, total=False): + projects: Iterable[Project] + + +class Project(TypedDict, total=False): + initializer: Required[EnvironmentInitializerParam] + """initializer is the content initializer""" + + automations_file_path: Annotated[str, PropertyInfo(alias="automationsFilePath")] + """ + automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + devcontainer_file_path: Annotated[str, PropertyInfo(alias="devcontainerFilePath")] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + name: str + + prebuild_configuration: Annotated[ProjectPrebuildConfigurationParam, PropertyInfo(alias="prebuildConfiguration")] + """ + prebuild_configuration defines how prebuilds are created for this project. If + not set, prebuilds are disabled for the project. + """ + + technical_description: Annotated[str, PropertyInfo(alias="technicalDescription")] + """ + technical_description is a detailed technical description of the project This + field is not returned by default in GetProject or ListProjects responses 8KB max + """ diff --git a/src/gitpod/types/project_bulk_create_response.py b/src/gitpod/types/project_bulk_create_response.py new file mode 100644 index 00000000..9da43978 --- /dev/null +++ b/src/gitpod/types/project_bulk_create_response.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .project import Project +from .._models import BaseModel + +__all__ = ["ProjectBulkCreateResponse", "FailedProject"] + + +class FailedProject(BaseModel): + error: Optional[str] = None + """error describes why the project creation failed""" + + index: Optional[int] = None + """index is the position in the request array (0-based)""" + + name: Optional[str] = None + """name is the project name that failed""" + + +class ProjectBulkCreateResponse(BaseModel): + created_projects: Optional[List[Project]] = FieldInfo(alias="createdProjects", default=None) + """created_projects contains the successfully created projects""" + + failed_projects: Optional[List[FailedProject]] = FieldInfo(alias="failedProjects", default=None) + """failed_projects contains details about projects that failed to create""" diff --git a/src/gitpod/types/project_bulk_delete_params.py b/src/gitpod/types/project_bulk_delete_params.py new file mode 100644 index 00000000..9a28eff8 --- /dev/null +++ b/src/gitpod/types/project_bulk_delete_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = ["ProjectBulkDeleteParams"] + + +class ProjectBulkDeleteParams(TypedDict, total=False): + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] diff --git a/src/gitpod/types/project_bulk_delete_response.py b/src/gitpod/types/project_bulk_delete_response.py new file mode 100644 index 00000000..f4196013 --- /dev/null +++ b/src/gitpod/types/project_bulk_delete_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["ProjectBulkDeleteResponse", "FailedProject"] + + +class FailedProject(BaseModel): + error: Optional[str] = None + """error describes why the project deletion failed""" + + index: Optional[int] = None + """index is the position in the request array (0-based)""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """project_id is the project ID that failed""" + + +class ProjectBulkDeleteResponse(BaseModel): + deleted_project_ids: Optional[List[str]] = FieldInfo(alias="deletedProjectIds", default=None) + """deleted_project_ids contains the IDs of successfully deleted projects""" + + failed_projects: Optional[List[FailedProject]] = FieldInfo(alias="failedProjects", default=None) + """failed_projects contains details about projects that failed to delete""" diff --git a/src/gitpod/types/project_bulk_update_params.py b/src/gitpod/types/project_bulk_update_params.py new file mode 100644 index 00000000..255cb11b --- /dev/null +++ b/src/gitpod/types/project_bulk_update_params.py @@ -0,0 +1,69 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .recommended_editors_param import RecommendedEditorsParam +from .environment_initializer_param import EnvironmentInitializerParam +from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam + +__all__ = ["ProjectBulkUpdateParams", "Project"] + + +class ProjectBulkUpdateParams(TypedDict, total=False): + projects: Iterable[Project] + + +class Project(TypedDict, total=False): + automations_file_path: Annotated[Optional[str], PropertyInfo(alias="automationsFilePath")] + """ + automations_file_path is the path to the automations file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + devcontainer_file_path: Annotated[Optional[str], PropertyInfo(alias="devcontainerFilePath")] + """ + devcontainer_file_path is the path to the devcontainer file relative to the repo + root path must not be absolute (start with a /): + + ``` + this.matches('^$|^[^/].*') + ``` + """ + + initializer: Optional[EnvironmentInitializerParam] + """initializer is the content initializer""" + + name: Optional[str] + + prebuild_configuration: Annotated[ + Optional[ProjectPrebuildConfigurationParam], PropertyInfo(alias="prebuildConfiguration") + ] + """ + prebuild_configuration defines how prebuilds are created for this project. If + not provided, the existing prebuild configuration is not modified. To disable + prebuilds, set enabled to false. + """ + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" + + recommended_editors: Annotated[Optional[RecommendedEditorsParam], PropertyInfo(alias="recommendedEditors")] + """ + recommended_editors specifies the editors recommended for this project. If not + provided, the existing recommended editors are not modified. To clear all + recommended editors, set to an empty RecommendedEditors message. + """ + + technical_description: Annotated[Optional[str], PropertyInfo(alias="technicalDescription")] + """ + technical_description is a detailed technical description of the project This + field is not returned by default in GetProject or ListProjects responses 8KB max + """ diff --git a/src/gitpod/types/project_bulk_update_response.py b/src/gitpod/types/project_bulk_update_response.py new file mode 100644 index 00000000..c8a3f265 --- /dev/null +++ b/src/gitpod/types/project_bulk_update_response.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .project import Project +from .._models import BaseModel + +__all__ = ["ProjectBulkUpdateResponse", "FailedProject"] + + +class FailedProject(BaseModel): + error: Optional[str] = None + """error describes why the project update failed""" + + index: Optional[int] = None + """index is the position in the request array (0-based)""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """project_id is the project ID that failed""" + + +class ProjectBulkUpdateResponse(BaseModel): + failed_projects: Optional[List[FailedProject]] = FieldInfo(alias="failedProjects", default=None) + """failed_projects contains details about projects that failed to update""" + + updated_projects: Optional[List[Project]] = FieldInfo(alias="updatedProjects", default=None) + """updated_projects contains the successfully updated projects""" diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 8e3985a4..b51a14b7 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -14,6 +14,9 @@ ProjectCreateResponse, ProjectUpdateResponse, ProjectRetrieveResponse, + ProjectBulkCreateResponse, + ProjectBulkDeleteResponse, + ProjectBulkUpdateResponse, ProjectCreateFromEnvironmentResponse, ) from gitpod.pagination import SyncProjectsPage, AsyncProjectsPage @@ -279,6 +282,244 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_bulk_create(self, client: Gitpod) -> None: + project = client.projects.bulk_create() + assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_bulk_create_with_all_params(self, client: Gitpod) -> None: + project = client.projects.bulk_create( + projects=[ + { + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "https://github.com/org/frontend", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "automations_file_path": "automationsFilePath", + "devcontainer_file_path": "devcontainerFilePath", + "name": "Frontend", + "prebuild_configuration": { + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, + "technical_description": "technicalDescription", + }, + { + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "https://github.com/org/backend", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "automations_file_path": "automationsFilePath", + "devcontainer_file_path": "devcontainerFilePath", + "name": "Backend", + "prebuild_configuration": { + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, + "technical_description": "technicalDescription", + }, + ], + ) + assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_bulk_create(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.bulk_create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_bulk_create(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.bulk_create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_bulk_delete(self, client: Gitpod) -> None: + project = client.projects.bulk_delete() + assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_bulk_delete_with_all_params(self, client: Gitpod) -> None: + project = client.projects.bulk_delete( + project_ids=["b0e12f6c-4c67-429d-a4a6-d9838b5da047", "c1f23g7d-5d78-430e-b5b7-e0949c6eb158"], + ) + assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_bulk_delete(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.bulk_delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_bulk_delete(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.bulk_delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_bulk_update(self, client: Gitpod) -> None: + project = client.projects.bulk_update() + assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_bulk_update_with_all_params(self, client: Gitpod) -> None: + project = client.projects.bulk_update( + projects=[ + { + "automations_file_path": "automationsFilePath", + "devcontainer_file_path": "devcontainerFilePath", + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "name": "Updated Frontend", + "prebuild_configuration": { + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, + "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", + "recommended_editors": {"editors": {"foo": {"versions": ["string"]}}}, + "technical_description": "technicalDescription", + }, + { + "automations_file_path": "automationsFilePath", + "devcontainer_file_path": "devcontainerFilePath", + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "name": "Updated Backend", + "prebuild_configuration": { + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, + "project_id": "c1f23g7d-5d78-430e-b5b7-e0949c6eb158", + "recommended_editors": {"editors": {"foo": {"versions": ["string"]}}}, + "technical_description": "technicalDescription", + }, + ], + ) + assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_bulk_update(self, client: Gitpod) -> None: + response = client.projects.with_raw_response.bulk_update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_bulk_update(self, client: Gitpod) -> None: + with client.projects.with_streaming_response.bulk_update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: @@ -577,6 +818,244 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_bulk_create(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.bulk_create() + assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_bulk_create_with_all_params(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.bulk_create( + projects=[ + { + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "https://github.com/org/frontend", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "automations_file_path": "automationsFilePath", + "devcontainer_file_path": "devcontainerFilePath", + "name": "Frontend", + "prebuild_configuration": { + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, + "technical_description": "technicalDescription", + }, + { + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "https://github.com/org/backend", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "automations_file_path": "automationsFilePath", + "devcontainer_file_path": "devcontainerFilePath", + "name": "Backend", + "prebuild_configuration": { + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, + "technical_description": "technicalDescription", + }, + ], + ) + assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_bulk_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.bulk_create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_bulk_create(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.bulk_create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_bulk_delete(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.bulk_delete() + assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_bulk_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.bulk_delete( + project_ids=["b0e12f6c-4c67-429d-a4a6-d9838b5da047", "c1f23g7d-5d78-430e-b5b7-e0949c6eb158"], + ) + assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_bulk_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.bulk_delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_bulk_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.bulk_delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_bulk_update(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.bulk_update() + assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_bulk_update_with_all_params(self, async_client: AsyncGitpod) -> None: + project = await async_client.projects.bulk_update( + projects=[ + { + "automations_file_path": "automationsFilePath", + "devcontainer_file_path": "devcontainerFilePath", + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "name": "Updated Frontend", + "prebuild_configuration": { + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, + "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", + "recommended_editors": {"editors": {"foo": {"versions": ["string"]}}}, + "technical_description": "technicalDescription", + }, + { + "automations_file_path": "automationsFilePath", + "devcontainer_file_path": "devcontainerFilePath", + "initializer": { + "specs": [ + { + "context_url": {"url": "https://example.com"}, + "git": { + "checkout_location": "checkoutLocation", + "clone_target": "cloneTarget", + "remote_uri": "remoteUri", + "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", + "upstream_remote_uri": "upstreamRemoteUri", + }, + } + ] + }, + "name": "Updated Backend", + "prebuild_configuration": { + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, + "project_id": "c1f23g7d-5d78-430e-b5b7-e0949c6eb158", + "recommended_editors": {"editors": {"foo": {"versions": ["string"]}}}, + "technical_description": "technicalDescription", + }, + ], + ) + assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_bulk_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.with_raw_response.bulk_update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_bulk_update(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.with_streaming_response.bulk_update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: From 050a7a0870815c7215781e0cc593690c16c336a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 14:25:12 +0000 Subject: [PATCH 330/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6538ca91..6d78745c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.8.0" + ".": "0.9.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 425c303f..ca81b19a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.8.0" +version = "0.9.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 58df5031..b6b19f6e 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.8.0" # x-release-please-version +__version__ = "0.9.0" # x-release-please-version From fee46c0e537073a9788270af5439cdff6ad9746d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 14:29:16 +0000 Subject: [PATCH 331/505] chore(internal): fix lint error on Python 3.14 --- src/gitpod/_utils/_compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitpod/_utils/_compat.py b/src/gitpod/_utils/_compat.py index dd703233..2c70b299 100644 --- a/src/gitpod/_utils/_compat.py +++ b/src/gitpod/_utils/_compat.py @@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool: else: import types - return tp is Union or tp is types.UnionType + return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap] def is_typeddict(tp: Type[Any]) -> bool: From 83bc2ce131b564c858714f7c51c2546bcf50a5e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 00:07:01 +0000 Subject: [PATCH 332/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index cca37c72..e42f52e1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8f6ee769411e2d21a2f437d49eb2f16880fcef0db52ac1985f2a3963af45f6a0.yml -openapi_spec_hash: 28f2d9d7e36f1f0ecd13052054449249 -config_hash: 3f1278a7a2a9285f57e81f148743e99e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8426aa204132f89d5d5f32747d82c2986f826c9acd0e5367010f04aaaf63f9e2.yml +openapi_spec_hash: e5e60a2fab845cf1d4a0637bf4d63790 +config_hash: 120c7d12a3f057e636ca5d9fb9eeb205 From 70483c79c676f93d3bc50834f4d3ee4a5787e564 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 16:31:06 +0000 Subject: [PATCH 333/505] feat(api): add WARMPOOL_ADMIN and WARMPOOL_VIEWER to ResourceRole --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_role.py | 2 ++ src/gitpod/types/shared_params/resource_role.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e42f52e1..91f8caf3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8426aa204132f89d5d5f32747d82c2986f826c9acd0e5367010f04aaaf63f9e2.yml -openapi_spec_hash: e5e60a2fab845cf1d4a0637bf4d63790 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cdd6702acb1ed8cc46e6f890808cdd543d75f66676afcaf6f823485e1b88bbce.yml +openapi_spec_hash: 03d0cd81b156a89c6a37fc4de3ff48be config_hash: 120c7d12a3f057e636ca5d9fb9eeb205 diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 82289489..c26b9211 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -60,4 +60,6 @@ "RESOURCE_ROLE_WEBHOOK_ADMIN", "RESOURCE_ROLE_WEBHOOK_VIEWER", "RESOURCE_ROLE_WARMPOOL_RUNNER", + "RESOURCE_ROLE_WARMPOOL_ADMIN", + "RESOURCE_ROLE_WARMPOOL_VIEWER", ] diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index dd7e43a1..71d430d8 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -62,4 +62,6 @@ "RESOURCE_ROLE_WEBHOOK_ADMIN", "RESOURCE_ROLE_WEBHOOK_VIEWER", "RESOURCE_ROLE_WARMPOOL_RUNNER", + "RESOURCE_ROLE_WARMPOOL_ADMIN", + "RESOURCE_ROLE_WARMPOOL_VIEWER", ] From 95687736cea6ef4f0553b6a7ca7d1fa136b2587e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 16:58:15 +0000 Subject: [PATCH 334/505] chore: format all `api.md` files --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ca81b19a..e0d80fe6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,7 @@ format = { chain = [ # run formatting again to fix any inconsistencies when imports are stripped "format:ruff", ]} -"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" +"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'" "format:ruff" = "ruff format" "lint" = { chain = [ From f4102364745a1c22fea8941c99b7c021e0c3878f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 18:21:58 +0000 Subject: [PATCH 335/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 91f8caf3..b9c527b1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cdd6702acb1ed8cc46e6f890808cdd543d75f66676afcaf6f823485e1b88bbce.yml -openapi_spec_hash: 03d0cd81b156a89c6a37fc4de3ff48be +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-647a751fe24c378b5e6b20c15a5c779816228f8bae7c3908086747670740d436.yml +openapi_spec_hash: 22107d4d4f497dd47eb6383657dfc4ba config_hash: 120c7d12a3f057e636ca5d9fb9eeb205 From ee86de6f28ca3fedca039ee5a6594455e012c7a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 07:32:07 +0000 Subject: [PATCH 336/505] feat(api): add RUNNER_SIDE_AGENT to RunnerCapability type --- .stats.yml | 4 ++-- src/gitpod/types/runner_capability.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b9c527b1..58f2e0c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-647a751fe24c378b5e6b20c15a5c779816228f8bae7c3908086747670740d436.yml -openapi_spec_hash: 22107d4d4f497dd47eb6383657dfc4ba +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8d8770b1ff17fc5fde74134b1075b82730df35293b6da9d9352c82b1318a5fcd.yml +openapi_spec_hash: 6f9ca02497d5d958fd26e108ddfcb30b config_hash: 120c7d12a3f057e636ca5d9fb9eeb205 diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py index be53db06..4224cfba 100644 --- a/src/gitpod/types/runner_capability.py +++ b/src/gitpod/types/runner_capability.py @@ -15,4 +15,5 @@ "RUNNER_CAPABILITY_PREBUILDS_BEFORE_SNAPSHOT_TRIGGER", "RUNNER_CAPABILITY_LIST_SCM_ORGANIZATIONS", "RUNNER_CAPABILITY_CHECK_REPOSITORY_ACCESS", + "RUNNER_CAPABILITY_RUNNER_SIDE_AGENT", ] From 80d267b2b330132f8c60ce04e0819be057ccf6da Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 11:31:35 +0000 Subject: [PATCH 337/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 58f2e0c0..659ee8df 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8d8770b1ff17fc5fde74134b1075b82730df35293b6da9d9352c82b1318a5fcd.yml -openapi_spec_hash: 6f9ca02497d5d958fd26e108ddfcb30b -config_hash: 120c7d12a3f057e636ca5d9fb9eeb205 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8b950be488319320d56c79d283249f44a7c93230ac1aa59501e53f0638c5c654.yml +openapi_spec_hash: 759b2934961cbba17d9d6adc80abe978 +config_hash: 93f6a624f50b6a337afe6e7d02fd2d9f From a03ce9cbf9846e6eb7acb7d21d6112114df05898 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 16:52:59 +0000 Subject: [PATCH 338/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 659ee8df..120dfe41 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8b950be488319320d56c79d283249f44a7c93230ac1aa59501e53f0638c5c654.yml -openapi_spec_hash: 759b2934961cbba17d9d6adc80abe978 -config_hash: 93f6a624f50b6a337afe6e7d02fd2d9f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6bfb10e82813fa3415f7ce350424221418b6fde16c3ec547c64ad46b68947277.yml +openapi_spec_hash: dea4ce60942cfbc15257e7c5dd57ee54 +config_hash: 318f17b933356b2580853e0380080816 From e78ac0e18bf64b36aea11ec297926fc4f61ac8dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:36:11 +0000 Subject: [PATCH 339/505] feat(api): add audit_only field to executable_deny_list and veto --- .stats.yml | 6 +++--- api.md | 1 + src/gitpod/types/organizations/__init__.py | 1 + src/gitpod/types/organizations/executable_deny_list.py | 4 ++++ .../types/organizations/executable_deny_list_param.py | 4 ++++ src/gitpod/types/organizations/kernel_controls_action.py | 9 +++++++++ src/gitpod/types/veto.py | 4 ++++ src/gitpod/types/veto_param.py | 4 ++++ tests/api_resources/organizations/test_policies.py | 2 ++ tests/api_resources/test_environments.py | 6 ++++++ 10 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/organizations/kernel_controls_action.py diff --git a/.stats.yml b/.stats.yml index 120dfe41..580ffda4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6bfb10e82813fa3415f7ce350424221418b6fde16c3ec547c64ad46b68947277.yml -openapi_spec_hash: dea4ce60942cfbc15257e7c5dd57ee54 -config_hash: 318f17b933356b2580853e0380080816 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cf6d772062952a074c6487c7c272a8dda20a65e238fae2d3163de9b6f4258ae2.yml +openapi_spec_hash: bc02a056a6ab611247ddacc41e4b98a5 +config_hash: 3a29593d2be08d2e9e818d2ac66ef562 diff --git a/api.md b/api.md index cd3547f8..07cfae66 100644 --- a/api.md +++ b/api.md @@ -455,6 +455,7 @@ from gitpod.types.organizations import ( AgentPolicy, CrowdStrikeConfig, ExecutableDenyList, + KernelControlsAction, OrganizationPolicies, SecurityAgentPolicy, PolicyRetrieveResponse, diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index 86ec7aed..8ac82511 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -19,6 +19,7 @@ from .custom_domain_provider import CustomDomainProvider as CustomDomainProvider from .invite_create_response import InviteCreateResponse as InviteCreateResponse from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams +from .kernel_controls_action import KernelControlsAction as KernelControlsAction from .policy_retrieve_params import PolicyRetrieveParams as PolicyRetrieveParams from .sso_configuration_state import SSOConfigurationState as SSOConfigurationState from .invite_retrieve_response import InviteRetrieveResponse as InviteRetrieveResponse diff --git a/src/gitpod/types/organizations/executable_deny_list.py b/src/gitpod/types/organizations/executable_deny_list.py index 0fc4ea34..8430f899 100644 --- a/src/gitpod/types/organizations/executable_deny_list.py +++ b/src/gitpod/types/organizations/executable_deny_list.py @@ -3,6 +3,7 @@ from typing import List, Optional from ..._models import BaseModel +from .kernel_controls_action import KernelControlsAction __all__ = ["ExecutableDenyList"] @@ -12,6 +13,9 @@ class ExecutableDenyList(BaseModel): ExecutableDenyList contains executables that are blocked from execution in environments. """ + action: Optional[KernelControlsAction] = None + """action specifies what action kernel-level controls take on policy violations""" + enabled: Optional[bool] = None """enabled controls whether executable blocking is active""" diff --git a/src/gitpod/types/organizations/executable_deny_list_param.py b/src/gitpod/types/organizations/executable_deny_list_param.py index bfe2677d..472cf6bf 100644 --- a/src/gitpod/types/organizations/executable_deny_list_param.py +++ b/src/gitpod/types/organizations/executable_deny_list_param.py @@ -5,6 +5,7 @@ from typing_extensions import TypedDict from ..._types import SequenceNotStr +from .kernel_controls_action import KernelControlsAction __all__ = ["ExecutableDenyListParam"] @@ -14,6 +15,9 @@ class ExecutableDenyListParam(TypedDict, total=False): ExecutableDenyList contains executables that are blocked from execution in environments. """ + action: KernelControlsAction + """action specifies what action kernel-level controls take on policy violations""" + enabled: bool """enabled controls whether executable blocking is active""" diff --git a/src/gitpod/types/organizations/kernel_controls_action.py b/src/gitpod/types/organizations/kernel_controls_action.py new file mode 100644 index 00000000..d835e49d --- /dev/null +++ b/src/gitpod/types/organizations/kernel_controls_action.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["KernelControlsAction"] + +KernelControlsAction: TypeAlias = Literal[ + "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "KERNEL_CONTROLS_ACTION_BLOCK", "KERNEL_CONTROLS_ACTION_AUDIT" +] diff --git a/src/gitpod/types/veto.py b/src/gitpod/types/veto.py index e01f3abb..029d97c3 100644 --- a/src/gitpod/types/veto.py +++ b/src/gitpod/types/veto.py @@ -3,6 +3,7 @@ from typing import List, Optional from .._models import BaseModel +from .organizations.kernel_controls_action import KernelControlsAction __all__ = ["Veto", "Exec"] @@ -10,6 +11,9 @@ class Exec(BaseModel): """exec controls executable blocking""" + action: Optional[KernelControlsAction] = None + """action specifies what action kernel-level controls take on policy violations""" + denylist: Optional[List[str]] = None """denylist is the list of executable paths or names to block""" diff --git a/src/gitpod/types/veto_param.py b/src/gitpod/types/veto_param.py index ba6d52dd..0234807c 100644 --- a/src/gitpod/types/veto_param.py +++ b/src/gitpod/types/veto_param.py @@ -5,6 +5,7 @@ from typing_extensions import TypedDict from .._types import SequenceNotStr +from .organizations.kernel_controls_action import KernelControlsAction __all__ = ["VetoParam", "Exec"] @@ -12,6 +13,9 @@ class Exec(TypedDict, total=False): """exec controls executable blocking""" + action: KernelControlsAction + """action specifies what action kernel-level controls take on policy violations""" + denylist: SequenceNotStr[str] """denylist is the list of executable paths or names to block""" diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index b7a74d82..21c8ce08 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -79,6 +79,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: delete_archived_environments_after="+9125115.360s", editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, executable_deny_list={ + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "enabled": True, "executables": ["string"], }, @@ -195,6 +196,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> delete_archived_environments_after="+9125115.360s", editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, executable_deny_list={ + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "enabled": True, "executables": ["string"], }, diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 5c33ab50..869f22c1 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -83,6 +83,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "kernel_controls_config": { "veto": { "exec": { + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "denylist": ["string"], "enabled": True, } @@ -227,6 +228,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "kernel_controls_config": { "veto": { "exec": { + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "denylist": ["string"], "enabled": True, } @@ -453,6 +455,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "kernel_controls_config": { "veto": { "exec": { + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "denylist": ["string"], "enabled": True, } @@ -767,6 +770,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "kernel_controls_config": { "veto": { "exec": { + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "denylist": ["string"], "enabled": True, } @@ -911,6 +915,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "kernel_controls_config": { "veto": { "exec": { + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "denylist": ["string"], "enabled": True, } @@ -1137,6 +1142,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "kernel_controls_config": { "veto": { "exec": { + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "denylist": ["string"], "enabled": True, } From 43fdb396588afc7b4a3e52688af45f24517dc58e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:28:26 +0000 Subject: [PATCH 340/505] fix(types): rename ExecutableDenyList to VetoExecPolicy in organizations policies --- .stats.yml | 6 +++--- api.md | 2 +- src/gitpod/resources/organizations/policies.py | 12 +++++------- src/gitpod/types/organizations/__init__.py | 4 ++-- .../types/organizations/organization_policies.py | 9 +++------ .../types/organizations/policy_update_params.py | 9 +++------ .../{executable_deny_list.py => veto_exec_policy.py} | 6 +++--- ..._deny_list_param.py => veto_exec_policy_param.py} | 6 +++--- 8 files changed, 23 insertions(+), 31 deletions(-) rename src/gitpod/types/organizations/{executable_deny_list.py => veto_exec_policy.py} (78%) rename src/gitpod/types/organizations/{executable_deny_list_param.py => veto_exec_policy_param.py} (76%) diff --git a/.stats.yml b/.stats.yml index 580ffda4..c0da6547 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cf6d772062952a074c6487c7c272a8dda20a65e238fae2d3163de9b6f4258ae2.yml -openapi_spec_hash: bc02a056a6ab611247ddacc41e4b98a5 -config_hash: 3a29593d2be08d2e9e818d2ac66ef562 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5a347cba895791d46a4d3c369e7fef031a03b8f8227e0724c09a087da5e245b5.yml +openapi_spec_hash: 8a302d9b615f3f84087acad858f2605a +config_hash: 469d30a2d44895c8c53a5aac370a56f1 diff --git a/api.md b/api.md index 07cfae66..819e682c 100644 --- a/api.md +++ b/api.md @@ -454,10 +454,10 @@ Types: from gitpod.types.organizations import ( AgentPolicy, CrowdStrikeConfig, - ExecutableDenyList, KernelControlsAction, OrganizationPolicies, SecurityAgentPolicy, + VetoExecPolicy, PolicyRetrieveResponse, ) ``` diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 28d2142d..da3cb4d2 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -18,8 +18,8 @@ ) from ..._base_client import make_request_options from ...types.organizations import policy_update_params, policy_retrieve_params +from ...types.organizations.veto_exec_policy_param import VetoExecPolicyParam from ...types.organizations.policy_retrieve_response import PolicyRetrieveResponse -from ...types.organizations.executable_deny_list_param import ExecutableDenyListParam __all__ = ["PoliciesResource", "AsyncPoliciesResource"] @@ -105,7 +105,7 @@ def update( default_environment_image: Optional[str] | Omit = omit, delete_archived_environments_after: Optional[str] | Omit = omit, editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, - executable_deny_list: Optional[ExecutableDenyListParam] | Omit = omit, + executable_deny_list: Optional[VetoExecPolicyParam] | Omit = omit, maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, @@ -182,8 +182,7 @@ def update( editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy with allowed major versions. - executable_deny_list: executable_deny_list contains executables that are blocked from execution in - environments. + executable_deny_list: executable_deny_list contains the veto exec policy for environments. maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 @@ -341,7 +340,7 @@ async def update( default_environment_image: Optional[str] | Omit = omit, delete_archived_environments_after: Optional[str] | Omit = omit, editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, - executable_deny_list: Optional[ExecutableDenyListParam] | Omit = omit, + executable_deny_list: Optional[VetoExecPolicyParam] | Omit = omit, maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, @@ -418,8 +417,7 @@ async def update( editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy with allowed major versions. - executable_deny_list: executable_deny_list contains executables that are blocked from execution in - environments. + executable_deny_list: executable_deny_list contains the veto exec policy for environments. maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index 8ac82511..7a7398e5 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -5,13 +5,13 @@ from .agent_policy import AgentPolicy as AgentPolicy from .custom_domain import CustomDomain as CustomDomain from .provider_type import ProviderType as ProviderType +from .veto_exec_policy import VetoExecPolicy as VetoExecPolicy from .sso_configuration import SSOConfiguration as SSOConfiguration from .scim_configuration import ScimConfiguration as ScimConfiguration from .announcement_banner import AnnouncementBanner as AnnouncementBanner from .crowd_strike_config import CrowdStrikeConfig as CrowdStrikeConfig from .domain_verification import DomainVerification as DomainVerification from .organization_invite import OrganizationInvite as OrganizationInvite -from .executable_deny_list import ExecutableDenyList as ExecutableDenyList from .invite_create_params import InviteCreateParams as InviteCreateParams from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams from .organization_policies import OrganizationPolicies as OrganizationPolicies @@ -21,12 +21,12 @@ from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams from .kernel_controls_action import KernelControlsAction as KernelControlsAction from .policy_retrieve_params import PolicyRetrieveParams as PolicyRetrieveParams +from .veto_exec_policy_param import VetoExecPolicyParam as VetoExecPolicyParam from .sso_configuration_state import SSOConfigurationState as SSOConfigurationState from .invite_retrieve_response import InviteRetrieveResponse as InviteRetrieveResponse from .policy_retrieve_response import PolicyRetrieveResponse as PolicyRetrieveResponse from .domain_verification_state import DomainVerificationState as DomainVerificationState from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams -from .executable_deny_list_param import ExecutableDenyListParam as ExecutableDenyListParam from .custom_domain_create_params import CustomDomainCreateParams as CustomDomainCreateParams from .custom_domain_delete_params import CustomDomainDeleteParams as CustomDomainDeleteParams from .custom_domain_update_params import CustomDomainUpdateParams as CustomDomainUpdateParams diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py index ea62f2eb..6929812c 100644 --- a/src/gitpod/types/organizations/organization_policies.py +++ b/src/gitpod/types/organizations/organization_policies.py @@ -6,7 +6,7 @@ from ..._models import BaseModel from .agent_policy import AgentPolicy -from .executable_deny_list import ExecutableDenyList +from .veto_exec_policy import VetoExecPolicy from .security_agent_policy import SecurityAgentPolicy __all__ = ["OrganizationPolicies", "EditorVersionRestrictions"] @@ -113,11 +113,8 @@ class OrganizationPolicies(BaseModel): of the editor """ - executable_deny_list: Optional[ExecutableDenyList] = FieldInfo(alias="executableDenyList", default=None) - """ - executable_deny_list contains executables that are blocked from execution in - environments. - """ + executable_deny_list: Optional[VetoExecPolicy] = FieldInfo(alias="executableDenyList", default=None) + """executable_deny_list contains the veto exec policy for environments.""" maximum_environment_lifetime: Optional[str] = FieldInfo(alias="maximumEnvironmentLifetime", default=None) """ diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index 33cc3143..d69d2928 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -7,7 +7,7 @@ from ..._types import SequenceNotStr from ..._utils import PropertyInfo -from .executable_deny_list_param import ExecutableDenyListParam +from .veto_exec_policy_param import VetoExecPolicyParam __all__ = [ "PolicyUpdateParams", @@ -64,11 +64,8 @@ class PolicyUpdateParams(TypedDict, total=False): editor ID to version policy with allowed major versions. """ - executable_deny_list: Annotated[Optional[ExecutableDenyListParam], PropertyInfo(alias="executableDenyList")] - """ - executable_deny_list contains executables that are blocked from execution in - environments. - """ + executable_deny_list: Annotated[Optional[VetoExecPolicyParam], PropertyInfo(alias="executableDenyList")] + """executable_deny_list contains the veto exec policy for environments.""" maximum_environment_lifetime: Annotated[Optional[str], PropertyInfo(alias="maximumEnvironmentLifetime")] """ diff --git a/src/gitpod/types/organizations/executable_deny_list.py b/src/gitpod/types/organizations/veto_exec_policy.py similarity index 78% rename from src/gitpod/types/organizations/executable_deny_list.py rename to src/gitpod/types/organizations/veto_exec_policy.py index 8430f899..05e22cbd 100644 --- a/src/gitpod/types/organizations/executable_deny_list.py +++ b/src/gitpod/types/organizations/veto_exec_policy.py @@ -5,12 +5,12 @@ from ..._models import BaseModel from .kernel_controls_action import KernelControlsAction -__all__ = ["ExecutableDenyList"] +__all__ = ["VetoExecPolicy"] -class ExecutableDenyList(BaseModel): +class VetoExecPolicy(BaseModel): """ - ExecutableDenyList contains executables that are blocked from execution in environments. + VetoExecPolicy defines the policy for blocking or auditing executable execution in environments. """ action: Optional[KernelControlsAction] = None diff --git a/src/gitpod/types/organizations/executable_deny_list_param.py b/src/gitpod/types/organizations/veto_exec_policy_param.py similarity index 76% rename from src/gitpod/types/organizations/executable_deny_list_param.py rename to src/gitpod/types/organizations/veto_exec_policy_param.py index 472cf6bf..c328c5c2 100644 --- a/src/gitpod/types/organizations/executable_deny_list_param.py +++ b/src/gitpod/types/organizations/veto_exec_policy_param.py @@ -7,12 +7,12 @@ from ..._types import SequenceNotStr from .kernel_controls_action import KernelControlsAction -__all__ = ["ExecutableDenyListParam"] +__all__ = ["VetoExecPolicyParam"] -class ExecutableDenyListParam(TypedDict, total=False): +class VetoExecPolicyParam(TypedDict, total=False): """ - ExecutableDenyList contains executables that are blocked from execution in environments. + VetoExecPolicy defines the policy for blocking or auditing executable execution in environments. """ action: KernelControlsAction From eb7a20c01e997fe24e1687358e89f36d13424f80 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 16:03:21 +0000 Subject: [PATCH 341/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c0da6547..9d8e308c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5a347cba895791d46a4d3c369e7fef031a03b8f8227e0724c09a087da5e245b5.yml -openapi_spec_hash: 8a302d9b615f3f84087acad858f2605a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-04247bf988645580ef6550363a7279d67d7c844e4310b526b6868be92541199f.yml +openapi_spec_hash: b0f61f1a55a55a187447ff684bf51d3d config_hash: 469d30a2d44895c8c53a5aac370a56f1 From 00bfc7f083044d6ca70f68878b45a3223aa1e4ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 16:56:15 +0000 Subject: [PATCH 342/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6d78745c..091cfb12 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.0" + ".": "0.10.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e0d80fe6..8bc49c47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.9.0" +version = "0.10.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index b6b19f6e..dec0e423 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.9.0" # x-release-please-version +__version__ = "0.10.0" # x-release-please-version From d660a56a0af19d21069f222d2254a0000108f4f6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 17:05:37 +0000 Subject: [PATCH 343/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d8e308c..f91b5129 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-04247bf988645580ef6550363a7279d67d7c844e4310b526b6868be92541199f.yml -openapi_spec_hash: b0f61f1a55a55a187447ff684bf51d3d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1923b5d3865532d64d80c22746aa63991bbf227cf1cbefc8cdb14a374c4c5b89.yml +openapi_spec_hash: 304200ebfa8622f5f6846895528f06e3 config_hash: 469d30a2d44895c8c53a5aac370a56f1 From 40f2ec03959b2890d359ed7f8c7eb70036715f95 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 20:05:51 +0000 Subject: [PATCH 344/505] feat(api): add time range filters to event list method --- .stats.yml | 4 ++-- src/gitpod/resources/events.py | 20 ++++++++++++++++++++ src/gitpod/types/event_list_params.py | 17 +++++++++++++++-- tests/api_resources/test_events.py | 5 +++++ 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index f91b5129..19ac5c03 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1923b5d3865532d64d80c22746aa63991bbf227cf1cbefc8cdb14a374c4c5b89.yml -openapi_spec_hash: 304200ebfa8622f5f6846895528f06e3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-18081d3ce0bf5a7c07f195ffcf7934a53c1822f2439270d4e03b89a3993aa3e1.yml +openapi_spec_hash: 38600260362ddb6b1419e21838e97783 config_hash: 469d30a2d44895c8c53a5aac370a56f1 diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index a37c2a27..6dd3c3d2 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -86,6 +86,16 @@ def list( pageSize: 20 ``` + - Filter by time range: + + ```yaml + filter: + from: "2024-01-01T00:00:00Z" + to: "2024-02-01T00:00:00Z" + pagination: + pageSize: 20 + ``` + Args: pagination: pagination contains the pagination options for listing environments @@ -251,6 +261,16 @@ def list( pageSize: 20 ``` + - Filter by time range: + + ```yaml + filter: + from: "2024-01-01T00:00:00Z" + to: "2024-02-01T00:00:00Z" + pagination: + pageSize: 20 + ``` + Args: pagination: pagination contains the pagination options for listing environments diff --git a/src/gitpod/types/event_list_params.py b/src/gitpod/types/event_list_params.py index 21246d50..85f5eeff 100644 --- a/src/gitpod/types/event_list_params.py +++ b/src/gitpod/types/event_list_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import List +from typing import List, Union +from datetime import datetime from typing_extensions import Annotated, TypedDict from .._types import SequenceNotStr @@ -24,7 +25,16 @@ class EventListParams(TypedDict, total=False): """pagination contains the pagination options for listing environments""" -class Filter(TypedDict, total=False): +_FilterReservedKeywords = TypedDict( + "_FilterReservedKeywords", + { + "from": Union[str, datetime, None], + }, + total=False, +) + + +class Filter(_FilterReservedKeywords, total=False): actor_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="actorIds")] actor_principals: Annotated[List[Principal], PropertyInfo(alias="actorPrincipals")] @@ -33,6 +43,9 @@ class Filter(TypedDict, total=False): subject_types: Annotated[List[ResourceType], PropertyInfo(alias="subjectTypes")] + to: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """to filters audit logs created before this timestamp (exclusive).""" + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing environments""" diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 64aff13d..68c991e7 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -10,6 +10,7 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type from gitpod.types import EventListResponse, EventWatchResponse +from gitpod._utils import parse_datetime from gitpod.pagination import SyncEntriesPage, AsyncEntriesPage from gitpod._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder @@ -34,8 +35,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], "actor_principals": ["PRINCIPAL_USER"], + "from": parse_datetime("2019-12-27T18:11:19.117Z"), "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], + "to": parse_datetime("2019-12-27T18:11:19.117Z"), }, pagination={ "token": "token", @@ -123,8 +126,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], "actor_principals": ["PRINCIPAL_USER"], + "from": parse_datetime("2019-12-27T18:11:19.117Z"), "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], + "to": parse_datetime("2019-12-27T18:11:19.117Z"), }, pagination={ "token": "token", From 3f248fc0c4e0951601550e968abe62b3ef118f79 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 08:55:23 +0000 Subject: [PATCH 345/505] feat(api): add bpf_debug_level field to KernelControlsConfig --- .stats.yml | 6 +++--- api.md | 1 + src/gitpod/types/__init__.py | 1 + src/gitpod/types/bpf_debug_level.py | 7 +++++++ 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/bpf_debug_level.py diff --git a/.stats.yml b/.stats.yml index 19ac5c03..6bc49b87 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-18081d3ce0bf5a7c07f195ffcf7934a53c1822f2439270d4e03b89a3993aa3e1.yml -openapi_spec_hash: 38600260362ddb6b1419e21838e97783 -config_hash: 469d30a2d44895c8c53a5aac370a56f1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-630c480e52441c340adc8a1e95c59e866136b0126b253234bdd578e75cdbbfa8.yml +openapi_spec_hash: 5888d9e3eb30cf12d42cee3ac3932160 +config_hash: b478642d4e5f97aab620afc5c51bb2ea diff --git a/api.md b/api.md index 819e682c..e12de957 100644 --- a/api.md +++ b/api.md @@ -114,6 +114,7 @@ Types: ```python from gitpod.types import ( AdmissionLevel, + BpfDebugLevel, Environment, EnvironmentActivitySignal, EnvironmentMetadata, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 05178ab1..606c5690 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -63,6 +63,7 @@ from .runner_variant import RunnerVariant as RunnerVariant from .admission_level import AdmissionLevel as AdmissionLevel from .agent_execution import AgentExecution as AgentExecution +from .bpf_debug_level import BpfDebugLevel as BpfDebugLevel from .prebuild_status import PrebuildStatus as PrebuildStatus from .prompt_metadata import PromptMetadata as PromptMetadata from .runner_provider import RunnerProvider as RunnerProvider diff --git a/src/gitpod/types/bpf_debug_level.py b/src/gitpod/types/bpf_debug_level.py new file mode 100644 index 00000000..261fb8f5 --- /dev/null +++ b/src/gitpod/types/bpf_debug_level.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["BpfDebugLevel"] + +BpfDebugLevel: TypeAlias = Literal["BPF_DEBUG_LEVEL_UNSPECIFIED", "BPF_DEBUG_LEVEL_INFO", "BPF_DEBUG_LEVEL_VERBOSE"] From accb777e7f92e94a0ade78320d31ae6959260749 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 09:46:19 +0000 Subject: [PATCH 346/505] fix(api): rename executable_deny_list to veto_exec_policy in policies update --- .stats.yml | 4 ++-- .../resources/organizations/policies.py | 16 +++++++-------- .../organizations/organization_policies.py | 6 +++--- .../organizations/policy_update_params.py | 6 +++--- .../organizations/test_policies.py | 20 +++++++++---------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6bc49b87..ae4752ab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-630c480e52441c340adc8a1e95c59e866136b0126b253234bdd578e75cdbbfa8.yml -openapi_spec_hash: 5888d9e3eb30cf12d42cee3ac3932160 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6537d9d31bcf213ac7dab540eebd4b21a511ebb6dc9f602296f13e71aa7c859a.yml +openapi_spec_hash: f6629cb53a0e7f5dc97956e9ae439289 config_hash: b478642d4e5f97aab620afc5c51bb2ea diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index da3cb4d2..16f93586 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -105,7 +105,6 @@ def update( default_environment_image: Optional[str] | Omit = omit, delete_archived_environments_after: Optional[str] | Omit = omit, editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, - executable_deny_list: Optional[VetoExecPolicyParam] | Omit = omit, maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, @@ -116,6 +115,7 @@ def update( require_custom_domain_access: Optional[bool] | Omit = omit, restrict_account_creation_to_scim: Optional[bool] | Omit = omit, security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit, + veto_exec_policy: Optional[VetoExecPolicyParam] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -182,8 +182,6 @@ def update( editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy with allowed major versions. - executable_deny_list: executable_deny_list contains the veto exec policy for environments. - maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 seconds). @@ -216,6 +214,8 @@ def update( security_agent_policy: security_agent_policy contains security agent configuration updates + veto_exec_policy: veto_exec_policy contains the veto exec policy for environments. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -236,7 +236,6 @@ def update( "default_environment_image": default_environment_image, "delete_archived_environments_after": delete_archived_environments_after, "editor_version_restrictions": editor_version_restrictions, - "executable_deny_list": executable_deny_list, "maximum_environment_lifetime": maximum_environment_lifetime, "maximum_environments_per_user": maximum_environments_per_user, "maximum_environment_timeout": maximum_environment_timeout, @@ -247,6 +246,7 @@ def update( "require_custom_domain_access": require_custom_domain_access, "restrict_account_creation_to_scim": restrict_account_creation_to_scim, "security_agent_policy": security_agent_policy, + "veto_exec_policy": veto_exec_policy, }, policy_update_params.PolicyUpdateParams, ), @@ -340,7 +340,6 @@ async def update( default_environment_image: Optional[str] | Omit = omit, delete_archived_environments_after: Optional[str] | Omit = omit, editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, - executable_deny_list: Optional[VetoExecPolicyParam] | Omit = omit, maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, @@ -351,6 +350,7 @@ async def update( require_custom_domain_access: Optional[bool] | Omit = omit, restrict_account_creation_to_scim: Optional[bool] | Omit = omit, security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit, + veto_exec_policy: Optional[VetoExecPolicyParam] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -417,8 +417,6 @@ async def update( editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy with allowed major versions. - executable_deny_list: executable_deny_list contains the veto exec policy for environments. - maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 seconds). @@ -451,6 +449,8 @@ async def update( security_agent_policy: security_agent_policy contains security agent configuration updates + veto_exec_policy: veto_exec_policy contains the veto exec policy for environments. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -471,7 +471,6 @@ async def update( "default_environment_image": default_environment_image, "delete_archived_environments_after": delete_archived_environments_after, "editor_version_restrictions": editor_version_restrictions, - "executable_deny_list": executable_deny_list, "maximum_environment_lifetime": maximum_environment_lifetime, "maximum_environments_per_user": maximum_environments_per_user, "maximum_environment_timeout": maximum_environment_timeout, @@ -482,6 +481,7 @@ async def update( "require_custom_domain_access": require_custom_domain_access, "restrict_account_creation_to_scim": restrict_account_creation_to_scim, "security_agent_policy": security_agent_policy, + "veto_exec_policy": veto_exec_policy, }, policy_update_params.PolicyUpdateParams, ), diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py index 6929812c..3f728ff3 100644 --- a/src/gitpod/types/organizations/organization_policies.py +++ b/src/gitpod/types/organizations/organization_policies.py @@ -113,9 +113,6 @@ class OrganizationPolicies(BaseModel): of the editor """ - executable_deny_list: Optional[VetoExecPolicy] = FieldInfo(alias="executableDenyList", default=None) - """executable_deny_list contains the veto exec policy for environments.""" - maximum_environment_lifetime: Optional[str] = FieldInfo(alias="maximumEnvironmentLifetime", default=None) """ maximum_environment_lifetime controls for how long environments are allowed to @@ -136,3 +133,6 @@ class OrganizationPolicies(BaseModel): organization. When configured, security agents are automatically deployed to all environments. """ + + veto_exec_policy: Optional[VetoExecPolicy] = FieldInfo(alias="vetoExecPolicy", default=None) + """veto_exec_policy contains the veto exec policy for environments.""" diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index d69d2928..b607a7f7 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -64,9 +64,6 @@ class PolicyUpdateParams(TypedDict, total=False): editor ID to version policy with allowed major versions. """ - executable_deny_list: Annotated[Optional[VetoExecPolicyParam], PropertyInfo(alias="executableDenyList")] - """executable_deny_list contains the veto exec policy for environments.""" - maximum_environment_lifetime: Annotated[Optional[str], PropertyInfo(alias="maximumEnvironmentLifetime")] """ maximum_environment_lifetime controls for how long environments are allowed to @@ -127,6 +124,9 @@ class PolicyUpdateParams(TypedDict, total=False): security_agent_policy: Annotated[Optional[SecurityAgentPolicy], PropertyInfo(alias="securityAgentPolicy")] """security_agent_policy contains security agent configuration updates""" + veto_exec_policy: Annotated[Optional[VetoExecPolicyParam], PropertyInfo(alias="vetoExecPolicy")] + """veto_exec_policy contains the veto exec policy for environments.""" + class AgentPolicy(TypedDict, total=False): """agent_policy contains agent-specific policy settings""" diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index 21c8ce08..65bf869c 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -78,11 +78,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: default_environment_image="defaultEnvironmentImage", delete_archived_environments_after="+9125115.360s", editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, - executable_deny_list={ - "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", - "enabled": True, - "executables": ["string"], - }, maximum_environment_lifetime="+9125115.360s", maximum_environments_per_user="20", maximum_environment_timeout="3600s", @@ -101,6 +96,11 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "tags": "tags", } }, + veto_exec_policy={ + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", + "enabled": True, + "executables": ["string"], + }, ) assert_matches_type(object, policy, path=["response"]) @@ -195,11 +195,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> default_environment_image="defaultEnvironmentImage", delete_archived_environments_after="+9125115.360s", editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, - executable_deny_list={ - "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", - "enabled": True, - "executables": ["string"], - }, maximum_environment_lifetime="+9125115.360s", maximum_environments_per_user="20", maximum_environment_timeout="3600s", @@ -218,6 +213,11 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "tags": "tags", } }, + veto_exec_policy={ + "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", + "enabled": True, + "executables": ["string"], + }, ) assert_matches_type(object, policy, path=["response"]) From 5077b7df40a48f96fe89413c698387e5c7055090 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:05:20 +0000 Subject: [PATCH 347/505] chore(internal): remove mock server code --- scripts/mock | 41 ----------------------------------------- scripts/test | 46 ---------------------------------------------- 2 files changed, 87 deletions(-) delete mode 100755 scripts/mock diff --git a/scripts/mock b/scripts/mock deleted file mode 100755 index 0b28f6ea..00000000 --- a/scripts/mock +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -if [[ -n "$1" && "$1" != '--'* ]]; then - URL="$1" - shift -else - URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" -fi - -# Check if the URL is empty -if [ -z "$URL" ]; then - echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" - exit 1 -fi - -echo "==> Starting mock server with URL ${URL}" - -# Run prism mock on the given spec -if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - - # Wait for server to come online - echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do - echo -n "." - sleep 0.1 - done - - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - - echo -else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" -fi diff --git a/scripts/test b/scripts/test index dbeda2d2..39729d09 100755 --- a/scripts/test +++ b/scripts/test @@ -4,53 +4,7 @@ set -e cd "$(dirname "$0")/.." -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -kill_server_on_port() { - pids=$(lsof -t -i tcp:"$1" || echo "") - if [ "$pids" != "" ]; then - kill "$pids" - echo "Stopped $pids." - fi -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if ! is_overriding_api_base_url && ! prism_is_running ; then - # When we exit this script, make sure to kill the background mock server process - trap 'kill_server_on_port 4010' EXIT - - # Start the dev server - ./scripts/mock --daemon -fi - -if is_overriding_api_base_url ; then - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" - echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo -fi export DEFER_PYDANTIC_BUILD=false From dd484c432299b669e2c10587680f7dbc988be1d8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:35:25 +0000 Subject: [PATCH 348/505] chore: update mock server docs --- CONTRIBUTING.md | 7 - .../automations/tasks/test_executions.py | 48 ++--- .../environments/automations/test_services.py | 112 +++++----- .../environments/automations/test_tasks.py | 96 ++++----- .../environments/test_automations.py | 16 +- .../environments/test_classes.py | 16 +- .../api_resources/groups/test_memberships.py | 64 +++--- .../groups/test_role_assignments.py | 48 ++--- tests/api_resources/groups/test_shares.py | 32 +-- .../organizations/test_announcement_banner.py | 28 +-- .../organizations/test_custom_domains.py | 56 ++--- .../test_domain_verifications.py | 64 +++--- .../organizations/test_invites.py | 36 ++-- .../organizations/test_policies.py | 28 +-- .../organizations/test_scim_configurations.py | 88 ++++---- .../organizations/test_sso_configurations.py | 72 +++---- .../projects/test_environment_clases.py | 32 +-- tests/api_resources/projects/test_policies.py | 64 +++--- .../test_environment_classes.py | 64 +++--- .../test_host_authentication_tokens.py | 80 ++++---- .../runners/configurations/test_schema.py | 16 +- .../configurations/test_scm_integrations.py | 80 ++++---- .../runners/test_configurations.py | 16 +- tests/api_resources/runners/test_policies.py | 64 +++--- tests/api_resources/test_accounts.py | 96 ++++----- tests/api_resources/test_agents.py | 192 +++++++++--------- tests/api_resources/test_editors.py | 44 ++-- tests/api_resources/test_environments.py | 184 ++++++++--------- tests/api_resources/test_errors.py | 16 +- tests/api_resources/test_events.py | 32 +-- tests/api_resources/test_gateways.py | 16 +- tests/api_resources/test_groups.py | 80 ++++---- tests/api_resources/test_identity.py | 48 ++--- tests/api_resources/test_organizations.py | 116 +++++------ tests/api_resources/test_prebuilds.py | 80 ++++---- tests/api_resources/test_projects.py | 144 ++++++------- tests/api_resources/test_runners.py | 192 +++++++++--------- tests/api_resources/test_secrets.py | 80 ++++---- tests/api_resources/test_usage.py | 16 +- tests/api_resources/test_users.py | 64 +++--- tests/api_resources/users/test_dotfiles.py | 32 +-- tests/api_resources/users/test_pats.py | 48 ++--- 42 files changed, 1350 insertions(+), 1357 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e1d17a7..1637a470 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,13 +85,6 @@ $ pip install ./path-to-wheel-file.whl ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. - -```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml -``` - ```sh $ ./scripts/test ``` diff --git a/tests/api_resources/environments/automations/tasks/test_executions.py b/tests/api_resources/environments/automations/tasks/test_executions.py index f4d55beb..1d5a2732 100644 --- a/tests/api_resources/environments/automations/tasks/test_executions.py +++ b/tests/api_resources/environments/automations/tasks/test_executions.py @@ -21,13 +21,13 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.retrieve( @@ -35,7 +35,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -45,7 +45,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.retrieve() as response: @@ -57,13 +57,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list() assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.list( @@ -82,7 +82,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.list() @@ -92,7 +92,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(SyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -104,13 +104,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stop(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: execution = client.environments.automations.tasks.executions.stop( @@ -118,7 +118,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.tasks.executions.with_raw_response.stop() @@ -128,7 +128,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: execution = response.parse() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.tasks.executions.with_streaming_response.stop() as response: @@ -146,13 +146,13 @@ class TestAsyncExecutions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.retrieve( @@ -160,7 +160,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve() @@ -170,7 +170,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -184,13 +184,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list() assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.list( @@ -209,7 +209,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.list() @@ -219,7 +219,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(AsyncTaskExecutionsPage[TaskExecution], execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.list() as response: @@ -231,13 +231,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: execution = await async_client.environments.automations.tasks.executions.stop( @@ -245,7 +245,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.executions.with_raw_response.stop() @@ -255,7 +255,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: execution = await response.parse() assert_matches_type(object, execution, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.executions.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index c0db2dcd..3d1ccf73 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -23,13 +23,13 @@ class TestServices: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: service = client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.create( @@ -82,7 +82,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.create() @@ -92,7 +92,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.create() as response: @@ -104,13 +104,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.retrieve( @@ -118,7 +118,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.retrieve() @@ -128,7 +128,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -140,13 +140,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: service = client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.update( @@ -199,7 +199,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.update() @@ -209,7 +209,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.update() as response: @@ -221,13 +221,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: service = client.environments.automations.services.list() assert_matches_type(SyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.list( @@ -246,7 +246,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.list() @@ -256,7 +256,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(SyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.list() as response: @@ -268,13 +268,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: service = client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.delete( @@ -283,7 +283,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.delete() @@ -293,7 +293,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.delete() as response: @@ -305,13 +305,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_start(self, client: Gitpod) -> None: service = client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.start( @@ -319,7 +319,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.start() @@ -329,7 +329,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.start() as response: @@ -341,13 +341,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stop(self, client: Gitpod) -> None: service = client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: service = client.environments.automations.services.stop( @@ -355,7 +355,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.automations.services.with_raw_response.stop() @@ -365,7 +365,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: service = response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.automations.services.with_streaming_response.stop() as response: @@ -383,13 +383,13 @@ class TestAsyncServices: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.create( @@ -442,7 +442,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.create() @@ -452,7 +452,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceCreateResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.create() as response: @@ -464,13 +464,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.retrieve( @@ -478,7 +478,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.retrieve() @@ -488,7 +488,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(ServiceRetrieveResponse, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.retrieve() as response: @@ -500,13 +500,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.update( @@ -559,7 +559,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.update() @@ -569,7 +569,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.update() as response: @@ -581,13 +581,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list() assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.list( @@ -606,7 +606,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.list() @@ -616,7 +616,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(AsyncServicesPage[Service], service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.list() as response: @@ -628,13 +628,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.delete( @@ -643,7 +643,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.delete() @@ -653,7 +653,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.delete() as response: @@ -665,13 +665,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.start( @@ -679,7 +679,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.start() @@ -689,7 +689,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.start() as response: @@ -701,13 +701,13 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: service = await async_client.environments.automations.services.stop( @@ -715,7 +715,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.services.with_raw_response.stop() @@ -725,7 +725,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: service = await response.parse() assert_matches_type(object, service, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.services.with_streaming_response.stop() as response: diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 289d4f4c..242dc25e 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -24,13 +24,13 @@ class TestTasks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.create( @@ -76,7 +76,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.create() @@ -86,7 +86,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.create() as response: @@ -98,13 +98,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.retrieve( @@ -112,7 +112,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.retrieve() @@ -122,7 +122,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -134,13 +134,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.update( @@ -182,7 +182,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.update() @@ -192,7 +192,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.update() as response: @@ -204,13 +204,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list() assert_matches_type(SyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.list( @@ -228,7 +228,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.list() @@ -238,7 +238,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(SyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.list() as response: @@ -250,13 +250,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.delete( @@ -264,7 +264,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.delete() @@ -274,7 +274,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -286,13 +286,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_start(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: task = client.environments.automations.tasks.start( @@ -300,7 +300,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.automations.tasks.with_raw_response.start() @@ -310,7 +310,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: task = response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.automations.tasks.with_streaming_response.start() as response: @@ -328,13 +328,13 @@ class TestAsyncTasks: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.create( @@ -380,7 +380,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.create() @@ -390,7 +390,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskCreateResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.create() as response: @@ -402,13 +402,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.retrieve( @@ -416,7 +416,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.retrieve() @@ -426,7 +426,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskRetrieveResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.retrieve() as response: @@ -438,13 +438,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.update( @@ -486,7 +486,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.update() @@ -496,7 +496,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.update() as response: @@ -508,13 +508,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list() assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.list( @@ -532,7 +532,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.list() @@ -542,7 +542,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(AsyncTasksPage[Task], task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.list() as response: @@ -554,13 +554,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.delete( @@ -568,7 +568,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.delete() @@ -578,7 +578,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(object, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.delete() as response: @@ -590,13 +590,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: task = await async_client.environments.automations.tasks.start( @@ -604,7 +604,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.tasks.with_raw_response.start() @@ -614,7 +614,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: task = await response.parse() assert_matches_type(TaskStartResponse, task, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.tasks.with_streaming_response.start() as response: diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 8a1bfcfb..15f3fe3a 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -17,13 +17,13 @@ class TestAutomations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_upsert(self, client: Gitpod) -> None: automation = client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_upsert_with_all_params(self, client: Gitpod) -> None: automation = client.environments.automations.upsert( @@ -69,7 +69,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_upsert(self, client: Gitpod) -> None: response = client.environments.automations.with_raw_response.upsert() @@ -79,7 +79,7 @@ def test_raw_response_upsert(self, client: Gitpod) -> None: automation = response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_upsert(self, client: Gitpod) -> None: with client.environments.automations.with_streaming_response.upsert() as response: @@ -97,13 +97,13 @@ class TestAsyncAutomations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_upsert(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> None: automation = await async_client.environments.automations.upsert( @@ -149,7 +149,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.automations.with_raw_response.upsert() @@ -159,7 +159,7 @@ async def test_raw_response_upsert(self, async_client: AsyncGitpod) -> None: automation = await response.parse() assert_matches_type(AutomationUpsertResponse, automation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_upsert(self, async_client: AsyncGitpod) -> None: async with async_client.environments.automations.with_streaming_response.upsert() as response: diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index 9f70511b..03ca3bc0 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -18,13 +18,13 @@ class TestClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: class_ = client.environments.classes.list() assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: class_ = client.environments.classes.list( @@ -44,7 +44,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.classes.with_raw_response.list() @@ -54,7 +54,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: class_ = response.parse() assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.classes.with_streaming_response.list() as response: @@ -72,13 +72,13 @@ class TestAsyncClasses: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list() assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: class_ = await async_client.environments.classes.list( @@ -98,7 +98,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.classes.with_raw_response.list() @@ -108,7 +108,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: class_ = await response.parse() assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], class_, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/groups/test_memberships.py b/tests/api_resources/groups/test_memberships.py index 88c7c32b..f73463f5 100644 --- a/tests/api_resources/groups/test_memberships.py +++ b/tests/api_resources/groups/test_memberships.py @@ -22,13 +22,13 @@ class TestMemberships: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: membership = client.groups.memberships.create() assert_matches_type(MembershipCreateResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: membership = client.groups.memberships.create( @@ -40,7 +40,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(MembershipCreateResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.groups.memberships.with_raw_response.create() @@ -50,7 +50,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: membership = response.parse() assert_matches_type(MembershipCreateResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.groups.memberships.with_streaming_response.create() as response: @@ -62,7 +62,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: membership = client.groups.memberships.retrieve( @@ -70,7 +70,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: membership = client.groups.memberships.retrieve( @@ -82,7 +82,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.groups.memberships.with_raw_response.retrieve( @@ -94,7 +94,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: membership = response.parse() assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.groups.memberships.with_streaming_response.retrieve( @@ -108,13 +108,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: membership = client.groups.memberships.list() assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: membership = client.groups.memberships.list( @@ -128,7 +128,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.groups.memberships.with_raw_response.list() @@ -138,7 +138,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: membership = response.parse() assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.groups.memberships.with_streaming_response.list() as response: @@ -150,13 +150,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: membership = client.groups.memberships.delete() assert_matches_type(object, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: membership = client.groups.memberships.delete( @@ -164,7 +164,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.groups.memberships.with_raw_response.delete() @@ -174,7 +174,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: membership = response.parse() assert_matches_type(object, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.groups.memberships.with_streaming_response.delete() as response: @@ -192,13 +192,13 @@ class TestAsyncMemberships: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: membership = await async_client.groups.memberships.create() assert_matches_type(MembershipCreateResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: membership = await async_client.groups.memberships.create( @@ -210,7 +210,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(MembershipCreateResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.memberships.with_raw_response.create() @@ -220,7 +220,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: membership = await response.parse() assert_matches_type(MembershipCreateResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.groups.memberships.with_streaming_response.create() as response: @@ -232,7 +232,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: membership = await async_client.groups.memberships.retrieve( @@ -240,7 +240,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: membership = await async_client.groups.memberships.retrieve( @@ -252,7 +252,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.memberships.with_raw_response.retrieve( @@ -264,7 +264,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: membership = await response.parse() assert_matches_type(MembershipRetrieveResponse, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.groups.memberships.with_streaming_response.retrieve( @@ -278,13 +278,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: membership = await async_client.groups.memberships.list() assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: membership = await async_client.groups.memberships.list( @@ -298,7 +298,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.memberships.with_raw_response.list() @@ -308,7 +308,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: membership = await response.parse() assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.groups.memberships.with_streaming_response.list() as response: @@ -320,13 +320,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: membership = await async_client.groups.memberships.delete() assert_matches_type(object, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: membership = await async_client.groups.memberships.delete( @@ -334,7 +334,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.memberships.with_raw_response.delete() @@ -344,7 +344,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: membership = await response.parse() assert_matches_type(object, membership, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.groups.memberships.with_streaming_response.delete() as response: diff --git a/tests/api_resources/groups/test_role_assignments.py b/tests/api_resources/groups/test_role_assignments.py index a21be7e3..a00ad05b 100644 --- a/tests/api_resources/groups/test_role_assignments.py +++ b/tests/api_resources/groups/test_role_assignments.py @@ -21,13 +21,13 @@ class TestRoleAssignments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: role_assignment = client.groups.role_assignments.create() assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: role_assignment = client.groups.role_assignments.create( @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.groups.role_assignments.with_raw_response.create() @@ -48,7 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: role_assignment = response.parse() assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.groups.role_assignments.with_streaming_response.create() as response: @@ -60,13 +60,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: role_assignment = client.groups.role_assignments.list() assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: role_assignment = client.groups.role_assignments.list( @@ -86,7 +86,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.groups.role_assignments.with_raw_response.list() @@ -96,7 +96,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: role_assignment = response.parse() assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.groups.role_assignments.with_streaming_response.list() as response: @@ -108,13 +108,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: role_assignment = client.groups.role_assignments.delete() assert_matches_type(object, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: role_assignment = client.groups.role_assignments.delete( @@ -122,7 +122,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.groups.role_assignments.with_raw_response.delete() @@ -132,7 +132,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: role_assignment = response.parse() assert_matches_type(object, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.groups.role_assignments.with_streaming_response.delete() as response: @@ -150,13 +150,13 @@ class TestAsyncRoleAssignments: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: role_assignment = await async_client.groups.role_assignments.create() assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: role_assignment = await async_client.groups.role_assignments.create( @@ -167,7 +167,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.role_assignments.with_raw_response.create() @@ -177,7 +177,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: role_assignment = await response.parse() assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.groups.role_assignments.with_streaming_response.create() as response: @@ -189,13 +189,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: role_assignment = await async_client.groups.role_assignments.list() assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: role_assignment = await async_client.groups.role_assignments.list( @@ -215,7 +215,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.role_assignments.with_raw_response.list() @@ -225,7 +225,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: role_assignment = await response.parse() assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.groups.role_assignments.with_streaming_response.list() as response: @@ -237,13 +237,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: role_assignment = await async_client.groups.role_assignments.delete() assert_matches_type(object, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: role_assignment = await async_client.groups.role_assignments.delete( @@ -251,7 +251,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.role_assignments.with_raw_response.delete() @@ -261,7 +261,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: role_assignment = await response.parse() assert_matches_type(object, role_assignment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.groups.role_assignments.with_streaming_response.delete() as response: diff --git a/tests/api_resources/groups/test_shares.py b/tests/api_resources/groups/test_shares.py index 3e0c57f4..b0f649b9 100644 --- a/tests/api_resources/groups/test_shares.py +++ b/tests/api_resources/groups/test_shares.py @@ -16,13 +16,13 @@ class TestShares: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: share = client.groups.shares.create() assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: share = client.groups.shares.create( @@ -34,7 +34,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.groups.shares.with_raw_response.create() @@ -44,7 +44,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: share = response.parse() assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.groups.shares.with_streaming_response.create() as response: @@ -56,13 +56,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: share = client.groups.shares.delete() assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: share = client.groups.shares.delete( @@ -73,7 +73,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.groups.shares.with_raw_response.delete() @@ -83,7 +83,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: share = response.parse() assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.groups.shares.with_streaming_response.delete() as response: @@ -101,13 +101,13 @@ class TestAsyncShares: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: share = await async_client.groups.shares.create() assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: share = await async_client.groups.shares.create( @@ -119,7 +119,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.shares.with_raw_response.create() @@ -129,7 +129,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: share = await response.parse() assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.groups.shares.with_streaming_response.create() as response: @@ -141,13 +141,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: share = await async_client.groups.shares.delete() assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: share = await async_client.groups.shares.delete( @@ -158,7 +158,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.shares.with_raw_response.delete() @@ -168,7 +168,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: share = await response.parse() assert_matches_type(object, share, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.groups.shares.with_streaming_response.delete() as response: diff --git a/tests/api_resources/organizations/test_announcement_banner.py b/tests/api_resources/organizations/test_announcement_banner.py index 2e1c5b8e..5d6e44f8 100644 --- a/tests/api_resources/organizations/test_announcement_banner.py +++ b/tests/api_resources/organizations/test_announcement_banner.py @@ -20,7 +20,7 @@ class TestAnnouncementBanner: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: announcement_banner = client.organizations.announcement_banner.update( @@ -28,7 +28,7 @@ def test_method_update(self, client: Gitpod) -> None: ) assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: announcement_banner = client.organizations.announcement_banner.update( @@ -38,7 +38,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.announcement_banner.with_raw_response.update( @@ -50,7 +50,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: announcement_banner = response.parse() assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.announcement_banner.with_streaming_response.update( @@ -64,7 +64,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get(self, client: Gitpod) -> None: announcement_banner = client.organizations.announcement_banner.get( @@ -72,7 +72,7 @@ def test_method_get(self, client: Gitpod) -> None: ) assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get(self, client: Gitpod) -> None: response = client.organizations.announcement_banner.with_raw_response.get( @@ -84,7 +84,7 @@ def test_raw_response_get(self, client: Gitpod) -> None: announcement_banner = response.parse() assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: with client.organizations.announcement_banner.with_streaming_response.get( @@ -104,7 +104,7 @@ class TestAsyncAnnouncementBanner: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: announcement_banner = await async_client.organizations.announcement_banner.update( @@ -112,7 +112,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: announcement_banner = await async_client.organizations.announcement_banner.update( @@ -122,7 +122,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.announcement_banner.with_raw_response.update( @@ -134,7 +134,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: announcement_banner = await response.parse() assert_matches_type(AnnouncementBannerUpdateResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.announcement_banner.with_streaming_response.update( @@ -148,7 +148,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: announcement_banner = await async_client.organizations.announcement_banner.get( @@ -156,7 +156,7 @@ async def test_method_get(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.announcement_banner.with_raw_response.get( @@ -168,7 +168,7 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: announcement_banner = await response.parse() assert_matches_type(AnnouncementBannerGetResponse, announcement_banner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.announcement_banner.with_streaming_response.get( diff --git a/tests/api_resources/organizations/test_custom_domains.py b/tests/api_resources/organizations/test_custom_domains.py index dd7d86bc..220b14f4 100644 --- a/tests/api_resources/organizations/test_custom_domains.py +++ b/tests/api_resources/organizations/test_custom_domains.py @@ -21,7 +21,7 @@ class TestCustomDomains: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: custom_domain = client.organizations.custom_domains.create( @@ -30,7 +30,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: custom_domain = client.organizations.custom_domains.create( @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.custom_domains.with_raw_response.create( @@ -55,7 +55,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: custom_domain = response.parse() assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.custom_domains.with_streaming_response.create( @@ -70,7 +70,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: custom_domain = client.organizations.custom_domains.retrieve( @@ -78,7 +78,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.custom_domains.with_raw_response.retrieve( @@ -90,7 +90,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: custom_domain = response.parse() assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.custom_domains.with_streaming_response.retrieve( @@ -104,7 +104,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: custom_domain = client.organizations.custom_domains.update( @@ -113,7 +113,7 @@ def test_method_update(self, client: Gitpod) -> None: ) assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: custom_domain = client.organizations.custom_domains.update( @@ -125,7 +125,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.custom_domains.with_raw_response.update( @@ -138,7 +138,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: custom_domain = response.parse() assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.custom_domains.with_streaming_response.update( @@ -153,7 +153,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: custom_domain = client.organizations.custom_domains.delete( @@ -161,7 +161,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.custom_domains.with_raw_response.delete( @@ -173,7 +173,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: custom_domain = response.parse() assert_matches_type(object, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.custom_domains.with_streaming_response.delete( @@ -193,7 +193,7 @@ class TestAsyncCustomDomains: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: custom_domain = await async_client.organizations.custom_domains.create( @@ -202,7 +202,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: custom_domain = await async_client.organizations.custom_domains.create( @@ -214,7 +214,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.custom_domains.with_raw_response.create( @@ -227,7 +227,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: custom_domain = await response.parse() assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.custom_domains.with_streaming_response.create( @@ -242,7 +242,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: custom_domain = await async_client.organizations.custom_domains.retrieve( @@ -250,7 +250,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.custom_domains.with_raw_response.retrieve( @@ -262,7 +262,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: custom_domain = await response.parse() assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.custom_domains.with_streaming_response.retrieve( @@ -276,7 +276,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: custom_domain = await async_client.organizations.custom_domains.update( @@ -285,7 +285,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: custom_domain = await async_client.organizations.custom_domains.update( @@ -297,7 +297,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.custom_domains.with_raw_response.update( @@ -310,7 +310,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: custom_domain = await response.parse() assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.custom_domains.with_streaming_response.update( @@ -325,7 +325,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: custom_domain = await async_client.organizations.custom_domains.delete( @@ -333,7 +333,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.custom_domains.with_raw_response.delete( @@ -345,7 +345,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: custom_domain = await response.parse() assert_matches_type(object, custom_domain, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.custom_domains.with_streaming_response.delete( diff --git a/tests/api_resources/organizations/test_domain_verifications.py b/tests/api_resources/organizations/test_domain_verifications.py index c6c7043e..3a0bb1e5 100644 --- a/tests/api_resources/organizations/test_domain_verifications.py +++ b/tests/api_resources/organizations/test_domain_verifications.py @@ -23,7 +23,7 @@ class TestDomainVerifications: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.create( @@ -32,7 +32,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.create( @@ -45,7 +45,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.create( @@ -60,7 +60,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.retrieve( @@ -68,7 +68,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.retrieve( @@ -80,7 +80,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.retrieve( @@ -94,7 +94,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.list( @@ -102,7 +102,7 @@ def test_method_list(self, client: Gitpod) -> None: ) assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.list( @@ -116,7 +116,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.list( @@ -128,7 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.list( @@ -142,7 +142,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(object, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_verify(self, client: Gitpod) -> None: domain_verification = client.organizations.domain_verifications.verify( @@ -184,7 +184,7 @@ def test_method_verify(self, client: Gitpod) -> None: ) assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_verify(self, client: Gitpod) -> None: response = client.organizations.domain_verifications.with_raw_response.verify( @@ -196,7 +196,7 @@ def test_raw_response_verify(self, client: Gitpod) -> None: domain_verification = response.parse() assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_verify(self, client: Gitpod) -> None: with client.organizations.domain_verifications.with_streaming_response.verify( @@ -216,7 +216,7 @@ class TestAsyncDomainVerifications: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.create( @@ -225,7 +225,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.create( @@ -238,7 +238,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.create( @@ -253,7 +253,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.retrieve( @@ -261,7 +261,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.retrieve( @@ -273,7 +273,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.retrieve( @@ -287,7 +287,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.list( @@ -295,7 +295,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.list( @@ -309,7 +309,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.list( @@ -321,7 +321,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.list( @@ -337,7 +337,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.delete( @@ -345,7 +345,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.delete( @@ -357,7 +357,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(object, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.delete( @@ -371,7 +371,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_verify(self, async_client: AsyncGitpod) -> None: domain_verification = await async_client.organizations.domain_verifications.verify( @@ -379,7 +379,7 @@ async def test_method_verify(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.domain_verifications.with_raw_response.verify( @@ -391,7 +391,7 @@ async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: domain_verification = await response.parse() assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_verify(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.domain_verifications.with_streaming_response.verify( diff --git a/tests/api_resources/organizations/test_invites.py b/tests/api_resources/organizations/test_invites.py index df2e8805..6002e9bb 100644 --- a/tests/api_resources/organizations/test_invites.py +++ b/tests/api_resources/organizations/test_invites.py @@ -21,7 +21,7 @@ class TestInvites: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: invite = client.organizations.invites.create( @@ -29,7 +29,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.create( @@ -41,7 +41,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.create( @@ -55,7 +55,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: invite = client.organizations.invites.retrieve( @@ -63,7 +63,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.retrieve( @@ -75,7 +75,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.retrieve( @@ -89,7 +89,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_summary(self, client: Gitpod) -> None: invite = client.organizations.invites.get_summary( @@ -97,7 +97,7 @@ def test_method_get_summary(self, client: Gitpod) -> None: ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_summary(self, client: Gitpod) -> None: response = client.organizations.invites.with_raw_response.get_summary( @@ -109,7 +109,7 @@ def test_raw_response_get_summary(self, client: Gitpod) -> None: invite = response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_summary(self, client: Gitpod) -> None: with client.organizations.invites.with_streaming_response.get_summary( @@ -129,7 +129,7 @@ class TestAsyncInvites: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.create( @@ -137,7 +137,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.create( @@ -149,7 +149,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteCreateResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.create( @@ -163,7 +163,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.retrieve( @@ -171,7 +171,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.retrieve( @@ -183,7 +183,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: invite = await response.parse() assert_matches_type(InviteRetrieveResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.retrieve( @@ -197,7 +197,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: invite = await async_client.organizations.invites.get_summary( @@ -205,7 +205,7 @@ async def test_method_get_summary(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.invites.with_raw_response.get_summary( @@ -217,7 +217,7 @@ async def test_raw_response_get_summary(self, async_client: AsyncGitpod) -> None invite = await response.parse() assert_matches_type(InviteGetSummaryResponse, invite, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_summary(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.invites.with_streaming_response.get_summary( diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index 65bf869c..7bd6cad2 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -19,7 +19,7 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: policy = client.organizations.policies.retrieve( @@ -27,7 +27,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.policies.with_raw_response.retrieve( @@ -39,7 +39,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.policies.with_streaming_response.retrieve( @@ -53,7 +53,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.organizations.policies.update( @@ -61,7 +61,7 @@ def test_method_update(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.organizations.policies.update( @@ -104,7 +104,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.policies.with_raw_response.update( @@ -116,7 +116,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.policies.with_streaming_response.update( @@ -136,7 +136,7 @@ class TestAsyncPolicies: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: policy = await async_client.organizations.policies.retrieve( @@ -144,7 +144,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.policies.with_raw_response.retrieve( @@ -156,7 +156,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyRetrieveResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.policies.with_streaming_response.retrieve( @@ -170,7 +170,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.organizations.policies.update( @@ -178,7 +178,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.organizations.policies.update( @@ -221,7 +221,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.policies.with_raw_response.update( @@ -233,7 +233,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.policies.with_streaming_response.update( diff --git a/tests/api_resources/organizations/test_scim_configurations.py b/tests/api_resources/organizations/test_scim_configurations.py index 4404e237..2bd96136 100644 --- a/tests/api_resources/organizations/test_scim_configurations.py +++ b/tests/api_resources/organizations/test_scim_configurations.py @@ -24,7 +24,7 @@ class TestScimConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.create( @@ -33,7 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.create( @@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.scim_configurations.with_raw_response.create( @@ -57,7 +57,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: scim_configuration = response.parse() assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.scim_configurations.with_streaming_response.create( @@ -72,7 +72,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.retrieve( @@ -80,7 +80,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.scim_configurations.with_raw_response.retrieve( @@ -92,7 +92,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: scim_configuration = response.parse() assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.scim_configurations.with_streaming_response.retrieve( @@ -106,7 +106,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.update( @@ -114,7 +114,7 @@ def test_method_update(self, client: Gitpod) -> None: ) assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.update( @@ -125,7 +125,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.scim_configurations.with_raw_response.update( @@ -137,7 +137,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: scim_configuration = response.parse() assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.scim_configurations.with_streaming_response.update( @@ -151,13 +151,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.list() assert_matches_type(SyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.list( @@ -170,7 +170,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.scim_configurations.with_raw_response.list() @@ -180,7 +180,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: scim_configuration = response.parse() assert_matches_type(SyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.scim_configurations.with_streaming_response.list() as response: @@ -192,7 +192,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.delete( @@ -200,7 +200,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.scim_configurations.with_raw_response.delete( @@ -212,7 +212,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: scim_configuration = response.parse() assert_matches_type(object, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.scim_configurations.with_streaming_response.delete( @@ -226,7 +226,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_regenerate_token(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.regenerate_token( @@ -234,7 +234,7 @@ def test_method_regenerate_token(self, client: Gitpod) -> None: ) assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_regenerate_token_with_all_params(self, client: Gitpod) -> None: scim_configuration = client.organizations.scim_configurations.regenerate_token( @@ -243,7 +243,7 @@ def test_method_regenerate_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_regenerate_token(self, client: Gitpod) -> None: response = client.organizations.scim_configurations.with_raw_response.regenerate_token( @@ -255,7 +255,7 @@ def test_raw_response_regenerate_token(self, client: Gitpod) -> None: scim_configuration = response.parse() assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_regenerate_token(self, client: Gitpod) -> None: with client.organizations.scim_configurations.with_streaming_response.regenerate_token( @@ -275,7 +275,7 @@ class TestAsyncScimConfigurations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.create( @@ -284,7 +284,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.create( @@ -295,7 +295,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.scim_configurations.with_raw_response.create( @@ -308,7 +308,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: scim_configuration = await response.parse() assert_matches_type(ScimConfigurationCreateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.scim_configurations.with_streaming_response.create( @@ -323,7 +323,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.retrieve( @@ -331,7 +331,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.scim_configurations.with_raw_response.retrieve( @@ -343,7 +343,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: scim_configuration = await response.parse() assert_matches_type(ScimConfigurationRetrieveResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.scim_configurations.with_streaming_response.retrieve( @@ -357,7 +357,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.update( @@ -365,7 +365,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.update( @@ -376,7 +376,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.scim_configurations.with_raw_response.update( @@ -388,7 +388,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: scim_configuration = await response.parse() assert_matches_type(ScimConfigurationUpdateResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.scim_configurations.with_streaming_response.update( @@ -402,13 +402,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.list() assert_matches_type(AsyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.list( @@ -421,7 +421,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.scim_configurations.with_raw_response.list() @@ -431,7 +431,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: scim_configuration = await response.parse() assert_matches_type(AsyncScimConfigurationsPage[ScimConfiguration], scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.scim_configurations.with_streaming_response.list() as response: @@ -443,7 +443,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.delete( @@ -451,7 +451,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.scim_configurations.with_raw_response.delete( @@ -463,7 +463,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: scim_configuration = await response.parse() assert_matches_type(object, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.scim_configurations.with_streaming_response.delete( @@ -477,7 +477,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_regenerate_token(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.regenerate_token( @@ -485,7 +485,7 @@ async def test_method_regenerate_token(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_regenerate_token_with_all_params(self, async_client: AsyncGitpod) -> None: scim_configuration = await async_client.organizations.scim_configurations.regenerate_token( @@ -494,7 +494,7 @@ async def test_method_regenerate_token_with_all_params(self, async_client: Async ) assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_regenerate_token(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.scim_configurations.with_raw_response.regenerate_token( @@ -506,7 +506,7 @@ async def test_raw_response_regenerate_token(self, async_client: AsyncGitpod) -> scim_configuration = await response.parse() assert_matches_type(ScimConfigurationRegenerateTokenResponse, scim_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_regenerate_token(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.scim_configurations.with_streaming_response.regenerate_token( diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 9dd1f95a..7c52f6f9 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -22,7 +22,7 @@ class TestSSOConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( @@ -33,7 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.create( @@ -63,7 +63,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.create( @@ -80,7 +80,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.retrieve( @@ -88,7 +88,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.retrieve( @@ -100,7 +100,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.retrieve( @@ -114,7 +114,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -122,7 +122,7 @@ def test_method_update(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.update( @@ -139,7 +139,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.update( @@ -151,7 +151,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.update( @@ -165,7 +165,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( @@ -173,7 +173,7 @@ def test_method_list(self, client: Gitpod) -> None: ) assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.list( @@ -187,7 +187,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.list( @@ -199,7 +199,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(SyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.list( @@ -213,7 +213,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.delete( @@ -221,7 +221,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.delete( @@ -233,7 +233,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: sso_configuration = response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.delete( @@ -253,7 +253,7 @@ class TestAsyncSSOConfigurations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( @@ -264,7 +264,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( @@ -279,7 +279,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.create( @@ -294,7 +294,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.create( @@ -311,7 +311,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.retrieve( @@ -319,7 +319,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.retrieve( @@ -331,7 +331,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(SSOConfigurationRetrieveResponse, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.retrieve( @@ -345,7 +345,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -353,7 +353,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.update( @@ -370,7 +370,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.update( @@ -382,7 +382,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.update( @@ -396,7 +396,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( @@ -404,7 +404,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.list( @@ -418,7 +418,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.list( @@ -430,7 +430,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(AsyncSSOConfigurationsPage[SSOConfiguration], sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.list( @@ -444,7 +444,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.delete( @@ -452,7 +452,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.delete( @@ -464,7 +464,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: sso_configuration = await response.parse() assert_matches_type(object, sso_configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.sso_configurations.with_streaming_response.delete( diff --git a/tests/api_resources/projects/test_environment_clases.py b/tests/api_resources/projects/test_environment_clases.py index fada14da..325c4ac5 100644 --- a/tests/api_resources/projects/test_environment_clases.py +++ b/tests/api_resources/projects/test_environment_clases.py @@ -18,13 +18,13 @@ class TestEnvironmentClases: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: environment_clase = client.projects.environment_clases.update() assert_matches_type(object, environment_clase, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: environment_clase = client.projects.environment_clases.update( @@ -44,7 +44,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_clase, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.projects.environment_clases.with_raw_response.update() @@ -54,7 +54,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: environment_clase = response.parse() assert_matches_type(object, environment_clase, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.projects.environment_clases.with_streaming_response.update() as response: @@ -66,7 +66,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: environment_clase = client.projects.environment_clases.list() @@ -74,7 +74,7 @@ def test_method_list(self, client: Gitpod) -> None: SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_clase = client.projects.environment_clases.list( @@ -90,7 +90,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.environment_clases.with_raw_response.list() @@ -102,7 +102,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.environment_clases.with_streaming_response.list() as response: @@ -122,13 +122,13 @@ class TestAsyncEnvironmentClases: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: environment_clase = await async_client.projects.environment_clases.update() assert_matches_type(object, environment_clase, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment_clase = await async_client.projects.environment_clases.update( @@ -148,7 +148,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment_clase, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.environment_clases.with_raw_response.update() @@ -158,7 +158,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: environment_clase = await response.parse() assert_matches_type(object, environment_clase, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.environment_clases.with_streaming_response.update() as response: @@ -170,7 +170,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment_clase = await async_client.projects.environment_clases.list() @@ -178,7 +178,7 @@ async def test_method_list(self, async_client: AsyncGitpod) -> None: AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_clase = await async_client.projects.environment_clases.list( @@ -194,7 +194,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.environment_clases.with_raw_response.list() @@ -206,7 +206,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.environment_clases.with_streaming_response.list() as response: diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index 17b49580..057a5773 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -22,13 +22,13 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.create() @@ -48,7 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.create() as response: @@ -60,13 +60,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( @@ -76,7 +76,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.update() @@ -86,7 +86,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.update() as response: @@ -98,13 +98,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.projects.policies.list() assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.list( @@ -118,7 +118,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.list() @@ -128,7 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.list() as response: @@ -140,13 +140,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.delete( @@ -155,7 +155,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.policies.with_raw_response.delete() @@ -165,7 +165,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.policies.with_streaming_response.delete() as response: @@ -183,13 +183,13 @@ class TestAsyncPolicies: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create( @@ -199,7 +199,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.create() @@ -209,7 +209,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.create() as response: @@ -221,13 +221,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update( @@ -237,7 +237,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.update() @@ -247,7 +247,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.update() as response: @@ -259,13 +259,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list() assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.list( @@ -279,7 +279,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.list() @@ -289,7 +289,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.list() as response: @@ -301,13 +301,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete( @@ -316,7 +316,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.policies.with_raw_response.delete() @@ -326,7 +326,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 919e93d8..db474c48 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -22,13 +22,13 @@ class TestEnvironmentClasses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create( @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.create() @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -70,13 +70,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( @@ -84,7 +84,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -94,7 +94,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.retrieve() as response: @@ -106,13 +106,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( @@ -123,7 +123,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.update() @@ -133,7 +133,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.update() as response: @@ -145,13 +145,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list() assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.list( @@ -171,7 +171,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.environment_classes.with_raw_response.list() @@ -181,7 +181,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: environment_class = response.parse() assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.environment_classes.with_streaming_response.list() as response: @@ -199,13 +199,13 @@ class TestAsyncEnvironmentClasses: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.create( @@ -225,7 +225,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.create() @@ -235,7 +235,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.create() as response: @@ -247,13 +247,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( @@ -261,7 +261,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.retrieve() @@ -271,7 +271,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -285,13 +285,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( @@ -302,7 +302,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.update() @@ -312,7 +312,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(object, environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.update() as response: @@ -324,13 +324,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list() assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.list( @@ -350,7 +350,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.environment_classes.with_raw_response.list() @@ -360,7 +360,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: environment_class = await response.parse() assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.environment_classes.with_streaming_response.list() as response: diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index ccfcf9f2..bc411e61 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -23,13 +23,13 @@ class TestHostAuthenticationTokens: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create( @@ -49,7 +49,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -59,7 +59,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.create() as response: @@ -71,13 +71,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( @@ -85,7 +85,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -95,7 +95,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.retrieve() as response: @@ -107,13 +107,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( @@ -125,7 +125,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.update() @@ -135,7 +135,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.update() as response: @@ -147,13 +147,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list() assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.list( @@ -171,7 +171,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -181,7 +181,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.list() as response: @@ -193,13 +193,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( @@ -207,7 +207,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -217,7 +217,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: host_authentication_token = response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.host_authentication_tokens.with_streaming_response.delete() as response: @@ -235,13 +235,13 @@ class TestAsyncHostAuthenticationTokens: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( @@ -261,7 +261,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.create() @@ -271,7 +271,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with ( @@ -285,13 +285,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( @@ -299,7 +299,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.retrieve() @@ -309,7 +309,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with ( @@ -323,13 +323,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( @@ -341,7 +341,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.update() @@ -351,7 +351,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with ( @@ -365,13 +365,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list() assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.list( @@ -389,7 +389,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.list() @@ -399,7 +399,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with ( @@ -413,13 +413,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( @@ -427,7 +427,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.host_authentication_tokens.with_raw_response.delete() @@ -437,7 +437,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: host_authentication_token = await response.parse() assert_matches_type(object, host_authentication_token, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with ( diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index e83271f8..7c5be8ad 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -17,13 +17,13 @@ class TestSchema: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( @@ -31,7 +31,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.schema.with_raw_response.retrieve() @@ -41,7 +41,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: schema = response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.schema.with_streaming_response.retrieve() as response: @@ -59,13 +59,13 @@ class TestAsyncSchema: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( @@ -73,7 +73,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.schema.with_raw_response.retrieve() @@ -83,7 +83,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: schema = await response.parse() assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.schema.with_streaming_response.retrieve() as response: diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index d68d3e88..fd94c6f0 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -22,13 +22,13 @@ class TestScmIntegrations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( @@ -43,7 +43,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.create() @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.create() as response: @@ -65,13 +65,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( @@ -79,7 +79,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -89,7 +89,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -101,13 +101,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( @@ -120,7 +120,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.update() @@ -130,7 +130,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.update() as response: @@ -142,13 +142,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list() assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list( @@ -162,7 +162,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.list() @@ -172,7 +172,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -184,13 +184,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete( @@ -198,7 +198,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -208,7 +208,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: scm_integration = response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: @@ -226,13 +226,13 @@ class TestAsyncScmIntegrations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( @@ -247,7 +247,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.create() @@ -257,7 +257,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.create() as response: @@ -269,13 +269,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( @@ -283,7 +283,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.retrieve() @@ -293,7 +293,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.retrieve() as response: @@ -305,13 +305,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( @@ -324,7 +324,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.update() @@ -334,7 +334,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.update() as response: @@ -346,13 +346,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list() assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.list( @@ -366,7 +366,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.list() @@ -376,7 +376,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.list() as response: @@ -388,13 +388,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete( @@ -402,7 +402,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.scm_integrations.with_raw_response.delete() @@ -412,7 +412,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: scm_integration = await response.parse() assert_matches_type(object, scm_integration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.scm_integrations.with_streaming_response.delete() as response: diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 0672e8e1..3cecfabd 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -17,13 +17,13 @@ class TestConfigurations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_validate(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_validate_with_all_params(self, client: Gitpod) -> None: configuration = client.runners.configurations.validate( @@ -55,7 +55,7 @@ def test_method_validate_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_validate(self, client: Gitpod) -> None: response = client.runners.configurations.with_raw_response.validate() @@ -65,7 +65,7 @@ def test_raw_response_validate(self, client: Gitpod) -> None: configuration = response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_validate(self, client: Gitpod) -> None: with client.runners.configurations.with_streaming_response.validate() as response: @@ -83,13 +83,13 @@ class TestAsyncConfigurations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_validate(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) -> None: configuration = await async_client.runners.configurations.validate( @@ -121,7 +121,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_validate(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.configurations.with_raw_response.validate() @@ -131,7 +131,7 @@ async def test_raw_response_validate(self, async_client: AsyncGitpod) -> None: configuration = await response.parse() assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_validate(self, async_client: AsyncGitpod) -> None: async with async_client.runners.configurations.with_streaming_response.validate() as response: diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index 8fa81fa5..a689f4a5 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -22,13 +22,13 @@ class TestPolicies: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: policy = client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.create() @@ -48,7 +48,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.create() as response: @@ -60,13 +60,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: policy = client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( @@ -76,7 +76,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.update() @@ -86,7 +86,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.update() as response: @@ -98,13 +98,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: policy = client.runners.policies.list() assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.list( @@ -118,7 +118,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.list() @@ -128,7 +128,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.list() as response: @@ -140,13 +140,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: policy = client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.delete( @@ -155,7 +155,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.policies.with_raw_response.delete() @@ -165,7 +165,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: policy = response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.policies.with_streaming_response.delete() as response: @@ -183,13 +183,13 @@ class TestAsyncPolicies: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( @@ -199,7 +199,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.create() @@ -209,7 +209,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyCreateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.create() as response: @@ -221,13 +221,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( @@ -237,7 +237,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.update() @@ -247,7 +247,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.update() as response: @@ -259,13 +259,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list() assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.list( @@ -279,7 +279,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.list() @@ -289,7 +289,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.list() as response: @@ -301,13 +301,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete( @@ -316,7 +316,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.policies.with_raw_response.delete() @@ -326,7 +326,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: policy = await response.parse() assert_matches_type(object, policy, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.policies.with_streaming_response.delete() as response: diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 41f2192e..deade9f3 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -31,13 +31,13 @@ class TestAccounts: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: account = client.accounts.retrieve() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: account = client.accounts.retrieve( @@ -45,7 +45,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.retrieve() @@ -55,7 +55,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.retrieve() as response: @@ -67,7 +67,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: account = client.accounts.delete( @@ -75,7 +75,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: account = client.accounts.delete( @@ -84,7 +84,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.delete( @@ -96,7 +96,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.delete( @@ -110,7 +110,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_sso_login_url(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -118,7 +118,7 @@ def test_method_get_sso_login_url(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: account = client.accounts.get_sso_login_url( @@ -127,7 +127,7 @@ def test_method_get_sso_login_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.get_sso_login_url( @@ -139,7 +139,7 @@ def test_raw_response_get_sso_login_url(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.get_sso_login_url( @@ -153,13 +153,13 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_joinable_organizations(self, client: Gitpod) -> None: account = client.accounts.list_joinable_organizations() assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_joinable_organizations_with_all_params(self, client: Gitpod) -> None: account = client.accounts.list_joinable_organizations( @@ -172,7 +172,7 @@ def test_method_list_joinable_organizations_with_all_params(self, client: Gitpod ) assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_joinable_organizations(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.list_joinable_organizations() @@ -182,7 +182,7 @@ def test_raw_response_list_joinable_organizations(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_joinable_organizations(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.list_joinable_organizations() as response: @@ -194,13 +194,13 @@ def test_streaming_response_list_joinable_organizations(self, client: Gitpod) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_login_providers(self, client: Gitpod) -> None: account = client.accounts.list_login_providers() assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> None: account = client.accounts.list_login_providers( @@ -217,7 +217,7 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No ) assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_login_providers(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.list_login_providers() @@ -227,7 +227,7 @@ def test_raw_response_list_login_providers(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(SyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.list_login_providers() as response: @@ -239,7 +239,7 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_sso_logins(self, client: Gitpod) -> None: account = client.accounts.list_sso_logins( @@ -247,7 +247,7 @@ def test_method_list_sso_logins(self, client: Gitpod) -> None: ) assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_sso_logins_with_all_params(self, client: Gitpod) -> None: account = client.accounts.list_sso_logins( @@ -262,7 +262,7 @@ def test_method_list_sso_logins_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_sso_logins(self, client: Gitpod) -> None: response = client.accounts.with_raw_response.list_sso_logins( @@ -274,7 +274,7 @@ def test_raw_response_list_sso_logins(self, client: Gitpod) -> None: account = response.parse() assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_sso_logins(self, client: Gitpod) -> None: with client.accounts.with_streaming_response.list_sso_logins( @@ -294,13 +294,13 @@ class TestAsyncAccounts: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.retrieve( @@ -308,7 +308,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.retrieve() @@ -318,7 +318,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: account = await response.parse() assert_matches_type(AccountRetrieveResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.retrieve() as response: @@ -330,7 +330,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete( @@ -338,7 +338,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.delete( @@ -347,7 +347,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.delete( @@ -359,7 +359,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: account = await response.parse() assert_matches_type(object, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.delete( @@ -373,7 +373,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -381,7 +381,7 @@ async def test_method_get_sso_login_url(self, async_client: AsyncGitpod) -> None ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_sso_login_url_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.get_sso_login_url( @@ -390,7 +390,7 @@ async def test_method_get_sso_login_url_with_all_params(self, async_client: Asyn ) assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.get_sso_login_url( @@ -402,7 +402,7 @@ async def test_raw_response_get_sso_login_url(self, async_client: AsyncGitpod) - account = await response.parse() assert_matches_type(AccountGetSSOLoginURLResponse, account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.get_sso_login_url( @@ -416,13 +416,13 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_joinable_organizations() assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_joinable_organizations_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_joinable_organizations( @@ -435,7 +435,7 @@ async def test_method_list_joinable_organizations_with_all_params(self, async_cl ) assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.list_joinable_organizations() @@ -445,7 +445,7 @@ async def test_raw_response_list_joinable_organizations(self, async_client: Asyn account = await response.parse() assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.list_joinable_organizations() as response: @@ -457,13 +457,13 @@ async def test_streaming_response_list_joinable_organizations(self, async_client assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_login_providers(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers() assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_login_providers_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_login_providers( @@ -480,7 +480,7 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A ) assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.list_login_providers() @@ -490,7 +490,7 @@ async def test_raw_response_list_login_providers(self, async_client: AsyncGitpod account = await response.parse() assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_login_providers(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.list_login_providers() as response: @@ -502,7 +502,7 @@ async def test_streaming_response_list_login_providers(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_sso_logins(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_sso_logins( @@ -510,7 +510,7 @@ async def test_method_list_sso_logins(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_sso_logins_with_all_params(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_sso_logins( @@ -525,7 +525,7 @@ async def test_method_list_sso_logins_with_all_params(self, async_client: AsyncG ) assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_sso_logins(self, async_client: AsyncGitpod) -> None: response = await async_client.accounts.with_raw_response.list_sso_logins( @@ -537,7 +537,7 @@ async def test_raw_response_list_sso_logins(self, async_client: AsyncGitpod) -> account = await response.parse() assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_sso_logins(self, async_client: AsyncGitpod) -> None: async with async_client.accounts.with_streaming_response.list_sso_logins( diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 979d8ae1..c5c87a4f 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -28,13 +28,13 @@ class TestAgents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_execution_conversation_token(self, client: Gitpod) -> None: agent = client.agents.create_execution_conversation_token() assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_execution_conversation_token_with_all_params(self, client: Gitpod) -> None: agent = client.agents.create_execution_conversation_token( @@ -42,7 +42,7 @@ def test_method_create_execution_conversation_token_with_all_params(self, client ) assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_execution_conversation_token(self, client: Gitpod) -> None: response = client.agents.with_raw_response.create_execution_conversation_token() @@ -52,7 +52,7 @@ def test_raw_response_create_execution_conversation_token(self, client: Gitpod) agent = response.parse() assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_execution_conversation_token(self, client: Gitpod) -> None: with client.agents.with_streaming_response.create_execution_conversation_token() as response: @@ -64,13 +64,13 @@ def test_streaming_response_create_execution_conversation_token(self, client: Gi assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_prompt(self, client: Gitpod) -> None: agent = client.agents.create_prompt() assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_prompt_with_all_params(self, client: Gitpod) -> None: agent = client.agents.create_prompt( @@ -84,7 +84,7 @@ def test_method_create_prompt_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_prompt(self, client: Gitpod) -> None: response = client.agents.with_raw_response.create_prompt() @@ -94,7 +94,7 @@ def test_raw_response_create_prompt(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_prompt(self, client: Gitpod) -> None: with client.agents.with_streaming_response.create_prompt() as response: @@ -106,13 +106,13 @@ def test_streaming_response_create_prompt(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_execution(self, client: Gitpod) -> None: agent = client.agents.delete_execution() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_execution_with_all_params(self, client: Gitpod) -> None: agent = client.agents.delete_execution( @@ -120,7 +120,7 @@ def test_method_delete_execution_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_execution(self, client: Gitpod) -> None: response = client.agents.with_raw_response.delete_execution() @@ -130,7 +130,7 @@ def test_raw_response_delete_execution(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_execution(self, client: Gitpod) -> None: with client.agents.with_streaming_response.delete_execution() as response: @@ -142,13 +142,13 @@ def test_streaming_response_delete_execution(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_prompt(self, client: Gitpod) -> None: agent = client.agents.delete_prompt() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_prompt_with_all_params(self, client: Gitpod) -> None: agent = client.agents.delete_prompt( @@ -156,7 +156,7 @@ def test_method_delete_prompt_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_prompt(self, client: Gitpod) -> None: response = client.agents.with_raw_response.delete_prompt() @@ -166,7 +166,7 @@ def test_raw_response_delete_prompt(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_prompt(self, client: Gitpod) -> None: with client.agents.with_streaming_response.delete_prompt() as response: @@ -178,13 +178,13 @@ def test_streaming_response_delete_prompt(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_executions(self, client: Gitpod) -> None: agent = client.agents.list_executions() assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_executions_with_all_params(self, client: Gitpod) -> None: agent = client.agents.list_executions( @@ -206,7 +206,7 @@ def test_method_list_executions_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_executions(self, client: Gitpod) -> None: response = client.agents.with_raw_response.list_executions() @@ -216,7 +216,7 @@ def test_raw_response_list_executions(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_executions(self, client: Gitpod) -> None: with client.agents.with_streaming_response.list_executions() as response: @@ -228,13 +228,13 @@ def test_streaming_response_list_executions(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_prompts(self, client: Gitpod) -> None: agent = client.agents.list_prompts() assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_prompts_with_all_params(self, client: Gitpod) -> None: agent = client.agents.list_prompts( @@ -254,7 +254,7 @@ def test_method_list_prompts_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_prompts(self, client: Gitpod) -> None: response = client.agents.with_raw_response.list_prompts() @@ -264,7 +264,7 @@ def test_raw_response_list_prompts(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_prompts(self, client: Gitpod) -> None: with client.agents.with_streaming_response.list_prompts() as response: @@ -276,13 +276,13 @@ def test_streaming_response_list_prompts(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_execution(self, client: Gitpod) -> None: agent = client.agents.retrieve_execution() assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_execution_with_all_params(self, client: Gitpod) -> None: agent = client.agents.retrieve_execution( @@ -290,7 +290,7 @@ def test_method_retrieve_execution_with_all_params(self, client: Gitpod) -> None ) assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve_execution(self, client: Gitpod) -> None: response = client.agents.with_raw_response.retrieve_execution() @@ -300,7 +300,7 @@ def test_raw_response_retrieve_execution(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve_execution(self, client: Gitpod) -> None: with client.agents.with_streaming_response.retrieve_execution() as response: @@ -312,13 +312,13 @@ def test_streaming_response_retrieve_execution(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_prompt(self, client: Gitpod) -> None: agent = client.agents.retrieve_prompt() assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_prompt_with_all_params(self, client: Gitpod) -> None: agent = client.agents.retrieve_prompt( @@ -326,7 +326,7 @@ def test_method_retrieve_prompt_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve_prompt(self, client: Gitpod) -> None: response = client.agents.with_raw_response.retrieve_prompt() @@ -336,7 +336,7 @@ def test_raw_response_retrieve_prompt(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve_prompt(self, client: Gitpod) -> None: with client.agents.with_streaming_response.retrieve_prompt() as response: @@ -348,13 +348,13 @@ def test_streaming_response_retrieve_prompt(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_send_to_execution(self, client: Gitpod) -> None: agent = client.agents.send_to_execution() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: agent = client.agents.send_to_execution( @@ -380,7 +380,7 @@ def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_send_to_execution(self, client: Gitpod) -> None: response = client.agents.with_raw_response.send_to_execution() @@ -390,7 +390,7 @@ def test_raw_response_send_to_execution(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_send_to_execution(self, client: Gitpod) -> None: with client.agents.with_streaming_response.send_to_execution() as response: @@ -402,13 +402,13 @@ def test_streaming_response_send_to_execution(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_start_execution(self, client: Gitpod) -> None: agent = client.agents.start_execution() assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: agent = client.agents.start_execution( @@ -445,7 +445,7 @@ def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_start_execution(self, client: Gitpod) -> None: response = client.agents.with_raw_response.start_execution() @@ -455,7 +455,7 @@ def test_raw_response_start_execution(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_start_execution(self, client: Gitpod) -> None: with client.agents.with_streaming_response.start_execution() as response: @@ -467,13 +467,13 @@ def test_streaming_response_start_execution(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stop_execution(self, client: Gitpod) -> None: agent = client.agents.stop_execution() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stop_execution_with_all_params(self, client: Gitpod) -> None: agent = client.agents.stop_execution( @@ -481,7 +481,7 @@ def test_method_stop_execution_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_stop_execution(self, client: Gitpod) -> None: response = client.agents.with_raw_response.stop_execution() @@ -491,7 +491,7 @@ def test_raw_response_stop_execution(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_stop_execution(self, client: Gitpod) -> None: with client.agents.with_streaming_response.stop_execution() as response: @@ -503,13 +503,13 @@ def test_streaming_response_stop_execution(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_prompt(self, client: Gitpod) -> None: agent = client.agents.update_prompt() assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_prompt_with_all_params(self, client: Gitpod) -> None: agent = client.agents.update_prompt( @@ -528,7 +528,7 @@ def test_method_update_prompt_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update_prompt(self, client: Gitpod) -> None: response = client.agents.with_raw_response.update_prompt() @@ -538,7 +538,7 @@ def test_raw_response_update_prompt(self, client: Gitpod) -> None: agent = response.parse() assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update_prompt(self, client: Gitpod) -> None: with client.agents.with_streaming_response.update_prompt() as response: @@ -556,13 +556,13 @@ class TestAsyncAgents: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_execution_conversation_token(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.create_execution_conversation_token() assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_execution_conversation_token_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.create_execution_conversation_token( @@ -570,7 +570,7 @@ async def test_method_create_execution_conversation_token_with_all_params(self, ) assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_execution_conversation_token(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.create_execution_conversation_token() @@ -580,7 +580,7 @@ async def test_raw_response_create_execution_conversation_token(self, async_clie agent = await response.parse() assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_execution_conversation_token(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.create_execution_conversation_token() as response: @@ -592,13 +592,13 @@ async def test_streaming_response_create_execution_conversation_token(self, asyn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_prompt(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.create_prompt() assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.create_prompt( @@ -612,7 +612,7 @@ async def test_method_create_prompt_with_all_params(self, async_client: AsyncGit ) assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_prompt(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.create_prompt() @@ -622,7 +622,7 @@ async def test_raw_response_create_prompt(self, async_client: AsyncGitpod) -> No agent = await response.parse() assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_prompt(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.create_prompt() as response: @@ -634,13 +634,13 @@ async def test_streaming_response_create_prompt(self, async_client: AsyncGitpod) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_execution(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.delete_execution() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_execution_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.delete_execution( @@ -648,7 +648,7 @@ async def test_method_delete_execution_with_all_params(self, async_client: Async ) assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_execution(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.delete_execution() @@ -658,7 +658,7 @@ async def test_raw_response_delete_execution(self, async_client: AsyncGitpod) -> agent = await response.parse() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_execution(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.delete_execution() as response: @@ -670,13 +670,13 @@ async def test_streaming_response_delete_execution(self, async_client: AsyncGitp assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_prompt(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.delete_prompt() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.delete_prompt( @@ -684,7 +684,7 @@ async def test_method_delete_prompt_with_all_params(self, async_client: AsyncGit ) assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_prompt(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.delete_prompt() @@ -694,7 +694,7 @@ async def test_raw_response_delete_prompt(self, async_client: AsyncGitpod) -> No agent = await response.parse() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_prompt(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.delete_prompt() as response: @@ -706,13 +706,13 @@ async def test_streaming_response_delete_prompt(self, async_client: AsyncGitpod) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_executions(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.list_executions() assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_executions_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.list_executions( @@ -734,7 +734,7 @@ async def test_method_list_executions_with_all_params(self, async_client: AsyncG ) assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_executions(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.list_executions() @@ -744,7 +744,7 @@ async def test_raw_response_list_executions(self, async_client: AsyncGitpod) -> agent = await response.parse() assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_executions(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.list_executions() as response: @@ -756,13 +756,13 @@ async def test_streaming_response_list_executions(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_prompts(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.list_prompts() assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_prompts_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.list_prompts( @@ -782,7 +782,7 @@ async def test_method_list_prompts_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_prompts(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.list_prompts() @@ -792,7 +792,7 @@ async def test_raw_response_list_prompts(self, async_client: AsyncGitpod) -> Non agent = await response.parse() assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_prompts(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.list_prompts() as response: @@ -804,13 +804,13 @@ async def test_streaming_response_list_prompts(self, async_client: AsyncGitpod) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_execution(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.retrieve_execution() assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_execution_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.retrieve_execution( @@ -818,7 +818,7 @@ async def test_method_retrieve_execution_with_all_params(self, async_client: Asy ) assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve_execution(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.retrieve_execution() @@ -828,7 +828,7 @@ async def test_raw_response_retrieve_execution(self, async_client: AsyncGitpod) agent = await response.parse() assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve_execution(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.retrieve_execution() as response: @@ -840,13 +840,13 @@ async def test_streaming_response_retrieve_execution(self, async_client: AsyncGi assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_prompt(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.retrieve_prompt() assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.retrieve_prompt( @@ -854,7 +854,7 @@ async def test_method_retrieve_prompt_with_all_params(self, async_client: AsyncG ) assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve_prompt(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.retrieve_prompt() @@ -864,7 +864,7 @@ async def test_raw_response_retrieve_prompt(self, async_client: AsyncGitpod) -> agent = await response.parse() assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve_prompt(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.retrieve_prompt() as response: @@ -876,13 +876,13 @@ async def test_streaming_response_retrieve_prompt(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_send_to_execution(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.send_to_execution() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_send_to_execution_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.send_to_execution( @@ -908,7 +908,7 @@ async def test_method_send_to_execution_with_all_params(self, async_client: Asyn ) assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_send_to_execution(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.send_to_execution() @@ -918,7 +918,7 @@ async def test_raw_response_send_to_execution(self, async_client: AsyncGitpod) - agent = await response.parse() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_send_to_execution(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.send_to_execution() as response: @@ -930,13 +930,13 @@ async def test_streaming_response_send_to_execution(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_start_execution(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.start_execution() assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_start_execution_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.start_execution( @@ -973,7 +973,7 @@ async def test_method_start_execution_with_all_params(self, async_client: AsyncG ) assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_start_execution(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.start_execution() @@ -983,7 +983,7 @@ async def test_raw_response_start_execution(self, async_client: AsyncGitpod) -> agent = await response.parse() assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_start_execution(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.start_execution() as response: @@ -995,13 +995,13 @@ async def test_streaming_response_start_execution(self, async_client: AsyncGitpo assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stop_execution(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.stop_execution() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stop_execution_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.stop_execution( @@ -1009,7 +1009,7 @@ async def test_method_stop_execution_with_all_params(self, async_client: AsyncGi ) assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_stop_execution(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.stop_execution() @@ -1019,7 +1019,7 @@ async def test_raw_response_stop_execution(self, async_client: AsyncGitpod) -> N agent = await response.parse() assert_matches_type(object, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_stop_execution(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.stop_execution() as response: @@ -1031,13 +1031,13 @@ async def test_streaming_response_stop_execution(self, async_client: AsyncGitpod assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_prompt(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.update_prompt() assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.update_prompt( @@ -1056,7 +1056,7 @@ async def test_method_update_prompt_with_all_params(self, async_client: AsyncGit ) assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update_prompt(self, async_client: AsyncGitpod) -> None: response = await async_client.agents.with_raw_response.update_prompt() @@ -1066,7 +1066,7 @@ async def test_raw_response_update_prompt(self, async_client: AsyncGitpod) -> No agent = await response.parse() assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update_prompt(self, async_client: AsyncGitpod) -> None: async with async_client.agents.with_streaming_response.update_prompt() as response: diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 5a6ebcd0..d2a2bcba 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -22,7 +22,7 @@ class TestEditors: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: editor = client.editors.retrieve( @@ -30,7 +30,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.editors.with_raw_response.retrieve( @@ -42,7 +42,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.editors.with_streaming_response.retrieve( @@ -56,13 +56,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: editor = client.editors.list() assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: editor = client.editors.list( @@ -76,7 +76,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.editors.with_raw_response.list() @@ -86,7 +86,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(SyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.editors.with_streaming_response.list() as response: @@ -98,7 +98,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_resolve_url(self, client: Gitpod) -> None: editor = client.editors.resolve_url( @@ -108,7 +108,7 @@ def test_method_resolve_url(self, client: Gitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: editor = client.editors.resolve_url( @@ -119,7 +119,7 @@ def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: response = client.editors.with_raw_response.resolve_url( @@ -133,7 +133,7 @@ def test_raw_response_resolve_url(self, client: Gitpod) -> None: editor = response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_resolve_url(self, client: Gitpod) -> None: with client.editors.with_streaming_response.resolve_url( @@ -155,7 +155,7 @@ class TestAsyncEditors: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( @@ -163,7 +163,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.retrieve( @@ -175,7 +175,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.retrieve( @@ -189,13 +189,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list() assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.list( @@ -209,7 +209,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.list() @@ -219,7 +219,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: editor = await response.parse() assert_matches_type(AsyncEditorsPage[Editor], editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.list() as response: @@ -231,7 +231,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( @@ -241,7 +241,7 @@ async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( @@ -252,7 +252,7 @@ async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: response = await async_client.editors.with_raw_response.resolve_url( @@ -266,7 +266,7 @@ async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None editor = await response.parse() assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: async with async_client.editors.with_streaming_response.resolve_url( diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 869f22c1..f74ce337 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -26,13 +26,13 @@ class TestEnvironments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: environment = client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( @@ -129,7 +129,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create() @@ -139,7 +139,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create() as response: @@ -151,7 +151,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: environment = client.environments.retrieve( @@ -159,7 +159,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.environments.with_raw_response.retrieve( @@ -171,7 +171,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.environments.with_streaming_response.retrieve( @@ -185,13 +185,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: environment = client.environments.update() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: environment = client.environments.update( @@ -253,7 +253,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.environments.with_raw_response.update() @@ -263,7 +263,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.environments.with_streaming_response.update() as response: @@ -275,13 +275,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: environment = client.environments.list() assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: environment = client.environments.list( @@ -304,7 +304,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.environments.with_raw_response.list() @@ -314,7 +314,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(SyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.environments.with_streaming_response.list() as response: @@ -326,13 +326,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: environment = client.environments.delete() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: environment = client.environments.delete( @@ -341,7 +341,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.environments.with_raw_response.delete() @@ -351,7 +351,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.environments.with_streaming_response.delete() as response: @@ -363,7 +363,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_environment_token(self, client: Gitpod) -> None: environment = client.environments.create_environment_token( @@ -371,7 +371,7 @@ def test_method_create_environment_token(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_environment_token(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_environment_token( @@ -383,7 +383,7 @@ def test_raw_response_create_environment_token(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_environment_token(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_environment_token( @@ -397,13 +397,13 @@ def test_streaming_response_create_environment_token(self, client: Gitpod) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_from_project(self, client: Gitpod) -> None: environment = client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_from_project_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_from_project( @@ -501,7 +501,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_from_project(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_from_project() @@ -511,7 +511,7 @@ def test_raw_response_create_from_project(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_from_project(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_from_project() as response: @@ -523,13 +523,13 @@ def test_streaming_response_create_from_project(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_logs_token(self, client: Gitpod) -> None: environment = client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create_logs_token( @@ -537,7 +537,7 @@ def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_logs_token(self, client: Gitpod) -> None: response = client.environments.with_raw_response.create_logs_token() @@ -547,7 +547,7 @@ def test_raw_response_create_logs_token(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: with client.environments.with_streaming_response.create_logs_token() as response: @@ -559,13 +559,13 @@ def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_mark_active(self, client: Gitpod) -> None: environment = client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: environment = client.environments.mark_active( @@ -577,7 +577,7 @@ def test_method_mark_active_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_mark_active(self, client: Gitpod) -> None: response = client.environments.with_raw_response.mark_active() @@ -587,7 +587,7 @@ def test_raw_response_mark_active(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_mark_active(self, client: Gitpod) -> None: with client.environments.with_streaming_response.mark_active() as response: @@ -599,13 +599,13 @@ def test_streaming_response_mark_active(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_start(self, client: Gitpod) -> None: environment = client.environments.start() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( @@ -613,7 +613,7 @@ def test_method_start_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_start(self, client: Gitpod) -> None: response = client.environments.with_raw_response.start() @@ -623,7 +623,7 @@ def test_raw_response_start(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_start(self, client: Gitpod) -> None: with client.environments.with_streaming_response.start() as response: @@ -635,13 +635,13 @@ def test_streaming_response_start(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stop(self, client: Gitpod) -> None: environment = client.environments.stop() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stop_with_all_params(self, client: Gitpod) -> None: environment = client.environments.stop( @@ -649,7 +649,7 @@ def test_method_stop_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_stop(self, client: Gitpod) -> None: response = client.environments.with_raw_response.stop() @@ -659,7 +659,7 @@ def test_raw_response_stop(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_stop(self, client: Gitpod) -> None: with client.environments.with_streaming_response.stop() as response: @@ -671,13 +671,13 @@ def test_streaming_response_stop(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_unarchive(self, client: Gitpod) -> None: environment = client.environments.unarchive() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_unarchive_with_all_params(self, client: Gitpod) -> None: environment = client.environments.unarchive( @@ -685,7 +685,7 @@ def test_method_unarchive_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_unarchive(self, client: Gitpod) -> None: response = client.environments.with_raw_response.unarchive() @@ -695,7 +695,7 @@ def test_raw_response_unarchive(self, client: Gitpod) -> None: environment = response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_unarchive(self, client: Gitpod) -> None: with client.environments.with_streaming_response.unarchive() as response: @@ -713,13 +713,13 @@ class TestAsyncEnvironments: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( @@ -816,7 +816,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create() @@ -826,7 +826,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create() as response: @@ -838,7 +838,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.retrieve( @@ -846,7 +846,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.retrieve( @@ -858,7 +858,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(EnvironmentRetrieveResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.retrieve( @@ -872,13 +872,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.update( @@ -940,7 +940,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.update() @@ -950,7 +950,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.update() as response: @@ -962,13 +962,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list() assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.list( @@ -991,7 +991,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.list() @@ -1001,7 +1001,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(AsyncEnvironmentsPage[Environment], environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.list() as response: @@ -1013,13 +1013,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.delete( @@ -1028,7 +1028,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.delete() @@ -1038,7 +1038,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.delete() as response: @@ -1050,7 +1050,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_environment_token(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_environment_token( @@ -1058,7 +1058,7 @@ async def test_method_create_environment_token(self, async_client: AsyncGitpod) ) assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_environment_token(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_environment_token( @@ -1070,7 +1070,7 @@ async def test_raw_response_create_environment_token(self, async_client: AsyncGi environment = await response.parse() assert_matches_type(EnvironmentCreateEnvironmentTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_environment_token(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_environment_token( @@ -1084,13 +1084,13 @@ async def test_streaming_response_create_environment_token(self, async_client: A assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_from_project(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_from_project_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_from_project( @@ -1188,7 +1188,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_from_project() @@ -1198,7 +1198,7 @@ async def test_raw_response_create_from_project(self, async_client: AsyncGitpod) environment = await response.parse() assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_from_project(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_from_project() as response: @@ -1210,13 +1210,13 @@ async def test_streaming_response_create_from_project(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create_logs_token( @@ -1224,7 +1224,7 @@ async def test_method_create_logs_token_with_all_params(self, async_client: Asyn ) assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.create_logs_token() @@ -1234,7 +1234,7 @@ async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) - environment = await response.parse() assert_matches_type(EnvironmentCreateLogsTokenResponse, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.create_logs_token() as response: @@ -1246,13 +1246,13 @@ async def test_streaming_response_create_logs_token(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_mark_active(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.mark_active( @@ -1264,7 +1264,7 @@ async def test_method_mark_active_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.mark_active() @@ -1274,7 +1274,7 @@ async def test_raw_response_mark_active(self, async_client: AsyncGitpod) -> None environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.mark_active() as response: @@ -1286,13 +1286,13 @@ async def test_streaming_response_mark_active(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_start(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( @@ -1300,7 +1300,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.start() @@ -1310,7 +1310,7 @@ async def test_raw_response_start(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.start() as response: @@ -1322,13 +1322,13 @@ async def test_streaming_response_start(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stop(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.stop( @@ -1336,7 +1336,7 @@ async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.stop() @@ -1346,7 +1346,7 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.stop() as response: @@ -1358,13 +1358,13 @@ async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_unarchive(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.unarchive() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_unarchive_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.unarchive( @@ -1372,7 +1372,7 @@ async def test_method_unarchive_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_unarchive(self, async_client: AsyncGitpod) -> None: response = await async_client.environments.with_raw_response.unarchive() @@ -1382,7 +1382,7 @@ async def test_raw_response_unarchive(self, async_client: AsyncGitpod) -> None: environment = await response.parse() assert_matches_type(object, environment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_unarchive(self, async_client: AsyncGitpod) -> None: async with async_client.environments.with_streaming_response.unarchive() as response: diff --git a/tests/api_resources/test_errors.py b/tests/api_resources/test_errors.py index 4cc33cae..5e342a29 100644 --- a/tests/api_resources/test_errors.py +++ b/tests/api_resources/test_errors.py @@ -17,13 +17,13 @@ class TestErrors: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_report_errors(self, client: Gitpod) -> None: error = client.errors.report_errors() assert_matches_type(object, error, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_report_errors_with_all_params(self, client: Gitpod) -> None: error = client.errors.report_errors( @@ -95,7 +95,7 @@ def test_method_report_errors_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, error, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_report_errors(self, client: Gitpod) -> None: response = client.errors.with_raw_response.report_errors() @@ -105,7 +105,7 @@ def test_raw_response_report_errors(self, client: Gitpod) -> None: error = response.parse() assert_matches_type(object, error, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_report_errors(self, client: Gitpod) -> None: with client.errors.with_streaming_response.report_errors() as response: @@ -123,13 +123,13 @@ class TestAsyncErrors: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_report_errors(self, async_client: AsyncGitpod) -> None: error = await async_client.errors.report_errors() assert_matches_type(object, error, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_report_errors_with_all_params(self, async_client: AsyncGitpod) -> None: error = await async_client.errors.report_errors( @@ -201,7 +201,7 @@ async def test_method_report_errors_with_all_params(self, async_client: AsyncGit ) assert_matches_type(object, error, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_report_errors(self, async_client: AsyncGitpod) -> None: response = await async_client.errors.with_raw_response.report_errors() @@ -211,7 +211,7 @@ async def test_raw_response_report_errors(self, async_client: AsyncGitpod) -> No error = await response.parse() assert_matches_type(object, error, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_report_errors(self, async_client: AsyncGitpod) -> None: async with async_client.errors.with_streaming_response.report_errors() as response: diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 68c991e7..71389707 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -20,13 +20,13 @@ class TestEvents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: event = client.events.list() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: event = client.events.list( @@ -47,7 +47,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.events.with_raw_response.list() @@ -57,7 +57,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: event = response.parse() assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.events.with_streaming_response.list() as response: @@ -69,13 +69,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") @parametrize def test_method_watch(self, client: Gitpod) -> None: event_stream = client.events.watch() assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") @parametrize def test_method_watch_with_all_params(self, client: Gitpod) -> None: event_stream = client.events.watch( @@ -84,7 +84,7 @@ def test_method_watch_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") @parametrize def test_raw_response_watch(self, client: Gitpod) -> None: response = client.events.with_raw_response.watch() @@ -93,7 +93,7 @@ def test_raw_response_watch(self, client: Gitpod) -> None: stream = response.parse() stream.close() - @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") @parametrize def test_streaming_response_watch(self, client: Gitpod) -> None: with client.events.with_streaming_response.watch() as response: @@ -111,13 +111,13 @@ class TestAsyncEvents: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: event = await async_client.events.list( @@ -138,7 +138,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.list() @@ -148,7 +148,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: event = await response.parse() assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.list() as response: @@ -160,13 +160,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") @parametrize async def test_method_watch(self, async_client: AsyncGitpod) -> None: event_stream = await async_client.events.watch() assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") @parametrize async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> None: event_stream = await async_client.events.watch( @@ -175,7 +175,7 @@ async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") @parametrize async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.watch() @@ -184,7 +184,7 @@ async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None: stream = await response.parse() await stream.close() - @pytest.mark.skip(reason="Prism doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") @parametrize async def test_streaming_response_watch(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.watch() as response: diff --git a/tests/api_resources/test_gateways.py b/tests/api_resources/test_gateways.py index b18ceec7..9896a40b 100644 --- a/tests/api_resources/test_gateways.py +++ b/tests/api_resources/test_gateways.py @@ -18,13 +18,13 @@ class TestGateways: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: gateway = client.gateways.list() assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: gateway = client.gateways.list( @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.gateways.with_raw_response.list() @@ -47,7 +47,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: gateway = response.parse() assert_matches_type(SyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.gateways.with_streaming_response.list() as response: @@ -65,13 +65,13 @@ class TestAsyncGateways: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: gateway = await async_client.gateways.list() assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: gateway = await async_client.gateways.list( @@ -84,7 +84,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.gateways.with_raw_response.list() @@ -94,7 +94,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: gateway = await response.parse() assert_matches_type(AsyncGatewaysPage[Gateway], gateway, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.gateways.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index 4a8a1bb4..ccb4f2db 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -23,13 +23,13 @@ class TestGroups: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: group = client.groups.create() assert_matches_type(GroupCreateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: group = client.groups.create( @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(GroupCreateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.groups.with_raw_response.create() @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: group = response.parse() assert_matches_type(GroupCreateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.groups.with_streaming_response.create() as response: @@ -61,13 +61,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: group = client.groups.retrieve() assert_matches_type(GroupRetrieveResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: group = client.groups.retrieve( @@ -75,7 +75,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(GroupRetrieveResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.groups.with_raw_response.retrieve() @@ -85,7 +85,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: group = response.parse() assert_matches_type(GroupRetrieveResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.groups.with_streaming_response.retrieve() as response: @@ -97,13 +97,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: group = client.groups.update() assert_matches_type(GroupUpdateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: group = client.groups.update( @@ -113,7 +113,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(GroupUpdateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.groups.with_raw_response.update() @@ -123,7 +123,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: group = response.parse() assert_matches_type(GroupUpdateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.groups.with_streaming_response.update() as response: @@ -135,13 +135,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: group = client.groups.list() assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: group = client.groups.list( @@ -154,7 +154,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.groups.with_raw_response.list() @@ -164,7 +164,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: group = response.parse() assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.groups.with_streaming_response.list() as response: @@ -176,13 +176,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: group = client.groups.delete() assert_matches_type(object, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: group = client.groups.delete( @@ -190,7 +190,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.groups.with_raw_response.delete() @@ -200,7 +200,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: group = response.parse() assert_matches_type(object, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.groups.with_streaming_response.delete() as response: @@ -218,13 +218,13 @@ class TestAsyncGroups: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.create() assert_matches_type(GroupCreateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.create( @@ -234,7 +234,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(GroupCreateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.with_raw_response.create() @@ -244,7 +244,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: group = await response.parse() assert_matches_type(GroupCreateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.groups.with_streaming_response.create() as response: @@ -256,13 +256,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.retrieve() assert_matches_type(GroupRetrieveResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.retrieve( @@ -270,7 +270,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(GroupRetrieveResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.with_raw_response.retrieve() @@ -280,7 +280,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: group = await response.parse() assert_matches_type(GroupRetrieveResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.groups.with_streaming_response.retrieve() as response: @@ -292,13 +292,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.update() assert_matches_type(GroupUpdateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.update( @@ -308,7 +308,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(GroupUpdateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.with_raw_response.update() @@ -318,7 +318,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: group = await response.parse() assert_matches_type(GroupUpdateResponse, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.groups.with_streaming_response.update() as response: @@ -330,13 +330,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list() assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.list( @@ -349,7 +349,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.with_raw_response.list() @@ -359,7 +359,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: group = await response.parse() assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.groups.with_streaming_response.list() as response: @@ -371,13 +371,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.delete() assert_matches_type(object, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.delete( @@ -385,7 +385,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.groups.with_raw_response.delete() @@ -395,7 +395,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: group = await response.parse() assert_matches_type(object, group, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.groups.with_streaming_response.delete() as response: diff --git a/tests/api_resources/test_identity.py b/tests/api_resources/test_identity.py index de7afdff..a3a45017 100644 --- a/tests/api_resources/test_identity.py +++ b/tests/api_resources/test_identity.py @@ -21,13 +21,13 @@ class TestIdentity: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_exchange_token(self, client: Gitpod) -> None: identity = client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.exchange_token( @@ -35,7 +35,7 @@ def test_method_exchange_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_exchange_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.exchange_token() @@ -45,7 +45,7 @@ def test_raw_response_exchange_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_exchange_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.exchange_token() as response: @@ -57,13 +57,13 @@ def test_streaming_response_exchange_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_authenticated_identity(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_authenticated_identity( @@ -71,7 +71,7 @@ def test_method_get_authenticated_identity_with_all_params(self, client: Gitpod) ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_authenticated_identity() @@ -81,7 +81,7 @@ def test_raw_response_get_authenticated_identity(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_authenticated_identity() as response: @@ -93,13 +93,13 @@ def test_streaming_response_get_authenticated_identity(self, client: Gitpod) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_id_token(self, client: Gitpod) -> None: identity = client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: identity = client.identity.get_id_token( @@ -108,7 +108,7 @@ def test_method_get_id_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_id_token(self, client: Gitpod) -> None: response = client.identity.with_raw_response.get_id_token() @@ -118,7 +118,7 @@ def test_raw_response_get_id_token(self, client: Gitpod) -> None: identity = response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_id_token(self, client: Gitpod) -> None: with client.identity.with_streaming_response.get_id_token() as response: @@ -136,13 +136,13 @@ class TestAsyncIdentity: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_exchange_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_exchange_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.exchange_token( @@ -150,7 +150,7 @@ async def test_method_exchange_token_with_all_params(self, async_client: AsyncGi ) assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.exchange_token() @@ -160,7 +160,7 @@ async def test_raw_response_exchange_token(self, async_client: AsyncGitpod) -> N identity = await response.parse() assert_matches_type(IdentityExchangeTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.exchange_token() as response: @@ -172,13 +172,13 @@ async def test_streaming_response_exchange_token(self, async_client: AsyncGitpod assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_authenticated_identity_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_authenticated_identity( @@ -186,7 +186,7 @@ async def test_method_get_authenticated_identity_with_all_params(self, async_cli ) assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_authenticated_identity() @@ -196,7 +196,7 @@ async def test_raw_response_get_authenticated_identity(self, async_client: Async identity = await response.parse() assert_matches_type(IdentityGetAuthenticatedIdentityResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_authenticated_identity(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_authenticated_identity() as response: @@ -208,13 +208,13 @@ async def test_streaming_response_get_authenticated_identity(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_id_token(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitpod) -> None: identity = await async_client.identity.get_id_token( @@ -223,7 +223,7 @@ async def test_method_get_id_token_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> None: response = await async_client.identity.with_raw_response.get_id_token() @@ -233,7 +233,7 @@ async def test_raw_response_get_id_token(self, async_client: AsyncGitpod) -> Non identity = await response.parse() assert_matches_type(IdentityGetIDTokenResponse, identity, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_id_token(self, async_client: AsyncGitpod) -> None: async with async_client.identity.with_streaming_response.get_id_token() as response: diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index a8653c7c..18299d24 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -24,7 +24,7 @@ class TestOrganizations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: organization = client.organizations.create( @@ -32,7 +32,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.create( @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.create( @@ -54,7 +54,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.create( @@ -68,7 +68,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: organization = client.organizations.retrieve( @@ -76,7 +76,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.retrieve( @@ -88,7 +88,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.retrieve( @@ -102,7 +102,7 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -110,7 +110,7 @@ def test_method_update(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.update( @@ -120,7 +120,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.update( @@ -132,7 +132,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.update( @@ -146,7 +146,7 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: organization = client.organizations.delete( @@ -154,7 +154,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.delete( @@ -166,7 +166,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.delete( @@ -180,13 +180,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_join(self, client: Gitpod) -> None: organization = client.organizations.join() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_join_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.join( @@ -195,7 +195,7 @@ def test_method_join_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_join(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.join() @@ -205,7 +205,7 @@ def test_raw_response_join(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_join(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.join() as response: @@ -217,7 +217,7 @@ def test_streaming_response_join(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_leave(self, client: Gitpod) -> None: organization = client.organizations.leave( @@ -225,7 +225,7 @@ def test_method_leave(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_leave(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.leave( @@ -237,7 +237,7 @@ def test_raw_response_leave(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_leave(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.leave( @@ -251,7 +251,7 @@ def test_streaming_response_leave(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_members(self, client: Gitpod) -> None: organization = client.organizations.list_members( @@ -259,7 +259,7 @@ def test_method_list_members(self, client: Gitpod) -> None: ) assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.list_members( @@ -284,7 +284,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_members(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.list_members( @@ -296,7 +296,7 @@ def test_raw_response_list_members(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(SyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_members(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.list_members( @@ -310,7 +310,7 @@ def test_streaming_response_list_members(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_set_role(self, client: Gitpod) -> None: organization = client.organizations.set_role( @@ -319,7 +319,7 @@ def test_method_set_role(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_set_role_with_all_params(self, client: Gitpod) -> None: organization = client.organizations.set_role( @@ -329,7 +329,7 @@ def test_method_set_role_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_set_role(self, client: Gitpod) -> None: response = client.organizations.with_raw_response.set_role( @@ -342,7 +342,7 @@ def test_raw_response_set_role(self, client: Gitpod) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_set_role(self, client: Gitpod) -> None: with client.organizations.with_streaming_response.set_role( @@ -363,7 +363,7 @@ class TestAsyncOrganizations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( @@ -371,7 +371,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.create( @@ -381,7 +381,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.create( @@ -393,7 +393,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.create( @@ -407,7 +407,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.retrieve( @@ -415,7 +415,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.retrieve( @@ -427,7 +427,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationRetrieveResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.retrieve( @@ -441,7 +441,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -449,7 +449,7 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.update( @@ -459,7 +459,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.update( @@ -471,7 +471,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.update( @@ -485,7 +485,7 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.delete( @@ -493,7 +493,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.delete( @@ -505,7 +505,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.delete( @@ -519,13 +519,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_join(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_join_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.join( @@ -534,7 +534,7 @@ async def test_method_join_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_join(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.join() @@ -544,7 +544,7 @@ async def test_raw_response_join(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(OrganizationJoinResponse, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_join(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.join() as response: @@ -556,7 +556,7 @@ async def test_streaming_response_join(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_leave(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.leave( @@ -564,7 +564,7 @@ async def test_method_leave(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.leave( @@ -576,7 +576,7 @@ async def test_raw_response_leave(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.leave( @@ -590,7 +590,7 @@ async def test_streaming_response_leave(self, async_client: AsyncGitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_members(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( @@ -598,7 +598,7 @@ async def test_method_list_members(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.list_members( @@ -623,7 +623,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.list_members( @@ -635,7 +635,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGitpod) -> Non organization = await response.parse() assert_matches_type(AsyncMembersPage[OrganizationMember], organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.list_members( @@ -649,7 +649,7 @@ async def test_streaming_response_list_members(self, async_client: AsyncGitpod) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_set_role(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( @@ -658,7 +658,7 @@ async def test_method_set_role(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) -> None: organization = await async_client.organizations.set_role( @@ -668,7 +668,7 @@ async def test_method_set_role_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.with_raw_response.set_role( @@ -681,7 +681,7 @@ async def test_raw_response_set_role(self, async_client: AsyncGitpod) -> None: organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_set_role(self, async_client: AsyncGitpod) -> None: async with async_client.organizations.with_streaming_response.set_role( diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py index 8d1518e7..53eb090e 100644 --- a/tests/api_resources/test_prebuilds.py +++ b/tests/api_resources/test_prebuilds.py @@ -24,7 +24,7 @@ class TestPrebuilds: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: prebuild = client.prebuilds.create( @@ -33,7 +33,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: prebuild = client.prebuilds.create( @@ -47,7 +47,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.prebuilds.with_raw_response.create( @@ -60,7 +60,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: prebuild = response.parse() assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.prebuilds.with_streaming_response.create( @@ -75,7 +75,7 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: prebuild = client.prebuilds.retrieve( @@ -83,7 +83,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: ) assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.prebuilds.with_raw_response.retrieve( @@ -95,7 +95,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: prebuild = response.parse() assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.prebuilds.with_streaming_response.retrieve( @@ -109,13 +109,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: prebuild = client.prebuilds.list() assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: prebuild = client.prebuilds.list( @@ -135,7 +135,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.prebuilds.with_raw_response.list() @@ -145,7 +145,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: prebuild = response.parse() assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.prebuilds.with_streaming_response.list() as response: @@ -157,7 +157,7 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: prebuild = client.prebuilds.delete( @@ -165,7 +165,7 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.prebuilds.with_raw_response.delete( @@ -177,7 +177,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: prebuild = response.parse() assert_matches_type(object, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.prebuilds.with_streaming_response.delete( @@ -191,7 +191,7 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_cancel(self, client: Gitpod) -> None: prebuild = client.prebuilds.cancel( @@ -199,7 +199,7 @@ def test_method_cancel(self, client: Gitpod) -> None: ) assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_cancel(self, client: Gitpod) -> None: response = client.prebuilds.with_raw_response.cancel( @@ -211,7 +211,7 @@ def test_raw_response_cancel(self, client: Gitpod) -> None: prebuild = response.parse() assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_cancel(self, client: Gitpod) -> None: with client.prebuilds.with_streaming_response.cancel( @@ -225,7 +225,7 @@ def test_streaming_response_cancel(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_logs_token(self, client: Gitpod) -> None: prebuild = client.prebuilds.create_logs_token( @@ -233,7 +233,7 @@ def test_method_create_logs_token(self, client: Gitpod) -> None: ) assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_logs_token(self, client: Gitpod) -> None: response = client.prebuilds.with_raw_response.create_logs_token( @@ -245,7 +245,7 @@ def test_raw_response_create_logs_token(self, client: Gitpod) -> None: prebuild = response.parse() assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: with client.prebuilds.with_streaming_response.create_logs_token( @@ -265,7 +265,7 @@ class TestAsyncPrebuilds: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: prebuild = await async_client.prebuilds.create( @@ -274,7 +274,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: prebuild = await async_client.prebuilds.create( @@ -288,7 +288,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.prebuilds.with_raw_response.create( @@ -301,7 +301,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: prebuild = await response.parse() assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.prebuilds.with_streaming_response.create( @@ -316,7 +316,7 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: prebuild = await async_client.prebuilds.retrieve( @@ -324,7 +324,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.prebuilds.with_raw_response.retrieve( @@ -336,7 +336,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: prebuild = await response.parse() assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.prebuilds.with_streaming_response.retrieve( @@ -350,13 +350,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: prebuild = await async_client.prebuilds.list() assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: prebuild = await async_client.prebuilds.list( @@ -376,7 +376,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.prebuilds.with_raw_response.list() @@ -386,7 +386,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: prebuild = await response.parse() assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.prebuilds.with_streaming_response.list() as response: @@ -398,7 +398,7 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: prebuild = await async_client.prebuilds.delete( @@ -406,7 +406,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.prebuilds.with_raw_response.delete( @@ -418,7 +418,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: prebuild = await response.parse() assert_matches_type(object, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.prebuilds.with_streaming_response.delete( @@ -432,7 +432,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_cancel(self, async_client: AsyncGitpod) -> None: prebuild = await async_client.prebuilds.cancel( @@ -440,7 +440,7 @@ async def test_method_cancel(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_cancel(self, async_client: AsyncGitpod) -> None: response = await async_client.prebuilds.with_raw_response.cancel( @@ -452,7 +452,7 @@ async def test_raw_response_cancel(self, async_client: AsyncGitpod) -> None: prebuild = await response.parse() assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_cancel(self, async_client: AsyncGitpod) -> None: async with async_client.prebuilds.with_streaming_response.cancel( @@ -466,7 +466,7 @@ async def test_streaming_response_cancel(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: prebuild = await async_client.prebuilds.create_logs_token( @@ -474,7 +474,7 @@ async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None ) assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: response = await async_client.prebuilds.with_raw_response.create_logs_token( @@ -486,7 +486,7 @@ async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) - prebuild = await response.parse() assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: async with async_client.prebuilds.with_streaming_response.create_logs_token( diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index b51a14b7..0418b6f2 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -27,7 +27,7 @@ class TestProjects: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( @@ -35,7 +35,7 @@ def test_method_create(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( @@ -71,7 +71,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( @@ -83,7 +83,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( @@ -97,13 +97,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: project = client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( @@ -111,7 +111,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.projects.with_raw_response.retrieve() @@ -121,7 +121,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.projects.with_streaming_response.retrieve() as response: @@ -133,13 +133,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: project = client.projects.update() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: project = client.projects.update( @@ -177,7 +177,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.projects.with_raw_response.update() @@ -187,7 +187,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.projects.with_streaming_response.update() as response: @@ -199,13 +199,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: project = client.projects.list() assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: project = client.projects.list( @@ -224,7 +224,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.projects.with_raw_response.list() @@ -234,7 +234,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.projects.with_streaming_response.list() as response: @@ -246,13 +246,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: project = client.projects.delete() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: project = client.projects.delete( @@ -260,7 +260,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.projects.with_raw_response.delete() @@ -270,7 +270,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.projects.with_streaming_response.delete() as response: @@ -282,13 +282,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_create(self, client: Gitpod) -> None: project = client.projects.bulk_create() assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.bulk_create( @@ -359,7 +359,7 @@ def test_method_bulk_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_bulk_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.bulk_create() @@ -369,7 +369,7 @@ def test_raw_response_bulk_create(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_bulk_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.bulk_create() as response: @@ -381,13 +381,13 @@ def test_streaming_response_bulk_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_delete(self, client: Gitpod) -> None: project = client.projects.bulk_delete() assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_delete_with_all_params(self, client: Gitpod) -> None: project = client.projects.bulk_delete( @@ -395,7 +395,7 @@ def test_method_bulk_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_bulk_delete(self, client: Gitpod) -> None: response = client.projects.with_raw_response.bulk_delete() @@ -405,7 +405,7 @@ def test_raw_response_bulk_delete(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_bulk_delete(self, client: Gitpod) -> None: with client.projects.with_streaming_response.bulk_delete() as response: @@ -417,13 +417,13 @@ def test_streaming_response_bulk_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_update(self, client: Gitpod) -> None: project = client.projects.bulk_update() assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_update_with_all_params(self, client: Gitpod) -> None: project = client.projects.bulk_update( @@ -498,7 +498,7 @@ def test_method_bulk_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_bulk_update(self, client: Gitpod) -> None: response = client.projects.with_raw_response.bulk_update() @@ -508,7 +508,7 @@ def test_raw_response_bulk_update(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_bulk_update(self, client: Gitpod) -> None: with client.projects.with_streaming_response.bulk_update() as response: @@ -520,13 +520,13 @@ def test_streaming_response_bulk_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_from_environment(self, client: Gitpod) -> None: project = client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( @@ -535,7 +535,7 @@ def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_from_environment(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create_from_environment() @@ -545,7 +545,7 @@ def test_raw_response_create_from_environment(self, client: Gitpod) -> None: project = response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_from_environment(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create_from_environment() as response: @@ -563,7 +563,7 @@ class TestAsyncProjects: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -571,7 +571,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( @@ -607,7 +607,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( @@ -619,7 +619,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create( @@ -633,13 +633,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( @@ -647,7 +647,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.retrieve() @@ -657,7 +657,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.retrieve() as response: @@ -669,13 +669,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.update( @@ -713,7 +713,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.update() @@ -723,7 +723,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(ProjectUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.update() as response: @@ -735,13 +735,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list() assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.list( @@ -760,7 +760,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.list() @@ -770,7 +770,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.list() as response: @@ -782,13 +782,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete( @@ -796,7 +796,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.delete() @@ -806,7 +806,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: project = await response.parse() assert_matches_type(object, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.delete() as response: @@ -818,13 +818,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.bulk_create() assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.bulk_create( @@ -895,7 +895,7 @@ async def test_method_bulk_create_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_bulk_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.bulk_create() @@ -905,7 +905,7 @@ async def test_raw_response_bulk_create(self, async_client: AsyncGitpod) -> None project = await response.parse() assert_matches_type(ProjectBulkCreateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_bulk_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.bulk_create() as response: @@ -917,13 +917,13 @@ async def test_streaming_response_bulk_create(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_delete(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.bulk_delete() assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_delete_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.bulk_delete( @@ -931,7 +931,7 @@ async def test_method_bulk_delete_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_bulk_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.bulk_delete() @@ -941,7 +941,7 @@ async def test_raw_response_bulk_delete(self, async_client: AsyncGitpod) -> None project = await response.parse() assert_matches_type(ProjectBulkDeleteResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_bulk_delete(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.bulk_delete() as response: @@ -953,13 +953,13 @@ async def test_streaming_response_bulk_delete(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_update(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.bulk_update() assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_update_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.bulk_update( @@ -1034,7 +1034,7 @@ async def test_method_bulk_update_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_bulk_update(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.bulk_update() @@ -1044,7 +1044,7 @@ async def test_raw_response_bulk_update(self, async_client: AsyncGitpod) -> None project = await response.parse() assert_matches_type(ProjectBulkUpdateResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_bulk_update(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.bulk_update() as response: @@ -1056,13 +1056,13 @@ async def test_streaming_response_bulk_update(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_from_environment(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( @@ -1071,7 +1071,7 @@ async def test_method_create_from_environment_with_all_params(self, async_client ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_from_environment(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create_from_environment() @@ -1081,7 +1081,7 @@ async def test_raw_response_create_from_environment(self, async_client: AsyncGit project = await response.parse() assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_from_environment(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create_from_environment() as response: diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index eaf96b9e..9e7ef743 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -29,13 +29,13 @@ class TestRunners: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: runner = client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( @@ -63,7 +63,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create() @@ -73,7 +73,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create() as response: @@ -85,13 +85,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gitpod) -> None: runner = client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( @@ -99,7 +99,7 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: response = client.runners.with_raw_response.retrieve() @@ -109,7 +109,7 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: with client.runners.with_streaming_response.retrieve() as response: @@ -121,13 +121,13 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gitpod) -> None: runner = client.runners.update() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: runner = client.runners.update( @@ -151,7 +151,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gitpod) -> None: response = client.runners.with_raw_response.update() @@ -161,7 +161,7 @@ def test_raw_response_update(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gitpod) -> None: with client.runners.with_streaming_response.update() as response: @@ -173,13 +173,13 @@ def test_streaming_response_update(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: runner = client.runners.list() assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list( @@ -197,7 +197,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.runners.with_raw_response.list() @@ -207,7 +207,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.runners.with_streaming_response.list() as response: @@ -219,13 +219,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: runner = client.runners.delete() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete( @@ -234,7 +234,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.runners.with_raw_response.delete() @@ -244,7 +244,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.runners.with_streaming_response.delete() as response: @@ -256,13 +256,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_check_authentication_for_host(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( @@ -271,7 +271,7 @@ def test_method_check_authentication_for_host_with_all_params(self, client: Gitp ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> None: response = client.runners.with_raw_response.check_authentication_for_host() @@ -281,7 +281,7 @@ def test_raw_response_check_authentication_for_host(self, client: Gitpod) -> Non runner = response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_check_authentication_for_host(self, client: Gitpod) -> None: with client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -293,13 +293,13 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_check_repository_access(self, client: Gitpod) -> None: runner = client.runners.check_repository_access() assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_check_repository_access_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_repository_access( @@ -308,7 +308,7 @@ def test_method_check_repository_access_with_all_params(self, client: Gitpod) -> ) assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_check_repository_access(self, client: Gitpod) -> None: response = client.runners.with_raw_response.check_repository_access() @@ -318,7 +318,7 @@ def test_raw_response_check_repository_access(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_check_repository_access(self, client: Gitpod) -> None: with client.runners.with_streaming_response.check_repository_access() as response: @@ -330,13 +330,13 @@ def test_streaming_response_check_repository_access(self, client: Gitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_logs_token(self, client: Gitpod) -> None: runner = client.runners.create_logs_token() assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_logs_token( @@ -344,7 +344,7 @@ def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_logs_token(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create_logs_token() @@ -354,7 +354,7 @@ def test_raw_response_create_logs_token(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create_logs_token() as response: @@ -366,13 +366,13 @@ def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: runner = client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( @@ -380,7 +380,7 @@ def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_runner_token(self, client: Gitpod) -> None: response = client.runners.with_raw_response.create_runner_token() @@ -390,7 +390,7 @@ def test_raw_response_create_runner_token(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: with client.runners.with_streaming_response.create_runner_token() as response: @@ -402,13 +402,13 @@ def test_streaming_response_create_runner_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_scm_organizations(self, client: Gitpod) -> None: runner = client.runners.list_scm_organizations() assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_scm_organizations_with_all_params(self, client: Gitpod) -> None: runner = client.runners.list_scm_organizations( @@ -419,7 +419,7 @@ def test_method_list_scm_organizations_with_all_params(self, client: Gitpod) -> ) assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_scm_organizations(self, client: Gitpod) -> None: response = client.runners.with_raw_response.list_scm_organizations() @@ -429,7 +429,7 @@ def test_raw_response_list_scm_organizations(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_scm_organizations(self, client: Gitpod) -> None: with client.runners.with_streaming_response.list_scm_organizations() as response: @@ -441,13 +441,13 @@ def test_streaming_response_list_scm_organizations(self, client: Gitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_parse_context_url(self, client: Gitpod) -> None: runner = client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( @@ -456,7 +456,7 @@ def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_parse_context_url(self, client: Gitpod) -> None: response = client.runners.with_raw_response.parse_context_url() @@ -466,7 +466,7 @@ def test_raw_response_parse_context_url(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: with client.runners.with_streaming_response.parse_context_url() as response: @@ -478,13 +478,13 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_search_repositories(self, client: Gitpod) -> None: runner = client.runners.search_repositories() assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_search_repositories_with_all_params(self, client: Gitpod) -> None: runner = client.runners.search_repositories( @@ -500,7 +500,7 @@ def test_method_search_repositories_with_all_params(self, client: Gitpod) -> Non ) assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_search_repositories(self, client: Gitpod) -> None: response = client.runners.with_raw_response.search_repositories() @@ -510,7 +510,7 @@ def test_raw_response_search_repositories(self, client: Gitpod) -> None: runner = response.parse() assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_search_repositories(self, client: Gitpod) -> None: with client.runners.with_streaming_response.search_repositories() as response: @@ -528,13 +528,13 @@ class TestAsyncRunners: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( @@ -562,7 +562,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create() @@ -572,7 +572,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerCreateResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create() as response: @@ -584,13 +584,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( @@ -598,7 +598,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.retrieve() @@ -608,7 +608,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.retrieve() as response: @@ -620,13 +620,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( @@ -650,7 +650,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.update() @@ -660,7 +660,7 @@ async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.update() as response: @@ -672,13 +672,13 @@ async def test_streaming_response_update(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list() assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list( @@ -696,7 +696,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.list() @@ -706,7 +706,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.list() as response: @@ -718,13 +718,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete( @@ -733,7 +733,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.delete() @@ -743,7 +743,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: runner = await response.parse() assert_matches_type(object, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.delete() as response: @@ -755,13 +755,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( @@ -770,7 +770,7 @@ async def test_method_check_authentication_for_host_with_all_params(self, async_ ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.check_authentication_for_host() @@ -780,7 +780,7 @@ async def test_raw_response_check_authentication_for_host(self, async_client: As runner = await response.parse() assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_check_authentication_for_host(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.check_authentication_for_host() as response: @@ -792,13 +792,13 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_check_repository_access(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_repository_access() assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_check_repository_access_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_repository_access( @@ -807,7 +807,7 @@ async def test_method_check_repository_access_with_all_params(self, async_client ) assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_check_repository_access(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.check_repository_access() @@ -817,7 +817,7 @@ async def test_raw_response_check_repository_access(self, async_client: AsyncGit runner = await response.parse() assert_matches_type(RunnerCheckRepositoryAccessResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_check_repository_access(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.check_repository_access() as response: @@ -829,13 +829,13 @@ async def test_streaming_response_check_repository_access(self, async_client: As assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_logs_token() assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_logs_token( @@ -843,7 +843,7 @@ async def test_method_create_logs_token_with_all_params(self, async_client: Asyn ) assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create_logs_token() @@ -853,7 +853,7 @@ async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create_logs_token() as response: @@ -865,13 +865,13 @@ async def test_streaming_response_create_logs_token(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( @@ -879,7 +879,7 @@ async def test_method_create_runner_token_with_all_params(self, async_client: As ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.create_runner_token() @@ -889,7 +889,7 @@ async def test_raw_response_create_runner_token(self, async_client: AsyncGitpod) runner = await response.parse() assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_runner_token(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.create_runner_token() as response: @@ -901,13 +901,13 @@ async def test_streaming_response_create_runner_token(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_scm_organizations(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list_scm_organizations() assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_scm_organizations_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.list_scm_organizations( @@ -918,7 +918,7 @@ async def test_method_list_scm_organizations_with_all_params(self, async_client: ) assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_scm_organizations(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.list_scm_organizations() @@ -928,7 +928,7 @@ async def test_raw_response_list_scm_organizations(self, async_client: AsyncGitp runner = await response.parse() assert_matches_type(RunnerListScmOrganizationsResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_scm_organizations(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.list_scm_organizations() as response: @@ -940,13 +940,13 @@ async def test_streaming_response_list_scm_organizations(self, async_client: Asy assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( @@ -955,7 +955,7 @@ async def test_method_parse_context_url_with_all_params(self, async_client: Asyn ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.parse_context_url() @@ -965,7 +965,7 @@ async def test_raw_response_parse_context_url(self, async_client: AsyncGitpod) - runner = await response.parse() assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_parse_context_url(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.parse_context_url() as response: @@ -977,13 +977,13 @@ async def test_streaming_response_parse_context_url(self, async_client: AsyncGit assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_search_repositories(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.search_repositories() assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_search_repositories_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.search_repositories( @@ -999,7 +999,7 @@ async def test_method_search_repositories_with_all_params(self, async_client: As ) assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_search_repositories(self, async_client: AsyncGitpod) -> None: response = await async_client.runners.with_raw_response.search_repositories() @@ -1009,7 +1009,7 @@ async def test_raw_response_search_repositories(self, async_client: AsyncGitpod) runner = await response.parse() assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_search_repositories(self, async_client: AsyncGitpod) -> None: async with async_client.runners.with_streaming_response.search_repositories() as response: diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 680a9d7c..cbed1cda 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -22,13 +22,13 @@ class TestSecrets: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gitpod) -> None: secret = client.secrets.create() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.create() @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.create() as response: @@ -70,13 +70,13 @@ def test_streaming_response_create(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: secret = client.secrets.list() assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.list( @@ -98,7 +98,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.list() @@ -108,7 +108,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.list() as response: @@ -120,13 +120,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: secret = client.secrets.delete() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.delete( @@ -134,7 +134,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.delete() @@ -144,7 +144,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.delete() as response: @@ -156,13 +156,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_value(self, client: Gitpod) -> None: secret = client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.get_value( @@ -170,7 +170,7 @@ def test_method_get_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.get_value() @@ -180,7 +180,7 @@ def test_raw_response_get_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.get_value() as response: @@ -192,13 +192,13 @@ def test_streaming_response_get_value(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_value(self, client: Gitpod) -> None: secret = client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_value_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.update_value( @@ -207,7 +207,7 @@ def test_method_update_value_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update_value(self, client: Gitpod) -> None: response = client.secrets.with_raw_response.update_value() @@ -217,7 +217,7 @@ def test_raw_response_update_value(self, client: Gitpod) -> None: secret = response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update_value(self, client: Gitpod) -> None: with client.secrets.with_streaming_response.update_value() as response: @@ -235,13 +235,13 @@ class TestAsyncSecrets: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( @@ -261,7 +261,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.create() @@ -271,7 +271,7 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(SecretCreateResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.create() as response: @@ -283,13 +283,13 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list() assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.list( @@ -311,7 +311,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.list() @@ -321,7 +321,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.list() as response: @@ -333,13 +333,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.delete( @@ -347,7 +347,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.delete() @@ -357,7 +357,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.delete() as response: @@ -369,13 +369,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.get_value( @@ -383,7 +383,7 @@ async def test_method_get_value_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.get_value() @@ -393,7 +393,7 @@ async def test_raw_response_get_value(self, async_client: AsyncGitpod) -> None: secret = await response.parse() assert_matches_type(SecretGetValueResponse, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.get_value() as response: @@ -405,13 +405,13 @@ async def test_streaming_response_get_value(self, async_client: AsyncGitpod) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_value(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_value_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.update_value( @@ -420,7 +420,7 @@ async def test_method_update_value_with_all_params(self, async_client: AsyncGitp ) assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> None: response = await async_client.secrets.with_raw_response.update_value() @@ -430,7 +430,7 @@ async def test_raw_response_update_value(self, async_client: AsyncGitpod) -> Non secret = await response.parse() assert_matches_type(object, secret, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update_value(self, async_client: AsyncGitpod) -> None: async with async_client.secrets.with_streaming_response.update_value() as response: diff --git a/tests/api_resources/test_usage.py b/tests/api_resources/test_usage.py index a203b817..754a862e 100644 --- a/tests/api_resources/test_usage.py +++ b/tests/api_resources/test_usage.py @@ -19,13 +19,13 @@ class TestUsage: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_environment_runtime_records(self, client: Gitpod) -> None: usage = client.usage.list_environment_runtime_records() assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_environment_runtime_records_with_all_params(self, client: Gitpod) -> None: usage = client.usage.list_environment_runtime_records( @@ -45,7 +45,7 @@ def test_method_list_environment_runtime_records_with_all_params(self, client: G ) assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_environment_runtime_records(self, client: Gitpod) -> None: response = client.usage.with_raw_response.list_environment_runtime_records() @@ -55,7 +55,7 @@ def test_raw_response_list_environment_runtime_records(self, client: Gitpod) -> usage = response.parse() assert_matches_type(SyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_environment_runtime_records(self, client: Gitpod) -> None: with client.usage.with_streaming_response.list_environment_runtime_records() as response: @@ -73,13 +73,13 @@ class TestAsyncUsage: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_environment_runtime_records(self, async_client: AsyncGitpod) -> None: usage = await async_client.usage.list_environment_runtime_records() assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_environment_runtime_records_with_all_params(self, async_client: AsyncGitpod) -> None: usage = await async_client.usage.list_environment_runtime_records( @@ -99,7 +99,7 @@ async def test_method_list_environment_runtime_records_with_all_params(self, asy ) assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_environment_runtime_records(self, async_client: AsyncGitpod) -> None: response = await async_client.usage.with_raw_response.list_environment_runtime_records() @@ -109,7 +109,7 @@ async def test_raw_response_list_environment_runtime_records(self, async_client: usage = await response.parse() assert_matches_type(AsyncRecordsPage[EnvironmentUsageRecord], usage, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_environment_runtime_records(self, async_client: AsyncGitpod) -> None: async with async_client.usage.with_streaming_response.list_environment_runtime_records() as response: diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index 576deff0..3871c1bf 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -20,13 +20,13 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_user(self, client: Gitpod) -> None: user = client.users.delete_user() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_user_with_all_params(self, client: Gitpod) -> None: user = client.users.delete_user( @@ -34,7 +34,7 @@ def test_method_delete_user_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_user(self, client: Gitpod) -> None: response = client.users.with_raw_response.delete_user() @@ -44,7 +44,7 @@ def test_raw_response_delete_user(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_user(self, client: Gitpod) -> None: with client.users.with_streaming_response.delete_user() as response: @@ -56,13 +56,13 @@ def test_streaming_response_delete_user(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_authenticated_user(self, client: Gitpod) -> None: user = client.users.get_authenticated_user() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> None: user = client.users.get_authenticated_user( @@ -70,7 +70,7 @@ def test_method_get_authenticated_user_with_all_params(self, client: Gitpod) -> ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: response = client.users.with_raw_response.get_authenticated_user() @@ -80,7 +80,7 @@ def test_raw_response_get_authenticated_user(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None: with client.users.with_streaming_response.get_authenticated_user() as response: @@ -92,13 +92,13 @@ def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_user(self, client: Gitpod) -> None: user = client.users.get_user() assert_matches_type(UserGetUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_user_with_all_params(self, client: Gitpod) -> None: user = client.users.get_user( @@ -106,7 +106,7 @@ def test_method_get_user_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(UserGetUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_user(self, client: Gitpod) -> None: response = client.users.with_raw_response.get_user() @@ -116,7 +116,7 @@ def test_raw_response_get_user(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(UserGetUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_user(self, client: Gitpod) -> None: with client.users.with_streaming_response.get_user() as response: @@ -128,13 +128,13 @@ def test_streaming_response_get_user(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_set_suspended(self, client: Gitpod) -> None: user = client.users.set_suspended() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: user = client.users.set_suspended( @@ -143,7 +143,7 @@ def test_method_set_suspended_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_set_suspended(self, client: Gitpod) -> None: response = client.users.with_raw_response.set_suspended() @@ -153,7 +153,7 @@ def test_raw_response_set_suspended(self, client: Gitpod) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_set_suspended(self, client: Gitpod) -> None: with client.users.with_streaming_response.set_suspended() as response: @@ -171,13 +171,13 @@ class TestAsyncUsers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_user(self, async_client: AsyncGitpod) -> None: user = await async_client.users.delete_user() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_user_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.delete_user( @@ -185,7 +185,7 @@ async def test_method_delete_user_with_all_params(self, async_client: AsyncGitpo ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_user(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.delete_user() @@ -195,7 +195,7 @@ async def test_raw_response_delete_user(self, async_client: AsyncGitpod) -> None user = await response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_user(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.delete_user() as response: @@ -207,13 +207,13 @@ async def test_streaming_response_delete_user(self, async_client: AsyncGitpod) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_authenticated_user_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_authenticated_user( @@ -221,7 +221,7 @@ async def test_method_get_authenticated_user_with_all_params(self, async_client: ) assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.get_authenticated_user() @@ -231,7 +231,7 @@ async def test_raw_response_get_authenticated_user(self, async_client: AsyncGitp user = await response.parse() assert_matches_type(UserGetAuthenticatedUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_authenticated_user(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.get_authenticated_user() as response: @@ -243,13 +243,13 @@ async def test_streaming_response_get_authenticated_user(self, async_client: Asy assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_user(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_user() assert_matches_type(UserGetUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_user_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.get_user( @@ -257,7 +257,7 @@ async def test_method_get_user_with_all_params(self, async_client: AsyncGitpod) ) assert_matches_type(UserGetUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_user(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.get_user() @@ -267,7 +267,7 @@ async def test_raw_response_get_user(self, async_client: AsyncGitpod) -> None: user = await response.parse() assert_matches_type(UserGetUserResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_user(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.get_user() as response: @@ -279,13 +279,13 @@ async def test_streaming_response_get_user(self, async_client: AsyncGitpod) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_set_suspended_with_all_params(self, async_client: AsyncGitpod) -> None: user = await async_client.users.set_suspended( @@ -294,7 +294,7 @@ async def test_method_set_suspended_with_all_params(self, async_client: AsyncGit ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> None: response = await async_client.users.with_raw_response.set_suspended() @@ -304,7 +304,7 @@ async def test_raw_response_set_suspended(self, async_client: AsyncGitpod) -> No user = await response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_set_suspended(self, async_client: AsyncGitpod) -> None: async with async_client.users.with_streaming_response.set_suspended() as response: diff --git a/tests/api_resources/users/test_dotfiles.py b/tests/api_resources/users/test_dotfiles.py index 6d2ebe96..70e4deb8 100644 --- a/tests/api_resources/users/test_dotfiles.py +++ b/tests/api_resources/users/test_dotfiles.py @@ -17,13 +17,13 @@ class TestDotfiles: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get(self, client: Gitpod) -> None: dotfile = client.users.dotfiles.get() assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: dotfile = client.users.dotfiles.get( @@ -31,7 +31,7 @@ def test_method_get_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get(self, client: Gitpod) -> None: response = client.users.dotfiles.with_raw_response.get() @@ -41,7 +41,7 @@ def test_raw_response_get(self, client: Gitpod) -> None: dotfile = response.parse() assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: with client.users.dotfiles.with_streaming_response.get() as response: @@ -53,13 +53,13 @@ def test_streaming_response_get(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_set(self, client: Gitpod) -> None: dotfile = client.users.dotfiles.set() assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_set_with_all_params(self, client: Gitpod) -> None: dotfile = client.users.dotfiles.set( @@ -67,7 +67,7 @@ def test_method_set_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_set(self, client: Gitpod) -> None: response = client.users.dotfiles.with_raw_response.set() @@ -77,7 +77,7 @@ def test_raw_response_set(self, client: Gitpod) -> None: dotfile = response.parse() assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_set(self, client: Gitpod) -> None: with client.users.dotfiles.with_streaming_response.set() as response: @@ -95,13 +95,13 @@ class TestAsyncDotfiles: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: dotfile = await async_client.users.dotfiles.get() assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: dotfile = await async_client.users.dotfiles.get( @@ -109,7 +109,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> No ) assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: response = await async_client.users.dotfiles.with_raw_response.get() @@ -119,7 +119,7 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: dotfile = await response.parse() assert_matches_type(DotfileGetResponse, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: async with async_client.users.dotfiles.with_streaming_response.get() as response: @@ -131,13 +131,13 @@ async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_set(self, async_client: AsyncGitpod) -> None: dotfile = await async_client.users.dotfiles.set() assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_set_with_all_params(self, async_client: AsyncGitpod) -> None: dotfile = await async_client.users.dotfiles.set( @@ -145,7 +145,7 @@ async def test_method_set_with_all_params(self, async_client: AsyncGitpod) -> No ) assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_set(self, async_client: AsyncGitpod) -> None: response = await async_client.users.dotfiles.with_raw_response.set() @@ -155,7 +155,7 @@ async def test_raw_response_set(self, async_client: AsyncGitpod) -> None: dotfile = await response.parse() assert_matches_type(object, dotfile, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_set(self, async_client: AsyncGitpod) -> None: async with async_client.users.dotfiles.with_streaming_response.set() as response: diff --git a/tests/api_resources/users/test_pats.py b/tests/api_resources/users/test_pats.py index d00d8d20..d865cc0d 100644 --- a/tests/api_resources/users/test_pats.py +++ b/tests/api_resources/users/test_pats.py @@ -18,13 +18,13 @@ class TestPats: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: pat = client.users.pats.list() assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.list( @@ -38,7 +38,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.list() @@ -48,7 +48,7 @@ def test_raw_response_list(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(SyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.list() as response: @@ -60,13 +60,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gitpod) -> None: pat = client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.delete( @@ -74,7 +74,7 @@ def test_method_delete_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.delete() @@ -84,7 +84,7 @@ def test_raw_response_delete(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.delete() as response: @@ -96,13 +96,13 @@ def test_streaming_response_delete(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get(self, client: Gitpod) -> None: pat = client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_with_all_params(self, client: Gitpod) -> None: pat = client.users.pats.get( @@ -110,7 +110,7 @@ def test_method_get_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get(self, client: Gitpod) -> None: response = client.users.pats.with_raw_response.get() @@ -120,7 +120,7 @@ def test_raw_response_get(self, client: Gitpod) -> None: pat = response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get(self, client: Gitpod) -> None: with client.users.pats.with_streaming_response.get() as response: @@ -138,13 +138,13 @@ class TestAsyncPats: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list() assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.list( @@ -158,7 +158,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N ) assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.list() @@ -168,7 +168,7 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(AsyncPersonalAccessTokensPage[PersonalAccessToken], pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.list() as response: @@ -180,13 +180,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.delete( @@ -194,7 +194,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.delete() @@ -204,7 +204,7 @@ async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(object, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.delete() as response: @@ -216,13 +216,13 @@ async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> None: pat = await async_client.users.pats.get( @@ -230,7 +230,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncGitpod) -> No ) assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: response = await async_client.users.pats.with_raw_response.get() @@ -240,7 +240,7 @@ async def test_raw_response_get(self, async_client: AsyncGitpod) -> None: pat = await response.parse() assert_matches_type(PatGetResponse, pat, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get(self, async_client: AsyncGitpod) -> None: async with async_client.users.pats.with_streaming_response.get() as response: From 7deb105da10084b66013a115ac15c3a20ed33c5f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 17:48:01 +0000 Subject: [PATCH 349/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ae4752ab..56f22061 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6537d9d31bcf213ac7dab540eebd4b21a511ebb6dc9f602296f13e71aa7c859a.yml -openapi_spec_hash: f6629cb53a0e7f5dc97956e9ae439289 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3017822d8c133c3d60f2bf1a65bc81fa8e11737d46d90d2316d5ef57285ed30f.yml +openapi_spec_hash: 2a1219326c8d17de457653ca29023ebf config_hash: b478642d4e5f97aab620afc5c51bb2ea From 18cec33e34aedef68b21975928a0028fc21e8f8d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 18:35:48 +0000 Subject: [PATCH 350/505] chore(test): update skip reason message --- tests/api_resources/test_events.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 71389707..0ee88808 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -69,13 +69,13 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_watch(self, client: Gitpod) -> None: event_stream = client.events.watch() assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_watch_with_all_params(self, client: Gitpod) -> None: event_stream = client.events.watch( @@ -84,7 +84,7 @@ def test_method_watch_with_all_params(self, client: Gitpod) -> None: ) assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_watch(self, client: Gitpod) -> None: response = client.events.with_raw_response.watch() @@ -93,7 +93,7 @@ def test_raw_response_watch(self, client: Gitpod) -> None: stream = response.parse() stream.close() - @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_watch(self, client: Gitpod) -> None: with client.events.with_streaming_response.watch() as response: @@ -160,13 +160,13 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_watch(self, async_client: AsyncGitpod) -> None: event_stream = await async_client.events.watch() assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> None: event_stream = await async_client.events.watch( @@ -175,7 +175,7 @@ async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> ) assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None: response = await async_client.events.with_raw_response.watch() @@ -184,7 +184,7 @@ async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None: stream = await response.parse() await stream.close() - @pytest.mark.skip(reason="Mock server doesn't support application/jsonl responses") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_watch(self, async_client: AsyncGitpod) -> None: async with async_client.events.with_streaming_response.watch() as response: From bb3a35c30e0a72030b916fa7f9756965b8a22b90 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 19:14:31 +0000 Subject: [PATCH 351/505] feat(api): add resource_ids to role assignments, restructure executable deny list in policies --- .stats.yml | 4 ++-- .../groups/role_assignment_list_params.py | 18 ++++++++++++++---- .../groups/test_role_assignments.py | 2 ++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 56f22061..3974e04c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3017822d8c133c3d60f2bf1a65bc81fa8e11737d46d90d2316d5ef57285ed30f.yml -openapi_spec_hash: 2a1219326c8d17de457653ca29023ebf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6a3ce4fa1cddca171e56bb663ad37610241027c3e149cdda77d579e1c5f4411a.yml +openapi_spec_hash: fd261ea098c45e8ab600e18bbd9650c5 config_hash: b478642d4e5f97aab620afc5c51bb2ea diff --git a/src/gitpod/types/groups/role_assignment_list_params.py b/src/gitpod/types/groups/role_assignment_list_params.py index 52ceaacb..69be3188 100644 --- a/src/gitpod/types/groups/role_assignment_list_params.py +++ b/src/gitpod/types/groups/role_assignment_list_params.py @@ -5,6 +5,7 @@ from typing import List from typing_extensions import Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo from ..shared.resource_role import ResourceRole from ..shared.resource_type import ResourceType @@ -34,11 +35,20 @@ class Filter(TypedDict, total=False): """ resource_id: Annotated[str, PropertyInfo(alias="resourceId")] + """Filters by a single resource. + + Use this when listing all groups that have access to a specific resource (e.g. + share dialogs). Non-admin callers with :grant permission on the resource can see + role assignments from groups they don't belong to. Mutually exclusive with + resource_ids. """ - resource_id filters the response to only role assignments for this specific - resource When provided, users with :grant permission on the resource can see its - role assignments even if they don't belong to the assigned groups Empty string - is allowed and means no filtering by resource + + resource_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="resourceIds")] + """Filters by multiple resources in a single request. + + Use this for batch permission lookups (e.g. checking the caller's own + permissions across several resources). Does not support the :grant permission + bypass. Mutually exclusive with resource_id. """ resource_roles: Annotated[List[ResourceRole], PropertyInfo(alias="resourceRoles")] diff --git a/tests/api_resources/groups/test_role_assignments.py b/tests/api_resources/groups/test_role_assignments.py index a00ad05b..f654fb3a 100644 --- a/tests/api_resources/groups/test_role_assignments.py +++ b/tests/api_resources/groups/test_role_assignments.py @@ -75,6 +75,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "group_id": "groupId", "resource_id": "resourceId", + "resource_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "resource_roles": ["RESOURCE_ROLE_UNSPECIFIED"], "resource_types": ["RESOURCE_TYPE_RUNNER"], "user_id": "userId", @@ -204,6 +205,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "group_id": "groupId", "resource_id": "resourceId", + "resource_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "resource_roles": ["RESOURCE_ROLE_UNSPECIFIED"], "resource_types": ["RESOURCE_TYPE_RUNNER"], "user_id": "userId", From 537ed71d75a8ed9d25fdd24f2c8614778f916551 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 11:13:45 +0000 Subject: [PATCH 352/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3974e04c..6d8985d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6a3ce4fa1cddca171e56bb663ad37610241027c3e149cdda77d579e1c5f4411a.yml -openapi_spec_hash: fd261ea098c45e8ab600e18bbd9650c5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-978293eecaf6753561be22655bba682fef03e1dc5cc002c276fa117261135c70.yml +openapi_spec_hash: b4bdaf1d7daffb0b6fd8d7fcee562aa0 config_hash: b478642d4e5f97aab620afc5c51bb2ea From cd70f84cf8226bdbae7e6db47d09d358f5863ab5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 15:36:32 +0000 Subject: [PATCH 353/505] chore(internal): update jsonl tests --- tests/api_resources/test_events.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 0ee88808..5cc28f86 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -12,7 +12,6 @@ from gitpod.types import EventListResponse, EventWatchResponse from gitpod._utils import parse_datetime from gitpod.pagination import SyncEntriesPage, AsyncEntriesPage -from gitpod._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -73,7 +72,8 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @parametrize def test_method_watch(self, client: Gitpod) -> None: event_stream = client.events.watch() - assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) + for item in event_stream: + assert_matches_type(EventWatchResponse, item, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -82,7 +82,8 @@ def test_method_watch_with_all_params(self, client: Gitpod) -> None: environment_id="environmentId", organization=True, ) - assert_matches_type(JSONLDecoder[EventWatchResponse], event_stream, path=["response"]) + for item in event_stream: + assert_matches_type(EventWatchResponse, item, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -91,7 +92,8 @@ def test_raw_response_watch(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = response.parse() - stream.close() + for item in stream: + assert_matches_type(EventWatchResponse, item, path=["line"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -101,7 +103,8 @@ def test_streaming_response_watch(self, client: Gitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = response.parse() - stream.close() + for item in stream: + assert_matches_type(EventWatchResponse, item, path=["item"]) assert cast(Any, response.is_closed) is True @@ -164,7 +167,8 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_watch(self, async_client: AsyncGitpod) -> None: event_stream = await async_client.events.watch() - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) + async for item in event_stream: + assert_matches_type(EventWatchResponse, item, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -173,7 +177,8 @@ async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> environment_id="environmentId", organization=True, ) - assert_matches_type(AsyncJSONLDecoder[EventWatchResponse], event_stream, path=["response"]) + async for item in event_stream: + assert_matches_type(EventWatchResponse, item, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -182,7 +187,8 @@ async def test_raw_response_watch(self, async_client: AsyncGitpod) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = await response.parse() - await stream.close() + async for item in stream: + assert_matches_type(EventWatchResponse, item, path=["line"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -192,6 +198,7 @@ async def test_streaming_response_watch(self, async_client: AsyncGitpod) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = await response.parse() - await stream.close() + async for item in stream: + assert_matches_type(EventWatchResponse, item, path=["item"]) assert cast(Any, response.is_closed) is True From dc5c871d6ec063f1346c30c9d6fede141319e38a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 15:41:09 +0000 Subject: [PATCH 354/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6d8985d5..bce04790 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-978293eecaf6753561be22655bba682fef03e1dc5cc002c276fa117261135c70.yml -openapi_spec_hash: b4bdaf1d7daffb0b6fd8d7fcee562aa0 -config_hash: b478642d4e5f97aab620afc5c51bb2ea +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-425b7af32f0a85fcc19ebbb2487b0c4dc36a01a91f93fba6c708b1d64f56abb5.yml +openapi_spec_hash: c104046b6c75375623038a3bcb35a373 +config_hash: 9310e62fdd4819bba6317f3479cfff1c From 4bf1763343df84fd1904d5fb0b3c4aba99084dc5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 16:52:27 +0000 Subject: [PATCH 355/505] feat(api): add SONNET_4_6 model variants to agent_execution Status --- .stats.yml | 4 ++-- src/gitpod/types/agent_execution.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bce04790..74d90fa9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-425b7af32f0a85fcc19ebbb2487b0c4dc36a01a91f93fba6c708b1d64f56abb5.yml -openapi_spec_hash: c104046b6c75375623038a3bcb35a373 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5bd1d582d09b3f50f2658008d810dd7fbcb56e8b95f05c1ae56246c24aee39e2.yml +openapi_spec_hash: 14b0c544bf9b9558dcea53e09bd5f473 config_hash: 9310e62fdd4819bba6317f3479cfff1c diff --git a/src/gitpod/types/agent_execution.py b/src/gitpod/types/agent_execution.py index ee64847f..dafe3745 100644 --- a/src/gitpod/types/agent_execution.py +++ b/src/gitpod/types/agent_execution.py @@ -436,6 +436,8 @@ class Status(BaseModel): "SUPPORTED_MODEL_SONNET_4_EXTENDED", "SUPPORTED_MODEL_SONNET_4_5", "SUPPORTED_MODEL_SONNET_4_5_EXTENDED", + "SUPPORTED_MODEL_SONNET_4_6", + "SUPPORTED_MODEL_SONNET_4_6_EXTENDED", "SUPPORTED_MODEL_OPUS_4", "SUPPORTED_MODEL_OPUS_4_EXTENDED", "SUPPORTED_MODEL_OPUS_4_5", From c22ed78c4d5e517491d9beac9cc13b1a83bdb2bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 09:23:14 +0000 Subject: [PATCH 356/505] feat(types): add CountResponseRelation enum type --- .stats.yml | 6 +++--- api.md | 1 + src/gitpod/types/__init__.py | 1 + src/gitpod/types/count_response_relation.py | 9 +++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/count_response_relation.py diff --git a/.stats.yml b/.stats.yml index 74d90fa9..40fec4f8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5bd1d582d09b3f50f2658008d810dd7fbcb56e8b95f05c1ae56246c24aee39e2.yml -openapi_spec_hash: 14b0c544bf9b9558dcea53e09bd5f473 -config_hash: 9310e62fdd4819bba6317f3479cfff1c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5498c80829cdba9708b7765af11a4c6668383640159e195835b768d1d0070a2c.yml +openapi_spec_hash: 9bbcc41c34e3fcc108e19e4335fa82cd +config_hash: e561ac157e2bab45b5c366f2cf6b526e diff --git a/api.md b/api.md index e12de957..24489720 100644 --- a/api.md +++ b/api.md @@ -347,6 +347,7 @@ Types: ```python from gitpod.types import ( + CountResponseRelation, InviteDomains, Organization, OrganizationMember, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 606c5690..2bd95b2e 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -134,6 +134,7 @@ from .user_get_user_response import UserGetUserResponse as UserGetUserResponse from .user_input_block_param import UserInputBlockParam as UserInputBlockParam from .account_retrieve_params import AccountRetrieveParams as AccountRetrieveParams +from .count_response_relation import CountResponseRelation as CountResponseRelation from .environment_initializer import EnvironmentInitializer as EnvironmentInitializer from .environment_list_params import EnvironmentListParams as EnvironmentListParams from .environment_stop_params import EnvironmentStopParams as EnvironmentStopParams diff --git a/src/gitpod/types/count_response_relation.py b/src/gitpod/types/count_response_relation.py new file mode 100644 index 00000000..6b4f3228 --- /dev/null +++ b/src/gitpod/types/count_response_relation.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CountResponseRelation"] + +CountResponseRelation: TypeAlias = Literal[ + "COUNT_RESPONSE_RELATION_UNSPECIFIED", "COUNT_RESPONSE_RELATION_EQ", "COUNT_RESPONSE_RELATION_GTE" +] From 283d8c0315b1c5a45ba0032bcccd981940186af3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 09:23:40 +0000 Subject: [PATCH 357/505] feat(api): add sort parameter to projects list, SortOrder/SortParam types --- .stats.yml | 6 ++--- api.md | 2 ++ src/gitpod/resources/projects/projects.py | 23 +++++++++++++++++++ src/gitpod/types/__init__.py | 2 ++ .../types/organization_list_members_params.py | 3 ++- src/gitpod/types/project_list_params.py | 12 ++++++++++ src/gitpod/types/sort_order.py | 7 ++++++ src/gitpod/types/sort_param.py | 16 +++++++++++++ tests/api_resources/test_projects.py | 8 +++++++ 9 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 src/gitpod/types/sort_order.py create mode 100644 src/gitpod/types/sort_param.py diff --git a/.stats.yml b/.stats.yml index 40fec4f8..1f90a3f0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5498c80829cdba9708b7765af11a4c6668383640159e195835b768d1d0070a2c.yml -openapi_spec_hash: 9bbcc41c34e3fcc108e19e4335fa82cd -config_hash: e561ac157e2bab45b5c366f2cf6b526e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8507bc4eff2dbfe0392f2a2e18b337827935aaa2d99046653efca1c43a5f82cd.yml +openapi_spec_hash: 8a9387a75d5d0dcaa53d01ba6f52f2c9 +config_hash: 37a21c5644cb6c8f1d592ea2ec7c66d7 diff --git a/api.md b/api.md index 24489720..bc4271c9 100644 --- a/api.md +++ b/api.md @@ -555,6 +555,8 @@ from gitpod.types import ( ProjectPhase, ProjectPrebuildConfiguration, RecommendedEditors, + Sort, + SortOrder, ProjectCreateResponse, ProjectRetrieveResponse, ProjectUpdateResponse, diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index ac2caee1..9daaaa6e 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -38,6 +38,7 @@ from ...pagination import SyncProjectsPage, AsyncProjectsPage from ..._base_client import AsyncPaginator, make_request_options from ...types.project import Project +from ...types.sort_param import SortParam from .environment_clases import ( EnvironmentClasesResource, AsyncEnvironmentClasesResource, @@ -364,6 +365,7 @@ def list( page_size: int | Omit = omit, filter: project_list_params.Filter | Omit = omit, pagination: project_list_params.Pagination | Omit = omit, + sort: SortParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -394,6 +396,15 @@ def list( Args: pagination: pagination contains the pagination options for listing organizations + sort: sort specifies the order of results. Defaults to popularity descending. + + Supported fields: + + - "id": Sort by project ID (UUID v7, effectively creation order). Produces a + stable, deterministic result set suitable for consistent pagination. + - "popularity": Sort by popularity — a precomputed score based on recent + environment creation activity. Updated periodically by a background job. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -409,6 +420,7 @@ def list( { "filter": filter, "pagination": pagination, + "sort": sort, }, project_list_params.ProjectListParams, ), @@ -1008,6 +1020,7 @@ def list( page_size: int | Omit = omit, filter: project_list_params.Filter | Omit = omit, pagination: project_list_params.Pagination | Omit = omit, + sort: SortParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1038,6 +1051,15 @@ def list( Args: pagination: pagination contains the pagination options for listing organizations + sort: sort specifies the order of results. Defaults to popularity descending. + + Supported fields: + + - "id": Sort by project ID (UUID v7, effectively creation order). Produces a + stable, deterministic result set suitable for consistent pagination. + - "popularity": Sort by popularity — a precomputed score based on recent + environment creation activity. Updated periodically by a background job. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1053,6 +1075,7 @@ def list( { "filter": filter, "pagination": pagination, + "sort": sort, }, project_list_params.ProjectListParams, ), diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 2bd95b2e..f1c4afcd 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -42,6 +42,8 @@ from .prebuild import Prebuild as Prebuild from .log_level import LogLevel as LogLevel from .agent_mode import AgentMode as AgentMode +from .sort_order import SortOrder as SortOrder +from .sort_param import SortParam as SortParam from .veto_param import VetoParam as VetoParam from .environment import Environment as Environment from .error_level import ErrorLevel as ErrorLevel diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 986af24e..f7e1979c 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -7,6 +7,7 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo +from .sort_order import SortOrder from .shared.user_status import UserStatus from .shared.organization_role import OrganizationRole @@ -83,4 +84,4 @@ class Sort(TypedDict, total=False): field: Literal["SORT_FIELD_UNSPECIFIED", "SORT_FIELD_NAME", "SORT_FIELD_DATE_JOINED"] - order: Literal["SORT_ORDER_UNSPECIFIED", "SORT_ORDER_ASC", "SORT_ORDER_DESC"] + order: SortOrder diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py index 0ce45e83..0c9a11a7 100644 --- a/src/gitpod/types/project_list_params.py +++ b/src/gitpod/types/project_list_params.py @@ -7,6 +7,7 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo +from .sort_param import SortParam from .runner_kind import RunnerKind __all__ = ["ProjectListParams", "Filter", "Pagination"] @@ -22,6 +23,17 @@ class ProjectListParams(TypedDict, total=False): pagination: Pagination """pagination contains the pagination options for listing organizations""" + sort: SortParam + """sort specifies the order of results. Defaults to popularity descending. + + Supported fields: + + - "id": Sort by project ID (UUID v7, effectively creation order). Produces a + stable, deterministic result set suitable for consistent pagination. + - "popularity": Sort by popularity — a precomputed score based on recent + environment creation activity. Updated periodically by a background job. + """ + class Filter(TypedDict, total=False): project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] diff --git a/src/gitpod/types/sort_order.py b/src/gitpod/types/sort_order.py new file mode 100644 index 00000000..c0164b54 --- /dev/null +++ b/src/gitpod/types/sort_order.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SortOrder"] + +SortOrder: TypeAlias = Literal["SORT_ORDER_UNSPECIFIED", "SORT_ORDER_ASC", "SORT_ORDER_DESC"] diff --git a/src/gitpod/types/sort_param.py b/src/gitpod/types/sort_param.py new file mode 100644 index 00000000..d8f7b07e --- /dev/null +++ b/src/gitpod/types/sort_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .sort_order import SortOrder + +__all__ = ["SortParam"] + + +class SortParam(TypedDict, total=False): + field: str + """Field name to sort by, in camelCase.""" + + order: SortOrder diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 0418b6f2..03f0abd1 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -221,6 +221,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 20, }, + sort={ + "field": "field", + "order": "SORT_ORDER_UNSPECIFIED", + }, ) assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) @@ -757,6 +761,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 20, }, + sort={ + "field": "field", + "order": "SORT_ORDER_UNSPECIFIED", + }, ) assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) From e920b8617477fd37501b6d4b8c94f9d8e4d8568d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 12:45:40 +0000 Subject: [PATCH 358/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1f90a3f0..3db0e689 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8507bc4eff2dbfe0392f2a2e18b337827935aaa2d99046653efca1c43a5f82cd.yml -openapi_spec_hash: 8a9387a75d5d0dcaa53d01ba6f52f2c9 -config_hash: 37a21c5644cb6c8f1d592ea2ec7c66d7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5d1c02f2a41e5b4854c72832120cacaae793b68dd4406b4966af82294fee09eb.yml +openapi_spec_hash: 33524cdb0c70aabb217543c199d29a36 +config_hash: d1efd0fb13278cef73ed308a4a0a1294 From e514e2496cc8288f42ce8f1adeccd92ba1b5cc43 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 13:32:20 +0000 Subject: [PATCH 359/505] chore(internal): add request options to SSE classes --- src/gitpod/_response.py | 3 +++ src/gitpod/_streaming.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gitpod/_response.py b/src/gitpod/_response.py index 6211d722..5122aac0 100644 --- a/src/gitpod/_response.py +++ b/src/gitpod/_response.py @@ -174,6 +174,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -184,6 +185,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -197,6 +199,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/gitpod/_streaming.py b/src/gitpod/_streaming.py index 9a4ccf40..e7850426 100644 --- a/src/gitpod/_streaming.py +++ b/src/gitpod/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ._client import Gitpod, AsyncGitpod + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -22,7 +23,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -31,10 +32,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: Gitpod, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -94,10 +97,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncGitpod, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() From 0fc2eb06a94482687661c536865462bf0ee1377c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 20:29:16 +0000 Subject: [PATCH 360/505] chore(internal): make `test_proxy_environment_variables` more resilient --- tests/test_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 81db6c83..6db2b5e5 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -981,6 +981,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultHttpxClient() @@ -1907,6 +1909,8 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultAsyncHttpxClient() From d18ca6c8339bf9ab89ec233ff53f60e3815e14de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:03:06 +0000 Subject: [PATCH 361/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3db0e689..89c49bab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5d1c02f2a41e5b4854c72832120cacaae793b68dd4406b4966af82294fee09eb.yml -openapi_spec_hash: 33524cdb0c70aabb217543c199d29a36 -config_hash: d1efd0fb13278cef73ed308a4a0a1294 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-efebbf89daf148b007793d595d4a27693d32c2af05de5cad7bd627acb289fd48.yml +openapi_spec_hash: 579a0ad85d72fe97b7ccf94147c4cf8b +config_hash: bc00f6f75db39f10e08429d65d1a3256 From ea10123d1e5849e3e93a47223d0a5c75e6a54063 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:46:33 +0000 Subject: [PATCH 362/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 89c49bab..b87101b1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-efebbf89daf148b007793d595d4a27693d32c2af05de5cad7bd627acb289fd48.yml -openapi_spec_hash: 579a0ad85d72fe97b7ccf94147c4cf8b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d558cd59c0afb87b242c1b7988b9f661f9f9da27b5c70f716b985f389c9e4525.yml +openapi_spec_hash: f4e3d1e1193f667b1dfeedd599cc8037 config_hash: bc00f6f75db39f10e08429d65d1a3256 From 380cf4efc8884ee3037f65e46b10567a1ba74bee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:49:09 +0000 Subject: [PATCH 363/505] chore(internal): make `test_proxy_environment_variables` more resilient to env --- tests/test_client.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 6db2b5e5..92b0eea3 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -981,8 +981,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultHttpxClient() @@ -1909,8 +1915,14 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultAsyncHttpxClient() From 2524e2a0aaf81a38f9e17320f8f8c6cd68515b71 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:53:02 +0000 Subject: [PATCH 364/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index b87101b1..9c22cddb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d558cd59c0afb87b242c1b7988b9f661f9f9da27b5c70f716b985f389c9e4525.yml -openapi_spec_hash: f4e3d1e1193f667b1dfeedd599cc8037 -config_hash: bc00f6f75db39f10e08429d65d1a3256 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6ec331208d75a70905e27db1628fb6c8377570c165c96fac6be6c2584f96b457.yml +openapi_spec_hash: 4b329837363160d2f32748841d820d43 +config_hash: 5ae1121a61e0263e40f13c9d7d45c935 From 334a6f3f2fc5431504d731fa2884f9344b036412 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 09:38:13 +0000 Subject: [PATCH 365/505] feat(api): add lockdown_at field to environment status --- .stats.yml | 4 ++-- src/gitpod/types/environment_metadata.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9c22cddb..535aacc3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6ec331208d75a70905e27db1628fb6c8377570c165c96fac6be6c2584f96b457.yml -openapi_spec_hash: 4b329837363160d2f32748841d820d43 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2b5d25c42aae80b17781d652e385cb0c6efa9473c3c5e131df8d8add561f4223.yml +openapi_spec_hash: b973ecdb8f4d13f56b64c4cafa605697 config_hash: 5ae1121a61e0263e40f13c9d7d45c935 diff --git a/src/gitpod/types/environment_metadata.py b/src/gitpod/types/environment_metadata.py index 302dded8..28452a70 100644 --- a/src/gitpod/types/environment_metadata.py +++ b/src/gitpod/types/environment_metadata.py @@ -42,6 +42,13 @@ class EnvironmentMetadata(BaseModel): CreateEnvironment or StartEnvironment were called). """ + lockdown_at: Optional[datetime] = FieldInfo(alias="lockdownAt", default=None) + """ + lockdown_at is the time at which the environment becomes locked down due to the + organization's maximum environment lifetime policy. Nil when no lifetime policy + applies. + """ + name: Optional[str] = None """name is the name of the environment as specified by the user""" From e850a584832a94fc57b619f399ee4ea0fe5f6333 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 15:42:20 +0000 Subject: [PATCH 366/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 535aacc3..0352f93a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2b5d25c42aae80b17781d652e385cb0c6efa9473c3c5e131df8d8add561f4223.yml -openapi_spec_hash: b973ecdb8f4d13f56b64c4cafa605697 -config_hash: 5ae1121a61e0263e40f13c9d7d45c935 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1fab56fc7ffb9bb5d047373fb5b6e87bd4c9a0fe9722aaf8883cd610e7e49076.yml +openapi_spec_hash: f6cc68597aa394e0aff61a1134760180 +config_hash: 3baf22e1ba2ea473a953cae5b4983a59 From 1f239cf42d3b0785356bc411b2944979b92a96d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 15:57:07 +0000 Subject: [PATCH 367/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0352f93a..22d7adbc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1fab56fc7ffb9bb5d047373fb5b6e87bd4c9a0fe9722aaf8883cd610e7e49076.yml -openapi_spec_hash: f6cc68597aa394e0aff61a1134760180 -config_hash: 3baf22e1ba2ea473a953cae5b4983a59 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-15f2c0c63051be741e815dc5bdf3c872d44be772c59a2da699d8159ddde1ed8b.yml +openapi_spec_hash: f9694289a0a4550b5aaba20045aeb661 +config_hash: 46181938e983742bbe5ea736cb76993b From 8254156386c7d0cc61ee6abe3dbfe07575a41133 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:17:30 +0000 Subject: [PATCH 368/505] docs(api): update filter descriptions in groups role_assignment_list_params --- .stats.yml | 4 ++-- .../types/groups/role_assignment_list_params.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 22d7adbc..097d11e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-15f2c0c63051be741e815dc5bdf3c872d44be772c59a2da699d8159ddde1ed8b.yml -openapi_spec_hash: f9694289a0a4550b5aaba20045aeb661 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6ddb2652b5fb1610666e18a37fff845ede972439790678f3a8cda6c10e359f68.yml +openapi_spec_hash: 264d8d361658501f45a7ac14ffd82e62 config_hash: 46181938e983742bbe5ea736cb76993b diff --git a/src/gitpod/types/groups/role_assignment_list_params.py b/src/gitpod/types/groups/role_assignment_list_params.py index 69be3188..7d3faf02 100644 --- a/src/gitpod/types/groups/role_assignment_list_params.py +++ b/src/gitpod/types/groups/role_assignment_list_params.py @@ -37,18 +37,18 @@ class Filter(TypedDict, total=False): resource_id: Annotated[str, PropertyInfo(alias="resourceId")] """Filters by a single resource. - Use this when listing all groups that have access to a specific resource (e.g. - share dialogs). Non-admin callers with :grant permission on the resource can see - role assignments from groups they don't belong to. Mutually exclusive with + Non-admin callers with :grant permission on the resource can see role + assignments from groups they don't belong to. Mutually exclusive with resource_ids. """ resource_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="resourceIds")] """Filters by multiple resources in a single request. - Use this for batch permission lookups (e.g. checking the caller's own - permissions across several resources). Does not support the :grant permission - bypass. Mutually exclusive with resource_id. + Non-admin callers with :grant permission on a resource can see all role + assignments for that resource, even from groups they don't belong to. The :grant + check is applied per-resource within the batch. Mutually exclusive with + resource_id. """ resource_roles: Annotated[List[ResourceRole], PropertyInfo(alias="resourceRoles")] From 2f15d85ccfc2af4941cf116ffb021927d518adfc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:24:36 +0000 Subject: [PATCH 369/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 097d11e0..764f7c36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6ddb2652b5fb1610666e18a37fff845ede972439790678f3a8cda6c10e359f68.yml -openapi_spec_hash: 264d8d361658501f45a7ac14ffd82e62 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c3174438205baf14c66a8d57efd38f1e64bb9c5979146334023a742f4b65426c.yml +openapi_spec_hash: 128c9686ed1c6174e71eab661ef63bce config_hash: 46181938e983742bbe5ea736cb76993b From f829d4ccb14b368da262046064a1fa326e0cbf8d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:39:31 +0000 Subject: [PATCH 370/505] fix(types): remove AGENT_EXECUTION values from Principal and ResourceRole enums --- .stats.yml | 4 ++-- src/gitpod/types/shared/principal.py | 1 - src/gitpod/types/shared/resource_role.py | 1 - src/gitpod/types/shared_params/principal.py | 1 - src/gitpod/types/shared_params/resource_role.py | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 764f7c36..9c136dfd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c3174438205baf14c66a8d57efd38f1e64bb9c5979146334023a742f4b65426c.yml -openapi_spec_hash: 128c9686ed1c6174e71eab661ef63bce +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b6950e81b6a48c630d396d3d36e8d4cfb10e92bb9839cddf44ecc7dd06bab57b.yml +openapi_spec_hash: a9719dc002914a9fbb09bea594104777 config_hash: 46181938e983742bbe5ea736cb76993b diff --git a/src/gitpod/types/shared/principal.py b/src/gitpod/types/shared/principal.py index b71334f8..5300b520 100644 --- a/src/gitpod/types/shared/principal.py +++ b/src/gitpod/types/shared/principal.py @@ -12,5 +12,4 @@ "PRINCIPAL_ENVIRONMENT", "PRINCIPAL_SERVICE_ACCOUNT", "PRINCIPAL_RUNNER_MANAGER", - "PRINCIPAL_AGENT_EXECUTION", ] diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index c26b9211..24874f4e 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -43,7 +43,6 @@ "RESOURCE_ROLE_ENVIRONMENT_TASK_ENV", "RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY", "RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN", - "RESOURCE_ROLE_AGENT_EXECUTION_IDENTITY", "RESOURCE_ROLE_AGENT_EXECUTION_USER", "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", diff --git a/src/gitpod/types/shared_params/principal.py b/src/gitpod/types/shared_params/principal.py index 465d7b21..3cefcfa1 100644 --- a/src/gitpod/types/shared_params/principal.py +++ b/src/gitpod/types/shared_params/principal.py @@ -14,5 +14,4 @@ "PRINCIPAL_ENVIRONMENT", "PRINCIPAL_SERVICE_ACCOUNT", "PRINCIPAL_RUNNER_MANAGER", - "PRINCIPAL_AGENT_EXECUTION", ] diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index 71d430d8..43687de7 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -45,7 +45,6 @@ "RESOURCE_ROLE_ENVIRONMENT_TASK_ENV", "RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY", "RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN", - "RESOURCE_ROLE_AGENT_EXECUTION_IDENTITY", "RESOURCE_ROLE_AGENT_EXECUTION_USER", "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", From 25095bffe33ce69c602e4fd929fb081a364cdfd1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 11:14:53 +0000 Subject: [PATCH 371/505] feat(api): add filter parameter to groups list method --- .stats.yml | 4 ++-- src/gitpod/resources/groups/groups.py | 22 ++++++++++++++++++++-- src/gitpod/types/group_list_params.py | 12 +++++++++++- tests/api_resources/test_groups.py | 2 ++ 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9c136dfd..84c0c592 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b6950e81b6a48c630d396d3d36e8d4cfb10e92bb9839cddf44ecc7dd06bab57b.yml -openapi_spec_hash: a9719dc002914a9fbb09bea594104777 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-776b637a72fdf509d1426a6fd7529f935fb920ba7dc55e4da9e32130f63df330.yml +openapi_spec_hash: 43b107cede38b82de2a9812840ebd18f config_hash: 46181938e983742bbe5ea736cb76993b diff --git a/src/gitpod/resources/groups/groups.py b/src/gitpod/resources/groups/groups.py index bebd369b..f32fe099 100644 --- a/src/gitpod/resources/groups/groups.py +++ b/src/gitpod/resources/groups/groups.py @@ -270,6 +270,7 @@ def list( *, token: str | Omit = omit, page_size: int | Omit = omit, + filter: group_list_params.Filter | Omit = omit, pagination: group_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -314,6 +315,8 @@ def list( All organization members can list groups (transparency model). Args: + filter: filter contains options for filtering the list of groups. + pagination: pagination contains the pagination options for listing groups extra_headers: Send extra headers @@ -327,7 +330,13 @@ def list( return self._get_api_list( "/gitpod.v1.GroupService/ListGroups", page=SyncGroupsPage[Group], - body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + group_list_params.GroupListParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -614,6 +623,7 @@ def list( *, token: str | Omit = omit, page_size: int | Omit = omit, + filter: group_list_params.Filter | Omit = omit, pagination: group_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -658,6 +668,8 @@ def list( All organization members can list groups (transparency model). Args: + filter: filter contains options for filtering the list of groups. + pagination: pagination contains the pagination options for listing groups extra_headers: Send extra headers @@ -671,7 +683,13 @@ def list( return self._get_api_list( "/gitpod.v1.GroupService/ListGroups", page=AsyncGroupsPage[Group], - body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + group_list_params.GroupListParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/gitpod/types/group_list_params.py b/src/gitpod/types/group_list_params.py index 223e3e8d..55450c32 100644 --- a/src/gitpod/types/group_list_params.py +++ b/src/gitpod/types/group_list_params.py @@ -6,7 +6,7 @@ from .._utils import PropertyInfo -__all__ = ["GroupListParams", "Pagination"] +__all__ = ["GroupListParams", "Filter", "Pagination"] class GroupListParams(TypedDict, total=False): @@ -14,10 +14,20 @@ class GroupListParams(TypedDict, total=False): page_size: Annotated[int, PropertyInfo(alias="pageSize")] + filter: Filter + """filter contains options for filtering the list of groups.""" + pagination: Pagination """pagination contains the pagination options for listing groups""" +class Filter(TypedDict, total=False): + """filter contains options for filtering the list of groups.""" + + search: str + """search performs case-insensitive search across group name, description, and ID""" + + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing groups""" diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index ccb4f2db..9e478183 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -147,6 +147,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: group = client.groups.list( token="token", page_size=0, + filter={"search": "search"}, pagination={ "token": "token", "page_size": 20, @@ -342,6 +343,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N group = await async_client.groups.list( token="token", page_size=0, + filter={"search": "search"}, pagination={ "token": "token", "page_size": 20, From f5e2189362e89427a23ffda5603b89a12c7a8a40 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 15:10:53 +0000 Subject: [PATCH 372/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 84c0c592..aa052ca9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-776b637a72fdf509d1426a6fd7529f935fb920ba7dc55e4da9e32130f63df330.yml -openapi_spec_hash: 43b107cede38b82de2a9812840ebd18f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cd2fb0d9ef1292b69e2a8bf7de48849e0eb9f3f44428c472603b611240b8c4d5.yml +openapi_spec_hash: 1485a4c623b139485bde309b7a597edb config_hash: 46181938e983742bbe5ea736cb76993b From d8728829e4222d50032a30420894654c18ea4156 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 19:30:41 +0000 Subject: [PATCH 373/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index aa052ca9..6f6fe282 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cd2fb0d9ef1292b69e2a8bf7de48849e0eb9f3f44428c472603b611240b8c4d5.yml -openapi_spec_hash: 1485a4c623b139485bde309b7a597edb -config_hash: 46181938e983742bbe5ea736cb76993b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d7f548d9bd50aca802b55ace7e9194d8dbe4a96a1258abcc4786cb00094b6802.yml +openapi_spec_hash: d29ac6bb840f1dcfec0ab4b7e1235060 +config_hash: 343503f34d4ea5e1d46f58f24519a796 From 42aa5cb8113eaee8ac2633f43e93729018087858 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 23:07:37 +0000 Subject: [PATCH 374/505] chore(docs): add missing descriptions --- src/gitpod/_client.py | 66 +++++++++++++++++++++++++++++++ src/gitpod/resources/errors.py | 10 +++++ src/gitpod/resources/prebuilds.py | 10 +++++ src/gitpod/resources/usage.py | 8 ++++ 4 files changed, 94 insertions(+) diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index e1319a29..888775ef 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -150,6 +150,10 @@ def environments(self) -> EnvironmentsResource: @cached_property def errors(self) -> ErrorsResource: + """ + ErrorsService provides endpoints for clients to report errors + that will be sent to error reporting systems. + """ from .resources.errors import ErrorsResource return ErrorsResource(self) @@ -186,6 +190,10 @@ def organizations(self) -> OrganizationsResource: @cached_property def prebuilds(self) -> PrebuildsResource: + """ + PrebuildService manages prebuilds for projects to enable faster environment startup times. + Prebuilds create snapshots of environments that can be used to provision new environments quickly. + """ from .resources.prebuilds import PrebuildsResource return PrebuildsResource(self) @@ -210,6 +218,9 @@ def secrets(self) -> SecretsResource: @cached_property def usage(self) -> UsageResource: + """ + UsageService provides usage information about environments, users, and projects. + """ from .resources.usage import UsageResource return UsageResource(self) @@ -414,6 +425,10 @@ def environments(self) -> AsyncEnvironmentsResource: @cached_property def errors(self) -> AsyncErrorsResource: + """ + ErrorsService provides endpoints for clients to report errors + that will be sent to error reporting systems. + """ from .resources.errors import AsyncErrorsResource return AsyncErrorsResource(self) @@ -450,6 +465,10 @@ def organizations(self) -> AsyncOrganizationsResource: @cached_property def prebuilds(self) -> AsyncPrebuildsResource: + """ + PrebuildService manages prebuilds for projects to enable faster environment startup times. + Prebuilds create snapshots of environments that can be used to provision new environments quickly. + """ from .resources.prebuilds import AsyncPrebuildsResource return AsyncPrebuildsResource(self) @@ -474,6 +493,9 @@ def secrets(self) -> AsyncSecretsResource: @cached_property def usage(self) -> AsyncUsageResource: + """ + UsageService provides usage information about environments, users, and projects. + """ from .resources.usage import AsyncUsageResource return AsyncUsageResource(self) @@ -629,6 +651,10 @@ def environments(self) -> environments.EnvironmentsResourceWithRawResponse: @cached_property def errors(self) -> errors.ErrorsResourceWithRawResponse: + """ + ErrorsService provides endpoints for clients to report errors + that will be sent to error reporting systems. + """ from .resources.errors import ErrorsResourceWithRawResponse return ErrorsResourceWithRawResponse(self._client.errors) @@ -665,6 +691,10 @@ def organizations(self) -> organizations.OrganizationsResourceWithRawResponse: @cached_property def prebuilds(self) -> prebuilds.PrebuildsResourceWithRawResponse: + """ + PrebuildService manages prebuilds for projects to enable faster environment startup times. + Prebuilds create snapshots of environments that can be used to provision new environments quickly. + """ from .resources.prebuilds import PrebuildsResourceWithRawResponse return PrebuildsResourceWithRawResponse(self._client.prebuilds) @@ -689,6 +719,9 @@ def secrets(self) -> secrets.SecretsResourceWithRawResponse: @cached_property def usage(self) -> usage.UsageResourceWithRawResponse: + """ + UsageService provides usage information about environments, users, and projects. + """ from .resources.usage import UsageResourceWithRawResponse return UsageResourceWithRawResponse(self._client.usage) @@ -732,6 +765,10 @@ def environments(self) -> environments.AsyncEnvironmentsResourceWithRawResponse: @cached_property def errors(self) -> errors.AsyncErrorsResourceWithRawResponse: + """ + ErrorsService provides endpoints for clients to report errors + that will be sent to error reporting systems. + """ from .resources.errors import AsyncErrorsResourceWithRawResponse return AsyncErrorsResourceWithRawResponse(self._client.errors) @@ -768,6 +805,10 @@ def organizations(self) -> organizations.AsyncOrganizationsResourceWithRawRespon @cached_property def prebuilds(self) -> prebuilds.AsyncPrebuildsResourceWithRawResponse: + """ + PrebuildService manages prebuilds for projects to enable faster environment startup times. + Prebuilds create snapshots of environments that can be used to provision new environments quickly. + """ from .resources.prebuilds import AsyncPrebuildsResourceWithRawResponse return AsyncPrebuildsResourceWithRawResponse(self._client.prebuilds) @@ -792,6 +833,9 @@ def secrets(self) -> secrets.AsyncSecretsResourceWithRawResponse: @cached_property def usage(self) -> usage.AsyncUsageResourceWithRawResponse: + """ + UsageService provides usage information about environments, users, and projects. + """ from .resources.usage import AsyncUsageResourceWithRawResponse return AsyncUsageResourceWithRawResponse(self._client.usage) @@ -835,6 +879,10 @@ def environments(self) -> environments.EnvironmentsResourceWithStreamingResponse @cached_property def errors(self) -> errors.ErrorsResourceWithStreamingResponse: + """ + ErrorsService provides endpoints for clients to report errors + that will be sent to error reporting systems. + """ from .resources.errors import ErrorsResourceWithStreamingResponse return ErrorsResourceWithStreamingResponse(self._client.errors) @@ -871,6 +919,10 @@ def organizations(self) -> organizations.OrganizationsResourceWithStreamingRespo @cached_property def prebuilds(self) -> prebuilds.PrebuildsResourceWithStreamingResponse: + """ + PrebuildService manages prebuilds for projects to enable faster environment startup times. + Prebuilds create snapshots of environments that can be used to provision new environments quickly. + """ from .resources.prebuilds import PrebuildsResourceWithStreamingResponse return PrebuildsResourceWithStreamingResponse(self._client.prebuilds) @@ -895,6 +947,9 @@ def secrets(self) -> secrets.SecretsResourceWithStreamingResponse: @cached_property def usage(self) -> usage.UsageResourceWithStreamingResponse: + """ + UsageService provides usage information about environments, users, and projects. + """ from .resources.usage import UsageResourceWithStreamingResponse return UsageResourceWithStreamingResponse(self._client.usage) @@ -938,6 +993,10 @@ def environments(self) -> environments.AsyncEnvironmentsResourceWithStreamingRes @cached_property def errors(self) -> errors.AsyncErrorsResourceWithStreamingResponse: + """ + ErrorsService provides endpoints for clients to report errors + that will be sent to error reporting systems. + """ from .resources.errors import AsyncErrorsResourceWithStreamingResponse return AsyncErrorsResourceWithStreamingResponse(self._client.errors) @@ -974,6 +1033,10 @@ def organizations(self) -> organizations.AsyncOrganizationsResourceWithStreaming @cached_property def prebuilds(self) -> prebuilds.AsyncPrebuildsResourceWithStreamingResponse: + """ + PrebuildService manages prebuilds for projects to enable faster environment startup times. + Prebuilds create snapshots of environments that can be used to provision new environments quickly. + """ from .resources.prebuilds import AsyncPrebuildsResourceWithStreamingResponse return AsyncPrebuildsResourceWithStreamingResponse(self._client.prebuilds) @@ -998,6 +1061,9 @@ def secrets(self) -> secrets.AsyncSecretsResourceWithStreamingResponse: @cached_property def usage(self) -> usage.AsyncUsageResourceWithStreamingResponse: + """ + UsageService provides usage information about environments, users, and projects. + """ from .resources.usage import AsyncUsageResourceWithStreamingResponse return AsyncUsageResourceWithStreamingResponse(self._client.usage) diff --git a/src/gitpod/resources/errors.py b/src/gitpod/resources/errors.py index 220301f2..68f6e2b4 100644 --- a/src/gitpod/resources/errors.py +++ b/src/gitpod/resources/errors.py @@ -24,6 +24,11 @@ class ErrorsResource(SyncAPIResource): + """ + ErrorsService provides endpoints for clients to report errors + that will be sent to error reporting systems. + """ + @cached_property def with_raw_response(self) -> ErrorsResourceWithRawResponse: """ @@ -94,6 +99,11 @@ def report_errors( class AsyncErrorsResource(AsyncAPIResource): + """ + ErrorsService provides endpoints for clients to report errors + that will be sent to error reporting systems. + """ + @cached_property def with_raw_response(self) -> AsyncErrorsResourceWithRawResponse: """ diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py index c688d1a3..d170df0c 100644 --- a/src/gitpod/resources/prebuilds.py +++ b/src/gitpod/resources/prebuilds.py @@ -37,6 +37,11 @@ class PrebuildsResource(SyncAPIResource): + """ + PrebuildService manages prebuilds for projects to enable faster environment startup times. + Prebuilds create snapshots of environments that can be used to provision new environments quickly. + """ + @cached_property def with_raw_response(self) -> PrebuildsResourceWithRawResponse: """ @@ -400,6 +405,11 @@ def create_logs_token( class AsyncPrebuildsResource(AsyncAPIResource): + """ + PrebuildService manages prebuilds for projects to enable faster environment startup times. + Prebuilds create snapshots of environments that can be used to provision new environments quickly. + """ + @cached_property def with_raw_response(self) -> AsyncPrebuildsResourceWithRawResponse: """ diff --git a/src/gitpod/resources/usage.py b/src/gitpod/resources/usage.py index 2b98af15..6285e304 100644 --- a/src/gitpod/resources/usage.py +++ b/src/gitpod/resources/usage.py @@ -23,6 +23,10 @@ class UsageResource(SyncAPIResource): + """ + UsageService provides usage information about environments, users, and projects. + """ + @cached_property def with_raw_response(self) -> UsageResourceWithRawResponse: """ @@ -123,6 +127,10 @@ def list_environment_runtime_records( class AsyncUsageResource(AsyncAPIResource): + """ + UsageService provides usage information about environments, users, and projects. + """ + @cached_property def with_raw_response(self) -> AsyncUsageResourceWithRawResponse: """ From 83a81512dc7baccccd675b1c15175f3b7e3fb3ec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 12:12:25 +0000 Subject: [PATCH 375/505] feat(api): add acknowledge_token param to environments.start method --- .stats.yml | 4 ++-- .../resources/environments/environments.py | 24 +++++++++++++++++-- src/gitpod/types/environment_start_params.py | 7 ++++++ tests/api_resources/test_environments.py | 2 ++ 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6f6fe282..5d8449d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d7f548d9bd50aca802b55ace7e9194d8dbe4a96a1258abcc4786cb00094b6802.yml -openapi_spec_hash: d29ac6bb840f1dcfec0ab4b7e1235060 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b501e4da71906d7d2cfb49ff85c4d1316592623392cf00cb535938b7844f469b.yml +openapi_spec_hash: 5b1bd959ae6f6a909b3d00acbb49ea78 config_hash: 343503f34d4ea5e1d46f58f24519a796 diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 3f5defc8..9ffac9ce 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -748,6 +748,7 @@ def mark_active( def start( self, *, + acknowledge_token: str | Omit = omit, environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -774,6 +775,10 @@ def start( ``` Args: + acknowledge_token: acknowledge_token is the HMAC token from a previous + EnvironmentMaxLifetimeEnforcementDetails response, allowing the user to start an + environment past its max lifetime in warn mode. + environment_id: environment_id specifies which environment should be started. extra_headers: Send extra headers @@ -786,7 +791,13 @@ def start( """ return self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", - body=maybe_transform({"environment_id": environment_id}, environment_start_params.EnvironmentStartParams), + body=maybe_transform( + { + "acknowledge_token": acknowledge_token, + "environment_id": environment_id, + }, + environment_start_params.EnvironmentStartParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1577,6 +1588,7 @@ async def mark_active( async def start( self, *, + acknowledge_token: str | Omit = omit, environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1603,6 +1615,10 @@ async def start( ``` Args: + acknowledge_token: acknowledge_token is the HMAC token from a previous + EnvironmentMaxLifetimeEnforcementDetails response, allowing the user to start an + environment past its max lifetime in warn mode. + environment_id: environment_id specifies which environment should be started. extra_headers: Send extra headers @@ -1616,7 +1632,11 @@ async def start( return await self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", body=await async_maybe_transform( - {"environment_id": environment_id}, environment_start_params.EnvironmentStartParams + { + "acknowledge_token": acknowledge_token, + "environment_id": environment_id, + }, + environment_start_params.EnvironmentStartParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/gitpod/types/environment_start_params.py b/src/gitpod/types/environment_start_params.py index 83fe0a45..c7a5b066 100644 --- a/src/gitpod/types/environment_start_params.py +++ b/src/gitpod/types/environment_start_params.py @@ -10,5 +10,12 @@ class EnvironmentStartParams(TypedDict, total=False): + acknowledge_token: Annotated[str, PropertyInfo(alias="acknowledgeToken")] + """ + acknowledge_token is the HMAC token from a previous + EnvironmentMaxLifetimeEnforcementDetails response, allowing the user to start an + environment past its max lifetime in warn mode. + """ + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies which environment should be started.""" diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index f74ce337..25c315d9 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -609,6 +609,7 @@ def test_method_start(self, client: Gitpod) -> None: @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( + acknowledge_token="acknowledgeToken", environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) @@ -1296,6 +1297,7 @@ async def test_method_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( + acknowledge_token="acknowledgeToken", environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) From caa4e72d37160de014c113d35851646a27ceb23b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 13:30:33 +0000 Subject: [PATCH 376/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5d8449d1..43eb27f6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b501e4da71906d7d2cfb49ff85c4d1316592623392cf00cb535938b7844f469b.yml -openapi_spec_hash: 5b1bd959ae6f6a909b3d00acbb49ea78 -config_hash: 343503f34d4ea5e1d46f58f24519a796 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5b98a29682165caf4e36ec765ee98bde27789f634486cbf4f5410eb15e8748d2.yml +openapi_spec_hash: f013c12b05b6813f3b3c06b95e443543 +config_hash: 2ccc720c40279ba2b77b64507b6e9621 From 0a7d5616efcbfbd0b574abe36b22b6fd083b1495 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 17:13:27 +0000 Subject: [PATCH 377/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 43eb27f6..8d505c88 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5b98a29682165caf4e36ec765ee98bde27789f634486cbf4f5410eb15e8748d2.yml -openapi_spec_hash: f013c12b05b6813f3b3c06b95e443543 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7f650e7c07a6256395063855ce265987aa6bc16d3d8d0d740f1e4bf6d63d162c.yml +openapi_spec_hash: 11306b12c04b848e239afdd71e3034f9 config_hash: 2ccc720c40279ba2b77b64507b6e9621 From 1ed7abd5f865eea754f7c1f8d18e5dfa3eebdb08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 17:45:40 +0000 Subject: [PATCH 378/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8d505c88..3e687310 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7f650e7c07a6256395063855ce265987aa6bc16d3d8d0d740f1e4bf6d63d162c.yml -openapi_spec_hash: 11306b12c04b848e239afdd71e3034f9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-def2db81f6becdef534b062180365fc518fd77f8a8dfaf6bc50a79b65f34530a.yml +openapi_spec_hash: cc85813a9997d3e1305d1f500253438f config_hash: 2ccc720c40279ba2b77b64507b6e9621 From 0b65a66d9e1af0b901b78174ca7a89e9f25f2023 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 20:21:04 +0000 Subject: [PATCH 379/505] feat(api): remove acknowledge_token parameter from environments.start --- .stats.yml | 4 ++-- .../resources/environments/environments.py | 24 ++----------------- src/gitpod/types/environment_start_params.py | 7 ------ tests/api_resources/test_environments.py | 2 -- 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3e687310..7fe5d35f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-def2db81f6becdef534b062180365fc518fd77f8a8dfaf6bc50a79b65f34530a.yml -openapi_spec_hash: cc85813a9997d3e1305d1f500253438f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-227a61cdae589a1212231e9cd93e8aeef25f78c3360bb3622bc1e749f8508971.yml +openapi_spec_hash: d55bb6b8967f31e9b8cb6f6de9f8fefd config_hash: 2ccc720c40279ba2b77b64507b6e9621 diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 9ffac9ce..3f5defc8 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -748,7 +748,6 @@ def mark_active( def start( self, *, - acknowledge_token: str | Omit = omit, environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -775,10 +774,6 @@ def start( ``` Args: - acknowledge_token: acknowledge_token is the HMAC token from a previous - EnvironmentMaxLifetimeEnforcementDetails response, allowing the user to start an - environment past its max lifetime in warn mode. - environment_id: environment_id specifies which environment should be started. extra_headers: Send extra headers @@ -791,13 +786,7 @@ def start( """ return self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", - body=maybe_transform( - { - "acknowledge_token": acknowledge_token, - "environment_id": environment_id, - }, - environment_start_params.EnvironmentStartParams, - ), + body=maybe_transform({"environment_id": environment_id}, environment_start_params.EnvironmentStartParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1588,7 +1577,6 @@ async def mark_active( async def start( self, *, - acknowledge_token: str | Omit = omit, environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1615,10 +1603,6 @@ async def start( ``` Args: - acknowledge_token: acknowledge_token is the HMAC token from a previous - EnvironmentMaxLifetimeEnforcementDetails response, allowing the user to start an - environment past its max lifetime in warn mode. - environment_id: environment_id specifies which environment should be started. extra_headers: Send extra headers @@ -1632,11 +1616,7 @@ async def start( return await self._post( "/gitpod.v1.EnvironmentService/StartEnvironment", body=await async_maybe_transform( - { - "acknowledge_token": acknowledge_token, - "environment_id": environment_id, - }, - environment_start_params.EnvironmentStartParams, + {"environment_id": environment_id}, environment_start_params.EnvironmentStartParams ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/gitpod/types/environment_start_params.py b/src/gitpod/types/environment_start_params.py index c7a5b066..83fe0a45 100644 --- a/src/gitpod/types/environment_start_params.py +++ b/src/gitpod/types/environment_start_params.py @@ -10,12 +10,5 @@ class EnvironmentStartParams(TypedDict, total=False): - acknowledge_token: Annotated[str, PropertyInfo(alias="acknowledgeToken")] - """ - acknowledge_token is the HMAC token from a previous - EnvironmentMaxLifetimeEnforcementDetails response, allowing the user to start an - environment past its max lifetime in warn mode. - """ - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] """environment_id specifies which environment should be started.""" diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 25c315d9..f74ce337 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -609,7 +609,6 @@ def test_method_start(self, client: Gitpod) -> None: @parametrize def test_method_start_with_all_params(self, client: Gitpod) -> None: environment = client.environments.start( - acknowledge_token="acknowledgeToken", environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) @@ -1297,7 +1296,6 @@ async def test_method_start(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.start( - acknowledge_token="acknowledgeToken", environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) assert_matches_type(object, environment, path=["response"]) From 684440ec3d7d9ad448083557c233fa9b2ffdb31c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 13:33:15 +0000 Subject: [PATCH 380/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7fe5d35f..d445b5f3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-227a61cdae589a1212231e9cd93e8aeef25f78c3360bb3622bc1e749f8508971.yml -openapi_spec_hash: d55bb6b8967f31e9b8cb6f6de9f8fefd -config_hash: 2ccc720c40279ba2b77b64507b6e9621 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7813baf7c65298927bd9044af861b813f95234a32b149904aa533e236a1d5bc4.yml +openapi_spec_hash: 9a58fc72434461a16e0107d0444d3692 +config_hash: bca433624b21694253f4bcfbae4755de From 552988c917c4b352a821955a7d7d5be5c331fa58 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:02:13 +0000 Subject: [PATCH 381/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index d445b5f3..778894b9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7813baf7c65298927bd9044af861b813f95234a32b149904aa533e236a1d5bc4.yml -openapi_spec_hash: 9a58fc72434461a16e0107d0444d3692 -config_hash: bca433624b21694253f4bcfbae4755de +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7a29c69ab60c231f97fcde7e5c26c616622150422bac562e337d61766c9d706f.yml +openapi_spec_hash: 179a6c42e3237a19162cdad3abe057a1 +config_hash: 715e953acf41f9c19fd19ec85e91a053 From 629a1ddb9a0a22f90459e08e4e12deabf567ef84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 08:55:52 +0000 Subject: [PATCH 382/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 778894b9..f7200a93 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7a29c69ab60c231f97fcde7e5c26c616622150422bac562e337d61766c9d706f.yml -openapi_spec_hash: 179a6c42e3237a19162cdad3abe057a1 -config_hash: 715e953acf41f9c19fd19ec85e91a053 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-10e4732dd5dee452719295e8f173113c23a344aef1303c499da41483996eebd3.yml +openapi_spec_hash: 8bd2f5a641f38119443a9441e6b2f509 +config_hash: 616ec36ed369bae528a26b639b765754 From e4e04115bb38afe4c19cb78aaf4ac56eb9b2baae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 11:17:44 +0000 Subject: [PATCH 383/505] feat: [backend/api] add backend search for group members --- .stats.yml | 4 ++-- src/gitpod/resources/groups/memberships.py | 8 ++++++++ src/gitpod/types/groups/membership_list_params.py | 15 ++++++++++++++- tests/api_resources/groups/test_memberships.py | 2 ++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index f7200a93..df8dfa71 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-10e4732dd5dee452719295e8f173113c23a344aef1303c499da41483996eebd3.yml -openapi_spec_hash: 8bd2f5a641f38119443a9441e6b2f509 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0ce6b31b2b602e71c429c0a3b6badb639c6a8efdda66ae724abaf57cdd279429.yml +openapi_spec_hash: 36b42ad4f9be97ce27e8d2243a3f9e1c config_hash: 616ec36ed369bae528a26b639b765754 diff --git a/src/gitpod/resources/groups/memberships.py b/src/gitpod/resources/groups/memberships.py index 9ccee3ce..6183457e 100644 --- a/src/gitpod/resources/groups/memberships.py +++ b/src/gitpod/resources/groups/memberships.py @@ -182,6 +182,7 @@ def list( *, token: str | Omit = omit, page_size: int | Omit = omit, + filter: membership_list_params.Filter | Omit = omit, group_id: str | Omit = omit, pagination: membership_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -216,6 +217,8 @@ def list( All organization members can view group membership (transparency model). Args: + filter: filter contains options for filtering the list of memberships. + pagination: pagination contains the pagination options for listing memberships extra_headers: Send extra headers @@ -231,6 +234,7 @@ def list( page=SyncMembersPage[GroupMembership], body=maybe_transform( { + "filter": filter, "group_id": group_id, "pagination": pagination, }, @@ -460,6 +464,7 @@ def list( *, token: str | Omit = omit, page_size: int | Omit = omit, + filter: membership_list_params.Filter | Omit = omit, group_id: str | Omit = omit, pagination: membership_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -494,6 +499,8 @@ def list( All organization members can view group membership (transparency model). Args: + filter: filter contains options for filtering the list of memberships. + pagination: pagination contains the pagination options for listing memberships extra_headers: Send extra headers @@ -509,6 +516,7 @@ def list( page=AsyncMembersPage[GroupMembership], body=maybe_transform( { + "filter": filter, "group_id": group_id, "pagination": pagination, }, diff --git a/src/gitpod/types/groups/membership_list_params.py b/src/gitpod/types/groups/membership_list_params.py index e2f90e2d..b4fee1d9 100644 --- a/src/gitpod/types/groups/membership_list_params.py +++ b/src/gitpod/types/groups/membership_list_params.py @@ -6,7 +6,7 @@ from ..._utils import PropertyInfo -__all__ = ["MembershipListParams", "Pagination"] +__all__ = ["MembershipListParams", "Filter", "Pagination"] class MembershipListParams(TypedDict, total=False): @@ -14,12 +14,25 @@ class MembershipListParams(TypedDict, total=False): page_size: Annotated[int, PropertyInfo(alias="pageSize")] + filter: Filter + """filter contains options for filtering the list of memberships.""" + group_id: Annotated[str, PropertyInfo(alias="groupId")] pagination: Pagination """pagination contains the pagination options for listing memberships""" +class Filter(TypedDict, total=False): + """filter contains options for filtering the list of memberships.""" + + search: str + """ + search performs case-insensitive search across member name, email, ID, and + service account name and description + """ + + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing memberships""" diff --git a/tests/api_resources/groups/test_memberships.py b/tests/api_resources/groups/test_memberships.py index f73463f5..dd922c3b 100644 --- a/tests/api_resources/groups/test_memberships.py +++ b/tests/api_resources/groups/test_memberships.py @@ -120,6 +120,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: membership = client.groups.memberships.list( token="token", page_size=0, + filter={"search": "search"}, group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", pagination={ "token": "token", @@ -290,6 +291,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N membership = await async_client.groups.memberships.list( token="token", page_size=0, + filter={"search": "search"}, group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", pagination={ "token": "token", From 340067bffd61833c1d92d2269fb817a6902c7821 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 11:55:33 +0000 Subject: [PATCH 384/505] feat(api): add resource_type_filters parameter to events watch method --- .stats.yml | 4 ++-- src/gitpod/resources/events.py | 16 +++++++++++++ src/gitpod/types/event_watch_params.py | 33 +++++++++++++++++++++++++- tests/api_resources/test_events.py | 14 +++++++++++ 4 files changed, 64 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index df8dfa71..7f33d30f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0ce6b31b2b602e71c429c0a3b6badb639c6a8efdda66ae724abaf57cdd279429.yml -openapi_spec_hash: 36b42ad4f9be97ce27e8d2243a3f9e1c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1968882466818a42e20c78ead4d7565ffb92872416a570e5d6a2f9e2cf024e58.yml +openapi_spec_hash: 510d568d2b22bcef55ffe1d1d6abd926 config_hash: 616ec36ed369bae528a26b639b765754 diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index 6dd3c3d2..af65788d 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Iterable + import httpx from ..types import event_list_params, event_watch_params @@ -139,6 +141,7 @@ def watch( *, environment_id: str | Omit = omit, organization: bool | Omit = omit, + resource_type_filters: Iterable[event_watch_params.ResourceTypeFilter] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -173,6 +176,11 @@ def watch( the caller can see within their organization. No task, task execution or service events are produed. + resource_type_filters: Filters to limit which events are delivered on organization-scoped streams. When + empty, all events for the scope are delivered. When populated, only events + matching at least one filter entry are forwarded. Not supported for + environment-scoped streams; setting this field returns an error. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -188,6 +196,7 @@ def watch( { "environment_id": environment_id, "organization": organization, + "resource_type_filters": resource_type_filters, }, event_watch_params.EventWatchParams, ), @@ -314,6 +323,7 @@ async def watch( *, environment_id: str | Omit = omit, organization: bool | Omit = omit, + resource_type_filters: Iterable[event_watch_params.ResourceTypeFilter] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -348,6 +358,11 @@ async def watch( the caller can see within their organization. No task, task execution or service events are produed. + resource_type_filters: Filters to limit which events are delivered on organization-scoped streams. When + empty, all events for the scope are delivered. When populated, only events + matching at least one filter entry are forwarded. Not supported for + environment-scoped streams; setting this field returns an error. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -363,6 +378,7 @@ async def watch( { "environment_id": environment_id, "organization": organization, + "resource_type_filters": resource_type_filters, }, event_watch_params.EventWatchParams, ), diff --git a/src/gitpod/types/event_watch_params.py b/src/gitpod/types/event_watch_params.py index 0465a094..10c53a53 100644 --- a/src/gitpod/types/event_watch_params.py +++ b/src/gitpod/types/event_watch_params.py @@ -2,11 +2,14 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo +from .shared.resource_type import ResourceType -__all__ = ["EventWatchParams"] +__all__ = ["EventWatchParams", "ResourceTypeFilter"] class EventWatchParams(TypedDict, total=False): @@ -22,3 +25,31 @@ class EventWatchParams(TypedDict, total=False): the caller can see within their organization. No task, task execution or service events are produed. """ + + resource_type_filters: Annotated[Iterable[ResourceTypeFilter], PropertyInfo(alias="resourceTypeFilters")] + """ + Filters to limit which events are delivered on organization-scoped streams. When + empty, all events for the scope are delivered. When populated, only events + matching at least one filter entry are forwarded. Not supported for + environment-scoped streams; setting this field returns an error. + """ + + +class ResourceTypeFilter(TypedDict, total=False): + """ + ResourceTypeFilter restricts which events are delivered for a specific resource type. + """ + + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] + """ + If non-empty, only events where the resource was created by one of these user + IDs are delivered. Skipped for DELETE operations (creator info is unavailable + after deletion). Events with no creator information are skipped when this filter + is set (fail-closed). + """ + + resource_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="resourceIds")] + """If non-empty, only events for these specific resource IDs are delivered.""" + + resource_type: Annotated[ResourceType, PropertyInfo(alias="resourceType")] + """The resource type to filter for.""" diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 5cc28f86..b5b401d9 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -81,6 +81,13 @@ def test_method_watch_with_all_params(self, client: Gitpod) -> None: event_stream = client.events.watch( environment_id="environmentId", organization=True, + resource_type_filters=[ + { + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "resource_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "resource_type": "RESOURCE_TYPE_UNSPECIFIED", + } + ], ) for item in event_stream: assert_matches_type(EventWatchResponse, item, path=["response"]) @@ -176,6 +183,13 @@ async def test_method_watch_with_all_params(self, async_client: AsyncGitpod) -> event_stream = await async_client.events.watch( environment_id="environmentId", organization=True, + resource_type_filters=[ + { + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "resource_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "resource_type": "RESOURCE_TYPE_UNSPECIFIED", + } + ], ) async for item in event_stream: assert_matches_type(EventWatchResponse, item, path=["response"]) From bf98674fb5d9d3f7033071e46c3d88263168198a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 14:58:06 +0000 Subject: [PATCH 385/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7f33d30f..8b7362ee 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1968882466818a42e20c78ead4d7565ffb92872416a570e5d6a2f9e2cf024e58.yml -openapi_spec_hash: 510d568d2b22bcef55ffe1d1d6abd926 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-77eb1a0016f04591ada6cf48b9981ee9c6a5d342a8c905ce968cb82ea2304886.yml +openapi_spec_hash: bf3810346fba6627bf4173f6dff0e0e0 config_hash: 616ec36ed369bae528a26b639b765754 From 7b516353881014afe46c1dec33c2c9d42cb41a72 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 15:05:24 +0000 Subject: [PATCH 386/505] feat(api): add organization_tier field to identity get_authenticated_identity response --- .stats.yml | 4 ++-- .../types/identity_get_authenticated_identity_response.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8b7362ee..9e855f1a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-77eb1a0016f04591ada6cf48b9981ee9c6a5d342a8c905ce968cb82ea2304886.yml -openapi_spec_hash: bf3810346fba6627bf4173f6dff0e0e0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bb735be0ce5fbec3b2cfedea3c62451aaa06bba7c96529d2bd3926a1d18b6f5e.yml +openapi_spec_hash: 0aa3833a646110eb40cd4dc9062eecd3 config_hash: 616ec36ed369bae528a26b639b765754 diff --git a/src/gitpod/types/identity_get_authenticated_identity_response.py b/src/gitpod/types/identity_get_authenticated_identity_response.py index f04ad098..79bd96c8 100644 --- a/src/gitpod/types/identity_get_authenticated_identity_response.py +++ b/src/gitpod/types/identity_get_authenticated_identity_response.py @@ -13,5 +13,7 @@ class IdentityGetAuthenticatedIdentityResponse(BaseModel): organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + organization_tier: Optional[str] = FieldInfo(alias="organizationTier", default=None) + subject: Optional[Subject] = None """subject is the identity of the current user""" From b182ef96c5634a28e9205de644700020865d973b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 08:41:37 +0000 Subject: [PATCH 387/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9e855f1a..4bda1716 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bb735be0ce5fbec3b2cfedea3c62451aaa06bba7c96529d2bd3926a1d18b6f5e.yml -openapi_spec_hash: 0aa3833a646110eb40cd4dc9062eecd3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7ec4b48b5de101f1adf65b9cb947dc94285681867703fa0934aad768c872b71d.yml +openapi_spec_hash: 23699c122dbe3e98ca77011ed8ffd465 config_hash: 616ec36ed369bae528a26b639b765754 From c9a7887570468dcfc73ce1bf7463f1eae7baac18 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:35:22 +0000 Subject: [PATCH 388/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4bda1716..8b1fc591 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7ec4b48b5de101f1adf65b9cb947dc94285681867703fa0934aad768c872b71d.yml -openapi_spec_hash: 23699c122dbe3e98ca77011ed8ffd465 -config_hash: 616ec36ed369bae528a26b639b765754 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da171ca89186ec1ab21ac52c18c8848af491b06c0362b45b369a4c63c5db4b8b.yml +openapi_spec_hash: 0843635678e90d8aea726f3aba6265d1 +config_hash: e276b61fe25bd7cbb0ddad1a103108e8 From 2905db0ab94f6bb41ac6ef9caa69af7c801ebe44 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 12:26:11 +0000 Subject: [PATCH 389/505] feat(api): add RUNNER_CAPABILITY_WARM_POOL to runner_capability --- .stats.yml | 4 ++-- src/gitpod/types/runner_capability.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8b1fc591..66c1ec9a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da171ca89186ec1ab21ac52c18c8848af491b06c0362b45b369a4c63c5db4b8b.yml -openapi_spec_hash: 0843635678e90d8aea726f3aba6265d1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cb8a5fb9581bfc498c35130cbe1fc78ca7249282b44af108c6cd3fccaf337265.yml +openapi_spec_hash: abeeb3d26bbf9b8a9b6704f2709ade3b config_hash: e276b61fe25bd7cbb0ddad1a103108e8 diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py index 4224cfba..a0528961 100644 --- a/src/gitpod/types/runner_capability.py +++ b/src/gitpod/types/runner_capability.py @@ -16,4 +16,5 @@ "RUNNER_CAPABILITY_LIST_SCM_ORGANIZATIONS", "RUNNER_CAPABILITY_CHECK_REPOSITORY_ACCESS", "RUNNER_CAPABILITY_RUNNER_SIDE_AGENT", + "RUNNER_CAPABILITY_WARM_POOL", ] From 87d1944728916cd8948d0ba46b11342aa82f2c4a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 12:51:41 +0000 Subject: [PATCH 390/505] feat(api): add exclude_prompt_content parameter to agents list_prompts method --- .stats.yml | 4 ++-- src/gitpod/types/agent_list_prompts_params.py | 7 +++++++ tests/api_resources/test_agents.py | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 66c1ec9a..c687f79e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cb8a5fb9581bfc498c35130cbe1fc78ca7249282b44af108c6cd3fccaf337265.yml -openapi_spec_hash: abeeb3d26bbf9b8a9b6704f2709ade3b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e4a03098a3a5e4104a7d4feb50e32642185be6792e839f19f17b95af1f0fea93.yml +openapi_spec_hash: 34c3f9d3172d66b7c9f788d282529681 config_hash: e276b61fe25bd7cbb0ddad1a103108e8 diff --git a/src/gitpod/types/agent_list_prompts_params.py b/src/gitpod/types/agent_list_prompts_params.py index 6c3ac239..eb1f295c 100644 --- a/src/gitpod/types/agent_list_prompts_params.py +++ b/src/gitpod/types/agent_list_prompts_params.py @@ -24,6 +24,13 @@ class Filter(TypedDict, total=False): command_prefix: Annotated[str, PropertyInfo(alias="commandPrefix")] + exclude_prompt_content: Annotated[bool, PropertyInfo(alias="excludePromptContent")] + """ + exclude_prompt_content omits the large spec.prompt text from the response. Other + spec fields (is_template, is_command, command, is_skill) are still returned. Use + GetPrompt to retrieve the full prompt content when needed. + """ + is_command: Annotated[bool, PropertyInfo(alias="isCommand")] is_skill: Annotated[bool, PropertyInfo(alias="isSkill")] diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index c5c87a4f..030830e3 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -243,6 +243,7 @@ def test_method_list_prompts_with_all_params(self, client: Gitpod) -> None: filter={ "command": "command", "command_prefix": "commandPrefix", + "exclude_prompt_content": True, "is_command": True, "is_skill": True, "is_template": True, @@ -771,6 +772,7 @@ async def test_method_list_prompts_with_all_params(self, async_client: AsyncGitp filter={ "command": "command", "command_prefix": "commandPrefix", + "exclude_prompt_content": True, "is_command": True, "is_skill": True, "is_template": True, From f41897fb4d7c4161ae0c3ebab83d6c800e4a3865 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 13:58:57 +0000 Subject: [PATCH 391/505] chore(internal): move CountResponseRelation type to shared module --- .stats.yml | 6 +++--- api.md | 2 +- src/gitpod/types/__init__.py | 2 +- src/gitpod/types/shared/__init__.py | 1 + src/gitpod/types/{ => shared}/count_response_relation.py | 0 5 files changed, 6 insertions(+), 5 deletions(-) rename src/gitpod/types/{ => shared}/count_response_relation.py (100%) diff --git a/.stats.yml b/.stats.yml index c687f79e..bc99f504 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e4a03098a3a5e4104a7d4feb50e32642185be6792e839f19f17b95af1f0fea93.yml -openapi_spec_hash: 34c3f9d3172d66b7c9f788d282529681 -config_hash: e276b61fe25bd7cbb0ddad1a103108e8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-14f83122502ae8a419398eb6c60cb80211dd32b25d85bf8e8892f836b2e7f8bd.yml +openapi_spec_hash: c0bed614e55432bf93d5179db05836aa +config_hash: b0027f25e9882d48e07f081a437d7732 diff --git a/api.md b/api.md index bc4271c9..7ffff34e 100644 --- a/api.md +++ b/api.md @@ -3,6 +3,7 @@ ```python from gitpod.types import ( AutomationTrigger, + CountResponseRelation, EnvironmentClass, EnvironmentVariableItem, EnvironmentVariableSource, @@ -347,7 +348,6 @@ Types: ```python from gitpod.types import ( - CountResponseRelation, InviteDomains, Organization, OrganizationMember, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index f1c4afcd..04582be2 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -32,6 +32,7 @@ TaskExecutionSpec as TaskExecutionSpec, TaskExecutionPhase as TaskExecutionPhase, TaskExecutionStatus as TaskExecutionStatus, + CountResponseRelation as CountResponseRelation, TaskExecutionMetadata as TaskExecutionMetadata, EnvironmentVariableItem as EnvironmentVariableItem, ProjectEnvironmentClass as ProjectEnvironmentClass, @@ -136,7 +137,6 @@ from .user_get_user_response import UserGetUserResponse as UserGetUserResponse from .user_input_block_param import UserInputBlockParam as UserInputBlockParam from .account_retrieve_params import AccountRetrieveParams as AccountRetrieveParams -from .count_response_relation import CountResponseRelation as CountResponseRelation from .environment_initializer import EnvironmentInitializer as EnvironmentInitializer from .environment_list_params import EnvironmentListParams as EnvironmentListParams from .environment_stop_params import EnvironmentStopParams as EnvironmentStopParams diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index 04e206d4..4a6ac7b4 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -22,6 +22,7 @@ from .task_execution_spec import TaskExecutionSpec as TaskExecutionSpec from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase from .task_execution_status import TaskExecutionStatus as TaskExecutionStatus +from .count_response_relation import CountResponseRelation as CountResponseRelation from .task_execution_metadata import TaskExecutionMetadata as TaskExecutionMetadata from .environment_variable_item import EnvironmentVariableItem as EnvironmentVariableItem from .project_environment_class import ProjectEnvironmentClass as ProjectEnvironmentClass diff --git a/src/gitpod/types/count_response_relation.py b/src/gitpod/types/shared/count_response_relation.py similarity index 100% rename from src/gitpod/types/count_response_relation.py rename to src/gitpod/types/shared/count_response_relation.py From fe5eea9f5be313dd312bb80125deb393c3d68737 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:36:09 +0000 Subject: [PATCH 392/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index bc99f504..240399bb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-14f83122502ae8a419398eb6c60cb80211dd32b25d85bf8e8892f836b2e7f8bd.yml -openapi_spec_hash: c0bed614e55432bf93d5179db05836aa -config_hash: b0027f25e9882d48e07f081a437d7732 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-29973f5cca3188a76cec5213b5561bc79159c927dd53ba05ab23faffc3061058.yml +openapi_spec_hash: d4f8cd1e7e0d486f24ca7d7012e304e2 +config_hash: 41d143fd11898761ee80baf693afe8c7 From b3f7fa0c5230a60211adef64ff827dd7f55d6f84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 12:59:34 +0000 Subject: [PATCH 393/505] chore(ci): skip uploading artifacts on stainless-internal branches --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5fc12d8..1b586dc6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,14 +61,18 @@ jobs: run: rye build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/gitpod-python' + if: |- + github.repository == 'stainless-sdks/gitpod-python' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/gitpod-python' + if: |- + github.repository == 'stainless-sdks/gitpod-python' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} From 50c9de84c1edef15cf31160900c973585f414654 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 8 Mar 2026 02:41:54 +0000 Subject: [PATCH 394/505] feat(api): add session_id parameter to agents start_execution, environments create --- .stats.yml | 6 +++--- src/gitpod/resources/agents.py | 10 ++++++++++ src/gitpod/resources/environments/environments.py | 10 ++++++++++ src/gitpod/types/agent_start_execution_params.py | 6 ++++++ src/gitpod/types/environment_create_params.py | 9 ++++++++- src/gitpod/types/shared/resource_role.py | 3 +++ src/gitpod/types/shared_params/resource_role.py | 3 +++ tests/api_resources/test_agents.py | 2 ++ tests/api_resources/test_environments.py | 2 ++ 9 files changed, 47 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 240399bb..6ca06ab7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-29973f5cca3188a76cec5213b5561bc79159c927dd53ba05ab23faffc3061058.yml -openapi_spec_hash: d4f8cd1e7e0d486f24ca7d7012e304e2 -config_hash: 41d143fd11898761ee80baf693afe8c7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d162e721d07ef5297f2abd69181b59d8a816e0336ff4a874f4ab71628d1cd6a1.yml +openapi_spec_hash: bbad573f1e007ffff0dc2b1fd002c628 +config_hash: ab6aa39d26327d859f6a418e5efa2b35 diff --git a/src/gitpod/resources/agents.py b/src/gitpod/resources/agents.py index 3206d8ce..82dc942a 100644 --- a/src/gitpod/resources/agents.py +++ b/src/gitpod/resources/agents.py @@ -542,6 +542,7 @@ def start_execution( mode: AgentMode | Omit = omit, name: str | Omit = omit, runner_id: str | Omit = omit, + session_id: str | Omit = omit, workflow_action_id: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -579,6 +580,9 @@ def start_execution( execution is routed to this runner instead of the runner associated with the environment. + session_id: session_id is the ID of the session this agent execution belongs to. If empty, a + new session is created implicitly. + workflow_action_id: workflow_action_id is an optional reference to the workflow execution action that created this agent execution. Used for tracking and event correlation. @@ -600,6 +604,7 @@ def start_execution( "mode": mode, "name": name, "runner_id": runner_id, + "session_id": session_id, "workflow_action_id": workflow_action_id, }, agent_start_execution_params.AgentStartExecutionParams, @@ -1208,6 +1213,7 @@ async def start_execution( mode: AgentMode | Omit = omit, name: str | Omit = omit, runner_id: str | Omit = omit, + session_id: str | Omit = omit, workflow_action_id: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1245,6 +1251,9 @@ async def start_execution( execution is routed to this runner instead of the runner associated with the environment. + session_id: session_id is the ID of the session this agent execution belongs to. If empty, a + new session is created implicitly. + workflow_action_id: workflow_action_id is an optional reference to the workflow execution action that created this agent execution. Used for tracking and event correlation. @@ -1266,6 +1275,7 @@ async def start_execution( "mode": mode, "name": name, "runner_id": runner_id, + "session_id": session_id, "workflow_action_id": workflow_action_id, }, agent_start_execution_params.AgentStartExecutionParams, diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 3f5defc8..24d3584e 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -92,6 +92,7 @@ def create( self, *, name: Optional[str] | Omit = omit, + session_id: str | Omit = omit, spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -168,6 +169,9 @@ def create( name: name is a user-defined identifier for the environment. If not specified, the system will generate a name. + session_id: session_id is the ID of the session this environment belongs to. If empty, a new + session is created implicitly. + spec: spec is the configuration of the environment that's required for the to start the environment @@ -184,6 +188,7 @@ def create( body=maybe_transform( { "name": name, + "session_id": session_id, "spec": spec, }, environment_create_params.EnvironmentCreateParams, @@ -921,6 +926,7 @@ async def create( self, *, name: Optional[str] | Omit = omit, + session_id: str | Omit = omit, spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -997,6 +1003,9 @@ async def create( name: name is a user-defined identifier for the environment. If not specified, the system will generate a name. + session_id: session_id is the ID of the session this environment belongs to. If empty, a new + session is created implicitly. + spec: spec is the configuration of the environment that's required for the to start the environment @@ -1013,6 +1022,7 @@ async def create( body=await async_maybe_transform( { "name": name, + "session_id": session_id, "spec": spec, }, environment_create_params.EnvironmentCreateParams, diff --git a/src/gitpod/types/agent_start_execution_params.py b/src/gitpod/types/agent_start_execution_params.py index 4d9f640a..699ab8f6 100644 --- a/src/gitpod/types/agent_start_execution_params.py +++ b/src/gitpod/types/agent_start_execution_params.py @@ -39,6 +39,12 @@ class AgentStartExecutionParams(TypedDict, total=False): environment. """ + session_id: Annotated[str, PropertyInfo(alias="sessionId")] + """ + session_id is the ID of the session this agent execution belongs to. If empty, a + new session is created implicitly. + """ + workflow_action_id: Annotated[Optional[str], PropertyInfo(alias="workflowActionId")] """ workflow_action_id is an optional reference to the workflow execution action diff --git a/src/gitpod/types/environment_create_params.py b/src/gitpod/types/environment_create_params.py index d5c55e8e..711a075d 100644 --- a/src/gitpod/types/environment_create_params.py +++ b/src/gitpod/types/environment_create_params.py @@ -3,8 +3,9 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict +from .._utils import PropertyInfo from .environment_spec_param import EnvironmentSpecParam __all__ = ["EnvironmentCreateParams"] @@ -17,6 +18,12 @@ class EnvironmentCreateParams(TypedDict, total=False): system will generate a name. """ + session_id: Annotated[str, PropertyInfo(alias="sessionId")] + """ + session_id is the ID of the session this environment belongs to. If empty, a new + session is created implicitly. + """ + spec: EnvironmentSpecParam """ spec is the configuration of the environment that's required for the to start diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 24874f4e..23ecaf8b 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -61,4 +61,7 @@ "RESOURCE_ROLE_WARMPOOL_RUNNER", "RESOURCE_ROLE_WARMPOOL_ADMIN", "RESOURCE_ROLE_WARMPOOL_VIEWER", + "RESOURCE_ROLE_SESSION_EDITOR", + "RESOURCE_ROLE_SESSION_CONTRIBUTOR", + "RESOURCE_ROLE_SESSION_VIEWER", ] diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index 43687de7..315234d2 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -63,4 +63,7 @@ "RESOURCE_ROLE_WARMPOOL_RUNNER", "RESOURCE_ROLE_WARMPOOL_ADMIN", "RESOURCE_ROLE_WARMPOOL_VIEWER", + "RESOURCE_ROLE_SESSION_EDITOR", + "RESOURCE_ROLE_SESSION_CONTRIBUTOR", + "RESOURCE_ROLE_SESSION_VIEWER", ] diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 030830e3..f667a9d5 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -442,6 +442,7 @@ def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: mode="AGENT_MODE_UNSPECIFIED", name="name", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) @@ -971,6 +972,7 @@ async def test_method_start_execution_with_all_params(self, async_client: AsyncG mode="AGENT_MODE_UNSPECIFIED", name="name", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index f74ce337..5d6ba940 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -37,6 +37,7 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: environment = client.environments.create( name="name", + session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -724,6 +725,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: environment = await async_client.environments.create( name="name", + session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { From 8f7b585d3f6c9761831fe3fbc5d5655603ed3d9d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:41:04 +0000 Subject: [PATCH 395/505] feat(api): add snapshot_size_bytes field to PrebuildStatus --- .stats.yml | 4 ++-- src/gitpod/types/prebuild_status.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6ca06ab7..cd730344 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d162e721d07ef5297f2abd69181b59d8a816e0336ff4a874f4ab71628d1cd6a1.yml -openapi_spec_hash: bbad573f1e007ffff0dc2b1fd002c628 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8e3ee49e0108858b4375e383823a65ef1f13cfcd63ee9bbb6a73391691aaad57.yml +openapi_spec_hash: 7ec117af0ecf6980bc0d3c1f50ca3d0a config_hash: ab6aa39d26327d859f6a418e5efa2b35 diff --git a/src/gitpod/types/prebuild_status.py b/src/gitpod/types/prebuild_status.py index dcb1fd07..3510ed0d 100644 --- a/src/gitpod/types/prebuild_status.py +++ b/src/gitpod/types/prebuild_status.py @@ -44,6 +44,12 @@ class PrebuildStatus(BaseModel): the provider. """ + snapshot_size_bytes: Optional[str] = FieldInfo(alias="snapshotSizeBytes", default=None) + """ + snapshot_size_bytes is the size of the snapshot in bytes. Only populated when + the snapshot is available (phase is COMPLETED). + """ + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """ status_version is incremented each time the status is updated. Used for From 896e1c50a205c6cdede1bb012bdd28fc87723aac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:52:44 +0000 Subject: [PATCH 396/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index cd730344..c45eeffb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8e3ee49e0108858b4375e383823a65ef1f13cfcd63ee9bbb6a73391691aaad57.yml -openapi_spec_hash: 7ec117af0ecf6980bc0d3c1f50ca3d0a -config_hash: ab6aa39d26327d859f6a418e5efa2b35 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-94c14ac4e7b3f6b74102d8be754d31027df8880df17d9159e510e43225bf0f7c.yml +openapi_spec_hash: 5dc17a3af8103c3981f79d9798e5231f +config_hash: b0b039a51d7272a198c8fce8124b782b From 42af757dc2538a00a142896160447486db7e73cb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 09:34:36 +0000 Subject: [PATCH 397/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index c45eeffb..da34b10d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-94c14ac4e7b3f6b74102d8be754d31027df8880df17d9159e510e43225bf0f7c.yml -openapi_spec_hash: 5dc17a3af8103c3981f79d9798e5231f -config_hash: b0b039a51d7272a198c8fce8124b782b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-aff091b0b0cbc5539f259dec6aa0f89853d79ad407b3252f769a6f90422dd0df.yml +openapi_spec_hash: a6873fd8f07ec0b9ecdc85d187ac4129 +config_hash: 834f0fffab6de425144c4705fcd7228a From 0fee0cf73b9f1bcddc7fe7e91e950dec62324399 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 10:40:22 +0000 Subject: [PATCH 398/505] feat(api): add warm pool methods to prebuilds --- .stats.yml | 4 +- api.md | 13 + src/gitpod/pagination.py | 53 ++ src/gitpod/resources/prebuilds.py | 665 +++++++++++++++++- src/gitpod/types/__init__.py | 13 + .../types/prebuild_create_warm_pool_params.py | 26 + .../prebuild_create_warm_pool_response.py | 17 + .../types/prebuild_delete_warm_pool_params.py | 14 + .../types/prebuild_list_warm_pools_params.py | 48 ++ .../prebuild_retrieve_warm_pool_params.py | 14 + .../prebuild_retrieve_warm_pool_response.py | 17 + .../types/prebuild_update_warm_pool_params.py | 18 + .../prebuild_update_warm_pool_response.py | 17 + src/gitpod/types/warm_pool.py | 30 + src/gitpod/types/warm_pool_metadata.py | 35 + src/gitpod/types/warm_pool_phase.py | 14 + src/gitpod/types/warm_pool_spec.py | 36 + src/gitpod/types/warm_pool_status.py | 28 + tests/api_resources/test_prebuilds.py | 412 ++++++++++- 19 files changed, 1470 insertions(+), 4 deletions(-) create mode 100644 src/gitpod/types/prebuild_create_warm_pool_params.py create mode 100644 src/gitpod/types/prebuild_create_warm_pool_response.py create mode 100644 src/gitpod/types/prebuild_delete_warm_pool_params.py create mode 100644 src/gitpod/types/prebuild_list_warm_pools_params.py create mode 100644 src/gitpod/types/prebuild_retrieve_warm_pool_params.py create mode 100644 src/gitpod/types/prebuild_retrieve_warm_pool_response.py create mode 100644 src/gitpod/types/prebuild_update_warm_pool_params.py create mode 100644 src/gitpod/types/prebuild_update_warm_pool_response.py create mode 100644 src/gitpod/types/warm_pool.py create mode 100644 src/gitpod/types/warm_pool_metadata.py create mode 100644 src/gitpod/types/warm_pool_phase.py create mode 100644 src/gitpod/types/warm_pool_spec.py create mode 100644 src/gitpod/types/warm_pool_status.py diff --git a/.stats.yml b/.stats.yml index da34b10d..3b477db3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 175 +configured_endpoints: 180 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-aff091b0b0cbc5539f259dec6aa0f89853d79ad407b3252f769a6f90422dd0df.yml openapi_spec_hash: a6873fd8f07ec0b9ecdc85d187ac4129 -config_hash: 834f0fffab6de425144c4705fcd7228a +config_hash: 0ec0dc7b6891f666565cf1521a8d172f diff --git a/api.md b/api.md index 7ffff34e..c027c7af 100644 --- a/api.md +++ b/api.md @@ -527,10 +527,18 @@ from gitpod.types import ( PrebuildSpec, PrebuildStatus, PrebuildTrigger, + WarmPool, + WarmPoolMetadata, + WarmPoolPhase, + WarmPoolSpec, + WarmPoolStatus, PrebuildCreateResponse, PrebuildRetrieveResponse, PrebuildCancelResponse, PrebuildCreateLogsTokenResponse, + PrebuildCreateWarmPoolResponse, + PrebuildRetrieveWarmPoolResponse, + PrebuildUpdateWarmPoolResponse, ) ``` @@ -542,6 +550,11 @@ Methods: - client.prebuilds.delete(\*\*params) -> object - client.prebuilds.cancel(\*\*params) -> PrebuildCancelResponse - client.prebuilds.create_logs_token(\*\*params) -> PrebuildCreateLogsTokenResponse +- client.prebuilds.create_warm_pool(\*\*params) -> PrebuildCreateWarmPoolResponse +- client.prebuilds.delete_warm_pool(\*\*params) -> object +- client.prebuilds.list_warm_pools(\*\*params) -> SyncWarmPoolsPage[WarmPool] +- client.prebuilds.retrieve_warm_pool(\*\*params) -> PrebuildRetrieveWarmPoolResponse +- client.prebuilds.update_warm_pool(\*\*params) -> PrebuildUpdateWarmPoolResponse # Projects diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 0ffd69d7..9f534450 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -99,6 +99,9 @@ "TokensPagePagination", "SyncTokensPage", "AsyncTokensPage", + "WarmPoolsPagePagination", + "SyncWarmPoolsPage", + "AsyncWarmPoolsPage", ] _T = TypeVar("_T") @@ -1602,3 +1605,53 @@ def next_page_info(self) -> Optional[PageInfo]: return None return PageInfo(params={"token": next_token}) + + +class WarmPoolsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncWarmPoolsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[WarmPoolsPagePagination] = None + warm_pools: List[_T] = FieldInfo(alias="warmPools") + + @override + def _get_page_items(self) -> List[_T]: + warm_pools = self.warm_pools + if not warm_pools: + return [] + return warm_pools + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncWarmPoolsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[WarmPoolsPagePagination] = None + warm_pools: List[_T] = FieldInfo(alias="warmPools") + + @override + def _get_page_items(self) -> List[_T]: + warm_pools = self.warm_pools + if not warm_pools: + return [] + return warm_pools + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py index d170df0c..6213db22 100644 --- a/src/gitpod/resources/prebuilds.py +++ b/src/gitpod/resources/prebuilds.py @@ -12,7 +12,12 @@ prebuild_create_params, prebuild_delete_params, prebuild_retrieve_params, + prebuild_list_warm_pools_params, + prebuild_create_warm_pool_params, + prebuild_delete_warm_pool_params, + prebuild_update_warm_pool_params, prebuild_create_logs_token_params, + prebuild_retrieve_warm_pool_params, ) from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform @@ -24,14 +29,18 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..pagination import SyncPrebuildsPage, AsyncPrebuildsPage +from ..pagination import SyncPrebuildsPage, SyncWarmPoolsPage, AsyncPrebuildsPage, AsyncWarmPoolsPage from .._base_client import AsyncPaginator, make_request_options from ..types.prebuild import Prebuild +from ..types.warm_pool import WarmPool from ..types.prebuild_spec_param import PrebuildSpecParam from ..types.prebuild_cancel_response import PrebuildCancelResponse from ..types.prebuild_create_response import PrebuildCreateResponse from ..types.prebuild_retrieve_response import PrebuildRetrieveResponse +from ..types.prebuild_create_warm_pool_response import PrebuildCreateWarmPoolResponse +from ..types.prebuild_update_warm_pool_response import PrebuildUpdateWarmPoolResponse from ..types.prebuild_create_logs_token_response import PrebuildCreateLogsTokenResponse +from ..types.prebuild_retrieve_warm_pool_response import PrebuildRetrieveWarmPoolResponse __all__ = ["PrebuildsResource", "AsyncPrebuildsResource"] @@ -403,6 +412,303 @@ def create_logs_token( cast_to=PrebuildCreateLogsTokenResponse, ) + def create_warm_pool( + self, + *, + environment_class_id: str, + project_id: str, + desired_size: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateWarmPoolResponse: + """ + Creates a warm pool for a project and environment class. + + A warm pool maintains pre-created environment instances from a prebuild snapshot + so that new environments can start near-instantly. + + Only one warm pool is allowed per pair. The + environment class must have prebuilds enabled on the project. + + The pool's snapshot is managed automatically: when a new prebuild completes for + the same project and environment class, the pool's snapshot is updated and the + runner rotates instances. + + ### Examples + + - Create warm pool: + + Creates a warm pool with 2 instances for a project and environment class. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + desiredSize: 2 + ``` + + Args: + environment_class_id: environment_class_id specifies which environment class to warm. Must be listed + in the project's prebuild configuration environment_class_ids. + + project_id: project_id specifies the project this warm pool belongs to. The project must + have prebuilds enabled. + + desired_size: desired_size is the number of warm instances to maintain. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/CreateWarmPool", + body=maybe_transform( + { + "environment_class_id": environment_class_id, + "project_id": project_id, + "desired_size": desired_size, + }, + prebuild_create_warm_pool_params.PrebuildCreateWarmPoolParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateWarmPoolResponse, + ) + + def delete_warm_pool( + self, + *, + warm_pool_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a warm pool. + + Deletion is processed asynchronously. + + The pool is marked for deletion and the + runner drains instances in the background. + + Warm pools are also automatically deleted when prebuilds are disabled on the + project or the environment class is removed from the prebuild configuration. + + ### Examples + + - Delete warm pool: + + ```yaml + warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" + ``` + + Args: + warm_pool_id: warm_pool_id specifies the warm pool to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/DeleteWarmPool", + body=maybe_transform( + {"warm_pool_id": warm_pool_id}, prebuild_delete_warm_pool_params.PrebuildDeleteWarmPoolParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_warm_pools( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: prebuild_list_warm_pools_params.Filter | Omit = omit, + pagination: prebuild_list_warm_pools_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncWarmPoolsPage[WarmPool]: + """ + Lists warm pools with optional filtering. + + Use this method to: + + - View all warm pools for a project + - Monitor warm pool status across environment classes + + ### Examples + + - List warm pools for a project: + + ```yaml + filter: + projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + ``` + + Args: + filter: filter contains the filter options for listing warm pools + + pagination: pagination contains the pagination options for listing warm pools + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.PrebuildService/ListWarmPools", + page=SyncWarmPoolsPage[WarmPool], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + prebuild_list_warm_pools_params.PrebuildListWarmPoolsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + prebuild_list_warm_pools_params.PrebuildListWarmPoolsParams, + ), + ), + model=WarmPool, + method="post", + ) + + def retrieve_warm_pool( + self, + *, + warm_pool_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildRetrieveWarmPoolResponse: + """ + Gets details about a specific warm pool. + + Use this method to: + + - Check warm pool status and phase + - View the current snapshot being warmed + - Monitor pool health + + ### Examples + + - Get warm pool: + + ```yaml + warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" + ``` + + Args: + warm_pool_id: warm_pool_id specifies the warm pool to retrieve + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/GetWarmPool", + body=maybe_transform( + {"warm_pool_id": warm_pool_id}, prebuild_retrieve_warm_pool_params.PrebuildRetrieveWarmPoolParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildRetrieveWarmPoolResponse, + ) + + def update_warm_pool( + self, + *, + warm_pool_id: str, + desired_size: Optional[int] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildUpdateWarmPoolResponse: + """ + Updates a warm pool's configuration. + + Use this method to change the desired pool size. + + ### Examples + + - Update pool size: + + ```yaml + warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" + desiredSize: 5 + ``` + + Args: + warm_pool_id: warm_pool_id specifies the warm pool to update + + desired_size: desired_size updates the number of warm instances to maintain. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/UpdateWarmPool", + body=maybe_transform( + { + "warm_pool_id": warm_pool_id, + "desired_size": desired_size, + }, + prebuild_update_warm_pool_params.PrebuildUpdateWarmPoolParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildUpdateWarmPoolResponse, + ) + class AsyncPrebuildsResource(AsyncAPIResource): """ @@ -773,6 +1079,303 @@ async def create_logs_token( cast_to=PrebuildCreateLogsTokenResponse, ) + async def create_warm_pool( + self, + *, + environment_class_id: str, + project_id: str, + desired_size: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateWarmPoolResponse: + """ + Creates a warm pool for a project and environment class. + + A warm pool maintains pre-created environment instances from a prebuild snapshot + so that new environments can start near-instantly. + + Only one warm pool is allowed per pair. The + environment class must have prebuilds enabled on the project. + + The pool's snapshot is managed automatically: when a new prebuild completes for + the same project and environment class, the pool's snapshot is updated and the + runner rotates instances. + + ### Examples + + - Create warm pool: + + Creates a warm pool with 2 instances for a project and environment class. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + desiredSize: 2 + ``` + + Args: + environment_class_id: environment_class_id specifies which environment class to warm. Must be listed + in the project's prebuild configuration environment_class_ids. + + project_id: project_id specifies the project this warm pool belongs to. The project must + have prebuilds enabled. + + desired_size: desired_size is the number of warm instances to maintain. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/CreateWarmPool", + body=await async_maybe_transform( + { + "environment_class_id": environment_class_id, + "project_id": project_id, + "desired_size": desired_size, + }, + prebuild_create_warm_pool_params.PrebuildCreateWarmPoolParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateWarmPoolResponse, + ) + + async def delete_warm_pool( + self, + *, + warm_pool_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a warm pool. + + Deletion is processed asynchronously. + + The pool is marked for deletion and the + runner drains instances in the background. + + Warm pools are also automatically deleted when prebuilds are disabled on the + project or the environment class is removed from the prebuild configuration. + + ### Examples + + - Delete warm pool: + + ```yaml + warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" + ``` + + Args: + warm_pool_id: warm_pool_id specifies the warm pool to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/DeleteWarmPool", + body=await async_maybe_transform( + {"warm_pool_id": warm_pool_id}, prebuild_delete_warm_pool_params.PrebuildDeleteWarmPoolParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_warm_pools( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: prebuild_list_warm_pools_params.Filter | Omit = omit, + pagination: prebuild_list_warm_pools_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[WarmPool, AsyncWarmPoolsPage[WarmPool]]: + """ + Lists warm pools with optional filtering. + + Use this method to: + + - View all warm pools for a project + - Monitor warm pool status across environment classes + + ### Examples + + - List warm pools for a project: + + ```yaml + filter: + projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + ``` + + Args: + filter: filter contains the filter options for listing warm pools + + pagination: pagination contains the pagination options for listing warm pools + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.PrebuildService/ListWarmPools", + page=AsyncWarmPoolsPage[WarmPool], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + prebuild_list_warm_pools_params.PrebuildListWarmPoolsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + prebuild_list_warm_pools_params.PrebuildListWarmPoolsParams, + ), + ), + model=WarmPool, + method="post", + ) + + async def retrieve_warm_pool( + self, + *, + warm_pool_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildRetrieveWarmPoolResponse: + """ + Gets details about a specific warm pool. + + Use this method to: + + - Check warm pool status and phase + - View the current snapshot being warmed + - Monitor pool health + + ### Examples + + - Get warm pool: + + ```yaml + warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" + ``` + + Args: + warm_pool_id: warm_pool_id specifies the warm pool to retrieve + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/GetWarmPool", + body=await async_maybe_transform( + {"warm_pool_id": warm_pool_id}, prebuild_retrieve_warm_pool_params.PrebuildRetrieveWarmPoolParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildRetrieveWarmPoolResponse, + ) + + async def update_warm_pool( + self, + *, + warm_pool_id: str, + desired_size: Optional[int] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildUpdateWarmPoolResponse: + """ + Updates a warm pool's configuration. + + Use this method to change the desired pool size. + + ### Examples + + - Update pool size: + + ```yaml + warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" + desiredSize: 5 + ``` + + Args: + warm_pool_id: warm_pool_id specifies the warm pool to update + + desired_size: desired_size updates the number of warm instances to maintain. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/UpdateWarmPool", + body=await async_maybe_transform( + { + "warm_pool_id": warm_pool_id, + "desired_size": desired_size, + }, + prebuild_update_warm_pool_params.PrebuildUpdateWarmPoolParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildUpdateWarmPoolResponse, + ) + class PrebuildsResourceWithRawResponse: def __init__(self, prebuilds: PrebuildsResource) -> None: @@ -796,6 +1399,21 @@ def __init__(self, prebuilds: PrebuildsResource) -> None: self.create_logs_token = to_raw_response_wrapper( prebuilds.create_logs_token, ) + self.create_warm_pool = to_raw_response_wrapper( + prebuilds.create_warm_pool, + ) + self.delete_warm_pool = to_raw_response_wrapper( + prebuilds.delete_warm_pool, + ) + self.list_warm_pools = to_raw_response_wrapper( + prebuilds.list_warm_pools, + ) + self.retrieve_warm_pool = to_raw_response_wrapper( + prebuilds.retrieve_warm_pool, + ) + self.update_warm_pool = to_raw_response_wrapper( + prebuilds.update_warm_pool, + ) class AsyncPrebuildsResourceWithRawResponse: @@ -820,6 +1438,21 @@ def __init__(self, prebuilds: AsyncPrebuildsResource) -> None: self.create_logs_token = async_to_raw_response_wrapper( prebuilds.create_logs_token, ) + self.create_warm_pool = async_to_raw_response_wrapper( + prebuilds.create_warm_pool, + ) + self.delete_warm_pool = async_to_raw_response_wrapper( + prebuilds.delete_warm_pool, + ) + self.list_warm_pools = async_to_raw_response_wrapper( + prebuilds.list_warm_pools, + ) + self.retrieve_warm_pool = async_to_raw_response_wrapper( + prebuilds.retrieve_warm_pool, + ) + self.update_warm_pool = async_to_raw_response_wrapper( + prebuilds.update_warm_pool, + ) class PrebuildsResourceWithStreamingResponse: @@ -844,6 +1477,21 @@ def __init__(self, prebuilds: PrebuildsResource) -> None: self.create_logs_token = to_streamed_response_wrapper( prebuilds.create_logs_token, ) + self.create_warm_pool = to_streamed_response_wrapper( + prebuilds.create_warm_pool, + ) + self.delete_warm_pool = to_streamed_response_wrapper( + prebuilds.delete_warm_pool, + ) + self.list_warm_pools = to_streamed_response_wrapper( + prebuilds.list_warm_pools, + ) + self.retrieve_warm_pool = to_streamed_response_wrapper( + prebuilds.retrieve_warm_pool, + ) + self.update_warm_pool = to_streamed_response_wrapper( + prebuilds.update_warm_pool, + ) class AsyncPrebuildsResourceWithStreamingResponse: @@ -868,3 +1516,18 @@ def __init__(self, prebuilds: AsyncPrebuildsResource) -> None: self.create_logs_token = async_to_streamed_response_wrapper( prebuilds.create_logs_token, ) + self.create_warm_pool = async_to_streamed_response_wrapper( + prebuilds.create_warm_pool, + ) + self.delete_warm_pool = async_to_streamed_response_wrapper( + prebuilds.delete_warm_pool, + ) + self.list_warm_pools = async_to_streamed_response_wrapper( + prebuilds.list_warm_pools, + ) + self.retrieve_warm_pool = async_to_streamed_response_wrapper( + prebuilds.retrieve_warm_pool, + ) + self.update_warm_pool = async_to_streamed_response_wrapper( + prebuilds.update_warm_pool, + ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 04582be2..af3bb9f0 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -42,6 +42,7 @@ from .project import Project as Project from .prebuild import Prebuild as Prebuild from .log_level import LogLevel as LogLevel +from .warm_pool import WarmPool as WarmPool from .agent_mode import AgentMode as AgentMode from .sort_order import SortOrder as SortOrder from .sort_param import SortParam as SortParam @@ -64,18 +65,21 @@ from .login_provider import LoginProvider as LoginProvider from .prebuild_phase import PrebuildPhase as PrebuildPhase from .runner_variant import RunnerVariant as RunnerVariant +from .warm_pool_spec import WarmPoolSpec as WarmPoolSpec from .admission_level import AdmissionLevel as AdmissionLevel from .agent_execution import AgentExecution as AgentExecution from .bpf_debug_level import BpfDebugLevel as BpfDebugLevel from .prebuild_status import PrebuildStatus as PrebuildStatus from .prompt_metadata import PromptMetadata as PromptMetadata from .runner_provider import RunnerProvider as RunnerProvider +from .warm_pool_phase import WarmPoolPhase as WarmPoolPhase from .breadcrumb_param import BreadcrumbParam as BreadcrumbParam from .environment_role import EnvironmentRole as EnvironmentRole from .environment_spec import EnvironmentSpec as EnvironmentSpec from .id_token_version import IDTokenVersion as IDTokenVersion from .prebuild_trigger import PrebuildTrigger as PrebuildTrigger from .project_metadata import ProjectMetadata as ProjectMetadata +from .warm_pool_status import WarmPoolStatus as WarmPoolStatus from .environment_phase import EnvironmentPhase as EnvironmentPhase from .error_event_param import ErrorEventParam as ErrorEventParam from .event_list_params import EventListParams as EventListParams @@ -94,6 +98,7 @@ from .runner_list_params import RunnerListParams as RunnerListParams from .secret_list_params import SecretListParams as SecretListParams from .secret_scope_param import SecretScopeParam as SecretScopeParam +from .warm_pool_metadata import WarmPoolMetadata as WarmPoolMetadata from .event_list_response import EventListResponse as EventListResponse from .gateway_list_params import GatewayListParams as GatewayListParams from .group_create_params import GroupCreateParams as GroupCreateParams @@ -215,12 +220,16 @@ from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse from .project_prebuild_configuration import ProjectPrebuildConfiguration as ProjectPrebuildConfiguration from .agent_retrieve_execution_params import AgentRetrieveExecutionParams as AgentRetrieveExecutionParams +from .prebuild_list_warm_pools_params import PrebuildListWarmPoolsParams as PrebuildListWarmPoolsParams from .runner_create_logs_token_params import RunnerCreateLogsTokenParams as RunnerCreateLogsTokenParams from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams from .account_get_sso_login_url_params import AccountGetSSOLoginURLParams as AccountGetSSOLoginURLParams from .account_list_sso_logins_response import AccountListSSOLoginsResponse as AccountListSSOLoginsResponse from .identity_exchange_token_response import IdentityExchangeTokenResponse as IdentityExchangeTokenResponse from .organization_list_members_params import OrganizationListMembersParams as OrganizationListMembersParams +from .prebuild_create_warm_pool_params import PrebuildCreateWarmPoolParams as PrebuildCreateWarmPoolParams +from .prebuild_delete_warm_pool_params import PrebuildDeleteWarmPoolParams as PrebuildDeleteWarmPoolParams +from .prebuild_update_warm_pool_params import PrebuildUpdateWarmPoolParams as PrebuildUpdateWarmPoolParams from .agent_retrieve_execution_response import AgentRetrieveExecutionResponse as AgentRetrieveExecutionResponse from .environment_activity_signal_param import EnvironmentActivitySignalParam as EnvironmentActivitySignalParam from .prebuild_create_logs_token_params import PrebuildCreateLogsTokenParams as PrebuildCreateLogsTokenParams @@ -229,12 +238,16 @@ from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse from .runner_search_repositories_params import RunnerSearchRepositoriesParams as RunnerSearchRepositoriesParams from .account_get_sso_login_url_response import AccountGetSSOLoginURLResponse as AccountGetSSOLoginURLResponse +from .prebuild_create_warm_pool_response import PrebuildCreateWarmPoolResponse as PrebuildCreateWarmPoolResponse +from .prebuild_retrieve_warm_pool_params import PrebuildRetrieveWarmPoolParams as PrebuildRetrieveWarmPoolParams +from .prebuild_update_warm_pool_response import PrebuildUpdateWarmPoolResponse as PrebuildUpdateWarmPoolResponse from .user_get_authenticated_user_params import UserGetAuthenticatedUserParams as UserGetAuthenticatedUserParams from .account_list_login_providers_params import AccountListLoginProvidersParams as AccountListLoginProvidersParams from .prebuild_create_logs_token_response import PrebuildCreateLogsTokenResponse as PrebuildCreateLogsTokenResponse from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse from .runner_search_repositories_response import RunnerSearchRepositoriesResponse as RunnerSearchRepositoriesResponse from .environment_create_logs_token_params import EnvironmentCreateLogsTokenParams as EnvironmentCreateLogsTokenParams +from .prebuild_retrieve_warm_pool_response import PrebuildRetrieveWarmPoolResponse as PrebuildRetrieveWarmPoolResponse from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam as ProjectPrebuildConfigurationParam from .runner_list_scm_organizations_params import RunnerListScmOrganizationsParams as RunnerListScmOrganizationsParams from .user_get_authenticated_user_response import UserGetAuthenticatedUserResponse as UserGetAuthenticatedUserResponse diff --git a/src/gitpod/types/prebuild_create_warm_pool_params.py b/src/gitpod/types/prebuild_create_warm_pool_params.py new file mode 100644 index 00000000..051a9558 --- /dev/null +++ b/src/gitpod/types/prebuild_create_warm_pool_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildCreateWarmPoolParams"] + + +class PrebuildCreateWarmPoolParams(TypedDict, total=False): + environment_class_id: Required[Annotated[str, PropertyInfo(alias="environmentClassId")]] + """ + environment_class_id specifies which environment class to warm. Must be listed + in the project's prebuild configuration environment_class_ids. + """ + + project_id: Required[Annotated[str, PropertyInfo(alias="projectId")]] + """ + project_id specifies the project this warm pool belongs to. The project must + have prebuilds enabled. + """ + + desired_size: Annotated[int, PropertyInfo(alias="desiredSize")] + """desired_size is the number of warm instances to maintain.""" diff --git a/src/gitpod/types/prebuild_create_warm_pool_response.py b/src/gitpod/types/prebuild_create_warm_pool_response.py new file mode 100644 index 00000000..3bf2f447 --- /dev/null +++ b/src/gitpod/types/prebuild_create_warm_pool_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .warm_pool import WarmPool + +__all__ = ["PrebuildCreateWarmPoolResponse"] + + +class PrebuildCreateWarmPoolResponse(BaseModel): + warm_pool: WarmPool = FieldInfo(alias="warmPool") + """ + WarmPool maintains pre-created environment instances from a prebuild snapshot + for near-instant environment startup. One warm pool exists per pair. + """ diff --git a/src/gitpod/types/prebuild_delete_warm_pool_params.py b/src/gitpod/types/prebuild_delete_warm_pool_params.py new file mode 100644 index 00000000..5fab3a5b --- /dev/null +++ b/src/gitpod/types/prebuild_delete_warm_pool_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildDeleteWarmPoolParams"] + + +class PrebuildDeleteWarmPoolParams(TypedDict, total=False): + warm_pool_id: Required[Annotated[str, PropertyInfo(alias="warmPoolId")]] + """warm_pool_id specifies the warm pool to delete""" diff --git a/src/gitpod/types/prebuild_list_warm_pools_params.py b/src/gitpod/types/prebuild_list_warm_pools_params.py new file mode 100644 index 00000000..1c3b4ae6 --- /dev/null +++ b/src/gitpod/types/prebuild_list_warm_pools_params.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = ["PrebuildListWarmPoolsParams", "Filter", "Pagination"] + + +class PrebuildListWarmPoolsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + """filter contains the filter options for listing warm pools""" + + pagination: Pagination + """pagination contains the pagination options for listing warm pools""" + + +class Filter(TypedDict, total=False): + """filter contains the filter options for listing warm pools""" + + environment_class_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentClassIds")] + """environment_class_ids filters warm pools to specific environment classes""" + + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] + """project_ids filters warm pools to specific projects""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing warm pools""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/prebuild_retrieve_warm_pool_params.py b/src/gitpod/types/prebuild_retrieve_warm_pool_params.py new file mode 100644 index 00000000..f073b66a --- /dev/null +++ b/src/gitpod/types/prebuild_retrieve_warm_pool_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildRetrieveWarmPoolParams"] + + +class PrebuildRetrieveWarmPoolParams(TypedDict, total=False): + warm_pool_id: Required[Annotated[str, PropertyInfo(alias="warmPoolId")]] + """warm_pool_id specifies the warm pool to retrieve""" diff --git a/src/gitpod/types/prebuild_retrieve_warm_pool_response.py b/src/gitpod/types/prebuild_retrieve_warm_pool_response.py new file mode 100644 index 00000000..334c309e --- /dev/null +++ b/src/gitpod/types/prebuild_retrieve_warm_pool_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .warm_pool import WarmPool + +__all__ = ["PrebuildRetrieveWarmPoolResponse"] + + +class PrebuildRetrieveWarmPoolResponse(BaseModel): + warm_pool: WarmPool = FieldInfo(alias="warmPool") + """ + WarmPool maintains pre-created environment instances from a prebuild snapshot + for near-instant environment startup. One warm pool exists per pair. + """ diff --git a/src/gitpod/types/prebuild_update_warm_pool_params.py b/src/gitpod/types/prebuild_update_warm_pool_params.py new file mode 100644 index 00000000..a0137ce5 --- /dev/null +++ b/src/gitpod/types/prebuild_update_warm_pool_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildUpdateWarmPoolParams"] + + +class PrebuildUpdateWarmPoolParams(TypedDict, total=False): + warm_pool_id: Required[Annotated[str, PropertyInfo(alias="warmPoolId")]] + """warm_pool_id specifies the warm pool to update""" + + desired_size: Annotated[Optional[int], PropertyInfo(alias="desiredSize")] + """desired_size updates the number of warm instances to maintain.""" diff --git a/src/gitpod/types/prebuild_update_warm_pool_response.py b/src/gitpod/types/prebuild_update_warm_pool_response.py new file mode 100644 index 00000000..cfa24d08 --- /dev/null +++ b/src/gitpod/types/prebuild_update_warm_pool_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .warm_pool import WarmPool + +__all__ = ["PrebuildUpdateWarmPoolResponse"] + + +class PrebuildUpdateWarmPoolResponse(BaseModel): + warm_pool: WarmPool = FieldInfo(alias="warmPool") + """ + WarmPool maintains pre-created environment instances from a prebuild snapshot + for near-instant environment startup. One warm pool exists per pair. + """ diff --git a/src/gitpod/types/warm_pool.py b/src/gitpod/types/warm_pool.py new file mode 100644 index 00000000..3739d57e --- /dev/null +++ b/src/gitpod/types/warm_pool.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .warm_pool_spec import WarmPoolSpec +from .warm_pool_status import WarmPoolStatus +from .warm_pool_metadata import WarmPoolMetadata + +__all__ = ["WarmPool"] + + +class WarmPool(BaseModel): + """ + WarmPool maintains pre-created environment instances from a prebuild snapshot + for near-instant environment startup. + One warm pool exists per pair. + """ + + metadata: WarmPoolMetadata + """metadata contains organizational and ownership information""" + + spec: WarmPoolSpec + """spec contains the desired configuration for this warm pool""" + + status: WarmPoolStatus + """status contains the current status reported by the runner""" + + id: Optional[str] = None + """id is the unique identifier for the warm pool""" diff --git a/src/gitpod/types/warm_pool_metadata.py b/src/gitpod/types/warm_pool_metadata.py new file mode 100644 index 00000000..63e81be1 --- /dev/null +++ b/src/gitpod/types/warm_pool_metadata.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["WarmPoolMetadata"] + + +class WarmPoolMetadata(BaseModel): + """WarmPoolMetadata contains metadata about the warm pool""" + + created_at: datetime = FieldInfo(alias="createdAt") + """created_at is when the warm pool was created""" + + updated_at: datetime = FieldInfo(alias="updatedAt") + """updated_at is when the warm pool was last updated""" + + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """environment_class_id is the environment class whose instances are warmed""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that owns the warm pool""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """project_id is the ID of the project this warm pool belongs to""" + + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + """ + runner_id is the runner that manages this warm pool. Derived from the + environment class. + """ diff --git a/src/gitpod/types/warm_pool_phase.py b/src/gitpod/types/warm_pool_phase.py new file mode 100644 index 00000000..08fa3b48 --- /dev/null +++ b/src/gitpod/types/warm_pool_phase.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["WarmPoolPhase"] + +WarmPoolPhase: TypeAlias = Literal[ + "WARM_POOL_PHASE_UNSPECIFIED", + "WARM_POOL_PHASE_PENDING", + "WARM_POOL_PHASE_READY", + "WARM_POOL_PHASE_DEGRADED", + "WARM_POOL_PHASE_DELETING", + "WARM_POOL_PHASE_DELETED", +] diff --git a/src/gitpod/types/warm_pool_spec.py b/src/gitpod/types/warm_pool_spec.py new file mode 100644 index 00000000..e82ac84a --- /dev/null +++ b/src/gitpod/types/warm_pool_spec.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .warm_pool_phase import WarmPoolPhase + +__all__ = ["WarmPoolSpec"] + + +class WarmPoolSpec(BaseModel): + """WarmPoolSpec contains the desired configuration for a warm pool""" + + desired_phase: Optional[WarmPoolPhase] = FieldInfo(alias="desiredPhase", default=None) + """ + desired_phase is the intended lifecycle phase for this warm pool. Managed by the + API and reconciler. + """ + + desired_size: Optional[int] = FieldInfo(alias="desiredSize", default=None) + """desired_size is the number of warm instances to maintain.""" + + snapshot_id: Optional[str] = FieldInfo(alias="snapshotId", default=None) + """ + snapshot_id is the prebuild snapshot to warm up in the pool. Updated by the + reconciler when a new prebuild completes for this project and environment class. + Empty when no completed prebuild exists yet. + """ + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + """ + spec_version is incremented each time the spec is updated. Used for optimistic + concurrency control. + """ diff --git a/src/gitpod/types/warm_pool_status.py b/src/gitpod/types/warm_pool_status.py new file mode 100644 index 00000000..b7605272 --- /dev/null +++ b/src/gitpod/types/warm_pool_status.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .warm_pool_phase import WarmPoolPhase + +__all__ = ["WarmPoolStatus"] + + +class WarmPoolStatus(BaseModel): + """ + WarmPoolStatus contains the current status of a warm pool as reported by the runner + """ + + phase: WarmPoolPhase + """phase is the current phase of the warm pool lifecycle""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains details about why the warm pool is degraded or failed""" + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """ + status_version is incremented each time the status is updated. Used for + optimistic concurrency control. + """ diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py index 53eb090e..25fa12e7 100644 --- a/tests/api_resources/test_prebuilds.py +++ b/tests/api_resources/test_prebuilds.py @@ -11,12 +11,16 @@ from tests.utils import assert_matches_type from gitpod.types import ( Prebuild, + WarmPool, PrebuildCancelResponse, PrebuildCreateResponse, PrebuildRetrieveResponse, + PrebuildCreateWarmPoolResponse, + PrebuildUpdateWarmPoolResponse, PrebuildCreateLogsTokenResponse, + PrebuildRetrieveWarmPoolResponse, ) -from gitpod.pagination import SyncPrebuildsPage, AsyncPrebuildsPage +from gitpod.pagination import SyncPrebuildsPage, SyncWarmPoolsPage, AsyncPrebuildsPage, AsyncWarmPoolsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -259,6 +263,209 @@ def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_warm_pool(self, client: Gitpod) -> None: + prebuild = client.prebuilds.create_warm_pool( + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_warm_pool_with_all_params(self, client: Gitpod) -> None: + prebuild = client.prebuilds.create_warm_pool( + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + desired_size=2, + ) + assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_create_warm_pool(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.create_warm_pool( + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_create_warm_pool(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.create_warm_pool( + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_delete_warm_pool(self, client: Gitpod) -> None: + prebuild = client.prebuilds.delete_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_delete_warm_pool(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.delete_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_delete_warm_pool(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.delete_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_warm_pools(self, client: Gitpod) -> None: + prebuild = client.prebuilds.list_warm_pools() + assert_matches_type(SyncWarmPoolsPage[WarmPool], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_warm_pools_with_all_params(self, client: Gitpod) -> None: + prebuild = client.prebuilds.list_warm_pools( + token="token", + page_size=0, + filter={ + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "project_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncWarmPoolsPage[WarmPool], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_list_warm_pools(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.list_warm_pools() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(SyncWarmPoolsPage[WarmPool], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_list_warm_pools(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.list_warm_pools() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(SyncWarmPoolsPage[WarmPool], prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_warm_pool(self, client: Gitpod) -> None: + prebuild = client.prebuilds.retrieve_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + assert_matches_type(PrebuildRetrieveWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_retrieve_warm_pool(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.retrieve_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildRetrieveWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_retrieve_warm_pool(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.retrieve_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildRetrieveWarmPoolResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_update_warm_pool(self, client: Gitpod) -> None: + prebuild = client.prebuilds.update_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_update_warm_pool_with_all_params(self, client: Gitpod) -> None: + prebuild = client.prebuilds.update_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + desired_size=5, + ) + assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_update_warm_pool(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.update_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_update_warm_pool(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.update_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncPrebuilds: parametrize = pytest.mark.parametrize( @@ -499,3 +706,206 @@ async def test_streaming_response_create_logs_token(self, async_client: AsyncGit assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_warm_pool(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.create_warm_pool( + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_warm_pool_with_all_params(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.create_warm_pool( + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + desired_size=2, + ) + assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_create_warm_pool(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.create_warm_pool( + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_create_warm_pool(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.create_warm_pool( + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_delete_warm_pool(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.delete_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_delete_warm_pool(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.delete_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_delete_warm_pool(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.delete_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_warm_pools(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.list_warm_pools() + assert_matches_type(AsyncWarmPoolsPage[WarmPool], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_warm_pools_with_all_params(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.list_warm_pools( + token="token", + page_size=0, + filter={ + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "project_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncWarmPoolsPage[WarmPool], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_list_warm_pools(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.list_warm_pools() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(AsyncWarmPoolsPage[WarmPool], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_list_warm_pools(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.list_warm_pools() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(AsyncWarmPoolsPage[WarmPool], prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_warm_pool(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.retrieve_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + assert_matches_type(PrebuildRetrieveWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_retrieve_warm_pool(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.retrieve_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildRetrieveWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_retrieve_warm_pool(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.retrieve_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildRetrieveWarmPoolResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_update_warm_pool(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.update_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_update_warm_pool_with_all_params(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.update_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + desired_size=5, + ) + assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_update_warm_pool(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.update_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_update_warm_pool(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.update_warm_pool( + warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True From c77c8dd0a91d04c120d3f7d3a300247acf39550b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:02:09 +0000 Subject: [PATCH 399/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3b477db3..905ff5c1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-aff091b0b0cbc5539f259dec6aa0f89853d79ad407b3252f769a6f90422dd0df.yml -openapi_spec_hash: a6873fd8f07ec0b9ecdc85d187ac4129 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-16b360cee45543059c71209bed8235e5e1a37b61fbeb513a63ee7e67b577e165.yml +openapi_spec_hash: f22e39876f664dced8af26d4bd51f20c config_hash: 0ec0dc7b6891f666565cf1521a8d172f From 060c7d63c86e9b5094fcd3318b1e3ea7a6bfa108 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 21:44:30 +0000 Subject: [PATCH 400/505] feat(api): add agent_message parameter to agents.send_to_execution --- .stats.yml | 6 ++--- api.md | 2 ++ src/gitpod/resources/agents.py | 11 ++++++++++ src/gitpod/types/__init__.py | 2 ++ src/gitpod/types/agent_message_param.py | 22 +++++++++++++++++++ .../types/agent_send_to_execution_params.py | 7 ++++++ src/gitpod/types/type.py | 7 ++++++ tests/api_resources/test_agents.py | 8 +++++++ 8 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/agent_message_param.py create mode 100644 src/gitpod/types/type.py diff --git a/.stats.yml b/.stats.yml index 905ff5c1..98368fd9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-16b360cee45543059c71209bed8235e5e1a37b61fbeb513a63ee7e67b577e165.yml -openapi_spec_hash: f22e39876f664dced8af26d4bd51f20c -config_hash: 0ec0dc7b6891f666565cf1521a8d172f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b4ac05534b28936c4fe9d86221fb30415a39826e6a5414b5a7ffb2ad87a021ed.yml +openapi_spec_hash: c5ae4a889864c5255ce9aa0a1fe98631 +config_hash: 9629844f3bf40631adbcfe7c739494a1 diff --git a/api.md b/api.md index c027c7af..1ce56ebb 100644 --- a/api.md +++ b/api.md @@ -65,10 +65,12 @@ Types: from gitpod.types import ( AgentCodeContext, AgentExecution, + AgentMessage, AgentMode, Prompt, PromptMetadata, PromptSpec, + Type, UserInputBlock, AgentCreateExecutionConversationTokenResponse, AgentCreatePromptResponse, diff --git a/src/gitpod/resources/agents.py b/src/gitpod/resources/agents.py index 82dc942a..9faf572f 100644 --- a/src/gitpod/resources/agents.py +++ b/src/gitpod/resources/agents.py @@ -36,6 +36,7 @@ from ..types.prompt import Prompt from ..types.agent_mode import AgentMode from ..types.agent_execution import AgentExecution +from ..types.agent_message_param import AgentMessageParam from ..types.user_input_block_param import UserInputBlockParam from ..types.agent_code_context_param import AgentCodeContextParam from ..types.agent_create_prompt_response import AgentCreatePromptResponse @@ -483,6 +484,7 @@ def send_to_execution( self, *, agent_execution_id: str | Omit = omit, + agent_message: AgentMessageParam | Omit = omit, user_input: UserInputBlockParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -510,6 +512,9 @@ def send_to_execution( ``` Args: + agent_message: AgentMessage is a message sent between agents (e.g. from a parent agent to a + child agent execution, or vice versa). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -523,6 +528,7 @@ def send_to_execution( body=maybe_transform( { "agent_execution_id": agent_execution_id, + "agent_message": agent_message, "user_input": user_input, }, agent_send_to_execution_params.AgentSendToExecutionParams, @@ -1154,6 +1160,7 @@ async def send_to_execution( self, *, agent_execution_id: str | Omit = omit, + agent_message: AgentMessageParam | Omit = omit, user_input: UserInputBlockParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1181,6 +1188,9 @@ async def send_to_execution( ``` Args: + agent_message: AgentMessage is a message sent between agents (e.g. from a parent agent to a + child agent execution, or vice versa). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1194,6 +1204,7 @@ async def send_to_execution( body=await async_maybe_transform( { "agent_execution_id": agent_execution_id, + "agent_message": agent_message, "user_input": user_input, }, agent_send_to_execution_params.AgentSendToExecutionParams, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index af3bb9f0..018e9dec 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .type import Type as Type from .user import User as User from .veto import Veto as Veto from .group import Group as Group @@ -99,6 +100,7 @@ from .secret_list_params import SecretListParams as SecretListParams from .secret_scope_param import SecretScopeParam as SecretScopeParam from .warm_pool_metadata import WarmPoolMetadata as WarmPoolMetadata +from .agent_message_param import AgentMessageParam as AgentMessageParam from .event_list_response import EventListResponse as EventListResponse from .gateway_list_params import GatewayListParams as GatewayListParams from .group_create_params import GroupCreateParams as GroupCreateParams diff --git a/src/gitpod/types/agent_message_param.py b/src/gitpod/types/agent_message_param.py new file mode 100644 index 00000000..634fd16d --- /dev/null +++ b/src/gitpod/types/agent_message_param.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .type import Type + +__all__ = ["AgentMessageParam"] + + +class AgentMessageParam(TypedDict, total=False): + """AgentMessage is a message sent between agents (e.g. + + from a parent agent to a + child agent execution, or vice versa). + """ + + payload: str + """Free-form payload of the message.""" + + type: Type diff --git a/src/gitpod/types/agent_send_to_execution_params.py b/src/gitpod/types/agent_send_to_execution_params.py index 27c14294..8b5e4688 100644 --- a/src/gitpod/types/agent_send_to_execution_params.py +++ b/src/gitpod/types/agent_send_to_execution_params.py @@ -5,6 +5,7 @@ from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .agent_message_param import AgentMessageParam from .user_input_block_param import UserInputBlockParam __all__ = ["AgentSendToExecutionParams"] @@ -13,4 +14,10 @@ class AgentSendToExecutionParams(TypedDict, total=False): agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] + agent_message: Annotated[AgentMessageParam, PropertyInfo(alias="agentMessage")] + """AgentMessage is a message sent between agents (e.g. + + from a parent agent to a child agent execution, or vice versa). + """ + user_input: Annotated[UserInputBlockParam, PropertyInfo(alias="userInput")] diff --git a/src/gitpod/types/type.py b/src/gitpod/types/type.py new file mode 100644 index 00000000..585a3d8f --- /dev/null +++ b/src/gitpod/types/type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["Type"] + +Type: TypeAlias = Literal["TYPE_UNSPECIFIED", "TYPE_UPDATE", "TYPE_COMPLETE"] diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index f667a9d5..4012cd16 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -360,6 +360,10 @@ def test_method_send_to_execution(self, client: Gitpod) -> None: def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: agent = client.agents.send_to_execution( agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + agent_message={ + "payload": "payload", + "type": "TYPE_UNSPECIFIED", + }, user_input={ "id": "id", "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -890,6 +894,10 @@ async def test_method_send_to_execution(self, async_client: AsyncGitpod) -> None async def test_method_send_to_execution_with_all_params(self, async_client: AsyncGitpod) -> None: agent = await async_client.agents.send_to_execution( agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + agent_message={ + "payload": "payload", + "type": "TYPE_UNSPECIFIED", + }, user_input={ "id": "id", "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), From 3103500a8d2767563b6b10551f235944de32c25d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 09:28:20 +0000 Subject: [PATCH 401/505] feat(api): add role and sender_execution_id fields to agent messages --- .stats.yml | 6 +++--- api.md | 1 + src/gitpod/types/__init__.py | 1 + src/gitpod/types/role.py | 7 +++++++ 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/role.py diff --git a/.stats.yml b/.stats.yml index 98368fd9..cda8d968 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b4ac05534b28936c4fe9d86221fb30415a39826e6a5414b5a7ffb2ad87a021ed.yml -openapi_spec_hash: c5ae4a889864c5255ce9aa0a1fe98631 -config_hash: 9629844f3bf40631adbcfe7c739494a1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1a471dfdbf74746a2b480058a4f12e7664da70d99fcf8e14789872d8358533b7.yml +openapi_spec_hash: 5f57f657ea599ad8d1be3388f45cd77a +config_hash: 76ed1b5c38c855d3383b38deafebd1ae diff --git a/api.md b/api.md index 1ce56ebb..3eec5ed7 100644 --- a/api.md +++ b/api.md @@ -70,6 +70,7 @@ from gitpod.types import ( Prompt, PromptMetadata, PromptSpec, + Role, Type, UserInputBlock, AgentCreateExecutionConversationTokenResponse, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 018e9dec..f3adf070 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .role import Role as Role from .type import Type as Type from .user import User as User from .veto import Veto as Veto diff --git a/src/gitpod/types/role.py b/src/gitpod/types/role.py new file mode 100644 index 00000000..89dd1b9b --- /dev/null +++ b/src/gitpod/types/role.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["Role"] + +Role: TypeAlias = Literal["ROLE_UNSPECIFIED", "ROLE_PARENT", "ROLE_CHILD"] From fb69d525f27cf451d71b026f004ea3fe053861d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 09:58:39 +0000 Subject: [PATCH 402/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cda8d968..1efbe107 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1a471dfdbf74746a2b480058a4f12e7664da70d99fcf8e14789872d8358533b7.yml -openapi_spec_hash: 5f57f657ea599ad8d1be3388f45cd77a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0650bfaee782ffa1f62c3a21bbb03a4140c491dc67f5c17cc4c5d62dfa5fe36c.yml +openapi_spec_hash: 43e034dfea6543c57259c7562bbaff2c config_hash: 76ed1b5c38c855d3383b38deafebd1ae From cf8790f92dc90534dfd90f1f27b507a8d483ec3e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 11:09:53 +0000 Subject: [PATCH 403/505] feat(api): add SESSION_ADMIN and SESSION_USER roles to ResourceRole --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_role.py | 5 ++--- src/gitpod/types/shared_params/resource_role.py | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1efbe107..a0788752 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0650bfaee782ffa1f62c3a21bbb03a4140c491dc67f5c17cc4c5d62dfa5fe36c.yml -openapi_spec_hash: 43e034dfea6543c57259c7562bbaff2c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c8cb681c5b3ecde846adb3de81f1d8cb8da3df62deb86d36f2387e94bcfbafc8.yml +openapi_spec_hash: 5b90c50927ddb8208f709bac310525ca config_hash: 76ed1b5c38c855d3383b38deafebd1ae diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 23ecaf8b..b2989eaf 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -61,7 +61,6 @@ "RESOURCE_ROLE_WARMPOOL_RUNNER", "RESOURCE_ROLE_WARMPOOL_ADMIN", "RESOURCE_ROLE_WARMPOOL_VIEWER", - "RESOURCE_ROLE_SESSION_EDITOR", - "RESOURCE_ROLE_SESSION_CONTRIBUTOR", - "RESOURCE_ROLE_SESSION_VIEWER", + "RESOURCE_ROLE_SESSION_ADMIN", + "RESOURCE_ROLE_SESSION_USER", ] diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index 315234d2..6bfa9bb2 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -63,7 +63,6 @@ "RESOURCE_ROLE_WARMPOOL_RUNNER", "RESOURCE_ROLE_WARMPOOL_ADMIN", "RESOURCE_ROLE_WARMPOOL_VIEWER", - "RESOURCE_ROLE_SESSION_EDITOR", - "RESOURCE_ROLE_SESSION_CONTRIBUTOR", - "RESOURCE_ROLE_SESSION_VIEWER", + "RESOURCE_ROLE_SESSION_ADMIN", + "RESOURCE_ROLE_SESSION_USER", ] From 08692522d31693eea1fad333b7f5e46d0df8d372 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 12:24:53 +0000 Subject: [PATCH 404/505] feat(api): add team admin and viewer roles to ResourceRole --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_role.py | 2 ++ src/gitpod/types/shared_params/resource_role.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a0788752..acc42d4f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c8cb681c5b3ecde846adb3de81f1d8cb8da3df62deb86d36f2387e94bcfbafc8.yml -openapi_spec_hash: 5b90c50927ddb8208f709bac310525ca +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7d56837db309145bd797a9791b7265781e34675b23dfd69d817f2be45f9b1062.yml +openapi_spec_hash: eb329205d76135f39cbe56d7b696dba3 config_hash: 76ed1b5c38c855d3383b38deafebd1ae diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index b2989eaf..e9c753f3 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -63,4 +63,6 @@ "RESOURCE_ROLE_WARMPOOL_VIEWER", "RESOURCE_ROLE_SESSION_ADMIN", "RESOURCE_ROLE_SESSION_USER", + "RESOURCE_ROLE_TEAM_ADMIN", + "RESOURCE_ROLE_TEAM_VIEWER", ] diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index 6bfa9bb2..c040a312 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -65,4 +65,6 @@ "RESOURCE_ROLE_WARMPOOL_VIEWER", "RESOURCE_ROLE_SESSION_ADMIN", "RESOURCE_ROLE_SESSION_USER", + "RESOURCE_ROLE_TEAM_ADMIN", + "RESOURCE_ROLE_TEAM_VIEWER", ] From 14688ccc2fb8434de35ce59d8cb05ab3a3b34f7d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 12:25:22 +0000 Subject: [PATCH 405/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index acc42d4f..ae80f751 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7d56837db309145bd797a9791b7265781e34675b23dfd69d817f2be45f9b1062.yml -openapi_spec_hash: eb329205d76135f39cbe56d7b696dba3 -config_hash: 76ed1b5c38c855d3383b38deafebd1ae +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-05be77a7f138b6ef57d6909c4af271dd93b7fdc674695f9e81f3e2ee294669cb.yml +openapi_spec_hash: a6174539bc384915695903fdb769c142 +config_hash: f88ff6eb8112c66c79c9334f913febb9 From a8e29736de26a99af9d886926697da53593c9635 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 12:59:49 +0000 Subject: [PATCH 406/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ae80f751..a2d96ab9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-05be77a7f138b6ef57d6909c4af271dd93b7fdc674695f9e81f3e2ee294669cb.yml -openapi_spec_hash: a6174539bc384915695903fdb769c142 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5f52425c0fa3c3733433bca0afdf98c8e10257cfa5e9f5ac6a50bd7c20c7798b.yml +openapi_spec_hash: 28a77c5c0c7e6cef812451470dc5fc0c config_hash: f88ff6eb8112c66c79c9334f913febb9 From aabfdb201ba0a7234e8c4b9d655952492211800b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 13:19:46 +0000 Subject: [PATCH 407/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index a2d96ab9..9738131b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5f52425c0fa3c3733433bca0afdf98c8e10257cfa5e9f5ac6a50bd7c20c7798b.yml -openapi_spec_hash: 28a77c5c0c7e6cef812451470dc5fc0c -config_hash: f88ff6eb8112c66c79c9334f913febb9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3d02f9ba6ab517e6356f85a73b30072e545ffa92911f08375869870232328d8d.yml +openapi_spec_hash: a6dcafe05fa8bfc45f25b23856deb6fc +config_hash: 1f86360120835c81a6cb4b7d7facdd69 From 151eb56361d2ea84cc137eca8ed07fa678cd1d11 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:13:54 +0000 Subject: [PATCH 408/505] feat(api): add wake_event parameter to agents send_to_execution method --- .stats.yml | 6 ++-- api.md | 1 + src/gitpod/resources/agents.py | 11 ++++++++ src/gitpod/types/__init__.py | 1 + .../types/agent_send_to_execution_params.py | 7 +++++ src/gitpod/types/wake_event_param.py | 28 +++++++++++++++++++ tests/api_resources/test_agents.py | 8 ++++++ 7 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/wake_event_param.py diff --git a/.stats.yml b/.stats.yml index 9738131b..b899831b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3d02f9ba6ab517e6356f85a73b30072e545ffa92911f08375869870232328d8d.yml -openapi_spec_hash: a6dcafe05fa8bfc45f25b23856deb6fc -config_hash: 1f86360120835c81a6cb4b7d7facdd69 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-9eb1ec1f32d76b1ad4ed5e3e5faa5bfecec587601e45f6faa1a0d0c98de640c2.yml +openapi_spec_hash: 2b5f6a01ee669442fa45083ceac387b5 +config_hash: 97dc0a3753a72cd447196f070d8290e0 diff --git a/api.md b/api.md index 3eec5ed7..6310546f 100644 --- a/api.md +++ b/api.md @@ -73,6 +73,7 @@ from gitpod.types import ( Role, Type, UserInputBlock, + WakeEvent, AgentCreateExecutionConversationTokenResponse, AgentCreatePromptResponse, AgentRetrieveExecutionResponse, diff --git a/src/gitpod/resources/agents.py b/src/gitpod/resources/agents.py index 9faf572f..4cabe2e8 100644 --- a/src/gitpod/resources/agents.py +++ b/src/gitpod/resources/agents.py @@ -36,6 +36,7 @@ from ..types.prompt import Prompt from ..types.agent_mode import AgentMode from ..types.agent_execution import AgentExecution +from ..types.wake_event_param import WakeEventParam from ..types.agent_message_param import AgentMessageParam from ..types.user_input_block_param import UserInputBlockParam from ..types.agent_code_context_param import AgentCodeContextParam @@ -486,6 +487,7 @@ def send_to_execution( agent_execution_id: str | Omit = omit, agent_message: AgentMessageParam | Omit = omit, user_input: UserInputBlockParam | Omit = omit, + wake_event: WakeEventParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -515,6 +517,9 @@ def send_to_execution( agent_message: AgentMessage is a message sent between agents (e.g. from a parent agent to a child agent execution, or vice versa). + wake_event: WakeEvent is sent by the backend to wake an agent when a registered interest + fires. Delivered via SendToAgentExecution as a new oneof variant. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -530,6 +535,7 @@ def send_to_execution( "agent_execution_id": agent_execution_id, "agent_message": agent_message, "user_input": user_input, + "wake_event": wake_event, }, agent_send_to_execution_params.AgentSendToExecutionParams, ), @@ -1162,6 +1168,7 @@ async def send_to_execution( agent_execution_id: str | Omit = omit, agent_message: AgentMessageParam | Omit = omit, user_input: UserInputBlockParam | Omit = omit, + wake_event: WakeEventParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1191,6 +1198,9 @@ async def send_to_execution( agent_message: AgentMessage is a message sent between agents (e.g. from a parent agent to a child agent execution, or vice versa). + wake_event: WakeEvent is sent by the backend to wake an agent when a registered interest + fires. Delivered via SendToAgentExecution as a new oneof variant. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1206,6 +1216,7 @@ async def send_to_execution( "agent_execution_id": agent_execution_id, "agent_message": agent_message, "user_input": user_input, + "wake_event": wake_event, }, agent_send_to_execution_params.AgentSendToExecutionParams, ), diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index f3adf070..d68e94f2 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -81,6 +81,7 @@ from .id_token_version import IDTokenVersion as IDTokenVersion from .prebuild_trigger import PrebuildTrigger as PrebuildTrigger from .project_metadata import ProjectMetadata as ProjectMetadata +from .wake_event_param import WakeEventParam as WakeEventParam from .warm_pool_status import WarmPoolStatus as WarmPoolStatus from .environment_phase import EnvironmentPhase as EnvironmentPhase from .error_event_param import ErrorEventParam as ErrorEventParam diff --git a/src/gitpod/types/agent_send_to_execution_params.py b/src/gitpod/types/agent_send_to_execution_params.py index 8b5e4688..2ad05f82 100644 --- a/src/gitpod/types/agent_send_to_execution_params.py +++ b/src/gitpod/types/agent_send_to_execution_params.py @@ -5,6 +5,7 @@ from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo +from .wake_event_param import WakeEventParam from .agent_message_param import AgentMessageParam from .user_input_block_param import UserInputBlockParam @@ -21,3 +22,9 @@ class AgentSendToExecutionParams(TypedDict, total=False): """ user_input: Annotated[UserInputBlockParam, PropertyInfo(alias="userInput")] + + wake_event: Annotated[WakeEventParam, PropertyInfo(alias="wakeEvent")] + """ + WakeEvent is sent by the backend to wake an agent when a registered interest + fires. Delivered via SendToAgentExecution as a new oneof variant. + """ diff --git a/src/gitpod/types/wake_event_param.py b/src/gitpod/types/wake_event_param.py new file mode 100644 index 00000000..eae916dc --- /dev/null +++ b/src/gitpod/types/wake_event_param.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["WakeEventParam", "Timer"] + + +class Timer(TypedDict, total=False): + fired_at: Annotated[Union[str, datetime], PropertyInfo(alias="firedAt", format="iso8601")] + """The actual time the timer was evaluated as expired.""" + + +class WakeEventParam(TypedDict, total=False): + """ + WakeEvent is sent by the backend to wake an agent when a registered interest fires. + Delivered via SendToAgentExecution as a new oneof variant. + """ + + timer: Required[Timer] + + interest_id: Annotated[str, PropertyInfo(alias="interestId")] + """The interest ID that fired (from WaitingInfo.Interest.id).""" diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 4012cd16..857f285b 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -382,6 +382,10 @@ def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: ], "text": {"content": "Generate a report based on the latest logs."}, }, + wake_event={ + "timer": {"fired_at": parse_datetime("2019-12-27T18:11:19.117Z")}, + "interest_id": "interestId", + }, ) assert_matches_type(object, agent, path=["response"]) @@ -916,6 +920,10 @@ async def test_method_send_to_execution_with_all_params(self, async_client: Asyn ], "text": {"content": "Generate a report based on the latest logs."}, }, + wake_event={ + "timer": {"fired_at": parse_datetime("2019-12-27T18:11:19.117Z")}, + "interest_id": "interestId", + }, ) assert_matches_type(object, agent, path=["response"]) From 7085065c1e206c36352995105ac728acc193b2a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 19:03:26 +0000 Subject: [PATCH 409/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index b899831b..275ffb8f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-9eb1ec1f32d76b1ad4ed5e3e5faa5bfecec587601e45f6faa1a0d0c98de640c2.yml -openapi_spec_hash: 2b5f6a01ee669442fa45083ceac387b5 -config_hash: 97dc0a3753a72cd447196f070d8290e0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d7bf8afe7b633495502b90459fd5fdaff25218ee53dd710a18538a76de27b8ce.yml +openapi_spec_hash: cc6b8e51f317fac144bfe317bf4da2e1 +config_hash: 2e93c96d706d08428b9592538b4f1eab From 046c1f8f457671c56439e579b9ea2676fca67127 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 20:29:39 +0000 Subject: [PATCH 410/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 275ffb8f..1b95580d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d7bf8afe7b633495502b90459fd5fdaff25218ee53dd710a18538a76de27b8ce.yml -openapi_spec_hash: cc6b8e51f317fac144bfe317bf4da2e1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-431bad5bd6d42f0ee4b93f1dde8d42427d42f635d5f0cada1f3149c6ac2986bb.yml +openapi_spec_hash: 6c0aca7d69758f8ef1a0e17332b58fe3 config_hash: 2e93c96d706d08428b9592538b4f1eab From 1ac674ec4ac0774ac50b72c18f4a18c2e25350b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 21:32:32 +0000 Subject: [PATCH 411/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1b95580d..f8342b9a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-431bad5bd6d42f0ee4b93f1dde8d42427d42f635d5f0cada1f3149c6ac2986bb.yml -openapi_spec_hash: 6c0aca7d69758f8ef1a0e17332b58fe3 -config_hash: 2e93c96d706d08428b9592538b4f1eab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b3269f9875cf972863968afb41f52d54c7e46924db8aca0cccd751ddf3e891ec.yml +openapi_spec_hash: c0066f77e1ba7d84905950e79be7aaaa +config_hash: 592f78583488172fd4df0edfa2760ec6 From a75d02a74bfc682c73ce7b53e2bfc2888830706c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 08:04:02 +0000 Subject: [PATCH 412/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f8342b9a..bc68f9ab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b3269f9875cf972863968afb41f52d54c7e46924db8aca0cccd751ddf3e891ec.yml -openapi_spec_hash: c0066f77e1ba7d84905950e79be7aaaa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f5ed839be9328e77698c9c7def7ca2143df1b94d0e3473c5790a28d4ce9e1f74.yml +openapi_spec_hash: a2e22139f1087c1e41a93187829836b4 config_hash: 592f78583488172fd4df0edfa2760ec6 From e337037dd1cac2bc6e1023b68a5c858fd06e9766 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:29:55 +0000 Subject: [PATCH 413/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index bc68f9ab..0c09951a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f5ed839be9328e77698c9c7def7ca2143df1b94d0e3473c5790a28d4ce9e1f74.yml -openapi_spec_hash: a2e22139f1087c1e41a93187829836b4 -config_hash: 592f78583488172fd4df0edfa2760ec6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-66a6056c94410bdb8b9c011724920ac13c05ec3fc4042a76e3572a3f2a157288.yml +openapi_spec_hash: c492fce4aea5a7624b01140a8fa532fb +config_hash: 1bbe12db32bc3ff1b6b94903b036b4a5 From fe37dcfd7f3dae283d32472bd30985e4b63e015d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:58:13 +0000 Subject: [PATCH 414/505] feat(api): add SUPPORTED_MODEL_HAIKU_4_5 to agent_execution Status enum --- .stats.yml | 4 ++-- src/gitpod/types/agent_execution.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0c09951a..4937cef3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-66a6056c94410bdb8b9c011724920ac13c05ec3fc4042a76e3572a3f2a157288.yml -openapi_spec_hash: c492fce4aea5a7624b01140a8fa532fb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-893b4021bf45a83abcd0e6153ca6395b4fc38aef4f36da4e3d3905fbec3098b0.yml +openapi_spec_hash: 457a0d443824f072e22b68b1f166c29d config_hash: 1bbe12db32bc3ff1b6b94903b036b4a5 diff --git a/src/gitpod/types/agent_execution.py b/src/gitpod/types/agent_execution.py index dafe3745..f3e92d83 100644 --- a/src/gitpod/types/agent_execution.py +++ b/src/gitpod/types/agent_execution.py @@ -444,6 +444,7 @@ class Status(BaseModel): "SUPPORTED_MODEL_OPUS_4_5_EXTENDED", "SUPPORTED_MODEL_OPUS_4_6", "SUPPORTED_MODEL_OPUS_4_6_EXTENDED", + "SUPPORTED_MODEL_HAIKU_4_5", "SUPPORTED_MODEL_OPENAI_4O", "SUPPORTED_MODEL_OPENAI_4O_MINI", "SUPPORTED_MODEL_OPENAI_O1", From 6f28477720cff5f81d6184ccb033ea328bb93be5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 19:09:48 +0000 Subject: [PATCH 415/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4937cef3..7d3c95d8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-893b4021bf45a83abcd0e6153ca6395b4fc38aef4f36da4e3d3905fbec3098b0.yml -openapi_spec_hash: 457a0d443824f072e22b68b1f166c29d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-db66cce570b248bad197303f13085f4cc791f0f37accd05551a211f639a504f4.yml +openapi_spec_hash: 4f42e6d0feb767646ed2a1de3d1649d2 config_hash: 1bbe12db32bc3ff1b6b94903b036b4a5 From 3e9298f51311406db14ade593e4990ff5280b736 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 20:22:41 +0000 Subject: [PATCH 416/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7d3c95d8..7a1b0600 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-db66cce570b248bad197303f13085f4cc791f0f37accd05551a211f639a504f4.yml -openapi_spec_hash: 4f42e6d0feb767646ed2a1de3d1649d2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b27803ede69b49b599171b12f4962cf7cc7f6fbab2a5a166e5c6080484cfc067.yml +openapi_spec_hash: 80a087f89a1d2c959b0ac8c6c548291f config_hash: 1bbe12db32bc3ff1b6b94903b036b4a5 From 2a3d9220040c345bdd7169f643605f626515ddf5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 21:30:01 +0000 Subject: [PATCH 417/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7a1b0600..6b0ef442 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b27803ede69b49b599171b12f4962cf7cc7f6fbab2a5a166e5c6080484cfc067.yml -openapi_spec_hash: 80a087f89a1d2c959b0ac8c6c548291f -config_hash: 1bbe12db32bc3ff1b6b94903b036b4a5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-577296b7c6ed6bed2b21637338a4f13e354052ba6d904c65a99e5d13512f53fa.yml +openapi_spec_hash: 5fe9809e8ea47cccb6caf16295ee30bf +config_hash: 4f180c7b682d53be6dff8a05a3ac16d4 From 8f53b3a1192f1fd95e2733a576fb25b612290be7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 09:03:23 +0000 Subject: [PATCH 418/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6b0ef442..33e7dd90 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-577296b7c6ed6bed2b21637338a4f13e354052ba6d904c65a99e5d13512f53fa.yml -openapi_spec_hash: 5fe9809e8ea47cccb6caf16295ee30bf -config_hash: 4f180c7b682d53be6dff8a05a3ac16d4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-02ad1975aaf8e2fe22f10f1cb7f691d4b00f440c0b481aedab196e1eedab68cc.yml +openapi_spec_hash: 83b08f17aedbc539a5e3db6b9f282053 +config_hash: 8531cb42193029df25a045bf85d9778e From 18a4386fd82b5ddc1369e0fe33f0db714f7105de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 09:06:10 +0000 Subject: [PATCH 419/505] docs(api): add validation examples to timeout fields in policies/environments --- .stats.yml | 4 ++-- src/gitpod/resources/organizations/policies.py | 14 ++++++++++++-- src/gitpod/types/environment_spec.py | 7 ++++++- src/gitpod/types/environment_spec_param.py | 7 ++++++- src/gitpod/types/environment_update_params.py | 7 ++++++- .../types/organizations/organization_policies.py | 7 ++++++- .../types/organizations/policy_update_params.py | 7 ++++++- 7 files changed, 44 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 33e7dd90..3f0933da 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-02ad1975aaf8e2fe22f10f1cb7f691d4b00f440c0b481aedab196e1eedab68cc.yml -openapi_spec_hash: 83b08f17aedbc539a5e3db6b9f282053 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a50acff4052581b25c7fa8b0b35d7b173b7f7bfe008dafeab53d98acd29140f8.yml +openapi_spec_hash: 5da04537f5a42c068303af2adaa3fe0e config_hash: 8531cb42193029df25a045bf85d9778e diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 16f93586..a9d30bfb 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -191,7 +191,12 @@ def update( maximum_environment_timeout: maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes (1800 seconds). + minutes (1800 seconds). value must be 0s (no limit) or at least 1800s (30 + minutes): + + ``` + this == duration('0s') || this >= duration('1800s') + ``` maximum_running_environments_per_user: maximum_running_environments_per_user limits simultaneously running environments per user @@ -426,7 +431,12 @@ async def update( maximum_environment_timeout: maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes (1800 seconds). + minutes (1800 seconds). value must be 0s (no limit) or at least 1800s (30 + minutes): + + ``` + this == duration('0s') || this >= duration('1800s') + ``` maximum_running_environments_per_user: maximum_running_environments_per_user limits simultaneously running environments per user diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index c4a10ecd..0ea027ad 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -200,7 +200,12 @@ class Timeout(BaseModel): disconnected: Optional[str] = None """ inacitivity is the maximum time of disconnection before the environment is - stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. + stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. value + must be 0s (disabled) or at least 1800s (30 minutes): + + ``` + this == duration('0s') || this >= duration('1800s') + ``` """ diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index a646dac6..e761d4d0 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -205,7 +205,12 @@ class Timeout(TypedDict, total=False): disconnected: str """ inacitivity is the maximum time of disconnection before the environment is - stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. + stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. value + must be 0s (disabled) or at least 1800s (30 minutes): + + ``` + this == duration('0s') || this >= duration('1800s') + ``` """ diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index 28879ebc..c5437c0a 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -121,7 +121,12 @@ class SpecTimeout(TypedDict, total=False): disconnected: Optional[str] """ inacitivity is the maximum time of disconnection before the environment is - stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. + stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. value + must be 0s (disabled) or at least 1800s (30 minutes): + + ``` + this == duration('0s') || this >= duration('1800s') + ``` """ diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py index 3f728ff3..0816b40f 100644 --- a/src/gitpod/types/organizations/organization_policies.py +++ b/src/gitpod/types/organizations/organization_policies.py @@ -124,7 +124,12 @@ class OrganizationPolicies(BaseModel): """ maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes (1800 seconds). + minutes (1800 seconds). value must be 0s (no limit) or at least 1800s (30 + minutes): + + ``` + this == duration('0s') || this >= duration('1800s') + ``` """ security_agent_policy: Optional[SecurityAgentPolicy] = FieldInfo(alias="securityAgentPolicy", default=None) diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index b607a7f7..84d21073 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -81,7 +81,12 @@ class PolicyUpdateParams(TypedDict, total=False): """ maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes (1800 seconds). + minutes (1800 seconds). value must be 0s (no limit) or at least 1800s (30 + minutes): + + ``` + this == duration('0s') || this >= duration('1800s') + ``` """ maximum_running_environments_per_user: Annotated[ From c96ea604a1284a752e4af14cb87eeea0fc52e24e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 09:46:44 +0000 Subject: [PATCH 420/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3f0933da..32191d90 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a50acff4052581b25c7fa8b0b35d7b173b7f7bfe008dafeab53d98acd29140f8.yml -openapi_spec_hash: 5da04537f5a42c068303af2adaa3fe0e -config_hash: 8531cb42193029df25a045bf85d9778e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6afce08fcd8bf2db43a1bf23cd3d0e26cfd58038a4886a0b93905ed32a270976.yml +openapi_spec_hash: 7e68abc261b93d149fe5274a4033fe7f +config_hash: 929b044c214da0da793e235847333d89 From a3b9c639b7084714a5e7cbfdcb9018ecd1124d94 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:47:08 +0000 Subject: [PATCH 421/505] feat(api): add sort option to ListAuditLogs --- .stats.yml | 6 +++--- api.md | 4 ++-- src/gitpod/resources/events.py | 15 +++++++++++++-- src/gitpod/resources/projects/projects.py | 6 +++--- src/gitpod/types/__init__.py | 4 ++-- src/gitpod/types/event_list_params.py | 12 ++++++++++-- .../types/organization_list_members_params.py | 2 +- src/gitpod/types/project_list_params.py | 4 ++-- src/gitpod/types/shared/__init__.py | 2 ++ src/gitpod/types/shared/sort.py | 15 +++++++++++++++ src/gitpod/types/{ => shared}/sort_order.py | 0 src/gitpod/types/shared_params/__init__.py | 2 ++ .../{sort_param.py => shared_params/sort.py} | 6 +++--- src/gitpod/types/shared_params/sort_order.py | 9 +++++++++ tests/api_resources/test_events.py | 8 ++++++++ 15 files changed, 75 insertions(+), 20 deletions(-) create mode 100644 src/gitpod/types/shared/sort.py rename src/gitpod/types/{ => shared}/sort_order.py (100%) rename src/gitpod/types/{sort_param.py => shared_params/sort.py} (71%) create mode 100644 src/gitpod/types/shared_params/sort_order.py diff --git a/.stats.yml b/.stats.yml index 32191d90..a7ba70a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6afce08fcd8bf2db43a1bf23cd3d0e26cfd58038a4886a0b93905ed32a270976.yml -openapi_spec_hash: 7e68abc261b93d149fe5274a4033fe7f -config_hash: 929b044c214da0da793e235847333d89 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-426f3adea47f1f9969b3ace193806d0b5c6cca002b59f1306ff55a53ba184d41.yml +openapi_spec_hash: c4f8786a933b74d658f315ed5587b4bd +config_hash: 65442903d648b9f87a032fc0a4823e62 diff --git a/api.md b/api.md index 6310546f..e1322dff 100644 --- a/api.md +++ b/api.md @@ -18,6 +18,8 @@ from gitpod.types import ( ResourceType, RunsOn, SecretRef, + Sort, + SortOrder, State, Subject, Task, @@ -572,8 +574,6 @@ from gitpod.types import ( ProjectPhase, ProjectPrebuildConfiguration, RecommendedEditors, - Sort, - SortOrder, ProjectCreateResponse, ProjectRetrieveResponse, ProjectUpdateResponse, diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index af65788d..179eb6cb 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -20,6 +20,7 @@ from ..pagination import SyncEntriesPage, AsyncEntriesPage from .._base_client import AsyncPaginator, make_request_options from .._decoders.jsonl import JSONLDecoder, AsyncJSONLDecoder +from ..types.shared_params.sort import Sort from ..types.event_list_response import EventListResponse from ..types.event_watch_response import EventWatchResponse @@ -53,6 +54,7 @@ def list( page_size: int | Omit = omit, filter: event_list_params.Filter | Omit = omit, pagination: event_list_params.Pagination | Omit = omit, + sort: Sort | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -99,7 +101,10 @@ def list( ``` Args: - pagination: pagination contains the pagination options for listing environments + pagination: pagination contains the pagination options for listing audit logs + + sort: sort specifies the order of results. When unspecified, results are sorted by + creation time descending (newest first). Supported sort fields: createdAt. extra_headers: Send extra headers @@ -116,6 +121,7 @@ def list( { "filter": filter, "pagination": pagination, + "sort": sort, }, event_list_params.EventListParams, ), @@ -235,6 +241,7 @@ def list( page_size: int | Omit = omit, filter: event_list_params.Filter | Omit = omit, pagination: event_list_params.Pagination | Omit = omit, + sort: Sort | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -281,7 +288,10 @@ def list( ``` Args: - pagination: pagination contains the pagination options for listing environments + pagination: pagination contains the pagination options for listing audit logs + + sort: sort specifies the order of results. When unspecified, results are sorted by + creation time descending (newest first). Supported sort fields: createdAt. extra_headers: Send extra headers @@ -298,6 +308,7 @@ def list( { "filter": filter, "pagination": pagination, + "sort": sort, }, event_list_params.EventListParams, ), diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 9daaaa6e..7661206e 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -38,7 +38,6 @@ from ...pagination import SyncProjectsPage, AsyncProjectsPage from ..._base_client import AsyncPaginator, make_request_options from ...types.project import Project -from ...types.sort_param import SortParam from .environment_clases import ( EnvironmentClasesResource, AsyncEnvironmentClasesResource, @@ -47,6 +46,7 @@ EnvironmentClasesResourceWithStreamingResponse, AsyncEnvironmentClasesResourceWithStreamingResponse, ) +from ...types.shared_params.sort import Sort from ...types.project_create_response import ProjectCreateResponse from ...types.project_update_response import ProjectUpdateResponse from ...types.project_retrieve_response import ProjectRetrieveResponse @@ -365,7 +365,7 @@ def list( page_size: int | Omit = omit, filter: project_list_params.Filter | Omit = omit, pagination: project_list_params.Pagination | Omit = omit, - sort: SortParam | Omit = omit, + sort: Sort | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1020,7 +1020,7 @@ def list( page_size: int | Omit = omit, filter: project_list_params.Filter | Omit = omit, pagination: project_list_params.Pagination | Omit = omit, - sort: SortParam | Omit = omit, + sort: Sort | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index d68e94f2..6afb334e 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -12,6 +12,7 @@ from .runner import Runner as Runner from .secret import Secret as Secret from .shared import ( + Sort as Sort, Task as Task, State as State, RunsOn as RunsOn, @@ -21,6 +22,7 @@ ErrorCode as ErrorCode, Principal as Principal, SecretRef as SecretRef, + SortOrder as SortOrder, FieldValue as FieldValue, UserStatus as UserStatus, ResourceRole as ResourceRole, @@ -46,8 +48,6 @@ from .log_level import LogLevel as LogLevel from .warm_pool import WarmPool as WarmPool from .agent_mode import AgentMode as AgentMode -from .sort_order import SortOrder as SortOrder -from .sort_param import SortParam as SortParam from .veto_param import VetoParam as VetoParam from .environment import Environment as Environment from .error_level import ErrorLevel as ErrorLevel diff --git a/src/gitpod/types/event_list_params.py b/src/gitpod/types/event_list_params.py index 85f5eeff..b0a320d2 100644 --- a/src/gitpod/types/event_list_params.py +++ b/src/gitpod/types/event_list_params.py @@ -9,6 +9,7 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo from .shared.principal import Principal +from .shared_params.sort import Sort from .shared.resource_type import ResourceType __all__ = ["EventListParams", "Filter", "Pagination"] @@ -22,7 +23,14 @@ class EventListParams(TypedDict, total=False): filter: Filter pagination: Pagination - """pagination contains the pagination options for listing environments""" + """pagination contains the pagination options for listing audit logs""" + + sort: Sort + """sort specifies the order of results. + + When unspecified, results are sorted by creation time descending (newest first). + Supported sort fields: createdAt. + """ _FilterReservedKeywords = TypedDict( @@ -48,7 +56,7 @@ class Filter(_FilterReservedKeywords, total=False): class Pagination(TypedDict, total=False): - """pagination contains the pagination options for listing environments""" + """pagination contains the pagination options for listing audit logs""" token: str """ diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index f7e1979c..2b4f7714 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -7,7 +7,7 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo -from .sort_order import SortOrder +from .shared.sort_order import SortOrder from .shared.user_status import UserStatus from .shared.organization_role import OrganizationRole diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py index 0c9a11a7..796fa58a 100644 --- a/src/gitpod/types/project_list_params.py +++ b/src/gitpod/types/project_list_params.py @@ -7,8 +7,8 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo -from .sort_param import SortParam from .runner_kind import RunnerKind +from .shared_params.sort import Sort __all__ = ["ProjectListParams", "Filter", "Pagination"] @@ -23,7 +23,7 @@ class ProjectListParams(TypedDict, total=False): pagination: Pagination """pagination contains the pagination options for listing organizations""" - sort: SortParam + sort: Sort """sort specifies the order of results. Defaults to popularity descending. Supported fields: diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index 4a6ac7b4..0d4db91c 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .sort import Sort as Sort from .task import Task as Task from .state import State as State from .gateway import Gateway as Gateway @@ -9,6 +10,7 @@ from .task_spec import TaskSpec as TaskSpec from .error_code import ErrorCode as ErrorCode from .secret_ref import SecretRef as SecretRef +from .sort_order import SortOrder as SortOrder from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus from .resource_role import ResourceRole as ResourceRole diff --git a/src/gitpod/types/shared/sort.py b/src/gitpod/types/shared/sort.py new file mode 100644 index 00000000..a34fee6f --- /dev/null +++ b/src/gitpod/types/shared/sort.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .sort_order import SortOrder + +__all__ = ["Sort"] + + +class Sort(BaseModel): + field: Optional[str] = None + """Field name to sort by, in camelCase.""" + + order: Optional[SortOrder] = None diff --git a/src/gitpod/types/sort_order.py b/src/gitpod/types/shared/sort_order.py similarity index 100% rename from src/gitpod/types/sort_order.py rename to src/gitpod/types/shared/sort_order.py diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index 1d82dedc..48b06ca8 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -1,11 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .sort import Sort as Sort from .state import State as State from .runs_on import RunsOn as RunsOn from .subject import Subject as Subject from .principal import Principal as Principal from .task_spec import TaskSpec as TaskSpec from .secret_ref import SecretRef as SecretRef +from .sort_order import SortOrder as SortOrder from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus from .resource_role import ResourceRole as ResourceRole diff --git a/src/gitpod/types/sort_param.py b/src/gitpod/types/shared_params/sort.py similarity index 71% rename from src/gitpod/types/sort_param.py rename to src/gitpod/types/shared_params/sort.py index d8f7b07e..9ed3a2ed 100644 --- a/src/gitpod/types/sort_param.py +++ b/src/gitpod/types/shared_params/sort.py @@ -4,12 +4,12 @@ from typing_extensions import TypedDict -from .sort_order import SortOrder +from ..shared.sort_order import SortOrder -__all__ = ["SortParam"] +__all__ = ["Sort"] -class SortParam(TypedDict, total=False): +class Sort(TypedDict, total=False): field: str """Field name to sort by, in camelCase.""" diff --git a/src/gitpod/types/shared_params/sort_order.py b/src/gitpod/types/shared_params/sort_order.py new file mode 100644 index 00000000..679df500 --- /dev/null +++ b/src/gitpod/types/shared_params/sort_order.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SortOrder"] + +SortOrder: TypeAlias = Literal["SORT_ORDER_UNSPECIFIED", "SORT_ORDER_ASC", "SORT_ORDER_DESC"] diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index b5b401d9..dc84a57e 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -43,6 +43,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 20, }, + sort={ + "field": "field", + "order": "SORT_ORDER_UNSPECIFIED", + }, ) assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) @@ -145,6 +149,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 20, }, + sort={ + "field": "field", + "order": "SORT_ORDER_UNSPECIFIED", + }, ) assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) From 7fa1e0d25e69a7b12c2329338abcfa586cb64bb4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 14:25:14 +0000 Subject: [PATCH 422/505] feat(api): add automations resource with workflows/executions/actions --- .stats.yml | 6 +- api.md | 39 + src/gitpod/_client.py | 38 + src/gitpod/pagination.py | 212 ++ src/gitpod/resources/__init__.py | 14 + src/gitpod/resources/automations.py | 2027 +++++++++++++++++ src/gitpod/types/__init__.py | 45 + ...tomation_cancel_execution_action_params.py | 13 + .../automation_cancel_execution_params.py | 13 + src/gitpod/types/automation_create_params.py | 51 + .../types/automation_create_response.py | 13 + src/gitpod/types/automation_delete_params.py | 26 + ...utomation_list_execution_actions_params.py | 56 + ...utomation_list_execution_outputs_params.py | 38 + ...omation_list_execution_outputs_response.py | 25 + .../automation_list_executions_params.py | 74 + src/gitpod/types/automation_list_params.py | 69 + ...mation_retrieve_execution_action_params.py | 13 + ...tion_retrieve_execution_action_response.py | 17 + .../automation_retrieve_execution_params.py | 13 + .../automation_retrieve_execution_response.py | 15 + .../types/automation_retrieve_params.py | 13 + .../types/automation_retrieve_response.py | 13 + .../automation_start_execution_params.py | 32 + .../automation_start_execution_response.py | 15 + src/gitpod/types/automation_update_params.py | 49 + .../types/automation_update_response.py | 13 + src/gitpod/types/workflow.py | 236 ++ src/gitpod/types/workflow_action.py | 71 + src/gitpod/types/workflow_action_param.py | 72 + src/gitpod/types/workflow_execution.py | 560 +++++ src/gitpod/types/workflow_execution_action.py | 682 ++++++ src/gitpod/types/workflow_step.py | 92 + src/gitpod/types/workflow_step_param.py | 93 + src/gitpod/types/workflow_trigger.py | 105 + src/gitpod/types/workflow_trigger_context.py | 130 ++ .../types/workflow_trigger_context_param.py | 131 ++ src/gitpod/types/workflow_trigger_param.py | 103 + tests/api_resources/test_automations.py | 1549 +++++++++++++ 39 files changed, 6773 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/resources/automations.py create mode 100644 src/gitpod/types/automation_cancel_execution_action_params.py create mode 100644 src/gitpod/types/automation_cancel_execution_params.py create mode 100644 src/gitpod/types/automation_create_params.py create mode 100644 src/gitpod/types/automation_create_response.py create mode 100644 src/gitpod/types/automation_delete_params.py create mode 100644 src/gitpod/types/automation_list_execution_actions_params.py create mode 100644 src/gitpod/types/automation_list_execution_outputs_params.py create mode 100644 src/gitpod/types/automation_list_execution_outputs_response.py create mode 100644 src/gitpod/types/automation_list_executions_params.py create mode 100644 src/gitpod/types/automation_list_params.py create mode 100644 src/gitpod/types/automation_retrieve_execution_action_params.py create mode 100644 src/gitpod/types/automation_retrieve_execution_action_response.py create mode 100644 src/gitpod/types/automation_retrieve_execution_params.py create mode 100644 src/gitpod/types/automation_retrieve_execution_response.py create mode 100644 src/gitpod/types/automation_retrieve_params.py create mode 100644 src/gitpod/types/automation_retrieve_response.py create mode 100644 src/gitpod/types/automation_start_execution_params.py create mode 100644 src/gitpod/types/automation_start_execution_response.py create mode 100644 src/gitpod/types/automation_update_params.py create mode 100644 src/gitpod/types/automation_update_response.py create mode 100644 src/gitpod/types/workflow.py create mode 100644 src/gitpod/types/workflow_action.py create mode 100644 src/gitpod/types/workflow_action_param.py create mode 100644 src/gitpod/types/workflow_execution.py create mode 100644 src/gitpod/types/workflow_execution_action.py create mode 100644 src/gitpod/types/workflow_step.py create mode 100644 src/gitpod/types/workflow_step_param.py create mode 100644 src/gitpod/types/workflow_trigger.py create mode 100644 src/gitpod/types/workflow_trigger_context.py create mode 100644 src/gitpod/types/workflow_trigger_context_param.py create mode 100644 src/gitpod/types/workflow_trigger_param.py create mode 100644 tests/api_resources/test_automations.py diff --git a/.stats.yml b/.stats.yml index a7ba70a7..d281cf1b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-426f3adea47f1f9969b3ace193806d0b5c6cca002b59f1306ff55a53ba184d41.yml +configured_endpoints: 193 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d7e6093517f83ea4606a88899e81565c0f9207614e112b6057679645e0651801.yml openapi_spec_hash: c4f8786a933b74d658f315ed5587b4bd -config_hash: 65442903d648b9f87a032fc0a4823e62 +config_hash: 8f918c43124691f0ddd95f5fd521960a diff --git a/api.md b/api.md index e1322dff..8c8075ae 100644 --- a/api.md +++ b/api.md @@ -100,6 +100,45 @@ Methods: - client.agents.stop_execution(\*\*params) -> object - client.agents.update_prompt(\*\*params) -> AgentUpdatePromptResponse +# Automations + +Types: + +```python +from gitpod.types import ( + Workflow, + WorkflowAction, + WorkflowExecution, + WorkflowExecutionAction, + WorkflowStep, + WorkflowTrigger, + WorkflowTriggerContext, + AutomationCreateResponse, + AutomationRetrieveResponse, + AutomationUpdateResponse, + AutomationListExecutionOutputsResponse, + AutomationRetrieveExecutionResponse, + AutomationRetrieveExecutionActionResponse, + AutomationStartExecutionResponse, +) +``` + +Methods: + +- client.automations.create(\*\*params) -> AutomationCreateResponse +- client.automations.retrieve(\*\*params) -> AutomationRetrieveResponse +- client.automations.update(\*\*params) -> AutomationUpdateResponse +- client.automations.list(\*\*params) -> SyncWorkflowsPage[Workflow] +- client.automations.delete(\*\*params) -> object +- client.automations.cancel_execution(\*\*params) -> object +- client.automations.cancel_execution_action(\*\*params) -> object +- client.automations.list_execution_actions(\*\*params) -> SyncWorkflowExecutionActionsPage[WorkflowExecutionAction] +- client.automations.list_execution_outputs(\*\*params) -> SyncOutputsPage[AutomationListExecutionOutputsResponse] +- client.automations.list_executions(\*\*params) -> SyncWorkflowExecutionsPage[WorkflowExecution] +- client.automations.retrieve_execution(\*\*params) -> AutomationRetrieveExecutionResponse +- client.automations.retrieve_execution_action(\*\*params) -> AutomationRetrieveExecutionActionResponse +- client.automations.start_execution(\*\*params) -> AutomationStartExecutionResponse + # Editors Types: diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index 888775ef..dddc11d8 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -46,6 +46,7 @@ identity, projects, prebuilds, + automations, environments, organizations, ) @@ -59,6 +60,7 @@ from .resources.gateways import GatewaysResource, AsyncGatewaysResource from .resources.identity import IdentityResource, AsyncIdentityResource from .resources.prebuilds import PrebuildsResource, AsyncPrebuildsResource + from .resources.automations import AutomationsResource, AsyncAutomationsResource from .resources.users.users import UsersResource, AsyncUsersResource from .resources.groups.groups import GroupsResource, AsyncGroupsResource from .resources.runners.runners import RunnersResource, AsyncRunnersResource @@ -136,6 +138,12 @@ def agents(self) -> AgentsResource: return AgentsResource(self) + @cached_property + def automations(self) -> AutomationsResource: + from .resources.automations import AutomationsResource + + return AutomationsResource(self) + @cached_property def editors(self) -> EditorsResource: from .resources.editors import EditorsResource @@ -411,6 +419,12 @@ def agents(self) -> AsyncAgentsResource: return AsyncAgentsResource(self) + @cached_property + def automations(self) -> AsyncAutomationsResource: + from .resources.automations import AsyncAutomationsResource + + return AsyncAutomationsResource(self) + @cached_property def editors(self) -> AsyncEditorsResource: from .resources.editors import AsyncEditorsResource @@ -637,6 +651,12 @@ def agents(self) -> agents.AgentsResourceWithRawResponse: return AgentsResourceWithRawResponse(self._client.agents) + @cached_property + def automations(self) -> automations.AutomationsResourceWithRawResponse: + from .resources.automations import AutomationsResourceWithRawResponse + + return AutomationsResourceWithRawResponse(self._client.automations) + @cached_property def editors(self) -> editors.EditorsResourceWithRawResponse: from .resources.editors import EditorsResourceWithRawResponse @@ -751,6 +771,12 @@ def agents(self) -> agents.AsyncAgentsResourceWithRawResponse: return AsyncAgentsResourceWithRawResponse(self._client.agents) + @cached_property + def automations(self) -> automations.AsyncAutomationsResourceWithRawResponse: + from .resources.automations import AsyncAutomationsResourceWithRawResponse + + return AsyncAutomationsResourceWithRawResponse(self._client.automations) + @cached_property def editors(self) -> editors.AsyncEditorsResourceWithRawResponse: from .resources.editors import AsyncEditorsResourceWithRawResponse @@ -865,6 +891,12 @@ def agents(self) -> agents.AgentsResourceWithStreamingResponse: return AgentsResourceWithStreamingResponse(self._client.agents) + @cached_property + def automations(self) -> automations.AutomationsResourceWithStreamingResponse: + from .resources.automations import AutomationsResourceWithStreamingResponse + + return AutomationsResourceWithStreamingResponse(self._client.automations) + @cached_property def editors(self) -> editors.EditorsResourceWithStreamingResponse: from .resources.editors import EditorsResourceWithStreamingResponse @@ -979,6 +1011,12 @@ def agents(self) -> agents.AsyncAgentsResourceWithStreamingResponse: return AsyncAgentsResourceWithStreamingResponse(self._client.agents) + @cached_property + def automations(self) -> automations.AsyncAutomationsResourceWithStreamingResponse: + from .resources.automations import AsyncAutomationsResourceWithStreamingResponse + + return AsyncAutomationsResourceWithStreamingResponse(self._client.automations) + @cached_property def editors(self) -> editors.AsyncEditorsResourceWithStreamingResponse: from .resources.editors import AsyncEditorsResourceWithStreamingResponse diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 9f534450..b55ecc60 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -51,6 +51,9 @@ "MembersPagePagination", "SyncMembersPage", "AsyncMembersPage", + "OutputsPagePagination", + "SyncOutputsPage", + "AsyncOutputsPage", "PersonalAccessTokensPagePagination", "SyncPersonalAccessTokensPage", "AsyncPersonalAccessTokensPage", @@ -102,6 +105,15 @@ "WarmPoolsPagePagination", "SyncWarmPoolsPage", "AsyncWarmPoolsPage", + "WorkflowExecutionActionsPagePagination", + "SyncWorkflowExecutionActionsPage", + "AsyncWorkflowExecutionActionsPage", + "WorkflowExecutionsPagePagination", + "SyncWorkflowExecutionsPage", + "AsyncWorkflowExecutionsPage", + "WorkflowsPagePagination", + "SyncWorkflowsPage", + "AsyncWorkflowsPage", ] _T = TypeVar("_T") @@ -807,6 +819,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class OutputsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncOutputsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + outputs: List[_T] + pagination: Optional[OutputsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + outputs = self.outputs + if not outputs: + return [] + return outputs + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncOutputsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + outputs: List[_T] + pagination: Optional[OutputsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + outputs = self.outputs + if not outputs: + return [] + return outputs + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class PersonalAccessTokensPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -1655,3 +1717,153 @@ def next_page_info(self) -> Optional[PageInfo]: return None return PageInfo(params={"token": next_token}) + + +class WorkflowExecutionActionsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncWorkflowExecutionActionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[WorkflowExecutionActionsPagePagination] = None + workflow_execution_actions: List[_T] = FieldInfo(alias="workflowExecutionActions") + + @override + def _get_page_items(self) -> List[_T]: + workflow_execution_actions = self.workflow_execution_actions + if not workflow_execution_actions: + return [] + return workflow_execution_actions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncWorkflowExecutionActionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[WorkflowExecutionActionsPagePagination] = None + workflow_execution_actions: List[_T] = FieldInfo(alias="workflowExecutionActions") + + @override + def _get_page_items(self) -> List[_T]: + workflow_execution_actions = self.workflow_execution_actions + if not workflow_execution_actions: + return [] + return workflow_execution_actions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class WorkflowExecutionsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncWorkflowExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[WorkflowExecutionsPagePagination] = None + workflow_executions: List[_T] = FieldInfo(alias="workflowExecutions") + + @override + def _get_page_items(self) -> List[_T]: + workflow_executions = self.workflow_executions + if not workflow_executions: + return [] + return workflow_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncWorkflowExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[WorkflowExecutionsPagePagination] = None + workflow_executions: List[_T] = FieldInfo(alias="workflowExecutions") + + @override + def _get_page_items(self) -> List[_T]: + workflow_executions = self.workflow_executions + if not workflow_executions: + return [] + return workflow_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class WorkflowsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncWorkflowsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[WorkflowsPagePagination] = None + workflows: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + workflows = self.workflows + if not workflows: + return [] + return workflows + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncWorkflowsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[WorkflowsPagePagination] = None + workflows: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + workflows = self.workflows + if not workflows: + return [] + return workflows + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index d5baa12a..97c0390c 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -112,6 +112,14 @@ PrebuildsResourceWithStreamingResponse, AsyncPrebuildsResourceWithStreamingResponse, ) +from .automations import ( + AutomationsResource, + AsyncAutomationsResource, + AutomationsResourceWithRawResponse, + AsyncAutomationsResourceWithRawResponse, + AutomationsResourceWithStreamingResponse, + AsyncAutomationsResourceWithStreamingResponse, +) from .environments import ( EnvironmentsResource, AsyncEnvironmentsResource, @@ -142,6 +150,12 @@ "AsyncAgentsResourceWithRawResponse", "AgentsResourceWithStreamingResponse", "AsyncAgentsResourceWithStreamingResponse", + "AutomationsResource", + "AsyncAutomationsResource", + "AutomationsResourceWithRawResponse", + "AsyncAutomationsResourceWithRawResponse", + "AutomationsResourceWithStreamingResponse", + "AsyncAutomationsResourceWithStreamingResponse", "EditorsResource", "AsyncEditorsResource", "EditorsResourceWithRawResponse", diff --git a/src/gitpod/resources/automations.py b/src/gitpod/resources/automations.py new file mode 100644 index 00000000..616bc89d --- /dev/null +++ b/src/gitpod/resources/automations.py @@ -0,0 +1,2027 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable, Optional + +import httpx + +from ..types import ( + automation_list_params, + automation_create_params, + automation_delete_params, + automation_update_params, + automation_retrieve_params, + automation_list_executions_params, + automation_start_execution_params, + automation_cancel_execution_params, + automation_retrieve_execution_params, + automation_list_execution_actions_params, + automation_list_execution_outputs_params, + automation_cancel_execution_action_params, + automation_retrieve_execution_action_params, +) +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import ( + SyncOutputsPage, + AsyncOutputsPage, + SyncWorkflowsPage, + AsyncWorkflowsPage, + SyncWorkflowExecutionsPage, + AsyncWorkflowExecutionsPage, + SyncWorkflowExecutionActionsPage, + AsyncWorkflowExecutionActionsPage, +) +from .._base_client import AsyncPaginator, make_request_options +from ..types.workflow import Workflow +from ..types.shared_params.sort import Sort +from ..types.workflow_execution import WorkflowExecution +from ..types.shared_params.subject import Subject +from ..types.workflow_action_param import WorkflowActionParam +from ..types.workflow_trigger_param import WorkflowTriggerParam +from ..types.workflow_execution_action import WorkflowExecutionAction +from ..types.automation_create_response import AutomationCreateResponse +from ..types.automation_update_response import AutomationUpdateResponse +from ..types.automation_retrieve_response import AutomationRetrieveResponse +from ..types.workflow_trigger_context_param import WorkflowTriggerContextParam +from ..types.automation_start_execution_response import AutomationStartExecutionResponse +from ..types.automation_retrieve_execution_response import AutomationRetrieveExecutionResponse +from ..types.automation_list_execution_outputs_response import AutomationListExecutionOutputsResponse +from ..types.automation_retrieve_execution_action_response import AutomationRetrieveExecutionActionResponse + +__all__ = ["AutomationsResource", "AsyncAutomationsResource"] + + +class AutomationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AutomationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AutomationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AutomationsResourceWithStreamingResponse(self) + + def create( + self, + *, + action: WorkflowActionParam, + description: str | Omit = omit, + executor: Optional[Subject] | Omit = omit, + name: str | Omit = omit, + report: WorkflowActionParam | Omit = omit, + triggers: Iterable[WorkflowTriggerParam] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationCreateResponse: + """ + Creates a new workflow with specified configuration. + + Use this method to: + + - Set up automated workflows + - Configure workflow triggers + - Define workflow actions and steps + - Set execution limits and constraints + + Args: + action: WorkflowAction defines the actions to be executed in a workflow. + + description: + Description must be at most 500 characters: + + ``` + size(this) <= 500 + ``` + + executor: Optional executor for the workflow. If not provided, defaults to the creator. + Must be either the caller themselves or a service account. + + name: + Name must be between 1 and 80 characters: + + ``` + size(this) >= 1 && size(this) <= 80 + ``` + + report: WorkflowAction defines the actions to be executed in a workflow. + + triggers: + Automation must have between 1 and 10 triggers: + + ``` + size(this) >= 1 && size(this) <= 10 + ``` + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.WorkflowService/CreateWorkflow", + body=maybe_transform( + { + "action": action, + "description": description, + "executor": executor, + "name": name, + "report": report, + "triggers": triggers, + }, + automation_create_params.AutomationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationCreateResponse, + ) + + def retrieve( + self, + *, + workflow_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationRetrieveResponse: + """ + Gets details about a specific workflow. + + Use this method to: + + - View workflow configuration + - Check workflow status + - Get workflow metadata + + ### Examples + + - Get workflow details: + + Retrieves information about a specific workflow. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.WorkflowService/GetWorkflow", + body=maybe_transform({"workflow_id": workflow_id}, automation_retrieve_params.AutomationRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationRetrieveResponse, + ) + + def update( + self, + *, + action: Optional[WorkflowActionParam] | Omit = omit, + description: Optional[str] | Omit = omit, + executor: Optional[Subject] | Omit = omit, + name: Optional[str] | Omit = omit, + report: Optional[WorkflowActionParam] | Omit = omit, + triggers: Iterable[WorkflowTriggerParam] | Omit = omit, + workflow_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationUpdateResponse: + """ + Updates a workflow's configuration using full replacement semantics. + + Update Behavior: + + - All provided fields completely replace existing values + - Optional fields that are not provided remain unchanged + - Complex fields (triggers, action) are replaced entirely, not merged + - To remove optional fields, explicitly set them to empty/default values + + Use this method to: + + - Modify workflow settings + - Update triggers and actions + - Change execution limits + - Update workflow steps + + ### Examples + + - Update workflow name: + + Changes the workflow's display name. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "Updated Workflow Name" + ``` + + - Replace all triggers: + + Completely replaces the workflow's trigger configuration. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + triggers: + - manual: {} + context: + projects: + projectIds: ["new-project-id"] + ``` + + - Update execution limits: + + Completely replaces the workflow's action configuration. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + action: + limits: + maxParallel: 10 + maxTotal: 100 + steps: + - task: + command: "npm test" + ``` + + Args: + action: WorkflowAction defines the actions to be executed in a workflow. + + description: + Description must be at most 500 characters: + + ``` + size(this) <= 500 + ``` + + name: + Name must be between 1 and 80 characters: + + ``` + size(this) >= 1 && size(this) <= 80 + ``` + + report: WorkflowAction defines the actions to be executed in a workflow. + + triggers: + Automation can have at most 10 triggers: + + ``` + size(this) <= 10 + ``` + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.WorkflowService/UpdateWorkflow", + body=maybe_transform( + { + "action": action, + "description": description, + "executor": executor, + "name": name, + "report": report, + "triggers": triggers, + "workflow_id": workflow_id, + }, + automation_update_params.AutomationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationUpdateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: automation_list_params.Filter | Omit = omit, + pagination: automation_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncWorkflowsPage[Workflow]: + """ + ListWorkflows + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.WorkflowService/ListWorkflows", + page=SyncWorkflowsPage[Workflow], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + automation_list_params.AutomationListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + automation_list_params.AutomationListParams, + ), + ), + model=Workflow, + method="post", + ) + + def delete( + self, + *, + force: bool | Omit = omit, + workflow_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a workflow permanently. + + Use this method to: + + - Remove unused workflows + - Clean up test workflows + - Delete obsolete configurations + + ### Examples + + - Delete workflow: + + Permanently removes a workflow. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + force: force indicates whether to immediately delete the workflow and all related + resources. When true, performs cascading deletion of: + + - All workflow executions + - All workflow execution actions + - All environments created by workflow actions + - All agent executions created by workflow actions + - The workflow itself When false (default), marks workflow executions for + deletion and relies on background reconciliation to clean up resources. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.WorkflowService/DeleteWorkflow", + body=maybe_transform( + { + "force": force, + "workflow_id": workflow_id, + }, + automation_delete_params.AutomationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def cancel_execution( + self, + *, + workflow_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Cancels a running workflow execution. + + Use this method to: + + - Stop long-running executions + - Cancel failed executions + - Manage resource usage + + ### Examples + + - Cancel execution: + + Stops a running workflow execution. + + ```yaml + workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.WorkflowService/CancelWorkflowExecution", + body=maybe_transform( + {"workflow_execution_id": workflow_execution_id}, + automation_cancel_execution_params.AutomationCancelExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def cancel_execution_action( + self, + *, + workflow_execution_action_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Cancels a running workflow execution action. + + Use this method to: + + - Stop long-running actions + - Cancel failed actions + - Manage resource usage + + ### Examples + + - Cancel execution action: + + Stops a running workflow execution action. + + ```yaml + workflowExecutionActionId: "a1b2c3d4-5e6f-7890-abcd-ef1234567890" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.WorkflowService/CancelWorkflowExecutionAction", + body=maybe_transform( + {"workflow_execution_action_id": workflow_execution_action_id}, + automation_cancel_execution_action_params.AutomationCancelExecutionActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_execution_actions( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: automation_list_execution_actions_params.Filter | Omit = omit, + pagination: automation_list_execution_actions_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncWorkflowExecutionActionsPage[WorkflowExecutionAction]: + """ + Lists workflow execution actions with optional filtering. + + Use this method to: + + - Monitor individual action execution status + - Debug action failures + - Track resource usage per action + + ### Examples + + - List execution actions for workflow execution: + + Shows all execution actions for a specific workflow execution. + + ```yaml + filter: + workflowExecutionIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + pagination: + pageSize: 20 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.WorkflowService/ListWorkflowExecutionActions", + page=SyncWorkflowExecutionActionsPage[WorkflowExecutionAction], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + automation_list_execution_actions_params.AutomationListExecutionActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + automation_list_execution_actions_params.AutomationListExecutionActionsParams, + ), + ), + model=WorkflowExecutionAction, + method="post", + ) + + def list_execution_outputs( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: automation_list_execution_outputs_params.Filter | Omit = omit, + pagination: automation_list_execution_outputs_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncOutputsPage[AutomationListExecutionOutputsResponse]: + """ + Lists outputs produced by workflow execution actions. + + Use this method to: + + - Retrieve test results, coverage metrics, or other structured data from + executions + - Aggregate outputs across multiple workflow executions + - Build dashboards or reports from execution data + + ### Examples + + - List outputs for a workflow execution: + + Retrieves all outputs produced by actions in the specified execution. + + ```yaml + filter: + workflowExecutionIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + pagination: + pageSize: 50 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.WorkflowService/ListWorkflowExecutionOutputs", + page=SyncOutputsPage[AutomationListExecutionOutputsResponse], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + automation_list_execution_outputs_params.AutomationListExecutionOutputsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + automation_list_execution_outputs_params.AutomationListExecutionOutputsParams, + ), + ), + model=AutomationListExecutionOutputsResponse, + method="post", + ) + + def list_executions( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: automation_list_executions_params.Filter | Omit = omit, + pagination: automation_list_executions_params.Pagination | Omit = omit, + sort: Sort | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncWorkflowExecutionsPage[WorkflowExecution]: + """ + Lists workflow executions with optional filtering. + + Use this method to: + + - Monitor workflow execution history + - Track execution status + - Debug workflow issues + + ### Examples + + - List executions for workflow: + + Shows all executions for a specific workflow. + + ```yaml + filter: + workflowIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + pagination: + pageSize: 20 + ``` + + Args: + sort: sort specifies the order of results. When unspecified, results are sorted by + operational priority (running first, then failed, then completed, then others). + Supported sort fields: startedAt, finishedAt, createdAt. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.WorkflowService/ListWorkflowExecutions", + page=SyncWorkflowExecutionsPage[WorkflowExecution], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + "sort": sort, + }, + automation_list_executions_params.AutomationListExecutionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + automation_list_executions_params.AutomationListExecutionsParams, + ), + ), + model=WorkflowExecution, + method="post", + ) + + def retrieve_execution( + self, + *, + workflow_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationRetrieveExecutionResponse: + """ + Gets details about a specific workflow execution. + + Use this method to: + + - Check execution status + - View execution results + - Monitor execution progress + + ### Examples + + - Get execution details: + + Retrieves information about a specific execution. + + ```yaml + workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.WorkflowService/GetWorkflowExecution", + body=maybe_transform( + {"workflow_execution_id": workflow_execution_id}, + automation_retrieve_execution_params.AutomationRetrieveExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationRetrieveExecutionResponse, + ) + + def retrieve_execution_action( + self, + *, + workflow_execution_action_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationRetrieveExecutionActionResponse: + """ + Gets details about a specific workflow execution action. + + Use this method to: + + - Check execution action status + - View execution action results + - Monitor execution action progress + + ### Examples + + - Get execution action details: + + Retrieves information about a specific execution action. + + ```yaml + workflowExecutionActionId: "a1b2c3d4-5e6f-7890-abcd-ef1234567890" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.WorkflowService/GetWorkflowExecutionAction", + body=maybe_transform( + {"workflow_execution_action_id": workflow_execution_action_id}, + automation_retrieve_execution_action_params.AutomationRetrieveExecutionActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationRetrieveExecutionActionResponse, + ) + + def start_execution( + self, + *, + context_override: Optional[WorkflowTriggerContextParam] | Omit = omit, + parameters: Dict[str, str] | Omit = omit, + workflow_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationStartExecutionResponse: + """ + Starts a workflow execution. + + Use this method to: + + - Start workflow execution on demand + - Test workflow configurations + - Run workflows outside of automatic triggers + + ### Examples + + - Start workflow: + + Starts a workflow execution manually. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + context_override: Optional context override for the execution. When provided, replaces the + workflow's default trigger context. User must have appropriate permissions on + the overridden resources. Supports Projects, Repositories, and Agent context + types. FromTrigger context type is not supported for manual overrides. + + parameters: Parameters to substitute into workflow steps using Go template syntax. Use + {{ .Parameters.key_name }} in templatable fields (task.command, agent.prompt, + pull*request.title/description/branch, trigger context agent.prompt). Keys must + match pattern ^[a-zA-Z*][a-zA-Z0-9_]\\**$ Maximum 10 parameters allowed. Empty map + is treated as no parameters provided. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.WorkflowService/StartWorkflow", + body=maybe_transform( + { + "context_override": context_override, + "parameters": parameters, + "workflow_id": workflow_id, + }, + automation_start_execution_params.AutomationStartExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationStartExecutionResponse, + ) + + +class AsyncAutomationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAutomationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncAutomationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncAutomationsResourceWithStreamingResponse(self) + + async def create( + self, + *, + action: WorkflowActionParam, + description: str | Omit = omit, + executor: Optional[Subject] | Omit = omit, + name: str | Omit = omit, + report: WorkflowActionParam | Omit = omit, + triggers: Iterable[WorkflowTriggerParam] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationCreateResponse: + """ + Creates a new workflow with specified configuration. + + Use this method to: + + - Set up automated workflows + - Configure workflow triggers + - Define workflow actions and steps + - Set execution limits and constraints + + Args: + action: WorkflowAction defines the actions to be executed in a workflow. + + description: + Description must be at most 500 characters: + + ``` + size(this) <= 500 + ``` + + executor: Optional executor for the workflow. If not provided, defaults to the creator. + Must be either the caller themselves or a service account. + + name: + Name must be between 1 and 80 characters: + + ``` + size(this) >= 1 && size(this) <= 80 + ``` + + report: WorkflowAction defines the actions to be executed in a workflow. + + triggers: + Automation must have between 1 and 10 triggers: + + ``` + size(this) >= 1 && size(this) <= 10 + ``` + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.WorkflowService/CreateWorkflow", + body=await async_maybe_transform( + { + "action": action, + "description": description, + "executor": executor, + "name": name, + "report": report, + "triggers": triggers, + }, + automation_create_params.AutomationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationCreateResponse, + ) + + async def retrieve( + self, + *, + workflow_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationRetrieveResponse: + """ + Gets details about a specific workflow. + + Use this method to: + + - View workflow configuration + - Check workflow status + - Get workflow metadata + + ### Examples + + - Get workflow details: + + Retrieves information about a specific workflow. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.WorkflowService/GetWorkflow", + body=await async_maybe_transform( + {"workflow_id": workflow_id}, automation_retrieve_params.AutomationRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationRetrieveResponse, + ) + + async def update( + self, + *, + action: Optional[WorkflowActionParam] | Omit = omit, + description: Optional[str] | Omit = omit, + executor: Optional[Subject] | Omit = omit, + name: Optional[str] | Omit = omit, + report: Optional[WorkflowActionParam] | Omit = omit, + triggers: Iterable[WorkflowTriggerParam] | Omit = omit, + workflow_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationUpdateResponse: + """ + Updates a workflow's configuration using full replacement semantics. + + Update Behavior: + + - All provided fields completely replace existing values + - Optional fields that are not provided remain unchanged + - Complex fields (triggers, action) are replaced entirely, not merged + - To remove optional fields, explicitly set them to empty/default values + + Use this method to: + + - Modify workflow settings + - Update triggers and actions + - Change execution limits + - Update workflow steps + + ### Examples + + - Update workflow name: + + Changes the workflow's display name. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "Updated Workflow Name" + ``` + + - Replace all triggers: + + Completely replaces the workflow's trigger configuration. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + triggers: + - manual: {} + context: + projects: + projectIds: ["new-project-id"] + ``` + + - Update execution limits: + + Completely replaces the workflow's action configuration. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + action: + limits: + maxParallel: 10 + maxTotal: 100 + steps: + - task: + command: "npm test" + ``` + + Args: + action: WorkflowAction defines the actions to be executed in a workflow. + + description: + Description must be at most 500 characters: + + ``` + size(this) <= 500 + ``` + + name: + Name must be between 1 and 80 characters: + + ``` + size(this) >= 1 && size(this) <= 80 + ``` + + report: WorkflowAction defines the actions to be executed in a workflow. + + triggers: + Automation can have at most 10 triggers: + + ``` + size(this) <= 10 + ``` + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.WorkflowService/UpdateWorkflow", + body=await async_maybe_transform( + { + "action": action, + "description": description, + "executor": executor, + "name": name, + "report": report, + "triggers": triggers, + "workflow_id": workflow_id, + }, + automation_update_params.AutomationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationUpdateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: automation_list_params.Filter | Omit = omit, + pagination: automation_list_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Workflow, AsyncWorkflowsPage[Workflow]]: + """ + ListWorkflows + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.WorkflowService/ListWorkflows", + page=AsyncWorkflowsPage[Workflow], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + automation_list_params.AutomationListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + automation_list_params.AutomationListParams, + ), + ), + model=Workflow, + method="post", + ) + + async def delete( + self, + *, + force: bool | Omit = omit, + workflow_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a workflow permanently. + + Use this method to: + + - Remove unused workflows + - Clean up test workflows + - Delete obsolete configurations + + ### Examples + + - Delete workflow: + + Permanently removes a workflow. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + force: force indicates whether to immediately delete the workflow and all related + resources. When true, performs cascading deletion of: + + - All workflow executions + - All workflow execution actions + - All environments created by workflow actions + - All agent executions created by workflow actions + - The workflow itself When false (default), marks workflow executions for + deletion and relies on background reconciliation to clean up resources. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.WorkflowService/DeleteWorkflow", + body=await async_maybe_transform( + { + "force": force, + "workflow_id": workflow_id, + }, + automation_delete_params.AutomationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def cancel_execution( + self, + *, + workflow_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Cancels a running workflow execution. + + Use this method to: + + - Stop long-running executions + - Cancel failed executions + - Manage resource usage + + ### Examples + + - Cancel execution: + + Stops a running workflow execution. + + ```yaml + workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.WorkflowService/CancelWorkflowExecution", + body=await async_maybe_transform( + {"workflow_execution_id": workflow_execution_id}, + automation_cancel_execution_params.AutomationCancelExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def cancel_execution_action( + self, + *, + workflow_execution_action_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Cancels a running workflow execution action. + + Use this method to: + + - Stop long-running actions + - Cancel failed actions + - Manage resource usage + + ### Examples + + - Cancel execution action: + + Stops a running workflow execution action. + + ```yaml + workflowExecutionActionId: "a1b2c3d4-5e6f-7890-abcd-ef1234567890" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.WorkflowService/CancelWorkflowExecutionAction", + body=await async_maybe_transform( + {"workflow_execution_action_id": workflow_execution_action_id}, + automation_cancel_execution_action_params.AutomationCancelExecutionActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_execution_actions( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: automation_list_execution_actions_params.Filter | Omit = omit, + pagination: automation_list_execution_actions_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[WorkflowExecutionAction, AsyncWorkflowExecutionActionsPage[WorkflowExecutionAction]]: + """ + Lists workflow execution actions with optional filtering. + + Use this method to: + + - Monitor individual action execution status + - Debug action failures + - Track resource usage per action + + ### Examples + + - List execution actions for workflow execution: + + Shows all execution actions for a specific workflow execution. + + ```yaml + filter: + workflowExecutionIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + pagination: + pageSize: 20 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.WorkflowService/ListWorkflowExecutionActions", + page=AsyncWorkflowExecutionActionsPage[WorkflowExecutionAction], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + automation_list_execution_actions_params.AutomationListExecutionActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + automation_list_execution_actions_params.AutomationListExecutionActionsParams, + ), + ), + model=WorkflowExecutionAction, + method="post", + ) + + def list_execution_outputs( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: automation_list_execution_outputs_params.Filter | Omit = omit, + pagination: automation_list_execution_outputs_params.Pagination | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ + AutomationListExecutionOutputsResponse, AsyncOutputsPage[AutomationListExecutionOutputsResponse] + ]: + """ + Lists outputs produced by workflow execution actions. + + Use this method to: + + - Retrieve test results, coverage metrics, or other structured data from + executions + - Aggregate outputs across multiple workflow executions + - Build dashboards or reports from execution data + + ### Examples + + - List outputs for a workflow execution: + + Retrieves all outputs produced by actions in the specified execution. + + ```yaml + filter: + workflowExecutionIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + pagination: + pageSize: 50 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.WorkflowService/ListWorkflowExecutionOutputs", + page=AsyncOutputsPage[AutomationListExecutionOutputsResponse], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + automation_list_execution_outputs_params.AutomationListExecutionOutputsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + automation_list_execution_outputs_params.AutomationListExecutionOutputsParams, + ), + ), + model=AutomationListExecutionOutputsResponse, + method="post", + ) + + def list_executions( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: automation_list_executions_params.Filter | Omit = omit, + pagination: automation_list_executions_params.Pagination | Omit = omit, + sort: Sort | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[WorkflowExecution, AsyncWorkflowExecutionsPage[WorkflowExecution]]: + """ + Lists workflow executions with optional filtering. + + Use this method to: + + - Monitor workflow execution history + - Track execution status + - Debug workflow issues + + ### Examples + + - List executions for workflow: + + Shows all executions for a specific workflow. + + ```yaml + filter: + workflowIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + pagination: + pageSize: 20 + ``` + + Args: + sort: sort specifies the order of results. When unspecified, results are sorted by + operational priority (running first, then failed, then completed, then others). + Supported sort fields: startedAt, finishedAt, createdAt. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.WorkflowService/ListWorkflowExecutions", + page=AsyncWorkflowExecutionsPage[WorkflowExecution], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + "sort": sort, + }, + automation_list_executions_params.AutomationListExecutionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + automation_list_executions_params.AutomationListExecutionsParams, + ), + ), + model=WorkflowExecution, + method="post", + ) + + async def retrieve_execution( + self, + *, + workflow_execution_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationRetrieveExecutionResponse: + """ + Gets details about a specific workflow execution. + + Use this method to: + + - Check execution status + - View execution results + - Monitor execution progress + + ### Examples + + - Get execution details: + + Retrieves information about a specific execution. + + ```yaml + workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.WorkflowService/GetWorkflowExecution", + body=await async_maybe_transform( + {"workflow_execution_id": workflow_execution_id}, + automation_retrieve_execution_params.AutomationRetrieveExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationRetrieveExecutionResponse, + ) + + async def retrieve_execution_action( + self, + *, + workflow_execution_action_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationRetrieveExecutionActionResponse: + """ + Gets details about a specific workflow execution action. + + Use this method to: + + - Check execution action status + - View execution action results + - Monitor execution action progress + + ### Examples + + - Get execution action details: + + Retrieves information about a specific execution action. + + ```yaml + workflowExecutionActionId: "a1b2c3d4-5e6f-7890-abcd-ef1234567890" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.WorkflowService/GetWorkflowExecutionAction", + body=await async_maybe_transform( + {"workflow_execution_action_id": workflow_execution_action_id}, + automation_retrieve_execution_action_params.AutomationRetrieveExecutionActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationRetrieveExecutionActionResponse, + ) + + async def start_execution( + self, + *, + context_override: Optional[WorkflowTriggerContextParam] | Omit = omit, + parameters: Dict[str, str] | Omit = omit, + workflow_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AutomationStartExecutionResponse: + """ + Starts a workflow execution. + + Use this method to: + + - Start workflow execution on demand + - Test workflow configurations + - Run workflows outside of automatic triggers + + ### Examples + + - Start workflow: + + Starts a workflow execution manually. + + ```yaml + workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + context_override: Optional context override for the execution. When provided, replaces the + workflow's default trigger context. User must have appropriate permissions on + the overridden resources. Supports Projects, Repositories, and Agent context + types. FromTrigger context type is not supported for manual overrides. + + parameters: Parameters to substitute into workflow steps using Go template syntax. Use + {{ .Parameters.key_name }} in templatable fields (task.command, agent.prompt, + pull*request.title/description/branch, trigger context agent.prompt). Keys must + match pattern ^[a-zA-Z*][a-zA-Z0-9_]\\**$ Maximum 10 parameters allowed. Empty map + is treated as no parameters provided. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.WorkflowService/StartWorkflow", + body=await async_maybe_transform( + { + "context_override": context_override, + "parameters": parameters, + "workflow_id": workflow_id, + }, + automation_start_execution_params.AutomationStartExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AutomationStartExecutionResponse, + ) + + +class AutomationsResourceWithRawResponse: + def __init__(self, automations: AutomationsResource) -> None: + self._automations = automations + + self.create = to_raw_response_wrapper( + automations.create, + ) + self.retrieve = to_raw_response_wrapper( + automations.retrieve, + ) + self.update = to_raw_response_wrapper( + automations.update, + ) + self.list = to_raw_response_wrapper( + automations.list, + ) + self.delete = to_raw_response_wrapper( + automations.delete, + ) + self.cancel_execution = to_raw_response_wrapper( + automations.cancel_execution, + ) + self.cancel_execution_action = to_raw_response_wrapper( + automations.cancel_execution_action, + ) + self.list_execution_actions = to_raw_response_wrapper( + automations.list_execution_actions, + ) + self.list_execution_outputs = to_raw_response_wrapper( + automations.list_execution_outputs, + ) + self.list_executions = to_raw_response_wrapper( + automations.list_executions, + ) + self.retrieve_execution = to_raw_response_wrapper( + automations.retrieve_execution, + ) + self.retrieve_execution_action = to_raw_response_wrapper( + automations.retrieve_execution_action, + ) + self.start_execution = to_raw_response_wrapper( + automations.start_execution, + ) + + +class AsyncAutomationsResourceWithRawResponse: + def __init__(self, automations: AsyncAutomationsResource) -> None: + self._automations = automations + + self.create = async_to_raw_response_wrapper( + automations.create, + ) + self.retrieve = async_to_raw_response_wrapper( + automations.retrieve, + ) + self.update = async_to_raw_response_wrapper( + automations.update, + ) + self.list = async_to_raw_response_wrapper( + automations.list, + ) + self.delete = async_to_raw_response_wrapper( + automations.delete, + ) + self.cancel_execution = async_to_raw_response_wrapper( + automations.cancel_execution, + ) + self.cancel_execution_action = async_to_raw_response_wrapper( + automations.cancel_execution_action, + ) + self.list_execution_actions = async_to_raw_response_wrapper( + automations.list_execution_actions, + ) + self.list_execution_outputs = async_to_raw_response_wrapper( + automations.list_execution_outputs, + ) + self.list_executions = async_to_raw_response_wrapper( + automations.list_executions, + ) + self.retrieve_execution = async_to_raw_response_wrapper( + automations.retrieve_execution, + ) + self.retrieve_execution_action = async_to_raw_response_wrapper( + automations.retrieve_execution_action, + ) + self.start_execution = async_to_raw_response_wrapper( + automations.start_execution, + ) + + +class AutomationsResourceWithStreamingResponse: + def __init__(self, automations: AutomationsResource) -> None: + self._automations = automations + + self.create = to_streamed_response_wrapper( + automations.create, + ) + self.retrieve = to_streamed_response_wrapper( + automations.retrieve, + ) + self.update = to_streamed_response_wrapper( + automations.update, + ) + self.list = to_streamed_response_wrapper( + automations.list, + ) + self.delete = to_streamed_response_wrapper( + automations.delete, + ) + self.cancel_execution = to_streamed_response_wrapper( + automations.cancel_execution, + ) + self.cancel_execution_action = to_streamed_response_wrapper( + automations.cancel_execution_action, + ) + self.list_execution_actions = to_streamed_response_wrapper( + automations.list_execution_actions, + ) + self.list_execution_outputs = to_streamed_response_wrapper( + automations.list_execution_outputs, + ) + self.list_executions = to_streamed_response_wrapper( + automations.list_executions, + ) + self.retrieve_execution = to_streamed_response_wrapper( + automations.retrieve_execution, + ) + self.retrieve_execution_action = to_streamed_response_wrapper( + automations.retrieve_execution_action, + ) + self.start_execution = to_streamed_response_wrapper( + automations.start_execution, + ) + + +class AsyncAutomationsResourceWithStreamingResponse: + def __init__(self, automations: AsyncAutomationsResource) -> None: + self._automations = automations + + self.create = async_to_streamed_response_wrapper( + automations.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + automations.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + automations.update, + ) + self.list = async_to_streamed_response_wrapper( + automations.list, + ) + self.delete = async_to_streamed_response_wrapper( + automations.delete, + ) + self.cancel_execution = async_to_streamed_response_wrapper( + automations.cancel_execution, + ) + self.cancel_execution_action = async_to_streamed_response_wrapper( + automations.cancel_execution_action, + ) + self.list_execution_actions = async_to_streamed_response_wrapper( + automations.list_execution_actions, + ) + self.list_execution_outputs = async_to_streamed_response_wrapper( + automations.list_execution_outputs, + ) + self.list_executions = async_to_streamed_response_wrapper( + automations.list_executions, + ) + self.retrieve_execution = async_to_streamed_response_wrapper( + automations.retrieve_execution, + ) + self.retrieve_execution_action = async_to_streamed_response_wrapper( + automations.retrieve_execution_action, + ) + self.start_execution = async_to_streamed_response_wrapper( + automations.start_execution, + ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 6afb334e..aedad4c6 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -45,6 +45,7 @@ from .account import Account as Account from .project import Project as Project from .prebuild import Prebuild as Prebuild +from .workflow import Workflow as Workflow from .log_level import LogLevel as LogLevel from .warm_pool import WarmPool as WarmPool from .agent_mode import AgentMode as AgentMode @@ -62,6 +63,7 @@ from .prebuild_spec import PrebuildSpec as PrebuildSpec from .project_phase import ProjectPhase as ProjectPhase from .runner_status import RunnerStatus as RunnerStatus +from .workflow_step import WorkflowStep as WorkflowStep from .editor_version import EditorVersion as EditorVersion from .invite_domains import InviteDomains as InviteDomains from .login_provider import LoginProvider as LoginProvider @@ -75,6 +77,7 @@ from .prompt_metadata import PromptMetadata as PromptMetadata from .runner_provider import RunnerProvider as RunnerProvider from .warm_pool_phase import WarmPoolPhase as WarmPoolPhase +from .workflow_action import WorkflowAction as WorkflowAction from .breadcrumb_param import BreadcrumbParam as BreadcrumbParam from .environment_role import EnvironmentRole as EnvironmentRole from .environment_spec import EnvironmentSpec as EnvironmentSpec @@ -83,6 +86,7 @@ from .project_metadata import ProjectMetadata as ProjectMetadata from .wake_event_param import WakeEventParam as WakeEventParam from .warm_pool_status import WarmPoolStatus as WarmPoolStatus +from .workflow_trigger import WorkflowTrigger as WorkflowTrigger from .environment_phase import EnvironmentPhase as EnvironmentPhase from .error_event_param import ErrorEventParam as ErrorEventParam from .event_list_params import EventListParams as EventListParams @@ -102,6 +106,7 @@ from .secret_list_params import SecretListParams as SecretListParams from .secret_scope_param import SecretScopeParam as SecretScopeParam from .warm_pool_metadata import WarmPoolMetadata as WarmPoolMetadata +from .workflow_execution import WorkflowExecution as WorkflowExecution from .agent_message_param import AgentMessageParam as AgentMessageParam from .event_list_response import EventListResponse as EventListResponse from .gateway_list_params import GatewayListParams as GatewayListParams @@ -112,6 +117,7 @@ from .prebuild_spec_param import PrebuildSpecParam as PrebuildSpecParam from .project_list_params import ProjectListParams as ProjectListParams from .recommended_editors import RecommendedEditors as RecommendedEditors +from .workflow_step_param import WorkflowStepParam as WorkflowStepParam from .environment_metadata import EnvironmentMetadata as EnvironmentMetadata from .event_watch_response import EventWatchResponse as EventWatchResponse from .exception_info_param import ExceptionInfoParam as ExceptionInfoParam @@ -133,6 +139,8 @@ from .project_create_params import ProjectCreateParams as ProjectCreateParams from .project_delete_params import ProjectDeleteParams as ProjectDeleteParams from .project_update_params import ProjectUpdateParams as ProjectUpdateParams +from .workflow_action_param import WorkflowActionParam as WorkflowActionParam +from .automation_list_params import AutomationListParams as AutomationListParams from .editor_retrieve_params import EditorRetrieveParams as EditorRetrieveParams from .environment_spec_param import EnvironmentSpecParam as EnvironmentSpecParam from .kernel_controls_config import KernelControlsConfig as KernelControlsConfig @@ -145,6 +153,7 @@ from .secret_create_response import SecretCreateResponse as SecretCreateResponse from .user_get_user_response import UserGetUserResponse as UserGetUserResponse from .user_input_block_param import UserInputBlockParam as UserInputBlockParam +from .workflow_trigger_param import WorkflowTriggerParam as WorkflowTriggerParam from .account_retrieve_params import AccountRetrieveParams as AccountRetrieveParams from .environment_initializer import EnvironmentInitializer as EnvironmentInitializer from .environment_list_params import EnvironmentListParams as EnvironmentListParams @@ -156,6 +165,9 @@ from .secret_get_value_params import SecretGetValueParams as SecretGetValueParams from .user_delete_user_params import UserDeleteUserParams as UserDeleteUserParams from .agent_code_context_param import AgentCodeContextParam as AgentCodeContextParam +from .automation_create_params import AutomationCreateParams as AutomationCreateParams +from .automation_delete_params import AutomationDeleteParams as AutomationDeleteParams +from .automation_update_params import AutomationUpdateParams as AutomationUpdateParams from .editor_retrieve_response import EditorRetrieveResponse as EditorRetrieveResponse from .environment_start_params import EnvironmentStartParams as EnvironmentStartParams from .environment_usage_record import EnvironmentUsageRecord as EnvironmentUsageRecord @@ -164,6 +176,7 @@ from .prebuild_create_response import PrebuildCreateResponse as PrebuildCreateResponse from .prebuild_retrieve_params import PrebuildRetrieveParams as PrebuildRetrieveParams from .runner_retrieve_response import RunnerRetrieveResponse as RunnerRetrieveResponse +from .workflow_trigger_context import WorkflowTriggerContext as WorkflowTriggerContext from .account_retrieve_response import AccountRetrieveResponse as AccountRetrieveResponse from .agent_list_prompts_params import AgentListPromptsParams as AgentListPromptsParams from .editor_resolve_url_params import EditorResolveURLParams as EditorResolveURLParams @@ -176,9 +189,13 @@ from .recommended_editors_param import RecommendedEditorsParam as RecommendedEditorsParam from .secret_get_value_response import SecretGetValueResponse as SecretGetValueResponse from .user_set_suspended_params import UserSetSuspendedParams as UserSetSuspendedParams +from .workflow_execution_action import WorkflowExecutionAction as WorkflowExecutionAction from .agent_create_prompt_params import AgentCreatePromptParams as AgentCreatePromptParams from .agent_delete_prompt_params import AgentDeletePromptParams as AgentDeletePromptParams from .agent_update_prompt_params import AgentUpdatePromptParams as AgentUpdatePromptParams +from .automation_create_response import AutomationCreateResponse as AutomationCreateResponse +from .automation_retrieve_params import AutomationRetrieveParams as AutomationRetrieveParams +from .automation_update_response import AutomationUpdateResponse as AutomationUpdateResponse from .error_report_errors_params import ErrorReportErrorsParams as ErrorReportErrorsParams from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams from .organization_delete_params import OrganizationDeleteParams as OrganizationDeleteParams @@ -201,6 +218,7 @@ from .agent_retrieve_prompt_params import AgentRetrievePromptParams as AgentRetrievePromptParams from .agent_start_execution_params import AgentStartExecutionParams as AgentStartExecutionParams from .agent_update_prompt_response import AgentUpdatePromptResponse as AgentUpdatePromptResponse +from .automation_retrieve_response import AutomationRetrieveResponse as AutomationRetrieveResponse from .environment_unarchive_params import EnvironmentUnarchiveParams as EnvironmentUnarchiveParams from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams from .kernel_controls_config_param import KernelControlsConfigParam as KernelControlsConfigParam @@ -223,6 +241,7 @@ from .identity_get_id_token_response import IdentityGetIDTokenResponse as IdentityGetIDTokenResponse from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse from .project_prebuild_configuration import ProjectPrebuildConfiguration as ProjectPrebuildConfiguration +from .workflow_trigger_context_param import WorkflowTriggerContextParam as WorkflowTriggerContextParam from .agent_retrieve_execution_params import AgentRetrieveExecutionParams as AgentRetrieveExecutionParams from .prebuild_list_warm_pools_params import PrebuildListWarmPoolsParams as PrebuildListWarmPoolsParams from .runner_create_logs_token_params import RunnerCreateLogsTokenParams as RunnerCreateLogsTokenParams @@ -235,6 +254,8 @@ from .prebuild_delete_warm_pool_params import PrebuildDeleteWarmPoolParams as PrebuildDeleteWarmPoolParams from .prebuild_update_warm_pool_params import PrebuildUpdateWarmPoolParams as PrebuildUpdateWarmPoolParams from .agent_retrieve_execution_response import AgentRetrieveExecutionResponse as AgentRetrieveExecutionResponse +from .automation_list_executions_params import AutomationListExecutionsParams as AutomationListExecutionsParams +from .automation_start_execution_params import AutomationStartExecutionParams as AutomationStartExecutionParams from .environment_activity_signal_param import EnvironmentActivitySignalParam as EnvironmentActivitySignalParam from .prebuild_create_logs_token_params import PrebuildCreateLogsTokenParams as PrebuildCreateLogsTokenParams from .runner_create_logs_token_response import RunnerCreateLogsTokenResponse as RunnerCreateLogsTokenResponse @@ -242,14 +263,17 @@ from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse from .runner_search_repositories_params import RunnerSearchRepositoriesParams as RunnerSearchRepositoriesParams from .account_get_sso_login_url_response import AccountGetSSOLoginURLResponse as AccountGetSSOLoginURLResponse +from .automation_cancel_execution_params import AutomationCancelExecutionParams as AutomationCancelExecutionParams from .prebuild_create_warm_pool_response import PrebuildCreateWarmPoolResponse as PrebuildCreateWarmPoolResponse from .prebuild_retrieve_warm_pool_params import PrebuildRetrieveWarmPoolParams as PrebuildRetrieveWarmPoolParams from .prebuild_update_warm_pool_response import PrebuildUpdateWarmPoolResponse as PrebuildUpdateWarmPoolResponse from .user_get_authenticated_user_params import UserGetAuthenticatedUserParams as UserGetAuthenticatedUserParams from .account_list_login_providers_params import AccountListLoginProvidersParams as AccountListLoginProvidersParams +from .automation_start_execution_response import AutomationStartExecutionResponse as AutomationStartExecutionResponse from .prebuild_create_logs_token_response import PrebuildCreateLogsTokenResponse as PrebuildCreateLogsTokenResponse from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse from .runner_search_repositories_response import RunnerSearchRepositoriesResponse as RunnerSearchRepositoriesResponse +from .automation_retrieve_execution_params import AutomationRetrieveExecutionParams as AutomationRetrieveExecutionParams from .environment_create_logs_token_params import EnvironmentCreateLogsTokenParams as EnvironmentCreateLogsTokenParams from .prebuild_retrieve_warm_pool_response import PrebuildRetrieveWarmPoolResponse as PrebuildRetrieveWarmPoolResponse from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam as ProjectPrebuildConfigurationParam @@ -258,6 +282,9 @@ from .runner_check_repository_access_params import ( RunnerCheckRepositoryAccessParams as RunnerCheckRepositoryAccessParams, ) +from .automation_retrieve_execution_response import ( + AutomationRetrieveExecutionResponse as AutomationRetrieveExecutionResponse, +) from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, ) @@ -273,18 +300,33 @@ from .runner_check_repository_access_response import ( RunnerCheckRepositoryAccessResponse as RunnerCheckRepositoryAccessResponse, ) +from .automation_list_execution_actions_params import ( + AutomationListExecutionActionsParams as AutomationListExecutionActionsParams, +) +from .automation_list_execution_outputs_params import ( + AutomationListExecutionOutputsParams as AutomationListExecutionOutputsParams, +) from .environment_create_from_project_response import ( EnvironmentCreateFromProjectResponse as EnvironmentCreateFromProjectResponse, ) from .project_create_from_environment_response import ( ProjectCreateFromEnvironmentResponse as ProjectCreateFromEnvironmentResponse, ) +from .automation_cancel_execution_action_params import ( + AutomationCancelExecutionActionParams as AutomationCancelExecutionActionParams, +) from .account_list_joinable_organizations_params import ( AccountListJoinableOrganizationsParams as AccountListJoinableOrganizationsParams, ) +from .automation_list_execution_outputs_response import ( + AutomationListExecutionOutputsResponse as AutomationListExecutionOutputsResponse, +) from .identity_get_authenticated_identity_params import ( IdentityGetAuthenticatedIdentityParams as IdentityGetAuthenticatedIdentityParams, ) +from .automation_retrieve_execution_action_params import ( + AutomationRetrieveExecutionActionParams as AutomationRetrieveExecutionActionParams, +) from .environment_create_environment_token_params import ( EnvironmentCreateEnvironmentTokenParams as EnvironmentCreateEnvironmentTokenParams, ) @@ -294,6 +336,9 @@ from .identity_get_authenticated_identity_response import ( IdentityGetAuthenticatedIdentityResponse as IdentityGetAuthenticatedIdentityResponse, ) +from .automation_retrieve_execution_action_response import ( + AutomationRetrieveExecutionActionResponse as AutomationRetrieveExecutionActionResponse, +) from .environment_create_environment_token_response import ( EnvironmentCreateEnvironmentTokenResponse as EnvironmentCreateEnvironmentTokenResponse, ) diff --git a/src/gitpod/types/automation_cancel_execution_action_params.py b/src/gitpod/types/automation_cancel_execution_action_params.py new file mode 100644 index 00000000..0a072c29 --- /dev/null +++ b/src/gitpod/types/automation_cancel_execution_action_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AutomationCancelExecutionActionParams"] + + +class AutomationCancelExecutionActionParams(TypedDict, total=False): + workflow_execution_action_id: Annotated[str, PropertyInfo(alias="workflowExecutionActionId")] diff --git a/src/gitpod/types/automation_cancel_execution_params.py b/src/gitpod/types/automation_cancel_execution_params.py new file mode 100644 index 00000000..7f2517cf --- /dev/null +++ b/src/gitpod/types/automation_cancel_execution_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AutomationCancelExecutionParams"] + + +class AutomationCancelExecutionParams(TypedDict, total=False): + workflow_execution_id: Annotated[str, PropertyInfo(alias="workflowExecutionId")] diff --git a/src/gitpod/types/automation_create_params.py b/src/gitpod/types/automation_create_params.py new file mode 100644 index 00000000..cb8ade23 --- /dev/null +++ b/src/gitpod/types/automation_create_params.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Required, TypedDict + +from .shared_params.subject import Subject +from .workflow_action_param import WorkflowActionParam +from .workflow_trigger_param import WorkflowTriggerParam + +__all__ = ["AutomationCreateParams"] + + +class AutomationCreateParams(TypedDict, total=False): + action: Required[WorkflowActionParam] + """WorkflowAction defines the actions to be executed in a workflow.""" + + description: str + """Description must be at most 500 characters: + + ``` + size(this) <= 500 + ``` + """ + + executor: Optional[Subject] + """Optional executor for the workflow. + + If not provided, defaults to the creator. Must be either the caller themselves + or a service account. + """ + + name: str + """Name must be between 1 and 80 characters: + + ``` + size(this) >= 1 && size(this) <= 80 + ``` + """ + + report: WorkflowActionParam + """WorkflowAction defines the actions to be executed in a workflow.""" + + triggers: Iterable[WorkflowTriggerParam] + """Automation must have between 1 and 10 triggers: + + ``` + size(this) >= 1 && size(this) <= 10 + ``` + """ diff --git a/src/gitpod/types/automation_create_response.py b/src/gitpod/types/automation_create_response.py new file mode 100644 index 00000000..a9c9c67f --- /dev/null +++ b/src/gitpod/types/automation_create_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .workflow import Workflow + +__all__ = ["AutomationCreateResponse"] + + +class AutomationCreateResponse(BaseModel): + workflow: Optional[Workflow] = None + """Workflow represents a workflow configuration.""" diff --git a/src/gitpod/types/automation_delete_params.py b/src/gitpod/types/automation_delete_params.py new file mode 100644 index 00000000..77bcd804 --- /dev/null +++ b/src/gitpod/types/automation_delete_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AutomationDeleteParams"] + + +class AutomationDeleteParams(TypedDict, total=False): + force: bool + """ + force indicates whether to immediately delete the workflow and all related + resources. When true, performs cascading deletion of: + + - All workflow executions + - All workflow execution actions + - All environments created by workflow actions + - All agent executions created by workflow actions + - The workflow itself When false (default), marks workflow executions for + deletion and relies on background reconciliation to clean up resources. + """ + + workflow_id: Annotated[str, PropertyInfo(alias="workflowId")] diff --git a/src/gitpod/types/automation_list_execution_actions_params.py b/src/gitpod/types/automation_list_execution_actions_params.py new file mode 100644 index 00000000..d0d34298 --- /dev/null +++ b/src/gitpod/types/automation_list_execution_actions_params.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = ["AutomationListExecutionActionsParams", "Filter", "Pagination"] + + +class AutomationListExecutionActionsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + + +class Filter(TypedDict, total=False): + phases: List[ + Literal[ + "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED", + "WORKFLOW_EXECUTION_ACTION_PHASE_PENDING", + "WORKFLOW_EXECUTION_ACTION_PHASE_RUNNING", + "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPING", + "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPED", + "WORKFLOW_EXECUTION_ACTION_PHASE_DELETING", + "WORKFLOW_EXECUTION_ACTION_PHASE_DELETED", + "WORKFLOW_EXECUTION_ACTION_PHASE_DONE", + ] + ] + + workflow_execution_action_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="workflowExecutionActionIds")] + + workflow_execution_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="workflowExecutionIds")] + + workflow_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="workflowIds")] + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/automation_list_execution_outputs_params.py b/src/gitpod/types/automation_list_execution_outputs_params.py new file mode 100644 index 00000000..da53d870 --- /dev/null +++ b/src/gitpod/types/automation_list_execution_outputs_params.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = ["AutomationListExecutionOutputsParams", "Filter", "Pagination"] + + +class AutomationListExecutionOutputsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + + +class Filter(TypedDict, total=False): + workflow_execution_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="workflowExecutionIds")] + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/automation_list_execution_outputs_response.py b/src/gitpod/types/automation_list_execution_outputs_response.py new file mode 100644 index 00000000..3a3bc69e --- /dev/null +++ b/src/gitpod/types/automation_list_execution_outputs_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AutomationListExecutionOutputsResponse", "Values"] + + +class Values(BaseModel): + bool_value: Optional[bool] = FieldInfo(alias="boolValue", default=None) + + float_value: Optional[float] = FieldInfo(alias="floatValue", default=None) + + int_value: Optional[str] = FieldInfo(alias="intValue", default=None) + + string_value: Optional[str] = FieldInfo(alias="stringValue", default=None) + + +class AutomationListExecutionOutputsResponse(BaseModel): + action_id: Optional[str] = FieldInfo(alias="actionId", default=None) + + values: Optional[Dict[str, Values]] = None diff --git a/src/gitpod/types/automation_list_executions_params.py b/src/gitpod/types/automation_list_executions_params.py new file mode 100644 index 00000000..dab6e801 --- /dev/null +++ b/src/gitpod/types/automation_list_executions_params.py @@ -0,0 +1,74 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo +from .shared_params.sort import Sort + +__all__ = ["AutomationListExecutionsParams", "Filter", "Pagination"] + + +class AutomationListExecutionsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + + sort: Sort + """sort specifies the order of results. + + When unspecified, results are sorted by operational priority (running first, + then failed, then completed, then others). Supported sort fields: startedAt, + finishedAt, createdAt. + """ + + +class Filter(TypedDict, total=False): + has_failed_actions: Annotated[Optional[bool], PropertyInfo(alias="hasFailedActions")] + + search: str + """ + search performs case-insensitive search across workflow execution ID and trigger + type + """ + + status_phases: Annotated[ + List[ + Literal[ + "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED", + "WORKFLOW_EXECUTION_PHASE_PENDING", + "WORKFLOW_EXECUTION_PHASE_RUNNING", + "WORKFLOW_EXECUTION_PHASE_STOPPING", + "WORKFLOW_EXECUTION_PHASE_STOPPED", + "WORKFLOW_EXECUTION_PHASE_DELETING", + "WORKFLOW_EXECUTION_PHASE_DELETED", + "WORKFLOW_EXECUTION_PHASE_COMPLETED", + ] + ], + PropertyInfo(alias="statusPhases"), + ] + + workflow_execution_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="workflowExecutionIds")] + + workflow_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="workflowIds")] + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/automation_list_params.py b/src/gitpod/types/automation_list_params.py new file mode 100644 index 00000000..40b3a3d4 --- /dev/null +++ b/src/gitpod/types/automation_list_params.py @@ -0,0 +1,69 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = ["AutomationListParams", "Filter", "Pagination"] + + +class AutomationListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + + +class Filter(TypedDict, total=False): + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] + """creator_ids filters workflows by creator user IDs""" + + search: str + """ + search performs case-insensitive search across workflow name, description, and + ID + """ + + status_phases: Annotated[ + List[ + Literal[ + "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED", + "WORKFLOW_EXECUTION_PHASE_PENDING", + "WORKFLOW_EXECUTION_PHASE_RUNNING", + "WORKFLOW_EXECUTION_PHASE_STOPPING", + "WORKFLOW_EXECUTION_PHASE_STOPPED", + "WORKFLOW_EXECUTION_PHASE_DELETING", + "WORKFLOW_EXECUTION_PHASE_DELETED", + "WORKFLOW_EXECUTION_PHASE_COMPLETED", + ] + ], + PropertyInfo(alias="statusPhases"), + ] + """ + status_phases filters workflows by the phase of their latest execution. Only + workflows whose most recent execution matches one of the specified phases are + returned. + """ + + workflow_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="workflowIds")] + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/automation_retrieve_execution_action_params.py b/src/gitpod/types/automation_retrieve_execution_action_params.py new file mode 100644 index 00000000..bbf73594 --- /dev/null +++ b/src/gitpod/types/automation_retrieve_execution_action_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AutomationRetrieveExecutionActionParams"] + + +class AutomationRetrieveExecutionActionParams(TypedDict, total=False): + workflow_execution_action_id: Annotated[str, PropertyInfo(alias="workflowExecutionActionId")] diff --git a/src/gitpod/types/automation_retrieve_execution_action_response.py b/src/gitpod/types/automation_retrieve_execution_action_response.py new file mode 100644 index 00000000..77e79a09 --- /dev/null +++ b/src/gitpod/types/automation_retrieve_execution_action_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .workflow_execution_action import WorkflowExecutionAction + +__all__ = ["AutomationRetrieveExecutionActionResponse"] + + +class AutomationRetrieveExecutionActionResponse(BaseModel): + workflow_execution_action: Optional[WorkflowExecutionAction] = FieldInfo( + alias="workflowExecutionAction", default=None + ) + """WorkflowExecutionAction represents a workflow execution action instance.""" diff --git a/src/gitpod/types/automation_retrieve_execution_params.py b/src/gitpod/types/automation_retrieve_execution_params.py new file mode 100644 index 00000000..b32314e0 --- /dev/null +++ b/src/gitpod/types/automation_retrieve_execution_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AutomationRetrieveExecutionParams"] + + +class AutomationRetrieveExecutionParams(TypedDict, total=False): + workflow_execution_id: Annotated[str, PropertyInfo(alias="workflowExecutionId")] diff --git a/src/gitpod/types/automation_retrieve_execution_response.py b/src/gitpod/types/automation_retrieve_execution_response.py new file mode 100644 index 00000000..7b936a47 --- /dev/null +++ b/src/gitpod/types/automation_retrieve_execution_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .workflow_execution import WorkflowExecution + +__all__ = ["AutomationRetrieveExecutionResponse"] + + +class AutomationRetrieveExecutionResponse(BaseModel): + workflow_execution: Optional[WorkflowExecution] = FieldInfo(alias="workflowExecution", default=None) + """WorkflowExecution represents a workflow execution instance.""" diff --git a/src/gitpod/types/automation_retrieve_params.py b/src/gitpod/types/automation_retrieve_params.py new file mode 100644 index 00000000..4d17a5cc --- /dev/null +++ b/src/gitpod/types/automation_retrieve_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AutomationRetrieveParams"] + + +class AutomationRetrieveParams(TypedDict, total=False): + workflow_id: Annotated[str, PropertyInfo(alias="workflowId")] diff --git a/src/gitpod/types/automation_retrieve_response.py b/src/gitpod/types/automation_retrieve_response.py new file mode 100644 index 00000000..bdfd185f --- /dev/null +++ b/src/gitpod/types/automation_retrieve_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .workflow import Workflow + +__all__ = ["AutomationRetrieveResponse"] + + +class AutomationRetrieveResponse(BaseModel): + workflow: Optional[Workflow] = None + """Workflow represents a workflow configuration.""" diff --git a/src/gitpod/types/automation_start_execution_params.py b/src/gitpod/types/automation_start_execution_params.py new file mode 100644 index 00000000..376b26ed --- /dev/null +++ b/src/gitpod/types/automation_start_execution_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .workflow_trigger_context_param import WorkflowTriggerContextParam + +__all__ = ["AutomationStartExecutionParams"] + + +class AutomationStartExecutionParams(TypedDict, total=False): + context_override: Annotated[Optional[WorkflowTriggerContextParam], PropertyInfo(alias="contextOverride")] + """ + Optional context override for the execution. When provided, replaces the + workflow's default trigger context. User must have appropriate permissions on + the overridden resources. Supports Projects, Repositories, and Agent context + types. FromTrigger context type is not supported for manual overrides. + """ + + parameters: Dict[str, str] + """ + Parameters to substitute into workflow steps using Go template syntax. Use + {{ .Parameters.key_name }} in templatable fields (task.command, agent.prompt, + pull*request.title/description/branch, trigger context agent.prompt). Keys must + match pattern ^[a-zA-Z*][a-zA-Z0-9_]\\**$ Maximum 10 parameters allowed. Empty map + is treated as no parameters provided. + """ + + workflow_id: Annotated[str, PropertyInfo(alias="workflowId")] diff --git a/src/gitpod/types/automation_start_execution_response.py b/src/gitpod/types/automation_start_execution_response.py new file mode 100644 index 00000000..6e8938a8 --- /dev/null +++ b/src/gitpod/types/automation_start_execution_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .workflow_execution import WorkflowExecution + +__all__ = ["AutomationStartExecutionResponse"] + + +class AutomationStartExecutionResponse(BaseModel): + workflow_execution: Optional[WorkflowExecution] = FieldInfo(alias="workflowExecution", default=None) + """WorkflowExecution represents a workflow execution instance.""" diff --git a/src/gitpod/types/automation_update_params.py b/src/gitpod/types/automation_update_params.py new file mode 100644 index 00000000..175e84a6 --- /dev/null +++ b/src/gitpod/types/automation_update_params.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .shared_params.subject import Subject +from .workflow_action_param import WorkflowActionParam +from .workflow_trigger_param import WorkflowTriggerParam + +__all__ = ["AutomationUpdateParams"] + + +class AutomationUpdateParams(TypedDict, total=False): + action: Optional[WorkflowActionParam] + """WorkflowAction defines the actions to be executed in a workflow.""" + + description: Optional[str] + """Description must be at most 500 characters: + + ``` + size(this) <= 500 + ``` + """ + + executor: Optional[Subject] + + name: Optional[str] + """Name must be between 1 and 80 characters: + + ``` + size(this) >= 1 && size(this) <= 80 + ``` + """ + + report: Optional[WorkflowActionParam] + """WorkflowAction defines the actions to be executed in a workflow.""" + + triggers: Iterable[WorkflowTriggerParam] + """Automation can have at most 10 triggers: + + ``` + size(this) <= 10 + ``` + """ + + workflow_id: Annotated[str, PropertyInfo(alias="workflowId")] diff --git a/src/gitpod/types/automation_update_response.py b/src/gitpod/types/automation_update_response.py new file mode 100644 index 00000000..d024fedb --- /dev/null +++ b/src/gitpod/types/automation_update_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .workflow import Workflow + +__all__ = ["AutomationUpdateResponse"] + + +class AutomationUpdateResponse(BaseModel): + workflow: Optional[Workflow] = None + """Workflow represents a workflow configuration.""" diff --git a/src/gitpod/types/workflow.py b/src/gitpod/types/workflow.py new file mode 100644 index 00000000..6d0e5cc9 --- /dev/null +++ b/src/gitpod/types/workflow.py @@ -0,0 +1,236 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject +from .workflow_action import WorkflowAction +from .workflow_trigger import WorkflowTrigger + +__all__ = ["Workflow", "Metadata", "Spec"] + + +class Metadata(BaseModel): + """WorkflowMetadata contains workflow metadata.""" + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[Subject] = None + + description: Optional[str] = None + + executor: Optional[Subject] = None + + name: Optional[str] = None + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class Spec(BaseModel): + action: Optional[WorkflowAction] = None + """WorkflowAction defines the actions to be executed in a workflow.""" + + report: Optional[WorkflowAction] = None + """WorkflowAction defines the actions to be executed in a workflow.""" + + triggers: Optional[List[WorkflowTrigger]] = None + + +class Workflow(BaseModel): + """Workflow represents a workflow configuration.""" + + id: Optional[str] = None + + metadata: Optional[Metadata] = None + """WorkflowMetadata contains workflow metadata.""" + + spec: Optional[Spec] = None + + webhook_url: Optional[str] = FieldInfo(alias="webhookUrl", default=None) + """ + Webhook URL for triggering this workflow via HTTP POST Format: + {base_url}/workflows/{workflow_id}/webhooks + """ diff --git a/src/gitpod/types/workflow_action.py b/src/gitpod/types/workflow_action.py new file mode 100644 index 00000000..d0b4e903 --- /dev/null +++ b/src/gitpod/types/workflow_action.py @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .workflow_step import WorkflowStep + +__all__ = ["WorkflowAction", "Limits", "LimitsPerExecution"] + + +class LimitsPerExecution(BaseModel): + """PerExecution defines limits per execution action.""" + + max_time: Optional[str] = FieldInfo(alias="maxTime", default=None) + """ + Maximum time allowed for a single execution action. Use standard duration format + (e.g., "30m" for 30 minutes, "2h" for 2 hours). + """ + + +class Limits(BaseModel): + """ + Limits defines execution limits for workflow actions. + Concurrent actions limit cannot exceed total actions limit: + ``` + this.max_parallel <= this.max_total + ``` + """ + + max_parallel: Optional[int] = FieldInfo(alias="maxParallel", default=None) + """Maximum parallel actions must be between 1 and 25: + + ``` + this >= 1 && this <= 25 + ``` + """ + + max_total: Optional[int] = FieldInfo(alias="maxTotal", default=None) + """Maximum total actions must be between 1 and 100: + + ``` + this >= 1 && this <= 100 + ``` + """ + + per_execution: Optional[LimitsPerExecution] = FieldInfo(alias="perExecution", default=None) + """PerExecution defines limits per execution action.""" + + +class WorkflowAction(BaseModel): + """WorkflowAction defines the actions to be executed in a workflow.""" + + limits: Limits + """ + Limits defines execution limits for workflow actions. Concurrent actions limit + cannot exceed total actions limit: + + ``` + this.max_parallel <= this.max_total + ``` + """ + + steps: Optional[List[WorkflowStep]] = None + """Automation must have between 1 and 50 steps: + + ``` + size(this) >= 1 && size(this) <= 50 + ``` + """ diff --git a/src/gitpod/types/workflow_action_param.py b/src/gitpod/types/workflow_action_param.py new file mode 100644 index 00000000..f6464ab3 --- /dev/null +++ b/src/gitpod/types/workflow_action_param.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo +from .workflow_step_param import WorkflowStepParam + +__all__ = ["WorkflowActionParam", "Limits", "LimitsPerExecution"] + + +class LimitsPerExecution(TypedDict, total=False): + """PerExecution defines limits per execution action.""" + + max_time: Annotated[str, PropertyInfo(alias="maxTime")] + """ + Maximum time allowed for a single execution action. Use standard duration format + (e.g., "30m" for 30 minutes, "2h" for 2 hours). + """ + + +class Limits(TypedDict, total=False): + """ + Limits defines execution limits for workflow actions. + Concurrent actions limit cannot exceed total actions limit: + ``` + this.max_parallel <= this.max_total + ``` + """ + + max_parallel: Annotated[int, PropertyInfo(alias="maxParallel")] + """Maximum parallel actions must be between 1 and 25: + + ``` + this >= 1 && this <= 25 + ``` + """ + + max_total: Annotated[int, PropertyInfo(alias="maxTotal")] + """Maximum total actions must be between 1 and 100: + + ``` + this >= 1 && this <= 100 + ``` + """ + + per_execution: Annotated[LimitsPerExecution, PropertyInfo(alias="perExecution")] + """PerExecution defines limits per execution action.""" + + +class WorkflowActionParam(TypedDict, total=False): + """WorkflowAction defines the actions to be executed in a workflow.""" + + limits: Required[Limits] + """ + Limits defines execution limits for workflow actions. Concurrent actions limit + cannot exceed total actions limit: + + ``` + this.max_parallel <= this.max_total + ``` + """ + + steps: Iterable[WorkflowStepParam] + """Automation must have between 1 and 50 steps: + + ``` + size(this) >= 1 && size(this) <= 50 + ``` + """ diff --git a/src/gitpod/types/workflow_execution.py b/src/gitpod/types/workflow_execution.py new file mode 100644 index 00000000..5608014a --- /dev/null +++ b/src/gitpod/types/workflow_execution.py @@ -0,0 +1,560 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.state import State +from .shared.subject import Subject +from .workflow_action import WorkflowAction +from .workflow_trigger_context import WorkflowTriggerContext + +__all__ = [ + "WorkflowExecution", + "Metadata", + "Spec", + "SpecTrigger", + "SpecTriggerPullRequest", + "SpecTriggerPullRequestRepository", + "SpecTriggerTime", + "Status", + "StatusFailure", + "StatusFailureRetry", + "StatusWarning", + "StatusWarningRetry", +] + + +class Metadata(BaseModel): + """WorkflowExecutionMetadata contains workflow execution metadata.""" + + creator: Optional[Subject] = None + + executor: Optional[Subject] = None + + finished_at: Optional[datetime] = FieldInfo(alias="finishedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + workflow_id: Optional[str] = FieldInfo(alias="workflowId", default=None) + + +class SpecTriggerPullRequestRepository(BaseModel): + """Repository information""" + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + + host: Optional[str] = None + + name: Optional[str] = None + + owner: Optional[str] = None + + +class SpecTriggerPullRequest(BaseModel): + """ + PullRequest represents pull request metadata from source control systems. + This message is used across workflow triggers, executions, and agent contexts + to maintain consistent PR information throughout the system. + """ + + id: Optional[str] = None + """Unique identifier from the source system (e.g., "123" for GitHub PR #123)""" + + author: Optional[str] = None + """Author name as provided by the SCM system""" + + draft: Optional[bool] = None + """Whether this is a draft pull request""" + + from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None) + """Source branch name (the branch being merged from)""" + + repository: Optional[SpecTriggerPullRequestRepository] = None + """Repository information""" + + state: Optional[State] = None + """Current state of the pull request""" + + title: Optional[str] = None + """Pull request title""" + + to_branch: Optional[str] = FieldInfo(alias="toBranch", default=None) + """Target branch name (the branch being merged into)""" + + url: Optional[str] = None + """Pull request URL (e.g., "https://github.com/owner/repo/pull/123")""" + + +class SpecTriggerTime(BaseModel): + """Time trigger - just the timestamp when it was triggered""" + + triggered_at: Optional[datetime] = FieldInfo(alias="triggeredAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + +class SpecTrigger(BaseModel): + """WorkflowExecutionTrigger represents a workflow execution trigger instance.""" + + context: WorkflowTriggerContext + """ + Context from the workflow trigger - copied at execution time for immutability. + This allows the reconciler to create actions without fetching the workflow + definition. + """ + + manual: Optional[object] = None + """Manual trigger - empty message since no additional data needed""" + + pull_request: Optional[SpecTriggerPullRequest] = FieldInfo(alias="pullRequest", default=None) + """ + PullRequest represents pull request metadata from source control systems. This + message is used across workflow triggers, executions, and agent contexts to + maintain consistent PR information throughout the system. + """ + + time: Optional[SpecTriggerTime] = None + """Time trigger - just the timestamp when it was triggered""" + + +class Spec(BaseModel): + """WorkflowExecutionSpec contains the specification used for this execution.""" + + action: Optional[WorkflowAction] = None + """WorkflowAction defines the actions to be executed in a workflow.""" + + report: Optional[WorkflowAction] = None + """WorkflowAction defines the actions to be executed in a workflow.""" + + trigger: Optional[SpecTrigger] = None + """WorkflowExecutionTrigger represents a workflow execution trigger instance.""" + + +class StatusFailureRetry(BaseModel): + """Retry configuration. If not set, the error is considered non-retriable.""" + + retriable: Optional[bool] = None + """Whether the error is retriable.""" + + retry_after: Optional[str] = FieldInfo(alias="retryAfter", default=None) + """ + Suggested duration to wait before retrying. Only meaningful when retriable is + true. + """ + + +class StatusFailure(BaseModel): + """ + WorkflowError provides structured error information for workflow failures. + This enables the reconciler to make informed retry decisions and the frontend + to display actionable error messages. + """ + + code: Optional[ + Literal[ + "WORKFLOW_ERROR_CODE_UNSPECIFIED", + "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR", + "WORKFLOW_ERROR_CODE_AGENT_ERROR", + ] + ] = None + """Error code identifying the type of error.""" + + message: Optional[str] = None + """Human-readable error message.""" + + meta: Optional[Dict[str, str]] = None + """Additional metadata about the error. Common keys include: + + - environment_id: ID of the environment + - task_id: ID of the task + - service_id: ID of the service + - workflow_id: ID of the workflow + - workflow_execution_id: ID of the workflow execution + """ + + reason: Optional[str] = None + """ + Reason explaining why the error occurred. Examples: "not_found", "stopped", + "deleted", "creation_failed", "start_failed" + """ + + retry: Optional[StatusFailureRetry] = None + """Retry configuration. If not set, the error is considered non-retriable.""" + + +class StatusWarningRetry(BaseModel): + """Retry configuration. If not set, the error is considered non-retriable.""" + + retriable: Optional[bool] = None + """Whether the error is retriable.""" + + retry_after: Optional[str] = FieldInfo(alias="retryAfter", default=None) + """ + Suggested duration to wait before retrying. Only meaningful when retriable is + true. + """ + + +class StatusWarning(BaseModel): + """ + WorkflowError provides structured error information for workflow failures. + This enables the reconciler to make informed retry decisions and the frontend + to display actionable error messages. + """ + + code: Optional[ + Literal[ + "WORKFLOW_ERROR_CODE_UNSPECIFIED", + "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR", + "WORKFLOW_ERROR_CODE_AGENT_ERROR", + ] + ] = None + """Error code identifying the type of error.""" + + message: Optional[str] = None + """Human-readable error message.""" + + meta: Optional[Dict[str, str]] = None + """Additional metadata about the error. Common keys include: + + - environment_id: ID of the environment + - task_id: ID of the task + - service_id: ID of the service + - workflow_id: ID of the workflow + - workflow_execution_id: ID of the workflow execution + """ + + reason: Optional[str] = None + """ + Reason explaining why the error occurred. Examples: "not_found", "stopped", + "deleted", "creation_failed", "start_failed" + """ + + retry: Optional[StatusWarningRetry] = None + """Retry configuration. If not set, the error is considered non-retriable.""" + + +class Status(BaseModel): + """WorkflowExecutionStatus contains the current status of a workflow execution.""" + + done_action_count: Optional[int] = FieldInfo(alias="doneActionCount", default=None) + + failed_action_count: Optional[int] = FieldInfo(alias="failedActionCount", default=None) + + failures: Optional[List[StatusFailure]] = None + """ + Structured failures that caused the workflow execution to fail. Provides + detailed error codes, messages, and retry information. + """ + + pending_action_count: Optional[int] = FieldInfo(alias="pendingActionCount", default=None) + + phase: Optional[ + Literal[ + "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED", + "WORKFLOW_EXECUTION_PHASE_PENDING", + "WORKFLOW_EXECUTION_PHASE_RUNNING", + "WORKFLOW_EXECUTION_PHASE_STOPPING", + "WORKFLOW_EXECUTION_PHASE_STOPPED", + "WORKFLOW_EXECUTION_PHASE_DELETING", + "WORKFLOW_EXECUTION_PHASE_DELETED", + "WORKFLOW_EXECUTION_PHASE_COMPLETED", + ] + ] = None + + running_action_count: Optional[int] = FieldInfo(alias="runningActionCount", default=None) + + stopped_action_count: Optional[int] = FieldInfo(alias="stoppedActionCount", default=None) + + warnings: Optional[List[StatusWarning]] = None + """ + Structured warnings about the workflow execution. Provides detailed warning + codes and messages. + """ + + +class WorkflowExecution(BaseModel): + """WorkflowExecution represents a workflow execution instance.""" + + id: Optional[str] = None + + metadata: Optional[Metadata] = None + """WorkflowExecutionMetadata contains workflow execution metadata.""" + + spec: Optional[Spec] = None + """WorkflowExecutionSpec contains the specification used for this execution.""" + + status: Optional[Status] = None + """WorkflowExecutionStatus contains the current status of a workflow execution.""" diff --git a/src/gitpod/types/workflow_execution_action.py b/src/gitpod/types/workflow_execution_action.py new file mode 100644 index 00000000..e7eb6454 --- /dev/null +++ b/src/gitpod/types/workflow_execution_action.py @@ -0,0 +1,682 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .workflow_step import WorkflowStep +from .agent_code_context import AgentCodeContext + +__all__ = [ + "WorkflowExecutionAction", + "Metadata", + "Spec", + "SpecLimits", + "Status", + "StatusFailure", + "StatusFailureRetry", + "StatusStepStatus", + "StatusStepStatusError", + "StatusStepStatusErrorRetry", + "StatusWarning", + "StatusWarningRetry", +] + + +class Metadata(BaseModel): + """WorkflowExecutionActionMetadata contains workflow execution action metadata.""" + + action_name: Optional[str] = FieldInfo(alias="actionName", default=None) + """ + Human-readable name for this action based on its context. Examples: + "gitpod-io/gitpod-next" for repository context, "My Project" for project + context. Will be empty string for actions created before this field was added. + """ + + finished_at: Optional[datetime] = FieldInfo(alias="finishedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + workflow_execution_id: Optional[str] = FieldInfo(alias="workflowExecutionId", default=None) + + workflow_id: Optional[str] = FieldInfo(alias="workflowId", default=None) + + +class SpecLimits(BaseModel): + """PerExecution defines limits per execution action.""" + + max_time: Optional[str] = FieldInfo(alias="maxTime", default=None) + """ + Maximum time allowed for a single execution action. Use standard duration format + (e.g., "30m" for 30 minutes, "2h" for 2 hours). + """ + + +class Spec(BaseModel): + """ + WorkflowExecutionActionSpec contains the specification for this execution action. + """ + + context: Optional[AgentCodeContext] = None + """ + Context for the execution action - specifies where and how the action executes. + This is resolved from the workflow trigger context and contains the specific + project, repository, or agent context for this execution instance. + """ + + limits: Optional[SpecLimits] = None + """PerExecution defines limits per execution action.""" + + +class StatusFailureRetry(BaseModel): + """Retry configuration. If not set, the error is considered non-retriable.""" + + retriable: Optional[bool] = None + """Whether the error is retriable.""" + + retry_after: Optional[str] = FieldInfo(alias="retryAfter", default=None) + """ + Suggested duration to wait before retrying. Only meaningful when retriable is + true. + """ + + +class StatusFailure(BaseModel): + """ + WorkflowError provides structured error information for workflow failures. + This enables the reconciler to make informed retry decisions and the frontend + to display actionable error messages. + """ + + code: Optional[ + Literal[ + "WORKFLOW_ERROR_CODE_UNSPECIFIED", + "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR", + "WORKFLOW_ERROR_CODE_AGENT_ERROR", + ] + ] = None + """Error code identifying the type of error.""" + + message: Optional[str] = None + """Human-readable error message.""" + + meta: Optional[Dict[str, str]] = None + """Additional metadata about the error. Common keys include: + + - environment_id: ID of the environment + - task_id: ID of the task + - service_id: ID of the service + - workflow_id: ID of the workflow + - workflow_execution_id: ID of the workflow execution + """ + + reason: Optional[str] = None + """ + Reason explaining why the error occurred. Examples: "not_found", "stopped", + "deleted", "creation_failed", "start_failed" + """ + + retry: Optional[StatusFailureRetry] = None + """Retry configuration. If not set, the error is considered non-retriable.""" + + +class StatusStepStatusErrorRetry(BaseModel): + """Retry configuration. If not set, the error is considered non-retriable.""" + + retriable: Optional[bool] = None + """Whether the error is retriable.""" + + retry_after: Optional[str] = FieldInfo(alias="retryAfter", default=None) + """ + Suggested duration to wait before retrying. Only meaningful when retriable is + true. + """ + + +class StatusStepStatusError(BaseModel): + """ + Structured error that caused the step to fail. + Provides detailed error code, message, and retry information. + """ + + code: Optional[ + Literal[ + "WORKFLOW_ERROR_CODE_UNSPECIFIED", + "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR", + "WORKFLOW_ERROR_CODE_AGENT_ERROR", + ] + ] = None + """Error code identifying the type of error.""" + + message: Optional[str] = None + """Human-readable error message.""" + + meta: Optional[Dict[str, str]] = None + """Additional metadata about the error. Common keys include: + + - environment_id: ID of the environment + - task_id: ID of the task + - service_id: ID of the service + - workflow_id: ID of the workflow + - workflow_execution_id: ID of the workflow execution + """ + + reason: Optional[str] = None + """ + Reason explaining why the error occurred. Examples: "not_found", "stopped", + "deleted", "creation_failed", "start_failed" + """ + + retry: Optional[StatusStepStatusErrorRetry] = None + """Retry configuration. If not set, the error is considered non-retriable.""" + + +class StatusStepStatus(BaseModel): + """ + WorkflowExecutionActionStepStatus represents the status of a single step execution. + """ + + error: Optional[StatusStepStatusError] = None + """ + Structured error that caused the step to fail. Provides detailed error code, + message, and retry information. + """ + + finished_at: Optional[datetime] = FieldInfo(alias="finishedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + phase: Optional[ + Literal[ + "STEP_PHASE_UNSPECIFIED", + "STEP_PHASE_PENDING", + "STEP_PHASE_RUNNING", + "STEP_PHASE_DONE", + "STEP_PHASE_FAILED", + "STEP_PHASE_CANCELLED", + ] + ] = None + + started_at: Optional[datetime] = FieldInfo(alias="startedAt", default=None) + """ + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at nanosecond + resolution. The count is relative to an epoch at UTC midnight on January 1, + 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a + [24-hour linear smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + zero-padded to two digits each. The fractional seconds, which can go up to 9 + digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and + other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to + this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + Joda Time's + [`ISODateTimeFormat.dateTime()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + step: Optional[WorkflowStep] = None + """ + The step definition captured at execution time for immutability. This ensures + the UI shows the correct step even if the workflow definition changes. + """ + + step_index: Optional[int] = FieldInfo(alias="stepIndex", default=None) + """Index of the step in the workflow action steps array""" + + +class StatusWarningRetry(BaseModel): + """Retry configuration. If not set, the error is considered non-retriable.""" + + retriable: Optional[bool] = None + """Whether the error is retriable.""" + + retry_after: Optional[str] = FieldInfo(alias="retryAfter", default=None) + """ + Suggested duration to wait before retrying. Only meaningful when retriable is + true. + """ + + +class StatusWarning(BaseModel): + """ + WorkflowError provides structured error information for workflow failures. + This enables the reconciler to make informed retry decisions and the frontend + to display actionable error messages. + """ + + code: Optional[ + Literal[ + "WORKFLOW_ERROR_CODE_UNSPECIFIED", + "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR", + "WORKFLOW_ERROR_CODE_AGENT_ERROR", + ] + ] = None + """Error code identifying the type of error.""" + + message: Optional[str] = None + """Human-readable error message.""" + + meta: Optional[Dict[str, str]] = None + """Additional metadata about the error. Common keys include: + + - environment_id: ID of the environment + - task_id: ID of the task + - service_id: ID of the service + - workflow_id: ID of the workflow + - workflow_execution_id: ID of the workflow execution + """ + + reason: Optional[str] = None + """ + Reason explaining why the error occurred. Examples: "not_found", "stopped", + "deleted", "creation_failed", "start_failed" + """ + + retry: Optional[StatusWarningRetry] = None + """Retry configuration. If not set, the error is considered non-retriable.""" + + +class Status(BaseModel): + """ + WorkflowExecutionActionStatus contains the current status of a workflow execution action. + """ + + agent_execution_id: Optional[str] = FieldInfo(alias="agentExecutionId", default=None) + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + failures: Optional[List[StatusFailure]] = None + """ + Structured failures that caused the workflow execution action to fail. Provides + detailed error codes, messages, and retry information. + """ + + phase: Optional[ + Literal[ + "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED", + "WORKFLOW_EXECUTION_ACTION_PHASE_PENDING", + "WORKFLOW_EXECUTION_ACTION_PHASE_RUNNING", + "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPING", + "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPED", + "WORKFLOW_EXECUTION_ACTION_PHASE_DELETING", + "WORKFLOW_EXECUTION_ACTION_PHASE_DELETED", + "WORKFLOW_EXECUTION_ACTION_PHASE_DONE", + ] + ] = None + """WorkflowExecutionActionPhase defines the phases of workflow execution action.""" + + step_statuses: Optional[List[StatusStepStatus]] = FieldInfo(alias="stepStatuses", default=None) + """Step-level progress tracking""" + + warnings: Optional[List[StatusWarning]] = None + """ + Structured warnings about the workflow execution action. Provides detailed + warning codes and messages. + """ + + +class WorkflowExecutionAction(BaseModel): + """WorkflowExecutionAction represents a workflow execution action instance.""" + + id: Optional[str] = None + + metadata: Optional[Metadata] = None + """WorkflowExecutionActionMetadata contains workflow execution action metadata.""" + + spec: Optional[Spec] = None + """ + WorkflowExecutionActionSpec contains the specification for this execution + action. + """ + + status: Optional[Status] = None + """ + WorkflowExecutionActionStatus contains the current status of a workflow + execution action. + """ diff --git a/src/gitpod/types/workflow_step.py b/src/gitpod/types/workflow_step.py new file mode 100644 index 00000000..c1871e0e --- /dev/null +++ b/src/gitpod/types/workflow_step.py @@ -0,0 +1,92 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["WorkflowStep", "Agent", "PullRequest", "Report", "ReportOutput", "Task"] + + +class Agent(BaseModel): + """WorkflowAgentStep represents an agent step that executes with a prompt.""" + + prompt: Optional[str] = None + """Prompt must be between 1 and 20,000 characters: + + ``` + size(this) >= 1 && size(this) <= 20000 + ``` + """ + + +class PullRequest(BaseModel): + """WorkflowPullRequestStep represents a pull request creation step.""" + + branch: Optional[str] = None + """Branch name must be between 1 and 255 characters: + + ``` + size(this) >= 1 && size(this) <= 255 + ``` + """ + + description: Optional[str] = None + """Description must be at most 20,000 characters: + + ``` + size(this) <= 20000 + ``` + """ + + draft: Optional[bool] = None + + title: Optional[str] = None + """Title must be between 1 and 500 characters: + + ``` + size(this) >= 1 && size(this) <= 500 + ``` + """ + + +class ReportOutput: + pass + + +class Report(BaseModel): + outputs: Optional[List[ReportOutput]] = None + """Report must have at least one output: + + ``` + size(this) >= 1 + ``` + """ + + +class Task(BaseModel): + """WorkflowTaskStep represents a task step that executes a command.""" + + command: Optional[str] = None + """Command must be between 1 and 20,000 characters: + + ``` + size(this) >= 1 && size(this) <= 20000 + ``` + """ + + +class WorkflowStep(BaseModel): + """WorkflowStep defines a single step in a workflow action.""" + + agent: Optional[Agent] = None + """WorkflowAgentStep represents an agent step that executes with a prompt.""" + + pull_request: Optional[PullRequest] = FieldInfo(alias="pullRequest", default=None) + """WorkflowPullRequestStep represents a pull request creation step.""" + + report: Optional[Report] = None + + task: Optional[Task] = None + """WorkflowTaskStep represents a task step that executes a command.""" diff --git a/src/gitpod/types/workflow_step_param.py b/src/gitpod/types/workflow_step_param.py new file mode 100644 index 00000000..35365d5b --- /dev/null +++ b/src/gitpod/types/workflow_step_param.py @@ -0,0 +1,93 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["WorkflowStepParam", "Agent", "PullRequest", "Report", "ReportOutput", "Task"] + + +class Agent(TypedDict, total=False): + """WorkflowAgentStep represents an agent step that executes with a prompt.""" + + prompt: str + """Prompt must be between 1 and 20,000 characters: + + ``` + size(this) >= 1 && size(this) <= 20000 + ``` + """ + + +class PullRequest(TypedDict, total=False): + """WorkflowPullRequestStep represents a pull request creation step.""" + + branch: str + """Branch name must be between 1 and 255 characters: + + ``` + size(this) >= 1 && size(this) <= 255 + ``` + """ + + description: str + """Description must be at most 20,000 characters: + + ``` + size(this) <= 20000 + ``` + """ + + draft: bool + + title: str + """Title must be between 1 and 500 characters: + + ``` + size(this) >= 1 && size(this) <= 500 + ``` + """ + + +class ReportOutput(total=False): + pass + + +class Report(TypedDict, total=False): + outputs: Iterable[ReportOutput] + """Report must have at least one output: + + ``` + size(this) >= 1 + ``` + """ + + +class Task(TypedDict, total=False): + """WorkflowTaskStep represents a task step that executes a command.""" + + command: str + """Command must be between 1 and 20,000 characters: + + ``` + size(this) >= 1 && size(this) <= 20000 + ``` + """ + + +class WorkflowStepParam(TypedDict, total=False): + """WorkflowStep defines a single step in a workflow action.""" + + agent: Agent + """WorkflowAgentStep represents an agent step that executes with a prompt.""" + + pull_request: Annotated[PullRequest, PropertyInfo(alias="pullRequest")] + """WorkflowPullRequestStep represents a pull request creation step.""" + + report: Report + + task: Task + """WorkflowTaskStep represents a task step that executes a command.""" diff --git a/src/gitpod/types/workflow_trigger.py b/src/gitpod/types/workflow_trigger.py new file mode 100644 index 00000000..4b044761 --- /dev/null +++ b/src/gitpod/types/workflow_trigger.py @@ -0,0 +1,105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .workflow_trigger_context import WorkflowTriggerContext + +__all__ = ["WorkflowTrigger", "PullRequest", "Time"] + + +class PullRequest(BaseModel): + """ + Pull request trigger - executed when specified PR events occur. + Only triggers for PRs in repositories matching the trigger context. + """ + + events: Optional[ + List[ + Literal[ + "PULL_REQUEST_EVENT_UNSPECIFIED", + "PULL_REQUEST_EVENT_OPENED", + "PULL_REQUEST_EVENT_UPDATED", + "PULL_REQUEST_EVENT_APPROVED", + "PULL_REQUEST_EVENT_MERGED", + "PULL_REQUEST_EVENT_CLOSED", + "PULL_REQUEST_EVENT_READY_FOR_REVIEW", + ] + ] + ] = None + + webhook_id: Optional[str] = FieldInfo(alias="webhookId", default=None) + """ + webhook_id is the optional ID of a webhook that this trigger is bound to. When + set, the trigger will be activated when the webhook receives events. This allows + multiple workflows to share a single webhook endpoint. + """ + + +class Time(BaseModel): + """ + Time-based trigger - executed automatically based on cron schedule. + Uses standard cron expression format (minute hour day month weekday). + """ + + cron_expression: Optional[str] = FieldInfo(alias="cronExpression", default=None) + """Cron expression must be between 1 and 100 characters: + + ``` + size(this) >= 1 && size(this) <= 100 + ``` + """ + + +class WorkflowTrigger(BaseModel): + """WorkflowTrigger defines when a workflow should be executed. + + Each trigger type defines a specific condition that will cause the workflow to execute: + - Manual: Triggered explicitly by user action via StartWorkflow RPC + - Time: Triggered automatically based on cron schedule + - PullRequest: Triggered automatically when specified PR events occur + + Trigger Semantics: + - Each trigger instance can create multiple workflow executions + - Multiple triggers of the same workflow can fire simultaneously + - Each trigger execution is independent and tracked separately + - Triggers are evaluated in the context specified by WorkflowTriggerContext + """ + + context: WorkflowTriggerContext + """WorkflowTriggerContext defines the context in which a workflow should run. + + Context determines where and how the workflow executes: + + - Projects: Execute in specific project environments + - Repositories: Execute in environments created from repository URLs + - Agent: Execute in agent-managed environments with custom prompts + - FromTrigger: Use context derived from the trigger event (PR-specific) + + Context Usage by Trigger Type: + + - Manual: Can use any context type + - Time: Typically uses Projects or Repositories context + - PullRequest: Can use any context, FromTrigger uses PR repository context + """ + + manual: Optional[object] = None + """ + Manual trigger - executed when StartWorkflow RPC is called. No additional + configuration needed. + """ + + pull_request: Optional[PullRequest] = FieldInfo(alias="pullRequest", default=None) + """ + Pull request trigger - executed when specified PR events occur. Only triggers + for PRs in repositories matching the trigger context. + """ + + time: Optional[Time] = None + """ + Time-based trigger - executed automatically based on cron schedule. Uses + standard cron expression format (minute hour day month weekday). + """ diff --git a/src/gitpod/types/workflow_trigger_context.py b/src/gitpod/types/workflow_trigger_context.py new file mode 100644 index 00000000..6d82400e --- /dev/null +++ b/src/gitpod/types/workflow_trigger_context.py @@ -0,0 +1,130 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "WorkflowTriggerContext", + "Agent", + "Projects", + "Repositories", + "RepositoriesRepoSelector", + "RepositoriesRepositoryURLs", +] + + +class Agent(BaseModel): + """ + Execute workflow in agent-managed environments. + Agent receives the specified prompt and manages execution context. + """ + + prompt: Optional[str] = None + """Agent prompt must be between 1 and 20,000 characters: + + ``` + size(this) >= 1 && size(this) <= 20000 + ``` + """ + + +class Projects(BaseModel): + """ + Execute workflow in specific project environments. + Creates environments for each specified project. + """ + + project_ids: Optional[List[str]] = FieldInfo(alias="projectIds", default=None) + + +class RepositoriesRepoSelector(BaseModel): + """ + RepositorySelector defines how to select repositories for workflow execution. + Combines a search string with an SCM host to identify repositories. + """ + + repo_search_string: Optional[str] = FieldInfo(alias="repoSearchString", default=None) + """ + Search string to match repositories using SCM-specific search patterns. For + GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", + "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM + provider documentation for supported search patterns. + """ + + scm_host: Optional[str] = FieldInfo(alias="scmHost", default=None) + """ + SCM host where the search should be performed (e.g., "github.com", "gitlab.com") + """ + + +class RepositoriesRepositoryURLs(BaseModel): + """ + RepositoryURLs contains a list of explicit repository URLs. + Creates one action per repository URL. + """ + + repo_urls: Optional[List[str]] = FieldInfo(alias="repoUrls", default=None) + + +class Repositories(BaseModel): + """ + Execute workflow in environments created from repository URLs. + Supports both explicit repository URLs and search patterns. + """ + + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + + repo_selector: Optional[RepositoriesRepoSelector] = FieldInfo(alias="repoSelector", default=None) + """ + RepositorySelector defines how to select repositories for workflow execution. + Combines a search string with an SCM host to identify repositories. + """ + + repository_urls: Optional[RepositoriesRepositoryURLs] = FieldInfo(alias="repositoryUrls", default=None) + """ + RepositoryURLs contains a list of explicit repository URLs. Creates one action + per repository URL. + """ + + +class WorkflowTriggerContext(BaseModel): + """WorkflowTriggerContext defines the context in which a workflow should run. + + Context determines where and how the workflow executes: + - Projects: Execute in specific project environments + - Repositories: Execute in environments created from repository URLs + - Agent: Execute in agent-managed environments with custom prompts + - FromTrigger: Use context derived from the trigger event (PR-specific) + + Context Usage by Trigger Type: + - Manual: Can use any context type + - Time: Typically uses Projects or Repositories context + - PullRequest: Can use any context, FromTrigger uses PR repository context + """ + + agent: Optional[Agent] = None + """ + Execute workflow in agent-managed environments. Agent receives the specified + prompt and manages execution context. + """ + + from_trigger: Optional[object] = FieldInfo(alias="fromTrigger", default=None) + """ + Use context derived from the trigger event. Currently only supported for + PullRequest triggers - uses PR repository context. + """ + + projects: Optional[Projects] = None + """ + Execute workflow in specific project environments. Creates environments for each + specified project. + """ + + repositories: Optional[Repositories] = None + """ + Execute workflow in environments created from repository URLs. Supports both + explicit repository URLs and search patterns. + """ diff --git a/src/gitpod/types/workflow_trigger_context_param.py b/src/gitpod/types/workflow_trigger_context_param.py new file mode 100644 index 00000000..4ebb2e49 --- /dev/null +++ b/src/gitpod/types/workflow_trigger_context_param.py @@ -0,0 +1,131 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = [ + "WorkflowTriggerContextParam", + "Agent", + "Projects", + "Repositories", + "RepositoriesRepoSelector", + "RepositoriesRepositoryURLs", +] + + +class Agent(TypedDict, total=False): + """ + Execute workflow in agent-managed environments. + Agent receives the specified prompt and manages execution context. + """ + + prompt: str + """Agent prompt must be between 1 and 20,000 characters: + + ``` + size(this) >= 1 && size(this) <= 20000 + ``` + """ + + +class Projects(TypedDict, total=False): + """ + Execute workflow in specific project environments. + Creates environments for each specified project. + """ + + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] + + +class RepositoriesRepoSelector(TypedDict, total=False): + """ + RepositorySelector defines how to select repositories for workflow execution. + Combines a search string with an SCM host to identify repositories. + """ + + repo_search_string: Annotated[str, PropertyInfo(alias="repoSearchString")] + """ + Search string to match repositories using SCM-specific search patterns. For + GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", + "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM + provider documentation for supported search patterns. + """ + + scm_host: Annotated[str, PropertyInfo(alias="scmHost")] + """ + SCM host where the search should be performed (e.g., "github.com", "gitlab.com") + """ + + +class RepositoriesRepositoryURLs(TypedDict, total=False): + """ + RepositoryURLs contains a list of explicit repository URLs. + Creates one action per repository URL. + """ + + repo_urls: Annotated[SequenceNotStr[str], PropertyInfo(alias="repoUrls")] + + +class Repositories(TypedDict, total=False): + """ + Execute workflow in environments created from repository URLs. + Supports both explicit repository URLs and search patterns. + """ + + environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] + + repo_selector: Annotated[RepositoriesRepoSelector, PropertyInfo(alias="repoSelector")] + """ + RepositorySelector defines how to select repositories for workflow execution. + Combines a search string with an SCM host to identify repositories. + """ + + repository_urls: Annotated[RepositoriesRepositoryURLs, PropertyInfo(alias="repositoryUrls")] + """ + RepositoryURLs contains a list of explicit repository URLs. Creates one action + per repository URL. + """ + + +class WorkflowTriggerContextParam(TypedDict, total=False): + """WorkflowTriggerContext defines the context in which a workflow should run. + + Context determines where and how the workflow executes: + - Projects: Execute in specific project environments + - Repositories: Execute in environments created from repository URLs + - Agent: Execute in agent-managed environments with custom prompts + - FromTrigger: Use context derived from the trigger event (PR-specific) + + Context Usage by Trigger Type: + - Manual: Can use any context type + - Time: Typically uses Projects or Repositories context + - PullRequest: Can use any context, FromTrigger uses PR repository context + """ + + agent: Agent + """ + Execute workflow in agent-managed environments. Agent receives the specified + prompt and manages execution context. + """ + + from_trigger: Annotated[object, PropertyInfo(alias="fromTrigger")] + """ + Use context derived from the trigger event. Currently only supported for + PullRequest triggers - uses PR repository context. + """ + + projects: Projects + """ + Execute workflow in specific project environments. Creates environments for each + specified project. + """ + + repositories: Repositories + """ + Execute workflow in environments created from repository URLs. Supports both + explicit repository URLs and search patterns. + """ diff --git a/src/gitpod/types/workflow_trigger_param.py b/src/gitpod/types/workflow_trigger_param.py new file mode 100644 index 00000000..ed28c9f8 --- /dev/null +++ b/src/gitpod/types/workflow_trigger_param.py @@ -0,0 +1,103 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo +from .workflow_trigger_context_param import WorkflowTriggerContextParam + +__all__ = ["WorkflowTriggerParam", "PullRequest", "Time"] + + +class PullRequest(TypedDict, total=False): + """ + Pull request trigger - executed when specified PR events occur. + Only triggers for PRs in repositories matching the trigger context. + """ + + events: List[ + Literal[ + "PULL_REQUEST_EVENT_UNSPECIFIED", + "PULL_REQUEST_EVENT_OPENED", + "PULL_REQUEST_EVENT_UPDATED", + "PULL_REQUEST_EVENT_APPROVED", + "PULL_REQUEST_EVENT_MERGED", + "PULL_REQUEST_EVENT_CLOSED", + "PULL_REQUEST_EVENT_READY_FOR_REVIEW", + ] + ] + + webhook_id: Annotated[Optional[str], PropertyInfo(alias="webhookId")] + """ + webhook_id is the optional ID of a webhook that this trigger is bound to. When + set, the trigger will be activated when the webhook receives events. This allows + multiple workflows to share a single webhook endpoint. + """ + + +class Time(TypedDict, total=False): + """ + Time-based trigger - executed automatically based on cron schedule. + Uses standard cron expression format (minute hour day month weekday). + """ + + cron_expression: Annotated[str, PropertyInfo(alias="cronExpression")] + """Cron expression must be between 1 and 100 characters: + + ``` + size(this) >= 1 && size(this) <= 100 + ``` + """ + + +class WorkflowTriggerParam(TypedDict, total=False): + """WorkflowTrigger defines when a workflow should be executed. + + Each trigger type defines a specific condition that will cause the workflow to execute: + - Manual: Triggered explicitly by user action via StartWorkflow RPC + - Time: Triggered automatically based on cron schedule + - PullRequest: Triggered automatically when specified PR events occur + + Trigger Semantics: + - Each trigger instance can create multiple workflow executions + - Multiple triggers of the same workflow can fire simultaneously + - Each trigger execution is independent and tracked separately + - Triggers are evaluated in the context specified by WorkflowTriggerContext + """ + + context: Required[WorkflowTriggerContextParam] + """WorkflowTriggerContext defines the context in which a workflow should run. + + Context determines where and how the workflow executes: + + - Projects: Execute in specific project environments + - Repositories: Execute in environments created from repository URLs + - Agent: Execute in agent-managed environments with custom prompts + - FromTrigger: Use context derived from the trigger event (PR-specific) + + Context Usage by Trigger Type: + + - Manual: Can use any context type + - Time: Typically uses Projects or Repositories context + - PullRequest: Can use any context, FromTrigger uses PR repository context + """ + + manual: object + """ + Manual trigger - executed when StartWorkflow RPC is called. No additional + configuration needed. + """ + + pull_request: Annotated[PullRequest, PropertyInfo(alias="pullRequest")] + """ + Pull request trigger - executed when specified PR events occur. Only triggers + for PRs in repositories matching the trigger context. + """ + + time: Time + """ + Time-based trigger - executed automatically based on cron schedule. Uses + standard cron expression format (minute hour day month weekday). + """ diff --git a/tests/api_resources/test_automations.py b/tests/api_resources/test_automations.py new file mode 100644 index 00000000..e9a5fa93 --- /dev/null +++ b/tests/api_resources/test_automations.py @@ -0,0 +1,1549 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + Workflow, + WorkflowExecution, + WorkflowExecutionAction, + AutomationCreateResponse, + AutomationUpdateResponse, + AutomationRetrieveResponse, + AutomationStartExecutionResponse, + AutomationRetrieveExecutionResponse, + AutomationListExecutionOutputsResponse, + AutomationRetrieveExecutionActionResponse, +) +from gitpod.pagination import ( + SyncOutputsPage, + AsyncOutputsPage, + SyncWorkflowsPage, + AsyncWorkflowsPage, + SyncWorkflowExecutionsPage, + AsyncWorkflowExecutionsPage, + SyncWorkflowExecutionActionsPage, + AsyncWorkflowExecutionActionsPage, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAutomations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + automation = client.automations.create( + action={"limits": {}}, + ) + assert_matches_type(AutomationCreateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.create( + action={ + "limits": { + "max_parallel": 0, + "max_total": 0, + "per_execution": {"max_time": "+9125115.360s"}, + }, + "steps": [ + { + "agent": {"prompt": "prompt"}, + "pull_request": { + "branch": "branch", + "description": "description", + "draft": True, + "title": "title", + }, + "report": { + "outputs": [ + { + "acceptance_criteria": "acceptanceCriteria", + "boolean": {}, + "command": "command", + "float": { + "max": 0, + "min": 0, + }, + "integer": { + "max": 0, + "min": 0, + }, + "key": "key", + "prompt": "prompt", + "string": {"pattern": "pattern"}, + "title": "title", + } + ] + }, + "task": {"command": "command"}, + } + ], + }, + description="description", + executor={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + name="name", + report={ + "limits": { + "max_parallel": 0, + "max_total": 0, + "per_execution": {"max_time": "+9125115.360s"}, + }, + "steps": [ + { + "agent": {"prompt": "prompt"}, + "pull_request": { + "branch": "branch", + "description": "description", + "draft": True, + "title": "title", + }, + "report": { + "outputs": [ + { + "acceptance_criteria": "acceptanceCriteria", + "boolean": {}, + "command": "command", + "float": { + "max": 0, + "min": 0, + }, + "integer": { + "max": 0, + "min": 0, + }, + "key": "key", + "prompt": "prompt", + "string": {"pattern": "pattern"}, + "title": "title", + } + ] + }, + "task": {"command": "command"}, + } + ], + }, + triggers=[ + { + "context": { + "agent": {"prompt": "prompt"}, + "from_trigger": {}, + "projects": {"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + "repositories": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "repo_selector": { + "repo_search_string": "x", + "scm_host": "x", + }, + "repository_urls": {"repo_urls": ["x"]}, + }, + }, + "manual": {}, + "pull_request": { + "events": ["PULL_REQUEST_EVENT_UNSPECIFIED"], + "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, + "time": {"cron_expression": "cronExpression"}, + } + ], + ) + assert_matches_type(AutomationCreateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.create( + action={"limits": {}}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(AutomationCreateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.create( + action={"limits": {}}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(AutomationCreateResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + automation = client.automations.retrieve() + assert_matches_type(AutomationRetrieveResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.retrieve( + workflow_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AutomationRetrieveResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(AutomationRetrieveResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(AutomationRetrieveResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_update(self, client: Gitpod) -> None: + automation = client.automations.update() + assert_matches_type(AutomationUpdateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.update( + action={ + "limits": { + "max_parallel": 0, + "max_total": 0, + "per_execution": {"max_time": "+9125115.360s"}, + }, + "steps": [ + { + "agent": {"prompt": "prompt"}, + "pull_request": { + "branch": "branch", + "description": "description", + "draft": True, + "title": "title", + }, + "report": { + "outputs": [ + { + "acceptance_criteria": "acceptanceCriteria", + "boolean": {}, + "command": "command", + "float": { + "max": 0, + "min": 0, + }, + "integer": { + "max": 0, + "min": 0, + }, + "key": "key", + "prompt": "prompt", + "string": {"pattern": "pattern"}, + "title": "title", + } + ] + }, + "task": {"command": "command"}, + } + ], + }, + description="description", + executor={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + name="name", + report={ + "limits": { + "max_parallel": 0, + "max_total": 0, + "per_execution": {"max_time": "+9125115.360s"}, + }, + "steps": [ + { + "agent": {"prompt": "prompt"}, + "pull_request": { + "branch": "branch", + "description": "description", + "draft": True, + "title": "title", + }, + "report": { + "outputs": [ + { + "acceptance_criteria": "acceptanceCriteria", + "boolean": {}, + "command": "command", + "float": { + "max": 0, + "min": 0, + }, + "integer": { + "max": 0, + "min": 0, + }, + "key": "key", + "prompt": "prompt", + "string": {"pattern": "pattern"}, + "title": "title", + } + ] + }, + "task": {"command": "command"}, + } + ], + }, + triggers=[ + { + "context": { + "agent": {"prompt": "prompt"}, + "from_trigger": {}, + "projects": {"project_ids": ["new-project-id"]}, + "repositories": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "repo_selector": { + "repo_search_string": "x", + "scm_host": "x", + }, + "repository_urls": {"repo_urls": ["x"]}, + }, + }, + "manual": {}, + "pull_request": { + "events": ["PULL_REQUEST_EVENT_UNSPECIFIED"], + "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, + "time": {"cron_expression": "cronExpression"}, + } + ], + workflow_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AutomationUpdateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(AutomationUpdateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(AutomationUpdateResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + automation = client.automations.list() + assert_matches_type(SyncWorkflowsPage[Workflow], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.list( + token="token", + page_size=0, + filter={ + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "search": "search", + "status_phases": ["WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"], + "workflow_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncWorkflowsPage[Workflow], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(SyncWorkflowsPage[Workflow], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(SyncWorkflowsPage[Workflow], automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + automation = client.automations.delete() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.delete( + force=True, + workflow_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(object, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_cancel_execution(self, client: Gitpod) -> None: + automation = client.automations.cancel_execution() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_cancel_execution_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.cancel_execution( + workflow_execution_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_cancel_execution(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.cancel_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_cancel_execution(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.cancel_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(object, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_cancel_execution_action(self, client: Gitpod) -> None: + automation = client.automations.cancel_execution_action() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_cancel_execution_action_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.cancel_execution_action( + workflow_execution_action_id="a1b2c3d4-5e6f-7890-abcd-ef1234567890", + ) + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_cancel_execution_action(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.cancel_execution_action() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_cancel_execution_action(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.cancel_execution_action() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(object, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_execution_actions(self, client: Gitpod) -> None: + automation = client.automations.list_execution_actions() + assert_matches_type(SyncWorkflowExecutionActionsPage[WorkflowExecutionAction], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_execution_actions_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.list_execution_actions( + token="token", + page_size=0, + filter={ + "phases": ["WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED"], + "workflow_execution_action_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "workflow_execution_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], + "workflow_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(SyncWorkflowExecutionActionsPage[WorkflowExecutionAction], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_list_execution_actions(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.list_execution_actions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(SyncWorkflowExecutionActionsPage[WorkflowExecutionAction], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_list_execution_actions(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.list_execution_actions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type( + SyncWorkflowExecutionActionsPage[WorkflowExecutionAction], automation, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_execution_outputs(self, client: Gitpod) -> None: + automation = client.automations.list_execution_outputs() + assert_matches_type(SyncOutputsPage[AutomationListExecutionOutputsResponse], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_execution_outputs_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.list_execution_outputs( + token="token", + page_size=0, + filter={"workflow_execution_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"]}, + pagination={ + "token": "token", + "page_size": 50, + }, + ) + assert_matches_type(SyncOutputsPage[AutomationListExecutionOutputsResponse], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_list_execution_outputs(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.list_execution_outputs() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(SyncOutputsPage[AutomationListExecutionOutputsResponse], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_list_execution_outputs(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.list_execution_outputs() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(SyncOutputsPage[AutomationListExecutionOutputsResponse], automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_executions(self, client: Gitpod) -> None: + automation = client.automations.list_executions() + assert_matches_type(SyncWorkflowExecutionsPage[WorkflowExecution], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_executions_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.list_executions( + token="token", + page_size=0, + filter={ + "has_failed_actions": True, + "search": "search", + "status_phases": ["WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"], + "workflow_execution_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "workflow_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"], + }, + pagination={ + "token": "token", + "page_size": 20, + }, + sort={ + "field": "field", + "order": "SORT_ORDER_UNSPECIFIED", + }, + ) + assert_matches_type(SyncWorkflowExecutionsPage[WorkflowExecution], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_list_executions(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.list_executions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(SyncWorkflowExecutionsPage[WorkflowExecution], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_list_executions(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.list_executions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(SyncWorkflowExecutionsPage[WorkflowExecution], automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_execution(self, client: Gitpod) -> None: + automation = client.automations.retrieve_execution() + assert_matches_type(AutomationRetrieveExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_execution_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.retrieve_execution( + workflow_execution_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(AutomationRetrieveExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_retrieve_execution(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.retrieve_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(AutomationRetrieveExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_retrieve_execution(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.retrieve_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(AutomationRetrieveExecutionResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_execution_action(self, client: Gitpod) -> None: + automation = client.automations.retrieve_execution_action() + assert_matches_type(AutomationRetrieveExecutionActionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_execution_action_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.retrieve_execution_action( + workflow_execution_action_id="a1b2c3d4-5e6f-7890-abcd-ef1234567890", + ) + assert_matches_type(AutomationRetrieveExecutionActionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_retrieve_execution_action(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.retrieve_execution_action() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(AutomationRetrieveExecutionActionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_retrieve_execution_action(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.retrieve_execution_action() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(AutomationRetrieveExecutionActionResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_start_execution(self, client: Gitpod) -> None: + automation = client.automations.start_execution() + assert_matches_type(AutomationStartExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: + automation = client.automations.start_execution( + context_override={ + "agent": {"prompt": "prompt"}, + "from_trigger": {}, + "projects": {"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + "repositories": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "repo_selector": { + "repo_search_string": "x", + "scm_host": "x", + }, + "repository_urls": {"repo_urls": ["x"]}, + }, + }, + parameters={"foo": "string"}, + workflow_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AutomationStartExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_start_execution(self, client: Gitpod) -> None: + response = client.automations.with_raw_response.start_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = response.parse() + assert_matches_type(AutomationStartExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_start_execution(self, client: Gitpod) -> None: + with client.automations.with_streaming_response.start_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = response.parse() + assert_matches_type(AutomationStartExecutionResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncAutomations: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.create( + action={"limits": {}}, + ) + assert_matches_type(AutomationCreateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.create( + action={ + "limits": { + "max_parallel": 0, + "max_total": 0, + "per_execution": {"max_time": "+9125115.360s"}, + }, + "steps": [ + { + "agent": {"prompt": "prompt"}, + "pull_request": { + "branch": "branch", + "description": "description", + "draft": True, + "title": "title", + }, + "report": { + "outputs": [ + { + "acceptance_criteria": "acceptanceCriteria", + "boolean": {}, + "command": "command", + "float": { + "max": 0, + "min": 0, + }, + "integer": { + "max": 0, + "min": 0, + }, + "key": "key", + "prompt": "prompt", + "string": {"pattern": "pattern"}, + "title": "title", + } + ] + }, + "task": {"command": "command"}, + } + ], + }, + description="description", + executor={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + name="name", + report={ + "limits": { + "max_parallel": 0, + "max_total": 0, + "per_execution": {"max_time": "+9125115.360s"}, + }, + "steps": [ + { + "agent": {"prompt": "prompt"}, + "pull_request": { + "branch": "branch", + "description": "description", + "draft": True, + "title": "title", + }, + "report": { + "outputs": [ + { + "acceptance_criteria": "acceptanceCriteria", + "boolean": {}, + "command": "command", + "float": { + "max": 0, + "min": 0, + }, + "integer": { + "max": 0, + "min": 0, + }, + "key": "key", + "prompt": "prompt", + "string": {"pattern": "pattern"}, + "title": "title", + } + ] + }, + "task": {"command": "command"}, + } + ], + }, + triggers=[ + { + "context": { + "agent": {"prompt": "prompt"}, + "from_trigger": {}, + "projects": {"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + "repositories": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "repo_selector": { + "repo_search_string": "x", + "scm_host": "x", + }, + "repository_urls": {"repo_urls": ["x"]}, + }, + }, + "manual": {}, + "pull_request": { + "events": ["PULL_REQUEST_EVENT_UNSPECIFIED"], + "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, + "time": {"cron_expression": "cronExpression"}, + } + ], + ) + assert_matches_type(AutomationCreateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.create( + action={"limits": {}}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AutomationCreateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.create( + action={"limits": {}}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(AutomationCreateResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.retrieve() + assert_matches_type(AutomationRetrieveResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.retrieve( + workflow_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AutomationRetrieveResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AutomationRetrieveResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(AutomationRetrieveResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.update() + assert_matches_type(AutomationUpdateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.update( + action={ + "limits": { + "max_parallel": 0, + "max_total": 0, + "per_execution": {"max_time": "+9125115.360s"}, + }, + "steps": [ + { + "agent": {"prompt": "prompt"}, + "pull_request": { + "branch": "branch", + "description": "description", + "draft": True, + "title": "title", + }, + "report": { + "outputs": [ + { + "acceptance_criteria": "acceptanceCriteria", + "boolean": {}, + "command": "command", + "float": { + "max": 0, + "min": 0, + }, + "integer": { + "max": 0, + "min": 0, + }, + "key": "key", + "prompt": "prompt", + "string": {"pattern": "pattern"}, + "title": "title", + } + ] + }, + "task": {"command": "command"}, + } + ], + }, + description="description", + executor={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + name="name", + report={ + "limits": { + "max_parallel": 0, + "max_total": 0, + "per_execution": {"max_time": "+9125115.360s"}, + }, + "steps": [ + { + "agent": {"prompt": "prompt"}, + "pull_request": { + "branch": "branch", + "description": "description", + "draft": True, + "title": "title", + }, + "report": { + "outputs": [ + { + "acceptance_criteria": "acceptanceCriteria", + "boolean": {}, + "command": "command", + "float": { + "max": 0, + "min": 0, + }, + "integer": { + "max": 0, + "min": 0, + }, + "key": "key", + "prompt": "prompt", + "string": {"pattern": "pattern"}, + "title": "title", + } + ] + }, + "task": {"command": "command"}, + } + ], + }, + triggers=[ + { + "context": { + "agent": {"prompt": "prompt"}, + "from_trigger": {}, + "projects": {"project_ids": ["new-project-id"]}, + "repositories": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "repo_selector": { + "repo_search_string": "x", + "scm_host": "x", + }, + "repository_urls": {"repo_urls": ["x"]}, + }, + }, + "manual": {}, + "pull_request": { + "events": ["PULL_REQUEST_EVENT_UNSPECIFIED"], + "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, + "time": {"cron_expression": "cronExpression"}, + } + ], + workflow_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AutomationUpdateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AutomationUpdateResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(AutomationUpdateResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.list() + assert_matches_type(AsyncWorkflowsPage[Workflow], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.list( + token="token", + page_size=0, + filter={ + "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "search": "search", + "status_phases": ["WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"], + "workflow_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncWorkflowsPage[Workflow], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AsyncWorkflowsPage[Workflow], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(AsyncWorkflowsPage[Workflow], automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.delete() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.delete( + force=True, + workflow_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(object, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_cancel_execution(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.cancel_execution() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_cancel_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.cancel_execution( + workflow_execution_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_cancel_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.cancel_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_cancel_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.cancel_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(object, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_cancel_execution_action(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.cancel_execution_action() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_cancel_execution_action_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.cancel_execution_action( + workflow_execution_action_id="a1b2c3d4-5e6f-7890-abcd-ef1234567890", + ) + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_cancel_execution_action(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.cancel_execution_action() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(object, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_cancel_execution_action(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.cancel_execution_action() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(object, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_execution_actions(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.list_execution_actions() + assert_matches_type(AsyncWorkflowExecutionActionsPage[WorkflowExecutionAction], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_execution_actions_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.list_execution_actions( + token="token", + page_size=0, + filter={ + "phases": ["WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED"], + "workflow_execution_action_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "workflow_execution_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], + "workflow_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(AsyncWorkflowExecutionActionsPage[WorkflowExecutionAction], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_list_execution_actions(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.list_execution_actions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AsyncWorkflowExecutionActionsPage[WorkflowExecutionAction], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_list_execution_actions(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.list_execution_actions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type( + AsyncWorkflowExecutionActionsPage[WorkflowExecutionAction], automation, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_execution_outputs(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.list_execution_outputs() + assert_matches_type(AsyncOutputsPage[AutomationListExecutionOutputsResponse], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_execution_outputs_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.list_execution_outputs( + token="token", + page_size=0, + filter={"workflow_execution_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"]}, + pagination={ + "token": "token", + "page_size": 50, + }, + ) + assert_matches_type(AsyncOutputsPage[AutomationListExecutionOutputsResponse], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_list_execution_outputs(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.list_execution_outputs() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AsyncOutputsPage[AutomationListExecutionOutputsResponse], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_list_execution_outputs(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.list_execution_outputs() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(AsyncOutputsPage[AutomationListExecutionOutputsResponse], automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_executions(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.list_executions() + assert_matches_type(AsyncWorkflowExecutionsPage[WorkflowExecution], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_executions_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.list_executions( + token="token", + page_size=0, + filter={ + "has_failed_actions": True, + "search": "search", + "status_phases": ["WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"], + "workflow_execution_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "workflow_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"], + }, + pagination={ + "token": "token", + "page_size": 20, + }, + sort={ + "field": "field", + "order": "SORT_ORDER_UNSPECIFIED", + }, + ) + assert_matches_type(AsyncWorkflowExecutionsPage[WorkflowExecution], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_list_executions(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.list_executions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AsyncWorkflowExecutionsPage[WorkflowExecution], automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_list_executions(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.list_executions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(AsyncWorkflowExecutionsPage[WorkflowExecution], automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_execution(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.retrieve_execution() + assert_matches_type(AutomationRetrieveExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.retrieve_execution( + workflow_execution_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(AutomationRetrieveExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_retrieve_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.retrieve_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AutomationRetrieveExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_retrieve_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.retrieve_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(AutomationRetrieveExecutionResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_execution_action(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.retrieve_execution_action() + assert_matches_type(AutomationRetrieveExecutionActionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_execution_action_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.retrieve_execution_action( + workflow_execution_action_id="a1b2c3d4-5e6f-7890-abcd-ef1234567890", + ) + assert_matches_type(AutomationRetrieveExecutionActionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_retrieve_execution_action(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.retrieve_execution_action() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AutomationRetrieveExecutionActionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_retrieve_execution_action(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.retrieve_execution_action() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(AutomationRetrieveExecutionActionResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_start_execution(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.start_execution() + assert_matches_type(AutomationStartExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_start_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + automation = await async_client.automations.start_execution( + context_override={ + "agent": {"prompt": "prompt"}, + "from_trigger": {}, + "projects": {"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + "repositories": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "repo_selector": { + "repo_search_string": "x", + "scm_host": "x", + }, + "repository_urls": {"repo_urls": ["x"]}, + }, + }, + parameters={"foo": "string"}, + workflow_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(AutomationStartExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_start_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.automations.with_raw_response.start_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + automation = await response.parse() + assert_matches_type(AutomationStartExecutionResponse, automation, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_start_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.automations.with_streaming_response.start_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + automation = await response.parse() + assert_matches_type(AutomationStartExecutionResponse, automation, path=["response"]) + + assert cast(Any, response.is_closed) is True From e2a644cb45f5bcd07c9cc230e8a509181c3db902 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 15:33:21 +0000 Subject: [PATCH 423/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index d281cf1b..b82e7616 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d7e6093517f83ea4606a88899e81565c0f9207614e112b6057679645e0651801.yml -openapi_spec_hash: c4f8786a933b74d658f315ed5587b4bd -config_hash: 8f918c43124691f0ddd95f5fd521960a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f60e1c4938d7e8ac2e873e8638c8da463a9a6e603140fd65759a7d2d47e94ae3.yml +openapi_spec_hash: 2c4f4cc169862fba0759b128ec8108c9 +config_hash: 1e3edbeecb529f712bfaac1b561d91d5 From 7c683a8d7dd44c948de32318d716707a01242334 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 15:56:50 +0000 Subject: [PATCH 424/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b82e7616..0f3de9e3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f60e1c4938d7e8ac2e873e8638c8da463a9a6e603140fd65759a7d2d47e94ae3.yml -openapi_spec_hash: 2c4f4cc169862fba0759b128ec8108c9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a5292b4a022c56637a3b3ec0a490e739e7c140ac417b5e2560a9a86f53a314a6.yml +openapi_spec_hash: 98a28f7fc2f23ecfac4673e35ab5714a config_hash: 1e3edbeecb529f712bfaac1b561d91d5 From 4c469a294567ec8a5487cddb106981e88f3a3cf0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 17:51:42 +0000 Subject: [PATCH 425/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0f3de9e3..55ee9115 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a5292b4a022c56637a3b3ec0a490e739e7c140ac417b5e2560a9a86f53a314a6.yml -openapi_spec_hash: 98a28f7fc2f23ecfac4673e35ab5714a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-088cf9cc6faa9f08d2e43908e6d86bcb58082a5c7696222a78f4e3befe98304d.yml +openapi_spec_hash: 69b777f88daf7c5f9db19f20df19670b config_hash: 1e3edbeecb529f712bfaac1b561d91d5 From ffa0473ff6538a3c1015659eecdebe4cce9c4a7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Mar 2026 15:23:52 +0000 Subject: [PATCH 426/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 55ee9115..137fe16c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-088cf9cc6faa9f08d2e43908e6d86bcb58082a5c7696222a78f4e3befe98304d.yml -openapi_spec_hash: 69b777f88daf7c5f9db19f20df19670b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-81e6dd362ed000dd15cc51a77545a0772d791241380906229b5ba6f2ba265bcb.yml +openapi_spec_hash: 9adc025d621dcefde671682cdd711ec0 config_hash: 1e3edbeecb529f712bfaac1b561d91d5 From 19d519ba592746618597c30650d84ed0ebde3137 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 15 Mar 2026 21:53:59 +0000 Subject: [PATCH 427/505] docs(api): update annotations parameter examples in agents --- .stats.yml | 4 ++-- src/gitpod/resources/agents.py | 8 ++++---- src/gitpod/types/agent_start_execution_params.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 137fe16c..8a91a435 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-81e6dd362ed000dd15cc51a77545a0772d791241380906229b5ba6f2ba265bcb.yml -openapi_spec_hash: 9adc025d621dcefde671682cdd711ec0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-eb2a06fb4bcfb9dc85e08216cdaad259453be5d03dd6cdd0562e147d33a8ff31.yml +openapi_spec_hash: 0d278e84539c7e554d6218666aa3bf41 config_hash: 1e3edbeecb529f712bfaac1b561d91d5 diff --git a/src/gitpod/resources/agents.py b/src/gitpod/resources/agents.py index 4cabe2e8..b5c22f9e 100644 --- a/src/gitpod/resources/agents.py +++ b/src/gitpod/resources/agents.py @@ -581,9 +581,9 @@ def start_execution( ``` Args: - annotations: annotations are key-value pairs for tracking external context (e.g., Linear + annotations: annotations are key-value pairs for tracking external context (e.g., integration session IDs, GitHub issue references). Keys should follow domain/name convention - (e.g., "linear.app/session-id"). + (e.g., "agent-client-session/id"). mode: mode specifies the operational mode for this agent execution If not specified, defaults to AGENT_MODE_EXECUTION @@ -1262,9 +1262,9 @@ async def start_execution( ``` Args: - annotations: annotations are key-value pairs for tracking external context (e.g., Linear + annotations: annotations are key-value pairs for tracking external context (e.g., integration session IDs, GitHub issue references). Keys should follow domain/name convention - (e.g., "linear.app/session-id"). + (e.g., "agent-client-session/id"). mode: mode specifies the operational mode for this agent execution If not specified, defaults to AGENT_MODE_EXECUTION diff --git a/src/gitpod/types/agent_start_execution_params.py b/src/gitpod/types/agent_start_execution_params.py index 699ab8f6..4e3f82b1 100644 --- a/src/gitpod/types/agent_start_execution_params.py +++ b/src/gitpod/types/agent_start_execution_params.py @@ -17,9 +17,9 @@ class AgentStartExecutionParams(TypedDict, total=False): annotations: Dict[str, str] """ - annotations are key-value pairs for tracking external context (e.g., Linear + annotations are key-value pairs for tracking external context (e.g., integration session IDs, GitHub issue references). Keys should follow domain/name convention - (e.g., "linear.app/session-id"). + (e.g., "agent-client-session/id"). """ code_context: Annotated[AgentCodeContextParam, PropertyInfo(alias="codeContext")] From dd789aace32449825ca5c2f9d2f34edcb1bd344d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:58:19 +0000 Subject: [PATCH 428/505] feat(api): add session_ids filter to agents/environments list methods --- .stats.yml | 4 ++-- src/gitpod/types/agent_list_executions_params.py | 6 ++++++ src/gitpod/types/environment_list_params.py | 6 ++++++ tests/api_resources/test_agents.py | 2 ++ tests/api_resources/test_environments.py | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8a91a435..379f637f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-eb2a06fb4bcfb9dc85e08216cdaad259453be5d03dd6cdd0562e147d33a8ff31.yml -openapi_spec_hash: 0d278e84539c7e554d6218666aa3bf41 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dc11159f8832715e5e2f90bd30be75023f98924c9b347ee58140426d98a66451.yml +openapi_spec_hash: 20be193759f39a790f961ff6be44cd22 config_hash: 1e3edbeecb529f712bfaac1b561d91d5 diff --git a/src/gitpod/types/agent_list_executions_params.py b/src/gitpod/types/agent_list_executions_params.py index f01aef28..f139d42c 100644 --- a/src/gitpod/types/agent_list_executions_params.py +++ b/src/gitpod/types/agent_list_executions_params.py @@ -41,6 +41,12 @@ class Filter(TypedDict, total=False): Literal["AGENT_EXECUTION_ROLE_UNSPECIFIED", "AGENT_EXECUTION_ROLE_DEFAULT", "AGENT_EXECUTION_ROLE_WORKFLOW"] ] + session_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="sessionIds")] + """ + session_ids filters the response to only executions belonging to the specified + sessions + """ + status_phases: Annotated[ List[ Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", "PHASE_WAITING_FOR_INPUT", "PHASE_STOPPED"] diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index 0b5d21a1..34eaf938 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -69,6 +69,12 @@ class Filter(TypedDict, total=False): Kinds """ + session_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="sessionIds")] + """ + session_ids filters the response to only environments belonging to the specified + sessions + """ + status_phases: Annotated[List[EnvironmentPhase], PropertyInfo(alias="statusPhases")] """ actual_phases is a list of phases the environment must be in for it to be diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 857f285b..915f0927 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -197,6 +197,7 @@ def test_method_list_executions_with_all_params(self, client: Gitpod) -> None: "environment_ids": ["string"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "roles": ["AGENT_EXECUTION_ROLE_UNSPECIFIED"], + "session_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "status_phases": ["PHASE_UNSPECIFIED"], }, pagination={ @@ -735,6 +736,7 @@ async def test_method_list_executions_with_all_params(self, async_client: AsyncG "environment_ids": ["string"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "roles": ["AGENT_EXECUTION_ROLE_UNSPECIFIED"], + "session_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "status_phases": ["PHASE_UNSPECIFIED"], }, pagination={ diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 5d6ba940..28f68f17 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -296,6 +296,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "roles": ["ENVIRONMENT_ROLE_UNSPECIFIED"], "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "session_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, pagination={ @@ -984,6 +985,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "roles": ["ENVIRONMENT_ROLE_UNSPECIFIED"], "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "session_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, pagination={ From c5f5f645bc33edd57605014ad54c8a770ce8f51a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 12:43:31 +0000 Subject: [PATCH 429/505] feat(api): add update_window field to runner configuration --- .stats.yml | 6 ++-- api.md | 1 + src/gitpod/types/__init__.py | 2 ++ src/gitpod/types/runner_configuration.py | 7 +++++ .../types/runner_configuration_param.py | 7 +++++ src/gitpod/types/runner_update_params.py | 9 ++++++ src/gitpod/types/update_window.py | 28 ++++++++++++++++++ src/gitpod/types/update_window_param.py | 29 +++++++++++++++++++ tests/api_resources/test_runners.py | 16 ++++++++++ 9 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 src/gitpod/types/update_window.py create mode 100644 src/gitpod/types/update_window_param.py diff --git a/.stats.yml b/.stats.yml index 379f637f..7e741617 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dc11159f8832715e5e2f90bd30be75023f98924c9b347ee58140426d98a66451.yml -openapi_spec_hash: 20be193759f39a790f961ff6be44cd22 -config_hash: 1e3edbeecb529f712bfaac1b561d91d5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-9af1d2d8008f6a755a5e8ae29151cd102c698c9fce494b74dd9163a6e48edf4e.yml +openapi_spec_hash: 111508e126ff88904bcb739bc6ceaabd +config_hash: 91b2982c67083dfc3f65e5e27d94e0aa diff --git a/api.md b/api.md index 8c8075ae..fbd4ba42 100644 --- a/api.md +++ b/api.md @@ -682,6 +682,7 @@ from gitpod.types import ( RunnerStatus, RunnerVariant, SearchMode, + UpdateWindow, RunnerCreateResponse, RunnerRetrieveResponse, RunnerCheckAuthenticationForHostResponse, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index aedad4c6..4f9dca65 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -63,6 +63,7 @@ from .prebuild_spec import PrebuildSpec as PrebuildSpec from .project_phase import ProjectPhase as ProjectPhase from .runner_status import RunnerStatus as RunnerStatus +from .update_window import UpdateWindow as UpdateWindow from .workflow_step import WorkflowStep as WorkflowStep from .editor_version import EditorVersion as EditorVersion from .invite_domains import InviteDomains as InviteDomains @@ -117,6 +118,7 @@ from .prebuild_spec_param import PrebuildSpecParam as PrebuildSpecParam from .project_list_params import ProjectListParams as ProjectListParams from .recommended_editors import RecommendedEditors as RecommendedEditors +from .update_window_param import UpdateWindowParam as UpdateWindowParam from .workflow_step_param import WorkflowStepParam as WorkflowStepParam from .environment_metadata import EnvironmentMetadata as EnvironmentMetadata from .event_watch_response import EventWatchResponse as EventWatchResponse diff --git a/src/gitpod/types/runner_configuration.py b/src/gitpod/types/runner_configuration.py index 4e4cf1e6..4c78775b 100644 --- a/src/gitpod/types/runner_configuration.py +++ b/src/gitpod/types/runner_configuration.py @@ -6,6 +6,7 @@ from .._models import BaseModel from .log_level import LogLevel +from .update_window import UpdateWindow from .metrics_configuration import MetricsConfiguration from .runner_release_channel import RunnerReleaseChannel @@ -38,3 +39,9 @@ class RunnerConfiguration(BaseModel): release_channel: Optional[RunnerReleaseChannel] = FieldInfo(alias="releaseChannel", default=None) """The release channel the runner is on""" + + update_window: Optional[UpdateWindow] = FieldInfo(alias="updateWindow", default=None) + """ + update_window defines the daily time window (UTC) during which auto-updates are + allowed. If not set, updates are allowed at any time. + """ diff --git a/src/gitpod/types/runner_configuration_param.py b/src/gitpod/types/runner_configuration_param.py index d29c11fc..d371b114 100644 --- a/src/gitpod/types/runner_configuration_param.py +++ b/src/gitpod/types/runner_configuration_param.py @@ -6,6 +6,7 @@ from .._utils import PropertyInfo from .log_level import LogLevel +from .update_window_param import UpdateWindowParam from .runner_release_channel import RunnerReleaseChannel from .metrics_configuration_param import MetricsConfigurationParam @@ -38,3 +39,9 @@ class RunnerConfigurationParam(TypedDict, total=False): release_channel: Annotated[RunnerReleaseChannel, PropertyInfo(alias="releaseChannel")] """The release channel the runner is on""" + + update_window: Annotated[UpdateWindowParam, PropertyInfo(alias="updateWindow")] + """ + update_window defines the daily time window (UTC) during which auto-updates are + allowed. If not set, updates are allowed at any time. + """ diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index 444e842e..f28ff40d 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -8,6 +8,7 @@ from .._utils import PropertyInfo from .log_level import LogLevel from .runner_phase import RunnerPhase +from .update_window_param import UpdateWindowParam from .runner_release_channel import RunnerReleaseChannel __all__ = ["RunnerUpdateParams", "Spec", "SpecConfiguration", "SpecConfigurationMetrics"] @@ -61,6 +62,14 @@ class SpecConfiguration(TypedDict, total=False): release_channel: Annotated[Optional[RunnerReleaseChannel], PropertyInfo(alias="releaseChannel")] """The release channel the runner is on""" + update_window: Annotated[Optional[UpdateWindowParam], PropertyInfo(alias="updateWindow")] + """ + update_window defines the daily time window (UTC) during which auto-updates are + allowed. start_hour is required. If end_hour is omitted, it defaults to + start_hour + 2. Send an empty UpdateWindow (no start_hour or end_hour) to clear + a custom window and allow updates at any time. + """ + class Spec(TypedDict, total=False): configuration: Optional[SpecConfiguration] diff --git a/src/gitpod/types/update_window.py b/src/gitpod/types/update_window.py new file mode 100644 index 00000000..3ee11657 --- /dev/null +++ b/src/gitpod/types/update_window.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["UpdateWindow"] + + +class UpdateWindow(BaseModel): + """ + UpdateWindow defines a daily time window (UTC) during which auto-updates are allowed. + The window must be at least 2 hours long. + Overnight windows are supported (e.g., start_hour=22, end_hour=4). + """ + + end_hour: Optional[int] = FieldInfo(alias="endHour", default=None) + """ + end_hour is the end of the update window as a UTC hour (0-23). If not set, + defaults to start_hour + 2. + """ + + start_hour: Optional[int] = FieldInfo(alias="startHour", default=None) + """ + start_hour is the beginning of the update window as a UTC hour (0-23). +required + """ diff --git a/src/gitpod/types/update_window_param.py b/src/gitpod/types/update_window_param.py new file mode 100644 index 00000000..30479f93 --- /dev/null +++ b/src/gitpod/types/update_window_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["UpdateWindowParam"] + + +class UpdateWindowParam(TypedDict, total=False): + """ + UpdateWindow defines a daily time window (UTC) during which auto-updates are allowed. + The window must be at least 2 hours long. + Overnight windows are supported (e.g., start_hour=22, end_hour=4). + """ + + end_hour: Annotated[Optional[int], PropertyInfo(alias="endHour")] + """ + end_hour is the end of the update window as a UTC hour (0-23). If not set, + defaults to start_hour + 2. + """ + + start_hour: Annotated[Optional[int], PropertyInfo(alias="startHour")] + """ + start_hour is the beginning of the update window as a UTC hour (0-23). +required + """ diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 9e7ef743..65aa1b3e 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -56,6 +56,10 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: }, "region": "us-west", "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", + "update_window": { + "end_hour": 0, + "start_hour": 0, + }, }, "desired_phase": "RUNNER_PHASE_ACTIVE", "variant": "RUNNER_VARIANT_UNSPECIFIED", @@ -145,6 +149,10 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "username": "username", }, "release_channel": "RUNNER_RELEASE_CHANNEL_LATEST", + "update_window": { + "end_hour": 0, + "start_hour": 0, + }, }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, @@ -555,6 +563,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> }, "region": "us-west", "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", + "update_window": { + "end_hour": 0, + "start_hour": 0, + }, }, "desired_phase": "RUNNER_PHASE_ACTIVE", "variant": "RUNNER_VARIANT_UNSPECIFIED", @@ -644,6 +656,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "username": "username", }, "release_channel": "RUNNER_RELEASE_CHANNEL_LATEST", + "update_window": { + "end_hour": 0, + "start_hour": 0, + }, }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", }, From 954388365a06385200e444c3a1138ff6ea67cd0c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 13:17:52 +0000 Subject: [PATCH 430/505] feat(api): add session_id parameter to environments.create_from_project --- .stats.yml | 4 ++-- src/gitpod/resources/environments/environments.py | 10 ++++++++++ .../types/environment_create_from_project_params.py | 6 ++++++ tests/api_resources/test_environments.py | 2 ++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7e741617..6bc8138e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-9af1d2d8008f6a755a5e8ae29151cd102c698c9fce494b74dd9163a6e48edf4e.yml -openapi_spec_hash: 111508e126ff88904bcb739bc6ceaabd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-055db8fdb0c818654b041a70752ac1e2b8d3625244c81463c722cfd860f684e2.yml +openapi_spec_hash: 7e9ed18957abb39e539f50a9ca3adc73 config_hash: 91b2982c67083dfc3f65e5e27d94e0aa diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index 24d3584e..c8c92434 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -566,6 +566,7 @@ def create_from_project( *, name: Optional[str] | Omit = omit, project_id: str | Omit = omit, + session_id: str | Omit = omit, spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -610,6 +611,9 @@ def create_from_project( name: name is a user-defined identifier for the environment. If not specified, the system will generate a name. + session_id: session_id is the ID of the session this environment belongs to. If empty, a new + session is created implicitly. + spec: Spec is the configuration of the environment that's required for the runner to start the environment Configuration already defined in the Project will override parts of the spec, if set @@ -628,6 +632,7 @@ def create_from_project( { "name": name, "project_id": project_id, + "session_id": session_id, "spec": spec, }, environment_create_from_project_params.EnvironmentCreateFromProjectParams, @@ -1400,6 +1405,7 @@ async def create_from_project( *, name: Optional[str] | Omit = omit, project_id: str | Omit = omit, + session_id: str | Omit = omit, spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1444,6 +1450,9 @@ async def create_from_project( name: name is a user-defined identifier for the environment. If not specified, the system will generate a name. + session_id: session_id is the ID of the session this environment belongs to. If empty, a new + session is created implicitly. + spec: Spec is the configuration of the environment that's required for the runner to start the environment Configuration already defined in the Project will override parts of the spec, if set @@ -1462,6 +1471,7 @@ async def create_from_project( { "name": name, "project_id": project_id, + "session_id": session_id, "spec": spec, }, environment_create_from_project_params.EnvironmentCreateFromProjectParams, diff --git a/src/gitpod/types/environment_create_from_project_params.py b/src/gitpod/types/environment_create_from_project_params.py index 4a26228d..1ad29fd1 100644 --- a/src/gitpod/types/environment_create_from_project_params.py +++ b/src/gitpod/types/environment_create_from_project_params.py @@ -20,6 +20,12 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False): project_id: Annotated[str, PropertyInfo(alias="projectId")] + session_id: Annotated[str, PropertyInfo(alias="sessionId")] + """ + session_id is the ID of the session this environment belongs to. If empty, a new + session is created implicitly. + """ + spec: EnvironmentSpecParam """ Spec is the configuration of the environment that's required for the runner to diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 28f68f17..ce26c6d8 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -411,6 +411,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non environment = client.environments.create_from_project( name="name", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { @@ -1100,6 +1101,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As environment = await async_client.environments.create_from_project( name="name", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", spec={ "admission": "ADMISSION_LEVEL_UNSPECIFIED", "automations_file": { From d3b0b54fee81b9c9077a6841b42367ac1022430b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 16:11:40 +0000 Subject: [PATCH 431/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6bc8138e..71166a9f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-055db8fdb0c818654b041a70752ac1e2b8d3625244c81463c722cfd860f684e2.yml -openapi_spec_hash: 7e9ed18957abb39e539f50a9ca3adc73 -config_hash: 91b2982c67083dfc3f65e5e27d94e0aa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-228aa0f8b440a040117a3e5e2282f857a2cbaf4957bae2c3f04accc653ae42e4.yml +openapi_spec_hash: 2a9a4195f6d6b9397c5d7ff46c18f9bd +config_hash: 1bfdd908308b0bc392edbef83566284c From 4ae5525f51ed3132c7b9e2393a1ed890192ce2b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 17:35:39 +0000 Subject: [PATCH 432/505] fix(pydantic): do not pass `by_alias` unless set --- src/gitpod/_compat.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gitpod/_compat.py b/src/gitpod/_compat.py index 786ff42a..e6690a4f 100644 --- a/src/gitpod/_compat.py +++ b/src/gitpod/_compat.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self, Literal +from typing_extensions import Self, Literal, TypedDict import pydantic from pydantic.fields import FieldInfo @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: return model.model_dump_json(indent=indent) +class _ModelDumpKwargs(TypedDict, total=False): + by_alias: bool + + def model_dump( model: pydantic.BaseModel, *, @@ -142,6 +146,9 @@ def model_dump( by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): + kwargs: _ModelDumpKwargs = {} + if by_alias is not None: + kwargs["by_alias"] = by_alias return model.model_dump( mode=mode, exclude=exclude, @@ -149,7 +156,7 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, - by_alias=by_alias, + **kwargs, ) return cast( "dict[str, Any]", From 8c91abf2f66d2b2351482609a3bd97dd4b8f745c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 19:06:46 +0000 Subject: [PATCH 433/505] fix(deps): bump minimum typing-extensions version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8bc49c47..91c86d31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", + "typing-extensions>=4.14, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", From f748d57eb4b06e52dca2ffe5f5ca7590c2f177c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 19:46:50 +0000 Subject: [PATCH 434/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 71166a9f..1494d4ad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-228aa0f8b440a040117a3e5e2282f857a2cbaf4957bae2c3f04accc653ae42e4.yml -openapi_spec_hash: 2a9a4195f6d6b9397c5d7ff46c18f9bd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cd774a77f01f7c7c0872caf935eab4de8b06811e0a6c17af6da4e642d24aa1a5.yml +openapi_spec_hash: a1c5294457addfc76d9ffc1e65a5125e config_hash: 1bfdd908308b0bc392edbef83566284c From f561e78f9f657a6786ef64d68eea329ffa96ea5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:50:07 +0000 Subject: [PATCH 435/505] chore(internal): tweak CI branches --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b586dc6..65fafcdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' From 164f354d686a661e7142692d445eff8287561ba4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:04:24 +0000 Subject: [PATCH 436/505] feat(api): add read_only field to PersonalAccessToken proto messages --- .stats.yml | 4 ++-- src/gitpod/types/users/personal_access_token.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1494d4ad..1d71a2c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cd774a77f01f7c7c0872caf935eab4de8b06811e0a6c17af6da4e642d24aa1a5.yml -openapi_spec_hash: a1c5294457addfc76d9ffc1e65a5125e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fae3aa4414fe83c95acadea5fc12f2ca16c81ac39b406e086d674fa4a892ba34.yml +openapi_spec_hash: c69a15cafc180101cb77cc70e7cee30f config_hash: 1bfdd908308b0bc392edbef83566284c diff --git a/src/gitpod/types/users/personal_access_token.py b/src/gitpod/types/users/personal_access_token.py index c094c3c7..4396aa1c 100644 --- a/src/gitpod/types/users/personal_access_token.py +++ b/src/gitpod/types/users/personal_access_token.py @@ -294,4 +294,10 @@ class PersonalAccessToken(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ + read_only: Optional[bool] = FieldInfo(alias="readOnly", default=None) + """ + When true, the token can only be used for read operations. Mutations will be + denied at the data layer. + """ + user_id: Optional[str] = FieldInfo(alias="userId", default=None) From f1a7a4ab23812f17f898564588010eda7cfee15a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 12:04:39 +0000 Subject: [PATCH 437/505] feat(api): add RESOURCE_ROLE_ORG_AUDIT_LOG_READER to ResourceRole enum --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_role.py | 1 + src/gitpod/types/shared_params/resource_role.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1d71a2c0..20dce76d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fae3aa4414fe83c95acadea5fc12f2ca16c81ac39b406e086d674fa4a892ba34.yml -openapi_spec_hash: c69a15cafc180101cb77cc70e7cee30f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-29a2b14753a2248cf654669748e268c94b1d979777990129422653fbccf4a393.yml +openapi_spec_hash: e7b5f3eb2052606d8e25fa943cf48fd0 config_hash: 1bfdd908308b0bc392edbef83566284c diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index e9c753f3..51848e69 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -12,6 +12,7 @@ "RESOURCE_ROLE_ORG_PROJECTS_ADMIN", "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN", "RESOURCE_ROLE_ORG_GROUPS_ADMIN", + "RESOURCE_ROLE_ORG_AUDIT_LOG_READER", "RESOURCE_ROLE_GROUP_ADMIN", "RESOURCE_ROLE_GROUP_VIEWER", "RESOURCE_ROLE_USER_IDENTITY", diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index c040a312..b61b998c 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -14,6 +14,7 @@ "RESOURCE_ROLE_ORG_PROJECTS_ADMIN", "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN", "RESOURCE_ROLE_ORG_GROUPS_ADMIN", + "RESOURCE_ROLE_ORG_AUDIT_LOG_READER", "RESOURCE_ROLE_GROUP_ADMIN", "RESOURCE_ROLE_GROUP_VIEWER", "RESOURCE_ROLE_USER_IDENTITY", From 65658f22082b33476e8b845c23c8949cf72044ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 15:28:08 +0000 Subject: [PATCH 438/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 20dce76d..28189c22 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-29a2b14753a2248cf654669748e268c94b1d979777990129422653fbccf4a393.yml -openapi_spec_hash: e7b5f3eb2052606d8e25fa943cf48fd0 -config_hash: 1bfdd908308b0bc392edbef83566284c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f1324c9042b32cf2d853a8b80b018625c1a047e750f8b846c353cc800b8ffa4f.yml +openapi_spec_hash: 6b6acf2797dcc5d245d577fa7d1a9afe +config_hash: bb91d6262c6e660a87ffa99531e8ea81 From 76acd3c6774937919de288114cc746a0b26fce4b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 19:49:29 +0000 Subject: [PATCH 439/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 28189c22..7620ac4f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f1324c9042b32cf2d853a8b80b018625c1a047e750f8b846c353cc800b8ffa4f.yml -openapi_spec_hash: 6b6acf2797dcc5d245d577fa7d1a9afe -config_hash: bb91d6262c6e660a87ffa99531e8ea81 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fd1185f71f8b7c1f4b6d13ff6d89cf6d1b3fe3333d2b6da41b94b2ffcbfbd9c5.yml +openapi_spec_hash: 4868ffc06e2a812b4a93bfbac1584102 +config_hash: 555f115fcb663264461c0f66de8c25b7 From 40401b02fb803dc8a9dc278220643fd8da92461b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 21:08:54 +0000 Subject: [PATCH 440/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7620ac4f..aac10082 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fd1185f71f8b7c1f4b6d13ff6d89cf6d1b3fe3333d2b6da41b94b2ffcbfbd9c5.yml -openapi_spec_hash: 4868ffc06e2a812b4a93bfbac1584102 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f702ddc06be77c4ebea791119d390c67022381f7e44cff14f1debb61f38c487a.yml +openapi_spec_hash: 746f5337fcd1223da227610fa4010cf2 config_hash: 555f115fcb663264461c0f66de8c25b7 From 09fe4bb7d5a5fa9c716344cd498224131d75c335 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 12:42:59 +0000 Subject: [PATCH 441/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index aac10082..5aa05d06 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f702ddc06be77c4ebea791119d390c67022381f7e44cff14f1debb61f38c487a.yml -openapi_spec_hash: 746f5337fcd1223da227610fa4010cf2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f75b21b427e51f993458aa2ccc5e9af7963e448ccc019e8020c5c06d4044fc3a.yml +openapi_spec_hash: 6bff77fadf4978bcd16979e690783a8f config_hash: 555f115fcb663264461c0f66de8c25b7 From 5562229004706794bfe60bbab1754c790850a063 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:38:57 +0000 Subject: [PATCH 442/505] feat(api): add loop_conditions to agent execution, loop_retrigger to wake event, make timer optional --- .stats.yml | 6 +++--- src/gitpod/types/agent_execution.py | 11 ++++++++++ src/gitpod/types/wake_event_param.py | 32 +++++++++++++++++++++++----- tests/api_resources/test_agents.py | 30 ++++++++++++++++++++++++-- 4 files changed, 69 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5aa05d06..999d2910 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f75b21b427e51f993458aa2ccc5e9af7963e448ccc019e8020c5c06d4044fc3a.yml -openapi_spec_hash: 6bff77fadf4978bcd16979e690783a8f -config_hash: 555f115fcb663264461c0f66de8c25b7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a7deaeeaec204a29afa78cfb8cc180a8a661120f955a6681043bf8417a18ac06.yml +openapi_spec_hash: c30bb27830ead5c7602ab367a6e51728 +config_hash: b0a3fd86ab6f098dc64e390b2a0dfc77 diff --git a/src/gitpod/types/agent_execution.py b/src/gitpod/types/agent_execution.py index f3e92d83..07f02eda 100644 --- a/src/gitpod/types/agent_execution.py +++ b/src/gitpod/types/agent_execution.py @@ -16,6 +16,7 @@ "Metadata", "Spec", "SpecLimits", + "SpecLoopCondition", "Status", "StatusCurrentOperation", "StatusCurrentOperationLlm", @@ -246,6 +247,14 @@ class SpecLimits(BaseModel): max_output_tokens: Optional[str] = FieldInfo(alias="maxOutputTokens", default=None) +class SpecLoopCondition(BaseModel): + id: Optional[str] = None + + description: Optional[str] = None + + expression: Optional[str] = None + + class Spec(BaseModel): """ Spec is the configuration of the agent that's required for the @@ -263,6 +272,8 @@ class Spec(BaseModel): limits: Optional[SpecLimits] = None + loop_conditions: Optional[List[SpecLoopCondition]] = FieldInfo(alias="loopConditions", default=None) + session: Optional[str] = None spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) diff --git a/src/gitpod/types/wake_event_param.py b/src/gitpod/types/wake_event_param.py index eae916dc..533c4303 100644 --- a/src/gitpod/types/wake_event_param.py +++ b/src/gitpod/types/wake_event_param.py @@ -2,13 +2,33 @@ from __future__ import annotations -from typing import Union +from typing import Dict, Union, Iterable from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["WakeEventParam", "Timer"] +__all__ = ["WakeEventParam", "LoopRetrigger", "LoopRetriggerUnmetCondition", "Timer"] + + +class LoopRetriggerUnmetCondition(TypedDict, total=False): + id: str + + description: str + + expression: str + + iteration: int + + max_iterations: Annotated[int, PropertyInfo(alias="maxIterations")] + + reason: str + + +class LoopRetrigger(TypedDict, total=False): + outputs: Dict[str, str] + + unmet_conditions: Annotated[Iterable[LoopRetriggerUnmetCondition], PropertyInfo(alias="unmetConditions")] class Timer(TypedDict, total=False): @@ -22,7 +42,9 @@ class WakeEventParam(TypedDict, total=False): Delivered via SendToAgentExecution as a new oneof variant. """ - timer: Required[Timer] - interest_id: Annotated[str, PropertyInfo(alias="interestId")] """The interest ID that fired (from WaitingInfo.Interest.id).""" + + loop_retrigger: Annotated[LoopRetrigger, PropertyInfo(alias="loopRetrigger")] + + timer: Timer diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 915f0927..6edc8e06 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -384,8 +384,21 @@ def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: "text": {"content": "Generate a report based on the latest logs."}, }, wake_event={ - "timer": {"fired_at": parse_datetime("2019-12-27T18:11:19.117Z")}, "interest_id": "interestId", + "loop_retrigger": { + "outputs": {"foo": "string"}, + "unmet_conditions": [ + { + "id": "id", + "description": "description", + "expression": "expression", + "iteration": 0, + "max_iterations": 0, + "reason": "reason", + } + ], + }, + "timer": {"fired_at": parse_datetime("2019-12-27T18:11:19.117Z")}, }, ) assert_matches_type(object, agent, path=["response"]) @@ -923,8 +936,21 @@ async def test_method_send_to_execution_with_all_params(self, async_client: Asyn "text": {"content": "Generate a report based on the latest logs."}, }, wake_event={ - "timer": {"fired_at": parse_datetime("2019-12-27T18:11:19.117Z")}, "interest_id": "interestId", + "loop_retrigger": { + "outputs": {"foo": "string"}, + "unmet_conditions": [ + { + "id": "id", + "description": "description", + "expression": "expression", + "iteration": 0, + "max_iterations": 0, + "reason": "reason", + } + ], + }, + "timer": {"fired_at": parse_datetime("2019-12-27T18:11:19.117Z")}, }, ) assert_matches_type(object, agent, path=["response"]) From 982404e37179365f932e9c25c075ed3f9f9b6bff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 19:44:41 +0000 Subject: [PATCH 443/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 999d2910..33a2951b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a7deaeeaec204a29afa78cfb8cc180a8a661120f955a6681043bf8417a18ac06.yml -openapi_spec_hash: c30bb27830ead5c7602ab367a6e51728 -config_hash: b0a3fd86ab6f098dc64e390b2a0dfc77 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f76c09ab0f9cb8aa252f3e73abf8ebc017706fe0c6f166a6e531e9e5164001e5.yml +openapi_spec_hash: 977531d9223653b1868b73970c485c55 +config_hash: 9006956c2bbfddd199282d395269e2d5 From 1446671098ef8c61dca218102c18c66e994d207c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:41:05 +0000 Subject: [PATCH 444/505] fix: sanitize endpoint path params --- src/gitpod/_utils/__init__.py | 1 + src/gitpod/_utils/_path.py | 127 ++++++++++++++++++++++++++++++++++ tests/test_utils/test_path.py | 89 ++++++++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 src/gitpod/_utils/_path.py create mode 100644 tests/test_utils/test_path.py diff --git a/src/gitpod/_utils/__init__.py b/src/gitpod/_utils/__init__.py index dc64e29a..10cb66d2 100644 --- a/src/gitpod/_utils/__init__.py +++ b/src/gitpod/_utils/__init__.py @@ -1,3 +1,4 @@ +from ._path import path_template as path_template from ._sync import asyncify as asyncify from ._proxy import LazyProxy as LazyProxy from ._utils import ( diff --git a/src/gitpod/_utils/_path.py b/src/gitpod/_utils/_path.py new file mode 100644 index 00000000..4d6e1e4c --- /dev/null +++ b/src/gitpod/_utils/_path.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +import re +from typing import ( + Any, + Mapping, + Callable, +) +from urllib.parse import quote + +# Matches '.' or '..' where each dot is either literal or percent-encoded (%2e / %2E). +_DOT_SEGMENT_RE = re.compile(r"^(?:\.|%2[eE]){1,2}$") + +_PLACEHOLDER_RE = re.compile(r"\{(\w+)\}") + + +def _quote_path_segment_part(value: str) -> str: + """Percent-encode `value` for use in a URI path segment. + + Considers characters not in `pchar` set from RFC 3986 §3.3 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 + """ + # quote() already treats unreserved characters (letters, digits, and -._~) + # as safe, so we only need to add sub-delims, ':', and '@'. + # Notably, unlike the default `safe` for quote(), / is unsafe and must be quoted. + return quote(value, safe="!$&'()*+,;=:@") + + +def _quote_query_part(value: str) -> str: + """Percent-encode `value` for use in a URI query string. + + Considers &, = and characters not in `query` set from RFC 3986 §3.4 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 + """ + return quote(value, safe="!$'()*+,;:@/?") + + +def _quote_fragment_part(value: str) -> str: + """Percent-encode `value` for use in a URI fragment. + + Considers characters not in `fragment` set from RFC 3986 §3.5 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.5 + """ + return quote(value, safe="!$&'()*+,;=:@/?") + + +def _interpolate( + template: str, + values: Mapping[str, Any], + quoter: Callable[[str], str], +) -> str: + """Replace {name} placeholders in `template`, quoting each value with `quoter`. + + Placeholder names are looked up in `values`. + + Raises: + KeyError: If a placeholder is not found in `values`. + """ + # re.split with a capturing group returns alternating + # [text, name, text, name, ..., text] elements. + parts = _PLACEHOLDER_RE.split(template) + + for i in range(1, len(parts), 2): + name = parts[i] + if name not in values: + raise KeyError(f"a value for placeholder {{{name}}} was not provided") + val = values[name] + if val is None: + parts[i] = "null" + elif isinstance(val, bool): + parts[i] = "true" if val else "false" + else: + parts[i] = quoter(str(values[name])) + + return "".join(parts) + + +def path_template(template: str, /, **kwargs: Any) -> str: + """Interpolate {name} placeholders in `template` from keyword arguments. + + Args: + template: The template string containing {name} placeholders. + **kwargs: Keyword arguments to interpolate into the template. + + Returns: + The template with placeholders interpolated and percent-encoded. + + Safe characters for percent-encoding are dependent on the URI component. + Placeholders in path and fragment portions are percent-encoded where the `segment` + and `fragment` sets from RFC 3986 respectively are considered safe. + Placeholders in the query portion are percent-encoded where the `query` set from + RFC 3986 §3.3 is considered safe except for = and & characters. + + Raises: + KeyError: If a placeholder is not found in `kwargs`. + ValueError: If resulting path contains /./ or /../ segments (including percent-encoded dot-segments). + """ + # Split the template into path, query, and fragment portions. + fragment_template: str | None = None + query_template: str | None = None + + rest = template + if "#" in rest: + rest, fragment_template = rest.split("#", 1) + if "?" in rest: + rest, query_template = rest.split("?", 1) + path_template = rest + + # Interpolate each portion with the appropriate quoting rules. + path_result = _interpolate(path_template, kwargs, _quote_path_segment_part) + + # Reject dot-segments (. and ..) in the final assembled path. The check + # runs after interpolation so that adjacent placeholders or a mix of static + # text and placeholders that together form a dot-segment are caught. + # Also reject percent-encoded dot-segments to protect against incorrectly + # implemented normalization in servers/proxies. + for segment in path_result.split("/"): + if _DOT_SEGMENT_RE.match(segment): + raise ValueError(f"Constructed path {path_result!r} contains dot-segment {segment!r} which is not allowed") + + result = path_result + if query_template is not None: + result += "?" + _interpolate(query_template, kwargs, _quote_query_part) + if fragment_template is not None: + result += "#" + _interpolate(fragment_template, kwargs, _quote_fragment_part) + + return result diff --git a/tests/test_utils/test_path.py b/tests/test_utils/test_path.py new file mode 100644 index 00000000..5aa33a9d --- /dev/null +++ b/tests/test_utils/test_path.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from typing import Any + +import pytest + +from gitpod._utils._path import path_template + + +@pytest.mark.parametrize( + "template, kwargs, expected", + [ + ("/v1/{id}", dict(id="abc"), "/v1/abc"), + ("/v1/{a}/{b}", dict(a="x", b="y"), "/v1/x/y"), + ("/v1/{a}{b}/path/{c}?val={d}#{e}", dict(a="x", b="y", c="z", d="u", e="v"), "/v1/xy/path/z?val=u#v"), + ("/{w}/{w}", dict(w="echo"), "/echo/echo"), + ("/v1/static", {}, "/v1/static"), + ("", {}, ""), + ("/v1/?q={n}&count=10", dict(n=42), "/v1/?q=42&count=10"), + ("/v1/{v}", dict(v=None), "/v1/null"), + ("/v1/{v}", dict(v=True), "/v1/true"), + ("/v1/{v}", dict(v=False), "/v1/false"), + ("/v1/{v}", dict(v=".hidden"), "/v1/.hidden"), # dot prefix ok + ("/v1/{v}", dict(v="file.txt"), "/v1/file.txt"), # dot in middle ok + ("/v1/{v}", dict(v="..."), "/v1/..."), # triple dot ok + ("/v1/{a}{b}", dict(a=".", b="txt"), "/v1/.txt"), # dot var combining with adjacent to be ok + ("/items?q={v}#{f}", dict(v=".", f=".."), "/items?q=.#.."), # dots in query/fragment are fine + ( + "/v1/{a}?query={b}", + dict(a="../../other/endpoint", b="a&bad=true"), + "/v1/..%2F..%2Fother%2Fendpoint?query=a%26bad%3Dtrue", + ), + ("/v1/{val}", dict(val="a/b/c"), "/v1/a%2Fb%2Fc"), + ("/v1/{val}", dict(val="a/b/c?query=value"), "/v1/a%2Fb%2Fc%3Fquery=value"), + ("/v1/{val}", dict(val="a/b/c?query=value&bad=true"), "/v1/a%2Fb%2Fc%3Fquery=value&bad=true"), + ("/v1/{val}", dict(val="%20"), "/v1/%2520"), # escapes escape sequences in input + # Query: slash and ? are safe, # is not + ("/items?q={v}", dict(v="a/b"), "/items?q=a/b"), + ("/items?q={v}", dict(v="a?b"), "/items?q=a?b"), + ("/items?q={v}", dict(v="a#b"), "/items?q=a%23b"), + ("/items?q={v}", dict(v="a b"), "/items?q=a%20b"), + # Fragment: slash and ? are safe + ("/docs#{v}", dict(v="a/b"), "/docs#a/b"), + ("/docs#{v}", dict(v="a?b"), "/docs#a?b"), + # Path: slash, ? and # are all encoded + ("/v1/{v}", dict(v="a/b"), "/v1/a%2Fb"), + ("/v1/{v}", dict(v="a?b"), "/v1/a%3Fb"), + ("/v1/{v}", dict(v="a#b"), "/v1/a%23b"), + # same var encoded differently by component + ( + "/v1/{v}?q={v}#{v}", + dict(v="a/b?c#d"), + "/v1/a%2Fb%3Fc%23d?q=a/b?c%23d#a/b?c%23d", + ), + ("/v1/{val}", dict(val="x?admin=true"), "/v1/x%3Fadmin=true"), # query injection + ("/v1/{val}", dict(val="x#admin"), "/v1/x%23admin"), # fragment injection + ], +) +def test_interpolation(template: str, kwargs: dict[str, Any], expected: str) -> None: + assert path_template(template, **kwargs) == expected + + +def test_missing_kwarg_raises_key_error() -> None: + with pytest.raises(KeyError, match="org_id"): + path_template("/v1/{org_id}") + + +@pytest.mark.parametrize( + "template, kwargs", + [ + ("{a}/path", dict(a=".")), + ("{a}/path", dict(a="..")), + ("/v1/{a}", dict(a=".")), + ("/v1/{a}", dict(a="..")), + ("/v1/{a}/path", dict(a=".")), + ("/v1/{a}/path", dict(a="..")), + ("/v1/{a}{b}", dict(a=".", b=".")), # adjacent vars → ".." + ("/v1/{a}.", dict(a=".")), # var + static → ".." + ("/v1/{a}{b}", dict(a="", b=".")), # empty + dot → "." + ("/v1/%2e/{x}", dict(x="ok")), # encoded dot in static text + ("/v1/%2e./{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/.%2E/{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/{v}?q=1", dict(v="..")), + ("/v1/{v}#frag", dict(v="..")), + ], +) +def test_dot_segment_rejected(template: str, kwargs: dict[str, Any]) -> None: + with pytest.raises(ValueError, match="dot-segment"): + path_template(template, **kwargs) From 68b61d9cbc41c96ce23921094b34fa9acef8eaa2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 09:42:30 +0000 Subject: [PATCH 445/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 33a2951b..2ffaaeb3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f76c09ab0f9cb8aa252f3e73abf8ebc017706fe0c6f166a6e531e9e5164001e5.yml -openapi_spec_hash: 977531d9223653b1868b73970c485c55 -config_hash: 9006956c2bbfddd199282d395269e2d5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c48144943803f4a8f6e721e5f1611985485621c88b5c6cd6e4e6df3ad36420f4.yml +openapi_spec_hash: a48e0a822ede4ce2d48c14ba00e149b4 +config_hash: 480df9bb1d5150d2f37c201d28220533 From 651ec9413e2641498dbe6bef77f86b532ef890db Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 12:36:53 +0000 Subject: [PATCH 446/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2ffaaeb3..da3aeb43 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c48144943803f4a8f6e721e5f1611985485621c88b5c6cd6e4e6df3ad36420f4.yml -openapi_spec_hash: a48e0a822ede4ce2d48c14ba00e149b4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-99b9496f01443f12c3438a2826da4d8b0e28418c738434865e342f3f01f79aa8.yml +openapi_spec_hash: e3e249ef81eb05be33542aa2e7145c6f config_hash: 480df9bb1d5150d2f37c201d28220533 From f6e7b197e421c57210004d783cde748a86f439b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 14:10:32 +0000 Subject: [PATCH 447/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index da3aeb43..8202f452 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-99b9496f01443f12c3438a2826da4d8b0e28418c738434865e342f3f01f79aa8.yml -openapi_spec_hash: e3e249ef81eb05be33542aa2e7145c6f -config_hash: 480df9bb1d5150d2f37c201d28220533 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f12ace58a293e967ac373e545eb25b1f4bfb72c66a6ed3477d36543e45635b32.yml +openapi_spec_hash: 98c8febb9b8b0788ae9b674ef80e7005 +config_hash: 7dcf23a612f573a3267446501c35a0e0 From 08640aca56e2d30a6bf775581a401c5f3601e939 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 14:58:46 +0000 Subject: [PATCH 448/505] feat(api): add RESOURCE_ROLE_AGENT_EXECUTION_VIEWER to ResourceRole enum --- .stats.yml | 4 ++-- src/gitpod/types/shared/resource_role.py | 1 + src/gitpod/types/shared_params/resource_role.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8202f452..8fc1df39 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f12ace58a293e967ac373e545eb25b1f4bfb72c66a6ed3477d36543e45635b32.yml -openapi_spec_hash: 98c8febb9b8b0788ae9b674ef80e7005 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-84a17c2c7c56901f5fd5ebb6e444c831671d403eba90509a6ecd85780ba04ad2.yml +openapi_spec_hash: 5ae1e9b53725fcf9a3224289f2f413e9 config_hash: 7dcf23a612f573a3267446501c35a0e0 diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 51848e69..45759abb 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -48,6 +48,7 @@ "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER", + "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER", "RESOURCE_ROLE_AGENT_ADMIN", "RESOURCE_ROLE_AGENT_VIEWER", "RESOURCE_ROLE_AGENT_EXECUTOR", diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index b61b998c..94f5abcc 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -50,6 +50,7 @@ "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER", + "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER", "RESOURCE_ROLE_AGENT_ADMIN", "RESOURCE_ROLE_AGENT_VIEWER", "RESOURCE_ROLE_AGENT_EXECUTOR", From 0091ab13018bee94242a59b682c90c6f642e8f30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 15:31:50 +0000 Subject: [PATCH 449/505] feat(api): add conversation_sharing_policy field to agent_policy --- .stats.yml | 6 +++--- api.md | 1 + src/gitpod/types/organizations/__init__.py | 1 + src/gitpod/types/organizations/agent_policy.py | 6 ++++++ .../organizations/conversation_sharing_policy.py | 11 +++++++++++ .../types/organizations/policy_update_params.py | 6 ++++++ src/gitpod/types/shared/resource_role.py | 1 - src/gitpod/types/shared_params/resource_role.py | 1 - tests/api_resources/organizations/test_policies.py | 2 ++ 9 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 src/gitpod/types/organizations/conversation_sharing_policy.py diff --git a/.stats.yml b/.stats.yml index 8fc1df39..9236557c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-84a17c2c7c56901f5fd5ebb6e444c831671d403eba90509a6ecd85780ba04ad2.yml -openapi_spec_hash: 5ae1e9b53725fcf9a3224289f2f413e9 -config_hash: 7dcf23a612f573a3267446501c35a0e0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bda11704254692a0568ae0b36b970e79946aa725c9a64c3511f979dc5c20aa13.yml +openapi_spec_hash: abc326f8f7553f8e86eedc8bca0b0378 +config_hash: a456e43b92b021483b4b81971da31909 diff --git a/api.md b/api.md index fbd4ba42..aff845d3 100644 --- a/api.md +++ b/api.md @@ -500,6 +500,7 @@ Types: ```python from gitpod.types.organizations import ( AgentPolicy, + ConversationSharingPolicy, CrowdStrikeConfig, KernelControlsAction, OrganizationPolicies, diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index 7a7398e5..6787a9a4 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -27,6 +27,7 @@ from .policy_retrieve_response import PolicyRetrieveResponse as PolicyRetrieveResponse from .domain_verification_state import DomainVerificationState as DomainVerificationState from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams +from .conversation_sharing_policy import ConversationSharingPolicy as ConversationSharingPolicy from .custom_domain_create_params import CustomDomainCreateParams as CustomDomainCreateParams from .custom_domain_delete_params import CustomDomainDeleteParams as CustomDomainDeleteParams from .custom_domain_update_params import CustomDomainUpdateParams as CustomDomainUpdateParams diff --git a/src/gitpod/types/organizations/agent_policy.py b/src/gitpod/types/organizations/agent_policy.py index 92827dd2..cc3eae01 100644 --- a/src/gitpod/types/organizations/agent_policy.py +++ b/src/gitpod/types/organizations/agent_policy.py @@ -5,6 +5,7 @@ from pydantic import Field as FieldInfo from ..._models import BaseModel +from .conversation_sharing_policy import ConversationSharingPolicy __all__ = ["AgentPolicy"] @@ -30,6 +31,11 @@ class AgentPolicy(BaseModel): disabled for agents """ + conversation_sharing_policy: Optional[ConversationSharingPolicy] = FieldInfo( + alias="conversationSharingPolicy", default=None + ) + """conversation_sharing_policy controls whether agent conversations can be shared""" + scm_tools_allowed_group_id: Optional[str] = FieldInfo(alias="scmToolsAllowedGroupId", default=None) """ scm_tools_allowed_group_id restricts SCM tools access to members of this group. diff --git a/src/gitpod/types/organizations/conversation_sharing_policy.py b/src/gitpod/types/organizations/conversation_sharing_policy.py new file mode 100644 index 00000000..b77164b7 --- /dev/null +++ b/src/gitpod/types/organizations/conversation_sharing_policy.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ConversationSharingPolicy"] + +ConversationSharingPolicy: TypeAlias = Literal[ + "CONVERSATION_SHARING_POLICY_UNSPECIFIED", + "CONVERSATION_SHARING_POLICY_DISABLED", + "CONVERSATION_SHARING_POLICY_ORGANIZATION", +] diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index 84d21073..b738ce51 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -8,6 +8,7 @@ from ..._types import SequenceNotStr from ..._utils import PropertyInfo from .veto_exec_policy_param import VetoExecPolicyParam +from .conversation_sharing_policy import ConversationSharingPolicy __all__ = [ "PolicyUpdateParams", @@ -142,6 +143,11 @@ class AgentPolicy(TypedDict, total=False): execute """ + conversation_sharing_policy: Annotated[ + Optional[ConversationSharingPolicy], PropertyInfo(alias="conversationSharingPolicy") + ] + """conversation_sharing_policy controls whether agent conversations can be shared""" + mcp_disabled: Annotated[Optional[bool], PropertyInfo(alias="mcpDisabled")] """ mcp_disabled controls whether MCP (Model Context Protocol) is disabled for diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 45759abb..51848e69 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -48,7 +48,6 @@ "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER", - "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER", "RESOURCE_ROLE_AGENT_ADMIN", "RESOURCE_ROLE_AGENT_VIEWER", "RESOURCE_ROLE_AGENT_EXECUTOR", diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index 94f5abcc..b61b998c 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -50,7 +50,6 @@ "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER", - "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER", "RESOURCE_ROLE_AGENT_ADMIN", "RESOURCE_ROLE_AGENT_VIEWER", "RESOURCE_ROLE_AGENT_EXECUTOR", diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index 7bd6cad2..1b8d7f72 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -68,6 +68,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", agent_policy={ "command_deny_list": ["string"], + "conversation_sharing_policy": "CONVERSATION_SHARING_POLICY_UNSPECIFIED", "mcp_disabled": True, "scm_tools_allowed_group_id": "scmToolsAllowedGroupId", "scm_tools_disabled": True, @@ -185,6 +186,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", agent_policy={ "command_deny_list": ["string"], + "conversation_sharing_policy": "CONVERSATION_SHARING_POLICY_UNSPECIFIED", "mcp_disabled": True, "scm_tools_allowed_group_id": "scmToolsAllowedGroupId", "scm_tools_disabled": True, From 08756c4a7ec9c04f4e7392d389ed856615753683 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:18:59 +0000 Subject: [PATCH 450/505] chore(internal): regenerate SDK with no functional changes --- .stats.yml | 6 +++--- src/gitpod/types/shared/resource_role.py | 1 + src/gitpod/types/shared_params/resource_role.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9236557c..4d457637 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bda11704254692a0568ae0b36b970e79946aa725c9a64c3511f979dc5c20aa13.yml -openapi_spec_hash: abc326f8f7553f8e86eedc8bca0b0378 -config_hash: a456e43b92b021483b4b81971da31909 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ba1ec7984802784b2b08954c4ed82dbf0b232a3f8a356ae4a1bd09a9ce5da698.yml +openapi_spec_hash: 5206c1aaee85555cf9c08efc8245efff +config_hash: 5dfe2ceeca8a86a1817ddc788283814a diff --git a/src/gitpod/types/shared/resource_role.py b/src/gitpod/types/shared/resource_role.py index 51848e69..45759abb 100644 --- a/src/gitpod/types/shared/resource_role.py +++ b/src/gitpod/types/shared/resource_role.py @@ -48,6 +48,7 @@ "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER", + "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER", "RESOURCE_ROLE_AGENT_ADMIN", "RESOURCE_ROLE_AGENT_VIEWER", "RESOURCE_ROLE_AGENT_EXECUTOR", diff --git a/src/gitpod/types/shared_params/resource_role.py b/src/gitpod/types/shared_params/resource_role.py index b61b998c..94f5abcc 100644 --- a/src/gitpod/types/shared_params/resource_role.py +++ b/src/gitpod/types/shared_params/resource_role.py @@ -50,6 +50,7 @@ "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER", + "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER", "RESOURCE_ROLE_AGENT_ADMIN", "RESOURCE_ROLE_AGENT_VIEWER", "RESOURCE_ROLE_AGENT_EXECUTOR", From 28063d819453bbfc2c87d7d40a94730ccfeaba19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:48:28 +0000 Subject: [PATCH 451/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4d457637..9009f2c5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ba1ec7984802784b2b08954c4ed82dbf0b232a3f8a356ae4a1bd09a9ce5da698.yml -openapi_spec_hash: 5206c1aaee85555cf9c08efc8245efff -config_hash: 5dfe2ceeca8a86a1817ddc788283814a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bd9914e7b59fc62bee0c8b6ed488b702b04a669d1180b5549b0b7b44af4d8801.yml +openapi_spec_hash: 7c920142d8ae78ab387efdc9cdc3a4d8 +config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 From d7abdccf1b08784d1f40b0aaec62c38247b4d618 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 23:18:33 +0000 Subject: [PATCH 452/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9009f2c5..ca43795b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bd9914e7b59fc62bee0c8b6ed488b702b04a669d1180b5549b0b7b44af4d8801.yml -openapi_spec_hash: 7c920142d8ae78ab387efdc9cdc3a4d8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-221a9ea52426d803e6ec7db57b813429c411c251a402965787aa3467ec677b2b.yml +openapi_spec_hash: 11202f2e26fbe67ea48107ae70bc9b2e config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 From 0b4a44880770e8e7e0dd85e060c5853ff66ca612 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 08:28:25 +0000 Subject: [PATCH 453/505] feat(api): add has_failed_execution_since filter parameter to automation list method --- .stats.yml | 4 ++-- src/gitpod/types/automation_list_params.py | 14 +++++++++++++- tests/api_resources/test_automations.py | 3 +++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index ca43795b..0a5b6482 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-221a9ea52426d803e6ec7db57b813429c411c251a402965787aa3467ec677b2b.yml -openapi_spec_hash: 11202f2e26fbe67ea48107ae70bc9b2e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-72bdb1df5196e62a848060603a6967149bc29c56c240fce63db51411d487362d.yml +openapi_spec_hash: c4ab595bbfec841426210a41288da729 config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 diff --git a/src/gitpod/types/automation_list_params.py b/src/gitpod/types/automation_list_params.py index 40b3a3d4..7cd91a58 100644 --- a/src/gitpod/types/automation_list_params.py +++ b/src/gitpod/types/automation_list_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import List +from typing import List, Union +from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict from .._types import SequenceNotStr @@ -25,6 +26,17 @@ class Filter(TypedDict, total=False): creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] """creator_ids filters workflows by creator user IDs""" + has_failed_execution_since: Annotated[ + Union[str, datetime], PropertyInfo(alias="hasFailedExecutionSince", format="iso8601") + ] + """ + has_failed_execution_since filters workflows that have at least one failed + execution with create_time >= the specified timestamp. A failed execution is one + that is COMPLETED with failed_action_count > 0, or STOPPED with + failed_action_count > 0 or a non-empty failure_message. This filter is mutually + exclusive with status_phases. + """ + search: str """ search performs case-insensitive search across workflow name, description, and diff --git a/tests/api_resources/test_automations.py b/tests/api_resources/test_automations.py index e9a5fa93..0f99b05f 100644 --- a/tests/api_resources/test_automations.py +++ b/tests/api_resources/test_automations.py @@ -21,6 +21,7 @@ AutomationListExecutionOutputsResponse, AutomationRetrieveExecutionActionResponse, ) +from gitpod._utils import parse_datetime from gitpod.pagination import ( SyncOutputsPage, AsyncOutputsPage, @@ -383,6 +384,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "has_failed_execution_since": parse_datetime("2019-12-27T18:11:19.117Z"), "search": "search", "status_phases": ["WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"], "workflow_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -1141,6 +1143,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "has_failed_execution_since": parse_datetime("2019-12-27T18:11:19.117Z"), "search": "search", "status_phases": ["WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"], "workflow_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], From 116e8e7627737e2f8f3a2bb3ce6b756536908976 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:51:31 +0000 Subject: [PATCH 454/505] feat(api): add credential_proxy field to environment_spec Secret --- .stats.yml | 4 +-- src/gitpod/types/environment_spec.py | 38 +++++++++++++++++++++ src/gitpod/types/environment_spec_param.py | 39 ++++++++++++++++++++++ tests/api_resources/test_environments.py | 20 +++++++++++ 4 files changed, 99 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a5b6482..93556f60 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-72bdb1df5196e62a848060603a6967149bc29c56c240fce63db51411d487362d.yml -openapi_spec_hash: c4ab595bbfec841426210a41288da729 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-00b0806e92d9492889e6f4456f9d1edfa57673ea41d8434d076dd705a98ae1a6.yml +openapi_spec_hash: 0a52f29825648feddf5da57621a312c8 config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index 0ea027ad..798637b0 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -21,6 +21,7 @@ "Machine", "Port", "Secret", + "SecretCredentialProxy", "SSHPublicKey", "Timeout", ] @@ -132,6 +133,33 @@ class Port(BaseModel): """ +class SecretCredentialProxy(BaseModel): + """ + credential_proxy configures transparent credential injection via the + credential proxy. When set, the credential proxy intercepts HTTPS + traffic to the target hosts and replaces the dummy secret value with + the real value in the specified HTTP header. The real secret value is + never exposed in the environment. + This field is orthogonal to mount — a secret can be both mounted (e.g. + as a git credential) and proxied at the same time. + """ + + format: Optional[Literal["FORMAT_UNSPECIFIED", "FORMAT_PLAIN", "FORMAT_BASE64"]] = None + """format describes how the secret value is encoded. + + The proxy uses this to decode the value before injecting it into the header. + """ + + header: Optional[str] = None + """header is the HTTP header name to inject (e.g. "Authorization").""" + + target_hosts: Optional[List[str]] = FieldInfo(alias="targetHosts", default=None) + """ + target_hosts lists the hostnames to intercept (for example "github.com" or + "\\**.github.com"). Wildcards are subdomain-only and do not match the apex domain. + """ + + class Secret(BaseModel): id: Optional[str] = None """id is the unique identifier of the secret.""" @@ -148,6 +176,16 @@ class Secret(BaseModel): that supports basic auth """ + credential_proxy: Optional[SecretCredentialProxy] = FieldInfo(alias="credentialProxy", default=None) + """ + credential_proxy configures transparent credential injection via the credential + proxy. When set, the credential proxy intercepts HTTPS traffic to the target + hosts and replaces the dummy secret value with the real value in the specified + HTTP header. The real secret value is never exposed in the environment. This + field is orthogonal to mount — a secret can be both mounted (e.g. as a git + credential) and proxied at the same time. + """ + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) file_path: Optional[str] = FieldInfo(alias="filePath", default=None) diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index e761d4d0..783a9330 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -5,6 +5,7 @@ from typing import Iterable, Optional from typing_extensions import Literal, Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .admission_level import AdmissionLevel from .environment_phase import EnvironmentPhase @@ -21,6 +22,7 @@ "Machine", "Port", "Secret", + "SecretCredentialProxy", "SSHPublicKey", "Timeout", ] @@ -139,6 +141,33 @@ class Port(TypedDict, total=False): """ +class SecretCredentialProxy(TypedDict, total=False): + """ + credential_proxy configures transparent credential injection via the + credential proxy. When set, the credential proxy intercepts HTTPS + traffic to the target hosts and replaces the dummy secret value with + the real value in the specified HTTP header. The real secret value is + never exposed in the environment. + This field is orthogonal to mount — a secret can be both mounted (e.g. + as a git credential) and proxied at the same time. + """ + + format: Literal["FORMAT_UNSPECIFIED", "FORMAT_PLAIN", "FORMAT_BASE64"] + """format describes how the secret value is encoded. + + The proxy uses this to decode the value before injecting it into the header. + """ + + header: str + """header is the HTTP header name to inject (e.g. "Authorization").""" + + target_hosts: Annotated[SequenceNotStr[str], PropertyInfo(alias="targetHosts")] + """ + target_hosts lists the hostnames to intercept (for example "github.com" or + "\\**.github.com"). Wildcards are subdomain-only and do not match the apex domain. + """ + + class Secret(TypedDict, total=False): id: str """id is the unique identifier of the secret.""" @@ -155,6 +184,16 @@ class Secret(TypedDict, total=False): that supports basic auth """ + credential_proxy: Annotated[SecretCredentialProxy, PropertyInfo(alias="credentialProxy")] + """ + credential_proxy configures transparent credential injection via the credential + proxy. When set, the credential proxy intercepts HTTPS traffic to the target + hosts and replaces the dummy secret value with the real value in the specified + HTTP header. The real secret value is never exposed in the environment. This + field is orthogonal to mount — a secret can be both mounted (e.g. as a git + credential) and proxied at the same time. + """ + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] file_path: Annotated[str, PropertyInfo(alias="filePath")] diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index ce26c6d8..0b44c1c4 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -107,6 +107,11 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "id": "id", "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", + "credential_proxy": { + "format": "FORMAT_UNSPECIFIED", + "header": "header", + "target_hosts": ["string"], + }, "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -481,6 +486,11 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "id": "id", "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", + "credential_proxy": { + "format": "FORMAT_UNSPECIFIED", + "header": "header", + "target_hosts": ["string"], + }, "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -797,6 +807,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "id": "id", "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", + "credential_proxy": { + "format": "FORMAT_UNSPECIFIED", + "header": "header", + "target_hosts": ["string"], + }, "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -1171,6 +1186,11 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "id": "id", "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", + "credential_proxy": { + "format": "FORMAT_UNSPECIFIED", + "header": "header", + "target_hosts": ["string"], + }, "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", From d2d1490bc05ed79fb4002a04215221123530c22e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 12:41:01 +0000 Subject: [PATCH 455/505] chore(internal): update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 95ceb189..3824f4c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log _dev __pycache__ From 9531bc8f9d190bd3f723dfae760230ff94fe697a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 15:51:47 +0000 Subject: [PATCH 456/505] feat(api): add search parameter to agent list prompts filter --- .stats.yml | 4 ++-- src/gitpod/types/agent_list_prompts_params.py | 6 ++++++ tests/api_resources/test_agents.py | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 93556f60..020cf5de 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-00b0806e92d9492889e6f4456f9d1edfa57673ea41d8434d076dd705a98ae1a6.yml -openapi_spec_hash: 0a52f29825648feddf5da57621a312c8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-925801ec83630f69a6811ca5bed45643ee8d58afe0e769830dd2b3201715bc80.yml +openapi_spec_hash: 234fb343a86237c85ffedad38d79bd2e config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 diff --git a/src/gitpod/types/agent_list_prompts_params.py b/src/gitpod/types/agent_list_prompts_params.py index eb1f295c..b4f974a5 100644 --- a/src/gitpod/types/agent_list_prompts_params.py +++ b/src/gitpod/types/agent_list_prompts_params.py @@ -37,6 +37,12 @@ class Filter(TypedDict, total=False): is_template: Annotated[bool, PropertyInfo(alias="isTemplate")] + search: str + """ + search performs case-insensitive search across prompt name, description, and + command. + """ + class Pagination(TypedDict, total=False): token: str diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 6edc8e06..8d9faefc 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -248,6 +248,7 @@ def test_method_list_prompts_with_all_params(self, client: Gitpod) -> None: "is_command": True, "is_skill": True, "is_template": True, + "search": "search", }, pagination={ "token": "token", @@ -800,6 +801,7 @@ async def test_method_list_prompts_with_all_params(self, async_client: AsyncGitp "is_command": True, "is_skill": True, "is_template": True, + "search": "search", }, pagination={ "token": "token", From 192f178c2eca6ab85a88d98470920d3114db631a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 11:41:41 +0000 Subject: [PATCH 457/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 020cf5de..66afd2fb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-925801ec83630f69a6811ca5bed45643ee8d58afe0e769830dd2b3201715bc80.yml -openapi_spec_hash: 234fb343a86237c85ffedad38d79bd2e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0895d9507f65bc472526f952e89667eea3b68ba777c5626f48f0c0a77f28d7bf.yml +openapi_spec_hash: 6e82f97487758b596347a0cea93ecd1f config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 From 255fb5591fbd02ff13344b6b179f4a761daf4a91 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 11:42:52 +0000 Subject: [PATCH 458/505] feat(api): add min_size/max_size parameters to prebuilds warm pool methods --- .stats.yml | 4 +- src/gitpod/resources/prebuilds.py | 52 +++++++++++++++++-- src/gitpod/types/agent_list_prompts_params.py | 6 --- .../types/prebuild_create_warm_pool_params.py | 18 ++++++- .../types/prebuild_update_warm_pool_params.py | 17 +++++- src/gitpod/types/warm_pool_spec.py | 18 ++++++- src/gitpod/types/warm_pool_status.py | 15 ++++++ tests/api_resources/test_agents.py | 2 - tests/api_resources/test_prebuilds.py | 8 +++ 9 files changed, 123 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index 66afd2fb..0f0a998b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0895d9507f65bc472526f952e89667eea3b68ba777c5626f48f0c0a77f28d7bf.yml -openapi_spec_hash: 6e82f97487758b596347a0cea93ecd1f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-38af3b7959b169657232801bef106659fa1c37da5eab9f928abd0d75d6c8978a.yml +openapi_spec_hash: 995d980761d1ea9951b9ad5e1d2b58dd config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py index 6213db22..6287d0d0 100644 --- a/src/gitpod/resources/prebuilds.py +++ b/src/gitpod/resources/prebuilds.py @@ -418,6 +418,8 @@ def create_warm_pool( environment_class_id: str, project_id: str, desired_size: int | Omit = omit, + max_size: Optional[int] | Omit = omit, + min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -457,7 +459,14 @@ def create_warm_pool( project_id: project_id specifies the project this warm pool belongs to. The project must have prebuilds enabled. - desired_size: desired_size is the number of warm instances to maintain. + desired_size: desired_size is the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + + max_size: max_size is the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + + min_size: min_size is the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -474,6 +483,8 @@ def create_warm_pool( "environment_class_id": environment_class_id, "project_id": project_id, "desired_size": desired_size, + "max_size": max_size, + "min_size": min_size, }, prebuild_create_warm_pool_params.PrebuildCreateWarmPoolParams, ), @@ -660,6 +671,8 @@ def update_warm_pool( *, warm_pool_id: str, desired_size: Optional[int] | Omit = omit, + max_size: Optional[int] | Omit = omit, + min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -684,7 +697,14 @@ def update_warm_pool( Args: warm_pool_id: warm_pool_id specifies the warm pool to update - desired_size: desired_size updates the number of warm instances to maintain. + desired_size: desired_size updates the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + + max_size: max_size updates the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + + min_size: min_size updates the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -700,6 +720,8 @@ def update_warm_pool( { "warm_pool_id": warm_pool_id, "desired_size": desired_size, + "max_size": max_size, + "min_size": min_size, }, prebuild_update_warm_pool_params.PrebuildUpdateWarmPoolParams, ), @@ -1085,6 +1107,8 @@ async def create_warm_pool( environment_class_id: str, project_id: str, desired_size: int | Omit = omit, + max_size: Optional[int] | Omit = omit, + min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1124,7 +1148,14 @@ async def create_warm_pool( project_id: project_id specifies the project this warm pool belongs to. The project must have prebuilds enabled. - desired_size: desired_size is the number of warm instances to maintain. + desired_size: desired_size is the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + + max_size: max_size is the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + + min_size: min_size is the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -1141,6 +1172,8 @@ async def create_warm_pool( "environment_class_id": environment_class_id, "project_id": project_id, "desired_size": desired_size, + "max_size": max_size, + "min_size": min_size, }, prebuild_create_warm_pool_params.PrebuildCreateWarmPoolParams, ), @@ -1327,6 +1360,8 @@ async def update_warm_pool( *, warm_pool_id: str, desired_size: Optional[int] | Omit = omit, + max_size: Optional[int] | Omit = omit, + min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1351,7 +1386,14 @@ async def update_warm_pool( Args: warm_pool_id: warm_pool_id specifies the warm pool to update - desired_size: desired_size updates the number of warm instances to maintain. + desired_size: desired_size updates the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + + max_size: max_size updates the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + + min_size: min_size updates the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -1367,6 +1409,8 @@ async def update_warm_pool( { "warm_pool_id": warm_pool_id, "desired_size": desired_size, + "max_size": max_size, + "min_size": min_size, }, prebuild_update_warm_pool_params.PrebuildUpdateWarmPoolParams, ), diff --git a/src/gitpod/types/agent_list_prompts_params.py b/src/gitpod/types/agent_list_prompts_params.py index b4f974a5..eb1f295c 100644 --- a/src/gitpod/types/agent_list_prompts_params.py +++ b/src/gitpod/types/agent_list_prompts_params.py @@ -37,12 +37,6 @@ class Filter(TypedDict, total=False): is_template: Annotated[bool, PropertyInfo(alias="isTemplate")] - search: str - """ - search performs case-insensitive search across prompt name, description, and - command. - """ - class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/prebuild_create_warm_pool_params.py b/src/gitpod/types/prebuild_create_warm_pool_params.py index 051a9558..a3b44290 100644 --- a/src/gitpod/types/prebuild_create_warm_pool_params.py +++ b/src/gitpod/types/prebuild_create_warm_pool_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -23,4 +24,19 @@ class PrebuildCreateWarmPoolParams(TypedDict, total=False): """ desired_size: Annotated[int, PropertyInfo(alias="desiredSize")] - """desired_size is the number of warm instances to maintain.""" + """ + desired_size is the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + """ + + max_size: Annotated[Optional[int], PropertyInfo(alias="maxSize")] + """ + max_size is the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + """ + + min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] + """ + min_size is the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. + """ diff --git a/src/gitpod/types/prebuild_update_warm_pool_params.py b/src/gitpod/types/prebuild_update_warm_pool_params.py index a0137ce5..75df1fbe 100644 --- a/src/gitpod/types/prebuild_update_warm_pool_params.py +++ b/src/gitpod/types/prebuild_update_warm_pool_params.py @@ -15,4 +15,19 @@ class PrebuildUpdateWarmPoolParams(TypedDict, total=False): """warm_pool_id specifies the warm pool to update""" desired_size: Annotated[Optional[int], PropertyInfo(alias="desiredSize")] - """desired_size updates the number of warm instances to maintain.""" + """ + desired_size updates the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + """ + + max_size: Annotated[Optional[int], PropertyInfo(alias="maxSize")] + """ + max_size updates the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + """ + + min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] + """ + min_size updates the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. + """ diff --git a/src/gitpod/types/warm_pool_spec.py b/src/gitpod/types/warm_pool_spec.py index e82ac84a..86b43e86 100644 --- a/src/gitpod/types/warm_pool_spec.py +++ b/src/gitpod/types/warm_pool_spec.py @@ -20,7 +20,23 @@ class WarmPoolSpec(BaseModel): """ desired_size: Optional[int] = FieldInfo(alias="desiredSize", default=None) - """desired_size is the number of warm instances to maintain.""" + """ + desired_size is the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. Existing pools will be + migrated to min_size=max_size=desired_size. + """ + + max_size: Optional[int] = FieldInfo(alias="maxSize", default=None) + """ + max_size is the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + """ + + min_size: Optional[int] = FieldInfo(alias="minSize", default=None) + """ + min_size is the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. + """ snapshot_id: Optional[str] = FieldInfo(alias="snapshotId", default=None) """ diff --git a/src/gitpod/types/warm_pool_status.py b/src/gitpod/types/warm_pool_status.py index b7605272..c70cf45a 100644 --- a/src/gitpod/types/warm_pool_status.py +++ b/src/gitpod/types/warm_pool_status.py @@ -21,8 +21,23 @@ class WarmPoolStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message contains details about why the warm pool is degraded or failed""" + running_instances: Optional[int] = FieldInfo(alias="runningInstances", default=None) + """ + running_instances is the number of running warm instances in the pool, ready to + be claimed for near-instant environment startup. + """ + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """ status_version is incremented each time the status is updated. Used for optimistic concurrency control. """ + + stopped_instances: Optional[int] = FieldInfo(alias="stoppedInstances", default=None) + """ + stopped_instances is the number of pre-provisioned but stopped instances in the + pool. When a running instance is claimed, stopped instances are used to backfill + the running pool faster than provisioning from scratch. Stopped instances only + incur storage costs, allowing a larger total pool at lower cost than keeping all + instances running. + """ diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 8d9faefc..6edc8e06 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -248,7 +248,6 @@ def test_method_list_prompts_with_all_params(self, client: Gitpod) -> None: "is_command": True, "is_skill": True, "is_template": True, - "search": "search", }, pagination={ "token": "token", @@ -801,7 +800,6 @@ async def test_method_list_prompts_with_all_params(self, async_client: AsyncGitp "is_command": True, "is_skill": True, "is_template": True, - "search": "search", }, pagination={ "token": "token", diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py index 25fa12e7..48d37dfe 100644 --- a/tests/api_resources/test_prebuilds.py +++ b/tests/api_resources/test_prebuilds.py @@ -279,6 +279,8 @@ def test_method_create_warm_pool_with_all_params(self, client: Gitpod) -> None: environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, + max_size=1, + min_size=1, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -437,6 +439,8 @@ def test_method_update_warm_pool_with_all_params(self, client: Gitpod) -> None: prebuild = client.prebuilds.update_warm_pool( warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, + max_size=1, + min_size=1, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) @@ -723,6 +727,8 @@ async def test_method_create_warm_pool_with_all_params(self, async_client: Async environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, + max_size=1, + min_size=1, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -881,6 +887,8 @@ async def test_method_update_warm_pool_with_all_params(self, async_client: Async prebuild = await async_client.prebuilds.update_warm_pool( warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, + max_size=1, + min_size=1, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) From e0e1a6857f98fcf56b0efdf05aceb068a7bbfdc4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 12:06:34 +0000 Subject: [PATCH 459/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0f0a998b..2890bff9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-38af3b7959b169657232801bef106659fa1c37da5eab9f928abd0d75d6c8978a.yml -openapi_spec_hash: 995d980761d1ea9951b9ad5e1d2b58dd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d2c151e90e58f98f598a91ca9440eded57b96da07877075eaccdee3ed3ef40a2.yml +openapi_spec_hash: f12e774ba78e93b44278fcf9b8ff08a3 config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 From 2308d274010c57de9760fda675d083283a422b5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 14:28:31 +0000 Subject: [PATCH 460/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2890bff9..a9a3a2de 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d2c151e90e58f98f598a91ca9440eded57b96da07877075eaccdee3ed3ef40a2.yml -openapi_spec_hash: f12e774ba78e93b44278fcf9b8ff08a3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a4ab6604a76d175e72a9e789ed92900b511a0dd1eefbb5b9eff7598d03805b43.yml +openapi_spec_hash: b68d741be82e05899e816fd3c540c160 config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 From 44cc570a9e96a0b00b4aad8ca9d296a3a93bd0db Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 15:17:07 +0000 Subject: [PATCH 461/505] chore(ci): skip lint on metadata-only changes Note that we still want to run tests, as these depend on the metadata. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65fafcdd..a0c08917 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/gitpod-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -38,7 +38,7 @@ jobs: run: ./scripts/lint build: - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') timeout-minutes: 10 name: build permissions: From e4bb9bc6b09d1516cdb3bdf664d832a4bde3bda8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 16:11:36 +0000 Subject: [PATCH 462/505] chore(internal): regenerate SDK with no functional changes --- .stats.yml | 6 +-- src/gitpod/resources/prebuilds.py | 52 ++----------------- src/gitpod/types/agent_list_prompts_params.py | 6 +++ .../types/prebuild_create_warm_pool_params.py | 18 +------ .../types/prebuild_update_warm_pool_params.py | 17 +----- src/gitpod/types/warm_pool_spec.py | 18 +------ src/gitpod/types/warm_pool_status.py | 15 ------ tests/api_resources/test_agents.py | 2 + tests/api_resources/test_prebuilds.py | 8 --- 9 files changed, 18 insertions(+), 124 deletions(-) diff --git a/.stats.yml b/.stats.yml index a9a3a2de..5061d4d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a4ab6604a76d175e72a9e789ed92900b511a0dd1eefbb5b9eff7598d03805b43.yml -openapi_spec_hash: b68d741be82e05899e816fd3c540c160 -config_hash: 2b667d8e1f2c879dc0cfac9aceed9eb3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d3cb9b32fcd7b10a75bdb3ab72be3ce62ef2ebbc4321663dc892bf653e69edcd.yml +openapi_spec_hash: db205e154f216da622892c7b07d33234 +config_hash: 719d606666b99e520b83306733eee5d5 diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py index 6287d0d0..6213db22 100644 --- a/src/gitpod/resources/prebuilds.py +++ b/src/gitpod/resources/prebuilds.py @@ -418,8 +418,6 @@ def create_warm_pool( environment_class_id: str, project_id: str, desired_size: int | Omit = omit, - max_size: Optional[int] | Omit = omit, - min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -459,14 +457,7 @@ def create_warm_pool( project_id: project_id specifies the project this warm pool belongs to. The project must have prebuilds enabled. - desired_size: desired_size is the number of warm instances to maintain. Deprecated: Use - min_size and max_size instead for dynamic scaling. - - max_size: max_size is the maximum number of warm instances to maintain. The pool will - never scale above this value. Must be >= min_size and <= 20. - - min_size: min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + desired_size: desired_size is the number of warm instances to maintain. extra_headers: Send extra headers @@ -483,8 +474,6 @@ def create_warm_pool( "environment_class_id": environment_class_id, "project_id": project_id, "desired_size": desired_size, - "max_size": max_size, - "min_size": min_size, }, prebuild_create_warm_pool_params.PrebuildCreateWarmPoolParams, ), @@ -671,8 +660,6 @@ def update_warm_pool( *, warm_pool_id: str, desired_size: Optional[int] | Omit = omit, - max_size: Optional[int] | Omit = omit, - min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -697,14 +684,7 @@ def update_warm_pool( Args: warm_pool_id: warm_pool_id specifies the warm pool to update - desired_size: desired_size updates the number of warm instances to maintain. Deprecated: Use - min_size and max_size instead for dynamic scaling. - - max_size: max_size updates the maximum number of warm instances to maintain. The pool will - never scale above this value. Must be >= min_size and <= 20. - - min_size: min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + desired_size: desired_size updates the number of warm instances to maintain. extra_headers: Send extra headers @@ -720,8 +700,6 @@ def update_warm_pool( { "warm_pool_id": warm_pool_id, "desired_size": desired_size, - "max_size": max_size, - "min_size": min_size, }, prebuild_update_warm_pool_params.PrebuildUpdateWarmPoolParams, ), @@ -1107,8 +1085,6 @@ async def create_warm_pool( environment_class_id: str, project_id: str, desired_size: int | Omit = omit, - max_size: Optional[int] | Omit = omit, - min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1148,14 +1124,7 @@ async def create_warm_pool( project_id: project_id specifies the project this warm pool belongs to. The project must have prebuilds enabled. - desired_size: desired_size is the number of warm instances to maintain. Deprecated: Use - min_size and max_size instead for dynamic scaling. - - max_size: max_size is the maximum number of warm instances to maintain. The pool will - never scale above this value. Must be >= min_size and <= 20. - - min_size: min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + desired_size: desired_size is the number of warm instances to maintain. extra_headers: Send extra headers @@ -1172,8 +1141,6 @@ async def create_warm_pool( "environment_class_id": environment_class_id, "project_id": project_id, "desired_size": desired_size, - "max_size": max_size, - "min_size": min_size, }, prebuild_create_warm_pool_params.PrebuildCreateWarmPoolParams, ), @@ -1360,8 +1327,6 @@ async def update_warm_pool( *, warm_pool_id: str, desired_size: Optional[int] | Omit = omit, - max_size: Optional[int] | Omit = omit, - min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1386,14 +1351,7 @@ async def update_warm_pool( Args: warm_pool_id: warm_pool_id specifies the warm pool to update - desired_size: desired_size updates the number of warm instances to maintain. Deprecated: Use - min_size and max_size instead for dynamic scaling. - - max_size: max_size updates the maximum number of warm instances to maintain. The pool will - never scale above this value. Must be >= min_size and <= 20. - - min_size: min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + desired_size: desired_size updates the number of warm instances to maintain. extra_headers: Send extra headers @@ -1409,8 +1367,6 @@ async def update_warm_pool( { "warm_pool_id": warm_pool_id, "desired_size": desired_size, - "max_size": max_size, - "min_size": min_size, }, prebuild_update_warm_pool_params.PrebuildUpdateWarmPoolParams, ), diff --git a/src/gitpod/types/agent_list_prompts_params.py b/src/gitpod/types/agent_list_prompts_params.py index eb1f295c..b4f974a5 100644 --- a/src/gitpod/types/agent_list_prompts_params.py +++ b/src/gitpod/types/agent_list_prompts_params.py @@ -37,6 +37,12 @@ class Filter(TypedDict, total=False): is_template: Annotated[bool, PropertyInfo(alias="isTemplate")] + search: str + """ + search performs case-insensitive search across prompt name, description, and + command. + """ + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/prebuild_create_warm_pool_params.py b/src/gitpod/types/prebuild_create_warm_pool_params.py index a3b44290..051a9558 100644 --- a/src/gitpod/types/prebuild_create_warm_pool_params.py +++ b/src/gitpod/types/prebuild_create_warm_pool_params.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Optional from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -24,19 +23,4 @@ class PrebuildCreateWarmPoolParams(TypedDict, total=False): """ desired_size: Annotated[int, PropertyInfo(alias="desiredSize")] - """ - desired_size is the number of warm instances to maintain. Deprecated: Use - min_size and max_size instead for dynamic scaling. - """ - - max_size: Annotated[Optional[int], PropertyInfo(alias="maxSize")] - """ - max_size is the maximum number of warm instances to maintain. The pool will - never scale above this value. Must be >= min_size and <= 20. - """ - - min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] - """ - min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. - """ + """desired_size is the number of warm instances to maintain.""" diff --git a/src/gitpod/types/prebuild_update_warm_pool_params.py b/src/gitpod/types/prebuild_update_warm_pool_params.py index 75df1fbe..a0137ce5 100644 --- a/src/gitpod/types/prebuild_update_warm_pool_params.py +++ b/src/gitpod/types/prebuild_update_warm_pool_params.py @@ -15,19 +15,4 @@ class PrebuildUpdateWarmPoolParams(TypedDict, total=False): """warm_pool_id specifies the warm pool to update""" desired_size: Annotated[Optional[int], PropertyInfo(alias="desiredSize")] - """ - desired_size updates the number of warm instances to maintain. Deprecated: Use - min_size and max_size instead for dynamic scaling. - """ - - max_size: Annotated[Optional[int], PropertyInfo(alias="maxSize")] - """ - max_size updates the maximum number of warm instances to maintain. The pool will - never scale above this value. Must be >= min_size and <= 20. - """ - - min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] - """ - min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. - """ + """desired_size updates the number of warm instances to maintain.""" diff --git a/src/gitpod/types/warm_pool_spec.py b/src/gitpod/types/warm_pool_spec.py index 86b43e86..e82ac84a 100644 --- a/src/gitpod/types/warm_pool_spec.py +++ b/src/gitpod/types/warm_pool_spec.py @@ -20,23 +20,7 @@ class WarmPoolSpec(BaseModel): """ desired_size: Optional[int] = FieldInfo(alias="desiredSize", default=None) - """ - desired_size is the number of warm instances to maintain. Deprecated: Use - min_size and max_size instead for dynamic scaling. Existing pools will be - migrated to min_size=max_size=desired_size. - """ - - max_size: Optional[int] = FieldInfo(alias="maxSize", default=None) - """ - max_size is the maximum number of warm instances to maintain. The pool will - never scale above this value. Must be >= min_size and <= 20. - """ - - min_size: Optional[int] = FieldInfo(alias="minSize", default=None) - """ - min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. - """ + """desired_size is the number of warm instances to maintain.""" snapshot_id: Optional[str] = FieldInfo(alias="snapshotId", default=None) """ diff --git a/src/gitpod/types/warm_pool_status.py b/src/gitpod/types/warm_pool_status.py index c70cf45a..b7605272 100644 --- a/src/gitpod/types/warm_pool_status.py +++ b/src/gitpod/types/warm_pool_status.py @@ -21,23 +21,8 @@ class WarmPoolStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message contains details about why the warm pool is degraded or failed""" - running_instances: Optional[int] = FieldInfo(alias="runningInstances", default=None) - """ - running_instances is the number of running warm instances in the pool, ready to - be claimed for near-instant environment startup. - """ - status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """ status_version is incremented each time the status is updated. Used for optimistic concurrency control. """ - - stopped_instances: Optional[int] = FieldInfo(alias="stoppedInstances", default=None) - """ - stopped_instances is the number of pre-provisioned but stopped instances in the - pool. When a running instance is claimed, stopped instances are used to backfill - the running pool faster than provisioning from scratch. Stopped instances only - incur storage costs, allowing a larger total pool at lower cost than keeping all - instances running. - """ diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 6edc8e06..8d9faefc 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -248,6 +248,7 @@ def test_method_list_prompts_with_all_params(self, client: Gitpod) -> None: "is_command": True, "is_skill": True, "is_template": True, + "search": "search", }, pagination={ "token": "token", @@ -800,6 +801,7 @@ async def test_method_list_prompts_with_all_params(self, async_client: AsyncGitp "is_command": True, "is_skill": True, "is_template": True, + "search": "search", }, pagination={ "token": "token", diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py index 48d37dfe..25fa12e7 100644 --- a/tests/api_resources/test_prebuilds.py +++ b/tests/api_resources/test_prebuilds.py @@ -279,8 +279,6 @@ def test_method_create_warm_pool_with_all_params(self, client: Gitpod) -> None: environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, - max_size=1, - min_size=1, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -439,8 +437,6 @@ def test_method_update_warm_pool_with_all_params(self, client: Gitpod) -> None: prebuild = client.prebuilds.update_warm_pool( warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, - max_size=1, - min_size=1, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) @@ -727,8 +723,6 @@ async def test_method_create_warm_pool_with_all_params(self, async_client: Async environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, - max_size=1, - min_size=1, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -887,8 +881,6 @@ async def test_method_update_warm_pool_with_all_params(self, async_client: Async prebuild = await async_client.prebuilds.update_warm_pool( warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, - max_size=1, - min_size=1, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) From 310eb77fedbd13d672f74344eabb73ebc4840e1f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 16:52:42 +0000 Subject: [PATCH 463/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5061d4d1..ff567668 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d3cb9b32fcd7b10a75bdb3ab72be3ce62ef2ebbc4321663dc892bf653e69edcd.yml -openapi_spec_hash: db205e154f216da622892c7b07d33234 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2110902e48daa64a96807838ec3cb8461618762cca4ed69116960195481b07df.yml +openapi_spec_hash: 3fb674220196e951da8e3d45eba67ec7 config_hash: 719d606666b99e520b83306733eee5d5 From 7e01b596045ccd7f108d1c17b6953759c9cde911 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 10:01:06 +0000 Subject: [PATCH 464/505] feat(api): add managed_metrics_enabled field to metrics configuration --- .stats.yml | 6 +-- src/gitpod/resources/prebuilds.py | 52 +++++++++++++++++-- src/gitpod/types/metrics_configuration.py | 8 +++ .../types/metrics_configuration_param.py | 10 +++- .../types/prebuild_create_warm_pool_params.py | 18 ++++++- .../types/prebuild_update_warm_pool_params.py | 17 +++++- src/gitpod/types/runner_update_params.py | 6 +++ src/gitpod/types/warm_pool_spec.py | 18 ++++++- src/gitpod/types/warm_pool_status.py | 15 ++++++ tests/api_resources/test_prebuilds.py | 8 +++ tests/api_resources/test_runners.py | 4 ++ 11 files changed, 151 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index ff567668..abf9d5ad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2110902e48daa64a96807838ec3cb8461618762cca4ed69116960195481b07df.yml -openapi_spec_hash: 3fb674220196e951da8e3d45eba67ec7 -config_hash: 719d606666b99e520b83306733eee5d5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-46b2bdeb8322ab3291dc87f9ac5d2e899a8ea34f79b2c2b1beadc551a1700fcf.yml +openapi_spec_hash: 1a1032b0d0f6ce441d13430b58abb3a0 +config_hash: de54bcc58fea1260a6792f8fd013439b diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py index 6213db22..6287d0d0 100644 --- a/src/gitpod/resources/prebuilds.py +++ b/src/gitpod/resources/prebuilds.py @@ -418,6 +418,8 @@ def create_warm_pool( environment_class_id: str, project_id: str, desired_size: int | Omit = omit, + max_size: Optional[int] | Omit = omit, + min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -457,7 +459,14 @@ def create_warm_pool( project_id: project_id specifies the project this warm pool belongs to. The project must have prebuilds enabled. - desired_size: desired_size is the number of warm instances to maintain. + desired_size: desired_size is the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + + max_size: max_size is the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + + min_size: min_size is the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -474,6 +483,8 @@ def create_warm_pool( "environment_class_id": environment_class_id, "project_id": project_id, "desired_size": desired_size, + "max_size": max_size, + "min_size": min_size, }, prebuild_create_warm_pool_params.PrebuildCreateWarmPoolParams, ), @@ -660,6 +671,8 @@ def update_warm_pool( *, warm_pool_id: str, desired_size: Optional[int] | Omit = omit, + max_size: Optional[int] | Omit = omit, + min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -684,7 +697,14 @@ def update_warm_pool( Args: warm_pool_id: warm_pool_id specifies the warm pool to update - desired_size: desired_size updates the number of warm instances to maintain. + desired_size: desired_size updates the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + + max_size: max_size updates the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + + min_size: min_size updates the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -700,6 +720,8 @@ def update_warm_pool( { "warm_pool_id": warm_pool_id, "desired_size": desired_size, + "max_size": max_size, + "min_size": min_size, }, prebuild_update_warm_pool_params.PrebuildUpdateWarmPoolParams, ), @@ -1085,6 +1107,8 @@ async def create_warm_pool( environment_class_id: str, project_id: str, desired_size: int | Omit = omit, + max_size: Optional[int] | Omit = omit, + min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1124,7 +1148,14 @@ async def create_warm_pool( project_id: project_id specifies the project this warm pool belongs to. The project must have prebuilds enabled. - desired_size: desired_size is the number of warm instances to maintain. + desired_size: desired_size is the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + + max_size: max_size is the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + + min_size: min_size is the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -1141,6 +1172,8 @@ async def create_warm_pool( "environment_class_id": environment_class_id, "project_id": project_id, "desired_size": desired_size, + "max_size": max_size, + "min_size": min_size, }, prebuild_create_warm_pool_params.PrebuildCreateWarmPoolParams, ), @@ -1327,6 +1360,8 @@ async def update_warm_pool( *, warm_pool_id: str, desired_size: Optional[int] | Omit = omit, + max_size: Optional[int] | Omit = omit, + min_size: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1351,7 +1386,14 @@ async def update_warm_pool( Args: warm_pool_id: warm_pool_id specifies the warm pool to update - desired_size: desired_size updates the number of warm instances to maintain. + desired_size: desired_size updates the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + + max_size: max_size updates the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + + min_size: min_size updates the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -1367,6 +1409,8 @@ async def update_warm_pool( { "warm_pool_id": warm_pool_id, "desired_size": desired_size, + "max_size": max_size, + "min_size": min_size, }, prebuild_update_warm_pool_params.PrebuildUpdateWarmPoolParams, ), diff --git a/src/gitpod/types/metrics_configuration.py b/src/gitpod/types/metrics_configuration.py index 0f6a0758..9eb9e5af 100644 --- a/src/gitpod/types/metrics_configuration.py +++ b/src/gitpod/types/metrics_configuration.py @@ -2,6 +2,8 @@ from typing import Optional +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["MetricsConfiguration"] @@ -11,6 +13,12 @@ class MetricsConfiguration(BaseModel): enabled: Optional[bool] = None """enabled indicates whether the runner should collect metrics""" + managed_metrics_enabled: Optional[bool] = FieldInfo(alias="managedMetricsEnabled", default=None) + """ + When true, the runner pushes metrics to the management plane via + ReportRunnerMetrics instead of directly to the remote_write endpoint. + """ + password: Optional[str] = None """password is the password to use for the metrics collector""" diff --git a/src/gitpod/types/metrics_configuration_param.py b/src/gitpod/types/metrics_configuration_param.py index 252253e2..3ee5dfc9 100644 --- a/src/gitpod/types/metrics_configuration_param.py +++ b/src/gitpod/types/metrics_configuration_param.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["MetricsConfigurationParam"] @@ -11,6 +13,12 @@ class MetricsConfigurationParam(TypedDict, total=False): enabled: bool """enabled indicates whether the runner should collect metrics""" + managed_metrics_enabled: Annotated[bool, PropertyInfo(alias="managedMetricsEnabled")] + """ + When true, the runner pushes metrics to the management plane via + ReportRunnerMetrics instead of directly to the remote_write endpoint. + """ + password: str """password is the password to use for the metrics collector""" diff --git a/src/gitpod/types/prebuild_create_warm_pool_params.py b/src/gitpod/types/prebuild_create_warm_pool_params.py index 051a9558..a3b44290 100644 --- a/src/gitpod/types/prebuild_create_warm_pool_params.py +++ b/src/gitpod/types/prebuild_create_warm_pool_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -23,4 +24,19 @@ class PrebuildCreateWarmPoolParams(TypedDict, total=False): """ desired_size: Annotated[int, PropertyInfo(alias="desiredSize")] - """desired_size is the number of warm instances to maintain.""" + """ + desired_size is the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + """ + + max_size: Annotated[Optional[int], PropertyInfo(alias="maxSize")] + """ + max_size is the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + """ + + min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] + """ + min_size is the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. + """ diff --git a/src/gitpod/types/prebuild_update_warm_pool_params.py b/src/gitpod/types/prebuild_update_warm_pool_params.py index a0137ce5..75df1fbe 100644 --- a/src/gitpod/types/prebuild_update_warm_pool_params.py +++ b/src/gitpod/types/prebuild_update_warm_pool_params.py @@ -15,4 +15,19 @@ class PrebuildUpdateWarmPoolParams(TypedDict, total=False): """warm_pool_id specifies the warm pool to update""" desired_size: Annotated[Optional[int], PropertyInfo(alias="desiredSize")] - """desired_size updates the number of warm instances to maintain.""" + """ + desired_size updates the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. + """ + + max_size: Annotated[Optional[int], PropertyInfo(alias="maxSize")] + """ + max_size updates the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + """ + + min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] + """ + min_size updates the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. + """ diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index f28ff40d..1325008d 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -33,6 +33,12 @@ class SpecConfigurationMetrics(TypedDict, total=False): enabled: Optional[bool] """enabled indicates whether the runner should collect metrics""" + managed_metrics_enabled: Annotated[Optional[bool], PropertyInfo(alias="managedMetricsEnabled")] + """ + When true, the runner pushes metrics to the management plane via + ReportRunnerMetrics instead of directly to the remote_write endpoint. + """ + password: Optional[str] """password is the password to use for the metrics collector""" diff --git a/src/gitpod/types/warm_pool_spec.py b/src/gitpod/types/warm_pool_spec.py index e82ac84a..86b43e86 100644 --- a/src/gitpod/types/warm_pool_spec.py +++ b/src/gitpod/types/warm_pool_spec.py @@ -20,7 +20,23 @@ class WarmPoolSpec(BaseModel): """ desired_size: Optional[int] = FieldInfo(alias="desiredSize", default=None) - """desired_size is the number of warm instances to maintain.""" + """ + desired_size is the number of warm instances to maintain. Deprecated: Use + min_size and max_size instead for dynamic scaling. Existing pools will be + migrated to min_size=max_size=desired_size. + """ + + max_size: Optional[int] = FieldInfo(alias="maxSize", default=None) + """ + max_size is the maximum number of warm instances to maintain. The pool will + never scale above this value. Must be >= min_size and <= 20. + """ + + min_size: Optional[int] = FieldInfo(alias="minSize", default=None) + """ + min_size is the minimum number of warm instances to maintain. The pool will + never scale below this value. Must be >= 1 and <= max_size. + """ snapshot_id: Optional[str] = FieldInfo(alias="snapshotId", default=None) """ diff --git a/src/gitpod/types/warm_pool_status.py b/src/gitpod/types/warm_pool_status.py index b7605272..c70cf45a 100644 --- a/src/gitpod/types/warm_pool_status.py +++ b/src/gitpod/types/warm_pool_status.py @@ -21,8 +21,23 @@ class WarmPoolStatus(BaseModel): failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message contains details about why the warm pool is degraded or failed""" + running_instances: Optional[int] = FieldInfo(alias="runningInstances", default=None) + """ + running_instances is the number of running warm instances in the pool, ready to + be claimed for near-instant environment startup. + """ + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) """ status_version is incremented each time the status is updated. Used for optimistic concurrency control. """ + + stopped_instances: Optional[int] = FieldInfo(alias="stoppedInstances", default=None) + """ + stopped_instances is the number of pre-provisioned but stopped instances in the + pool. When a running instance is claimed, stopped instances are used to backfill + the running pool faster than provisioning from scratch. Stopped instances only + incur storage costs, allowing a larger total pool at lower cost than keeping all + instances running. + """ diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py index 25fa12e7..48d37dfe 100644 --- a/tests/api_resources/test_prebuilds.py +++ b/tests/api_resources/test_prebuilds.py @@ -279,6 +279,8 @@ def test_method_create_warm_pool_with_all_params(self, client: Gitpod) -> None: environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, + max_size=1, + min_size=1, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -437,6 +439,8 @@ def test_method_update_warm_pool_with_all_params(self, client: Gitpod) -> None: prebuild = client.prebuilds.update_warm_pool( warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, + max_size=1, + min_size=1, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) @@ -723,6 +727,8 @@ async def test_method_create_warm_pool_with_all_params(self, async_client: Async environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, + max_size=1, + min_size=1, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -881,6 +887,8 @@ async def test_method_update_warm_pool_with_all_params(self, async_client: Async prebuild = await async_client.prebuilds.update_warm_pool( warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, + max_size=1, + min_size=1, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 65aa1b3e..3a7c4506 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -50,6 +50,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, + "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", @@ -144,6 +145,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, + "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", @@ -557,6 +559,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, + "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", @@ -651,6 +654,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, + "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", From a0534360af632aa020d3d9b34e7e69f878cffc98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 14:06:02 +0000 Subject: [PATCH 465/505] docs(api): update min_size parameter docs in prebuilds warm pool methods --- .stats.yml | 4 ++-- src/gitpod/resources/prebuilds.py | 12 ++++++++---- src/gitpod/types/prebuild_create_warm_pool_params.py | 3 ++- src/gitpod/types/prebuild_update_warm_pool_params.py | 3 ++- src/gitpod/types/warm_pool_spec.py | 3 ++- tests/api_resources/test_prebuilds.py | 8 ++++---- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.stats.yml b/.stats.yml index abf9d5ad..2f926b01 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-46b2bdeb8322ab3291dc87f9ac5d2e899a8ea34f79b2c2b1beadc551a1700fcf.yml -openapi_spec_hash: 1a1032b0d0f6ce441d13430b58abb3a0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dc7143aaf5c9250839a926b35309a54fab505e05d50ea7bc06adf2bcbcdbc889.yml +openapi_spec_hash: b1b47e82090bf165700db79dd40533fe config_hash: de54bcc58fea1260a6792f8fd013439b diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py index 6287d0d0..19cda855 100644 --- a/src/gitpod/resources/prebuilds.py +++ b/src/gitpod/resources/prebuilds.py @@ -466,7 +466,8 @@ def create_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. extra_headers: Send extra headers @@ -704,7 +705,8 @@ def update_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. extra_headers: Send extra headers @@ -1155,7 +1157,8 @@ async def create_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. extra_headers: Send extra headers @@ -1393,7 +1396,8 @@ async def update_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. extra_headers: Send extra headers diff --git a/src/gitpod/types/prebuild_create_warm_pool_params.py b/src/gitpod/types/prebuild_create_warm_pool_params.py index a3b44290..69564ae9 100644 --- a/src/gitpod/types/prebuild_create_warm_pool_params.py +++ b/src/gitpod/types/prebuild_create_warm_pool_params.py @@ -38,5 +38,6 @@ class PrebuildCreateWarmPoolParams(TypedDict, total=False): min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] """ min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. """ diff --git a/src/gitpod/types/prebuild_update_warm_pool_params.py b/src/gitpod/types/prebuild_update_warm_pool_params.py index 75df1fbe..38b9ac9d 100644 --- a/src/gitpod/types/prebuild_update_warm_pool_params.py +++ b/src/gitpod/types/prebuild_update_warm_pool_params.py @@ -29,5 +29,6 @@ class PrebuildUpdateWarmPoolParams(TypedDict, total=False): min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] """ min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. """ diff --git a/src/gitpod/types/warm_pool_spec.py b/src/gitpod/types/warm_pool_spec.py index 86b43e86..5c23e119 100644 --- a/src/gitpod/types/warm_pool_spec.py +++ b/src/gitpod/types/warm_pool_spec.py @@ -35,7 +35,8 @@ class WarmPoolSpec(BaseModel): min_size: Optional[int] = FieldInfo(alias="minSize", default=None) """ min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. """ snapshot_id: Optional[str] = FieldInfo(alias="snapshotId", default=None) diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py index 48d37dfe..26a9e227 100644 --- a/tests/api_resources/test_prebuilds.py +++ b/tests/api_resources/test_prebuilds.py @@ -280,7 +280,7 @@ def test_method_create_warm_pool_with_all_params(self, client: Gitpod) -> None: project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, max_size=1, - min_size=1, + min_size=20, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -440,7 +440,7 @@ def test_method_update_warm_pool_with_all_params(self, client: Gitpod) -> None: warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, max_size=1, - min_size=1, + min_size=20, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) @@ -728,7 +728,7 @@ async def test_method_create_warm_pool_with_all_params(self, async_client: Async project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, max_size=1, - min_size=1, + min_size=20, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -888,7 +888,7 @@ async def test_method_update_warm_pool_with_all_params(self, async_client: Async warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, max_size=1, - min_size=1, + min_size=20, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) From b4a11e3e76e16936c443aa5c2a8bb77201aa3369 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 14:43:07 +0000 Subject: [PATCH 466/505] feat(api): add RUNNER_CAPABILITY_ASG_WARM_POOL to RunnerCapability type --- .stats.yml | 4 ++-- src/gitpod/types/runner_capability.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2f926b01..60a0dd76 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dc7143aaf5c9250839a926b35309a54fab505e05d50ea7bc06adf2bcbcdbc889.yml -openapi_spec_hash: b1b47e82090bf165700db79dd40533fe +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3f158bc08381a9336e28ef19d3bc89fba44faae548fd29c8e53849d3573c2d4c.yml +openapi_spec_hash: 054f7fecad0cd62c97b22c93dc79a369 config_hash: de54bcc58fea1260a6792f8fd013439b diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py index a0528961..c2e50b46 100644 --- a/src/gitpod/types/runner_capability.py +++ b/src/gitpod/types/runner_capability.py @@ -17,4 +17,5 @@ "RUNNER_CAPABILITY_CHECK_REPOSITORY_ACCESS", "RUNNER_CAPABILITY_RUNNER_SIDE_AGENT", "RUNNER_CAPABILITY_WARM_POOL", + "RUNNER_CAPABILITY_ASG_WARM_POOL", ] From 6c39eb76de36a88edba009580c741645ed1728d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 18:15:21 +0000 Subject: [PATCH 467/505] feat(api): add desired_size field to WarmPoolStatus --- .stats.yml | 4 ++-- src/gitpod/types/warm_pool_status.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 60a0dd76..ccedf6fd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3f158bc08381a9336e28ef19d3bc89fba44faae548fd29c8e53849d3573c2d4c.yml -openapi_spec_hash: 054f7fecad0cd62c97b22c93dc79a369 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8f6dea0eef78b44b26c72efce3f2a9443d1b431e4a11b4c540c3967ddf0e063e.yml +openapi_spec_hash: 7b0e355f20c891b32efe36e691704b75 config_hash: de54bcc58fea1260a6792f8fd013439b diff --git a/src/gitpod/types/warm_pool_status.py b/src/gitpod/types/warm_pool_status.py index c70cf45a..1f7a6f29 100644 --- a/src/gitpod/types/warm_pool_status.py +++ b/src/gitpod/types/warm_pool_status.py @@ -18,6 +18,13 @@ class WarmPoolStatus(BaseModel): phase: WarmPoolPhase """phase is the current phase of the warm pool lifecycle""" + desired_size: Optional[int] = FieldInfo(alias="desiredSize", default=None) + """ + desired_size is the current target number of instances the autoscaler has + decided on. Unlike running_instances, this value is stable and does not + fluctuate as instances are claimed and backfilled. + """ + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) """failure_message contains details about why the warm pool is degraded or failed""" From a80b9a43fe643c1ae80e649a40725ac8126027ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 20:37:33 +0000 Subject: [PATCH 468/505] chore(internal): regenerate SDK with no functional changes --- .stats.yml | 6 +++--- src/gitpod/resources/prebuilds.py | 12 ++++-------- src/gitpod/types/metrics_configuration.py | 8 -------- src/gitpod/types/metrics_configuration_param.py | 10 +--------- src/gitpod/types/prebuild_create_warm_pool_params.py | 3 +-- src/gitpod/types/prebuild_update_warm_pool_params.py | 3 +-- src/gitpod/types/runner_update_params.py | 6 ------ src/gitpod/types/warm_pool_spec.py | 3 +-- tests/api_resources/test_prebuilds.py | 8 ++++---- tests/api_resources/test_runners.py | 4 ---- 10 files changed, 15 insertions(+), 48 deletions(-) diff --git a/.stats.yml b/.stats.yml index ccedf6fd..9dc6b4b1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-8f6dea0eef78b44b26c72efce3f2a9443d1b431e4a11b4c540c3967ddf0e063e.yml -openapi_spec_hash: 7b0e355f20c891b32efe36e691704b75 -config_hash: de54bcc58fea1260a6792f8fd013439b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5843fddc36a9619ea8a4c4491d6ddb3b8a18a3b9d995391bc7b9265350e6e08f.yml +openapi_spec_hash: c8e7ad218f0999c9b9579724805a9f97 +config_hash: 719d606666b99e520b83306733eee5d5 diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py index 19cda855..6287d0d0 100644 --- a/src/gitpod/resources/prebuilds.py +++ b/src/gitpod/resources/prebuilds.py @@ -466,8 +466,7 @@ def create_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow - full scale-down. + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -705,8 +704,7 @@ def update_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow - full scale-down. + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -1157,8 +1155,7 @@ async def create_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow - full scale-down. + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers @@ -1396,8 +1393,7 @@ async def update_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow - full scale-down. + never scale below this value. Must be >= 1 and <= max_size. extra_headers: Send extra headers diff --git a/src/gitpod/types/metrics_configuration.py b/src/gitpod/types/metrics_configuration.py index 9eb9e5af..0f6a0758 100644 --- a/src/gitpod/types/metrics_configuration.py +++ b/src/gitpod/types/metrics_configuration.py @@ -2,8 +2,6 @@ from typing import Optional -from pydantic import Field as FieldInfo - from .._models import BaseModel __all__ = ["MetricsConfiguration"] @@ -13,12 +11,6 @@ class MetricsConfiguration(BaseModel): enabled: Optional[bool] = None """enabled indicates whether the runner should collect metrics""" - managed_metrics_enabled: Optional[bool] = FieldInfo(alias="managedMetricsEnabled", default=None) - """ - When true, the runner pushes metrics to the management plane via - ReportRunnerMetrics instead of directly to the remote_write endpoint. - """ - password: Optional[str] = None """password is the password to use for the metrics collector""" diff --git a/src/gitpod/types/metrics_configuration_param.py b/src/gitpod/types/metrics_configuration_param.py index 3ee5dfc9..252253e2 100644 --- a/src/gitpod/types/metrics_configuration_param.py +++ b/src/gitpod/types/metrics_configuration_param.py @@ -2,9 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict - -from .._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["MetricsConfigurationParam"] @@ -13,12 +11,6 @@ class MetricsConfigurationParam(TypedDict, total=False): enabled: bool """enabled indicates whether the runner should collect metrics""" - managed_metrics_enabled: Annotated[bool, PropertyInfo(alias="managedMetricsEnabled")] - """ - When true, the runner pushes metrics to the management plane via - ReportRunnerMetrics instead of directly to the remote_write endpoint. - """ - password: str """password is the password to use for the metrics collector""" diff --git a/src/gitpod/types/prebuild_create_warm_pool_params.py b/src/gitpod/types/prebuild_create_warm_pool_params.py index 69564ae9..a3b44290 100644 --- a/src/gitpod/types/prebuild_create_warm_pool_params.py +++ b/src/gitpod/types/prebuild_create_warm_pool_params.py @@ -38,6 +38,5 @@ class PrebuildCreateWarmPoolParams(TypedDict, total=False): min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] """ min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow - full scale-down. + never scale below this value. Must be >= 1 and <= max_size. """ diff --git a/src/gitpod/types/prebuild_update_warm_pool_params.py b/src/gitpod/types/prebuild_update_warm_pool_params.py index 38b9ac9d..75df1fbe 100644 --- a/src/gitpod/types/prebuild_update_warm_pool_params.py +++ b/src/gitpod/types/prebuild_update_warm_pool_params.py @@ -29,6 +29,5 @@ class PrebuildUpdateWarmPoolParams(TypedDict, total=False): min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] """ min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow - full scale-down. + never scale below this value. Must be >= 1 and <= max_size. """ diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index 1325008d..f28ff40d 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -33,12 +33,6 @@ class SpecConfigurationMetrics(TypedDict, total=False): enabled: Optional[bool] """enabled indicates whether the runner should collect metrics""" - managed_metrics_enabled: Annotated[Optional[bool], PropertyInfo(alias="managedMetricsEnabled")] - """ - When true, the runner pushes metrics to the management plane via - ReportRunnerMetrics instead of directly to the remote_write endpoint. - """ - password: Optional[str] """password is the password to use for the metrics collector""" diff --git a/src/gitpod/types/warm_pool_spec.py b/src/gitpod/types/warm_pool_spec.py index 5c23e119..86b43e86 100644 --- a/src/gitpod/types/warm_pool_spec.py +++ b/src/gitpod/types/warm_pool_spec.py @@ -35,8 +35,7 @@ class WarmPoolSpec(BaseModel): min_size: Optional[int] = FieldInfo(alias="minSize", default=None) """ min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow - full scale-down. + never scale below this value. Must be >= 1 and <= max_size. """ snapshot_id: Optional[str] = FieldInfo(alias="snapshotId", default=None) diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py index 26a9e227..48d37dfe 100644 --- a/tests/api_resources/test_prebuilds.py +++ b/tests/api_resources/test_prebuilds.py @@ -280,7 +280,7 @@ def test_method_create_warm_pool_with_all_params(self, client: Gitpod) -> None: project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, max_size=1, - min_size=20, + min_size=1, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -440,7 +440,7 @@ def test_method_update_warm_pool_with_all_params(self, client: Gitpod) -> None: warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, max_size=1, - min_size=20, + min_size=1, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) @@ -728,7 +728,7 @@ async def test_method_create_warm_pool_with_all_params(self, async_client: Async project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, max_size=1, - min_size=20, + min_size=1, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -888,7 +888,7 @@ async def test_method_update_warm_pool_with_all_params(self, async_client: Async warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, max_size=1, - min_size=20, + min_size=1, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 3a7c4506..65aa1b3e 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -50,7 +50,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, - "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", @@ -145,7 +144,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, - "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", @@ -559,7 +557,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, - "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", @@ -654,7 +651,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, - "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", From 978029c962a779b4962c84c3d376e2a92ff65fe7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 07:43:46 +0000 Subject: [PATCH 469/505] chore(internal): regenerate SDK with no functional changes --- .stats.yml | 6 +++--- src/gitpod/resources/prebuilds.py | 12 ++++++++---- src/gitpod/types/metrics_configuration.py | 8 ++++++++ src/gitpod/types/metrics_configuration_param.py | 10 +++++++++- src/gitpod/types/prebuild_create_warm_pool_params.py | 3 ++- src/gitpod/types/prebuild_update_warm_pool_params.py | 3 ++- src/gitpod/types/runner_update_params.py | 6 ++++++ src/gitpod/types/warm_pool_spec.py | 3 ++- tests/api_resources/test_prebuilds.py | 8 ++++---- tests/api_resources/test_runners.py | 4 ++++ 10 files changed, 48 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9dc6b4b1..699d74c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-5843fddc36a9619ea8a4c4491d6ddb3b8a18a3b9d995391bc7b9265350e6e08f.yml -openapi_spec_hash: c8e7ad218f0999c9b9579724805a9f97 -config_hash: 719d606666b99e520b83306733eee5d5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a4e4d9807871b7c4f572b0ad7eaac8954d12451f30bb5788277015c7064c3440.yml +openapi_spec_hash: cff2a4560986a873ccfbbd118814e4e9 +config_hash: 7a2cbe5967b1eef12830d2a23fc32c83 diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py index 6287d0d0..19cda855 100644 --- a/src/gitpod/resources/prebuilds.py +++ b/src/gitpod/resources/prebuilds.py @@ -466,7 +466,8 @@ def create_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. extra_headers: Send extra headers @@ -704,7 +705,8 @@ def update_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. extra_headers: Send extra headers @@ -1155,7 +1157,8 @@ async def create_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. extra_headers: Send extra headers @@ -1393,7 +1396,8 @@ async def update_warm_pool( never scale above this value. Must be >= min_size and <= 20. min_size: min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. extra_headers: Send extra headers diff --git a/src/gitpod/types/metrics_configuration.py b/src/gitpod/types/metrics_configuration.py index 0f6a0758..9eb9e5af 100644 --- a/src/gitpod/types/metrics_configuration.py +++ b/src/gitpod/types/metrics_configuration.py @@ -2,6 +2,8 @@ from typing import Optional +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["MetricsConfiguration"] @@ -11,6 +13,12 @@ class MetricsConfiguration(BaseModel): enabled: Optional[bool] = None """enabled indicates whether the runner should collect metrics""" + managed_metrics_enabled: Optional[bool] = FieldInfo(alias="managedMetricsEnabled", default=None) + """ + When true, the runner pushes metrics to the management plane via + ReportRunnerMetrics instead of directly to the remote_write endpoint. + """ + password: Optional[str] = None """password is the password to use for the metrics collector""" diff --git a/src/gitpod/types/metrics_configuration_param.py b/src/gitpod/types/metrics_configuration_param.py index 252253e2..3ee5dfc9 100644 --- a/src/gitpod/types/metrics_configuration_param.py +++ b/src/gitpod/types/metrics_configuration_param.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["MetricsConfigurationParam"] @@ -11,6 +13,12 @@ class MetricsConfigurationParam(TypedDict, total=False): enabled: bool """enabled indicates whether the runner should collect metrics""" + managed_metrics_enabled: Annotated[bool, PropertyInfo(alias="managedMetricsEnabled")] + """ + When true, the runner pushes metrics to the management plane via + ReportRunnerMetrics instead of directly to the remote_write endpoint. + """ + password: str """password is the password to use for the metrics collector""" diff --git a/src/gitpod/types/prebuild_create_warm_pool_params.py b/src/gitpod/types/prebuild_create_warm_pool_params.py index a3b44290..69564ae9 100644 --- a/src/gitpod/types/prebuild_create_warm_pool_params.py +++ b/src/gitpod/types/prebuild_create_warm_pool_params.py @@ -38,5 +38,6 @@ class PrebuildCreateWarmPoolParams(TypedDict, total=False): min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] """ min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. """ diff --git a/src/gitpod/types/prebuild_update_warm_pool_params.py b/src/gitpod/types/prebuild_update_warm_pool_params.py index 75df1fbe..38b9ac9d 100644 --- a/src/gitpod/types/prebuild_update_warm_pool_params.py +++ b/src/gitpod/types/prebuild_update_warm_pool_params.py @@ -29,5 +29,6 @@ class PrebuildUpdateWarmPoolParams(TypedDict, total=False): min_size: Annotated[Optional[int], PropertyInfo(alias="minSize")] """ min_size updates the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. """ diff --git a/src/gitpod/types/runner_update_params.py b/src/gitpod/types/runner_update_params.py index f28ff40d..1325008d 100644 --- a/src/gitpod/types/runner_update_params.py +++ b/src/gitpod/types/runner_update_params.py @@ -33,6 +33,12 @@ class SpecConfigurationMetrics(TypedDict, total=False): enabled: Optional[bool] """enabled indicates whether the runner should collect metrics""" + managed_metrics_enabled: Annotated[Optional[bool], PropertyInfo(alias="managedMetricsEnabled")] + """ + When true, the runner pushes metrics to the management plane via + ReportRunnerMetrics instead of directly to the remote_write endpoint. + """ + password: Optional[str] """password is the password to use for the metrics collector""" diff --git a/src/gitpod/types/warm_pool_spec.py b/src/gitpod/types/warm_pool_spec.py index 86b43e86..5c23e119 100644 --- a/src/gitpod/types/warm_pool_spec.py +++ b/src/gitpod/types/warm_pool_spec.py @@ -35,7 +35,8 @@ class WarmPoolSpec(BaseModel): min_size: Optional[int] = FieldInfo(alias="minSize", default=None) """ min_size is the minimum number of warm instances to maintain. The pool will - never scale below this value. Must be >= 1 and <= max_size. + never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + full scale-down. """ snapshot_id: Optional[str] = FieldInfo(alias="snapshotId", default=None) diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py index 48d37dfe..26a9e227 100644 --- a/tests/api_resources/test_prebuilds.py +++ b/tests/api_resources/test_prebuilds.py @@ -280,7 +280,7 @@ def test_method_create_warm_pool_with_all_params(self, client: Gitpod) -> None: project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, max_size=1, - min_size=1, + min_size=20, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -440,7 +440,7 @@ def test_method_update_warm_pool_with_all_params(self, client: Gitpod) -> None: warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, max_size=1, - min_size=1, + min_size=20, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) @@ -728,7 +728,7 @@ async def test_method_create_warm_pool_with_all_params(self, async_client: Async project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", desired_size=2, max_size=1, - min_size=1, + min_size=20, ) assert_matches_type(PrebuildCreateWarmPoolResponse, prebuild, path=["response"]) @@ -888,7 +888,7 @@ async def test_method_update_warm_pool_with_all_params(self, async_client: Async warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, max_size=1, - min_size=1, + min_size=20, ) assert_matches_type(PrebuildUpdateWarmPoolResponse, prebuild, path=["response"]) diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 65aa1b3e..3a7c4506 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -50,6 +50,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, + "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", @@ -144,6 +145,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, + "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", @@ -557,6 +559,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, + "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", @@ -651,6 +654,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "log_level": "LOG_LEVEL_UNSPECIFIED", "metrics": { "enabled": True, + "managed_metrics_enabled": True, "password": "password", "url": "url", "username": "username", From 7a6a0d38c582b8027637790df268cdd8bc4f53a6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 11:37:40 +0000 Subject: [PATCH 470/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 699d74c0..b1dbd429 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a4e4d9807871b7c4f572b0ad7eaac8954d12451f30bb5788277015c7064c3440.yml -openapi_spec_hash: cff2a4560986a873ccfbbd118814e4e9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e1c236e7db9c10bf400560385187ff1ff7be96ea0512c8c733b8c2060b5c38f7.yml +openapi_spec_hash: bc809609c12ae8fe95eaee43a35278f9 config_hash: 7a2cbe5967b1eef12830d2a23fc32c83 From e44b1d2e866c7c522a69817099cf3651c9a86069 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:53:06 +0000 Subject: [PATCH 471/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b1dbd429..434c02af 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e1c236e7db9c10bf400560385187ff1ff7be96ea0512c8c733b8c2060b5c38f7.yml -openapi_spec_hash: bc809609c12ae8fe95eaee43a35278f9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fa0cdbce4ec4c7890ccca1447232476d6fcb21b02dd3db7852d7009179bafd8c.yml +openapi_spec_hash: 5474d9742e790b98d0b7c55c43aeeac5 config_hash: 7a2cbe5967b1eef12830d2a23fc32c83 From 85736ad7726e117d03f33455553eea08337bb1b9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 19:26:05 +0000 Subject: [PATCH 472/505] feat(internal): implement indices array format for query and form serialization --- src/gitpod/_qs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gitpod/_qs.py b/src/gitpod/_qs.py index ada6fd3f..de8c99bc 100644 --- a/src/gitpod/_qs.py +++ b/src/gitpod/_qs.py @@ -101,7 +101,10 @@ def _stringify_item( items.extend(self._stringify_item(key, item, opts)) return items elif array_format == "indices": - raise NotImplementedError("The array indices format is not supported yet") + items = [] + for i, item in enumerate(value): + items.extend(self._stringify_item(f"{key}[{i}]", item, opts)) + return items elif array_format == "brackets": items = [] key = key + "[]" From afce3b6b7cb462d06c5ba409c55cbfa2d8fedd1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 19:32:07 +0000 Subject: [PATCH 473/505] feat(api): add max_subagents_per_environment field to organizations agent policy --- .stats.yml | 4 ++-- src/gitpod/types/organizations/agent_policy.py | 7 +++++++ src/gitpod/types/organizations/policy_update_params.py | 7 +++++++ tests/api_resources/organizations/test_policies.py | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 434c02af..1088d16a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fa0cdbce4ec4c7890ccca1447232476d6fcb21b02dd3db7852d7009179bafd8c.yml -openapi_spec_hash: 5474d9742e790b98d0b7c55c43aeeac5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ed3a1c285331386ba5056502d899a2e4659e9e738e9c126bee45fc101ca1e146.yml +openapi_spec_hash: 367ebe7e572da1892a3eaae9344cfcba config_hash: 7a2cbe5967b1eef12830d2a23fc32c83 diff --git a/src/gitpod/types/organizations/agent_policy.py b/src/gitpod/types/organizations/agent_policy.py index cc3eae01..28c4315a 100644 --- a/src/gitpod/types/organizations/agent_policy.py +++ b/src/gitpod/types/organizations/agent_policy.py @@ -36,6 +36,13 @@ class AgentPolicy(BaseModel): ) """conversation_sharing_policy controls whether agent conversations can be shared""" + max_subagents_per_environment: Optional[int] = FieldInfo(alias="maxSubagentsPerEnvironment", default=None) + """ + max_subagents_per_environment limits the number of non-terminal sub-agents a + parent can have running simultaneously in the same environment. Valid range: + 0-10. Zero means use the default (5). + """ + scm_tools_allowed_group_id: Optional[str] = FieldInfo(alias="scmToolsAllowedGroupId", default=None) """ scm_tools_allowed_group_id restricts SCM tools access to members of this group. diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index b738ce51..e0776802 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -148,6 +148,13 @@ class AgentPolicy(TypedDict, total=False): ] """conversation_sharing_policy controls whether agent conversations can be shared""" + max_subagents_per_environment: Annotated[Optional[int], PropertyInfo(alias="maxSubagentsPerEnvironment")] + """ + max_subagents_per_environment limits the number of non-terminal sub-agents a + parent can have running simultaneously in the same environment. Valid range: + 0-10. Zero means use the default (5). + """ + mcp_disabled: Annotated[Optional[bool], PropertyInfo(alias="mcpDisabled")] """ mcp_disabled controls whether MCP (Model Context Protocol) is disabled for diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index 1b8d7f72..56814db9 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -69,6 +69,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: agent_policy={ "command_deny_list": ["string"], "conversation_sharing_policy": "CONVERSATION_SHARING_POLICY_UNSPECIFIED", + "max_subagents_per_environment": 10, "mcp_disabled": True, "scm_tools_allowed_group_id": "scmToolsAllowedGroupId", "scm_tools_disabled": True, @@ -187,6 +188,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> agent_policy={ "command_deny_list": ["string"], "conversation_sharing_policy": "CONVERSATION_SHARING_POLICY_UNSPECIFIED", + "max_subagents_per_environment": 10, "mcp_disabled": True, "scm_tools_allowed_group_id": "scmToolsAllowedGroupId", "scm_tools_disabled": True, From fd4a2a4d2ca4a2bc7ddd13be6cfa2ae477e17307 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 11:30:26 +0000 Subject: [PATCH 474/505] feat(api): add terminal field to RunsOn --- .stats.yml | 6 +++--- src/gitpod/types/shared/runs_on.py | 6 ++++++ src/gitpod/types/shared_params/runs_on.py | 6 ++++++ .../api_resources/environments/automations/test_services.py | 4 ++++ tests/api_resources/environments/automations/test_tasks.py | 4 ++++ tests/api_resources/environments/test_automations.py | 4 ++++ 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1088d16a..d5a496e4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ed3a1c285331386ba5056502d899a2e4659e9e738e9c126bee45fc101ca1e146.yml -openapi_spec_hash: 367ebe7e572da1892a3eaae9344cfcba -config_hash: 7a2cbe5967b1eef12830d2a23fc32c83 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a43265810afa7f7c50a08fec12012d5109ecad109105f5c6cf4205f9114ad5fc.yml +openapi_spec_hash: 44434ed0762787b31c9ecec5f670fae5 +config_hash: 63777babba88b7fa1dbf28164294eaed diff --git a/src/gitpod/types/shared/runs_on.py b/src/gitpod/types/shared/runs_on.py index 33cf1bd5..5f26ef47 100644 --- a/src/gitpod/types/shared/runs_on.py +++ b/src/gitpod/types/shared/runs_on.py @@ -18,3 +18,9 @@ class RunsOn(BaseModel): machine: Optional[object] = None """Machine runs the service/task directly on the VM/machine level.""" + + terminal: Optional[object] = None + """ + Terminal runs the service inside a managed PTY terminal in the devcontainer. + Users can attach to the terminal interactively via the terminal API. + """ diff --git a/src/gitpod/types/shared_params/runs_on.py b/src/gitpod/types/shared_params/runs_on.py index 8fc0fd3c..0182710a 100644 --- a/src/gitpod/types/shared_params/runs_on.py +++ b/src/gitpod/types/shared_params/runs_on.py @@ -20,3 +20,9 @@ class RunsOn(TypedDict, total=False): machine: object """Machine runs the service/task directly on the VM/machine level.""" + + terminal: object + """ + Terminal runs the service inside a managed PTY terminal in the devcontainer. + Users can attach to the terminal interactively via the terminal API. + """ diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 3d1ccf73..3a80cc01 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -75,6 +75,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, + "terminal": {}, }, "session": "session", "spec_version": "specVersion", @@ -187,6 +188,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, + "terminal": {}, }, }, status={ @@ -435,6 +437,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, + "terminal": {}, }, "session": "session", "spec_version": "specVersion", @@ -547,6 +550,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, + "terminal": {}, }, }, status={ diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 242dc25e..29599ec1 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -71,6 +71,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, + "terminal": {}, }, }, ) @@ -177,6 +178,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, + "terminal": {}, }, }, ) @@ -375,6 +377,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, + "terminal": {}, }, }, ) @@ -481,6 +484,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, + "terminal": {}, }, }, ) diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 15f3fe3a..bed1aa5a 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -44,6 +44,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, + "terminal": {}, }, "triggered_by": ["postDevcontainerStart"], } @@ -60,6 +61,7 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, + "terminal": {}, }, "triggered_by": ["postEnvironmentStart"], } @@ -124,6 +126,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, + "terminal": {}, }, "triggered_by": ["postDevcontainerStart"], } @@ -140,6 +143,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, + "terminal": {}, }, "triggered_by": ["postEnvironmentStart"], } From c82b56bf9757e6d11cb2e54031e22ab11ef49bc8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 15:04:35 +0000 Subject: [PATCH 475/505] chore(internal): regenerate SDK with no functional changes --- .stats.yml | 6 +-- src/gitpod/resources/groups/groups.py | 50 ++++++++++++++++++----- src/gitpod/types/group_list_params.py | 17 ++++++++ src/gitpod/types/group_retrieve_params.py | 7 ++++ tests/api_resources/test_groups.py | 22 ++++++++-- 5 files changed, 85 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index d5a496e4..d0f6e1c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a43265810afa7f7c50a08fec12012d5109ecad109105f5c6cf4205f9114ad5fc.yml -openapi_spec_hash: 44434ed0762787b31c9ecec5f670fae5 -config_hash: 63777babba88b7fa1dbf28164294eaed +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2414772123f92b697fd3e4c661c0719539aa93dd7fcd50dad734b279fec80ced.yml +openapi_spec_hash: 44556e215acc58a53f8f18abd00ad4a7 +config_hash: 8934bf27653a3fd17f4e3d6a0f8cc7b8 diff --git a/src/gitpod/resources/groups/groups.py b/src/gitpod/resources/groups/groups.py index f32fe099..e3dc31fc 100644 --- a/src/gitpod/resources/groups/groups.py +++ b/src/gitpod/resources/groups/groups.py @@ -153,7 +153,9 @@ def create( def retrieve( self, *, + id: str | Omit = omit, group_id: str | Omit = omit, + name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -162,7 +164,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GroupRetrieveResponse: """ - Gets information about a specific group. + Gets information about a specific group by ID or name. Use this method to: @@ -172,12 +174,12 @@ def retrieve( ### Examples - - Get group details: + - Get group by ID: - Retrieves information about a specific group. + Retrieves information about a specific group by its unique ID. ```yaml - groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Authorization @@ -185,6 +187,12 @@ def retrieve( All organization members can view group information (transparency model). Args: + id: id looks up the group by its unique ID. + + group_id: Deprecated: use the group oneof instead. + + name: name looks up the group by its name within the caller's organization. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -195,7 +203,14 @@ def retrieve( """ return self._post( "/gitpod.v1.GroupService/GetGroup", - body=maybe_transform({"group_id": group_id}, group_retrieve_params.GroupRetrieveParams), + body=maybe_transform( + { + "id": id, + "group_id": group_id, + "name": name, + }, + group_retrieve_params.GroupRetrieveParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -506,7 +521,9 @@ async def create( async def retrieve( self, *, + id: str | Omit = omit, group_id: str | Omit = omit, + name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -515,7 +532,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GroupRetrieveResponse: """ - Gets information about a specific group. + Gets information about a specific group by ID or name. Use this method to: @@ -525,12 +542,12 @@ async def retrieve( ### Examples - - Get group details: + - Get group by ID: - Retrieves information about a specific group. + Retrieves information about a specific group by its unique ID. ```yaml - groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Authorization @@ -538,6 +555,12 @@ async def retrieve( All organization members can view group information (transparency model). Args: + id: id looks up the group by its unique ID. + + group_id: Deprecated: use the group oneof instead. + + name: name looks up the group by its name within the caller's organization. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -548,7 +571,14 @@ async def retrieve( """ return await self._post( "/gitpod.v1.GroupService/GetGroup", - body=await async_maybe_transform({"group_id": group_id}, group_retrieve_params.GroupRetrieveParams), + body=await async_maybe_transform( + { + "id": id, + "group_id": group_id, + "name": name, + }, + group_retrieve_params.GroupRetrieveParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/gitpod/types/group_list_params.py b/src/gitpod/types/group_list_params.py index 55450c32..0a7668ba 100644 --- a/src/gitpod/types/group_list_params.py +++ b/src/gitpod/types/group_list_params.py @@ -2,8 +2,10 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["GroupListParams", "Filter", "Pagination"] @@ -24,9 +26,24 @@ class GroupListParams(TypedDict, total=False): class Filter(TypedDict, total=False): """filter contains options for filtering the list of groups.""" + direct_share: Annotated[Optional[bool], PropertyInfo(alias="directShare")] + """ + direct_share filters groups by their direct_share flag. When set, only groups + matching this value are returned. + """ + + group_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="groupIds")] + """group_ids filters the response to only groups with the specified IDs""" + search: str """search performs case-insensitive search across group name, description, and ID""" + system_managed: Annotated[Optional[bool], PropertyInfo(alias="systemManaged")] + """ + system_managed filters groups by their system_managed flag. When set, only + groups matching this value are returned. + """ + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing groups""" diff --git a/src/gitpod/types/group_retrieve_params.py b/src/gitpod/types/group_retrieve_params.py index 0e039801..effd42b8 100644 --- a/src/gitpod/types/group_retrieve_params.py +++ b/src/gitpod/types/group_retrieve_params.py @@ -10,4 +10,11 @@ class GroupRetrieveParams(TypedDict, total=False): + id: str + """id looks up the group by its unique ID.""" + group_id: Annotated[str, PropertyInfo(alias="groupId")] + """Deprecated: use the group oneof instead.""" + + name: str + """name looks up the group by its name within the caller's organization.""" diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index 9e478183..82a93c26 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -71,7 +71,9 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: group = client.groups.retrieve( - group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + group_id="groupId", + name="xxx", ) assert_matches_type(GroupRetrieveResponse, group, path=["response"]) @@ -147,7 +149,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: group = client.groups.list( token="token", page_size=0, - filter={"search": "search"}, + filter={ + "direct_share": True, + "group_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "search": "search", + "system_managed": True, + }, pagination={ "token": "token", "page_size": 20, @@ -267,7 +274,9 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: group = await async_client.groups.retrieve( - group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + group_id="groupId", + name="xxx", ) assert_matches_type(GroupRetrieveResponse, group, path=["response"]) @@ -343,7 +352,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N group = await async_client.groups.list( token="token", page_size=0, - filter={"search": "search"}, + filter={ + "direct_share": True, + "group_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "search": "search", + "system_managed": True, + }, pagination={ "token": "token", "page_size": 20, From 9436fac7752f82a72356ace3eea5ca24b80a9829 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 19:20:45 +0000 Subject: [PATCH 476/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index d0f6e1c7..fd1d45ea 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2414772123f92b697fd3e4c661c0719539aa93dd7fcd50dad734b279fec80ced.yml -openapi_spec_hash: 44556e215acc58a53f8f18abd00ad4a7 -config_hash: 8934bf27653a3fd17f4e3d6a0f8cc7b8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-91befc5e43ed71fca019a53c01de7aeb7c83d7f062deaecdf664d90ae91fbadc.yml +openapi_spec_hash: fd9566a74a031e79106728e79c6d6591 +config_hash: ced51a017429d0c5ea7712b9cf28430d From f09bbd7d1f8b6f2df2b1c0d86c1ac3983644aad5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 21:39:15 +0000 Subject: [PATCH 477/505] feat(api): add custom security agents to organizations policies --- .stats.yml | 6 +++--- api.md | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index fd1d45ea..074927a1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-91befc5e43ed71fca019a53c01de7aeb7c83d7f062deaecdf664d90ae91fbadc.yml -openapi_spec_hash: fd9566a74a031e79106728e79c6d6591 -config_hash: ced51a017429d0c5ea7712b9cf28430d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-9ac5c8d650ab1874d96d115ab908743dac63f83f5e2cf4b46b6343abd3aec57a.yml +openapi_spec_hash: 017f9c3b551aca91196f2c2333032e6d +config_hash: ff8b5dec4d7afdd9b88a136ac6e71e0e diff --git a/api.md b/api.md index aff845d3..dbd40b76 100644 --- a/api.md +++ b/api.md @@ -502,6 +502,8 @@ from gitpod.types.organizations import ( AgentPolicy, ConversationSharingPolicy, CrowdStrikeConfig, + CustomAgentEnvMapping, + CustomSecurityAgent, KernelControlsAction, OrganizationPolicies, SecurityAgentPolicy, From 37e297b723309e2af7c1d115a1052bb671a33fa2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 28 Mar 2026 07:24:46 +0000 Subject: [PATCH 478/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 074927a1..e2670b0f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-9ac5c8d650ab1874d96d115ab908743dac63f83f5e2cf4b46b6343abd3aec57a.yml -openapi_spec_hash: 017f9c3b551aca91196f2c2333032e6d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d7f0f4a63fbad7214c33bb22f1ea3dd188513fab77747ec06254320f7c75c523.yml +openapi_spec_hash: 76946f9da9287bfcc0a4da1dc33b312f config_hash: ff8b5dec4d7afdd9b88a136ac6e71e0e From 480636709e89f34ca0e57a3b45a34c1dfcfec319 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 10:06:36 +0000 Subject: [PATCH 479/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index e2670b0f..e981e190 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d7f0f4a63fbad7214c33bb22f1ea3dd188513fab77747ec06254320f7c75c523.yml -openapi_spec_hash: 76946f9da9287bfcc0a4da1dc33b312f -config_hash: ff8b5dec4d7afdd9b88a136ac6e71e0e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-78e7f700a9e175f54dceb305eeaa99080ba0fe2ff97085a69da414cce0fed656.yml +openapi_spec_hash: 115ea7b9ce81b3d4c8d18ac237088480 +config_hash: 832c76d9cd88fc815f872ad64998911a From 5977336a8ae738ca970632632401c5bb0e4f063d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:18:08 +0000 Subject: [PATCH 480/505] feat(api): add exclude_team_ids parameter to organization list members --- .stats.yml | 4 ++-- src/gitpod/types/organization_list_members_params.py | 6 ++++++ tests/api_resources/test_organizations.py | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e981e190..5076de37 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-78e7f700a9e175f54dceb305eeaa99080ba0fe2ff97085a69da414cce0fed656.yml -openapi_spec_hash: 115ea7b9ce81b3d4c8d18ac237088480 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7a4f235379c078f7947364104260063f605613df775ccb0fe8d3710810589bc5.yml +openapi_spec_hash: 2afba992f3e6ed516002fb391d54d7b4 config_hash: 832c76d9cd88fc815f872ad64998911a diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index 2b4f7714..a196d6f7 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -44,6 +44,12 @@ class Filter(TypedDict, total=False): groups """ + exclude_members_in_any_team: Annotated[bool, PropertyInfo(alias="excludeMembersInAnyTeam")] + """ + exclude_members_in_any_team excludes members who belong to any team in the + organization + """ + roles: List[OrganizationRole] """roles filters members by their organization role""" diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index 18299d24..b486e803 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -268,6 +268,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "exclude_group_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "exclude_members_in_any_team": True, "roles": ["ORGANIZATION_ROLE_UNSPECIFIED"], "search": "search", "statuses": ["USER_STATUS_UNSPECIFIED"], @@ -607,6 +608,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp page_size=0, filter={ "exclude_group_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "exclude_members_in_any_team": True, "roles": ["ORGANIZATION_ROLE_UNSPECIFIED"], "search": "search", "statuses": ["USER_STATUS_UNSPECIFIED"], From 36b81d1a9a1181ec96f40b0d0ab0179fb3b0798e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 17:04:34 +0000 Subject: [PATCH 481/505] feat(backend/api,dashboard): add server-side `recentlyCompleted` sort for `ListWorkflows` --- .stats.yml | 4 ++-- src/gitpod/resources/automations.py | 20 ++++++++++++++++---- src/gitpod/types/automation_list_params.py | 21 ++++++++++++++++++++- tests/api_resources/test_automations.py | 8 ++++++++ 4 files changed, 46 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5076de37..e19c3214 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7a4f235379c078f7947364104260063f605613df775ccb0fe8d3710810589bc5.yml -openapi_spec_hash: 2afba992f3e6ed516002fb391d54d7b4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-eb4b27e6f97d8a8ebb2a75f24367f74153abb7d3a7c16c9110fc0af1be6ed8c9.yml +openapi_spec_hash: e1a8fd3ecf7c9ca8b7639857f56defc2 config_hash: 832c76d9cd88fc815f872ad64998911a diff --git a/src/gitpod/resources/automations.py b/src/gitpod/resources/automations.py index 616bc89d..4ba90bf3 100644 --- a/src/gitpod/resources/automations.py +++ b/src/gitpod/resources/automations.py @@ -345,6 +345,7 @@ def list( page_size: int | Omit = omit, filter: automation_list_params.Filter | Omit = omit, pagination: automation_list_params.Pagination | Omit = omit, + sort: automation_list_params.Sort | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -352,10 +353,14 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncWorkflowsPage[Workflow]: - """ - ListWorkflows + """ListWorkflows Args: + sort: sort specifies the order of results. + + When unspecified, results are sorted + alphabetically by name ascending. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -371,6 +376,7 @@ def list( { "filter": filter, "pagination": pagination, + "sort": sort, }, automation_list_params.AutomationListParams, ), @@ -1238,6 +1244,7 @@ def list( page_size: int | Omit = omit, filter: automation_list_params.Filter | Omit = omit, pagination: automation_list_params.Pagination | Omit = omit, + sort: automation_list_params.Sort | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1245,10 +1252,14 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Workflow, AsyncWorkflowsPage[Workflow]]: - """ - ListWorkflows + """ListWorkflows Args: + sort: sort specifies the order of results. + + When unspecified, results are sorted + alphabetically by name ascending. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1264,6 +1275,7 @@ def list( { "filter": filter, "pagination": pagination, + "sort": sort, }, automation_list_params.AutomationListParams, ), diff --git a/src/gitpod/types/automation_list_params.py b/src/gitpod/types/automation_list_params.py index 7cd91a58..286b4a5a 100644 --- a/src/gitpod/types/automation_list_params.py +++ b/src/gitpod/types/automation_list_params.py @@ -8,8 +8,9 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo +from .shared.sort_order import SortOrder -__all__ = ["AutomationListParams", "Filter", "Pagination"] +__all__ = ["AutomationListParams", "Filter", "Pagination", "Sort"] class AutomationListParams(TypedDict, total=False): @@ -21,6 +22,12 @@ class AutomationListParams(TypedDict, total=False): pagination: Pagination + sort: Sort + """sort specifies the order of results. + + When unspecified, results are sorted alphabetically by name ascending. + """ + class Filter(TypedDict, total=False): creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] @@ -79,3 +86,15 @@ class Pagination(TypedDict, total=False): Maximum 100. """ + + +class Sort(TypedDict, total=False): + """sort specifies the order of results. + + When unspecified, results are sorted + alphabetically by name ascending. + """ + + field: Literal["SORT_FIELD_UNSPECIFIED", "SORT_FIELD_NAME", "SORT_FIELD_RECENTLY_COMPLETED"] + + order: SortOrder diff --git a/tests/api_resources/test_automations.py b/tests/api_resources/test_automations.py index 0f99b05f..d427c4e5 100644 --- a/tests/api_resources/test_automations.py +++ b/tests/api_resources/test_automations.py @@ -393,6 +393,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "token": "token", "page_size": 100, }, + sort={ + "field": "SORT_FIELD_UNSPECIFIED", + "order": "SORT_ORDER_UNSPECIFIED", + }, ) assert_matches_type(SyncWorkflowsPage[Workflow], automation, path=["response"]) @@ -1152,6 +1156,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "token": "token", "page_size": 100, }, + sort={ + "field": "SORT_FIELD_UNSPECIFIED", + "order": "SORT_ORDER_UNSPECIFIED", + }, ) assert_matches_type(AsyncWorkflowsPage[Workflow], automation, path=["response"]) From 281195940d8d9b45e4a36cf20e61b75dea3a7e74 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 17:54:02 +0000 Subject: [PATCH 482/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e19c3214..5df81ccd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-eb4b27e6f97d8a8ebb2a75f24367f74153abb7d3a7c16c9110fc0af1be6ed8c9.yml -openapi_spec_hash: e1a8fd3ecf7c9ca8b7639857f56defc2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1de1f598d14617efe8f8a2034e5eb7bbdc802c6a51585aa90800c45c51097d1d.yml +openapi_spec_hash: 6404715e9e40c26063077beb5fde7f2a config_hash: 832c76d9cd88fc815f872ad64998911a From 9aa0c92121df833325f7be602172212b71fc894a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 18:57:01 +0000 Subject: [PATCH 483/505] feat(api): add claims_expression parameter to sso_configurations create and update --- .stats.yml | 4 +-- .../organizations/sso_configurations.py | 26 +++++++++++++++++++ .../types/organizations/sso_configuration.py | 9 +++++++ .../sso_configuration_create_params.py | 8 ++++++ .../sso_configuration_update_params.py | 7 +++++ .../organizations/test_sso_configurations.py | 4 +++ 6 files changed, 56 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5df81ccd..9d09258f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1de1f598d14617efe8f8a2034e5eb7bbdc802c6a51585aa90800c45c51097d1d.yml -openapi_spec_hash: 6404715e9e40c26063077beb5fde7f2a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-86397010ee4d38791a16758fd0668c48c3c6c0c552e0aca553e78250eb452f97.yml +openapi_spec_hash: 32003ebf118835677522e0d0166b8200 config_hash: 832c76d9cd88fc815f872ad64998911a diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index a6b0056b..20bd9b3f 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -63,6 +63,7 @@ def create( issuer_url: str, organization_id: str, additional_scopes: SequenceNotStr[str] | Omit = omit, + claims_expression: Optional[str] | Omit = omit, display_name: str | Omit = omit, email_domain: Optional[str] | Omit = omit, email_domains: SequenceNotStr[str] | Omit = omit, @@ -120,6 +121,11 @@ def create( during sign-in. These are appended to the default scopes (openid, email, profile). + claims_expression: claims_expression is an optional CEL expression evaluated against OIDC token + claims during login. When set, the expression must evaluate to true for the + login to succeed. Example: + `claims.email_verified && claims.email.endsWith("@example.com")` + email_domain: email_domain is the domain that is allowed to sign in to the organization extra_headers: Send extra headers @@ -139,6 +145,7 @@ def create( "issuer_url": issuer_url, "organization_id": organization_id, "additional_scopes": additional_scopes, + "claims_expression": claims_expression, "display_name": display_name, "email_domain": email_domain, "email_domains": email_domains, @@ -210,6 +217,7 @@ def update( sso_configuration_id: str, additional_scopes: Optional[AdditionalScopesUpdateParam] | Omit = omit, claims: Dict[str, str] | Omit = omit, + claims_expression: Optional[str] | Omit = omit, client_id: Optional[str] | Omit = omit, client_secret: Optional[str] | Omit = omit, display_name: Optional[str] | Omit = omit, @@ -265,6 +273,10 @@ def update( claims: claims are key/value pairs that defines a mapping of claims issued by the IdP. + claims_expression: claims_expression is a CEL expression evaluated against OIDC token claims during + login. When set, the expression must evaluate to true for the login to succeed. + When present with an empty string, the expression is cleared. + client_id: client_id is the client ID of the SSO provider client_secret: client_secret is the client secret of the SSO provider @@ -288,6 +300,7 @@ def update( "sso_configuration_id": sso_configuration_id, "additional_scopes": additional_scopes, "claims": claims, + "claims_expression": claims_expression, "client_id": client_id, "client_secret": client_secret, "display_name": display_name, @@ -469,6 +482,7 @@ async def create( issuer_url: str, organization_id: str, additional_scopes: SequenceNotStr[str] | Omit = omit, + claims_expression: Optional[str] | Omit = omit, display_name: str | Omit = omit, email_domain: Optional[str] | Omit = omit, email_domains: SequenceNotStr[str] | Omit = omit, @@ -526,6 +540,11 @@ async def create( during sign-in. These are appended to the default scopes (openid, email, profile). + claims_expression: claims_expression is an optional CEL expression evaluated against OIDC token + claims during login. When set, the expression must evaluate to true for the + login to succeed. Example: + `claims.email_verified && claims.email.endsWith("@example.com")` + email_domain: email_domain is the domain that is allowed to sign in to the organization extra_headers: Send extra headers @@ -545,6 +564,7 @@ async def create( "issuer_url": issuer_url, "organization_id": organization_id, "additional_scopes": additional_scopes, + "claims_expression": claims_expression, "display_name": display_name, "email_domain": email_domain, "email_domains": email_domains, @@ -616,6 +636,7 @@ async def update( sso_configuration_id: str, additional_scopes: Optional[AdditionalScopesUpdateParam] | Omit = omit, claims: Dict[str, str] | Omit = omit, + claims_expression: Optional[str] | Omit = omit, client_id: Optional[str] | Omit = omit, client_secret: Optional[str] | Omit = omit, display_name: Optional[str] | Omit = omit, @@ -671,6 +692,10 @@ async def update( claims: claims are key/value pairs that defines a mapping of claims issued by the IdP. + claims_expression: claims_expression is a CEL expression evaluated against OIDC token claims during + login. When set, the expression must evaluate to true for the login to succeed. + When present with an empty string, the expression is cleared. + client_id: client_id is the client ID of the SSO provider client_secret: client_secret is the client secret of the SSO provider @@ -694,6 +719,7 @@ async def update( "sso_configuration_id": sso_configuration_id, "additional_scopes": additional_scopes, "claims": claims, + "claims_expression": claims_expression, "client_id": client_id, "client_secret": client_secret, "display_name": display_name, diff --git a/src/gitpod/types/organizations/sso_configuration.py b/src/gitpod/types/organizations/sso_configuration.py index f5dd4db4..f0499553 100644 --- a/src/gitpod/types/organizations/sso_configuration.py +++ b/src/gitpod/types/organizations/sso_configuration.py @@ -35,6 +35,15 @@ class SSOConfiguration(BaseModel): claims: Optional[Dict[str, str]] = None """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" + claims_expression: Optional[str] = FieldInfo(alias="claimsExpression", default=None) + """ + claims_expression is a CEL (Common Expression Language) expression evaluated + against the OIDC token claims during login. When set, the expression must + evaluate to true for the login to succeed. The expression has access to a + `claims` variable containing all token claims as a map. Example: + `claims.email_verified && claims.email.endsWith("@example.com")` + """ + client_id: Optional[str] = FieldInfo(alias="clientId", default=None) """client_id is the client ID of the OIDC application set on the IdP""" diff --git a/src/gitpod/types/organizations/sso_configuration_create_params.py b/src/gitpod/types/organizations/sso_configuration_create_params.py index 16ffadb1..9a44d22b 100644 --- a/src/gitpod/types/organizations/sso_configuration_create_params.py +++ b/src/gitpod/types/organizations/sso_configuration_create_params.py @@ -30,6 +30,14 @@ class SSOConfigurationCreateParams(TypedDict, total=False): profile). """ + claims_expression: Annotated[Optional[str], PropertyInfo(alias="claimsExpression")] + """ + claims_expression is an optional CEL expression evaluated against OIDC token + claims during login. When set, the expression must evaluate to true for the + login to succeed. Example: + `claims.email_verified && claims.email.endsWith("@example.com")` + """ + display_name: Annotated[str, PropertyInfo(alias="displayName")] email_domain: Annotated[Optional[str], PropertyInfo(alias="emailDomain")] diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py index 7f85387e..121b0c74 100644 --- a/src/gitpod/types/organizations/sso_configuration_update_params.py +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -27,6 +27,13 @@ class SSOConfigurationUpdateParams(TypedDict, total=False): claims: Dict[str, str] """claims are key/value pairs that defines a mapping of claims issued by the IdP.""" + claims_expression: Annotated[Optional[str], PropertyInfo(alias="claimsExpression")] + """ + claims_expression is a CEL expression evaluated against OIDC token claims during + login. When set, the expression must evaluate to true for the login to succeed. + When present with an empty string, the expression is cleared. + """ + client_id: Annotated[Optional[str], PropertyInfo(alias="clientId")] """client_id is the client ID of the SSO provider""" diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 7c52f6f9..62413479 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -42,6 +42,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", additional_scopes=["x"], + claims_expression="claimsExpression", display_name="displayName", email_domain="acme-corp.com", email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], @@ -129,6 +130,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", additional_scopes={"scopes": ["x"]}, claims={"foo": "string"}, + claims_expression="claimsExpression", client_id="new-client-id", client_secret="new-client-secret", display_name="displayName", @@ -273,6 +275,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", additional_scopes=["x"], + claims_expression="claimsExpression", display_name="displayName", email_domain="acme-corp.com", email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], @@ -360,6 +363,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> sso_configuration_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", additional_scopes={"scopes": ["x"]}, claims={"foo": "string"}, + claims_expression="claimsExpression", client_id="new-client-id", client_secret="new-client-secret", display_name="displayName", From 86cac57363cefcd654774c7e18dd41949a958136 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 09:29:52 +0000 Subject: [PATCH 484/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d09258f..357427bf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-86397010ee4d38791a16758fd0668c48c3c6c0c552e0aca553e78250eb452f97.yml -openapi_spec_hash: 32003ebf118835677522e0d0166b8200 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ce2f3371515758ff78c958ff5ea8a32ae1917607858fb006ef25407fb03458a2.yml +openapi_spec_hash: 280252e283aa8b1ff998d211e92fbbd6 config_hash: 832c76d9cd88fc815f872ad64998911a From 204f48b63a36739d4fe65000497bddf3458a7049 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 09:40:25 +0000 Subject: [PATCH 485/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 357427bf..7b8d2b3e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ce2f3371515758ff78c958ff5ea8a32ae1917607858fb006ef25407fb03458a2.yml -openapi_spec_hash: 280252e283aa8b1ff998d211e92fbbd6 -config_hash: 832c76d9cd88fc815f872ad64998911a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ea44e431a3c4c7e117c70d54c64500e3b8f8bed99c4ef21c1445f2b2b82a2926.yml +openapi_spec_hash: b01753a713087df30734d8793c830666 +config_hash: 8ddb47f7aae7ba0d746096f40a010873 From ed5c2977f7bf27ed49f5f94d80e2d407c3ccd27a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 20:05:35 +0000 Subject: [PATCH 486/505] feat(api): add notification resource type --- .stats.yml | 6 +++--- src/gitpod/types/shared/resource_type.py | 1 + src/gitpod/types/shared_params/resource_type.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7b8d2b3e..39cfbb04 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ea44e431a3c4c7e117c70d54c64500e3b8f8bed99c4ef21c1445f2b2b82a2926.yml -openapi_spec_hash: b01753a713087df30734d8793c830666 -config_hash: 8ddb47f7aae7ba0d746096f40a010873 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e8866ae81b8afaf96e76b281290be1485af1674c03262cfd43cd0f5b2851c775.yml +openapi_spec_hash: a157c52535f5028047eea5d0d7750af2 +config_hash: 60242c6ae6fc727bce872753690be6fd diff --git a/src/gitpod/types/shared/resource_type.py b/src/gitpod/types/shared/resource_type.py index 0f7f7567..0debaeda 100644 --- a/src/gitpod/types/shared/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -54,4 +54,5 @@ "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN", "RESOURCE_TYPE_ROLE_ASSIGNMENT", "RESOURCE_TYPE_WARM_POOL", + "RESOURCE_TYPE_NOTIFICATION", ] diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py index 4928c237..27b68eae 100644 --- a/src/gitpod/types/shared_params/resource_type.py +++ b/src/gitpod/types/shared_params/resource_type.py @@ -56,4 +56,5 @@ "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN", "RESOURCE_TYPE_ROLE_ASSIGNMENT", "RESOURCE_TYPE_WARM_POOL", + "RESOURCE_TYPE_NOTIFICATION", ] From 57f61996a97c8118b686e1d3a18a1fd3bb4046be Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 00:35:39 +0000 Subject: [PATCH 487/505] feat(api): add environment field to WakeEventParam --- .stats.yml | 4 ++-- src/gitpod/types/wake_event_param.py | 14 +++++++++++++- tests/api_resources/test_agents.py | 10 ++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 39cfbb04..c958eff6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e8866ae81b8afaf96e76b281290be1485af1674c03262cfd43cd0f5b2851c775.yml -openapi_spec_hash: a157c52535f5028047eea5d0d7750af2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cade77d00e2ea53642be459df51982a608717dc6a15fdf5c6403a52571e7709b.yml +openapi_spec_hash: 88a0edaa03c6a9ae7eed84333977bfe2 config_hash: 60242c6ae6fc727bce872753690be6fd diff --git a/src/gitpod/types/wake_event_param.py b/src/gitpod/types/wake_event_param.py index 533c4303..0a53c300 100644 --- a/src/gitpod/types/wake_event_param.py +++ b/src/gitpod/types/wake_event_param.py @@ -6,9 +6,19 @@ from datetime import datetime from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo -__all__ = ["WakeEventParam", "LoopRetrigger", "LoopRetriggerUnmetCondition", "Timer"] +__all__ = ["WakeEventParam", "Environment", "LoopRetrigger", "LoopRetriggerUnmetCondition", "Timer"] + + +class Environment(TypedDict, total=False): + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + + failure_message: Annotated[SequenceNotStr[str], PropertyInfo(alias="failureMessage")] + + phase: str + """The phase the environment reached (e.g. "running", "stopped", "deleted").""" class LoopRetriggerUnmetCondition(TypedDict, total=False): @@ -42,6 +52,8 @@ class WakeEventParam(TypedDict, total=False): Delivered via SendToAgentExecution as a new oneof variant. """ + environment: Environment + interest_id: Annotated[str, PropertyInfo(alias="interestId")] """The interest ID that fired (from WaitingInfo.Interest.id).""" diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 8d9faefc..0a7b1ed7 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -385,6 +385,11 @@ def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: "text": {"content": "Generate a report based on the latest logs."}, }, wake_event={ + "environment": { + "environment_id": "environmentId", + "failure_message": ["string"], + "phase": "phase", + }, "interest_id": "interestId", "loop_retrigger": { "outputs": {"foo": "string"}, @@ -938,6 +943,11 @@ async def test_method_send_to_execution_with_all_params(self, async_client: Asyn "text": {"content": "Generate a report based on the latest logs."}, }, wake_event={ + "environment": { + "environment_id": "environmentId", + "failure_message": ["string"], + "phase": "phase", + }, "interest_id": "interestId", "loop_retrigger": { "outputs": {"foo": "string"}, From eb825ca20ae7b967602b6aae6852c75128da1bfe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 08:55:17 +0000 Subject: [PATCH 488/505] feat(api): add disabled parameter to automations update method --- .stats.yml | 6 +++--- src/gitpod/resources/automations.py | 10 ++++++++++ src/gitpod/types/automation_update_params.py | 7 +++++++ tests/api_resources/test_automations.py | 2 ++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index c958eff6..3d7a16d6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cade77d00e2ea53642be459df51982a608717dc6a15fdf5c6403a52571e7709b.yml -openapi_spec_hash: 88a0edaa03c6a9ae7eed84333977bfe2 -config_hash: 60242c6ae6fc727bce872753690be6fd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7b0c078bf03d89222865a5c11f0371cade6476f5348102f3ada80e453a44fc3a.yml +openapi_spec_hash: 88d52b6f3750a4015a926dcb909633fb +config_hash: 69ebf8df948a14a1809ba846a1ec4527 diff --git a/src/gitpod/resources/automations.py b/src/gitpod/resources/automations.py index 4ba90bf3..2cbece8b 100644 --- a/src/gitpod/resources/automations.py +++ b/src/gitpod/resources/automations.py @@ -216,6 +216,7 @@ def update( *, action: Optional[WorkflowActionParam] | Omit = omit, description: Optional[str] | Omit = omit, + disabled: Optional[bool] | Omit = omit, executor: Optional[Subject] | Omit = omit, name: Optional[str] | Omit = omit, report: Optional[WorkflowActionParam] | Omit = omit, @@ -294,6 +295,9 @@ def update( size(this) <= 500 ``` + disabled: When set, enables or disables the workflow. A disabled workflow will not be + triggered by any automatic trigger and manual starts are rejected. + name: Name must be between 1 and 80 characters: @@ -324,6 +328,7 @@ def update( { "action": action, "description": description, + "disabled": disabled, "executor": executor, "name": name, "report": report, @@ -1115,6 +1120,7 @@ async def update( *, action: Optional[WorkflowActionParam] | Omit = omit, description: Optional[str] | Omit = omit, + disabled: Optional[bool] | Omit = omit, executor: Optional[Subject] | Omit = omit, name: Optional[str] | Omit = omit, report: Optional[WorkflowActionParam] | Omit = omit, @@ -1193,6 +1199,9 @@ async def update( size(this) <= 500 ``` + disabled: When set, enables or disables the workflow. A disabled workflow will not be + triggered by any automatic trigger and manual starts are rejected. + name: Name must be between 1 and 80 characters: @@ -1223,6 +1232,7 @@ async def update( { "action": action, "description": description, + "disabled": disabled, "executor": executor, "name": name, "report": report, diff --git a/src/gitpod/types/automation_update_params.py b/src/gitpod/types/automation_update_params.py index 175e84a6..cae3bafb 100644 --- a/src/gitpod/types/automation_update_params.py +++ b/src/gitpod/types/automation_update_params.py @@ -25,6 +25,13 @@ class AutomationUpdateParams(TypedDict, total=False): ``` """ + disabled: Optional[bool] + """When set, enables or disables the workflow. + + A disabled workflow will not be triggered by any automatic trigger and manual + starts are rejected. + """ + executor: Optional[Subject] name: Optional[str] diff --git a/tests/api_resources/test_automations.py b/tests/api_resources/test_automations.py index d427c4e5..bf1fec1e 100644 --- a/tests/api_resources/test_automations.py +++ b/tests/api_resources/test_automations.py @@ -276,6 +276,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ], }, description="description", + disabled=True, executor={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", @@ -1039,6 +1040,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ], }, description="description", + disabled=True, executor={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", From 015b85ebf6cc6c7807cf3743dcc0722291c7b47a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 11:55:06 +0000 Subject: [PATCH 489/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3d7a16d6..a2a58a27 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7b0c078bf03d89222865a5c11f0371cade6476f5348102f3ada80e453a44fc3a.yml -openapi_spec_hash: 88d52b6f3750a4015a926dcb909633fb -config_hash: 69ebf8df948a14a1809ba846a1ec4527 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d00798f187c6cb34b901902a128fe022e059636f48442f7d67f547129453748a.yml +openapi_spec_hash: 3996bd43fef56b6b95fbd9258c05334b +config_hash: b968e68acc589109eb718eb46fb0d318 From efb466e4fb8ffa000c19cfdc059e14c390870345 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 12:31:37 +0000 Subject: [PATCH 490/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a2a58a27..21b6f562 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d00798f187c6cb34b901902a128fe022e059636f48442f7d67f547129453748a.yml -openapi_spec_hash: 3996bd43fef56b6b95fbd9258c05334b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-27eff498d6315a771ef8fe98e8a88caa18b93725144a0f8210b640310b6e9a04.yml +openapi_spec_hash: cb6006c99f55d32062452679bff81804 config_hash: b968e68acc589109eb718eb46fb0d318 From a3caba20067e534f31f859885d62c42a74269207 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:02:11 +0000 Subject: [PATCH 491/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 21b6f562..c9dde5fb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-27eff498d6315a771ef8fe98e8a88caa18b93725144a0f8210b640310b6e9a04.yml -openapi_spec_hash: cb6006c99f55d32062452679bff81804 -config_hash: b968e68acc589109eb718eb46fb0d318 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c8dc62d99f936361a1ff3cbc5dec754b1b48dd568ad37b62090232ea83560b4a.yml +openapi_spec_hash: 5ae0b46445867cadb4877a1b48eaad16 +config_hash: f365b422a530c390d99a7c25b5ecb55e From 34eedc8472ce3ee803f072ac7e649540320e0892 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 22:01:40 +0000 Subject: [PATCH 492/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index c9dde5fb..25923365 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c8dc62d99f936361a1ff3cbc5dec754b1b48dd568ad37b62090232ea83560b4a.yml -openapi_spec_hash: 5ae0b46445867cadb4877a1b48eaad16 -config_hash: f365b422a530c390d99a7c25b5ecb55e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fc2984e57ba2bcc93187fcc9c36258aba7d012f4ae43420e3b70aa680ca30cab.yml +openapi_spec_hash: e47cd10806a5915c4625eda64a9ad922 +config_hash: 4637c1b33f226f70f8ca473ed4107db4 From 6e0a5d5409698bf9cbb01655eb989b31b8f1a5af Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 06:35:16 +0000 Subject: [PATCH 493/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 25923365..db720b5a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-fc2984e57ba2bcc93187fcc9c36258aba7d012f4ae43420e3b70aa680ca30cab.yml -openapi_spec_hash: e47cd10806a5915c4625eda64a9ad922 -config_hash: 4637c1b33f226f70f8ca473ed4107db4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-235a20f33e6a93f83aad57a77eb9eaed59a523b3d6afbedb5852250bec86eef2.yml +openapi_spec_hash: db65d3acea1fbfe83a5b7928c98f4388 +config_hash: 7a80f85305907b2a848ff25e67d15751 From 27db1837ff5c2c115463c708f2067630efebd668 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 08:22:25 +0000 Subject: [PATCH 494/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index db720b5a..09bd832a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-235a20f33e6a93f83aad57a77eb9eaed59a523b3d6afbedb5852250bec86eef2.yml -openapi_spec_hash: db65d3acea1fbfe83a5b7928c98f4388 -config_hash: 7a80f85305907b2a848ff25e67d15751 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e7cce8d6a7d5ddda39e669751171309ecb804f0862d953b8aeb83513f9b8656b.yml +openapi_spec_hash: a6b984d708637d861525638e3ad462f1 +config_hash: 8a3d3a3914768fc140e372e60d93ec17 From 641836b6fa29e4d83a7db35bace462970c8eefe3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 08:28:23 +0000 Subject: [PATCH 495/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 09bd832a..82c3873e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e7cce8d6a7d5ddda39e669751171309ecb804f0862d953b8aeb83513f9b8656b.yml -openapi_spec_hash: a6b984d708637d861525638e3ad462f1 -config_hash: 8a3d3a3914768fc140e372e60d93ec17 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dabc0ff98cd7b9d91850b3c0dbada4e487e698333cd0b7257959e4819d9a29d6.yml +openapi_spec_hash: b974bdc6025a26cfa62857bf74ec379b +config_hash: 13514c5eb422e4eb01767e718798de1e From fd1b9b0b84482bc96a29cede38e6bcf1daec915f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 22:13:48 +0000 Subject: [PATCH 496/505] feat(api): add Report boolean/float/integer/string schema types --- .stats.yml | 6 +- src/gitpod/types/workflow_step.py | 20 +-- src/gitpod/types/workflow_step_param.py | 19 +-- tests/api_resources/test_automations.py | 168 ------------------------ 4 files changed, 6 insertions(+), 207 deletions(-) diff --git a/.stats.yml b/.stats.yml index 82c3873e..e93723a0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dabc0ff98cd7b9d91850b3c0dbada4e487e698333cd0b7257959e4819d9a29d6.yml -openapi_spec_hash: b974bdc6025a26cfa62857bf74ec379b -config_hash: 13514c5eb422e4eb01767e718798de1e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3dcdbd68ce4b336149d28d17ab08f211538ed6630112ae4883af2f6680643159.yml +openapi_spec_hash: 7e4333995b65cf32663166801e2444bb +config_hash: 8d7b241284195a8c51f5d670fbbe0ab4 diff --git a/src/gitpod/types/workflow_step.py b/src/gitpod/types/workflow_step.py index c1871e0e..a3f53aad 100644 --- a/src/gitpod/types/workflow_step.py +++ b/src/gitpod/types/workflow_step.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["WorkflowStep", "Agent", "PullRequest", "Report", "ReportOutput", "Task"] +__all__ = ["WorkflowStep", "Agent", "PullRequest", "Task"] class Agent(BaseModel): @@ -51,20 +51,6 @@ class PullRequest(BaseModel): """ -class ReportOutput: - pass - - -class Report(BaseModel): - outputs: Optional[List[ReportOutput]] = None - """Report must have at least one output: - - ``` - size(this) >= 1 - ``` - """ - - class Task(BaseModel): """WorkflowTaskStep represents a task step that executes a command.""" @@ -86,7 +72,5 @@ class WorkflowStep(BaseModel): pull_request: Optional[PullRequest] = FieldInfo(alias="pullRequest", default=None) """WorkflowPullRequestStep represents a pull request creation step.""" - report: Optional[Report] = None - task: Optional[Task] = None """WorkflowTaskStep represents a task step that executes a command.""" diff --git a/src/gitpod/types/workflow_step_param.py b/src/gitpod/types/workflow_step_param.py index 35365d5b..6e3d7344 100644 --- a/src/gitpod/types/workflow_step_param.py +++ b/src/gitpod/types/workflow_step_param.py @@ -2,12 +2,11 @@ from __future__ import annotations -from typing import Iterable from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["WorkflowStepParam", "Agent", "PullRequest", "Report", "ReportOutput", "Task"] +__all__ = ["WorkflowStepParam", "Agent", "PullRequest", "Task"] class Agent(TypedDict, total=False): @@ -52,20 +51,6 @@ class PullRequest(TypedDict, total=False): """ -class ReportOutput(total=False): - pass - - -class Report(TypedDict, total=False): - outputs: Iterable[ReportOutput] - """Report must have at least one output: - - ``` - size(this) >= 1 - ``` - """ - - class Task(TypedDict, total=False): """WorkflowTaskStep represents a task step that executes a command.""" @@ -87,7 +72,5 @@ class WorkflowStepParam(TypedDict, total=False): pull_request: Annotated[PullRequest, PropertyInfo(alias="pullRequest")] """WorkflowPullRequestStep represents a pull request creation step.""" - report: Report - task: Task """WorkflowTaskStep represents a task step that executes a command.""" diff --git a/tests/api_resources/test_automations.py b/tests/api_resources/test_automations.py index bf1fec1e..f1412921 100644 --- a/tests/api_resources/test_automations.py +++ b/tests/api_resources/test_automations.py @@ -66,27 +66,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "draft": True, "title": "title", }, - "report": { - "outputs": [ - { - "acceptance_criteria": "acceptanceCriteria", - "boolean": {}, - "command": "command", - "float": { - "max": 0, - "min": 0, - }, - "integer": { - "max": 0, - "min": 0, - }, - "key": "key", - "prompt": "prompt", - "string": {"pattern": "pattern"}, - "title": "title", - } - ] - }, "task": {"command": "command"}, } ], @@ -112,27 +91,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "draft": True, "title": "title", }, - "report": { - "outputs": [ - { - "acceptance_criteria": "acceptanceCriteria", - "boolean": {}, - "command": "command", - "float": { - "max": 0, - "min": 0, - }, - "integer": { - "max": 0, - "min": 0, - }, - "key": "key", - "prompt": "prompt", - "string": {"pattern": "pattern"}, - "title": "title", - } - ] - }, "task": {"command": "command"}, } ], @@ -250,27 +208,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "draft": True, "title": "title", }, - "report": { - "outputs": [ - { - "acceptance_criteria": "acceptanceCriteria", - "boolean": {}, - "command": "command", - "float": { - "max": 0, - "min": 0, - }, - "integer": { - "max": 0, - "min": 0, - }, - "key": "key", - "prompt": "prompt", - "string": {"pattern": "pattern"}, - "title": "title", - } - ] - }, "task": {"command": "command"}, } ], @@ -297,27 +234,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "draft": True, "title": "title", }, - "report": { - "outputs": [ - { - "acceptance_criteria": "acceptanceCriteria", - "boolean": {}, - "command": "command", - "float": { - "max": 0, - "min": 0, - }, - "integer": { - "max": 0, - "min": 0, - }, - "key": "key", - "prompt": "prompt", - "string": {"pattern": "pattern"}, - "title": "title", - } - ] - }, "task": {"command": "command"}, } ], @@ -830,27 +746,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "draft": True, "title": "title", }, - "report": { - "outputs": [ - { - "acceptance_criteria": "acceptanceCriteria", - "boolean": {}, - "command": "command", - "float": { - "max": 0, - "min": 0, - }, - "integer": { - "max": 0, - "min": 0, - }, - "key": "key", - "prompt": "prompt", - "string": {"pattern": "pattern"}, - "title": "title", - } - ] - }, "task": {"command": "command"}, } ], @@ -876,27 +771,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "draft": True, "title": "title", }, - "report": { - "outputs": [ - { - "acceptance_criteria": "acceptanceCriteria", - "boolean": {}, - "command": "command", - "float": { - "max": 0, - "min": 0, - }, - "integer": { - "max": 0, - "min": 0, - }, - "key": "key", - "prompt": "prompt", - "string": {"pattern": "pattern"}, - "title": "title", - } - ] - }, "task": {"command": "command"}, } ], @@ -1014,27 +888,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "draft": True, "title": "title", }, - "report": { - "outputs": [ - { - "acceptance_criteria": "acceptanceCriteria", - "boolean": {}, - "command": "command", - "float": { - "max": 0, - "min": 0, - }, - "integer": { - "max": 0, - "min": 0, - }, - "key": "key", - "prompt": "prompt", - "string": {"pattern": "pattern"}, - "title": "title", - } - ] - }, "task": {"command": "command"}, } ], @@ -1061,27 +914,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "draft": True, "title": "title", }, - "report": { - "outputs": [ - { - "acceptance_criteria": "acceptanceCriteria", - "boolean": {}, - "command": "command", - "float": { - "max": 0, - "min": 0, - }, - "integer": { - "max": 0, - "min": 0, - }, - "key": "key", - "prompt": "prompt", - "string": {"pattern": "pattern"}, - "title": "title", - } - ] - }, "task": {"command": "command"}, } ], From 411e77914dfc4a05ea473348f026076526047c9b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 22:25:57 +0000 Subject: [PATCH 497/505] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 091cfb12..f7014c35 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.10.0" + ".": "0.11.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 91c86d31..20052b53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.10.0" +version = "0.11.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index dec0e423..7504df3f 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.10.0" # x-release-please-version +__version__ = "0.11.0" # x-release-please-version From 757a303db4e1762bf9d20ba8ce20fa7b0dfe0c92 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 01:11:12 +0000 Subject: [PATCH 498/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e93723a0..ab885989 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3dcdbd68ce4b336149d28d17ab08f211538ed6630112ae4883af2f6680643159.yml -openapi_spec_hash: 7e4333995b65cf32663166801e2444bb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1122bbd6558bb1ce02f8dfc967697900cd32a18ef62481537f4f5a6ad5932260.yml +openapi_spec_hash: e5a3f1cb78e8eac5e0d4ac0bdb2c73a6 config_hash: 8d7b241284195a8c51f5d670fbbe0ab4 From 046842da40a7db7551a1d9ebcb365220d4b4573a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 23:48:29 +0000 Subject: [PATCH 499/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ab885989..f39bf498 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1122bbd6558bb1ce02f8dfc967697900cd32a18ef62481537f4f5a6ad5932260.yml -openapi_spec_hash: e5a3f1cb78e8eac5e0d4ac0bdb2c73a6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bb01d257acff1b3c58a570307eff6c618f2eb1c2740a8149736c644341504031.yml +openapi_spec_hash: f1a73aad352f34b1162560eb00ce2abe config_hash: 8d7b241284195a8c51f5d670fbbe0ab4 From cd3578cdf55d83ca350d6c4ac41eac68c6da1457 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 10:19:10 +0000 Subject: [PATCH 500/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index f39bf498..d93c13eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bb01d257acff1b3c58a570307eff6c618f2eb1c2740a8149736c644341504031.yml -openapi_spec_hash: f1a73aad352f34b1162560eb00ce2abe -config_hash: 8d7b241284195a8c51f5d670fbbe0ab4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ee5c1f5d47838a4ee7e114173d3b37b65abc3b3714615a0b9f06c16e3bbea076.yml +openapi_spec_hash: 4c08bb9223c4537e9bdc985a7937ad07 +config_hash: 6d27da09c9efc26556069dbefd693a37 From 666cb3a3c8a534197aae30a99e1638941bc11536 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 16:12:08 +0000 Subject: [PATCH 501/505] fix(client): preserve hardcoded query params when merging with user params --- src/gitpod/_base_client.py | 4 ++++ tests/test_client.py | 48 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index cc7f8af2..a9da58f9 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -540,6 +540,10 @@ def _build_request( files = cast(HttpxRequestFiles, ForceMultipartDict()) prepared_url = self._prepare_url(options.url) + # preserve hard-coded query params from the url + if params and prepared_url.query: + params = {**dict(prepared_url.params.items()), **params} + prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0]) if "_" in prepared_url.host: # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} diff --git a/tests/test_client.py b/tests/test_client.py index 92b0eea3..c105b4d9 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -438,6 +438,30 @@ def test_default_query_option(self) -> None: client.close() + def test_hardcoded_query_params_in_url(self, client: Gitpod) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: Gitpod) -> None: request = client._build_request( FinalRequestOptions( @@ -1363,6 +1387,30 @@ async def test_default_query_option(self) -> None: await client.close() + async def test_hardcoded_query_params_in_url(self, async_client: AsyncGitpod) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: Gitpod) -> None: request = client._build_request( FinalRequestOptions( From 501cfbb695ccc12c07e4fa3c1a011d9bdf0300d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 20:38:37 +0000 Subject: [PATCH 502/505] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index d93c13eb..5284245e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ee5c1f5d47838a4ee7e114173d3b37b65abc3b3714615a0b9f06c16e3bbea076.yml -openapi_spec_hash: 4c08bb9223c4537e9bdc985a7937ad07 -config_hash: 6d27da09c9efc26556069dbefd693a37 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7366f3114f6f2fae72e3141480d2b2a67094d37391b5a068210e69ead83045f2.yml +openapi_spec_hash: aa2198d5846e9e12e09c823f64b65dca +config_hash: 843d5f356bfb6295862722a8d71d08e0 From 9bf0a1cd8fe336fe2dcf7aba288451ef5947d14a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 11:54:00 +0000 Subject: [PATCH 503/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5284245e..a75e53d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7366f3114f6f2fae72e3141480d2b2a67094d37391b5a068210e69ead83045f2.yml -openapi_spec_hash: aa2198d5846e9e12e09c823f64b65dca +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-35cd7fa73c7adecfbdc71193bb6d59e34a427dae598401575870571ec220cd70.yml +openapi_spec_hash: 65118e845e2ad858c647c58016355820 config_hash: 843d5f356bfb6295862722a8d71d08e0 From c7907ca3b7c64642add2c1cc507f1afe408378d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 16:18:08 +0000 Subject: [PATCH 504/505] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a75e53d1..0e153d52 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-35cd7fa73c7adecfbdc71193bb6d59e34a427dae598401575870571ec220cd70.yml -openapi_spec_hash: 65118e845e2ad858c647c58016355820 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-9b7fd2030480921db661aeb8eb6c454e8b53accf4bddecc66e740383ab7ad074.yml +openapi_spec_hash: deb597c2dbac0fddcdd136aae19aba44 config_hash: 843d5f356bfb6295862722a8d71d08e0 From 5f1787b91d9e0ed6767aad20043b3e6452b10684 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 16:22:17 +0000 Subject: [PATCH 505/505] feat(api): remove terminal field from RunsOn type --- .stats.yml | 4 ++-- src/gitpod/types/shared/runs_on.py | 6 ------ src/gitpod/types/shared_params/runs_on.py | 6 ------ .../api_resources/environments/automations/test_services.py | 4 ---- tests/api_resources/environments/automations/test_tasks.py | 4 ---- tests/api_resources/environments/test_automations.py | 4 ---- 6 files changed, 2 insertions(+), 26 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0e153d52..45335695 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-9b7fd2030480921db661aeb8eb6c454e8b53accf4bddecc66e740383ab7ad074.yml -openapi_spec_hash: deb597c2dbac0fddcdd136aae19aba44 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ffc8cf0ed565636356f70cba5521094ee367d0b30bacb266a70f4ea98889c74c.yml +openapi_spec_hash: bf1abc17445dd410c3c3f8607c5a4937 config_hash: 843d5f356bfb6295862722a8d71d08e0 diff --git a/src/gitpod/types/shared/runs_on.py b/src/gitpod/types/shared/runs_on.py index 5f26ef47..33cf1bd5 100644 --- a/src/gitpod/types/shared/runs_on.py +++ b/src/gitpod/types/shared/runs_on.py @@ -18,9 +18,3 @@ class RunsOn(BaseModel): machine: Optional[object] = None """Machine runs the service/task directly on the VM/machine level.""" - - terminal: Optional[object] = None - """ - Terminal runs the service inside a managed PTY terminal in the devcontainer. - Users can attach to the terminal interactively via the terminal API. - """ diff --git a/src/gitpod/types/shared_params/runs_on.py b/src/gitpod/types/shared_params/runs_on.py index 0182710a..8fc0fd3c 100644 --- a/src/gitpod/types/shared_params/runs_on.py +++ b/src/gitpod/types/shared_params/runs_on.py @@ -20,9 +20,3 @@ class RunsOn(TypedDict, total=False): machine: object """Machine runs the service/task directly on the VM/machine level.""" - - terminal: object - """ - Terminal runs the service inside a managed PTY terminal in the devcontainer. - Users can attach to the terminal interactively via the terminal API. - """ diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index 3a80cc01..3d1ccf73 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -75,7 +75,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, - "terminal": {}, }, "session": "session", "spec_version": "specVersion", @@ -188,7 +187,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, - "terminal": {}, }, }, status={ @@ -437,7 +435,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, - "terminal": {}, }, "session": "session", "spec_version": "specVersion", @@ -550,7 +547,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, - "terminal": {}, }, }, status={ diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 29599ec1..242dc25e 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -71,7 +71,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, - "terminal": {}, }, }, ) @@ -178,7 +177,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, - "terminal": {}, }, }, ) @@ -377,7 +375,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, - "terminal": {}, }, }, ) @@ -484,7 +481,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, - "terminal": {}, }, }, ) diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index bed1aa5a..15f3fe3a 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -44,7 +44,6 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, - "terminal": {}, }, "triggered_by": ["postDevcontainerStart"], } @@ -61,7 +60,6 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "image": "x", }, "machine": {}, - "terminal": {}, }, "triggered_by": ["postEnvironmentStart"], } @@ -126,7 +124,6 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, - "terminal": {}, }, "triggered_by": ["postDevcontainerStart"], } @@ -143,7 +140,6 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "image": "x", }, "machine": {}, - "terminal": {}, }, "triggered_by": ["postEnvironmentStart"], }